blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c8fc7449ee2a8acf1a0eb204ba4c4006f47e66cf | db8be521b8e2eab424f594a50886275d68dd5a1b | /Competitive Programming/codechef/JUN13/TKCONVEX.cpp | eb68a8b5c56c92b2b769a3fb7735f87676c8487d | [] | no_license | purnimamehta/Articles-n-Algorithms | 7f2aa8046c8eef0e510689771a493f84707e9297 | aaea50bf1627585b935f8e43465360866b3b4eac | refs/heads/master | 2021-01-11T01:01:53.382696 | 2017-01-15T04:12:44 | 2017-01-15T04:12:44 | 70,463,305 | 10 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 995 | cpp | #include<iostream>
#include<algorithm>
using namespace std;
pair<long long,int> a[2000];
int main()
{
int n,k;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>a[i].first;
a[i].second=i+1;
}
sort(a,a+n);
bool ans[2000]={false};
for(int i=0;i<=n-k;i++)
{
long long sum=0;
for(int j=i;j<i+(k-1);j++)
sum=sum+a[j].first;
if(sum>a[i+k-1].first)
ans[i]=true;
}
bool ispossible=false;
int firstpos=-1;
int secondpos=-1;
for(int i=0;i+2*k-1<n;i++)
{
//cout<<endl<<"for "<<i;//cin.get();
if(ans[i])
{
// cout<<i<<endl;
for(int j=i+k;j<n;j++)
{
//cout<<"checking for "<<j<<"got "<<ans[j]<<endl;
if(ans[j]==true)
{
ispossible=true;
firstpos=i;
secondpos=j;
break;
}
}
}
if(ispossible) break;
}
if(!ispossible)
cout<<"No";
else
{
cout<<"Yes"<<endl;
for(int i=firstpos;i<firstpos+k;i++)
cout<<a[i].second<<" ";
for(int i=secondpos;i<secondpos+k;i++)
cout<<a[i].second<<" ";
}
}
| [
"me@lefeeza.com"
] | me@lefeeza.com |
171987c5ef19b00053dfc85dfef7cd0b43a88ed0 | 3da6556ca4cde0d7c78ebd826fa4f67a00baf16e | /Source/Dynamics/b2Island.cpp | 3e0be2495df1ec844b7f59be80ca0c4dc9d1a184 | [
"Zlib"
] | permissive | Rinnegatamante/Box2D | 4320edf8404ef54f0a1391f018cf65d0f9e98f12 | e4e218f5ec0d5e8fab5d6a8f54079066e8dc0a16 | refs/heads/master | 2021-01-22T06:03:14.116068 | 2020-09-04T20:11:20 | 2020-09-04T20:11:20 | 92,520,660 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 9,618 | cpp | /*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#include "b2Island.h"
#include "b2Body.h"
#include "b2World.h"
#include "Contacts/b2Contact.h"
#include "Contacts/b2ContactSolver.h"
#include "Joints/b2Joint.h"
#include "../Common/b2StackAllocator.h"
/*
Position Correction Notes
=========================
I tried the several algorithms for position correction of the 2D revolute joint.
I looked at these systems:
- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s.
- suspension bridge with 30 1m long planks of length 1m.
- multi-link chain with 30 1m long links.
Here are the algorithms:
Baumgarte - A fraction of the position error is added to the velocity error. There is no
separate position solver.
Pseudo Velocities - After the velocity solver and position integration,
the position error, Jacobian, and effective mass are recomputed. Then
the velocity constraints are solved with pseudo velocities and a fraction
of the position error is added to the pseudo velocity error. The pseudo
velocities are initialized to zero and there is no warm-starting. After
the position solver, the pseudo velocities are added to the positions.
This is also called the First Order World method or the Position LCP method.
Modified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the
position error is re-computed for each constraint and the positions are updated
after the constraint is solved. The radius vectors (aka Jacobians) are
re-computed too (otherwise the algorithm has horrible instability). The pseudo
velocity states are not needed because they are effectively zero at the beginning
of each iteration. Since we have the current position error, we allow the
iterations to terminate early if the error becomes smaller than b2_linearSlop.
Full NGS or just NGS - Like Modified NGS except the effective mass are re-computed
each time a constraint is solved.
Here are the results:
Baumgarte - this is the cheapest algorithm but it has some stability problems,
especially with the bridge. The chain links separate easily close to the root
and they jitter as they struggle to pull together. This is one of the most common
methods in the field. The big drawback is that the position correction artificially
affects the momentum, thus leading to instabilities and false bounce. I used a
bias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller
factor makes joints and contacts more spongy.
Pseudo Velocities - the is more stable than the Baumgarte method. The bridge is
stable. However, joints still separate with large angular velocities. Drag the
simple pendulum in a circle quickly and the joint will separate. The chain separates
easily and does not recover. I used a bias factor of 0.2. A larger value lead to
the bridge collapsing when a heavy cube drops on it.
Modified NGS - this algorithm is better in some ways than Baumgarte and Pseudo
Velocities, but in other ways it is worse. The bridge and chain are much more
stable, but the simple pendulum goes unstable at high angular velocities.
Full NGS - stable in all tests. The joints display good stiffness. The bridge
still sags, but this is better than infinite forces.
Recommendations
Pseudo Velocities are not really worthwhile because the bridge and chain cannot
recover from joint separation. In other cases the benefit over Baumgarte is small.
Modified NGS is not a robust method for the revolute joint due to the violent
instability seen in the simple pendulum. Perhaps it is viable with other constraint
types, especially scalar constraints where the effective mass is a scalar.
This leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities
and is very fast. I don't think we can escape Baumgarte, especially in highly
demanding cases where high constraint fidelity is not needed.
Full NGS is robust and easy on the eyes. I recommend this as an option for
higher fidelity simulation and certainly for suspension bridges and long chains.
Full NGS might be a good choice for ragdolls, especially motorized ragdolls where
joint separation can be problematic. The number of NGS iterations can be reduced
for better performance without harming robustness much.
Each joint in a can be handled differently in the position solver. So I recommend
a system where the user can select the algorithm on a per joint basis. I would
probably default to the slower Full NGS and let the user select the faster
Baumgarte method in performance critical scenarios.
*/
b2Island::b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, b2StackAllocator* allocator)
{
m_bodyCapacity = bodyCapacity;
m_contactCapacity = contactCapacity;
m_jointCapacity = jointCapacity;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_bodies = (b2Body**)allocator->Allocate(bodyCapacity * sizeof(b2Body*));
m_contacts = (b2Contact**)allocator->Allocate(contactCapacity * sizeof(b2Contact*));
m_joints = (b2Joint**)allocator->Allocate(jointCapacity * sizeof(b2Joint*));
m_allocator = allocator;
m_positionIterationCount = 0;
}
b2Island::~b2Island()
{
// Warning: the order should reverse the constructor order.
m_allocator->Free(m_joints);
m_allocator->Free(m_contacts);
m_allocator->Free(m_bodies);
}
void b2Island::Clear()
{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
void b2Island::Integrate(const b2TimeStep& step, const b2Vec2& gravity)
{
// Integrate velocities and apply damping.
for (int32 i = 0; i < m_bodyCount; ++i)
{
b2Body* b = m_bodies[i];
if (b->IsStatic())
continue;
// Integrate velocities.
b->m_linearVelocity += step.dt * (gravity + b->m_invMass * b->m_force);
b->m_angularVelocity += step.dt * b->m_invI * b->m_torque;
// Reset forces.
b->m_force.Set(0.0f, 0.0f);
b->m_torque = 0.0f;
// Apply damping.
b->m_linearVelocity *= b->m_linearDamping;
b->m_angularVelocity *= b->m_angularDamping;
}
b2ContactSolver contactSolver(m_contacts, m_contactCount, m_allocator);
// Initialize velocity constraints.
contactSolver.InitVelocityConstraints();
for (int32 i = 0; i < m_jointCount; ++i)
{
m_joints[i]->InitVelocityConstraints();
}
// Solve velocity constraints.
for (int32 i = 0; i < step.iterations; ++i)
{
contactSolver.SolveVelocityConstraints();
for (int32 j = 0; j < m_jointCount; ++j)
{
m_joints[j]->SolveVelocityConstraints(step);
}
}
// Post-solve (store impulses for warm starting).
contactSolver.FinalizeVelocityConstraints();
// Integrate positions, synchronize shapes, and reset forces.
for (int32 i = 0; i < m_bodyCount; ++i)
{
b2Body* b = m_bodies[i];
if (b->IsStatic())
continue;
// Store positions for continuous collision.
b->m_position0 = b->m_position;
b->m_rotation0 = b->m_rotation;
// Integrate
b->m_position += step.dt * b->m_linearVelocity;
b->m_rotation += step.dt * b->m_angularVelocity;
b->m_R.Set(b->m_rotation);
// Update shapes (for broad-phase).
b->SynchronizeShapes();
}
}
void b2Island::SolvePositionConstraints(const b2TimeStep& step)
{
b2ContactSolver contactSolver(m_contacts, m_contactCount, m_allocator);
// Initialize position constraints
contactSolver.InitPositionConstraints();
for (int32 i = 0; i < m_jointCount; ++i)
{
m_joints[i]->InitPositionConstraints();
}
// Solve position constraints.
for (m_positionIterationCount = 0; m_positionIterationCount < step.iterations; ++m_positionIterationCount)
{
bool contactsOkay = contactSolver.SolvePositionConstraints();
bool jointsOkay = true;
for (int i = 0; i < m_jointCount; ++i)
{
bool jointOkay = m_joints[i]->SolvePositionConstraints();
jointsOkay = jointsOkay && jointOkay;
}
if (contactsOkay && jointsOkay)
{
break;
}
}
}
void b2Island::UpdateSleep(const b2TimeStep& step)
{
float32 minSleepTime = FLT_MAX;
const float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance;
const float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance;
for (int32 i = 0; i < m_bodyCount; ++i)
{
b2Body* b = m_bodies[i];
if (b->m_invMass == 0.0f)
{
continue;
}
if ((b->m_flags & b2Body::e_allowSleepFlag) == 0)
{
b->m_sleepTime = 0.0f;
minSleepTime = 0.0f;
}
if ((b->m_flags & b2Body::e_allowSleepFlag) == 0 ||
b->m_angularVelocity * b->m_angularVelocity > angTolSqr ||
b2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr)
{
b->m_sleepTime = 0.0f;
minSleepTime = 0.0f;
}
else
{
b->m_sleepTime += step.dt;
minSleepTime = b2Min(minSleepTime, b->m_sleepTime);
}
}
if (minSleepTime >= b2_timeToSleep)
{
for (int32 i = 0; i < m_bodyCount; ++i)
{
b2Body* b = m_bodies[i];
b->m_flags |= b2Body::e_sleepFlag;
}
}
}
| [
"rinnegatamante@gmail.com"
] | rinnegatamante@gmail.com |
ca0c431f43c99cf8482f5299d593f3f44f7e6683 | e48c6ed286669dab8471c653c001c5d91bbf59e0 | /lecture15/mid point of linklist.cpp | 04f43881b531dfe388ca329cd5e617ce22ee1537 | [] | no_license | bdugersuren/Launchpad | 55565e9e039385b4ce2ed39718a7f1c1a9a9e643 | e93f32d200917b10568a2bd8dbc3b73c72bb6ee0 | refs/heads/master | 2023-04-14T17:44:37.766974 | 2021-05-03T15:55:04 | 2021-05-03T15:55:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,040 | cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node* next;
node()
{ }
node(int data)
{
this->data=data;
this->next=NULL;
}
};
void createlinklist(node** head)
{
int data;
cout<<"enter data and -1 to exit"<<endl;
cin>>data;
if(data!=-1)
{
*head=new node(data);
}
node* it=*head;
cin>>data;
while(data!=-1)
{
node* temp=new node(data);
it->next=temp;
it=it->next;
cin>>data;
}
return;
}
void print(node* head)
{
while(head)
{
cout<<head->data<<"-->";
head=head->next;
}
cout<<"NULL"<<endl;
return;
}
node* midpoint(node* head)
{
node* it1=head;
node* it2=head;
while(it2->next!=NULL && it2->next->next!=NULL)
{
it1=it1->next;
it2=it2->next->next;
}
return it1;
}
int main()
{
node* head=0;
createlinklist(&head);
print(head);
cout<<"midpoint is"<<endl;
cout<<midpoint(head)->data;
return 0;
}
| [
"ishaansharma1998@gmail.com"
] | ishaansharma1998@gmail.com |
94ff019b25a4081f64bbefb2fd5e687b16b08ff6 | 76e38ddd84488cb5d924c11c71c58cc22387f848 | /sources/common/operator_space.cpp | 3f9a90c4de0481a8de5fb0920cd178f3fb05caad | [] | no_license | gcross/CodeSearch | ad15e90d8555daf609aca835268000d536b2fb6c | 0d37cac0db2de2208c2a795a41fa03869a594a18 | refs/heads/master | 2016-09-06T07:38:46.459329 | 2011-02-25T04:43:55 | 2011-02-25T04:43:55 | 1,201,678 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,012 | cpp | //@+leo-ver=5-thin
//@+node:gcross.20101224191604.1867: * @thin operator_space.cpp
//@@language cplusplus
//@+<< Includes >>
//@+node:gcross.20101224191604.1868: ** << Includes >>
#include "operator_space.hpp"
//@-<< Includes >>
namespace CodeSearch {
//@+<< Usings >>
//@+node:gcross.20101224191604.1873: ** << Usings >>
using namespace Gecode;
using namespace boost;
using namespace std;
//@-<< Usings >>
//@+others
//@+node:gcross.20101224191604.1869: ** class OperatorSpace
//@+node:gcross.20101224191604.1870: *3* (constructors)
OperatorSpace::OperatorSpace(const unsigned int number_of_qubits, const unsigned int number_of_operators)
: number_of_operators(number_of_operators)
, number_of_qubits(number_of_qubits)
, number_of_variables(number_of_qubits*number_of_operators)
, X(*this,number_of_variables,0,1)
, Z(*this,number_of_variables,0,1)
, non_trivial(*this,number_of_variables,0,1)
, O(*this,number_of_variables,0,3)
, weights(*this,number_of_operators,0,number_of_qubits)
{
BOOST_FOREACH(unsigned int i, irange(0u,number_of_variables)) {
O[i] = expr(*this,2*Z[i] + X[i]);
non_trivial[i] = expr(*this,Z[i] || X[i]);
}
BoolMatrix non_trivial_matrix = getNonTrivialMatrix();
BOOST_FOREACH(unsigned int i, irange(0u,number_of_operators)) {
linear(*this,non_trivial_matrix.row(i),IRT_EQ,weights[i]);
}
branch(*this,O,INT_VAR_NONE,INT_VAL_MIN);
}
OperatorSpace::OperatorSpace(const bool share, OperatorSpace& s)
: Space(share,s)
, number_of_operators(s.number_of_operators)
, number_of_qubits(s.number_of_qubits)
, number_of_variables(s.number_of_variables)
{
X.update(*this,share,s.X);
Z.update(*this,share,s.Z);
non_trivial.update(*this,share,s.non_trivial);
O.update(*this,share,s.O);
weights.update(*this,share,s.weights);
}
//@+node:gcross.20101224191604.1871: *3* copy
Space* OperatorSpace::copy(bool share)
{
return new OperatorSpace(share,*this);
}
//@-others
}
//@-leo
| [
"gcross@phys.washington.edu"
] | gcross@phys.washington.edu |
dd2ae450bb521ca17857817bde5e525ed2ec9bd2 | 0512131605a5ad8541c498b9d36f9e4a9ef0809e | /src/player.h | e91e3c7a80c12cfdd07da7df42f5c9a1c7f32b9d | [] | no_license | hebrewd/MarioSDL | fa4e3cb2d5643d288d7dbb1383da6452545d4bc8 | 7d8db458f6fef4969c8514a5a88f1fc096907633 | refs/heads/master | 2022-05-17T09:59:53.565410 | 2022-04-20T22:52:08 | 2022-04-20T22:52:08 | 101,674,546 | 0 | 2 | null | 2022-04-20T22:19:10 | 2017-08-28T18:29:58 | C++ | UTF-8 | C++ | false | false | 469 | h | #include <SDL2/SDL.h>
#include "gameobject.h"
#include "block.h"
class player : public gameobject
{
public:
enum status {stand_still, move_left, move_right, mid_air};
player(void);
void move(void);
void set_status(player::status);
void jump(void);
void set_falling(bool);
bool on_block(block);
void set_running(bool);
int speed;
bool hit_block(block);
private:
status cstat;
int grav;
bool falling;
bool running;
bool can_move;
};
| [
"bennydarshan@gmail.com"
] | bennydarshan@gmail.com |
953d689965178075970243a576dd912395b60f0b | c5a6a853f8d72998c05c9599ced48fbf932d6cbe | /src/core/Screen.h | 735ae9e1e659787be25e0add3aa412fca2477e47 | [] | no_license | cid26/cheali-charger | aa99405ea8f2b5aaed8256abf0e5497726482208 | eb0c3804ca4dbabf8f2ccfc12e15293ff018cdfa | refs/heads/master | 2021-01-17T22:40:36.065603 | 2013-02-15T18:42:53 | 2013-02-15T18:42:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,792 | h | /*
cheali-charger - open source firmware for a variety of LiPo chargers
Copyright (C) 2013 Paweł Stawicki. All right reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCREEN_H_
#define SCREEN_H_
#include <inttypes.h>
#include "Program.h"
#include "Blink.h"
class Screen : public Blink {
public:
uint16_t charge_;
uint32_t startTime_totalTime_;
uint32_t totalBalanceTime_;
uint32_t totalChargDischargeTime_;
bool on_;
uint16_t getTimeSec() const;
void doSlowInterrupt();
static AnalogInputs::ValueType getI();
void powerOn();
void powerOff();
Screen() {};
enum ScreenViewType { Normal, Debug=0x80};
enum ScreenType {
ScreenStartInfo,
ScreenFirst, ScreenCIVlimits, ScreenTime, ScreenTemperature,
ScreenBalancer1_3, ScreenBalancer4_6,
ScreenBalancer1_3Rth, ScreenBalancer4_6Rth,
ScreenDeltaFirst,
ScreenR,
ScreenVout,
ScreenVinput,
ScreenDeltaVout,
ScreenDeltaTextern,
//Debug screens
ScreenDebugRthVth = Debug,
ScreenDebugI,
ScreenDebugDelta,
ScreenDebugBalancer1_3M, ScreenDebugBalancer4_6M,
ScreenDebugBalancer1_3RthV, ScreenDebugBalancer4_6RthV,
ScreenDebugBalancer1_3RthI, ScreenDebugBalancer4_6RthI,
};
void display(ScreenType screen);
void displayScreenFirst();
void displayScreenCIVlimits();
void displayScreenTime();
void displayScreenTemperature();
void displayScreenR();
void displayScreenVout();
void displayScreenVinput();
void displayDeltaVout();
void displayDeltaTextern();
void displayDeltaFirst();
void displayScreenProgramCompleted();
void displayDebugRthVth();
void displayDebugI();
void displayDebugDelta();
void displayMonitorError();
void displayStartInfo();
void printCharge();
void printChar_Time();
static void displayStrings(const char *s1, const char *s2);
static void displayNotImplemented();
static void displayScreenReversedPolarity();
static void runNotImplemented();
};
extern Screen screen;
#endif /* SCREEN_H_ */
| [
"stawel+chealiCharger@gmail.com"
] | stawel+chealiCharger@gmail.com |
45950bdeb49cc2d8e9c4f3e160e1413f06379e0c | 50457fc28800b3cf2f25e06478f33981a1a626dc | /Codeforces/707B.cpp | 2eac51a7f98f0e38547069aa0bc6add3e20c2b28 | [] | no_license | h-sinha/CP-codes | 5b1ef5021b7fd180b518270ffdb12997dc8d367b | 937174c73d1c80114de4535a6908122158366ad4 | refs/heads/master | 2021-07-20T18:47:00.500294 | 2021-07-06T05:11:57 | 2021-07-06T05:11:57 | 159,954,721 | 2 | 2 | null | 2020-01-07T18:57:28 | 2018-12-01T14:51:44 | C++ | UTF-8 | C++ | false | false | 614 | cpp | #include<bits/stdc++.h>
using namespace std;
std::map<int,int> counter;
int main()
{
int n,m,k;
cin>>n>>m>>k;
std::vector<int> a(m+1);
std::vector<int> b(m+1);
std::vector<int> wt(m+1);
for (int i = 1; i <=m; i++)
cin>>a[i]>>b[i]>>wt[i];
if(k==0)
{
cout<<"-1";
return 0;
}
int num;
for (int i = 0; i <k; i++)
{
cin>>num;
counter[num]++;
}
int minimum=INT_MAX;
for (int i = 1; i <=m; i++)
{
if((counter[a[i]]!=0 && counter[b[i]]==0) ||(counter[b[i]]!=0 && counter[a[i]]==0))
{
if(wt[i]<minimum)
minimum=wt[i];
}
}
if(minimum==INT_MAX)
cout<<"-1";
else
cout<<minimum;
} | [
"harsh.26020@gmail.com"
] | harsh.26020@gmail.com |
c690cdade5380a4ec9ec1dd80825d20110015f63 | 51991282ae658e643b89c6a4ec1f8b7ddd8e4132 | /src/include/interface/lidarAPI.h | 4aa7bde1fce24166516abd61d93bf71140d92702 | [] | no_license | AvinashRamashray/lidar_ros_driver | 613b8ed0e3e5c25b02fb3acab8fbfbc29bdea4f1 | 844cf44d930fe0f718c9da2bb9df6664aedb6be4 | refs/heads/main | 2023-07-07T22:02:41.056310 | 2021-09-01T06:33:35 | 2021-09-01T06:33:35 | 401,947,903 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 13,505 | h | /********************************************************************
* $I
* @Technic Support: <sdk@isurestar.com>
* All right reserved, Sure-Star Coop.
********************************************************************/
#ifndef SS_LIDAR_API_H_
#define SS_LIDAR_API_H_
#include "ICD_LiDAR_API.h"
#include "ICD_LiDAR_TSK.h"
#include "ICD_Scada_API.h"
#include "ICD_UsbCamera.h"
//#include "ICD_LiDAR_PRE.h"
//added by zhubing 2020.1.3
#ifndef _WINDOWS
#include "../navigator/include/ssNavigator.h"
#include "../navigator/include/nav_ccoordconvert.h"
#include "../navigator/include/nav_datatype.h"
#endif // !WINDOWS
class CUsbCamera ;
class CScada ;
class CLidarConfig ;
class IdataHandle ;
class CLifetime ;
class CLidarReporter ;
class CPalmMode ;
class CStrPtcTool ;
class CSvrSocket ;
class CNavSerial ;
class CdataCom ;
#if defined(_MSC_VER)
#ifdef LIDARAPI_EXPORTS
#define LIDAR_API_DLL __declspec(dllexport)
#else //LIDARAPI_EXPORTS
#define LIDAR_API_DLL __declspec(dllimport)
#endif //LIDARAPI_EXPORTS
#else //defined(_MSC_VER)
#define LIDAR_API_DLL
#endif //defined(_MSC_VER)
// added by zhubing 2020.2.13
#define PI 3.1415926
class LIDAR_API_DLL CLidarAPI {
private:
//<! LiDAR State
LDRPROG_STAT_E m_eprogstat;
LDRPROG_STAT_E cmrScanSta_;
GPSMSG_RINGBUF_S m_gpsMsgRing ;
SHOTS_RINGBUF_S shotsRing_; //!< for lidar data collecting
IMAGE_RINGBUF_S imageRing_[USBCmr_MAXNUMBER]; //一个相机一个ring Buffer,异步事件数据(回调函数)串行处理
MESSG_RINGBUF_S messgRing_; //!< for GUI message box
CFG_RINGBUF_S m_serverCfgRing_ ; //buf
CFG_RINGBUF_S m_clientCfgRing_ ; //配置文件信息buf
SLOW_RINGBUF_S slowRing_ ; //慢数据Buffer
STRMSG_RINGBUF_S strRprtRing_ ; //字符命令反馈buf
//FILE *fp_test;
//int buf_full;
int m_camNeedCnt;
int m_imgCnt;
int preCmrCount;
bool m_cmrIsTrige ; // 外置相机触发
int cmrCount ; //debug
CScada *s_scada;
CLidarConfig *s_config;
//added by zhubing 2020.1.3
#ifndef _WINDOWS
Point_S m_pStart_;
Point_S m_pNext_;
CNavigator *tmpNavigator_;
double m_fSumDis_;
SCDCMD_CAMERA_S tmpCamera;
void cameraRangeTrigger(Pilot_S &data);
#endif
//<! Camera
CUsbCamera * _usbCmr;
//USBCMR_CTRL_S usbCmrCtrl_[USBCmr_MAXNUMBER]; //!< 相机参数控制
// USBCMR_TRIG_S usbTrig_;
LiDAR_DATAINFO_S curData_; //!< 实时显示数据 liyp
SCADA_POST_S posDataStat_ ; //!< pos 状态 liyp
CLifetime *_lidarLife ; //!< 上电时间记录
CLidarReporter *_lidarRecord ; //!< 网络命令记录
unsigned short reportItv_ ; //!< 间隔时间
LiDAR_STAT_E lidarCfgStat_ ; //!< lidarConfig 接受记录
CPalmMode *_m_palmMode ; //!< palm 控制模块
SCADA_TYPE_E m_scada ; //scadaType
LiDAR_TYPE_E m_lidar;
bool m_openLidar ; //The LIDAR is Opened.
int m_cmfFlashCount ;
CStrPtcTool *_mPtcTool ;
bool m_dataFlwRun ; //初始化fast ring buffer 信号
bool m_dataTrans;
int m_StgMsgUp ;
int m_StgMsgCount ;
LDRPROG_STAT_E m_cmdSpinStat ;
LDRPROG_STAT_LIST m_cmdStatList ;
LDRFILE_STAT_LIST m_fileCtrlList ;
CSvrSocket *_svrSock ;
CdataCom *_m_svrUrt ;
CStrPtcTool *_m_strCmdHnd ;
CStrPtcTool *_m_strMsgHnd ;
time_t m_StartTime ; //开始采集数据时间
time_t m_StopTime ; //结束采集数据时间
LDRPROG_STAT_E m_slAtuoCtrlStatus;
UartScreenStatus m_usStatus;// uart screen的工作状态
UartSceenParam m_usParam;
private:
void impDataCtrl(SCDCMD_PROGRM_S progPara_) ;
void initUsbCamera( ) ;
void initScada(SCADA_TYPE_E mtscada ) ;
void initPalm();
public:
//<!
CLidarAPI(SCADA_TYPE_E scada_e=eScadaNet,LiDAR_TYPE_E mtlidar=eLidarGui);
~CLidarAPI() ;
static CLidarAPI* getInstance() ;
LiDAR_TYPE_E getLidarType();
SCADA_TYPE_E getScadaType();
/*** (1) for receiving commands from up-side controller ***/
int cmdHandle(SCADA_CMDRPT_U & cmd) ;
int cmdRprt(SCADA_CMDRPT_U & cmdrcv) ;
// added by zhubing 2020.3.19
//void getMF_Parameter(double &tmp_h, double &tmp_v, double &tmp_Drol, double &tmp_Draw,bool &tmp_mf_falg);
void setMF_Parameter(float tmp_mf_num_, bool tmp_mf_flag, float tmp_mf_freq_);
/*** (2) for SCADA Hardware communicating ***/
int openLidar(char *ip );
int closeLidar(void);
int pingLidar(void);
//<! start up a scanning production
LDRPROG_STAT_E prodStart(LiDAR_RoiProg_S * roids=NULL);
//<! stop the scanning procedure
LDRPROG_STAT_E prodStop();
//<! take a break, stop laser firing or simu
LDRPROG_STAT_E prodBreak();
int dtaRecvHandle() ;
int msgHandle(SCADA_CMDRPT_U mtMsgs) ;
int msgRecvHandle() ;
int systemDateTimeUpdate();
int msgRecv(char * _mt_msgBuff, int mt_msgSize ) ;
int gpsmsgRecv(char * _mt_msgBuff, int mt_msgSize);
int slwdtaRecvHandle() ; //慢数据流接收
int navmsgHandle();//added by zhubing 2020.1.3
int mfModeDateHandle();//added by zhubing 2020.2.13
// added by zhubing 2020.2.14
int init_cycle(double m_high, double m_dot_max, double m_view);
/*** (3) share the ring buffers ***/
//<!
SHOTS_RINGBUF_S * shotsOut() { return &shotsRing_; }
//<!
IMAGE_RINGBUF_S * imageOut() { return imageRing_; }
//<!
MESSG_RINGBUF_S * messgOut() { return &messgRing_; }
CFG_RINGBUF_S * serverCfgRingOut() { return &m_serverCfgRing_ ; }
CFG_RINGBUF_S * clientCfgRingOut() { return &m_clientCfgRing_ ; }
SLOW_RINGBUF_S * slwRingOut() { return &slowRing_ ;} //慢数据流内存地址
STRMSG_RINGBUF_S * strMsgRingOut() { return &strRprtRing_ ;} //字符串消息反馈内存地址
CLidarConfig * ldrCfgOut() {return s_config; }
LDRFILE_STAT_LIST * fileCtrlListOut() {return &m_fileCtrlList; }
/*** (4) .... ***/
//<! usb camera options
int usbCmrOpen();
int usbCmrClose();
//<! read and write the camera config parameters
int usbCmrRead(USBCMR_CTRL_S * usbcmrPara);
int usbCmrWrite(USBCMR_CTRL_S usbcmrPara);
int usbCmrSetupTrig(USBCMR_TRIG_S usbTrigSetup );
int usbCmrTrig(USBCMR_TRIG_S usbCmrTrig); // take a picture
int usbCameraCtrl(USBCMR_TRIG_S mt_usbCmrPara) ;
int usbCameraRprt(USBCMR_TRIG_S *_mt_usbCmrPara) ;
LDRPROG_STAT_E usbCameraScanStart(USBCMR_TRIG_S mt_usbCmrPara) ;
LDRPROG_STAT_E usbCameraScanStop();
/*** (5) .... *****/
//<! used for data header packaging, for CssTask and IDataHandle
//fileType: 0:字符串 1:二进制
int lidarLoadCfg(char * fname , int fileType=0 ) ;
int lidarLoadCfg(CScada * scada, char * fname , int fileType=0) ;
int lidarDumpCfg() ;
char * getImpHead() ;
int packImpHead(char * buf, int size=IMP_HEADER_SIZE) ;
int packTskRecd(char * buf) ;
int packConfig() ;
int depackConfig(const char * buf) ;
int spinMachine() ;
int spinCmrTrigger() ;
int initSlowRing() ;
int initFastRing() ;
/* delete by dengbj
//int pipeMsgIn(char* msg);
//int pipeMsgIn(SCADA_CMDRPT_U cmdrpt);
*/
public:
//Advanced Usage
int ctrlParaRprt(SCADA_CONTROL_S *ctrRpt ) ;
// including enable the dma
int progCtrl(SCDCMD_PROGRM_S prgCmd);
int progSetup(SCDCMD_PROGRM_S progPara) ;
int progRprt(SCDCMD_PROGRM_S * prgRpt);
//device control, add by dengbj
int envirCtrl(SCDCMD_ENVIR_S envirPara);
int envirSetup(SCDCMD_ENVIR_S envirPara);
int envirRprt(SCDCMD_ENVIR_S *envirReport);
int laserCtrl(SCDCMD_LASER_S laserPara);
int laserSetup(SCDCMD_LASER_S laserPara);
int laserRprt(SCDCMD_LASER_S *laserReport);
int scanerCtrl(SCDCMD_SCANER_S scanerPara);
int scanerSetup(SCDCMD_SCANER_S scanerPara);
int scanerRprt(SCDCMD_SCANER_S *scanRprt);
int scanerDriver(bool strStat ) ;
int cameraCtrl(SCDCMD_CAMERA_S cameraPara);
int cameraSetup(SCDCMD_CAMERA_S cameraPara);
int cameraRprt(SCDCMD_CAMERA_S *cmrRprt);
int cameraPosTrig(); // add for nav by dengbj
int turretCtrl(SCDCMD_TURRET_S turretPara);
int turretSetup(SCDCMD_TURRET_S turretPara);
int turretRprt(SCDCMD_TURRET_S *turretReport);
int turretWaitScaner();
int turretStatProcess() ;
//<! access the register directly
int regWrite(SCDCMD_REGIST_S reg);
int regRead(SCDCMD_REGIST_S *reg);
void setStationNbr(unsigned short nbr);
int configRprt(LiDAR_CFGFILE_S *config); //! 配置文件数据返回
LiDAR_DATAINFO_S* dataInfoOut();
int dataInfoRprt( LiDAR_DATAINFO_S *_mt_Info ) ;
int dataInfoSetup( LiDAR_DATAINFO_S mt_Info ) ;
LDRPROG_STAT_E cameraScanStart(SCDCMD_CAMERA_S mt_cmrPara);
LDRPROG_STAT_E cameraScanStop(); //! 停止外置相机曝光
int posCtrl(SCADA_POST_S posPara_ ) ; //!< pos 数据数据控制
int posRprt(SCADA_POST_S * _posPara ) ; //!< pos 数据传输状态返回
int fpgaStatRprt(SCADA_FPGA_STATE * _fpgaStaPara) ; //!< FPGA 状态监控
LiDAR_STAT_E getLidarConfigStat( void ) ; //!<liyp:读取配置文件接受状态
int impFileStateCtrl(LiDARImp_Action_E impPara ) ;
int searchUsbRegister() ;
#ifdef _WINDOWS
//palm 控制模块调用
int palmTranCtrl(SCDCMD_PALM_S mt_palmPata_) ;
int palmTranRprt(SCDCMD_PALM_S *_mt_palmPara) ;
int palmCmrCtrl(SCDCMD_CAMERA_S mt_cmrPara) ;
int palmCmrRprt(SCDCMD_CAMERA_S *_mt_cmrState) ;
int palmStgCtrl(SCDCMD_PALMSTG_S mt_stgPara) ;
int palmStgRprt(SCDCMD_PALMSTG_S *_mt_stgPara) ;
int palmReadRegister(SCDCMD_REGIST_S *_mt_reg) ;
int palmWriteRegister(SCDCMD_REGIST_S mt_reg) ;
int palmDataDirSetup(char * _mt_Path ) ;
int palmDataHandle() ;
int palmPing();
#endif
unsigned int issFileSizeRprt() ;
int dmiSetup(SCDCMD_DMI_S mt_para) ;
int dmiRprt(SCDCMD_DMI_S *_mt_para) ;
int strCmdSent(char *_mt_msg, int mt_size ) ;
LDRPROG_STAT_E lidarMachStateRprt() { return m_eprogstat ; }
int askLidarState() ;
bool imageCollectRprt() ; //反馈影像采集状态
bool imageWiFiTransfer() ;
int scanParaRprt(SCADA_DEFAULTCTR_S *defPara ) ;
int testImpHeadDump() ;
int syncTimeCtrl(SCDCMD_TIMSYN_S mtTime) ;
int storageSetup(SCADA_DATAFUN_S mtPara) ;
int storageCtrl(SCADA_DATAFUN_S mtPara) ;
int storageRprt(SCADA_DATAFUN_S *mtPara) ;
void msgRingHangle(void) ;
void strMsgHangle(void) ;
int msgAutoRprt() ;
CSvrSocket * getSvrSocket() ;
void checkDataChannel() ;
int svcCmdflow() ;
void initLidar(LiDAR_TYPE_E mtlidar) ;
void msgSent(unsigned char *mtMsg, int mtMsgSize, LiDAR_MSGID_E mtMsgId ) ;
int limitParaRprt(SCDCFG_LIMIT_S *mtPara) ; //设备硬件参数限制范围
void setupSimuPath(char *mtDir);
int intervalWork();
void scadaPing();
bool issFileIsOpen() ;
bool serialScreenCommandHandle(void *mtComMsg, size_t size, char* mtStrCmd);
int sendScada2UartCmd(const unsigned char* cmd, size_t size);
int getUartCmdValue(void* cmdStr, size_t size, unsigned char* data);
int updateserialScreenInfo();
void uartScreenStateReportCmd(unsigned char type, void*cmd);
void setupLaserStrCmd(char *buf);
public:
void getTemp(float &tempA,float &tempB);
void setTemp(float tempA,float tempB);
//added by zhubing 2020.5.20
void setMF_Pulse_num(int tmp,bool tmp_flag);
private:
//added by zhubing 2020.2.13
//用户输入参数
double m_high; //航高
double m_v_fight; //飞行速度
double m_density_col; //纵向点密度
double m_density_row; //横向点密度
//设备内部参数
int m_number_mirror; //镜面数量
double m_view; //视场角
double m_fpga_clk; //FPGA时钟频率
//初始化参数
double m_groundview; //地面视场角宽度
int m_v_motor; //电机转速
double m_dot_max; //最大点频
double m_cycle_tmp; //最大视场角下的最小需要跨周期数
int m_cycle; //当前光脉冲数
int m_view_angle_div; //角度划分数量(<50)
int m_div; //第i个角度区间的分频计数值
double m_th_div; //调整分频计数值的边界,取值范围(0.2~0.4)
double m_T0_T0_disti; //第i个角度区间的相邻T0测试值
double m_max_meas_disti; //第i个角度区间的最大测时值
double m_mid_meas_disti; //第i个角度区间的最小测时值
double m_min_meas_disti; //第i个角度区间的测时值中值
int m_err_mfi; //第i个角度区间的mf错误状态
double m_c; //空气中光速 2.99e8m/s
//计算航高涉及参数
double m_time; //时间
double m_scale_time; //测时标度
unsigned int m_hsdiv; //
unsigned int m_mset; //
float _tempA;
float _tempB;
bool tcp_flag;
// added by zhubing 2020.2.15
SCDCMD_MF_S _mf_parameter;
bool _mf_flag;
float _m_pulse;
// added by zhubing 2020.2.17
bool _mf_open_flag;
bool _mf_run_flag;
};
#endif
| [
"avinash4u28@gmail.com"
] | avinash4u28@gmail.com |
bd894f5e8c397e8e59a7371133fde04d7a37060c | 89fc5b243d34612ba90e1d1649387907e29d90ac | /剪花布条.cpp | b89657b9efd2899f0fde9b84fd600f9ee323a137 | [] | no_license | Misaka233/exciting | 8a074bf0924476c067a1965c6ea9a6dc1ad77d75 | 069455bb92560ceee47add71e1743f0d36c8cd10 | refs/heads/master | 2020-04-12T09:01:27.313535 | 2017-02-03T08:28:37 | 2017-02-03T08:28:37 | 55,968,227 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 974 | cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
/*
* next[]的含义:x[i-next[i]...i-1]=x[0...next[i]-1]
* next[i]为满足x[i-z...i-1]=x[0...z-1]的最大z值(就是x的自身匹配)
*/
int Next[1010];
void kmp_pre(char x[],int m)
{
int i,j;
j=Next[0]=-1;
i=0;
while(i<m)
{
while(-1!=j && x[i]!=x[j])j=Next[j];
Next[++i]=++j;
}
}
int KMP_Count(char x[],int m,char y[],int n)
{//x是模式串,y是主串
int i,j;
int ans=0;
//preKMP(x,m,next);
kmp_pre(x,m);
i=j=0;
while(i<n)
{
while(-1!=j && y[i]!=x[j])j=Next[j];
i++;j++;
if(j>=m)
{
ans++;
//j=next[j];
j=0;
}
}
return ans;
}
int main()
{
char a[1007],b[1007];
while(scanf("%s",a)&&a[0]!='#')
{
int la=strlen(a);
scanf("%s",b);
int lb=strlen(b);
cout<<KMP_Count(b,lb,a,la)<<endl;
}
}
| [
"1224936828@qq.com"
] | 1224936828@qq.com |
78039dddc6689a417bb28fe17e8ac697af90ed74 | bd7e29864cca1d1c00d4ed20335ccb5b96ad9f47 | /LET_CBG_Executor/install/rclcpp/include/rclcpp/message_info.hpp | c76eccb93088efa92c0634b1645d1d86fb4d55c0 | [] | no_license | azu-lab/LET_CBG_Executor | bae866e52dd4c9d9f004ad174b6e03f5263ef097 | 050a11c43debe798c4676fdade3b92064315ae9a | refs/heads/main | 2023-04-08T06:53:05.438160 | 2021-04-13T07:51:26 | 2021-04-13T07:51:26 | 357,069,395 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 74 | hpp | /home/pengbo/rclcpp_cbg/ros2_rclcpp/rclcpp/include/rclcpp/message_info.hpp | [
"73328822+retieme@users.noreply.github.com"
] | 73328822+retieme@users.noreply.github.com |
8eec2f5980f1df1d95c6089ef1e6fa89088cbf75 | 201b3d907bcd49b796f67e2819416ac0867f3d1b | /_deprecated/taewan/09.12/1291.cpp | 9e90f3d95dd372b9380aeccf7becf08608db14d8 | [] | no_license | havilog/AlgorithmStudy | 5ba7ac68ebdaac657d8ad9244eb4063ccc4b87a4 | c15cfce481ad0eb8b0f26a229f1088e5f6c47726 | refs/heads/master | 2023-03-28T17:25:43.038071 | 2021-03-27T00:19:47 | 2021-03-27T00:19:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 619 | cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<int> answer;
int low, high;
void recursive(int num)
{
if (num > high)
return;
else if (num >= low && num <= high)
answer.push_back(num);
int last = num % 10;
if (last == 9)
return;
int next = num * 10 + last + 1;
recursive(next);
}
vector<int> sequentialDigits(int low, int high)
{
this->low = low, this->high = high;
for (int i = 1; i < 10; i++)
recursive(i);
sort(answer.begin(), answer.end());
return answer;
}
};
int main(void) { return 0; } | [
"37101468+taewankang@users.noreply.github.com"
] | 37101468+taewankang@users.noreply.github.com |
fc2450c0f01aa907b737836147ae8bfa8c9822eb | 976487eb0301093760cb6666ada46f4999873272 | /sin clasificar/CLionProjects/M.cpp | bcb468e50ff825e83322d7a4950e0b019773ec06 | [] | no_license | Morcado/ACM | 3ddeb47a1ca992e09e2aea936c8a142207b434b8 | d799e180b2d88029b30bb79dfe7fcd52399abc19 | refs/heads/master | 2021-06-26T10:36:24.637120 | 2020-11-26T23:04:36 | 2020-11-26T23:04:36 | 172,977,404 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 357 | cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int num, competidores, palomSeg;
vector<pair<int, int>> competidorBolsa;
vector<int> bolsas;
cin >> num >> competidores >> palomSeg;
for (int i = 0; i < num; ++i) {
int pal;
cin >> pal;
bolsas.push_back(pal);
}
while() {
}
return 0;
} | [
"gposcarr18@gmail.com"
] | gposcarr18@gmail.com |
7fb6545a8e99ea5cd0302b9e67c24c3a8014e70f | c849da9771fa31b87bdbfb69ddc0c255d23c4086 | /Socket/TcpServer.cpp | d80fb3505947e0ec1de4719a2c2e269a63f1c748 | [] | no_license | sundalin0512/StudentManagementSystem | 60323f1e5ee34287bc3e71b2ec5e09664c28e3bf | 7a4e527b78020b17b488bf03e05afebe7aa556ea | refs/heads/master | 2021-04-30T11:08:51.776237 | 2018-02-24T13:47:28 | 2018-02-24T13:47:28 | 121,348,007 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 289 | cpp | #include "stdafx.h"
#include "TcpServer.h"
TcpServer::TcpServer(unsigned short port, std::string ip, int backlog)
{
Create();
Bind(port, ip);
Listen(backlog);
}
TcpServer::~TcpServer()
{
Socket::Close();
}
TcpClient* TcpServer::Accept()
{
return new TcpClient(Socket::Accept());
}
| [
"sundalin0512@outlook.com"
] | sundalin0512@outlook.com |
65def018ed7d41f767032fc227f9ca825af868a6 | f2bd1b6b91721c7bd14ea9b787a3290ac0d86b63 | /BYTESM2SPOJ3923/BYTESM2SPOJ3923/main.cpp | 222c9ee6dcf3ecd612bd19a5d5f2f713386231a4 | [] | no_license | jigya/SPOJ | dbcaf0cb25487f370acad8537efb8f0b598f4c9a | 92ad2979774b83ff4df9eb2c6cceefc5e4f99b33 | refs/heads/master | 2020-06-07T02:33:52.146757 | 2018-01-14T18:44:55 | 2018-01-14T18:44:55 | 17,896,576 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,472 | cpp | //
// main.cpp
// BYTESM2SPOJ3923
//
// Created by Jigya Yadav on 16/08/14.
// Copyright (c) 2014 Jigya Yadav. All rights reserved.
//
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <map>
#include <sstream>
#include <stack>
using namespace std;
int main(int argc, const char * argv[])
{
int i,j,k,t,h,w,a,b,c, max_val;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&h, &w);
vector< vector<int> > arr(h+5, vector<int>(w+5, 0));
for(i=0;i<h;i++)
{
for(j=0;j<w;j++)
{
scanf("%d", &arr[i][j]);
}
}
for(i=1;i<h;i++)
{
for(j=0;j<w;j++)
{
a=arr[i-1][j];
if(j-1>=0)
b=arr[i-1][j-1];
else
b=INT_MIN;
if(j+1<w)
c=arr[i-1][j+1];
else
c=INT_MIN;
arr[i][j]=max(a, max(b,c))+arr[i][j];
}
}
// for(i=0;i<h;i++)
// {
// for(j=0;j<w;j++)
// {
// cout<<arr[i][j]<<" ";
// }
// cout<<endl;
// }
max_val=INT_MIN;
for(i=0;i<w;i++)
{
max_val=max(max_val, arr[h-1][i]);
}
cout<<max_val<<endl;
}
return 0;
}
| [
"jyadav@eng.ucsd.edu"
] | jyadav@eng.ucsd.edu |
cdbe6fb21987277433e4f658f62df24a4c83be57 | 08d157ddf330d75f6bab77a94371a52df6dbc363 | /_172FactorialTrailingZeroes.cpp | 6265bc300c16db9d60d56fe8f6073eb2a38baa14 | [] | no_license | AshburnLee/LeetCode | 36bf01ad31dffc724d45db211b957bda5d848e17 | 585e0d332f4f32227bab8a57189fd57fb7ff4878 | refs/heads/master | 2020-04-26T01:57:38.345607 | 2020-03-18T08:31:52 | 2020-03-18T08:31:52 | 173,218,599 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 862 | cpp | //
// Created by junhui on 10/04/19.
//
#include <iostream>
using namespace std;
class Solution {
public:
// naive way, in this way N! is calculated, which is redundant.
// time: O(N!)
// space: O(1)
int trailingZeroes(int n) {
long long fact=1;
while( n!=0 ){
fact *= n;
n--;
}
cout<<fact<<endl;
int res=0;
while (fact%10 == 0) {
res++;
fact = fact / 10;
}
return res;
}
//we need to first think clear about what will generate a trailing 0
// time:
//space:
int trailingZeroes2(int n) {
int count = 0;
for (long long i = 5; n / i; i *= 5)
count += n / i;
return count;
}
};
int main(int argc, char** argv){
cout<<Solution().trailingZeroes(20)<<endl;
return 0;
} | [
"1578034415@qq.com"
] | 1578034415@qq.com |
b3a65813e48f3536a65e4ef548c880f908eddbea | e40505e3e76ee7d0d8b3d80d87e2a161bf0299d8 | /scripting/src/InitScriptingService.hpp | fde7cd7aedeb86a365ad5ccb41a190711ad7d8cc | [] | no_license | Phlar/core | b71a176f850dfa04bf40f48cc799009ba6623087 | 741a539197282ad9aa93cd6416f6626fabc25265 | refs/heads/master | 2020-12-18T15:44:51.446537 | 2016-06-29T10:11:41 | 2016-06-29T10:11:41 | 30,830,363 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 498 | hpp | #pragma once
#include <boost/shared_ptr.hpp>
#include <boost/intrusive_ptr.hpp>
namespace aw {
namespace core {
namespace base {
class ServiceLocator;
typedef boost::shared_ptr<ServiceLocator> ServiceLocatorPtr;
} // namespace base
namespace scripting {
class IScriptingService;
typedef boost::intrusive_ptr<IScriptingService> IScriptingServicePtr;
IScriptingServicePtr RegisterService(base::ServiceLocatorPtr serviceLocator);
} // namespace scripting
} // namespace core
} // namespace aw
| [
"r.prechtl@gmx.de"
] | r.prechtl@gmx.de |
40fefbc5f28957bb64d32a4922c8005ee3529145 | f86417b0ea8cd93fd3029e5d9564a287c23e79d9 | /lib/EthernetV2_0/examples/CosmClient/CosmClient.ino | 30fcf7b915c7b2eab4fa0689b5420e582f099632 | [] | no_license | jsvana/spices | 502e37af0934eec6c4ef1f67eea074702f2bcece | b9b35067519671bd6f55cbd9d017d869e2f6a6a6 | refs/heads/master | 2016-09-05T16:50:51.248919 | 2015-02-22T22:53:36 | 2015-02-22T22:53:36 | 31,183,515 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,110 | ino | /*
Cosm sensor client
This sketch connects an analog sensor to Cosm (http://www.cosm.com)
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
the Adafruit Ethernet shield, either one will work, as long as it's got
a Wiznet Ethernet module on board.
This example has been updated to use version 2.0 of the cosm.com API.
To make it work, create a feed with a datastream, and give it the ID
sensor1. Or change the code below to match your feed.
Circuit:
* Analog sensor attached to analog in 0
* Ethernet shield attached to pins 10, 11, 12, 13
created 15 March 2010
updated 14 May 2012
by Tom Igoe with input from Usman Haque and Joe Saavedra
http://arduino.cc/en/Tutorial/CosmClient
This code is in the public domain.
*/
#include <SPI.h>
#include <EthernetV2_0.h>
#define APIKEY "YOUR API KEY GOES HERE" // replace your Cosm api key here
#define FEEDID 00000 // replace your feed ID
#define USERAGENT "My Project" // user agent is the project name
// assign a MAC address for the ethernet controller.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
// fill in an available IP address on your network here,
// for manual configuration:
IPAddress ip(10,0,1,20);
// initialize the library instance:
EthernetClient client;
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
char server[] = "api.cosm.com"; // name address for cosm API
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
boolean lastConnected = false; // state of the connection last time through the main loop
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
#define W5200_CS 10
#define SDCARD_CS 4
void setup() {
// start serial port:
Serial.begin(9600);
pinMode(SDCARD_CS,OUTPUT);
digitalWrite(SDCARD_CS,HIGH);//Deselect the SD card
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// DHCP failed, so use a fixed IP address:
Ethernet.begin(mac, ip);
}
}
void loop() {
// read the analog sensor:
int sensorReading = analogRead(A0);
// if there's incoming data from the net connection.
// send it out the serial port. This is for debugging
// purposes only:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if there's no net connection, but there was one last time
// through the loop, then stop the client:
if (!client.connected() && lastConnected) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
// if you're not connected, and ten seconds have passed since
// your last connection, then connect again and send data:
if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {
sendData(sensorReading);
}
// store the state of the connection for next time through
// the loop:
lastConnected = client.connected();
}
// this method makes a HTTP connection to the server:
void sendData(int thisData) {
// if there's a successful connection:
if (client.connect(server, 80)) {
Serial.println("connecting...");
// send the HTTP PUT request:
client.print("PUT /v2/feeds/");
client.print(FEEDID);
client.println(".csv HTTP/1.1");
client.println("Host: api.cosm.com");
client.print("X-ApiKey: ");
client.println(APIKEY);
client.print("User-Agent: ");
client.println(USERAGENT);
client.print("Content-Length: ");
// calculate the length of the sensor reading in bytes:
// 8 bytes for "sensor1," + number of digits of the data:
int thisLength = 8 + getLength(thisData);
client.println(thisLength);
// last pieces of the HTTP PUT request:
client.println("Content-Type: text/csv");
client.println("Connection: close");
client.println();
// here's the actual content of the PUT request:
client.print("sensor1,");
client.println(thisData);
}
else {
// if you couldn't make a connection:
Serial.println("connection failed");
Serial.println();
Serial.println("disconnecting.");
client.stop();
}
// note the time that the connection was made or attempted:
lastConnectionTime = millis();
}
// This method calculates the number of digits in the
// sensor reading. Since each digit of the ASCII decimal
// representation is a byte, the number of digits equals
// the number of bytes:
int getLength(int someValue) {
// there's at least one byte:
int digits = 1;
// continually divide the value by ten,
// adding one to the digit count for each
// time you divide, until you're at 0:
int dividend = someValue /10;
while (dividend > 0) {
dividend = dividend /10;
digits++;
}
// return the number of digits:
return digits;
}
| [
"jsvana@mtu.edu"
] | jsvana@mtu.edu |
b458af9345c68576e0aefe0754b208f37594aca0 | cc7661edca4d5fb2fc226bd6605a533f50a2fb63 | /mscorlib/IApplicationTrustManager.h | 53e2d5062361c7e8e6a80276b8497ccbd4ff7332 | [
"MIT"
] | permissive | g91/Rust-C-SDK | 698e5b573285d5793250099b59f5453c3c4599eb | d1cce1133191263cba5583c43a8d42d8d65c21b0 | refs/heads/master | 2020-03-27T05:49:01.747456 | 2017-08-23T09:07:35 | 2017-08-23T09:07:35 | 146,053,940 | 1 | 0 | null | 2018-08-25T01:13:44 | 2018-08-25T01:13:44 | null | UTF-8 | C++ | false | false | 142 | h | #pragma once
namespace System
{
namespace Security
{
{
namespace Policy
{
class IApplicationTrustManager
{
public:
}; // size = 0x0
}
| [
"info@cvm-solutions.co.uk"
] | info@cvm-solutions.co.uk |
1db25e89c530c0a4536087b588c9ff00d26ee3c9 | 63c71060f36866bca4ac27304cef6d5755fdc35c | /src/DataCreator/DataCreator.cpp | ab4be0fe53dbed5fa8c764db047dfc37cc78124a | [] | no_license | 15831944/barry_dev | bc8441cbfbd4b62fbb42bee3dcb79ff7f5fcaf8a | d4a83421458aa28ca293caa7a5567433e9358596 | refs/heads/master | 2022-03-24T07:00:26.810732 | 2015-12-22T07:19:58 | 2015-12-22T07:19:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,046 | cpp | ////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2005
// Packet Engineering, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification is not permitted unless authorized in writing by a duly
// appointed officer of Packet Engineering, Inc. or its derivatives
//
//
// Modification History:
// 06/04/2012 Created by Chen Ding
////////////////////////////////////////////////////////////////////////////
#include "Sorter/Sorter.h"
#include "Sorter/SorterRecord.h"
#include "Debug/ExitHandler.h"
#include "Debug/Debug.h"
AosSorter::AosSorter(
const OmnString &name,
const AosSorterType::E type,
const bool regflag)
:
AosSorterObj(name, type, regflag)
{
}
AosSorter::~AosSorter()
{
}
bool
AosSorter::init()
{
static AosSorterRecord lsSorterRecord(true);
if (!AosSorterType::check())
{
OmnExitApp("Some sorters were not initialized");
return false;
}
OmnScreen << "All sorters are initialized" << endl;
return true;
}
| [
"barryniu@jimodb.com"
] | barryniu@jimodb.com |
f5d3f5f7a5663dfc954a4dfc1cb95eca025a6899 | 0f0ab7218f698fff15729a29a5d6fda3c6920857 | /new/demos/c05_hsm/hsm_demo.cpp | f587ac7efc9ee1a222dc3ccd302048c33cfb587a | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LawyerMorty97/aicore | 5bcfd7ff9359d8c1d91b3d6b01d8f776b7cdc90c | c39e39161c74d08496c692d29b626de17a6b8f61 | refs/heads/master | 2020-04-20T01:22:27.750140 | 2019-02-06T23:49:36 | 2019-02-06T23:49:36 | 168,543,496 | 0 | 0 | MIT | 2019-01-31T15:00:29 | 2019-01-31T15:00:28 | null | UTF-8 | C++ | false | false | 8,468 | cpp | /*
* The basic decision tree demo.
*
* Part of the Artificial Intelligence for Games system.
*
* Copyright (c) Ian Millington 2003-2006. All Rights Reserved.
*
* This software is distributed under licence. Use of this software
* implies agreement with all terms and conditions of the accompanying
* software licence.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aicore/aicore.h>
/** Holds the last selected option from the user. */
unsigned option = 0;
/**
* This is a custom condition implementation that checks what the last
* requested transition was.asks the user for the result of the
* decision.
*/
class UserCheckCondition : public aicore::Condition
{
public:
/** Holds the option for this condition */
unsigned myOption;
/** Checks if the condition is valid. */
virtual bool test();
};
bool UserCheckCondition::test()
{
printf("Checking for transition %d - ", myOption);
if (myOption == option) {
printf("Triggers\n");
return true;
} else {
printf("Doesn't trigger\n");
return false;
}
}
/**
* This is a very simple action that just holds some text to display.
*/
class DemoAction : public aicore::Action
{
public:
const char *actionText;
};
/**
* This class adds a mechanism to output demo actions with text.
*/
class DemoTransition :
public aicore::Transition,
public aicore::ConditionalTransitionMixin,
public aicore::FixedTargetTransitionMixin
{
public:
const char ** text;
unsigned textCount;
virtual aicore::Action* getActions();
aicore::StateMachineState * getTargetState()
{
return aicore::FixedTargetTransitionMixin::getTargetState();
}
bool isTriggered()
{
printf("Checking for transition %d - ",
((aicore::IntegerMatchCondition*)condition)->target);
bool result = aicore::ConditionalTransitionMixin::isTriggered();
if (result) {
printf("Triggers\n");
} else {
printf("Doesn't trigger\n");
}
return result;
}
};
/* This is a convenience function that returns a list of actions from
* a set of text strings. */
aicore::Action* getActionsFromText(const char ** text, unsigned textCount)
{
DemoAction* first = NULL;
DemoAction* last = NULL;
DemoAction* current = NULL;
for (unsigned i = 0; i < textCount; i++)
{
// Create a new action and set its text
current = new DemoAction();
current->actionText = (const char*) text[i];
current->next = NULL;
// Wire it into the action list
if (i == 0) first = current;
if (last) last->next = current;
last = current;
}
return first;
}
aicore::Action* DemoTransition::getActions()
{
return getActionsFromText(text, textCount);
}
/**
* This class extends the state machine state to have text-based
* actions returned.
*/
class DemoState : public aicore::StateMachineState
{
public:
const char ** text;
unsigned textCount;
const char ** entryText;
unsigned entryTextCount;
const char ** exitText;
unsigned exitTextCount;
virtual aicore::Action * getActions();
virtual aicore::Action * getEntryActions();
virtual aicore::Action * getExitActions();
};
aicore::Action* DemoState::getActions()
{
return getActionsFromText(text, textCount);
}
aicore::Action* DemoState::getEntryActions()
{
return getActionsFromText(entryText, entryTextCount);
}
aicore::Action* DemoState::getExitActions()
{
return getActionsFromText(exitText, exitTextCount);
}
/**
* The main entry point, we set up our state machine here, and then
* run it.
*/
int main(int argc, char** argv)
{
// Create the array of text used in all states
const char *allText[] = {
// State text
"Entering State A", "In State A", "Exiting State A",
"Entering State B", "In State B", "Exiting State B",
"Entering State C", "In State C", "Exiting State C",
"Entering State D", "In State D", "Exiting State D",
"Entering State E", "In State E", "Exiting State E",
"Entering State F", "In State F", "Exiting State F",
"Entering State G", "In State G", "Exiting State G",
// Transition text
"Transition 1",
"Transition 2",
"Transition 3",
"Transition 4",
"Transition 5",
"Transition 6",
"Transition 7",
"Transition 8",
"Transition 9",
"Transition 10",
"Transition 11",
"Transition 12",
"Transition 13",
"Transition 14",
"Transition 15"
};
// Create our state machine
DemoState states[7];
DemoTransition transitions[15];
// Set the text in each case
for (unsigned i = 0; i < 7; i++)
{
states[i].entryText = allText+(i*3);
states[i].entryTextCount = 1;
states[i].text = allText+(i*3+1);
states[i].textCount = 1;
states[i].exitText = allText+(i*3+2);
states[i].exitTextCount = 1;
}
for (unsigned i = 0; i < 15; i++)
{
transitions[i].text = allText+(21+i);
transitions[i].textCount = 1;
transitions[i].next = NULL;
UserCheckCondition *condition = new UserCheckCondition;
condition->myOption = i+1;
transitions[i].condition = condition;
}
// Connect the transitions to their targets
transitions[0].target = states+1;
transitions[1].target = states+1;
transitions[2].target = states+2;
transitions[3].target = states+3;
transitions[4].target = states+4;
transitions[5].target = states+0;
transitions[6].target = states+5;
transitions[7].target = states+6;
transitions[8].target = states+5;
transitions[9].target = states+2;
transitions[10].target = states+6;
transitions[11].target = states+4;
transitions[12].target = states+6;
transitions[13].target = states+4;
transitions[14].target = states+6;
// Place the transitions in their states
states[0].firstTransition = transitions+0;
transitions[0].next = transitions+4;
states[1].firstTransition = transitions+1;
transitions[1].next = transitions+2;
transitions[2].next = transitions+6;
transitions[6].next = transitions+7;
states[2].firstTransition = transitions+3;
transitions[3].next = transitions+8;
states[3].firstTransition = transitions+10;
states[4].firstTransition = transitions+13;
transitions[13].next = transitions+14;
states[5].firstTransition = transitions+5;
transitions[5].next = transitions+11;
transitions[11].next = transitions+12;
states[6].firstTransition = transitions+9;
// Set up the state machine
aicore::StateMachine sm;
sm.initialState = states+0;
sm.currentState = NULL;
// Now we can run the demo
printf("AI4G: State Machine Demo (Ctrl+C to exit)\n");
char buffer[4];
while (true)
{
// Display the current situation
if (sm.currentState != NULL) {
printf("\n\nCurrent State: %s\n",
((DemoState*)sm.currentState)->text[0]);
printf("Transitions from this state:\n");
// Output all valid transitions from here
aicore::BaseTransition * next = sm.currentState->firstTransition;
while (next != NULL)
{
DemoTransition* nextDT = (DemoTransition*)(next);
DemoState* to = (DemoState*)nextDT->target;
printf("%s to be %s\n", nextDT->text[0], to->text[0]);
// Find the next transition
next = next->next;
}
} else {
printf("\n\nNo Current state\nNo Current transitions\n");
}
// Ask for input
printf("Which transition should be allowed to trigger (0-15)\n");
// Get the user's input
fgets(buffer, 3, stdin);
option = atoi(buffer);
// Run one iteration of the state machine
aicore::Action * actions = sm.update();
// Output the action text
aicore::Action * next = actions;
while (next != NULL)
{
printf("Executing action: %s\n",
((DemoAction*)next)->actionText);
next = next->next;
}
// Delete the actions
actions->deleteList();
}
// We're fine
return 0;
}
| [
"mathiastb13@gmail.com"
] | mathiastb13@gmail.com |
92df4c913c68e59787d6a275b15e542fc86e3f15 | de5f555645ac0f70a129d5531fdc3934b1803bea | /Class/Prime.cc | f031384a917000f827be1080da649fabc4b15350 | [] | no_license | kaushal02/CP | 52737875c70a40b3e0f7885b2553fdb1b7447bf9 | 704543bcd17e75759a584f88300033a348dc71ab | refs/heads/master | 2022-10-20T06:59:33.421829 | 2022-10-18T05:25:54 | 2022-10-18T05:26:20 | 70,631,083 | 33 | 18 | null | 2018-10-26T13:48:52 | 2016-10-11T20:09:00 | C++ | UTF-8 | C++ | false | false | 888 | cc | #include <vector>
/*
* Prime(n) stores all primes below n
* Time : O(n * log log n)
* Space: O(n)
*/
class Prime {
int N;
vector <int> value;
vector <bool> isPrime;
public:
Prime(int n) {
N = n;
isPrime.resize(n, true);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i < n; i++) {
if (isPrime[i]) {
value.push_back(i);
for (int j = 2 * i; j < n; j += i) {
isPrime[j] = false;
}
}
}
}
bool check(int n) {
return isPrime[n];
}
int getKthPrime(int k) {
return value[k - 1];
}
static void unittests() {
Prime p(100);
assert(p.check(2));
assert(p.check(3));
assert(p.check(13));
assert(p.getKthPrime(1) == 2);
assert(p.getKthPrime(4) == 7);
}
};
| [
"kaushal0181@gmail.com"
] | kaushal0181@gmail.com |
8c92d30cf99f6e72cb408676d857e382ee06ad62 | 4f450f353377f155cd11567049056c2f690a153f | /1. CorruptLab_Client/CorruptLab/Object_DynamicObj.cpp | 92a96ee1dc9b4a935904b37e518b70e189ef0589 | [] | no_license | pinkogeneral/Portfolio | 767ae8c3634829d7748bf799c72fb2f1e497a21e | 0b35fa7b72b5f3b507edb16b0cb5e8d34eb7f080 | refs/heads/master | 2022-12-28T05:50:33.258666 | 2020-10-04T07:09:14 | 2020-10-04T07:09:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 105 | cpp | #include "Object_DynamicObj.h"
void CDynamicObject::OnInitialize()
{
CStaticObject::OnInitialize();
}
| [
"48274192+AhnaGeneral@users.noreply.github.com"
] | 48274192+AhnaGeneral@users.noreply.github.com |
17dc2d66b196d8348c4dfb73d09ae67effc285fb | 022c2c6ddbac93d681a7d05da7507dc86623efe1 | /Sources/cpp/include/ATen/CPUFunctions_inl.h | bf06a2910f42f7ecf9f7b2507cf137abf3eb0729 | [] | no_license | beatTheSystem42/CPytorch | 5772e460281c467e971af403c246f0808c705614 | e8649bacdd2dfda2a9519f15773f54208d200c73 | refs/heads/main | 2023-06-24T21:59:01.861357 | 2021-07-29T17:02:53 | 2021-07-29T17:02:53 | 390,803,086 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 169,062 | h | // @generated by tools/codegen/gen.py from DispatchKeyFunctions_inl.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API
#include <c10/core/MemoryFormat.h>
#include <c10/core/Scalar.h>
#include <ATen/core/Reduction.h>
namespace at {
namespace cpu {
TORCH_API void _assert_async(const at::Tensor & self);
TORCH_API at::Tensor & abs_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & abs_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor angle(const at::Tensor & self);
TORCH_API at::Tensor & angle_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & angle_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor view_as_real(const at::Tensor & self);
TORCH_API at::Tensor view_as_complex(const at::Tensor & self);
TORCH_API at::Tensor sgn(const at::Tensor & self);
TORCH_API at::Tensor & sgn_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sgn_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sgn_(at::Tensor & self);
TORCH_API at::Tensor & conj_physical_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & conj_physical_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor acos(const at::Tensor & self);
TORCH_API at::Tensor & acos_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & acos_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & acos_(at::Tensor & self);
TORCH_API at::Tensor add(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & add_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & add_outf(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & add_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor _add_relu(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & _add_relu_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & _add_relu_outf(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & _add_relu_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor _add_relu(const at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & _add_relu_(at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor addmv(const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addmv_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addmv_outf(const at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & addmv_(at::Tensor & self, const at::Tensor & mat, const at::Tensor & vec, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor addr(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addr_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addr_outf(const at::Tensor & self, const at::Tensor & vec1, const at::Tensor & vec2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor all(const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API at::Tensor & all_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API at::Tensor & all_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor any(const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API at::Tensor & any_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API at::Tensor & any_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor & arange_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, const at::Scalar & step=1);
TORCH_API at::Tensor & arange_outf(const at::Scalar & start, const at::Scalar & end, const at::Scalar & step, at::Tensor & out);
TORCH_API at::Tensor argmax(const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);
TORCH_API at::Tensor & argmax_out(at::Tensor & out, const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);
TORCH_API at::Tensor & argmax_outf(const at::Tensor & self, c10::optional<int64_t> dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor argmin(const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);
TORCH_API at::Tensor & argmin_out(at::Tensor & out, const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);
TORCH_API at::Tensor & argmin_outf(const at::Tensor & self, c10::optional<int64_t> dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor acosh(const at::Tensor & self);
TORCH_API at::Tensor & acosh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & acosh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & acosh_(at::Tensor & self);
TORCH_API at::Tensor asinh(const at::Tensor & self);
TORCH_API at::Tensor & asinh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & asinh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & asinh_(at::Tensor & self);
TORCH_API at::Tensor atanh(const at::Tensor & self);
TORCH_API at::Tensor & atanh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & atanh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & atanh_(at::Tensor & self);
TORCH_API at::Tensor as_strided(const at::Tensor & self, at::IntArrayRef size, at::IntArrayRef stride, c10::optional<int64_t> storage_offset=c10::nullopt);
TORCH_API at::Tensor asin(const at::Tensor & self);
TORCH_API at::Tensor & asin_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & asin_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & asin_(at::Tensor & self);
TORCH_API at::Tensor atan(const at::Tensor & self);
TORCH_API at::Tensor & atan_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & atan_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & atan_(at::Tensor & self);
TORCH_API at::Tensor baddbmm(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & baddbmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & baddbmm_outf(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & baddbmm_(at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & bernoulli_out(at::Tensor & out, const at::Tensor & self, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & bernoulli_outf(const at::Tensor & self, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor & bernoulli_(at::Tensor & self, const at::Tensor & p, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & bernoulli_(at::Tensor & self, double p=0.5, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor binary_cross_entropy(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & binary_cross_entropy_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & binary_cross_entropy_outf(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, at::Tensor & out);
TORCH_API at::Tensor binary_cross_entropy_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & binary_cross_entropy_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & binary_cross_entropy_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, at::Tensor & grad_input);
TORCH_API at::Tensor bincount(const at::Tensor & self, const c10::optional<at::Tensor> & weights={}, int64_t minlength=0);
TORCH_API at::Tensor bitwise_not(const at::Tensor & self);
TORCH_API at::Tensor & bitwise_not_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & bitwise_not_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & bitwise_not_(at::Tensor & self);
TORCH_API at::Tensor copysign(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & copysign_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & copysign_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & copysign_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logical_not_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & logical_not_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & logical_xor_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logical_xor_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & logical_and_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logical_and_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & logical_or_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logical_or_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor bmm(const at::Tensor & self, const at::Tensor & mat2);
TORCH_API at::Tensor & bmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat2);
TORCH_API at::Tensor & bmm_outf(const at::Tensor & self, const at::Tensor & mat2, at::Tensor & out);
TORCH_API at::Tensor ceil(const at::Tensor & self);
TORCH_API at::Tensor & ceil_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & ceil_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & ceil_(at::Tensor & self);
TORCH_API at::Tensor clamp(const at::Tensor & self, const c10::optional<at::Scalar> & min, const c10::optional<at::Scalar> & max=c10::nullopt);
TORCH_API at::Tensor & clamp_out(at::Tensor & out, const at::Tensor & self, const c10::optional<at::Scalar> & min, const c10::optional<at::Scalar> & max=c10::nullopt);
TORCH_API at::Tensor & clamp_outf(const at::Tensor & self, const c10::optional<at::Scalar> & min, const c10::optional<at::Scalar> & max, at::Tensor & out);
TORCH_API at::Tensor & clamp_(at::Tensor & self, const c10::optional<at::Scalar> & min, const c10::optional<at::Scalar> & max=c10::nullopt);
TORCH_API at::Tensor clamp(const at::Tensor & self, const c10::optional<at::Tensor> & min={}, const c10::optional<at::Tensor> & max={});
TORCH_API at::Tensor & clamp_out(at::Tensor & out, const at::Tensor & self, const c10::optional<at::Tensor> & min={}, const c10::optional<at::Tensor> & max={});
TORCH_API at::Tensor & clamp_outf(const at::Tensor & self, const c10::optional<at::Tensor> & min, const c10::optional<at::Tensor> & max, at::Tensor & out);
TORCH_API at::Tensor & clamp_max_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & max);
TORCH_API at::Tensor & clamp_max_outf(const at::Tensor & self, const at::Scalar & max, at::Tensor & out);
TORCH_API at::Tensor & clamp_max_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & max);
TORCH_API at::Tensor & clamp_max_outf(const at::Tensor & self, const at::Tensor & max, at::Tensor & out);
TORCH_API at::Tensor & clamp_min_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & min);
TORCH_API at::Tensor & clamp_min_outf(const at::Tensor & self, const at::Scalar & min, at::Tensor & out);
TORCH_API at::Tensor & clamp_min_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & min);
TORCH_API at::Tensor & clamp_min_outf(const at::Tensor & self, const at::Tensor & min, at::Tensor & out);
TORCH_API at::Tensor & complex_out(at::Tensor & out, const at::Tensor & real, const at::Tensor & imag);
TORCH_API at::Tensor & complex_outf(const at::Tensor & real, const at::Tensor & imag, at::Tensor & out);
TORCH_API at::Tensor & polar_out(at::Tensor & out, const at::Tensor & abs, const at::Tensor & angle);
TORCH_API at::Tensor & polar_outf(const at::Tensor & abs, const at::Tensor & angle, at::Tensor & out);
TORCH_API at::Tensor cos(const at::Tensor & self);
TORCH_API at::Tensor & cos_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & cos_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & cos_(at::Tensor & self);
TORCH_API at::Tensor cosh(const at::Tensor & self);
TORCH_API at::Tensor & cosh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & cosh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & cosh_(at::Tensor & self);
TORCH_API at::Tensor count_nonzero(const at::Tensor & self, at::IntArrayRef dim);
TORCH_API void _cummax_helper(const at::Tensor & self, at::Tensor & values, at::Tensor & indices, int64_t dim);
TORCH_API void _cummin_helper(const at::Tensor & self, at::Tensor & values, at::Tensor & indices, int64_t dim);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _ctc_loss(const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, int64_t blank=0, bool zero_infinity=false);
TORCH_API at::Tensor _ctc_loss_backward(const at::Tensor & grad, const at::Tensor & log_probs, const at::Tensor & targets, at::IntArrayRef input_lengths, at::IntArrayRef target_lengths, const at::Tensor & neg_log_likelihood, const at::Tensor & log_alpha, int64_t blank, bool zero_infinity=false);
TORCH_API at::Tensor div(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & div_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & div_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor div(const at::Tensor & self, const at::Tensor & other, c10::optional<c10::string_view> rounding_mode);
TORCH_API at::Tensor & div_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, c10::optional<c10::string_view> rounding_mode);
TORCH_API at::Tensor & div_outf(const at::Tensor & self, const at::Tensor & other, c10::optional<c10::string_view> rounding_mode, at::Tensor & out);
TORCH_API at::Tensor & div_(at::Tensor & self, const at::Tensor & other, c10::optional<c10::string_view> rounding_mode);
TORCH_API at::Tensor dot(const at::Tensor & self, const at::Tensor & tensor);
TORCH_API at::Tensor vdot(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor embedding_dense_backward(const at::Tensor & grad_output, const at::Tensor & indices, int64_t num_weights, int64_t padding_idx, bool scale_grad_by_freq);
TORCH_API at::Tensor & embedding_renorm_(at::Tensor & self, const at::Tensor & indices, double max_norm, double norm_type);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor> _embedding_bag_forward_only(const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq=false, int64_t mode=0, bool sparse=false, const c10::optional<at::Tensor> & per_sample_weights={}, bool include_last_offset=false, int64_t padding_idx=-1);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor,at::Tensor> _embedding_bag(const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, bool scale_grad_by_freq=false, int64_t mode=0, bool sparse=false, const c10::optional<at::Tensor> & per_sample_weights={}, bool include_last_offset=false, int64_t padding_idx=-1);
TORCH_API at::Tensor _embedding_bag_dense_backward(const at::Tensor & grad, const at::Tensor & indices, const at::Tensor & offset2bag, const at::Tensor & bag_size, const at::Tensor & maximum_indices, int64_t num_weights, bool scale_grad_by_freq, int64_t mode, const c10::optional<at::Tensor> & per_sample_weights, int64_t padding_idx=-1);
TORCH_API at::Tensor _embedding_bag_per_sample_weights_backward(const at::Tensor & grad, const at::Tensor & weight, const at::Tensor & indices, const at::Tensor & offsets, const at::Tensor & offset2bag, int64_t mode, int64_t padding_idx=-1);
TORCH_API at::Tensor empty(at::IntArrayRef size, at::TensorOptions options={}, c10::optional<at::MemoryFormat> memory_format=c10::nullopt);
TORCH_API at::Tensor empty(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory, c10::optional<at::MemoryFormat> memory_format);
TORCH_API at::Tensor _empty_affine_quantized(at::IntArrayRef size, at::TensorOptions options={}, double scale=1, int64_t zero_point=0, c10::optional<at::MemoryFormat> memory_format=MemoryFormat::Contiguous);
TORCH_API at::Tensor _empty_affine_quantized(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory, double scale, int64_t zero_point, c10::optional<at::MemoryFormat> memory_format);
TORCH_API at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options={}, c10::optional<at::MemoryFormat> memory_format=MemoryFormat::Contiguous);
TORCH_API at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory, c10::optional<at::MemoryFormat> memory_format);
TORCH_API const at::Tensor & resize_(const at::Tensor & self, at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format=c10::nullopt);
TORCH_API at::Tensor empty_strided(at::IntArrayRef size, at::IntArrayRef stride, at::TensorOptions options={});
TORCH_API at::Tensor empty_strided(at::IntArrayRef size, at::IntArrayRef stride, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory);
TORCH_API at::Tensor erf(const at::Tensor & self);
TORCH_API at::Tensor & erf_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & erf_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & erf_(at::Tensor & self);
TORCH_API at::Tensor erfc(const at::Tensor & self);
TORCH_API at::Tensor & erfc_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & erfc_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & erfc_(at::Tensor & self);
TORCH_API at::Tensor exp(const at::Tensor & self);
TORCH_API at::Tensor & exp_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & exp_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & exp_(at::Tensor & self);
TORCH_API at::Tensor exp2(const at::Tensor & self);
TORCH_API at::Tensor & exp2_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & exp2_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & exp2_(at::Tensor & self);
TORCH_API at::Tensor expm1(const at::Tensor & self);
TORCH_API at::Tensor & expm1_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & expm1_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & expm1_(at::Tensor & self);
TORCH_API at::Tensor & eye_out(at::Tensor & out, int64_t n);
TORCH_API at::Tensor & eye_outf(int64_t n, at::Tensor & out);
TORCH_API at::Tensor & eye_out(at::Tensor & out, int64_t n, int64_t m);
TORCH_API at::Tensor & eye_outf(int64_t n, int64_t m, at::Tensor & out);
TORCH_API at::Tensor & fill_(at::Tensor & self, const at::Scalar & value);
TORCH_API at::Tensor & fill_(at::Tensor & self, const at::Tensor & value);
TORCH_API at::Tensor floor(const at::Tensor & self);
TORCH_API at::Tensor & floor_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & floor_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & floor_(at::Tensor & self);
TORCH_API at::Tensor floor_divide(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & floor_divide_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & floor_divide_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & floor_divide_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor frac(const at::Tensor & self);
TORCH_API at::Tensor & frac_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & frac_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & frac_(at::Tensor & self);
TORCH_API at::Tensor from_file(c10::string_view filename, c10::optional<bool> shared=c10::nullopt, c10::optional<int64_t> size=0, at::TensorOptions options={});
TORCH_API at::Tensor from_file(c10::string_view filename, c10::optional<bool> shared, c10::optional<int64_t> size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory);
TORCH_API at::Tensor gcd(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & gcd_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & gcd_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & gcd_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor lcm(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & lcm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & lcm_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & lcm_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor grid_sampler_2d(const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> grid_sampler_2d_backward(const at::Tensor & grad_output, const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners);
TORCH_API at::Tensor grid_sampler_3d(const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> grid_sampler_3d_backward(const at::Tensor & grad_output, const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_group_norm(const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, int64_t N, int64_t C, int64_t HxW, int64_t group, double eps);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_group_norm_backward(const at::Tensor & grad_out, const at::Tensor & input, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional<at::Tensor> & weight, int64_t N, int64_t C, int64_t HxW, int64_t group, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor _fft_r2c(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool onesided);
TORCH_API at::Tensor & _fft_r2c_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool onesided);
TORCH_API at::Tensor & _fft_r2c_outf(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool onesided, at::Tensor & out);
TORCH_API at::Tensor _fft_c2r(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, int64_t last_dim_size);
TORCH_API at::Tensor & _fft_c2r_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, int64_t last_dim_size);
TORCH_API at::Tensor & _fft_c2r_outf(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, int64_t last_dim_size, at::Tensor & out);
TORCH_API at::Tensor _fft_c2c(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool forward);
TORCH_API at::Tensor & _fft_c2c_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool forward);
TORCH_API at::Tensor & _fft_c2c_outf(const at::Tensor & self, at::IntArrayRef dim, int64_t normalization, bool forward, at::Tensor & out);
TORCH_API at::Tensor index(const at::Tensor & self, const c10::List<c10::optional<at::Tensor>> & indices);
TORCH_API at::Tensor & _index_put_impl_(at::Tensor & self, const c10::List<c10::optional<at::Tensor>> & indices, const at::Tensor & values, bool accumulate=false, bool unsafe=false);
TORCH_API at::Tensor _inverse_helper(const at::Tensor & self);
TORCH_API at::Tensor isin(const at::Tensor & elements, const at::Tensor & test_elements, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_out(at::Tensor & out, const at::Tensor & elements, const at::Tensor & test_elements, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_outf(const at::Tensor & elements, const at::Tensor & test_elements, bool assume_unique, bool invert, at::Tensor & out);
TORCH_API at::Tensor isin(const at::Tensor & elements, const at::Scalar & test_element, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_out(at::Tensor & out, const at::Tensor & elements, const at::Scalar & test_element, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_outf(const at::Tensor & elements, const at::Scalar & test_element, bool assume_unique, bool invert, at::Tensor & out);
TORCH_API at::Tensor isin(const at::Scalar & element, const at::Tensor & test_elements, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_out(at::Tensor & out, const at::Scalar & element, const at::Tensor & test_elements, bool assume_unique=false, bool invert=false);
TORCH_API at::Tensor & isin_outf(const at::Scalar & element, const at::Tensor & test_elements, bool assume_unique, bool invert, at::Tensor & out);
TORCH_API at::Tensor isnan(const at::Tensor & self);
TORCH_API at::Tensor kl_div_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, bool log_target=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> kthvalue_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t k, int64_t dim=-1, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> kthvalue_outf(const at::Tensor & self, int64_t k, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_layer_norm(const at::Tensor & input, at::IntArrayRef normalized_shape, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, double eps);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_layer_norm_backward(const at::Tensor & grad_out, const at::Tensor & input, at::IntArrayRef normalized_shape, const at::Tensor & mean, const at::Tensor & rstd, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor & nan_to_num_out(at::Tensor & out, const at::Tensor & self, c10::optional<double> nan=c10::nullopt, c10::optional<double> posinf=c10::nullopt, c10::optional<double> neginf=c10::nullopt);
TORCH_API at::Tensor & nan_to_num_outf(const at::Tensor & self, c10::optional<double> nan, c10::optional<double> posinf, c10::optional<double> neginf, at::Tensor & out);
TORCH_API at::Tensor & linspace_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, c10::optional<int64_t> steps=c10::nullopt);
TORCH_API at::Tensor & linspace_outf(const at::Scalar & start, const at::Scalar & end, c10::optional<int64_t> steps, at::Tensor & out);
TORCH_API at::Tensor log(const at::Tensor & self);
TORCH_API at::Tensor & log_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & log_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & log_(at::Tensor & self);
TORCH_API at::Tensor log10(const at::Tensor & self);
TORCH_API at::Tensor & log10_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & log10_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & log10_(at::Tensor & self);
TORCH_API at::Tensor log1p(const at::Tensor & self);
TORCH_API at::Tensor & log1p_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & log1p_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & log1p_(at::Tensor & self);
TORCH_API at::Tensor log2(const at::Tensor & self);
TORCH_API at::Tensor & log2_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & log2_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & log2_(at::Tensor & self);
TORCH_API at::Tensor logaddexp(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logaddexp_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logaddexp_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor logaddexp2(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logaddexp2_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logaddexp2_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor xlogy(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & xlogy_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & xlogy_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & xlogy_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & logspace_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, c10::optional<int64_t> steps=c10::nullopt, double base=10.0);
TORCH_API at::Tensor & logspace_outf(const at::Scalar & start, const at::Scalar & end, c10::optional<int64_t> steps, double base, at::Tensor & out);
TORCH_API at::Tensor _log_softmax(const at::Tensor & self, int64_t dim, bool half_to_float);
TORCH_API at::Tensor _log_softmax_backward_data(const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, const at::Tensor & self);
TORCH_API at::Tensor _logcumsumexp(const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _logcumsumexp_out(at::Tensor & out, const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _logcumsumexp_outf(const at::Tensor & self, int64_t dim, at::Tensor & out);
TORCH_API at::Tensor matrix_exp(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _aminmax(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _aminmax(const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API at::Tensor _compute_linear_combination(const at::Tensor & input, const at::Tensor & coefficients);
TORCH_API at::Tensor & _compute_linear_combination_out(at::Tensor & out, const at::Tensor & input, const at::Tensor & coefficients);
TORCH_API at::Tensor & _compute_linear_combination_outf(const at::Tensor & input, const at::Tensor & coefficients, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> max(const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_out(at::Tensor & max, at::Tensor & max_values, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & max, at::Tensor & max_values);
TORCH_API at::Tensor & amax_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim={}, bool keepdim=false);
TORCH_API at::Tensor & amax_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor mean(const at::Tensor & self, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor mean(const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & mean_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & mean_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, c10::optional<at::ScalarType> dtype, at::Tensor & out);
TORCH_API at::Tensor median(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> median_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> median_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices);
TORCH_API at::Tensor nanmedian(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nanmedian_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nanmedian_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & values, at::Tensor & indices);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> min(const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> min_out(at::Tensor & min, at::Tensor & min_indices, const at::Tensor & self, int64_t dim, bool keepdim=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> min_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & min, at::Tensor & min_indices);
TORCH_API at::Tensor & amin_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim={}, bool keepdim=false);
TORCH_API at::Tensor & amin_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, at::Tensor & out);
TORCH_API at::Tensor mm(const at::Tensor & self, const at::Tensor & mat2);
TORCH_API at::Tensor & mm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat2);
TORCH_API at::Tensor & mm_outf(const at::Tensor & self, const at::Tensor & mat2, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> mode(const at::Tensor & self, int64_t dim=-1, bool keepdim=false);
TORCH_API at::Tensor mul(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & mul_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & mul_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & mul_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor mv(const at::Tensor & self, const at::Tensor & vec);
TORCH_API at::Tensor & mvlgamma_out(at::Tensor & out, const at::Tensor & self, int64_t p);
TORCH_API at::Tensor & mvlgamma_outf(const at::Tensor & self, int64_t p, at::Tensor & out);
TORCH_API at::Tensor narrow_copy(const at::Tensor & self, int64_t dim, int64_t start, int64_t length);
TORCH_API at::Tensor & narrow_copy_out(at::Tensor & out, const at::Tensor & self, int64_t dim, int64_t start, int64_t length);
TORCH_API at::Tensor & narrow_copy_outf(const at::Tensor & self, int64_t dim, int64_t start, int64_t length, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_batch_norm(const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, bool training, double momentum, double eps);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_batch_norm_backward(const at::Tensor & grad_out, const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, const c10::optional<at::Tensor> & save_mean, const c10::optional<at::Tensor> & save_invstd, bool train, double eps, ::std::array<bool,3> output_mask);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> batch_norm_update_stats(const at::Tensor & input, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, double momentum);
TORCH_API at::Tensor _cdist_forward(const at::Tensor & x1, const at::Tensor & x2, double p, c10::optional<int64_t> compute_mode);
TORCH_API at::Tensor _cdist_backward(const at::Tensor & grad, const at::Tensor & x1, const at::Tensor & x2, double p, const at::Tensor & cdist);
TORCH_API at::Tensor _pdist_forward(const at::Tensor & self, double p=2);
TORCH_API at::Tensor _pdist_backward(const at::Tensor & grad, const at::Tensor & self, double p, const at::Tensor & pdist);
TORCH_API at::Tensor channel_shuffle(const at::Tensor & self, int64_t groups);
TORCH_API at::Tensor & randperm_out(at::Tensor & out, int64_t n, c10::optional<at::Generator> generator);
TORCH_API at::Tensor & randperm_outf(int64_t n, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor & range_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, const at::Scalar & step=1);
TORCH_API at::Tensor & range_outf(const at::Scalar & start, const at::Scalar & end, const at::Scalar & step, at::Tensor & out);
TORCH_API at::Tensor reciprocal(const at::Tensor & self);
TORCH_API at::Tensor & reciprocal_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & reciprocal_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & reciprocal_(at::Tensor & self);
TORCH_API at::Tensor neg(const at::Tensor & self);
TORCH_API at::Tensor & neg_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & neg_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & neg_(at::Tensor & self);
TORCH_API at::Tensor repeat_interleave(const at::Tensor & repeats, c10::optional<int64_t> output_size=c10::nullopt);
TORCH_API at::Tensor _reshape_alias(const at::Tensor & self, at::IntArrayRef size, at::IntArrayRef stride);
TORCH_API at::Tensor round(const at::Tensor & self);
TORCH_API at::Tensor & round_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & round_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & round_(at::Tensor & self);
TORCH_API at::Tensor relu(const at::Tensor & self);
TORCH_API at::Tensor & relu_(at::Tensor & self);
TORCH_API at::Tensor prelu(const at::Tensor & self, const at::Tensor & weight);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> prelu_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight);
TORCH_API at::Tensor gelu(const at::Tensor & self);
TORCH_API at::Tensor & gelu_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & gelu_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor gelu_backward(const at::Tensor & grad, const at::Tensor & self);
TORCH_API at::Tensor & gelu_backward_out(at::Tensor & grad_input, const at::Tensor & grad, const at::Tensor & self);
TORCH_API at::Tensor & gelu_backward_outf(const at::Tensor & grad, const at::Tensor & self, at::Tensor & grad_input);
TORCH_API at::Tensor hardshrink(const at::Tensor & self, const at::Scalar & lambd=0.5);
TORCH_API at::Tensor & hardshrink_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & lambd=0.5);
TORCH_API at::Tensor & hardshrink_outf(const at::Tensor & self, const at::Scalar & lambd, at::Tensor & out);
TORCH_API at::Tensor hardshrink_backward(const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd);
TORCH_API at::Tensor & hardshrink_backward_out(at::Tensor & grad_input, const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd);
TORCH_API at::Tensor & hardshrink_backward_outf(const at::Tensor & grad_out, const at::Tensor & self, const at::Scalar & lambd, at::Tensor & grad_input);
TORCH_API at::Tensor rsqrt(const at::Tensor & self);
TORCH_API at::Tensor & rsqrt_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & rsqrt_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & rsqrt_(at::Tensor & self);
TORCH_API at::Tensor silu(const at::Tensor & self);
TORCH_API at::Tensor & silu_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & silu_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & silu_(at::Tensor & self);
TORCH_API at::Tensor silu_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & silu_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & silu_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::Tensor & grad_input);
TORCH_API at::Tensor mish(const at::Tensor & self);
TORCH_API at::Tensor & mish_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & mish_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & mish_(at::Tensor & self);
TORCH_API at::Tensor mish_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor sigmoid(const at::Tensor & self);
TORCH_API at::Tensor & sigmoid_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sigmoid_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sigmoid_(at::Tensor & self);
TORCH_API at::Tensor logit(const at::Tensor & self, c10::optional<double> eps=c10::nullopt);
TORCH_API at::Tensor & logit_out(at::Tensor & out, const at::Tensor & self, c10::optional<double> eps=c10::nullopt);
TORCH_API at::Tensor & logit_outf(const at::Tensor & self, c10::optional<double> eps, at::Tensor & out);
TORCH_API at::Tensor & logit_(at::Tensor & self, c10::optional<double> eps=c10::nullopt);
TORCH_API at::Tensor sin(const at::Tensor & self);
TORCH_API at::Tensor & sin_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sin_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sin_(at::Tensor & self);
TORCH_API at::Tensor sinc(const at::Tensor & self);
TORCH_API at::Tensor & sinc_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sinc_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sinc_(at::Tensor & self);
TORCH_API at::Tensor sinh(const at::Tensor & self);
TORCH_API at::Tensor & sinh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sinh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sinh_(at::Tensor & self);
TORCH_API at::Tensor _softmax(const at::Tensor & self, int64_t dim, bool half_to_float);
TORCH_API at::Tensor _softmax_backward_data(const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, const at::Tensor & self);
TORCH_API at::Tensor & sspaddmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & sspaddmm_outf(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor _stack(at::TensorList tensors, int64_t dim=0);
TORCH_API at::Tensor & _stack_out(at::Tensor & out, at::TensorList tensors, int64_t dim=0);
TORCH_API at::Tensor & _stack_outf(at::TensorList tensors, int64_t dim, at::Tensor & out);
TORCH_API at::Tensor sum(const at::Tensor & self, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor sum(const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & sum_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & sum_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, c10::optional<at::ScalarType> dtype, at::Tensor & out);
TORCH_API at::Tensor nansum(const at::Tensor & self, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor nansum(const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & nansum_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & nansum_outf(const at::Tensor & self, at::IntArrayRef dim, bool keepdim, c10::optional<at::ScalarType> dtype, at::Tensor & out);
TORCH_API at::Tensor sqrt(const at::Tensor & self);
TORCH_API at::Tensor & sqrt_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sqrt_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sqrt_(at::Tensor & self);
TORCH_API at::Tensor & square_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & square_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor std(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor & std_out(at::Tensor & out, const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor & std_outf(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> std_mean(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor prod(const at::Tensor & self, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor prod(const at::Tensor & self, int64_t dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & prod_out(at::Tensor & out, const at::Tensor & self, int64_t dim, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & prod_outf(const at::Tensor & self, int64_t dim, bool keepdim, c10::optional<at::ScalarType> dtype, at::Tensor & out);
TORCH_API at::Tensor tan(const at::Tensor & self);
TORCH_API at::Tensor & tan_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & tan_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & tan_(at::Tensor & self);
TORCH_API at::Tensor tanh(const at::Tensor & self);
TORCH_API at::Tensor & tanh_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & tanh_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & tanh_(at::Tensor & self);
TORCH_API at::Tensor & tensordot_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, at::IntArrayRef dims_self, at::IntArrayRef dims_other);
TORCH_API at::Tensor & tensordot_outf(const at::Tensor & self, const at::Tensor & other, at::IntArrayRef dims_self, at::IntArrayRef dims_other, at::Tensor & out);
TORCH_API at::Tensor threshold(const at::Tensor & self, const at::Scalar & threshold, const at::Scalar & value);
TORCH_API at::Tensor & threshold_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & threshold, const at::Scalar & value);
TORCH_API at::Tensor & threshold_outf(const at::Tensor & self, const at::Scalar & threshold, const at::Scalar & value, at::Tensor & out);
TORCH_API at::Tensor & threshold_(at::Tensor & self, const at::Scalar & threshold, const at::Scalar & value);
TORCH_API at::Tensor threshold_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & threshold);
TORCH_API at::Tensor & threshold_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & threshold);
TORCH_API at::Tensor & threshold_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & threshold, at::Tensor & grad_input);
TORCH_API at::Tensor flip(const at::Tensor & self, at::IntArrayRef dims);
TORCH_API at::Tensor roll(const at::Tensor & self, at::IntArrayRef shifts, at::IntArrayRef dims={});
TORCH_API at::Tensor trunc(const at::Tensor & self);
TORCH_API at::Tensor & trunc_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & trunc_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & trunc_(at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _unique(const at::Tensor & self, bool sorted=true, bool return_inverse=false);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> unique_dim(const at::Tensor & self, int64_t dim, bool sorted=true, bool return_inverse=false, bool return_counts=false);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> unique_consecutive(const at::Tensor & self, bool return_inverse=false, bool return_counts=false, c10::optional<int64_t> dim=c10::nullopt);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> unique_dim_consecutive(const at::Tensor & self, int64_t dim, bool return_inverse=false, bool return_counts=false);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> _unique2(const at::Tensor & self, bool sorted=true, bool return_inverse=false, bool return_counts=false);
TORCH_API at::Tensor var(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor & var_out(at::Tensor & out, const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor & var_outf(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> var_mean(const at::Tensor & self, c10::optional<at::IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim=false);
TORCH_API at::Tensor _s_where(const at::Tensor & condition, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor _standard_gamma_grad(const at::Tensor & self, const at::Tensor & output);
TORCH_API at::Tensor _standard_gamma(const at::Tensor & self, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor _dirichlet_grad(const at::Tensor & x, const at::Tensor & alpha, const at::Tensor & total);
TORCH_API at::Tensor _sample_dirichlet(const at::Tensor & self, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor poisson(const at::Tensor & self, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor binomial(const at::Tensor & count, const at::Tensor & prob, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor norm(const at::Tensor & self, const c10::optional<at::Scalar> & p, at::ScalarType dtype);
TORCH_API at::Tensor norm(const at::Tensor & self, const at::Scalar & p=2);
TORCH_API at::Tensor norm(const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim, at::ScalarType dtype);
TORCH_API at::Tensor & norm_out(at::Tensor & out, const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim, at::ScalarType dtype);
TORCH_API at::Tensor & norm_outf(const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim, at::ScalarType dtype, at::Tensor & out);
TORCH_API at::Tensor norm(const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim=false);
TORCH_API at::Tensor & norm_out(at::Tensor & out, const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim=false);
TORCH_API at::Tensor & norm_outf(const at::Tensor & self, const c10::optional<at::Scalar> & p, at::IntArrayRef dim, bool keepdim, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> frexp_out(at::Tensor & mantissa, at::Tensor & exponent, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> frexp_outf(const at::Tensor & self, at::Tensor & mantissa, at::Tensor & exponent);
TORCH_API at::Tensor & zero_(at::Tensor & self);
TORCH_API at::Tensor sub(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & sub_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor & sub_outf(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & sub_(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor rsub(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha=1);
TORCH_API at::Tensor heaviside(const at::Tensor & self, const at::Tensor & values);
TORCH_API at::Tensor & heaviside_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & values);
TORCH_API at::Tensor & heaviside_outf(const at::Tensor & self, const at::Tensor & values, at::Tensor & out);
TORCH_API at::Tensor & heaviside_(at::Tensor & self, const at::Tensor & values);
TORCH_API at::Tensor addmm(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addmm_outf(const at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & addmm_(at::Tensor & self, const at::Tensor & mat1, const at::Tensor & mat2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor to_sparse(const at::Tensor & self, int64_t sparse_dim);
TORCH_API at::Tensor to_sparse(const at::Tensor & self);
TORCH_API at::Tensor to_mkldnn(const at::Tensor & self, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor quantize_per_tensor(const at::Tensor & self, double scale, int64_t zero_point, at::ScalarType dtype);
TORCH_API at::Tensor quantize_per_tensor(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, at::ScalarType dtype);
TORCH_API ::std::vector<at::Tensor> quantize_per_tensor(at::TensorList tensors, const at::Tensor & scales, const at::Tensor & zero_points, at::ScalarType dtype);
TORCH_API at::Tensor quantize_per_channel(const at::Tensor & self, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::ScalarType dtype);
TORCH_API at::Tensor dequantize(const at::Tensor & self);
TORCH_API at::Tensor _make_per_tensor_quantized_tensor(const at::Tensor & self, double scale, int64_t zero_point);
TORCH_API at::Tensor _make_per_channel_quantized_tensor(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t axis);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> fake_quantize_per_tensor_affine_cachemask(const at::Tensor & self, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _fake_quantize_per_tensor_affine_cachemask_tensor_qparams(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, const at::Tensor & fake_quant_enabled, int64_t quant_min, int64_t quant_max);
TORCH_API at::Tensor _fake_quantize_learnable_per_tensor_affine(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t quant_min, int64_t quant_max, double grad_factor=1.0);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> fake_quantize_per_channel_affine_cachemask(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max);
TORCH_API at::Tensor _fake_quantize_learnable_per_channel_affine(const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max, double grad_factor=1.0);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _fused_moving_avg_obs_fq_helper(const at::Tensor & self, const at::Tensor & observer_on, const at::Tensor & fake_quant_on, at::Tensor & running_min, at::Tensor & running_max, at::Tensor & scale, at::Tensor & zero_point, double averaging_const, int64_t quant_min, int64_t quant_max, int64_t ch_axis, bool per_row_fake_quant=false, bool symmetric_quant=false);
TORCH_API at::Scalar _local_scalar_dense(const at::Tensor & self);
TORCH_API at::Tensor & set_(at::Tensor & self, at::Storage source);
TORCH_API at::Tensor & set_(at::Tensor & self, at::Storage source, int64_t storage_offset, at::IntArrayRef size, at::IntArrayRef stride={});
TORCH_API at::Tensor & set_(at::Tensor & self, const at::Tensor & source);
TORCH_API at::Tensor & set_(at::Tensor & self);
TORCH_API bool is_set_to(const at::Tensor & self, const at::Tensor & tensor);
TORCH_API at::Tensor & masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Scalar & value);
TORCH_API at::Tensor & masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Tensor & value);
TORCH_API at::Tensor & masked_scatter_(at::Tensor & self, const at::Tensor & mask, const at::Tensor & source);
TORCH_API at::Tensor view(const at::Tensor & self, at::IntArrayRef size);
TORCH_API at::Tensor & put_(at::Tensor & self, const at::Tensor & index, const at::Tensor & source, bool accumulate=false);
TORCH_API at::Tensor & index_add_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source, const at::Scalar & alpha);
TORCH_API at::Tensor & index_fill_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value);
TORCH_API at::Tensor & index_fill_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & value);
TORCH_API at::Tensor scatter(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor & scatter_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor & scatter_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, at::Tensor & out);
TORCH_API at::Tensor & scatter_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor scatter(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value);
TORCH_API at::Tensor & scatter_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value);
TORCH_API at::Tensor & scatter_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, at::Tensor & out);
TORCH_API at::Tensor & scatter_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value);
TORCH_API at::Tensor scatter(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, c10::string_view reduce);
TORCH_API at::Tensor & scatter_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, c10::string_view reduce);
TORCH_API at::Tensor & scatter_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, c10::string_view reduce, at::Tensor & out);
TORCH_API at::Tensor & scatter_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, c10::string_view reduce);
TORCH_API at::Tensor scatter(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, c10::string_view reduce);
TORCH_API at::Tensor & scatter_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, c10::string_view reduce);
TORCH_API at::Tensor & scatter_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, c10::string_view reduce, at::Tensor & out);
TORCH_API at::Tensor & scatter_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, c10::string_view reduce);
TORCH_API at::Tensor scatter_add(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor & scatter_add_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor & scatter_add_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src, at::Tensor & out);
TORCH_API at::Tensor & scatter_add_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & src);
TORCH_API at::Tensor eq(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & eq_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & eq_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & eq_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor eq(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & eq_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & eq_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & eq_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_and(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_and_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_and_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_and_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_or(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_or_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_or_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_or_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_xor(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_xor_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_xor_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_xor_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor __lshift__(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & __ilshift__(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor __lshift__(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & __ilshift__(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_left_shift(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_left_shift_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_left_shift_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_left_shift_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_left_shift(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & bitwise_left_shift_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & bitwise_left_shift_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_left_shift_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor bitwise_left_shift(const at::Scalar & self, const at::Tensor & other);
TORCH_API at::Tensor __rshift__(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & __irshift__(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor __rshift__(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & __irshift__(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_right_shift(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_right_shift_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & bitwise_right_shift_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_right_shift_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor bitwise_right_shift(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & bitwise_right_shift_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & bitwise_right_shift_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & bitwise_right_shift_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor bitwise_right_shift(const at::Scalar & self, const at::Tensor & other);
TORCH_API at::Tensor & tril_out(at::Tensor & out, const at::Tensor & self, int64_t diagonal=0);
TORCH_API at::Tensor & tril_outf(const at::Tensor & self, int64_t diagonal, at::Tensor & out);
TORCH_API at::Tensor & tril_(at::Tensor & self, int64_t diagonal=0);
TORCH_API at::Tensor & triu_out(at::Tensor & out, const at::Tensor & self, int64_t diagonal=0);
TORCH_API at::Tensor & triu_outf(const at::Tensor & self, int64_t diagonal, at::Tensor & out);
TORCH_API at::Tensor & triu_(at::Tensor & self, int64_t diagonal=0);
TORCH_API at::Tensor digamma(const at::Tensor & self);
TORCH_API at::Tensor & digamma_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & digamma_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & digamma_(at::Tensor & self);
TORCH_API at::Tensor lerp(const at::Tensor & self, const at::Tensor & end, const at::Scalar & weight);
TORCH_API at::Tensor & lerp_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & end, const at::Scalar & weight);
TORCH_API at::Tensor & lerp_outf(const at::Tensor & self, const at::Tensor & end, const at::Scalar & weight, at::Tensor & out);
TORCH_API at::Tensor & lerp_(at::Tensor & self, const at::Tensor & end, const at::Scalar & weight);
TORCH_API at::Tensor lerp(const at::Tensor & self, const at::Tensor & end, const at::Tensor & weight);
TORCH_API at::Tensor & lerp_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & end, const at::Tensor & weight);
TORCH_API at::Tensor & lerp_outf(const at::Tensor & self, const at::Tensor & end, const at::Tensor & weight, at::Tensor & out);
TORCH_API at::Tensor & lerp_(at::Tensor & self, const at::Tensor & end, const at::Tensor & weight);
TORCH_API at::Tensor addbmm(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addbmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addbmm_outf(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);
TORCH_API at::Tensor & addbmm_(at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
TORCH_API at::Tensor & addcdiv_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value=1);
TORCH_API at::Tensor & addcdiv_outf(const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value, at::Tensor & out);
TORCH_API at::Tensor & random_(at::Tensor & self, int64_t from, c10::optional<int64_t> to, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & random_(at::Tensor & self, int64_t to, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & random_(at::Tensor & self, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & uniform_(at::Tensor & self, double from=0, double to=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & cauchy_(at::Tensor & self, double median=0, double sigma=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & log_normal_(at::Tensor & self, double mean=1, double std=2, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & exponential_(at::Tensor & self, double lambd=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & geometric_(at::Tensor & self, double p, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & diag_out(at::Tensor & out, const at::Tensor & self, int64_t diagonal=0);
TORCH_API at::Tensor & diag_outf(const at::Tensor & self, int64_t diagonal, at::Tensor & out);
TORCH_API at::Tensor cross(const at::Tensor & self, const at::Tensor & other, c10::optional<int64_t> dim=c10::nullopt);
TORCH_API at::Tensor & cross_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other, c10::optional<int64_t> dim=c10::nullopt);
TORCH_API at::Tensor & cross_outf(const at::Tensor & self, const at::Tensor & other, c10::optional<int64_t> dim, at::Tensor & out);
TORCH_API at::Tensor tril_indices(int64_t row, int64_t col, int64_t offset=0, at::TensorOptions options=at::kLong);
TORCH_API at::Tensor tril_indices(int64_t row, int64_t col, int64_t offset, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory);
TORCH_API at::Tensor triu_indices(int64_t row, int64_t col, int64_t offset=0, at::TensorOptions options=at::kLong);
TORCH_API at::Tensor triu_indices(int64_t row, int64_t col, int64_t offset, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory);
TORCH_API at::Tensor trace(const at::Tensor & self);
TORCH_API at::Tensor ne(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & ne_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & ne_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & ne_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor ne(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & ne_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & ne_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & ne_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor ge(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & ge_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & ge_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & ge_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor ge(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & ge_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & ge_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & ge_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor le(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & le_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & le_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & le_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor le(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & le_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & le_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & le_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor gt(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & gt_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & gt_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & gt_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor gt(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & gt_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & gt_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & gt_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor lt(const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & lt_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor & lt_outf(const at::Tensor & self, const at::Scalar & other, at::Tensor & out);
TORCH_API at::Tensor & lt_(at::Tensor & self, const at::Scalar & other);
TORCH_API at::Tensor lt(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & lt_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & lt_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & lt_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor take(const at::Tensor & self, const at::Tensor & index);
TORCH_API at::Tensor & take_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & index);
TORCH_API at::Tensor & take_outf(const at::Tensor & self, const at::Tensor & index, at::Tensor & out);
TORCH_API at::Tensor index_select(const at::Tensor & self, int64_t dim, const at::Tensor & index);
TORCH_API at::Tensor & index_select_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index);
TORCH_API at::Tensor & index_select_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, at::Tensor & out);
TORCH_API at::Tensor masked_select(const at::Tensor & self, const at::Tensor & mask);
TORCH_API at::Tensor & masked_select_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & mask);
TORCH_API at::Tensor & masked_select_outf(const at::Tensor & self, const at::Tensor & mask, at::Tensor & out);
TORCH_API at::Tensor nonzero(const at::Tensor & self);
TORCH_API at::Tensor & nonzero_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & nonzero_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor gather(const at::Tensor & self, int64_t dim, const at::Tensor & index, bool sparse_grad=false);
TORCH_API at::Tensor & gather_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, bool sparse_grad=false);
TORCH_API at::Tensor & gather_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, bool sparse_grad, at::Tensor & out);
TORCH_API at::Tensor & addcmul_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value=1);
TORCH_API at::Tensor & addcmul_outf(const at::Tensor & self, const at::Tensor & tensor1, const at::Tensor & tensor2, const at::Scalar & value, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> lstsq(const at::Tensor & self, const at::Tensor & A);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> lstsq_out(at::Tensor & X, at::Tensor & qr, const at::Tensor & self, const at::Tensor & A);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> lstsq_outf(const at::Tensor & self, const at::Tensor & A, at::Tensor & X, at::Tensor & qr);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> triangular_solve(const at::Tensor & self, const at::Tensor & A, bool upper=true, bool transpose=false, bool unitriangular=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> triangular_solve_out(at::Tensor & X, at::Tensor & M, const at::Tensor & self, const at::Tensor & A, bool upper=true, bool transpose=false, bool unitriangular=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> triangular_solve_outf(const at::Tensor & self, const at::Tensor & A, bool upper, bool transpose, bool unitriangular, at::Tensor & X, at::Tensor & M);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _symeig_helper(const at::Tensor & self, bool eigenvectors, bool upper);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> _svd_helper(const at::Tensor & self, bool some, bool compute_uv);
TORCH_API at::Tensor cholesky(const at::Tensor & self, bool upper=false);
TORCH_API at::Tensor & cholesky_out(at::Tensor & out, const at::Tensor & self, bool upper=false);
TORCH_API at::Tensor & cholesky_outf(const at::Tensor & self, bool upper, at::Tensor & out);
TORCH_API at::Tensor _cholesky_solve_helper(const at::Tensor & self, const at::Tensor & A, bool upper);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _solve_helper(const at::Tensor & self, const at::Tensor & A);
TORCH_API at::Tensor cholesky_inverse(const at::Tensor & self, bool upper=false);
TORCH_API at::Tensor & cholesky_inverse_out(at::Tensor & out, const at::Tensor & self, bool upper=false);
TORCH_API at::Tensor & cholesky_inverse_outf(const at::Tensor & self, bool upper, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> geqrf(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> geqrf_out(at::Tensor & a, at::Tensor & tau, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> geqrf_outf(const at::Tensor & self, at::Tensor & a, at::Tensor & tau);
TORCH_API at::Tensor ormqr(const at::Tensor & self, const at::Tensor & input2, const at::Tensor & input3, bool left=true, bool transpose=false);
TORCH_API at::Tensor & ormqr_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & input2, const at::Tensor & input3, bool left=true, bool transpose=false);
TORCH_API at::Tensor & ormqr_outf(const at::Tensor & self, const at::Tensor & input2, const at::Tensor & input3, bool left, bool transpose, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> _lu_with_info(const at::Tensor & self, bool pivot=true, bool check_errors=true);
TORCH_API at::Tensor lu_solve(const at::Tensor & self, const at::Tensor & LU_data, const at::Tensor & LU_pivots);
TORCH_API at::Tensor & lu_solve_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & LU_data, const at::Tensor & LU_pivots);
TORCH_API at::Tensor & lu_solve_outf(const at::Tensor & self, const at::Tensor & LU_data, const at::Tensor & LU_pivots, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> lu_unpack(const at::Tensor & LU_data, const at::Tensor & LU_pivots, bool unpack_data=true, bool unpack_pivots=true);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> lu_unpack_out(at::Tensor & P, at::Tensor & L, at::Tensor & U, const at::Tensor & LU_data, const at::Tensor & LU_pivots, bool unpack_data=true, bool unpack_pivots=true);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> lu_unpack_outf(const at::Tensor & LU_data, const at::Tensor & LU_pivots, bool unpack_data, bool unpack_pivots, at::Tensor & P, at::Tensor & L, at::Tensor & U);
TORCH_API at::Tensor multinomial(const at::Tensor & self, int64_t num_samples, bool replacement=false, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & multinomial_out(at::Tensor & out, const at::Tensor & self, int64_t num_samples, bool replacement=false, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & multinomial_outf(const at::Tensor & self, int64_t num_samples, bool replacement, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor lgamma(const at::Tensor & self);
TORCH_API at::Tensor & lgamma_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & lgamma_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & lgamma_(at::Tensor & self);
TORCH_API at::Tensor polygamma(int64_t n, const at::Tensor & self);
TORCH_API at::Tensor & polygamma_out(at::Tensor & out, int64_t n, const at::Tensor & self);
TORCH_API at::Tensor & polygamma_outf(int64_t n, const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor erfinv(const at::Tensor & self);
TORCH_API at::Tensor & erfinv_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & erfinv_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & erfinv_(at::Tensor & self);
TORCH_API at::Tensor i0(const at::Tensor & self);
TORCH_API at::Tensor & i0_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & i0_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & i0_(at::Tensor & self);
TORCH_API at::Tensor sign(const at::Tensor & self);
TORCH_API at::Tensor & sign_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & sign_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & sign_(at::Tensor & self);
TORCH_API at::Tensor signbit(const at::Tensor & self);
TORCH_API at::Tensor & signbit_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & signbit_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor atan2(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & atan2_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & atan2_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & atan2_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor histc(const at::Tensor & self, int64_t bins=100, const at::Scalar & min=0, const at::Scalar & max=0);
TORCH_API at::Tensor & histc_out(at::Tensor & out, const at::Tensor & self, int64_t bins=100, const at::Scalar & min=0, const at::Scalar & max=0);
TORCH_API at::Tensor & histc_outf(const at::Tensor & self, int64_t bins, const at::Scalar & min, const at::Scalar & max, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> histogram(const at::Tensor & self, const at::Tensor & bins, const c10::optional<at::Tensor> & weight={}, bool density=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> histogram_out(at::Tensor & hist, at::Tensor & bin_edges, const at::Tensor & self, const at::Tensor & bins, const c10::optional<at::Tensor> & weight={}, bool density=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> histogram_outf(const at::Tensor & self, const at::Tensor & bins, const c10::optional<at::Tensor> & weight, bool density, at::Tensor & hist, at::Tensor & bin_edges);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> histogram(const at::Tensor & self, int64_t bins=100, c10::optional<at::ArrayRef<double>> range=c10::nullopt, const c10::optional<at::Tensor> & weight={}, bool density=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> histogram_out(at::Tensor & hist, at::Tensor & bin_edges, const at::Tensor & self, int64_t bins=100, c10::optional<at::ArrayRef<double>> range=c10::nullopt, const c10::optional<at::Tensor> & weight={}, bool density=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> histogram_outf(const at::Tensor & self, int64_t bins, c10::optional<at::ArrayRef<double>> range, const c10::optional<at::Tensor> & weight, bool density, at::Tensor & hist, at::Tensor & bin_edges);
TORCH_API at::Tensor fmod(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmod_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmod_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & fmod_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor hypot(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & hypot_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & hypot_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & hypot_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor igamma(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & igamma_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & igamma_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & igamma_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor igammac(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & igammac_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & igammac_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & igammac_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor nextafter(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & nextafter_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & nextafter_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & nextafter_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor remainder(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & remainder_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & remainder_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor & remainder_(at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor remainder(const at::Scalar & self, const at::Tensor & other);
TORCH_API at::Tensor min(const at::Tensor & self);
TORCH_API at::Tensor fmin(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmin_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmin_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor max(const at::Tensor & self);
TORCH_API at::Tensor fmax(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmax_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & fmax_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor maximum(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & maximum_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & maximum_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor minimum(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & minimum_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & minimum_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> sort(const at::Tensor & self, int64_t dim=-1, bool descending=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> sort_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t dim=-1, bool descending=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> sort_outf(const at::Tensor & self, int64_t dim, bool descending, at::Tensor & values, at::Tensor & indices);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> sort(const at::Tensor & self, c10::optional<bool> stable, int64_t dim=-1, bool descending=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> sort_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, c10::optional<bool> stable, int64_t dim=-1, bool descending=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> sort_outf(const at::Tensor & self, c10::optional<bool> stable, int64_t dim, bool descending, at::Tensor & values, at::Tensor & indices);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> topk(const at::Tensor & self, int64_t k, int64_t dim=-1, bool largest=true, bool sorted=true);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> topk_out(at::Tensor & values, at::Tensor & indices, const at::Tensor & self, int64_t k, int64_t dim=-1, bool largest=true, bool sorted=true);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> topk_outf(const at::Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted, at::Tensor & values, at::Tensor & indices);
TORCH_API at::Tensor all(const at::Tensor & self);
TORCH_API at::Tensor any(const at::Tensor & self);
TORCH_API at::Tensor renorm(const at::Tensor & self, const at::Scalar & p, int64_t dim, const at::Scalar & maxnorm);
TORCH_API at::Tensor & renorm_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & p, int64_t dim, const at::Scalar & maxnorm);
TORCH_API at::Tensor & renorm_outf(const at::Tensor & self, const at::Scalar & p, int64_t dim, const at::Scalar & maxnorm, at::Tensor & out);
TORCH_API at::Tensor & renorm_(at::Tensor & self, const at::Scalar & p, int64_t dim, const at::Scalar & maxnorm);
TORCH_API at::Tensor unfold(const at::Tensor & self, int64_t dimension, int64_t size, int64_t step);
TORCH_API at::Tensor unfold_backward(const at::Tensor & grad_in, at::IntArrayRef input_sizes, int64_t dim, int64_t size, int64_t step);
TORCH_API bool equal(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor pow(const at::Tensor & self, const at::Tensor & exponent);
TORCH_API at::Tensor & pow_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & exponent);
TORCH_API at::Tensor & pow_outf(const at::Tensor & self, const at::Tensor & exponent, at::Tensor & out);
TORCH_API at::Tensor & pow_(at::Tensor & self, const at::Tensor & exponent);
TORCH_API at::Tensor pow(const at::Scalar & self, const at::Tensor & exponent);
TORCH_API at::Tensor & pow_out(at::Tensor & out, const at::Scalar & self, const at::Tensor & exponent);
TORCH_API at::Tensor & pow_outf(const at::Scalar & self, const at::Tensor & exponent, at::Tensor & out);
TORCH_API at::Tensor pow(const at::Tensor & self, const at::Scalar & exponent);
TORCH_API at::Tensor & pow_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & exponent);
TORCH_API at::Tensor & pow_outf(const at::Tensor & self, const at::Scalar & exponent, at::Tensor & out);
TORCH_API at::Tensor & pow_(at::Tensor & self, const at::Scalar & exponent);
TORCH_API at::Tensor & normal_(at::Tensor & self, double mean=0, double std=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor normal(const at::Tensor & mean, double std=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_out(at::Tensor & out, const at::Tensor & mean, double std=1, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_outf(const at::Tensor & mean, double std, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor normal(double mean, const at::Tensor & std, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_out(at::Tensor & out, double mean, const at::Tensor & std, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_outf(double mean, const at::Tensor & std, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor normal(const at::Tensor & mean, const at::Tensor & std, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_out(at::Tensor & out, const at::Tensor & mean, const at::Tensor & std, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & normal_outf(const at::Tensor & mean, const at::Tensor & std, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor & _index_copy_(at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & source);
TORCH_API at::Tensor _cumsum(const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _cumsum_out(at::Tensor & out, const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _cumsum_outf(const at::Tensor & self, int64_t dim, at::Tensor & out);
TORCH_API at::Tensor _cumprod(const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _cumprod_out(at::Tensor & out, const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & _cumprod_outf(const at::Tensor & self, int64_t dim, at::Tensor & out);
TORCH_API at::Tensor _cat(at::TensorList tensors, int64_t dim=0);
TORCH_API at::Tensor & _cat_out(at::Tensor & out, at::TensorList tensors, int64_t dim=0);
TORCH_API at::Tensor & _cat_outf(at::TensorList tensors, int64_t dim, at::Tensor & out);
TORCH_API ::std::vector<at::Tensor> _foreach_add(at::TensorList tensors, const at::Scalar & scalar);
TORCH_API void _foreach_add_(at::TensorList self, const at::Scalar & scalar);
TORCH_API ::std::vector<at::Tensor> _foreach_sub(at::TensorList tensors, const at::Scalar & scalar);
TORCH_API void _foreach_sub_(at::TensorList self, const at::Scalar & scalar);
TORCH_API ::std::vector<at::Tensor> _foreach_mul(at::TensorList tensors, const at::Scalar & scalar);
TORCH_API void _foreach_mul_(at::TensorList self, const at::Scalar & scalar);
TORCH_API ::std::vector<at::Tensor> _foreach_div(at::TensorList tensors, const at::Scalar & scalar);
TORCH_API void _foreach_div_(at::TensorList self, const at::Scalar & scalar);
TORCH_API ::std::vector<at::Tensor> _foreach_add(at::TensorList tensors1, at::TensorList tensors2, const at::Scalar & alpha=1);
TORCH_API void _foreach_add_(at::TensorList self, at::TensorList other, const at::Scalar & alpha=1);
TORCH_API ::std::vector<at::Tensor> _foreach_sub(at::TensorList tensors1, at::TensorList tensors2, const at::Scalar & alpha=1);
TORCH_API void _foreach_sub_(at::TensorList self, at::TensorList other, const at::Scalar & alpha=1);
TORCH_API ::std::vector<at::Tensor> _foreach_mul(at::TensorList tensors1, at::TensorList tensors2);
TORCH_API void _foreach_mul_(at::TensorList self, at::TensorList other);
TORCH_API ::std::vector<at::Tensor> _foreach_div(at::TensorList tensors1, at::TensorList tensors2);
TORCH_API void _foreach_div_(at::TensorList self, at::TensorList other);
TORCH_API ::std::vector<at::Tensor> _foreach_add(at::TensorList tensors, at::ArrayRef<at::Scalar> scalars);
TORCH_API void _foreach_add_(at::TensorList self, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_sub(at::TensorList tensors, at::ArrayRef<at::Scalar> scalars);
TORCH_API void _foreach_sub_(at::TensorList self, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_div(at::TensorList tensors, at::ArrayRef<at::Scalar> scalars);
TORCH_API void _foreach_div_(at::TensorList self, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_mul(at::TensorList tensors, at::ArrayRef<at::Scalar> scalars);
TORCH_API void _foreach_mul_(at::TensorList self, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_exp(at::TensorList tensors);
TORCH_API void _foreach_zero_(at::TensorList self);
TORCH_API void _foreach_exp_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_sqrt(at::TensorList tensors);
TORCH_API void _foreach_sqrt_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_abs(at::TensorList tensors);
TORCH_API void _foreach_abs_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_acos(at::TensorList tensors);
TORCH_API void _foreach_acos_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_asin(at::TensorList tensors);
TORCH_API void _foreach_asin_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_atan(at::TensorList tensors);
TORCH_API void _foreach_atan_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_ceil(at::TensorList tensors);
TORCH_API void _foreach_ceil_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_cos(at::TensorList tensors);
TORCH_API void _foreach_cos_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_cosh(at::TensorList tensors);
TORCH_API void _foreach_cosh_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_erf(at::TensorList tensors);
TORCH_API void _foreach_erf_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_erfc(at::TensorList tensors);
TORCH_API void _foreach_erfc_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_expm1(at::TensorList tensors);
TORCH_API void _foreach_expm1_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_floor(at::TensorList tensors);
TORCH_API void _foreach_floor_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_log(at::TensorList tensors);
TORCH_API void _foreach_log_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_log10(at::TensorList tensors);
TORCH_API void _foreach_log10_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_log1p(at::TensorList tensors);
TORCH_API void _foreach_log1p_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_log2(at::TensorList tensors);
TORCH_API void _foreach_log2_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_neg(at::TensorList tensors);
TORCH_API void _foreach_neg_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_tan(at::TensorList tensors);
TORCH_API void _foreach_tan_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_tanh(at::TensorList tensors);
TORCH_API void _foreach_tanh_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_sin(at::TensorList tensors);
TORCH_API void _foreach_sin_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_sinh(at::TensorList tensors);
TORCH_API void _foreach_sinh_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_round(at::TensorList tensors);
TORCH_API void _foreach_round_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_lgamma(at::TensorList tensors);
TORCH_API void _foreach_lgamma_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_frac(at::TensorList tensors);
TORCH_API void _foreach_frac_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_reciprocal(at::TensorList tensors);
TORCH_API void _foreach_reciprocal_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_sigmoid(at::TensorList tensors);
TORCH_API void _foreach_sigmoid_(at::TensorList self);
TORCH_API ::std::vector<at::Tensor> _foreach_trunc(at::TensorList tensors);
TORCH_API void _foreach_trunc_(at::TensorList self);
TORCH_API void _foreach_addcdiv_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1);
TORCH_API void _foreach_addcmul_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1);
TORCH_API void _foreach_addcdiv_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef<at::Scalar> scalars);
TORCH_API void _foreach_addcmul_(at::TensorList self, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_addcdiv(at::TensorList input, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1);
TORCH_API ::std::vector<at::Tensor> _foreach_addcmul(at::TensorList input, at::TensorList tensor1, at::TensorList tensor2, const at::Scalar & value=1);
TORCH_API ::std::vector<at::Tensor> _foreach_addcdiv(at::TensorList input, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_addcmul(at::TensorList input, at::TensorList tensor1, at::TensorList tensor2, at::ArrayRef<at::Scalar> scalars);
TORCH_API ::std::vector<at::Tensor> _foreach_maximum(at::TensorList tensors1, at::TensorList tensors2);
TORCH_API ::std::vector<at::Tensor> _foreach_minimum(at::TensorList tensors1, at::TensorList tensors2);
TORCH_API at::Tensor bucketize(const at::Tensor & self, const at::Tensor & boundaries, bool out_int32=false, bool right=false);
TORCH_API at::Tensor & bucketize_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & boundaries, bool out_int32=false, bool right=false);
TORCH_API at::Tensor & bucketize_outf(const at::Tensor & self, const at::Tensor & boundaries, bool out_int32, bool right, at::Tensor & out);
TORCH_API at::Tensor bucketize(const at::Scalar & self, const at::Tensor & boundaries, bool out_int32=false, bool right=false);
TORCH_API at::Tensor searchsorted(const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32=false, bool right=false);
TORCH_API at::Tensor & searchsorted_out(at::Tensor & out, const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32=false, bool right=false);
TORCH_API at::Tensor & searchsorted_outf(const at::Tensor & sorted_sequence, const at::Tensor & self, bool out_int32, bool right, at::Tensor & out);
TORCH_API at::Tensor searchsorted(const at::Tensor & sorted_sequence, const at::Scalar & self, bool out_int32=false, bool right=false);
TORCH_API at::Tensor mse_loss(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & mse_loss_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & mse_loss_outf(const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & out);
TORCH_API at::Tensor mse_loss_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction);
TORCH_API at::Tensor & mse_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction);
TORCH_API at::Tensor & mse_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & grad_input);
TORCH_API at::Tensor & l1_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction);
TORCH_API at::Tensor & l1_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & grad_input);
TORCH_API at::Tensor multi_margin_loss(const at::Tensor & self, const at::Tensor & target, const at::Scalar & p=1, const at::Scalar & margin=1, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & multi_margin_loss_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, const at::Scalar & p=1, const at::Scalar & margin=1, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & multi_margin_loss_outf(const at::Tensor & self, const at::Tensor & target, const at::Scalar & p, const at::Scalar & margin, const c10::optional<at::Tensor> & weight, int64_t reduction, at::Tensor & out);
TORCH_API at::Tensor multi_margin_loss_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const at::Scalar & p, const at::Scalar & margin, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & multi_margin_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const at::Scalar & p, const at::Scalar & margin, const c10::optional<at::Tensor> & weight={}, int64_t reduction=at::Reduction::Mean);
TORCH_API at::Tensor & multi_margin_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const at::Scalar & p, const at::Scalar & margin, const c10::optional<at::Tensor> & weight, int64_t reduction, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> multilabel_margin_loss_forward(const at::Tensor & self, const at::Tensor & target, int64_t reduction);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> multilabel_margin_loss_forward_out(at::Tensor & output, at::Tensor & is_target, const at::Tensor & self, const at::Tensor & target, int64_t reduction);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> multilabel_margin_loss_forward_outf(const at::Tensor & self, const at::Tensor & target, int64_t reduction, at::Tensor & output, at::Tensor & is_target);
TORCH_API at::Tensor multilabel_margin_loss_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target);
TORCH_API at::Tensor & multilabel_margin_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target);
TORCH_API at::Tensor & multilabel_margin_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, const at::Tensor & is_target, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> nll_loss_forward(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nll_loss_forward_out(at::Tensor & output, at::Tensor & total_weight, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nll_loss_forward_outf(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, at::Tensor & output, at::Tensor & total_weight);
TORCH_API at::Tensor nll_loss_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight);
TORCH_API at::Tensor & nll_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight);
TORCH_API at::Tensor & nll_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> nll_loss2d_forward(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nll_loss2d_forward_out(at::Tensor & output, at::Tensor & total_weight, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> nll_loss2d_forward_outf(const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, at::Tensor & output, at::Tensor & total_weight);
TORCH_API at::Tensor nll_loss2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight);
TORCH_API at::Tensor & nll_loss2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight);
TORCH_API at::Tensor & nll_loss2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, const c10::optional<at::Tensor> & weight, int64_t reduction, int64_t ignore_index, const at::Tensor & total_weight, at::Tensor & grad_input);
TORCH_API at::Tensor smooth_l1_loss(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, double beta=1.0);
TORCH_API at::Tensor & smooth_l1_loss_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, double beta=1.0);
TORCH_API at::Tensor & smooth_l1_loss_outf(const at::Tensor & self, const at::Tensor & target, int64_t reduction, double beta, at::Tensor & out);
TORCH_API at::Tensor & smooth_l1_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, double beta);
TORCH_API at::Tensor & smooth_l1_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, double beta, at::Tensor & grad_input);
TORCH_API at::Tensor huber_loss(const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, double delta=1.0);
TORCH_API at::Tensor & huber_loss_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & target, int64_t reduction=at::Reduction::Mean, double delta=1.0);
TORCH_API at::Tensor & huber_loss_outf(const at::Tensor & self, const at::Tensor & target, int64_t reduction, double delta, at::Tensor & out);
TORCH_API at::Tensor & huber_loss_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, double delta);
TORCH_API at::Tensor & huber_loss_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & target, int64_t reduction, double delta, at::Tensor & grad_input);
TORCH_API at::Tensor elu(const at::Tensor & self, const at::Scalar & alpha=1, const at::Scalar & scale=1, const at::Scalar & input_scale=1);
TORCH_API at::Tensor & elu_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & alpha=1, const at::Scalar & scale=1, const at::Scalar & input_scale=1);
TORCH_API at::Tensor & elu_outf(const at::Tensor & self, const at::Scalar & alpha, const at::Scalar & scale, const at::Scalar & input_scale, at::Tensor & out);
TORCH_API at::Tensor & elu_(at::Tensor & self, const at::Scalar & alpha=1, const at::Scalar & scale=1, const at::Scalar & input_scale=1);
TORCH_API at::Tensor elu_backward(const at::Tensor & grad_output, const at::Scalar & alpha, const at::Scalar & scale, const at::Scalar & input_scale, bool is_result, const at::Tensor & self_or_result);
TORCH_API at::Tensor & elu_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Scalar & alpha, const at::Scalar & scale, const at::Scalar & input_scale, bool is_result, const at::Tensor & self_or_result);
TORCH_API at::Tensor & elu_backward_outf(const at::Tensor & grad_output, const at::Scalar & alpha, const at::Scalar & scale, const at::Scalar & input_scale, bool is_result, const at::Tensor & self_or_result, at::Tensor & grad_input);
TORCH_API at::Tensor glu(const at::Tensor & self, int64_t dim=-1);
TORCH_API at::Tensor & glu_out(at::Tensor & out, const at::Tensor & self, int64_t dim=-1);
TORCH_API at::Tensor & glu_outf(const at::Tensor & self, int64_t dim, at::Tensor & out);
TORCH_API at::Tensor glu_backward(const at::Tensor & grad_output, const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & glu_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, int64_t dim);
TORCH_API at::Tensor & glu_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, int64_t dim, at::Tensor & grad_input);
TORCH_API at::Tensor hardsigmoid(const at::Tensor & self);
TORCH_API at::Tensor & hardsigmoid_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & hardsigmoid_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & hardsigmoid_(at::Tensor & self);
TORCH_API at::Tensor hardsigmoid_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & hardsigmoid_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & hardsigmoid_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::Tensor & grad_input);
TORCH_API at::Tensor hardtanh(const at::Tensor & self, const at::Scalar & min_val=-1, const at::Scalar & max_val=1);
TORCH_API at::Tensor & hardtanh_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & min_val=-1, const at::Scalar & max_val=1);
TORCH_API at::Tensor & hardtanh_outf(const at::Tensor & self, const at::Scalar & min_val, const at::Scalar & max_val, at::Tensor & out);
TORCH_API at::Tensor & hardtanh_(at::Tensor & self, const at::Scalar & min_val=-1, const at::Scalar & max_val=1);
TORCH_API at::Tensor hardtanh_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & min_val, const at::Scalar & max_val);
TORCH_API at::Tensor & hardtanh_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & min_val, const at::Scalar & max_val);
TORCH_API at::Tensor & hardtanh_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & min_val, const at::Scalar & max_val, at::Tensor & grad_input);
TORCH_API at::Tensor hardswish(const at::Tensor & self);
TORCH_API at::Tensor & hardswish_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & hardswish_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor & hardswish_(at::Tensor & self);
TORCH_API at::Tensor hardswish_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor leaky_relu(const at::Tensor & self, const at::Scalar & negative_slope=0.01);
TORCH_API at::Tensor & leaky_relu_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & negative_slope=0.01);
TORCH_API at::Tensor & leaky_relu_outf(const at::Tensor & self, const at::Scalar & negative_slope, at::Tensor & out);
TORCH_API at::Tensor & leaky_relu_(at::Tensor & self, const at::Scalar & negative_slope=0.01);
TORCH_API at::Tensor leaky_relu_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & negative_slope, bool self_is_result);
TORCH_API at::Tensor & leaky_relu_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & negative_slope, bool self_is_result);
TORCH_API at::Tensor & leaky_relu_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & negative_slope, bool self_is_result, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> log_sigmoid_forward(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> log_sigmoid_forward_out(at::Tensor & output, at::Tensor & buffer, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> log_sigmoid_forward_outf(const at::Tensor & self, at::Tensor & output, at::Tensor & buffer);
TORCH_API at::Tensor log_sigmoid_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & buffer);
TORCH_API at::Tensor & log_sigmoid_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & buffer);
TORCH_API at::Tensor & log_sigmoid_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & buffer, at::Tensor & grad_input);
TORCH_API at::Tensor rrelu_with_noise(const at::Tensor & self, const at::Tensor & noise, const at::Scalar & lower=0.125, const at::Scalar & upper=0.3333333333333333, bool training=false, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & rrelu_with_noise_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & noise, const at::Scalar & lower=0.125, const at::Scalar & upper=0.3333333333333333, bool training=false, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor & rrelu_with_noise_outf(const at::Tensor & self, const at::Tensor & noise, const at::Scalar & lower, const at::Scalar & upper, bool training, c10::optional<at::Generator> generator, at::Tensor & out);
TORCH_API at::Tensor & rrelu_with_noise_(at::Tensor & self, const at::Tensor & noise, const at::Scalar & lower=0.125, const at::Scalar & upper=0.3333333333333333, bool training=false, c10::optional<at::Generator> generator=c10::nullopt);
TORCH_API at::Tensor softplus(const at::Tensor & self, const at::Scalar & beta=1, const at::Scalar & threshold=20);
TORCH_API at::Tensor & softplus_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & beta=1, const at::Scalar & threshold=20);
TORCH_API at::Tensor & softplus_outf(const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold, at::Tensor & out);
TORCH_API at::Tensor softplus_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold, const at::Tensor & output);
TORCH_API at::Tensor & softplus_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold, const at::Tensor & output);
TORCH_API at::Tensor & softplus_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold, const at::Tensor & output, at::Tensor & grad_input);
TORCH_API at::Tensor softshrink(const at::Tensor & self, const at::Scalar & lambd=0.5);
TORCH_API at::Tensor & softshrink_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & lambd=0.5);
TORCH_API at::Tensor & softshrink_outf(const at::Tensor & self, const at::Scalar & lambd, at::Tensor & out);
TORCH_API at::Tensor softshrink_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & lambd);
TORCH_API at::Tensor & softshrink_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & lambd);
TORCH_API at::Tensor & softshrink_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & lambd, at::Tensor & grad_input);
TORCH_API at::Tensor & adaptive_avg_pool2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API at::Tensor & adaptive_avg_pool2d_outf(const at::Tensor & self, at::IntArrayRef output_size, at::Tensor & out);
TORCH_API at::Tensor _adaptive_avg_pool2d(const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API at::Tensor _adaptive_avg_pool2d_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & adaptive_avg_pool3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API at::Tensor & adaptive_avg_pool3d_outf(const at::Tensor & self, at::IntArrayRef output_size, at::Tensor & out);
TORCH_API at::Tensor _adaptive_avg_pool3d(const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API at::Tensor & adaptive_avg_pool3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API at::Tensor & adaptive_avg_pool3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::Tensor & grad_input);
TORCH_API at::Tensor _adaptive_avg_pool3d_backward(const at::Tensor & grad_output, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> adaptive_max_pool2d(const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> adaptive_max_pool2d_out(at::Tensor & out, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> adaptive_max_pool2d_outf(const at::Tensor & self, at::IntArrayRef output_size, at::Tensor & out, at::Tensor & indices);
TORCH_API at::Tensor adaptive_max_pool2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices);
TORCH_API at::Tensor & adaptive_max_pool2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices);
TORCH_API at::Tensor & adaptive_max_pool2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> adaptive_max_pool3d(const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> adaptive_max_pool3d_out(at::Tensor & out, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef output_size);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> adaptive_max_pool3d_outf(const at::Tensor & self, at::IntArrayRef output_size, at::Tensor & out, at::Tensor & indices);
TORCH_API at::Tensor adaptive_max_pool3d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices);
TORCH_API at::Tensor & adaptive_max_pool3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices);
TORCH_API at::Tensor & adaptive_max_pool3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API at::Tensor avg_pool2d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, bool ceil_mode=false, bool count_include_pad=true, c10::optional<int64_t> divisor_override=c10::nullopt);
TORCH_API at::Tensor & avg_pool2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, bool ceil_mode=false, bool count_include_pad=true, c10::optional<int64_t> divisor_override=c10::nullopt);
TORCH_API at::Tensor & avg_pool2d_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override, at::Tensor & out);
TORCH_API at::Tensor avg_pool2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override);
TORCH_API at::Tensor & avg_pool2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override);
TORCH_API at::Tensor & avg_pool2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override, at::Tensor & grad_input);
TORCH_API at::Tensor avg_pool3d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, bool ceil_mode=false, bool count_include_pad=true, c10::optional<int64_t> divisor_override=c10::nullopt);
TORCH_API at::Tensor & avg_pool3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, bool ceil_mode=false, bool count_include_pad=true, c10::optional<int64_t> divisor_override=c10::nullopt);
TORCH_API at::Tensor & avg_pool3d_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override, at::Tensor & out);
TORCH_API at::Tensor avg_pool3d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override);
TORCH_API at::Tensor & avg_pool3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override);
TORCH_API at::Tensor & avg_pool3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> fractional_max_pool2d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> fractional_max_pool2d_out(at::Tensor & output, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> fractional_max_pool2d_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples, at::Tensor & output, at::Tensor & indices);
TORCH_API at::Tensor fractional_max_pool2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices);
TORCH_API at::Tensor & fractional_max_pool2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices);
TORCH_API at::Tensor & fractional_max_pool2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> fractional_max_pool3d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> fractional_max_pool3d_out(at::Tensor & output, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> fractional_max_pool3d_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples, at::Tensor & output, at::Tensor & indices);
TORCH_API at::Tensor fractional_max_pool3d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices);
TORCH_API at::Tensor & fractional_max_pool3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices);
TORCH_API at::Tensor & fractional_max_pool3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> max_pool2d_with_indices(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_pool2d_with_indices_out(at::Tensor & out, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_pool2d_with_indices_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, at::Tensor & out, at::Tensor & indices);
TORCH_API at::Tensor max_pool2d_with_indices_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices);
TORCH_API at::Tensor & max_pool2d_with_indices_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices);
TORCH_API at::Tensor & max_pool2d_with_indices_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> max_pool3d_with_indices(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_pool3d_with_indices_out(at::Tensor & out, at::Tensor & indices, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride={}, at::IntArrayRef padding=0, at::IntArrayRef dilation=1, bool ceil_mode=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> max_pool3d_with_indices_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, at::Tensor & out, at::Tensor & indices);
TORCH_API at::Tensor max_pool3d_with_indices_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices);
TORCH_API at::Tensor & max_pool3d_with_indices_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices);
TORCH_API at::Tensor & max_pool3d_with_indices_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode, const at::Tensor & indices, at::Tensor & grad_input);
TORCH_API at::Tensor max_unpool2d(const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size);
TORCH_API at::Tensor & max_unpool2d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size);
TORCH_API at::Tensor & max_unpool2d_outf(const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::Tensor & out);
TORCH_API at::Tensor max_unpool2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size);
TORCH_API at::Tensor & max_unpool2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size);
TORCH_API at::Tensor & max_unpool2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::Tensor & grad_input);
TORCH_API at::Tensor max_unpool3d(const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API at::Tensor & max_unpool3d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API at::Tensor & max_unpool3d_outf(const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor max_unpool3d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API at::Tensor & max_unpool3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API at::Tensor & max_unpool3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & indices, at::IntArrayRef output_size, at::IntArrayRef stride, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor reflection_pad1d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad1d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor reflection_pad1d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad1d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad1d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor reflection_pad2d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad2d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor reflection_pad2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor reflection_pad3d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad3d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor reflection_pad3d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & reflection_pad3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor replication_pad1d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad1d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor replication_pad1d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad1d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad1d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor replication_pad2d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad2d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor replication_pad2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor replication_pad3d(const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad3d_outf(const at::Tensor & self, at::IntArrayRef padding, at::Tensor & out);
TORCH_API at::Tensor replication_pad3d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding);
TORCH_API at::Tensor & replication_pad3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_nearest3d(const at::Tensor & input, c10::optional<at::IntArrayRef> output_size, c10::optional<at::ArrayRef<double>> scale_factors);
TORCH_API at::Tensor upsample_nearest3d_backward(const at::Tensor & grad_output, c10::optional<at::IntArrayRef> output_size, at::IntArrayRef input_size, c10::optional<at::ArrayRef<double>> scale_factors);
TORCH_API at::Tensor upsample_linear1d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_linear1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_linear1d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales, at::Tensor & out);
TORCH_API at::Tensor upsample_linear1d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_linear1d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_linear1d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_bilinear2d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bilinear2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bilinear2d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
TORCH_API at::Tensor upsample_bilinear2d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bilinear2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bilinear2d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_bicubic2d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bicubic2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bicubic2d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
TORCH_API at::Tensor upsample_bicubic2d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bicubic2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_bicubic2d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_trilinear3d(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_trilinear3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_trilinear3d_outf(const at::Tensor & self, at::IntArrayRef output_size, bool align_corners, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
TORCH_API at::Tensor upsample_trilinear3d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_trilinear3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_trilinear3d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, bool align_corners, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_nearest1d(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest1d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest1d_outf(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales, at::Tensor & out);
TORCH_API at::Tensor upsample_nearest1d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest1d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest1d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_nearest2d(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest2d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest2d_outf(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
TORCH_API at::Tensor upsample_nearest2d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest2d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & grad_input);
TORCH_API at::Tensor upsample_nearest3d(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest3d_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest3d_outf(const at::Tensor & self, at::IntArrayRef output_size, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & out);
TORCH_API at::Tensor upsample_nearest3d_backward(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest3d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_d=c10::nullopt, c10::optional<double> scales_h=c10::nullopt, c10::optional<double> scales_w=c10::nullopt);
TORCH_API at::Tensor & upsample_nearest3d_backward_outf(const at::Tensor & grad_output, at::IntArrayRef output_size, at::IntArrayRef input_size, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w, at::Tensor & grad_input);
TORCH_API at::Tensor sigmoid_backward(const at::Tensor & grad_output, const at::Tensor & output);
TORCH_API at::Tensor & sigmoid_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & output);
TORCH_API at::Tensor & sigmoid_backward_outf(const at::Tensor & grad_output, const at::Tensor & output, at::Tensor & grad_input);
TORCH_API at::Tensor logit_backward(const at::Tensor & grad_output, const at::Tensor & self, c10::optional<double> eps=c10::nullopt);
TORCH_API at::Tensor & logit_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, c10::optional<double> eps=c10::nullopt);
TORCH_API at::Tensor & logit_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, c10::optional<double> eps, at::Tensor & grad_input);
TORCH_API at::Tensor tanh_backward(const at::Tensor & grad_output, const at::Tensor & output);
TORCH_API at::Tensor & tanh_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & output);
TORCH_API at::Tensor & tanh_backward_outf(const at::Tensor & grad_output, const at::Tensor & output, at::Tensor & grad_input);
TORCH_API at::Tensor slow_conv_transpose2d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1);
TORCH_API at::Tensor & slow_conv_transpose2d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1);
TORCH_API at::Tensor & slow_conv_transpose2d_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv_transpose2d_backward_out(at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & columns, const at::Tensor & ones);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv_transpose2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & columns, const at::Tensor & ones, at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv_transpose2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & columns, const at::Tensor & ones, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor slow_conv_transpose3d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1);
TORCH_API at::Tensor & slow_conv_transpose3d_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef output_padding=0, at::IntArrayRef dilation=1);
TORCH_API at::Tensor & slow_conv_transpose3d_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv_transpose3d_backward_out(at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & finput, const at::Tensor & fgrad_input);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv_transpose3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & finput, const at::Tensor & fgrad_input, at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv_transpose3d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef dilation, const at::Tensor & finput, const at::Tensor & fgrad_input, ::std::array<bool,3> output_mask);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> thnn_conv2d_forward(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> thnn_conv2d_forward_out(at::Tensor & output, at::Tensor & finput, at::Tensor & fgrad_input, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> thnn_conv2d_forward_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::Tensor & output, at::Tensor & finput, at::Tensor & fgrad_input);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> thnn_conv2d_backward_out(at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> thnn_conv2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input, at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> thnn_conv2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input, ::std::array<bool,3> output_mask);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv3d_forward(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv3d_forward_out(at::Tensor & output, at::Tensor & finput, at::Tensor & fgrad_input, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv3d_forward_outf(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::Tensor & output, at::Tensor & finput, at::Tensor & fgrad_input);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv3d_backward_out(at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias, const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> slow_conv3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input, at::Tensor & grad_input, at::Tensor & grad_weight, at::Tensor & grad_bias);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv3d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, const at::Tensor & finput, const at::Tensor & fgrad_input, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor slow_conv_dilated2d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv_dilated2d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor slow_conv_dilated3d(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, const c10::optional<at::Tensor> & bias={}, at::IntArrayRef stride=1, at::IntArrayRef padding=0, at::IntArrayRef dilation=1);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> slow_conv_dilated3d_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, ::std::array<bool,3> output_mask);
TORCH_API at::Tensor col2im(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & col2im_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & col2im_outf(const at::Tensor & self, at::IntArrayRef output_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out);
TORCH_API at::Tensor col2im_backward(const at::Tensor & grad_output, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & col2im_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & col2im_backward_outf(const at::Tensor & grad_output, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & grad_input);
TORCH_API at::Tensor im2col(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & im2col_out(at::Tensor & out, const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & im2col_outf(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & out);
TORCH_API at::Tensor im2col_backward(const at::Tensor & grad_output, at::IntArrayRef input_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & im2col_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, at::IntArrayRef input_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride);
TORCH_API at::Tensor & im2col_backward_outf(const at::Tensor & grad_output, at::IntArrayRef input_size, at::IntArrayRef kernel_size, at::IntArrayRef dilation, at::IntArrayRef padding, at::IntArrayRef stride, at::Tensor & grad_input);
TORCH_API at::Tensor isposinf(const at::Tensor & self);
TORCH_API at::Tensor & isposinf_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & isposinf_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor isneginf(const at::Tensor & self);
TORCH_API at::Tensor & isneginf_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & isneginf_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_entr(const at::Tensor & self);
TORCH_API at::Tensor & special_entr_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_entr_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_ndtri(const at::Tensor & self);
TORCH_API at::Tensor & special_ndtri_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_ndtri_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_erfcx(const at::Tensor & self);
TORCH_API at::Tensor & special_erfcx_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_erfcx_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_xlog1py(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & special_xlog1py_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & special_xlog1py_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor special_zeta(const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & special_zeta_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & other);
TORCH_API at::Tensor & special_zeta_outf(const at::Tensor & self, const at::Tensor & other, at::Tensor & out);
TORCH_API at::Tensor special_i0e(const at::Tensor & self);
TORCH_API at::Tensor & special_i0e_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_i0e_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_i1(const at::Tensor & self);
TORCH_API at::Tensor & special_i1_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_i1_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API at::Tensor special_i1e(const at::Tensor & self);
TORCH_API at::Tensor & special_i1e_out(at::Tensor & out, const at::Tensor & self);
TORCH_API at::Tensor & special_i1e_outf(const at::Tensor & self, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> linalg_cholesky_ex(const at::Tensor & self, bool check_errors=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_cholesky_ex_out(at::Tensor & L, at::Tensor & info, const at::Tensor & self, bool check_errors=false);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_cholesky_ex_outf(const at::Tensor & self, bool check_errors, at::Tensor & L, at::Tensor & info);
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> _det_lu_based_helper(const at::Tensor & self);
TORCH_API at::Tensor _det_lu_based_helper_backward_helper(const at::Tensor & det_grad, const at::Tensor & det, const at::Tensor & self, const at::Tensor & lu, const at::Tensor & pivs);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &,at::Tensor &> linalg_lstsq_out(at::Tensor & solution, at::Tensor & residuals, at::Tensor & rank, at::Tensor & singular_values, const at::Tensor & self, const at::Tensor & b, c10::optional<double> rcond=c10::nullopt, c10::optional<c10::string_view> driver=c10::nullopt);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &,at::Tensor &> linalg_lstsq_outf(const at::Tensor & self, const at::Tensor & b, c10::optional<double> rcond, c10::optional<c10::string_view> driver, at::Tensor & solution, at::Tensor & residuals, at::Tensor & rank, at::Tensor & singular_values);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> linalg_slogdet(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_slogdet_out(at::Tensor & sign, at::Tensor & logabsdet, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_slogdet_outf(const at::Tensor & self, at::Tensor & sign, at::Tensor & logabsdet);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> linalg_eig(const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_eig_out(at::Tensor & eigenvalues, at::Tensor & eigenvectors, const at::Tensor & self);
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_eig_outf(const at::Tensor & self, at::Tensor & eigenvalues, at::Tensor & eigenvectors);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> linalg_eigh(const at::Tensor & self, c10::string_view UPLO="L");
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_eigh_out(at::Tensor & eigvals, at::Tensor & eigvecs, const at::Tensor & self, c10::string_view UPLO="L");
TORCH_API ::std::tuple<at::Tensor &,at::Tensor &> linalg_eigh_outf(const at::Tensor & self, c10::string_view UPLO, at::Tensor & eigvals, at::Tensor & eigvecs);
TORCH_API at::Tensor & linalg_eigvalsh_out(at::Tensor & out, const at::Tensor & self, c10::string_view UPLO="L");
TORCH_API at::Tensor & linalg_eigvalsh_outf(const at::Tensor & self, c10::string_view UPLO, at::Tensor & out);
TORCH_API at::Tensor linalg_householder_product(const at::Tensor & input, const at::Tensor & tau);
TORCH_API at::Tensor & linalg_householder_product_out(at::Tensor & out, const at::Tensor & input, const at::Tensor & tau);
TORCH_API at::Tensor & linalg_householder_product_outf(const at::Tensor & input, const at::Tensor & tau, at::Tensor & out);
TORCH_API at::Tensor & _linalg_inv_out_helper_(at::Tensor & self, at::Tensor & infos_lu, at::Tensor & infos_getri);
TORCH_API at::Tensor linalg_vector_norm(const at::Tensor & self, const at::Scalar & ord=2, c10::optional<at::IntArrayRef> dim=c10::nullopt, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & linalg_vector_norm_out(at::Tensor & out, const at::Tensor & self, const at::Scalar & ord=2, c10::optional<at::IntArrayRef> dim=c10::nullopt, bool keepdim=false, c10::optional<at::ScalarType> dtype=c10::nullopt);
TORCH_API at::Tensor & linalg_vector_norm_outf(const at::Tensor & self, const at::Scalar & ord, c10::optional<at::IntArrayRef> dim, bool keepdim, c10::optional<at::ScalarType> dtype, at::Tensor & out);
TORCH_API at::Tensor linalg_solve(const at::Tensor & input, const at::Tensor & other);
TORCH_API at::Tensor & linalg_solve_out(at::Tensor & out, const at::Tensor & input, const at::Tensor & other);
TORCH_API at::Tensor & linalg_solve_outf(const at::Tensor & input, const at::Tensor & other, at::Tensor & out);
TORCH_API ::std::tuple<at::Tensor,at::Tensor> _linalg_qr_helper(const at::Tensor & self, c10::string_view mode);
TORCH_API at::Tensor _test_optional_intlist(const at::Tensor & values, c10::optional<at::IntArrayRef> addends);
TORCH_API at::Tensor _test_optional_filled_intlist(const at::Tensor & values, c10::optional<at::IntArrayRef> addends);
TORCH_API at::Tensor _test_optional_floatlist(const at::Tensor & values, c10::optional<at::ArrayRef<double>> addends);
TORCH_API at::Tensor segment_reduce(const at::Tensor & data, c10::string_view reduce, const c10::optional<at::Tensor> & lengths={}, const c10::optional<at::Tensor> & indices={}, int64_t axis=0, bool unsafe=false, const c10::optional<at::Scalar> & initial=c10::nullopt);
TORCH_API at::Tensor _segment_reduce_backward(const at::Tensor & grad, const at::Tensor & output, const at::Tensor & data, c10::string_view reduce, const c10::optional<at::Tensor> & lengths={}, int64_t axis=0);
} // namespace cpu
} // namespace at
| [
"oqr416@gmail.com"
] | oqr416@gmail.com |
1725075064ceb67edb7808454f365dd65cd0805d | c676ee306d649197ed7ad8c4adc9a21ab48975db | /Source/GameServer/SceneManager.cpp | 9d293c9bbc9b7f38486da0f1c208d9b11a42ceee | [] | no_license | w5762847/hmx_linux | 5f4dd6e2e832818c9cbeb5d8d95274cccd4f8760 | 6935a976381407292cc3bc6a6ed371f2e8221536 | refs/heads/master | 2020-08-31T16:43:12.162040 | 2017-04-29T07:20:11 | 2017-04-29T07:20:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 23,207 | cpp | /**
* \brief SceneManager的实现
*
* 这个类暂时没有用到
*/
#include "ScenesServer.h"
#include "GameService.h"
#include "SceneNpcManager.h"
std::map<WORD, stRangMap*> RangMapData;
std::vector<DWORD> BmapBaseID;
//using namespace Cmd::Session;
using namespace H;
///SceneManager的唯一实例
SceneManager *SceneManager::sm(new SceneManager());
/**
* \brief 生成一个唯一ID
*
* \param tempid 输出:取得的ID
* \return 是否成功
*/
bool SceneManager::getUniqeID(QWORD &tempid)
{
tempid=sceneUniqeID->get();
return (tempid!=sceneUniqeID->invalid());
}
/**
* \brief 释放唯一ID
*
* \param tempid 要释放的ID
*/
void SceneManager::putUniqeID(const QWORD &tempid)
{
sceneUniqeID->put(tempid);
}
/**
* \brief 生成一个队伍唯一ID
*
* \param tempid 输出:取得的ID
* \return 是否成功
*/
bool SceneManager::getTeamID(DWORD &tempid)
{
tempid=sceneTeamID->get();
return (tempid!=sceneTeamID->invalid());
}
/**
* \brief 释放队伍唯一ID
*
* \param tempid 要释放的ID
*/
void SceneManager::putTeamID(const DWORD &tempid)
{
sceneTeamID->put(tempid);
}
/**
* \brief 构造函数
*
*/
SceneManager::SceneManager()
{
inited=false;
newzone=false;
//ScenTeamMap.clear();
}
/**
* \brief 析构函数
*
*/
SceneManager::~SceneManager()
{
//if(!ScenTeamMap.empty())
//{
// std::map<DWORD, TeamManager*>::iterator iter;
// for(iter=ScenTeamMap.begin(); iter!=ScenTeamMap.end(); iter++)
// {
// delete iter->second;
// }
// ScenTeamMap.clear();
//}
final();
}
/**
* \brief 得到SceneManager的指针
* 如果指针为0则进行初始化
*
*/
SceneManager & SceneManager::getInstance()
{
if (sm==NULL)
sm=new SceneManager();
return *sm;
}
/**
* \brief 删除SceneManager
*
*/
void SceneManager::delInstance()
{
if (sm!=NULL)
{
sm->final();
S_SAFE_DELETE(sm);
}
}
/**
* \brief 释放所有已经加载的地图
*
*/
void SceneManager::final()
{
if (inited)
{
inited=false;
unloadAllScene();
}
}
/**
* \brief 初始化
* 加载所有地图
*
*/
bool SceneManager::init()
{
if (inited) return inited;
//为每个场景服务器生成不相交叉的场景临时ID分配器,最小的从10000开始,每个有49998个ID可用
DWORD firstTempID = 10000+(GameService::getMe().getServerID()%100)*50000;
sceneUniqeID = new zUniqueDWORDID(firstTempID,firstTempID+49998);
////sky 生成不相交的场景队伍临时ID分配器最小从10000开始,每个有4998个ID可用
//firstTempID = 500000+(ScenesService::getInstance().getServerID()%100)*5000;
//sceneTeamID=new zUniqueDWORDID(firstTempID,firstTempID+4998);
//// 初始化所有地图
zXMLParser parser;
if (parser.initFile(H::global["confdir"] + "scenesinfo.xml"))
{
xmlNodePtr root = parser.getRootNode("ScenesInfo");
xmlNodePtr countryNode = parser.getChildNode(root, "countryinfo");
if (countryNode)
{
xmlNodePtr subnode = parser.getChildNode(countryNode,"country");
while(subnode)
{
if (strcmp((char*)subnode->name,"country") == 0)
{
CountryInfo info;
bzero(&info,sizeof(info));
parser.getNodePropNum(subnode,"id",&info.id,sizeof(info.id));
parser.getNodePropStr(subnode,"name",info.name,sizeof(info.name));
parser.getNodePropNum(subnode,"mapID",&info.mapid,sizeof(info.mapid));
parser.getNodePropNum(subnode,"function",&info.function,sizeof(info.function));
H::logger->info("加载国家名称(%u,%s,%u,%u)",info.id,info.name,info.mapid,info.function);
country_info.insert(CountryMap_value_type(info.id,info));
}
subnode = parser.getNextNode(subnode,NULL);
}
}
xmlNodePtr mapNode=parser.getChildNode(root,"mapinfo");
if (mapNode)
{
xmlNodePtr subnode = parser.getChildNode(mapNode,"map");
while(subnode)
{
if (strcmp((char*)subnode->name,"map") == 0)
{
MapInfo info;
bzero(&info,sizeof(info));
parser.getNodePropNum(subnode,"mapID",&info.id,sizeof(info.id));
parser.getNodePropStr(subnode,"name",info.name,sizeof(info.name));
parser.getNodePropStr(subnode,"fileName",info.filename,sizeof(info.filename));
parser.getNodePropNum(subnode,"backto",&info.backto,sizeof(info.backto));
parser.getNodePropNum(subnode,"backtocity",&info.backtoCity,sizeof(info.backtoCity));
parser.getNodePropNum(subnode,"foreignerbackto",&info.foreignbackto,sizeof(info.foreignbackto));
parser.getNodePropNum(subnode,"countrydarebackto",&info.countrydarebackto,
sizeof(info.countrydarebackto));
parser.getNodePropNum(subnode,"countrydefbackto",&info.countrydefbackto,
sizeof(info.countrydefbackto));
parser.getNodePropNum(subnode,"pklevel",&info.pklevel,
sizeof(info.pklevel));
parser.getNodePropNum(subnode,"commoncountrybackto",&info.commoncountrybackto,sizeof(info.commoncountrybackto));
parser.getNodePropNum(subnode,"commonuserbackto",&info.commonuserbackto,sizeof(info.commonuserbackto));
parser.getNodePropNum(subnode,"backtodare",&info.backtodare,sizeof(info.backtodare));
parser.getNodePropNum(subnode,"function",&info.function,sizeof(info.function));
parser.getNodePropNum(subnode,"level",&info.level,sizeof(info.level));
parser.getNodePropNum(subnode,"exprate",&info.exprate,sizeof(info.exprate));
map_info.insert(MapMap_value_type(info.id,info));
}
subnode = parser.getNextNode(subnode,NULL);
}
}
xmlNodePtr serverNode=parser.getChildNode(root,"server");
while (serverNode) {
int id = 0;
parser.getNodePropNum(serverNode,"id",&id,sizeof(id));
if (GameService::getMe().getServerID() == id) {
int mapCount=0;
xmlNodePtr countryNode=parser.getChildNode(serverNode,"country");
while(countryNode)
{
DWORD countryid=0;
parser.getNodePropNum(countryNode,"id",&countryid,sizeof(countryid));
xmlNodePtr mapNode=parser.getChildNode(countryNode,"map");
while(mapNode)
{
//加载地图
DWORD mapid = 0;
if (!parser.getNodePropNum(mapNode,"mapID", &mapid,sizeof(mapid)))
{
H::logger->error("得到地图编号失败");
return inited;
}
Scene *newScene = loadScene(Scene::STATIC, countryid, mapid);
// 注册地图
if (newScene)
{
printf("向session发送注册消息(%s-%d-%d)\n",newScene->name,newScene->id,newScene->tempid);
H::logger->info("加载%s(%d,%d)成功",newScene->name,newScene->id,newScene->tempid);
S::SSRqRegisterScene regscene;
regscene.sceneid = newScene->id;
//H::logger->info("[地图真实ID]:%d",loaded->id&0x0FFF);
regscene.sceneTempID=newScene->tempid;
regscene.mapid = mapid;
strncpy(regscene.name,newScene->name,MAX_NAMESIZE);
strncpy(regscene.fileName,newScene->getFileName(),MAX_NAMESIZE);
regscene.dwCountryID = countryid;
regscene.byLevel = newScene->getLevel();
GameService::getMe().getSessionMgr().sendToWs(®scene, sizeof(regscene));
mapCount++;
}
else
{
return inited;
}
mapNode=parser.getNextNode(mapNode,"map");
}
countryNode=parser.getNextNode(countryNode,"country");
}
H::logger->info("ScenesServer id=%d加载%d张地图.",id,mapCount);
}
else{
H::logger->info("skip id=%d != %d.",id, GameService::getMe().getServerID());
}
serverNode=parser.getNextNode(serverNode,"server");
}
inited=true;
}
else
H::logger->warn("SceneManager 解析配置文件失败.");
//刷新玉如意需要的地图信息
freshEverySceneField();
return inited;
}
/**
* \brief 根据名字的到场景指针的回调
* 方法是遍历所有scene并比较名字
*
*/
class GetSceneByFileName:public SceneCallBack
{
public:
///找到的scene指针
Scene *ret;
///要找的场景名字
const char *name;
/**
* \brief 构造函数
*
*
* \param name 要查找的场景名字
* \return
*/
GetSceneByFileName(const char *name) : ret(NULL),name(name) {};
/**
* \brief 执行查找的方法
*
*
* \param scene 场景指针
* \return 是否继续查找
*/
bool exec(Scene *scene)
{
if (strncmp(scene->getFileName(),name,MAX_NAMESIZE)==0)
{
ret=scene;
return false;
}
else
return true;
}
};
/**
* \brief 根据文件名字找到场景指针
*
* \param name 要找的场景名字
* \return 要找的场景指针,失败返回0
*/
Scene * SceneManager::getSceneByFileName( const char * name)
{
GetSceneByFileName gsfn(name);
execEveryScene(gsfn);
return gsfn.ret;
}
/**
* \brief 根据名字找到场景指针
*
* \param name 要找的场景名字
* \return 要找的场景指针,失败返回0
*/
Scene * SceneManager::getSceneByName( const char * name)
{
rwlock.rdlock();
Scene *ret =(Scene *)getEntryByName(name);
rwlock.unlock();
return ret;
}
/**
* \brief 根据领事ID找到场景指针
*
* \param tempid 要找的场景的临时id
* \return 要找的场景指针,失败返回0
*/
Scene * SceneManager::getSceneByTempID( DWORD tempid)
{
rwlock.rdlock();
Scene * ret = (Scene *)getEntryByTempID(tempid);
rwlock.unlock();
return ret;
}
/**
* \brief 根据id找到场景指针
*
* \param id 要找的场景id
* \return 要找的场景指针,失败返回0
*/
Scene * SceneManager::getSceneByID( DWORD id)
{
rwlock.rdlock();
Scene * ret = (Scene *)getEntryByID(id);
rwlock.unlock();
return ret;
}
DWORD SceneManager::getMapId(DWORD countryid,DWORD mapid)
{
MapMap_iter map_iter = map_info.find(mapid);
if (map_iter == map_info.end())
{
return 0;
}
CountryMap_iter country_iter = country_info.find(countryid);
if (country_iter == country_info.end())
{
return 0;
}
return (country_iter->second.id << 16) + map_iter->second.id;
}
/**
* \brief 加载一个地图
*
* \param type 地图类型,静态/动态
* \param countryid 国家id
* \param mapid 地图id
* \return 新加载的场景指针
*/
Scene * SceneManager::loadScene(int type/*Scene::SceneType type*/,DWORD countryid,DWORD mapid)
{
H::logger->info("SceneManager::loadScene type=%d,countryid=%d,mapid=%d",type,countryid,mapid);
zEntry *s=NULL;
switch(type)
{
case 0://Scene::STATIC:
s=new StaticScene();
break;
//case 1://Scene::GANG:
// s=new GangScene();
break;
default:
H::logger->error("未知场景类型");
return false;
}
rwlock.wrlock();
bool ret=((Scene *)s)->init(countryid,mapid);
if (ret)
{
ret=addEntry(s);
if (!ret)
H::logger->error("SceneManager::loadScene addEntry[%s]失败.",s->name);
else H::logger->info("SceneManager::loadScene[%s]成功",s->name);
}
else
H::logger->error("SceneManager::loadScene init[%s]失败.",s->name);
rwlock.unlock();
if (!ret)
{
S_SAFE_DELETE(s);
}
return (Scene *)s;
}
/**
* \brief 动态加载一个地图
*
* \param type 地图类型,静态/动态
* \param countryid 国家id
* \param baseid 地图源id
* \return 新加载的场景指针
*/
Scene * SceneManager::loadBattleScene(DWORD baseid)
{
if(baseid == 0)
return NULL;
zEntry *s=NULL;
//s=new GangScene();
//std::map<WORD, stRangMap*>::iterator iter;
//iter = RangMapData.find(baseid);
//if(iter == RangMapData.end())
// return NULL;
//DWORD countryid = iter->second->GetCountryid();
//DWORD mapid = 0;
//if(!iter->second->getUniqeID(mapid))
//{
// printf("%d 类型战场分配已到最大限制!无法再分配", baseid);
// return NULL;
//}
//rwlock.wrlock();
//bool ret = ((GangScene*)s)->GangSceneInit(countryid, baseid, mapid);
////sky 配置战场基本数据
////((GangScene*)s)->InitData();
//if (ret)
//{
// ret=addEntry(s);
// if (!ret)
// H::logger->error("SceneManager::loadScene addEntry[%s]失败.",s->name);
// else
// H::logger->info("SceneManager::loadScene[%s]成功",s->name);
//}
//else
// H::logger->error("SceneManager::loadScene init[%s]失败.",s->name);
//rwlock.unlock();
//if (!ret)
//{
// SAFE_DELETE(s);
//}
return (Scene *)s;
}
/**
* \brief 根据名字卸载一张地图
*
* \param name 要卸载的地图名字
*/
void SceneManager::unloadScene(std::string &name)
{
zEntry * ret=NULL;
rwlock.wrlock();
if (zEntryName::find(name.c_str(),ret))
removeEntry(ret);
S_SAFE_DELETE(ret);
rwlock.unlock();
H::logger->debug("SceneManager::unloadScene");
}
/**
* \brief 根据场景指针卸载一张地图
*
* \param scene 要卸载的地图指针
*/
void SceneManager::unloadScene(Scene * &scene)
{
if (scene==NULL) return;
rwlock.wrlock();
removeEntry((zEntry *)scene);
S_SAFE_DELETE(scene);
rwlock.unlock();
H::logger->debug("SceneManager::unloadScene");
}
/**
* \brief 卸载全部地图
*
*/
void SceneManager::unloadAllScene()
{
zEntry * ret=NULL;
rwlock.wrlock();
while(zEntryName::findOne(ret))
{
removeEntry(ret);
S_SAFE_DELETE(ret);
}
rwlock.unlock();
H::logger->debug("SceneManager::unloadAllScene");
}
/**
* \brief 检查并删除设置为remove的场景
* 方法是遍历所有场景,如果设置了remove标志,则清除所有npc和物件,然后删除场景
* 该方法在场景主循环中执行
*
*/
void SceneManager::checkUnloadOneScene()
{
for(zEntryTempID::hashmap::iterator it=zEntryTempID::ets.begin();it!=zEntryTempID::ets.end();it++)
{
Scene *scene = (Scene *)it->second;
if (scene->getRunningState() == SCENE_RUNNINGSTATE_REMOVE)
{
H::logger->debug("卸载场景%s",scene->name);
SceneNpcManager::getMe().removeNpcInOneScene(scene);
scene->removeSceneObjectInOneScene();
unloadScene(scene);
return ;
}
}
}
struct EveryMapExec : public execEntry<SceneManager::MapInfo>
{
Scene *_scene;
EveryMapExec(Scene *s):_scene(s)
{
}
bool exec(SceneManager::MapInfo *info)
{
if (info->function & 0x2)
{
char buf[MAX_NAMESIZE + 1];
bzero(buf,sizeof(buf));
if (SceneManager::getInstance().buildMapName(_scene->getCountryID(),info->name,buf))
{
_scene->addMainMapName(buf);
}
}
if (info->function & 0x20)
{
char buf[MAX_NAMESIZE + 1];
bzero(buf,sizeof(buf));
if (SceneManager::getInstance().buildMapName(_scene->getCountryID(),info->name,buf))
{
_scene->addIncMapName(buf);
}
}
return true;
}
};
void SceneManager::freshEverySceneField()
{
struct getAllMapExec :public SceneCallBack
{
Scene *_old_scene;
getAllMapExec(Scene *s):_old_scene(s)
{
}
bool exec(Scene *scene)
{
//H::logger->debug("%d,%d,%d,%s",scene->getCountryID(),_old_scene->getCountryID(),scene->isMainCity(),scene->getFileName());
//if (/*scene != _old_scene && */_old_scene->isMainCity() && scene->getCountryID() == _old_scene->getCountryID() && scene->isField() && _old_scene->getWayPoint(scene->getFileName()))
//{
// _old_scene->addFieldMapName(scene->name);
//}
return true;
}
};
struct EverySceneExec :public SceneCallBack
{
bool exec(Scene *scene)
{
scene->clearMainMapName();
EveryMapExec exec1(scene);
SceneManager::getInstance().execEveryMap(exec1);
scene->clearFieldMapName();
getAllMapExec exec(scene);
SceneManager::getInstance().execEveryScene(exec);
return true;
}
};
EverySceneExec exec;
SceneManager::getInstance().execEveryScene(exec);
}
/**
* \brief 对每个场景执行回调函数
*
* \param callback 要执行的回调函数
*/
void SceneManager::execEveryScene(SceneCallBack &callback)
{
for(zEntryTempID::hashmap::iterator it=zEntryTempID::ets.begin();it!=zEntryTempID::ets.end();it++)
{
if (!callback.exec((Scene *)it->second))
{
//mlock.unlock();
return;
}
}
}
/**
* \brief 根据国家名字得到国家id
*
* \param name 要得到id的国家名字
* \return 找到的id,失败返回0
*/
DWORD SceneManager::getCountryIDByCountryName(const char *name)
{
SceneManager::CountryMap_iter country_iter = SceneManager::getInstance().country_info.begin();
for(; country_iter != SceneManager::getInstance().country_info.end() ; country_iter ++)
{
if (strcmp(name,country_iter->second.name) == 0)
{
return country_iter->first;
}
}
return 0;
}
/**
* \brief 对每个国家配置执行回调函数
*
* \param callback 要执行的回调函数
*/
/*
void SceneManager::execEveryMap(MapCallBack &callback)
{
SceneManager::MapMap_iter map_iter = SceneManager::getInstance().map_info.begin();
for(; map_iter != SceneManager::getInstance().map_info.end() ; map_iter ++)
{
callback.exec(map_iter->second);
}
}
// */
/**
* \brief 根据国家id得到国家名字
*
* \param id 要找的国家id
* \return 找到的国家名字,失败返回0
*/
const char * SceneManager::getCountryNameByCountryID(DWORD id)
{
SceneManager::CountryMap_iter country_iter = SceneManager::getInstance().country_info.begin();
for(; country_iter != SceneManager::getInstance().country_info.end() ; country_iter ++)
{
if (country_iter->first == id)
{
return country_iter->second.name;
}
}
return 0;
}
/**
* \brief 根据地图名字得到地图id
*
* \param name 要找的地图名字
* \return 找到的id,失败返回0
*/
DWORD SceneManager::getMapIDByMapName(const char *name)
{
const char *p = strstr(name,"·");
if (p)
p += strlen("·");
else
p = name;
SceneManager::MapMap_iter map_iter = SceneManager::getInstance().map_info.begin();
for(; map_iter != SceneManager::getInstance().map_info.end() ; map_iter ++)
{
if (strcmp(p,map_iter->second.name) == 0)
{
return map_iter->first;
}
}
return 0;
}
/**
* \brief 根据国家id和地图id组成场景name
*
*/
bool SceneManager::buildMapName(DWORD countryid,DWORD mapid,char *out)
{
const char *c = getCountryNameByCountryID(countryid);
const char *m = map_info[mapid].name;
if (c && m)
{
sprintf(out,"%s·%s",c,m);
return true;
}
return false;
}
/**
* \brief 根据国家id和地图name组成场景name
*
*/
bool SceneManager::buildMapName(DWORD countryid,const char *in,char *out)
{
const char *c = getCountryNameByCountryID(countryid);
if (c && in)
{
sprintf(out,"%s·%s",c,in);
return true;
}
return false;
}
/**
* \brief 根据国家id和地图id组成场景id
*
*/
DWORD SceneManager::buildMapID(DWORD countryid,DWORD mapid)
{
return (countryid << 16) + mapid;
}
bool SceneManager::isNewZoneConfig()
{
return newzone && (!newzon_vec.empty());
}
void SceneManager::setNewZoneConfig(bool type)
{
newzone=type;
if (newzone==false)
{
newzon_vec.clear();
}
}
void SceneManager::addNewZonePos(DWORD x,DWORD y)
{
newzon_vec.push_back(std::make_pair(x,y));
}
SceneManager::NewZoneVec &SceneManager::queryNewZonePos()
{
return newzon_vec;
}
bool SceneManager::randzPosNewZone(Scene *intoScene,zPos &findedPos)
{
bool founded=false;
int i=0;
while(!founded && i < (int)newzon_vec.size())
{
int which = randBetween(0,newzon_vec.size() - 1);
zPos initPos;
int x = randBetween(0,10);
int y = randBetween(0,10);
initPos.x =newzon_vec[which].first + 5 - x;
initPos.y =newzon_vec[which].second + 5 - y;
founded = intoScene->findPosForUser(initPos,findedPos);
}
return founded;
}
//TeamManager* SceneManager::GetMapTeam(DWORD TeamID)
//{
// if(ScenTeamMap.empty() || ScenTeamMap[TeamID] == 0)
// return NULL;
// else
// return ScenTeamMap[TeamID];
//}
//bool SceneManager::SceneNewTeam(SceneUser *pUser)
//{
// if (pUser->TeamThisID == 0)
// {
// //sky 计算出队伍唯一ID
// DWORD teamid;
// if(!getTeamID(teamid))
// {
// Channel::sendSys(pUser,Cmd::INFO_TYPE_GAME,"分配队伍唯一ID失败!队伍建立失败!");
// return false;
// }
//
// TeamManager * team = new TeamManager();
// if(team == NULL)
// {
// H::logger->debug("内存不足!组队失败");
// putTeamID(teamid);
// return false;
// }
//
// if (team->addMemberByTempID(pUser,pUser->tempid))
// {
// team->setTeamtempId(teamid);
// team->setLeader(pUser->tempid);
//
// ScenTeamMap[teamid] = team;
//
// pUser->TeamThisID = teamid;
//
// Cmd::stAddTeamMemberUserCmd ret;
// ret.dwTeamID = teamid;
// ret.dwHeadID = pUser->tempid;
// ret.data.dwTempID = pUser->tempid;
// ret.data.dwMaxHealth = pUser->charstate.maxhp;
// ret.data.dwHealth = pUser->charbase.hp;
// ret.data.dwMaxMp = pUser->charstate.maxmp;
// ret.data.dwMp = pUser->charbase.mp;
// ret.data.wdFace = pUser->charbase.face;
// strncpy(ret.data.pstrName,pUser->name,MAX_NAMESIZE);
// ret.data.byHead = true;
// pUser->sendCmdToMe(&ret,sizeof(ret));
//
// pUser->team_mode = Cmd::TEAM_HONOR;
// pUser->reSendMyMapData();
// //session队伍
// ScenTeamMap[teamid]->addMemberToSession(pUser->name);
//
// return true;
// }
// }
//
// return false;
//}
//
//bool SceneManager::SceneNewTeam(Cmd::Session::t_Team_Data* send)
//{
// std::map<DWORD, TeamManager*>::iterator iter;
// iter = ScenTeamMap.find(send->dwTeamThisID);
//
// if(iter != ScenTeamMap.end())
// return true;
//
// TeamManager * team = new TeamManager();
// if(team == NULL)
// {
// H::logger->debug("内存不足!跨场景建立新队伍失败");
// return false;
// }
//
// team->setTeamtempId(send->dwTeamThisID);
//
// SceneUser * leader = SceneUserManager::getMe().getUserByID(send->LeaderID);
//
// if(leader)
// team->setLeader(leader->tempid);
// else
// team->setLeader( 0 );
//
// for(int i=0; i<send->dwSize; i++)
// {
// bool bleaber;
// if(send->Member->dwID == send->LeaderID)
// bleaber = true;
// else
// bleaber = false;
//
// team->addWAwayMember(&(send->Member[i]));
// }
//
// ScenTeamMap[send->dwTeamThisID] = team;
//
// return true;
//}
//sky 通知Session也删除队伍管理器的队伍
//bool SceneManager::SceneDelTeam(DWORD TeamID)
//{
// std::map<DWORD, TeamManager*>::iterator iter;
// iter = ScenTeamMap.find(TeamID);
//
// if(iter != ScenTeamMap.end())
// {
// /*if(iter->second)
// {
// iter->second->deleteTeam();
// delete iter->second;
// }
//
// ScenTeamMap.erase(iter);
//
// putTeamID(TeamID);*/
//
// //sky 告诉Session删除队伍
// Cmd::Session::t_Team_DelTeam rev;
// rev.TeamThisID = TeamID;
// sessionClient->sendCmd(&rev, sizeof(Cmd::Session::t_Team_DelTeam));
// }
//
// return true;
//}
//
////sky 删除当前场景的队伍管理器里的队伍
//bool SceneManager::DelMapTeam(DWORD TeamID)
//{
// std::map<DWORD, TeamManager*>::iterator iter;
// iter = ScenTeamMap.find(TeamID);
//
// if(iter != ScenTeamMap.end())
// {
// if(iter->second)
// {
// iter->second->deleteTeam();
// delete iter->second;
// }
//
// ScenTeamMap.erase(iter);
//
// putTeamID(TeamID);
// }
//
// return true;
//}
//
//void SceneManager::TeamRollItme()
//{
// std::map<DWORD, TeamManager*>::iterator iter;
// for(iter=ScenTeamMap.begin(); iter!=ScenTeamMap.end(); iter++)
// {
// TeamManager * team = iter->second;
//
// if(team)
// {
// if(team->bRoll)
// team->RollItem_A();
// }
// }
//} | [
"huangzuduan@qq.com"
] | huangzuduan@qq.com |
c78f95a111c147ae4877619b5b713099d82971ad | a3a92bf47715b5bee8dae5ca3dc71f28b85464b6 | /dcmcore/defs.h | 6190600bfec7d7bffb67fc837a7b4a4db175d1a0 | [
"MIT"
] | permissive | feliwir/dcmlite | 64e21f82dc753bbe9d498150f16f2006f82e833c | 70a5891b0c8409f351242da8f5c9cd8649453950 | refs/heads/master | 2020-04-17T19:18:15.433782 | 2019-03-13T23:24:04 | 2019-03-13T23:24:04 | 166,861,053 | 7 | 0 | null | 2019-01-21T18:31:07 | 2019-01-21T18:31:06 | null | UTF-8 | C++ | false | false | 1,417 | h | #pragma once
#include <cstdint>
#include <string>
namespace dcmcore {
enum Endian {
kLittleEndian,
kBigEndian,
};
// Return the endian type of the current platform.
Endian PlatformEndian();
const std::uint32_t kUndefinedLength = 0xFFFFFFFF;
typedef float float32_t;
typedef double float64_t;
template <typename T>
T byteswap(T value);
template <>
inline uint16_t byteswap<std::uint16_t>(std::uint16_t value)
{
return (value >> 8) | (value << 8);
}
template <>
inline int16_t byteswap<std::int16_t>(std::int16_t value)
{
return (value >> 8) | (value << 8);
}
template <>
inline uint32_t byteswap<uint32_t>(uint32_t value)
{
return std::uint32_t(byteswap<uint16_t>(value) << 16) | byteswap<uint16_t>(value >> 16);
}
template <>
inline int32_t byteswap<int32_t>(int32_t value)
{
return std::int32_t(byteswap<int16_t>(value) << 16) | byteswap<int16_t>(value >> 16);
}
template <>
inline uint64_t byteswap<uint64_t>(uint64_t value)
{
return std::uint64_t((unsigned long long)byteswap<uint32_t>(value) << 32LL) | byteswap<uint32_t>(value >> 32LL);
}
template <typename T>
inline void byteswap(void* src)
{
T* p = (T*)src;
*p = byteswap(*p);
}
template <>
inline void byteswap<float64_t>(void* src)
{
uint64_t* p = (uint64_t*)src;
*p = byteswap(*p);
}
template <>
inline void byteswap<float32_t>(void* src)
{
uint32_t* p = (uint32_t*)src;
*p = byteswap(*p);
}
} // namespace dcmcore | [
"stephan.vedder@gmail.com"
] | stephan.vedder@gmail.com |
6759a261404bafbc42d131bc01babfb1cd8156ef | 6f69622c84e625633fe107ecf0453a54c54aa531 | /dsa/cses/maths/bico.cpp | ad7ee41d8a3754f7d43c3ad5715ed33849c52d74 | [] | no_license | skrstv123/CP-ALGO | f1f7ca5d19c3d9f538ff33ac2510e01739b9bbe6 | 835f676166ab1088951b8f6ef6c083dacf62e055 | refs/heads/master | 2021-07-26T21:32:54.572089 | 2021-07-06T10:11:00 | 2021-07-06T10:11:00 | 215,589,822 | 0 | 2 | null | 2020-10-05T16:16:30 | 2019-10-16T16:05:09 | Python | UTF-8 | C++ | false | false | 629 | cpp | #include <bits/stdc++.h>
using ll = long long;
#define mod ll(1e9+7)
using namespace std;
ll modex(ll a,ll b, ll m){
ll r=1;
while(b){
if(b&1)
r=(r*a)%m;
a=(a*a)%m;
b>>=1;
}
return r;
}
ll modinv(ll a,ll m){
return modex(a, m-2, m);
}
main(){
ll fact[1000001];
fact[0]=fact[1]=1;
for(ll i=2;i<1000001;i++)
fact[i]=(i*fact[i-1])%mod;
ll n;
cin>>n;
for (ll i = 0; i < n; ++i)
{
/* code */
ll a,b,ans;
cin>>a>>b;
// cout<<fact[a]<<' '<<modinv(fact[b], mod)<<' '<<modinv(fact[a-b], mod)<<'\n';
ans=(fact[a]*modinv(fact[b], mod))%mod;
ans*=modinv(fact[a-b], mod);
ans%=mod;
cout<<ans<<'\n';
}
} | [
"skrstv123@gmail.com"
] | skrstv123@gmail.com |
c9bd02acb91b5b25e9a25827eaf69fc9959da33d | 4c48e348db7cb74b2e28d5142a496c556d412f49 | /helperFunctions.cpp | cdbea55643401793223f6c5531c9304189c6c824 | [] | no_license | JanKse/Restaurant-console-app- | b8f6e650870c32247b87a75e912fb1cb761831be | c03d9bb8e7fb58f279dbe340733b82b1ebe8fbb8 | refs/heads/main | 2023-03-14T14:22:50.194924 | 2021-03-08T16:40:41 | 2021-03-08T16:40:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,936 | cpp | #include "helperFunctions.h"
using namespace std;
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
COORD cursorPosition;
void gotoXY(int x, int y)
{
cursorPosition.X = x;
cursorPosition.Y = y;
SetConsoleCursorPosition(console, cursorPosition);
}
//display header of main menu
void menuHeader(string title)
{
gotoXY(20, 0);
cout << "#################################################";
gotoXY(20, 1);
cout << "## " << title << " ##";
gotoXY(20, 2);
cout << "#################################################";
}
//display header of main menu
//display menu items
void showMenuItems(vector<string> items)
{
gotoXY(20, 4);
cout << "+-----------------------------------------------+";
gotoXY(20, 5);
cout << "| |";
gotoXY(20, 6);
cout << "| Main menu |";
gotoXY(20, 7);
cout << "| |";
for (int i = 0; i < items.size(); i++)
{
gotoXY(20, i + 8);
cout << "| |";
gotoXY(25, i + 8);
cout << items[i];
}
gotoXY(20, (8 + items.size()));
cout << "| |";
gotoXY(20, (8 + items.size() + 1));
cout << "+-----------------------------------------------+ \n \n";
}
//display menu items
void printRestaurant(string name, string adrress, string telNumb)
{
gotoXY(20, 5);
cout << "Your current information";
gotoXY(20, 7);
cout << "Restaurant name : " << name;
gotoXY(20, 9);
cout << "Restaurant adrress : " << adrress;
gotoXY(20, 11);
cout << "Restaurant telephone number : " << telNumb;
gotoXY(20, 12);
cout << "------------------------------------------------";
}
void printRestaurants(restaurantList *list)
{
int i = 0;
for (restaurant r : list->getRestaurants())
{
gotoXY(5, i);
cout << r.getRestaurantName();
gotoXY(45, i);
cout << r.getRestaurantAdrress();
gotoXY(45, i + 1);
cout << r.getRestaurantTelNumb();
i += 3;
}
}
void printReviews(reviewList *revs)
{
int y = 0;
for (review rev : revs->getReviews())
{
gotoXY(5, y);
cout << "Author : " << rev.getAuthor() << endl;
gotoXY(5, y + 2);
cout << "Restaurant Name : ";
cout << rev.getRestaurantName() << endl;
gotoXY(5, y + 4);
cout << "Review";
gotoXY(42, y + 4);
cout << "Points : " << rev.getPoints() << "/10";
gotoXY(5, y + 5);
cout << rev.getReviewText();
gotoXY(5, y + 6);
cout << "--------------------------------------------------" << endl;
y += 7;
}
}
vector<string> getSearchedData(string fileName, string searchTerm)
{
vector<string> record;
fstream file;
bool foundRecord = false;
string str, fieldOne, fieldTwo, fieldThree;
file.open(fileName);
while (getline(file, fieldOne, ',') && !foundRecord)
{
getline(file, fieldTwo, ',');
getline(file, fieldThree, '\n');
if (fieldOne == searchTerm)
{
foundRecord = true;
record.push_back(fieldOne);
record.push_back(fieldTwo);
record.push_back(fieldThree);
}
}
file.close();
return record;
}
string encryptDecrypt(string toEncrypt)
{
string key = "jAn";
string output = toEncrypt;
for (int i = 0; i < toEncrypt.size(); i++)
output[i] = toEncrypt[i] ^ key[i % key.size()];
return output;
}
void noRestaurantMsg()
{
gotoXY(20, 5);
cout << "You don't have restaurant :( ...";
gotoXY(20, 7);
cout << "Press enter to back to main menu";
cin.get();
}
string getNewRestaurantInfo(string username)
{
string restaurantName, restaurantAdrress, restaurantNumb, info;
gotoXY(20, 14);
cout << "Your new information";
while (restaurantName.empty())
{
gotoXY(20, 16);
cout << "Restaurant name : ";
getline(cin, restaurantName);
}
while (restaurantAdrress.empty())
{
gotoXY(20, 18);
cout << "Restaurant adrress : ";
getline(cin, restaurantAdrress);
}
while (restaurantNumb.empty())
{
gotoXY(20, 20);
cout << "Restaurant telephone number : ";
getline(cin, restaurantNumb);
}
info = restaurantName + "," + restaurantAdrress + "," + restaurantNumb + "," + username;
return info;
}
string getAnswer()
{
string choice;
cout << "Are you sure ? y/n : ";
cin >> choice;
return choice;
}
string getReviewInfo(string username)
{
string restaurantName, reviewText;
int points = 0;
gotoXY(20, 5);
cout << "Restaurant name : ";
getline(cin, restaurantName);
gotoXY(20, 7);
cout << "Your review : ";
getline(cin, reviewText);
while (!isdigit(points))
{
if (points >= 0 && points <= 10)
{
gotoXY(20, 9);
cout << "Points (0-10) : ";
cin >> points;
break;
}
}
return username + "," + restaurantName + "," + reviewText + "," + to_string(points);
}
string getRestaurantInfo(string username)
{
string restaurantName, restaurantAddress, telNumber;
gotoXY(20, 2);
cout << "Enter restaurant name : ";
getline(cin, restaurantName);
gotoXY(20, 4);
cout << "Enter adrress of your restaurant : ";
getline(cin, restaurantAddress);
gotoXY(20, 6);
cout << "Entery your telephone number : ";
getline(cin, telNumber);
return restaurantName + "," + restaurantAddress + "," + telNumber + "," + username;
}
string getRestaurantName()
{
string resName;
gotoXY(20, 5);
cout << "Restaurant name : ";
getline(cin, resName);
system("cls");
return resName;
} | [
"jan.ksenak@gmail.com"
] | jan.ksenak@gmail.com |
6c55d017158b3ba64afe1baf69ec7a2b036859de | 352c0c532e85c499426ceb638323726125be5743 | /LIB.Utils/utilsBase.h | 662c5ff5a9fe65e69a327000150b3b8865dc25d7 | [] | no_license | mfkiwl/H_GNSS | 46b7c692b00f1c801b3f4c1cb5df106baa270a92 | 6b60e97fdb0d397ce030b67342162c0189bb6cb4 | refs/heads/main | 2023-04-10T05:15:09.091129 | 2021-04-16T13:28:13 | 2021-04-20T09:57:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,363 | h | ///////////////////////////////////////////////////////////////////////////////////////////////////
// utilsBase.h
//
// Standard ISO/IEC 114882, C++17
//
// | version | release | Description
// |------------|---------------|---------------------------------
// | ... | 2014 09 24 |
// | 1 | 2019 08 18 |
// | | |
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
namespace utils
{
typedef std::vector<std::uint8_t> tVectorUInt8;
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, void>::type Append(tVectorUInt8& dst, const T& value)
{
const std::uint8_t* Begin = reinterpret_cast<const std::uint8_t*>(&value);
dst.insert<const std::uint8_t*>(dst.end(), Begin, Begin + sizeof(value));
}
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, tVectorUInt8>::type ToVector(const T& value)
{
tVectorUInt8 Data;
Data.reserve(sizeof(value));
const std::uint8_t* Begin = reinterpret_cast<const std::uint8_t*>(&value);
Data.insert(Data.end(), Begin, Begin + sizeof(value));
return Data;
}
template<typename T, typename Iterator>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Read(Iterator first, Iterator last)
{
T Data = 0;
auto Size = std::distance(first, last);
if (Size > 0 && Size <= static_cast<std::size_t>(sizeof(T)))
{
std::copy(first, last, reinterpret_cast<std::uint8_t*>(&Data));
}
return Data;
}
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Read(const char* data, std::size_t dataSize)
{
return Read<T, const char*>(data, data + dataSize);
}
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Read(const unsigned char* data, std::size_t dataSize)
{
const char* Begin = reinterpret_cast<const char*>(data);
return Read<T, const char*>(Begin, Begin + dataSize);
}
enum tRadix
{
tRadix_10 = 10,
tRadix_16 = 16,
};
template<typename T, typename Iterator, int N = 20>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Read(Iterator first, Iterator last, tRadix radix)
{
char Str[N];//[#] and +/- and 0x00
unsigned int StrIndex = 0;
for (; first != last && StrIndex < sizeof(Str) - 1; ++first)
{
char Byte = static_cast<char>(*first);
if ((Byte >= '0' && Byte <= '9') ||
(radix == tRadix_10 && Byte == '-' && StrIndex == 0) ||
(radix == tRadix_16 && ((Byte >= 'A' && Byte <= 'F') || (Byte >= 'a' && Byte <= 'f'))))
{
Str[StrIndex++] = Byte;
}
else if (StrIndex != 0)
{
break;
}
}
Str[StrIndex] = 0;
if (Str[0] == '-' && radix == tRadix_10)
{
return static_cast<T>(strtol(Str, 0, radix));
}
return static_cast<T>(strtoul(Str, 0, radix));
}
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Read(const char* data, tRadix radix)
{
std::size_t DataSize = strlen(data);
return Read<T, const char*>(data, data + DataSize, radix);
}
template<typename T>
typename std::enable_if<std::is_trivially_copyable<T>::value, T>::type Reverse(T value)
{
std::uint8_t* Begin = reinterpret_cast<std::uint8_t*>(&value);
std::reverse<std::uint8_t*>(Begin, Begin + sizeof(value));
return value;
}
namespace type
{
template <unsigned int size>
struct tArray1
{
enum { Size = size };
std::uint8_t Value[size];
//tArray1() in union it's deleted by default
//{
// std::memset(Value, 0, Size);
//}
std::uint8_t& operator [] (std::size_t i)
{
assert(i < Size);
return Value[i];
}
bool operator == (const tArray1& value)
{
return std::memcmp(Value, value.Value, Size) == 0;
}
bool operator != (const tArray1& value)
{
return std::memcmp(Value, value.Value, Size) != 0;
}
};
template <unsigned int size>
struct tArray2 : public tArray1<size>
{
tArray2()
{
std::memset(this->Value, 0, this->Size);
}
};
}
class tEmptyAble
{
protected:
bool m_Empty = true;
public:
tEmptyAble() = default;
explicit tEmptyAble(bool empty) :m_Empty(empty) {}
bool Empty() const { return m_Empty; }
protected:
~tEmptyAble() {}
};
//char FromBCD(char dataBCD); [TBD]
//char ToBCD(char dataBCD); [TBD]
}
| [
"maslennikovserge@yandex.ru"
] | maslennikovserge@yandex.ru |
20670388abeacd0816b7f51598e584c3407c6800 | 3d98be08e31adc10cc3fdcc17c5a3c1b64c9681f | /nbase/network/INServerSocketIcmp.cpp | d35de9995ca5cf3c8876687d779111e35f144732 | [] | no_license | Strohhalm/nwebmedia | 3cf340e5c3c05b5aa942e97470e18f2281f8508c | 5fa80222b7618a8c44a1ec18668590f0dc198826 | refs/heads/master | 2021-01-23T14:46:29.661366 | 2015-09-04T12:21:52 | 2015-09-04T12:21:52 | 39,181,293 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,871 | cpp | //
// Created by strohhalm on 18.06.15.
//
#include "INServerSocketIcmp.h"
namespace nox
{
namespace network
{
INServerSocketIcmp::INServerSocketIcmp(boost::asio::ip::icmp::endpoint * endpoint)
: INServerSocket<boost::asio::ip::icmp::endpoint>(endpoint)
{
m_Socket = new boost::asio::ip::icmp::socket(*m_IoService, *endpoint);
}
INServerSocketIcmp::~INServerSocketIcmp()
{
if (m_Socket != NULL)
{
if (m_Socket->is_open())
{
m_Socket->cancel();
m_Socket->close();
}
delete m_Socket;
}
}
void INServerSocketIcmp::run(bool async)
{
INConnectionIcmp * newConnection = createConnection(m_Socket);
if (async)
{
m_Socket->async_receive_from(boost::asio::buffer(newConnection->getBuffer()),
newConnection->getEndpoint(), boost::bind(
&INServerSocket<boost::asio::ip::icmp::endpoint>::handleReceive, this,
boost::asio::placeholders::error, async, newConnection,
boost::asio::placeholders::bytes_transferred()));
}
else
{
boost::system::error_code errCode;
size_t bytes_read = m_Socket->receive_from(boost::asio::buffer(newConnection->getBuffer()),
newConnection->getEndpoint(),
0,
errCode);
handleReceive(errCode, async, newConnection, bytes_read);
}
}
}
} | [
"eder_armin@web.de"
] | eder_armin@web.de |
ca876aabe231ea99bd5dc3b8a47d822fa05d9950 | 1c66571b31dfad6577dc92c7fb020dd0e71e7c77 | /004.cpp | 05052829674aaf3cecd34ad479b5719187e25224 | [] | no_license | rchen93/Project_Euler | d9010e415542cf8a08c3fb4fbfb05b56d6b980af | 38ff3c8147b11471cd8c238de238fb1d9fd400b4 | refs/heads/master | 2016-09-05T15:27:17.718299 | 2013-08-28T23:24:34 | 2013-08-28T23:24:34 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 833 | cpp | #include <iostream>
#include <string>
using namespace std;
/* ORIGINAL PROBLEM
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.
Answer: 906609
*/
// Time Complexity: O(n^2)
bool isPalindrome(int cand)
{
string temp = to_string(static_cast<long long>(cand));
for (int i = 0; i < (temp.length())/2 + 1; i++)
{
if (temp[i] != temp[temp.length() - i - 1])
return false;
}
return true;
}
int main()
{
int cand;
int pal = -1;
for (int i = 999; i >= 100; i--)
{
for (int j = 999; j >= 100; j--)
{
cand = i * j;
if (isPalindrome(cand))
{
if (cand > pal)
pal = cand;
}
}
}
cout << "The largest palindrome is: " << pal << endl;
} | [
"rchen93@ucla.edu"
] | rchen93@ucla.edu |
5eca1e4503ed0daca4621ec03d3d077fdab20856 | 33e65c3c8257eb89ea62220f95aafca507fe7a42 | /PWGHF/vertexingHF/vHFML/AliHFMLResponse.cxx | bf74217afd71b6017505077cf7e2a4c16cc9154a | [] | permissive | tdietel/AliPhysics | 5f27acbb4abc042ba1b67bc9d7794d91e5bc099e | e1bff58959a2702e2d84d0ba6590c21d29af85dc | refs/heads/master | 2021-01-23T02:00:41.413005 | 2019-11-18T23:23:56 | 2019-11-18T23:23:56 | 85,959,164 | 0 | 0 | BSD-3-Clause | 2019-09-02T20:10:27 | 2017-03-23T14:27:29 | C++ | UTF-8 | C++ | false | false | 10,770 | cxx | // Copyright CERN. This software is distributed under the terms of the GNU
// General Public License v3 (GPL Version 3).
//
// See http://www.gnu.org/licenses/ for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//**************************************************************************************
// \class AliHFMLResponse
// \brief helper class to handle application of ML models trained with python libraries
// \authors:
// F. Catalano, fabio.catalano@cern.ch
// F. Grosa, fabrizio.grosa@cern.ch
/////////////////////////////////////////////////////////////////////////////////////////
#include <TGrid.h>
#include <TSystem.h>
#include <TDirectory.h>
#include <TFile.h>
#include "yaml-cpp/yaml.h"
#include "AliHFMLResponse.h"
#include "AliLog.h"
/// \cond CLASSIMP
ClassImp(AliHFMLResponse);
/// \endcond
//________________________________________________________________
AliHFMLResponse::AliHFMLResponse() : TObject(),
fModels{},
fModelLibraries{},
fModelVarNames{},
fModelPaths{},
fModelOutputCuts{},
fPtBinsModel{},
fPtBinCand(-1),
fVars{}
{
//
// Default constructor
//
}
//________________________________________________________________
AliHFMLResponse::AliHFMLResponse(string configfilename) : TObject(),
fModels{},
fModelLibraries{},
fModelVarNames{},
fModelPaths{},
fModelOutputCuts{},
fPtBinsModel{},
fPtBinCand(-1),
fVars{}
{
//
// Standard constructor
//
if (configfilename != "")
SetConfigFile(configfilename);
}
//________________________________________________________________
AliHFMLResponse::~AliHFMLResponse()
{
//
// Destructor
//
}
//--------------------------------------------------------------------------
AliHFMLResponse::AliHFMLResponse(const AliHFMLResponse &source) : TObject(source),
fModels(source.fModels),
fModelLibraries(source.fModelLibraries),
fModelVarNames(source.fModelVarNames),
fModelPaths(source.fModelPaths),
fModelOutputCuts(source.fModelOutputCuts),
fPtBinsModel(source.fPtBinsModel),
fPtBinCand(source.fPtBinCand),
fVars(source.fVars)
{
//
// Copy constructor
//
}
AliHFMLResponse &AliHFMLResponse::operator=(const AliHFMLResponse &source)
{
//
// assignment operator
//
if (&source == this)
return *this;
TObject::operator=(source);
fModels = source.fModels;
fModelLibraries = source.fModelLibraries;
fModelVarNames = source.fModelVarNames;
fModelPaths = source.fModelPaths;
fModelOutputCuts = source.fModelOutputCuts;
fPtBinsModel = source.fPtBinsModel;
fPtBinCand = source.fPtBinCand;
fVars = source.fVars;
return *this;
}
//________________________________________________________________
void AliHFMLResponse::SetConfigFile(const string configfilename)
{
string configFilePath = GetFile(configfilename);
YAML::Node configFile = YAML::LoadFile(configFilePath.data());
if (configFile.IsNull())
AliFatal("Yaml config file not found! Exit");
fModelVarNames = configFile["VarNames"].as<vector<string> >();
fModelPaths = configFile["ModelNames"].as<vector<string> >();
fModelOutputCuts = configFile["ModelOutputCuts"].as<vector<double> >();
fPtBinsModel = configFile["PtBins"].as<vector<double> >();
fModelLibraries = configFile["ModelLibraries"].as<vector<string> >();
//for consistency check
unsigned int numModels = configFile["NumModels"].as<unsigned int>();
unsigned int numVars = configFile["NumVars"].as<unsigned int>();
if (numModels != fModelPaths.size() || numModels != fModelLibraries.size() || numModels != fModelOutputCuts.size() || numModels != fPtBinsModel.size() - 1)
AliFatal("Inconsistency found in the number of models loaded from your yaml config file, please check it! Exit");
if (numVars != fModelVarNames.size())
AliFatal("Inconsistency found in the number of variables (features) loaded from your yaml config file, please check it! Exit");
}
//________________________________________________________________
double AliHFMLResponse::PredictProbaML(AliAODRecoDecayHF *cand, double bfield, AliAODPidHF *pidHF, int masshypo)
{
fPtBinCand = FindPtBin(cand->Pt());
SetMapOfVariables(cand, bfield, pidHF, masshypo);
if (fVars.empty())
{
AliWarning("Map of features empty!");
return -999.;
}
vector<double> vecOfFeatures;
for (auto varname : fModelVarNames)
{
if (fVars.find(varname) == fVars.end())
{ //variable name not found in variables map!
AliWarning("Variable (feature) used for ML training not implemented for model application!");
return -999.;
}
vecOfFeatures.push_back(fVars[varname]);
}
if (fPtBinCand > fModels.size()-1){
AliWarning(Form("Model for pT bin %d not loaded!",fPtBinCand));
return -999.;
}
double modelPred = fModels[fPtBinCand].Predict(&vecOfFeatures[0], vecOfFeatures.size());
return modelPred;
}
//________________________________________________________________
double AliHFMLResponse::PredictProbaML(double pt, vector<double> variables)
{
fPtBinCand = FindPtBin(pt);
if (fPtBinCand > fModels.size()-1){
AliWarning(Form("Model for pT bin %d not loaded!",fPtBinCand));
return -999.;
}
double modelPred = fModels[fPtBinCand].Predict(&variables[0], variables.size());
return modelPred;
}
//________________________________________________________________
bool AliHFMLResponse::IsSelectedML(double &prob, AliAODRecoDecayHF *cand, double bfield, AliAODPidHF *pidHF, int masshypo)
{
prob = PredictProbaML(cand, bfield, pidHF, masshypo);
if (prob > fModelOutputCuts[fPtBinCand])
return true;
return false;
}
//________________________________________________________________
bool AliHFMLResponse::IsSelectedML(double &prob, double pt, vector<double> variables)
{
prob = PredictProbaML(pt, variables);
if (prob > fModelOutputCuts[fPtBinCand])
return true;
return false;
}
//_________________________________________________________________________
string AliHFMLResponse::GetFile(const string path)
{
if (path.find("alien:") != string::npos)
{
size_t currPos = path.find_last_of("/") + 1;
string modelName = path.substr(currPos);
if (gGrid == nullptr)
{
TGrid::Connect("alien://");
if (gGrid == nullptr)
{
AliFatal("Connection to GRID not established! Exit");
}
}
string newPath = gSystem->pwd() + string("/") + modelName.data();
const char *OldRootDir = gDirectory->GetPath();
bool cpStatus = TFile::Cp(path.data(), newPath.data());
gDirectory->cd(OldRootDir);
if (!cpStatus)
{
AliFatal("Error in coping file from Alien! Exit");
}
return newPath;
}
else
{
return path;
}
}
//_________________________________________________________________________
void AliHFMLResponse::InitModels()
{
for (auto iMod = 0; iMod<fModelPaths.size(); iMod++)
{
string localpath = GetFile(fModelPaths[iMod]);
AliExternalBDT model = AliExternalBDT();
bool loadmodel = false;
switch (kLibMap[fModelLibraries[iMod]])
{
case kXGBoost:
{
loadmodel = model.LoadXGBoostModel(localpath);
break;
}
case kLightGBM:
{
loadmodel = model.LoadLightGBMModel(localpath);
break;
}
case kModelLibrary:
{
loadmodel = model.LoadModelLibrary(localpath);
break;
}
default:
{
loadmodel = model.LoadXGBoostModel(localpath);
break;
}
}
if (!loadmodel)
AliFatal("Problem in loading model");
fModels.push_back(model);
}
}
//_________________________________________________________________________
int AliHFMLResponse::FindPtBin(double pt)
{
int bin = TMath::BinarySearch(fPtBinsModel.size() - 1, &fPtBinsModel[0], pt);
if (bin < 0) //underflow --> equal to min value
bin = 0;
return bin;
}
//________________________________________________________________
double AliHFMLResponse::ComputeMaxd0MeasMinusExp(AliAODRecoDecayHF *cand, double bfield)
{
double dd0max = 0;
unsigned int fNProngsCand = static_cast<unsigned int>(cand->GetNProngs());
for (unsigned int iProng = 0; iProng < fNProngsCand; iProng++)
{
double d0diff, errd0diff;
cand->Getd0MeasMinusExpProng(iProng, bfield, d0diff, errd0diff);
double normdd0 = d0diff / errd0diff;
if (iProng == 0 || TMath::Abs(normdd0) > TMath::Abs(dd0max))
dd0max = normdd0;
}
return dd0max;
}
//________________________________________________________________
double AliHFMLResponse::CombineNsigmaTPCTOF(double nsigmaTPC, double nsigmaTOF)
{
if (nsigmaTPC > -998. && nsigmaTOF > -998.)
return TMath::Sqrt((nsigmaTPC * nsigmaTPC + nsigmaTOF * nsigmaTOF) / 2);
else if (nsigmaTPC > -998. && nsigmaTOF < -998.)
return TMath::Abs(nsigmaTPC);
else if (nsigmaTPC < -998. && nsigmaTOF > -998.)
return TMath::Abs(nsigmaTOF);
else
return -999.;
}
| [
"fabrizio.grosa@cern.ch"
] | fabrizio.grosa@cern.ch |
84c41167f384aa074462e947fe93693a9e3bc82b | d1340f10a78dacd903c6a9cfe7fdcab7b78caf87 | /components/supply/supply.h | 6e9c54c9ff3c2bef7379cdd9207d77b39be6f711 | [
"Apache-2.0"
] | permissive | sureshk93/MetroM4_SamD51Basis | 17bd44d306c9268c5b1974eed4104af234302617 | cec81f47903b321ab9cc8e9355eade795781bf38 | refs/heads/master | 2020-09-17T22:15:46.287470 | 2019-10-17T21:33:35 | 2019-10-17T21:33:35 | 224,117,986 | 1 | 0 | Apache-2.0 | 2019-11-26T06:23:51 | 2019-11-26T06:23:50 | null | UTF-8 | C++ | false | false | 830 | h | /*
Copyright 2019 June Hanabi
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.
*/
/*
* Supply.h
*
* Created: 10/7/2019 8:16:40 AM
* Author: juneh
*/
#ifndef __SUPPLY_H__
#define __SUPPLY_H__
class Supply
{
public:
static void boot();
static void powerCPUTemp();
static void powerCompTemp();
};
#endif
| [
"junehanabi@gmail.com"
] | junehanabi@gmail.com |
e6274bb6844a6f92ccd898ab51ac5ed2f2247705 | 8843c081acbe011a3b08520f9fc40a047e69c890 | /Coursera/Algorithmic Toolbox/week4_divide_and_conquer/1_binary_search/binary_search.cpp | e6698fd54a07db096db580752b54ef0db55493e1 | [] | no_license | Sh3ra/MyOwnCoding | 877aa26faa9b463e8572a205ac1d08aef18266d0 | c72a2f0a627f9f00a415f4db04530ed1ad1c3ee5 | refs/heads/master | 2023-05-11T07:08:53.036944 | 2020-10-25T10:36:44 | 2020-10-25T10:36:44 | 243,688,930 | 0 | 0 | null | 2023-05-08T04:17:24 | 2020-02-28T05:54:02 | MATLAB | UTF-8 | C++ | false | false | 853 | cpp | #include <iostream>
#include <cassert>
#include <vector>
using std::vector;
int binary_search(const vector<int> &a, int x) {
int left = 0, right = (int)a.size()-1;
while (left>right)
{
int mid=left+(right-left)/2;
if(a[mid]==x)return mid;
else if(a[mid]>x)right=mid-1;
else left=mid+1;
}
return -1;
}
int linear_search(const vector<int> &a, int x) {
for (size_t i = 0; i < a.size(); ++i) {
if (a[i] == x) return i;
}
return -1;
}
int main() {
int n;
std::cin >> n;
vector<int> a(n);
for (size_t i = 0; i < a.size(); i++) {
std::cin >> a[i];
}
int m;
std::cin >> m;
vector<int> b(m);
for (int i = 0; i < m; ++i) {
std::cin >> b[i];
}
for (int i = 0; i < m; ++i) {
//replace with the call to binary_search when implemented
std::cout << linear_search(a, b[i]) << ' ';
}
}
| [
"youssefalshaarawi@yahoo.com"
] | youssefalshaarawi@yahoo.com |
00648975bdfb96985d81661f8363f8ef6fa13fc9 | 14e2ee16300fb1909b4508cf11c1c1af9dd4e348 | /Day_Four/PROJECT/MotionChangerExample_noFunctions/MotionChangerExample_noFunctions.ino | 6f4652df1446e31eb0d65ba5d790d87957725ebb | [] | no_license | lizastark/GWC_WearableTech | a230ae0cff8d2d4ed3833164d0ac75520b310033 | e292fc821301070bab06c2f3381a0e89874017ea | refs/heads/master | 2021-04-09T10:40:22.542305 | 2019-05-17T14:27:40 | 2019-05-17T14:27:40 | 125,271,558 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 2,474 | ino | /*
Tilt Debouncer
By Your Name(s)
This sketch uses conditionals, operators, and a timing function called millis()
to make sure the tilt switch is actually tilted and not just experiencing noise.
This code is based on the "Better Debouncer" example by Lady Ada that you can find here:
http://www.ladyada.net/learn/sensor/tilt.html
NOTE: YOU DO NOT NEED TO WRITE IN ALL THE COMMENTS! THERE'S A LOT AND WE HAVE
A LOT TO COVER. YOU CAN ADD THEM IN LATER.
*/
int tiltPin = 10; // the number of the tilt pin
// pin 10 on Plus Board, pin 5 on SimpleSnap
int tiltState; // the current reading from the tilt pin
int ledPin = A8; // the number of the LED pin
// pin A8 on Plus Board, pin 9 on SimpleSnap
int vibePin = 11; // the number of the vibe motor pin
// pin 11 on Plus Board, pin 6 on SimpleSnap
int outputState = HIGH; // the current state of the output pins
int previousTiltState = LOW; // the previous reading from the input pin
// the following variables are long because the time, measured in milliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0; // the last time the tilt switch changed states
//(i.e. from on to off or off to on)
long debounce = 50; // the debounce time (i.e. how much time we wait to make
// sure the button is really pressed - increase if the output flickers
void setup()
{
pinMode(tiltPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
pinMode(vibePin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int switchState; //declare the variable that will hold the debounced reading later
tiltState = digitalRead(tiltPin);
Serial.println(tiltState);
// If the switch changed, due to bounce or pressing...
if (tiltState != previousTiltState) {
// reset the debouncing timer
time = millis();
}
if ((millis() - time) > debounce) {
// whichever way the sensor is tilted, it's been that way long
// enough for us to know it has actually changed states
switchState = tiltState;
}
// invert the output so the LED turns
// on when the switch is closed
if (switchState == HIGH) {
outputState = LOW;
}
else {
outputState = HIGH;
}
digitalWrite(ledPin, outputState);
digitalWrite(vibePin, outputState);
// save the last reading so we can check it again in the next round
previousTiltState = tiltState;
}
| [
"lizastark@gmail.com"
] | lizastark@gmail.com |
ff96984669d2907d4e29af3e3eec55009a878d9a | 0d3875b31c1989c1bd3199a6dd21530309689e98 | /c++/qt/src/QT5.9Samp/chap13Thread/samp13_3QMutexLocker/ui_dialog.h | fa44f4067e41492b8482287354fa795fb0acc1e7 | [] | no_license | wrzfeijianshen/TL | 00c4cf44e7217bb4d0d228f2eb5c3fc5dbab2e74 | 12032d5cd16c30bd7376e375fb3b2450d9720180 | refs/heads/master | 2021-04-27T00:10:26.488055 | 2018-12-19T06:04:22 | 2018-12-19T06:04:22 | 123,762,083 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 5,302 | h | /********************************************************************************
** Form generated from reading UI file 'dialog.ui'
**
** Created by: Qt User Interface Compiler version 5.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_DIALOG_H
#define UI_DIALOG_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QDialog>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPlainTextEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_Dialog
{
public:
QVBoxLayout *verticalLayout_2;
QGroupBox *groupBox;
QVBoxLayout *verticalLayout;
QHBoxLayout *horizontalLayout;
QPushButton *btnStartThread;
QPushButton *btnDiceBegin;
QPushButton *btnDiceEnd;
QPushButton *btnStopThread;
QPushButton *btnClear;
QHBoxLayout *horizontalLayout_3;
QPlainTextEdit *plainTextEdit;
QLabel *LabPic;
QLabel *LabA;
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
Dialog->setObjectName(QStringLiteral("Dialog"));
Dialog->resize(489, 410);
verticalLayout_2 = new QVBoxLayout(Dialog);
verticalLayout_2->setSpacing(6);
verticalLayout_2->setContentsMargins(11, 11, 11, 11);
verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
groupBox = new QGroupBox(Dialog);
groupBox->setObjectName(QStringLiteral("groupBox"));
verticalLayout = new QVBoxLayout(groupBox);
verticalLayout->setSpacing(6);
verticalLayout->setContentsMargins(11, 11, 11, 11);
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setSpacing(6);
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
btnStartThread = new QPushButton(groupBox);
btnStartThread->setObjectName(QStringLiteral("btnStartThread"));
horizontalLayout->addWidget(btnStartThread);
btnDiceBegin = new QPushButton(groupBox);
btnDiceBegin->setObjectName(QStringLiteral("btnDiceBegin"));
btnDiceBegin->setEnabled(false);
horizontalLayout->addWidget(btnDiceBegin);
btnDiceEnd = new QPushButton(groupBox);
btnDiceEnd->setObjectName(QStringLiteral("btnDiceEnd"));
btnDiceEnd->setEnabled(false);
horizontalLayout->addWidget(btnDiceEnd);
btnStopThread = new QPushButton(groupBox);
btnStopThread->setObjectName(QStringLiteral("btnStopThread"));
btnStopThread->setEnabled(false);
horizontalLayout->addWidget(btnStopThread);
btnClear = new QPushButton(groupBox);
btnClear->setObjectName(QStringLiteral("btnClear"));
horizontalLayout->addWidget(btnClear);
verticalLayout->addLayout(horizontalLayout);
horizontalLayout_3 = new QHBoxLayout();
horizontalLayout_3->setSpacing(6);
horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
plainTextEdit = new QPlainTextEdit(groupBox);
plainTextEdit->setObjectName(QStringLiteral("plainTextEdit"));
horizontalLayout_3->addWidget(plainTextEdit);
LabPic = new QLabel(groupBox);
LabPic->setObjectName(QStringLiteral("LabPic"));
LabPic->setMinimumSize(QSize(150, 0));
LabPic->setPixmap(QPixmap(QString::fromUtf8(":/dice/images/d0.jpg")));
horizontalLayout_3->addWidget(LabPic);
verticalLayout->addLayout(horizontalLayout_3);
LabA = new QLabel(groupBox);
LabA->setObjectName(QStringLiteral("LabA"));
verticalLayout->addWidget(LabA);
verticalLayout_2->addWidget(groupBox);
retranslateUi(Dialog);
QMetaObject::connectSlotsByName(Dialog);
} // setupUi
void retranslateUi(QDialog *Dialog)
{
Dialog->setWindowTitle(QApplication::translate("Dialog", "\345\244\232\347\272\277\347\250\213\357\274\214\344\275\277\347\224\250QMutex", Q_NULLPTR));
groupBox->setTitle(QApplication::translate("Dialog", "\347\272\277\347\250\213", Q_NULLPTR));
btnStartThread->setText(QApplication::translate("Dialog", "\345\220\257\345\212\250\347\272\277\347\250\213", Q_NULLPTR));
btnDiceBegin->setText(QApplication::translate("Dialog", "\345\274\200\345\247\213", Q_NULLPTR));
btnDiceEnd->setText(QApplication::translate("Dialog", "\346\232\202\345\201\234", Q_NULLPTR));
btnStopThread->setText(QApplication::translate("Dialog", "\347\273\223\346\235\237\347\272\277\347\250\213", Q_NULLPTR));
btnClear->setText(QApplication::translate("Dialog", "\346\270\205\347\251\272\346\226\207\346\234\254", Q_NULLPTR));
LabPic->setText(QString());
LabA->setText(QApplication::translate("Dialog", "Thread\347\212\266\346\200\201\357\274\232", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class Dialog: public Ui_Dialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_DIALOG_H
| [
"wrzfeijianshen@126.com"
] | wrzfeijianshen@126.com |
7106a3fc68e0e7913ebe2f65327a3746676b12b4 | 239ae5502fd576d5d3830de2d0b1b4802d5d22f8 | /test/CXX/expr/expr.prim/expr.prim.lambda/generic-lambda-unimplemented-1y.cpp | 7773aedb4ee46833922ed3c36fc821bd071bf8bc | [
"NCSA"
] | permissive | je4d/clang | 489a6a7904791ab744a55e5aea14b6301cec567a | 9beaf20b882eb83082da27a74760277bb9fc0bdd | refs/heads/master | 2021-01-18T10:43:59.954855 | 2013-09-28T05:38:27 | 2013-09-28T05:38:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,216 | cpp | // RUN: %clang_cc1 -fsyntax-only -std=c++1y %s -verify
namespace return_type_deduction_ok {
auto l = [](auto a) ->auto { return a; }(2);
auto l2 = [](auto a) ->decltype(auto) { return a; }(2);
auto l3 = [](auto a) { return a; }(2);
}
namespace lambda_capturing {
// FIXME: Once return type deduction is implemented for generic lambdas
// this will need to be updated.
void test() {
int i = 10;
auto L = [=](auto a) -> int { //expected-error{{unimplemented}}
return i + a;
};
L(3);
}
}
namespace nested_generic_lambdas {
void test() {
auto L = [](auto a) -> int {
auto M = [](auto b, decltype(a) b2) -> int { //expected-error{{unimplemented}}
return 1;
};
M(a, a);
};
L(3); //expected-note{{in instantiation of}}
}
template<class T> void foo(T) {
auto L = [](auto a) { return a; }; //expected-error{{unimplemented}}
}
template void foo(int); //expected-note{{in instantiation of}}
}
namespace conversion_operator {
void test() {
auto L = [](auto a) -> int { return a; };
int (*fp)(int) = L; //expected-error{{no viable conversion}}
}
}
namespace generic_lambda_as_default_argument_ok {
void test(int i = [](auto a)->int { return a; }(3)) {
}
}
| [
"faisalv@yahoo.com"
] | faisalv@yahoo.com |
761bd68e00b662077174d5f540587e7aa3c4ea8d | f03b829adca54cdd351f28816dbf724da0b7dc58 | /_node_modules/grpc/deps/grpc/src/core/lib/json/json_string.cc | 4be5abccfc5678a0d7399f26e4e753187d29e2d3 | [
"Apache-2.0"
] | permissive | srikaewa/SUTSmartFarm | a5657af5af55202ad9af67ddf8e36207e171e30b | 6b2a22944ddf54a99abe34f1b67d332bc926c1ad | refs/heads/master | 2020-04-16T21:57:19.749841 | 2019-01-18T21:09:22 | 2019-01-18T21:09:22 | 161,265,724 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,482 | cc | /*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <stdlib.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_reader.h"
#include "src/core/lib/json/json_writer.h"
/* The json reader will construct a bunch of grpc_json objects and
* link them all up together in a tree-like structure that will represent
* the json data in memory.
*
* It also uses its own input as a scratchpad to store all of the decoded,
* unescaped strings. So we need to keep track of all these pointers in
* that opaque structure the reader will carry for us.
*
* Note that this works because the act of parsing json always reduces its
* input size, and never expands it.
*/
typedef struct {
grpc_json* top;
grpc_json* current_container;
grpc_json* current_value;
uint8_t* input;
uint8_t* key;
uint8_t* string;
uint8_t* string_ptr;
size_t remaining_input;
} json_reader_userdata;
/* This json writer will put everything in a big string.
* The point is that we allocate that string in chunks of 256 bytes.
*/
typedef struct {
char* output;
size_t free_space;
size_t string_len;
size_t allocated;
} json_writer_userdata;
/* This function checks if there's enough space left in the output buffer,
* and will enlarge it if necessary. We're only allocating chunks of 256
* bytes at a time (or multiples thereof).
*/
static void json_writer_output_check(void* userdata, size_t needed) {
json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
if (state->free_space >= needed) return;
needed -= state->free_space;
/* Round up by 256 bytes. */
needed = (needed + 0xff) & ~0xffU;
state->output =
static_cast<char*>(gpr_realloc(state->output, state->allocated + needed));
state->free_space += needed;
state->allocated += needed;
}
/* These are needed by the writer's implementation. */
static void json_writer_output_char(void* userdata, char c) {
json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
json_writer_output_check(userdata, 1);
state->output[state->string_len++] = c;
state->free_space--;
}
static void json_writer_output_string_with_len(void* userdata, const char* str,
size_t len) {
json_writer_userdata* state = static_cast<json_writer_userdata*>(userdata);
json_writer_output_check(userdata, len);
memcpy(state->output + state->string_len, str, len);
state->string_len += len;
state->free_space -= len;
}
static void json_writer_output_string(void* userdata, const char* str) {
size_t len = strlen(str);
json_writer_output_string_with_len(userdata, str, len);
}
/* The reader asks us to clear our scratchpad. In our case, we'll simply mark
* the end of the current string, and advance our output pointer.
*/
static void json_reader_string_clear(void* userdata) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
if (state->string) {
GPR_ASSERT(state->string_ptr < state->input);
*state->string_ptr++ = 0;
}
state->string = state->string_ptr;
}
static void json_reader_string_add_char(void* userdata, uint32_t c) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
GPR_ASSERT(state->string_ptr < state->input);
GPR_ASSERT(c <= 0xff);
*state->string_ptr++ = static_cast<uint8_t>(c);
}
/* We are converting a UTF-32 character into UTF-8 here,
* as described by RFC3629.
*/
static void json_reader_string_add_utf32(void* userdata, uint32_t c) {
if (c <= 0x7f) {
json_reader_string_add_char(userdata, c);
} else if (c <= 0x7ff) {
uint32_t b1 = 0xc0 | ((c >> 6) & 0x1f);
uint32_t b2 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
} else if (c <= 0xffff) {
uint32_t b1 = 0xe0 | ((c >> 12) & 0x0f);
uint32_t b2 = 0x80 | ((c >> 6) & 0x3f);
uint32_t b3 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
json_reader_string_add_char(userdata, b3);
} else if (c <= 0x1fffff) {
uint32_t b1 = 0xf0 | ((c >> 18) & 0x07);
uint32_t b2 = 0x80 | ((c >> 12) & 0x3f);
uint32_t b3 = 0x80 | ((c >> 6) & 0x3f);
uint32_t b4 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
json_reader_string_add_char(userdata, b3);
json_reader_string_add_char(userdata, b4);
}
}
/* We consider that the input may be a zero-terminated string. So we
* can end up hitting eof before the end of the alleged string length.
*/
static uint32_t json_reader_read_char(void* userdata) {
uint32_t r;
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
if (state->remaining_input == 0) return GRPC_JSON_READ_CHAR_EOF;
r = *state->input++;
state->remaining_input--;
if (r == 0) {
state->remaining_input = 0;
return GRPC_JSON_READ_CHAR_EOF;
}
return r;
}
/* Helper function to create a new grpc_json object and link it into
* our tree-in-progress inside our opaque structure.
*/
static grpc_json* json_create_and_link(void* userdata, grpc_json_type type) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
grpc_json* json = grpc_json_create(type);
json->parent = state->current_container;
json->prev = state->current_value;
state->current_value = json;
if (json->prev) {
json->prev->next = json;
}
if (json->parent) {
if (!json->parent->child) {
json->parent->child = json;
}
if (json->parent->type == GRPC_JSON_OBJECT) {
json->key = reinterpret_cast<char*>(state->key);
}
}
if (!state->top) {
state->top = json;
}
return json;
}
static void json_reader_container_begins(void* userdata, grpc_json_type type) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
grpc_json* container;
GPR_ASSERT(type == GRPC_JSON_ARRAY || type == GRPC_JSON_OBJECT);
container = json_create_and_link(userdata, type);
state->current_container = container;
state->current_value = nullptr;
}
/* It's important to remember that the reader is mostly stateless, so it
* isn't trying to remember what the container was prior the one that just
* ends. Since we're keeping track of these for our own purpose, we are
* able to return that information back, which is useful for it to validate
* the input json stream.
*
* Also note that if we're at the top of the tree, and the last container
* ends, we have to return GRPC_JSON_TOP_LEVEL.
*/
static grpc_json_type json_reader_container_ends(void* userdata) {
grpc_json_type container_type = GRPC_JSON_TOP_LEVEL;
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
GPR_ASSERT(state->current_container);
state->current_value = state->current_container;
state->current_container = state->current_container->parent;
if (state->current_container) {
container_type = state->current_container->type;
}
return container_type;
}
/* The next 3 functions basically are the reader asking us to use our string
* scratchpad for one of these 3 purposes.
*
* Note that in the set_number case, we're not going to try interpreting it.
* We'll keep it as a string, and leave it to the caller to evaluate it.
*/
static void json_reader_set_key(void* userdata) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
state->key = state->string;
}
static void json_reader_set_string(void* userdata) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
grpc_json* json = json_create_and_link(userdata, GRPC_JSON_STRING);
json->value = reinterpret_cast<char*>(state->string);
}
static int json_reader_set_number(void* userdata) {
json_reader_userdata* state = static_cast<json_reader_userdata*>(userdata);
grpc_json* json = json_create_and_link(userdata, GRPC_JSON_NUMBER);
json->value = reinterpret_cast<char*>(state->string);
return 1;
}
/* The object types true, false and null are self-sufficient, and don't need
* any more information beside their type.
*/
static void json_reader_set_true(void* userdata) {
json_create_and_link(userdata, GRPC_JSON_TRUE);
}
static void json_reader_set_false(void* userdata) {
json_create_and_link(userdata, GRPC_JSON_FALSE);
}
static void json_reader_set_null(void* userdata) {
json_create_and_link(userdata, GRPC_JSON_NULL);
}
static grpc_json_reader_vtable reader_vtable = {
json_reader_string_clear, json_reader_string_add_char,
json_reader_string_add_utf32, json_reader_read_char,
json_reader_container_begins, json_reader_container_ends,
json_reader_set_key, json_reader_set_string,
json_reader_set_number, json_reader_set_true,
json_reader_set_false, json_reader_set_null};
/* And finally, let's define our public API. */
grpc_json* grpc_json_parse_string_with_len(char* input, size_t size) {
grpc_json_reader reader;
json_reader_userdata state;
grpc_json* json = nullptr;
grpc_json_reader_status status;
if (!input) return nullptr;
state.top = state.current_container = state.current_value = nullptr;
state.string = state.key = nullptr;
state.string_ptr = state.input = reinterpret_cast<uint8_t*>(input);
state.remaining_input = size;
grpc_json_reader_init(&reader, &reader_vtable, &state);
status = grpc_json_reader_run(&reader);
json = state.top;
if ((status != GRPC_JSON_DONE) && json) {
grpc_json_destroy(json);
json = nullptr;
}
return json;
}
#define UNBOUND_JSON_STRING_LENGTH 0x7fffffff
grpc_json* grpc_json_parse_string(char* input) {
return grpc_json_parse_string_with_len(input, UNBOUND_JSON_STRING_LENGTH);
}
static void json_dump_recursive(grpc_json_writer* writer, grpc_json* json,
int in_object) {
while (json) {
if (in_object) grpc_json_writer_object_key(writer, json->key);
switch (json->type) {
case GRPC_JSON_OBJECT:
case GRPC_JSON_ARRAY:
grpc_json_writer_container_begins(writer, json->type);
if (json->child)
json_dump_recursive(writer, json->child,
json->type == GRPC_JSON_OBJECT);
grpc_json_writer_container_ends(writer, json->type);
break;
case GRPC_JSON_STRING:
grpc_json_writer_value_string(writer, json->value);
break;
case GRPC_JSON_NUMBER:
grpc_json_writer_value_raw(writer, json->value);
break;
case GRPC_JSON_TRUE:
grpc_json_writer_value_raw_with_len(writer, "true", 4);
break;
case GRPC_JSON_FALSE:
grpc_json_writer_value_raw_with_len(writer, "false", 5);
break;
case GRPC_JSON_NULL:
grpc_json_writer_value_raw_with_len(writer, "null", 4);
break;
default:
GPR_UNREACHABLE_CODE(abort());
}
json = json->next;
}
}
static grpc_json_writer_vtable writer_vtable = {
json_writer_output_char, json_writer_output_string,
json_writer_output_string_with_len};
char* grpc_json_dump_to_string(grpc_json* json, int indent) {
grpc_json_writer writer;
json_writer_userdata state;
state.output = nullptr;
state.free_space = state.string_len = state.allocated = 0;
grpc_json_writer_init(&writer, indent, &writer_vtable, &state);
json_dump_recursive(&writer, json, 0);
json_writer_output_char(&state, 0);
return state.output;
}
| [
"srikaewa@gmail.com"
] | srikaewa@gmail.com |
a4869329aaa09591e947876033d12eeb6b37c812 | 07b0d7504c48ee17c431734de9f1c0b8cf889ece | /DMap/mf/mfclient/hoststack/src/mfsocketfactory.cpp | b63bf33d65ba8fa18dd703730b752a51c0356cf1 | [] | no_license | crockct/GNRS-DOS | 1a9a766cfa8dcef40150602b27ae5b606a256c16 | 8d167e36fa140364f171be70b3d9e10f0cf3008f | refs/heads/master | 2020-12-22T00:39:02.309595 | 2016-08-09T04:10:18 | 2016-08-09T04:10:18 | 59,504,731 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,353 | cpp | /*
* Copyright (c) 2010-2013, Rutgers, The State University of New Jersey
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the organization(s) stated above nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file mfsocketfactory.cpp
* @author wontoniii (bronzino@winlab.rutgers.edu)
* @date March, 2015
* @brief Class that handles instantiation of socket managers.
*
* Class that handles instantiation of socket managers. Starting from a profile it generates the proper socketmanager
*/
#include "mflog.h"
#include "mfsocketmanager.h"
#include "mfbasesocketmanager.h"
#include "mfcontentsocketmanager.h"
#include "mfsocketfactory.h"
MF_SocketManager *MF_SocketFactory::getInstance(MFSystem *_system, int type, u_int UID){
MF_Log::mf_log(MF_ERROR, "MF_SocketFactory::getInstance operation not supported");
return NULL;
}
MF_SocketManager *MF_SocketFactory::getInstance(MFSystem *_system, int type, u_int UID, int nChunks){
MF_Log::mf_log(MF_ERROR, "MF_SocketFactory::getInstance operation not supported");
return NULL;
}
MF_SocketManager *MF_SocketFactory::getInstance(MFSystem *_system, const char *profile, u_int UID){
if(!strcmp("basic", profile)){
return new MF_BaseSocketManager(_system, UID);
} else if (!strcmp("content", profile)) {
return new MF_ContentSocketManager(_system, UID);
} else{
MF_Log::mf_log(MF_ERROR, "MF_SocketFactory::getInstance wrong profile request %s", profile);
return NULL;
}
}
MF_SocketManager *MF_SocketFactory::getInstance(MFSystem *_system, const char *profile,
u_int UID, int nChunks, TransportSetting ts){
if(!strcmp("basic", profile)){
return new MF_BaseSocketManager(_system, UID, nChunks, ts);
} else if (!strcmp("content", profile)) {
return new MF_ContentSocketManager(_system, UID, nChunks, ts);
} else{
MF_Log::mf_log(MF_ERROR, "MF_SocketFactory::getInstance wrong profile request %s", profile);
return NULL;
}
}
| [
"crockct@mit.edu"
] | crockct@mit.edu |
d84cda7a928aee0e2473179ed51a1df9220126ad | a10a6832270d003ffe9b26395c770fc7a56375a0 | /src/explorer.cpp | b08435a1b3a4c0e0dc21719324e6252819680bd7 | [] | no_license | Funcy-dcm/EMP | 741aad408f41db1349811647be7aec95e003a5a4 | 5138a02734a7aad39543e976141c6cb2faee2f61 | refs/heads/master | 2022-09-16T06:55:55.314263 | 2013-12-14T15:32:06 | 2013-12-14T15:32:06 | 268,309,410 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,251 | cpp | #include "explorer.h"
ExplorerWidget::ExplorerWidget(MediaPlayer *player, QWidget *parent) :
QTableView(parent),
m_player(player)
{
setObjectName("ExplorerWidget");
model = new QDirModel(this);
model->setSorting(QDir::DirsFirst | QDir::IgnoreCase);
model->setFilter(QDir::NoDot | QDir::Dirs | QDir::Files);
model->setLazyChildCount(true);
setModel(model);
QModelIndex index = model->index(m_player->homeFilePath);
setRootIndex(index);
setColumnHidden(1, true);
setColumnHidden(2, true);
setColumnHidden(3, true);
horizontalHeader()->hide();
verticalHeader()->hide();
setSelectionBehavior( QAbstractItemView::SelectRows );
setSelectionMode(QAbstractItemView::SingleSelection);
horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
setShowGrid(false);
setFocusPolicy(Qt::NoFocus);
setEditTriggers(QAbstractItemView::NoEditTriggers);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
connect(this, SIGNAL(activated(const QModelIndex&)),
SLOT(slotSetIndex(QModelIndex)));
selectRow(0);
oldIndex = currentIndex();
onFullScreen(false);
QString strF = QString(EXTENSIONS_VIDEO) + QString(EXTENSIONS_AUDIO);
strFilters = strF.split(" *", QString::SkipEmptyParts);
setFilters();
}
ExplorerWidget::~ExplorerWidget()
{
}
/*virtual*/ void ExplorerWidget::keyPressEvent(QKeyEvent* pe)
{
if (pe->key() == Qt::Key_Left) {
qDebug() << "Backspace";
}
}
void ExplorerWidget::slotSetIndex(const QModelIndex& newIndex)
{
if (model->isDir(newIndex)) {
for (int i = 0; i < model->rowCount(rootIndex()); i++) {
if (isRowHidden(i)) showRow(i);
}
setRootIndex(newIndex);
selectRow(0);
setFilters();
} else {
if (!m_player->isFullScreen())
m_player->controlPanel->show();
QString filePath = model->filePath(newIndex);
m_player->saveFilePos();
m_player->initPlayList();
m_player->addFile(filePath);
m_player->setCurrentSource(filePath, true);
}
oldIndex = newIndex;
}
void ExplorerWidget::slotKeyLeft()
{
if (m_player->sWidget.currentIndex() == 3) {
for (int i = 0; i < model->rowCount(rootIndex()); i++) {
if (isRowHidden(i)) showRow(i);
}
setRootIndex(model->parent(oldIndex));
} else {
m_player->controlPanel->hide();
m_player->pause();
m_player->sWidget.setCurrentIndex(3);
}
int row = oldIndex.row();
if (row == -1) row = 0;
selectRow(row-1);
setFilters();
selectRow(row);
oldIndex = model->parent(oldIndex);
}
void ExplorerWidget::slotKeyRight()
{
if (m_player->sWidget.currentIndex() != 3) return;
slotSetIndex(currentIndex());
}
void ExplorerWidget::slotKeyUp()
{
if (m_player->sWidget.currentIndex() != 3) return;
bool ok = false;
int row = currentIndex().row();
if (row > 0) {
for (int i = row-1; i >= 0; --i) {
if (!isRowHidden(i)) {
selectRow(i);
ok = true;
break;
}
}
}
if (!ok) {
row = model->rowCount(rootIndex())-1;
for (int i = row; i >= 0; --i) {
if (!isRowHidden(i)) {
selectRow(i); break;
}
}
}
// if (currentIndex().row() > 0)
// selectRow(currentIndex().row() - 1);
// else selectRow(model->rowCount(rootIndex())-1);
}
void ExplorerWidget::slotKeyDown()
{
if (m_player->sWidget.currentIndex() != 3) return;
bool ok = false;
int row = currentIndex().row();
if (row < (model->rowCount(rootIndex()) - 1)) {
for (int i = row+1; i < model->rowCount(rootIndex()); i++) {
if (!isRowHidden(i)) {
selectRow(i);
ok = true;
break;
}
}
}
if (!ok) {
row = 0;
for (int i = row; i < model->rowCount(rootIndex()); i++) {
if (!isRowHidden(i)) {
selectRow(i); break;
}
}
}
// if (currentIndex().row() < (model->rowCount(rootIndex()) - 1)) {
// selectRow(currentIndex().row() + 1);
// } else selectRow(0);
// int current = verticalScrollBar()->value();
// verticalScrollBar()->setValue(++current);
}
void ExplorerWidget::onFullScreen(bool on)
{
QFont font;
font = this->font();
int fontSize;
int itemSise;
if (on) {
fontSize = 48;
itemSise = fontSize + 24;
setIconSize(QSize(48, 48));
} else {
fontSize = 24;
itemSise = fontSize + 10;
setIconSize(QSize(16, 16));
}
font.setPixelSize(fontSize);
setFont(font);
verticalHeader()->setDefaultSectionSize(itemSise);
int row = currentIndex().row();
selectRow(row+1);
selectRow(row);
}
void ExplorerWidget::setFilters()
{
bool ok;
QModelIndex index;
for (int i = 0; i < model->rowCount(rootIndex()); i++) {
index = model->index(i, 0 ,rootIndex());
if (!model->isDir(index)) {
QString str = model->fileName(index);
ok = false;
foreach (QString strFilter, strFilters) {
if (str.contains(strFilter, Qt::CaseInsensitive)) {
ok = true; break;
}
}
if (!ok) {
hideRow(i);
}
} else {
if (model->fileName(index) == "..") {
}
}
}
}
| [
"egor.shilyaev@gmail.com"
] | egor.shilyaev@gmail.com |
4c649b2745a53b644ccc23890c55c3984c54e351 | 0570750c6d8e28d837f9e4f7dc825c968c874fb4 | /build/Android/Preview1/app/src/main/include/Uno/Memory.h | cc1beed6ad95d212ec3c74e284153db964f94f31 | [] | no_license | theaustinthompson/maryjane | b3671d950aad58fd2ed490bda8aa1113aedf5a97 | b4ddf76aa2a2caae77765435d0315cf9111d6626 | refs/heads/master | 2021-04-12T08:37:47.311922 | 2018-03-27T23:06:47 | 2018-03-27T23:06:47 | 126,034,050 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,609 | h | // This file was generated based on C:/Users/borde_000/AppData/Local/Fusetools/Packages/UnoCore/1.8.0/Backends/CPlusPlus/Uno/Memory.h.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno/_config.h>
struct uArray;
struct uArrayType;
struct uByRefType;
struct uClassType;
struct uDelegate;
struct uField;
struct uFieldInfo;
struct uFunction;
struct uInterfaceType;
struct uObject;
struct uStatic;
struct uString;
struct uType;
struct uTField;
struct uTRef;
struct uT;
struct uWeakObject;
struct uThreadData;
template<class T> struct uStrong;
template<class T> struct uSWeak;
template<class T> struct uWeak;
/**
\addtogroup Memory
@{
*/
struct uRuntime
{
uRuntime();
~uRuntime();
private:
uRuntime(const uRuntime&);
uRuntime& operator =(const uRuntime&);
};
struct uStackFrame
{
uStackFrame(const char* type, const char* function);
~uStackFrame();
private:
uThreadData* _thread;
uStackFrame(const uStackFrame&);
uStackFrame& operator = (const uStackFrame&);
};
uString* uGetStackTrace();
uArray* uGetNativeStackTrace(int skipFrames);
struct uAutoReleasePool
{
uAutoReleasePool();
~uAutoReleasePool();
private:
uThreadData* _thread;
uAutoReleasePool(const uAutoReleasePool&);
uAutoReleasePool& operator = (const uAutoReleasePool&);
};
struct uForeignPool
{
uForeignPool();
~uForeignPool();
private:
uThreadData* _thread;
bool _threadHasPool;
uForeignPool(const uForeignPool&);
uForeignPool& operator = (const uForeignPool&);
};
void uRetainStruct(uType* type, void* address);
void uReleaseStruct(uType* type, void* address);
void uAutoReleaseStruct(uType* type, void* address);
void uRetain(uObject* object);
void uRelease(uObject* object);
void uAutoRelease(uObject* object);
struct uWeakStateIntercept
{
enum Event { OnRelease = 0, OnLoad = 1 };
// Callback is called on two occasions, both times while holding the
// internal uWeakObject's mutex:
//
// 1. Called from uRelease, with Event::OnRelease, when the object's
// reference count reaches zero.
//
// Returning true from the callback at this point allows deletion to
// proceed normally.
//
// Returning false defers object deletion, at which point, the object
// is considered a Zombie. Weak references may bring a Zombie object
// back to life (see point 2, below).
//
// NOTE: If the object's reference count reaches zero while it is
// considered a Zombie, object deletion proceeds without further
// notice.
//
//
// 2. Called from uLoadWeak, with Event::OnLoad, when attempting to
// obtain strong reference to a Zombie object (see point 1).
//
// If the callback returns true, the object is brought back to life and
// no longer considered a Zombie. Namely, the next time the reference
// count reaches zero the callback will be invoked again, per point 1.
//
// Returning false from the callback signals that object deletion is
// pending; uLoadWeak will return NULL.
//
//
// For a given object, the callback will be invoked at least once with
// Event::OnRelease, before object deletion takes place. Any subsequent
// calls with Event::OnRelease will be preceded by exacly one call with
// Event::OnLoad as the first argument.
typedef bool (*Callback)(Event, uObject *);
static void SetCallback(uWeakObject* object, Callback callback);
};
void uStoreStrong(uObject** address, uObject* object);
void uStoreWeak(uWeakObject** address, uObject* object);
uObject* uLoadWeak(uWeakObject* ptr);
#ifdef DEBUG_DUMPS
void uDumpAllStrongRefs(const char* filename);
#endif
struct uObjectRefs
{
size_t WeakCount;
size_t StrongCount;
size_t* Weak;
size_t* Strong;
};
template<class T>
struct uStrongRef
{
T* _address;
uStrongRef(T* address)
: _address(address) {
U_ASSERT(_address);
uAutoRelease(*_address);
}
~uStrongRef() {
U_ASSERT(_address);
uRetain(*_address);
}
operator T*() {
return _address;
}
operator uTRef&() {
return (uTRef&)_address;
}
template<class U>
explicit operator U() {
return (U)_address;
}
};
template<class T>
struct uWeakRef
{
uWeakObject** _address;
uObject* _value;
uWeakRef(uWeakObject** address)
: _address(address) {
U_ASSERT(address);
_value = uLoadWeak(*address);
}
~uWeakRef() {
uStoreWeak(_address, _value);
}
operator T*() {
return (T*)&_value;
}
operator uTRef&() {
return (uTRef&)&_value;
}
template<class U>
explicit operator U() {
return (U)&_value;
}
};
template<class T>
struct uSStrong
{
T _object;
uSStrong() {
}
uSStrong(T object)
: _object(object) {
uRetain((uObject*)object);
}
uSStrong<T>& operator =(T object) {
uStoreStrong((uObject**)&_object, (uObject*)object);
return *this;
}
uSStrong<T>& operator =(const uSStrong<T>& copy) {
return *this = copy._object;
}
uSStrong<T>& operator =(const uSWeak<T>& copy) {
return *this = (T)uLoadWeak(copy._object);
}
bool operator ==(T object) const {
return _object == object;
}
bool operator !=(T object) const {
return _object != object;
}
bool operator !() const {
return !_object;
}
uStrongRef<T> operator &() {
return &_object;
}
operator T() {
return _object;
}
T operator ->() {
return _object;
}
template<class U>
explicit operator U() {
return (U)_object;
}
};
template<class T>
struct uSWeak
{
uWeakObject* _object;
uSWeak() {
}
uSWeak(T object)
: _object(NULL) {
uStoreWeak(&_object, (uObject*)object);
}
uSWeak<T>& operator =(T object) {
uStoreWeak(&_object, (uObject*)object);
return *this;
}
uSWeak<T>& operator =(const uSStrong<T>& copy) {
return *this = copy._object;
}
uSWeak<T>& operator =(const uSWeak<T>& copy) {
_object = copy._object;
return *this;
}
bool operator ==(T object) const {
return (T)uLoadWeak(const_cast<uWeakObject*>(_object)) == object;
}
bool operator !=(T object) const {
return (T)uLoadWeak(const_cast<uWeakObject*>(_object)) != object;
}
bool operator !() const {
return !uLoadWeak(const_cast<uWeakObject*>(_object));
}
uWeakRef<T> operator &() {
return &_object;
}
operator T() {
return (T)uLoadWeak(_object);
}
T operator ->() {
return (T)uLoadWeak(_object);
}
template<class U>
explicit operator U() {
return (U)uLoadWeak(_object);
}
};
template<class T>
struct uStrong : uSStrong<T>
{
using uSStrong<T>::_object;
using uSStrong<T>::operator =;
uStrong() {
_object = NULL;
}
uStrong(T object)
: uSStrong<T>(object) {
}
uStrong(const uStrong& copy)
: uSStrong<T>(copy._object) {
}
~uStrong() {
uRelease((uObject*)_object);
}
};
template<class T>
struct uWeak : uSWeak<T>
{
using uSWeak<T>::_object;
using uSWeak<T>::operator =;
uWeak() {
_object = NULL;
}
uWeak(T object)
: uSWeak<T>(object) {
}
~uWeak() {
uStoreWeak(&_object, NULL);
}
};
/** @} */
| [
"austin@believeinthompson.com"
] | austin@believeinthompson.com |
4bafbd2b8000bb20a110eac284646a646a45ae5b | e43cd49419e63257a6976ff73efd22cd61e57acc | /src/pgfe/compositional.hpp | 066af105cb7e55c02b2b291192cdb2b7c18639fb | [
"Apache-2.0"
] | permissive | dmitigr/pgfe | 0ee9fd752e5ab12304cdcf03b0c8c04ecc1d778b | 87e37daf312d10c8d364c8edb61717765cf6bea2 | refs/heads/main | 2023-08-07T22:31:11.861167 | 2023-07-27T14:30:47 | 2023-07-27T14:30:47 | 134,432,885 | 159 | 23 | Apache-2.0 | 2023-07-27T14:30:49 | 2018-05-22T15:05:48 | C++ | UTF-8 | C++ | false | false | 1,862 | hpp | // -*- C++ -*-
//
// Copyright 2022 Dmitry Igrishin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef DMITIGR_PGFE_COMPOSITIONAL_HPP
#define DMITIGR_PGFE_COMPOSITIONAL_HPP
#include "types_fwd.hpp"
#include <cstdint>
#include <string>
namespace dmitigr::pgfe {
/**
* @ingroup main
*
* @brief A compositional type.
*/
class Compositional {
public:
/// The destructor.
virtual ~Compositional() = default;
/// @returns The number of fields.
virtual std::size_t field_count() const noexcept = 0;
/// @returns `field_count() > 0`.
virtual bool is_empty() const noexcept = 0;
/**
* @returns The name of the field.
*
* @par Requires
* `index < field_count()`.
*/
virtual std::string_view field_name(std::size_t index) const = 0;
/**
* @returns The field index if presents, or `field_count()` otherwise.
*
* @param name The name of the field.
* @param offset For cases when several fields are named equally.
*/
virtual std::size_t field_index(std::string_view name,
std::size_t offset = 0) const noexcept = 0;
private:
friend Composite;
friend Row_info;
Compositional() = default;
virtual bool is_invariant_ok() const noexcept;
};
} // namespace dmitigr::pgfe
#ifndef DMITIGR_PGFE_NOT_HEADER_ONLY
#include "compositional.cpp"
#endif
#endif // DMITIGR_PGFE_COMPOSITIONAL_HPP
| [
"dmitigr@gmail.com"
] | dmitigr@gmail.com |
195406c5bc4aacec562d67ab6d496445e9ce6fe4 | e2e16c1e173ea7a8cc6bfe3635bf5c5bfe6a969c | /TextureProcessSystem/TextureProcessSystem/LocalParameterization.cpp | 1ac12b610096537a9ce21ab1fa720100bb7fefa6 | [] | no_license | loy945/TP201602 | 3d6734b0d8707434b6bcbf17480c8a97ef180347 | 4f299e6e55b6336ada8bc202703c35aa4bedef51 | refs/heads/master | 2021-01-10T08:17:04.168391 | 2016-02-15T07:36:59 | 2016-02-15T07:36:59 | 51,738,396 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 5,256 | cpp | #pragma once
#include "StdAfx.h"
#include "LocalParameterization.h"
#include "stdafx.h"
#include"Point2d.h"
#include"IDList.h"
#include"PointTool.h"
#include"PolarList.h"
#include"IDSet.h"
#include"PCBCGSolver.h"
#include"Polyhedron.h"
#include"Parameterization.h"
#include "TriangleCoorTrans.h"
#include"Triangle.h"
#include <fstream>
using namespace std;
LocalParameterization::LocalParameterization()
{
}
LocalParameterization::~LocalParameterization()
{
}
double LocalParameterization::localPara(Model_PLY * ply, vector<int> faceIndexs, int indexCenter, Point3D * offset, float scale)
{
//初始化参数
mymesh = new Polyhedron();
m_indexCenter = indexCenter;
m_2DOffset = offset;//2d坐标
m_faceNums = 10;//初始值
m_scale = scale;
m_ply = ply;
//建立映射关系,并读取数据
this->init(ply, faceIndexs);
//参数化
this->face_Parameterization(ply, faceIndexs);
return mymesh->getCurrentE();
}
void LocalParameterization::init(Model_PLY * ply, vector<int> faceIndexs)
{
//建立映射关系
vvp = new vector<VertexPair *>;
vfp = new vector<VertexPair *>;
int index = 0;
for (int i = 0; i < faceIndexs.size(); i++)
{
VertexPair * fp = new VertexPair();
fp->index1 = faceIndexs[i];
fp->index2 = i;
vfp->push_back(fp);
}
for (int i = 0; i < ply->pointArry.size(); i++)
{
bool findFace = false;
if (!findFace)
{
for (int j = 0; j < ply->pointArry[i].beLongToFaceIndex.size(); j++)
{
if (!findFace)
{
for (int k = 0; k < faceIndexs.size(); k++)
{
if (ply->pointArry[i].beLongToFaceIndex[j] == faceIndexs[k])
{
VertexPair * vp = new VertexPair();
vp->index1 = ply->pointArry[i].pointNum;
vp->index2 = index;
index++;
vvp->push_back(vp);
findFace = true;
break;
}
}
}
}
}
}
// face_Parameterization(ply, faceIndexs);
//读取数据
int dV = 0;
int dF = 0;
int i, j;
int di = 0;
int dj = 0;
int dk = 0;
double dx = 0.0;
double dy = 0.0;
double dz = 0.0;
int ptNum = 0;
index = 0;
int ptnum1 = 0;
int ptnum2 = 0;
int ptnum3 = 0;
dV = vvp->size();
dF = faceIndexs.size();
mymesh->memoryallocate(dV, dF);
for (i = 0; i<mymesh->numberV; i++){
ptNum = find1by2(i,vvp);
dx = ply->pointArry[ptNum].x;
dy = ply->pointArry[ptNum].y;
dz = ply->pointArry[ptNum].z;
mymesh->setPoint(i, dx, dy, dz);
}
int val = 3;
for (i = 0; i<mymesh->numberF; i++){
index = faceIndexs[i];
ptnum1 = ply->faceArry[index].ptnum[0];
ptnum2 = ply->faceArry[index].ptnum[1];
ptnum3 = ply->faceArry[index].ptnum[2];
di = find2by1(ptnum1, vvp);
dj = find2by1(ptnum2, vvp);
dk = find2by1(ptnum3, vvp);
mymesh->setFace(i, di, dj, dk);
mymesh->IDtool->AppendVFSort(i, mymesh->FHead[mymesh->Face[i][0]], mymesh->FTail[mymesh->Face[i][0]]);
mymesh->IDtool->AppendVFSort(i, mymesh->FHead[mymesh->Face[i][1]], mymesh->FTail[mymesh->Face[i][1]]);
mymesh->IDtool->AppendVFSort(i, mymesh->FHead[mymesh->Face[i][2]], mymesh->FTail[mymesh->Face[i][2]]);
}
FILE *out = fopen("pro-convert.ply2", "w");
fprintf(out, "%d\n", mymesh->numberV);
fprintf(out, "%d\n", mymesh->numberF);
for (i = 0; i<mymesh->numberV; i++){
fprintf(out, "%lf %lf %lf\n", mymesh->point[i]->x, mymesh->point[i]->y, mymesh->point[i]->z);
}
for (i = 0; i<mymesh->numberF; i++)
fprintf(out, "3 %d %d %d\n", mymesh->Face[i][0], mymesh->Face[i][1], mymesh->Face[i][2]);
fclose(out);
/* feature analysis */
mymesh->SetBoundaryLines();
mymesh->setAreaMap3D();
Triangle t;
for (int i = 0; i < 3; i++)
{
t.pt[i].x = ply->pointArry[ply->faceArry[faceIndexs[0]].ptnum[i]].x;
t.pt[i].y = ply->pointArry[ply->faceArry[faceIndexs[0]].ptnum[i]].y;
t.pt[i].z = ply->pointArry[ply->faceArry[faceIndexs[0]].ptnum[i]].z;
}
mymesh->centerFaceArea=t.getArea();
return;
}
void LocalParameterization::face_Parameterization(Model_PLY * ply, vector<int> faceIndexs)
{
//处理数据
int i=0;
mymesh->param(this->find2by1(m_indexCenter, vfp), m_scale, m_2DOffset);
mymesh->writemesh("after-convert.ply2");
}
int LocalParameterization::find1by2(int index2,vector<VertexPair*> *v)
{
for (int i = 0; i < v->size(); i++)
{
if (v->at(i)->index2 == index2)
return v->at(i)->index1;
}
}
int LocalParameterization::find2by1(int index1, vector<VertexPair*> *v)
{
for (int i = 0; i < v->size(); i++)
{
if (v->at(i)->index1 == index1)
return v->at(i)->index2;
}
}
void LocalParameterization::updateTextureCoord(int textureIndex)
{
int i = 0;
int j = 0;
ofstream file;
file.open("faceEffect.log",ios::out);
for (i = 0; i < mymesh->numberF; i++)
{
file << find1by2(i, vfp) << " " << mymesh->faceEffect[i] << endl;
if (mymesh->faceEffect[i])
{
for (j = 0; j < 3; j++)
{
m_ply->faceArry[find1by2(i, vfp)].texCoord.textureIndex = textureIndex;
m_ply->pointArry[m_ply->faceArry[find1by2(i, vfp)].ptnum[j]].u = (mymesh->pU[mymesh->Face[i][j]] - (mymesh->m_centerPos->x)) / m_scale + (mymesh->m_centerPos->x);
m_ply->pointArry[m_ply->faceArry[find1by2(i, vfp)].ptnum[j]].v = (mymesh->pV[mymesh->Face[i][j]] - (mymesh->m_centerPos->y)) / m_scale + (mymesh->m_centerPos->y);
}
}
bool res = mymesh->faceEffect[i];
effectFaceVector.push_back(res);
}
file.close();
} | [
"loy945@gmail.com"
] | loy945@gmail.com |
f3a34bad56950f92f5e0ebf3a4098af3bae169a4 | 59daee962170b43cb88a84babb83acc6fb382a8f | /FMEGraphics/inc/LightComponent.h | 8dc16587ead15563a6e378138f30950e5808340e | [
"MIT"
] | permissive | mohit3112/FullMetalEngine | da36ba209b62a93a9ee7fc69b086e68304ffc89b | 26fbdd14332f9ab158180efea176e7aaa47f570c | refs/heads/master | 2021-09-22T09:35:47.884072 | 2018-09-07T11:18:27 | 2018-09-07T11:18:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 521 | h | #ifndef LIGHTCOMPONENT_H_
#define LIGHTCOMPONENT_H_
#include "IComponent.h"
#include "LightObject.h"
#include <GL/glew.h>
namespace FME
{
namespace Graphics
{
class LightComponent : public IComponent
{
public:
LightComponent(const std::vector<std::shared_ptr<LightObject>>& lights);
void SetShader(const std::string& shaderName);
void Draw();
virtual ~LightComponent() {};
private:
std::string m_shaderName;
std::vector<std::shared_ptr<LightObject>> m_lights;
};
}
}
#endif | [
"nickyfullmetal@gmail.com"
] | nickyfullmetal@gmail.com |
64920925263631336c9edce8ba87de5ebe9172f5 | 30a3e10673b3244206abe0611ced13e714e1bff5 | /DesignMode/FlyweightMode/WeiqiFactory.cpp | 907f9057ffcc186b785ed6f3d6ebc2859346ae63 | [] | no_license | fhLiu/MyProject | c68f31923ee41fd797041c6e346691361c16af01 | 620730ddb9f0caf630d7a20cf6a6f6c84f96baf2 | refs/heads/master | 2021-12-23T06:57:18.769690 | 2021-12-13T11:50:55 | 2021-12-13T11:50:55 | 158,992,520 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 579 | cpp | #include "WeiqiFactory.h"
#include "WhitePieces.h"
#include "BlackPieces.h"
WeiqiFactory::WeiqiFactory()
{
std::shared_ptr<ChessPieces> sp(new WhitePieces());
vcp.push_back(sp);
sp.reset(new BlackPieces());
vcp.push_back(sp);
}
ChessPieces* WeiqiFactory::GetChessPieces(std::string type)
{
if(vcp.size() != 2)
{
std::cout<<"vector not more elements..."<<std::endl;
return nullptr;
}
if (type == "w")
{
return vcp[0].get();
}
else if(type == "b")
{
return vcp[1].get();
}
return nullptr;
} | [
"andrew2_liu@askey.com"
] | andrew2_liu@askey.com |
ce490579944ba68fc5003a3993b41cb92ce44ac6 | dca653bb975528bd1b8ab2547f6ef4f48e15b7b7 | /branches/wx-2.9.0.1/src/univ/dialog.cpp | 3faf2f7800844cf081446dcd0c3232b731db867a | [] | no_license | czxxjtu/wxPython-1 | 51ca2f62ff6c01722e50742d1813f4be378c0517 | 6a7473c258ea4105f44e31d140ea5c0ae6bc46d8 | refs/heads/master | 2021-01-15T12:09:59.328778 | 2015-01-05T20:55:10 | 2015-01-05T20:55:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,869 | cpp | /////////////////////////////////////////////////////////////////////////////
// Name: src/univ/dialog.cpp
// Author: Robert Roebling, Vaclav Slavik
// Id: $Id$
// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/dialog.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/app.h"
#endif
#include "wx/evtloop.h"
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxDialog,wxDialogBase)
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow)
void wxDialog::Init()
{
m_returnCode = 0;
m_windowDisabler = NULL;
m_eventLoop = NULL;
m_isShowingModal = false;
}
wxDialog::~wxDialog()
{
// if the dialog is modal, this will end its event loop
Show(false);
delete m_eventLoop;
}
bool wxDialog::Create(wxWindow *parent,
wxWindowID id, const wxString &title,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name)
{
SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
// all dialogs should have tab traversal enabled
style |= wxTAB_TRAVERSAL;
return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
}
void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event))
{
if ( Validate() )
TransferDataFromWindow();
}
void wxDialog::OnCancel(wxCommandEvent &WXUNUSED(event))
{
if ( IsModal() )
{
EndModal(wxID_CANCEL);
}
else
{
SetReturnCode(wxID_CANCEL);
Show(false);
}
}
void wxDialog::OnOK(wxCommandEvent &WXUNUSED(event))
{
if ( Validate() && TransferDataFromWindow() )
{
if ( IsModal() )
{
EndModal(wxID_OK);
}
else
{
SetReturnCode(wxID_OK);
Show(false);
}
}
}
void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
// We'll send a Cancel message by default,
// which may close the dialog.
// Check for looping if the Cancel event handler calls Close().
// Note that if a cancel button and handler aren't present in the dialog,
// nothing will happen when you close the dialog via the window manager, or
// via Close().
// We wouldn't want to destroy the dialog by default, since the dialog may have been
// created on the stack.
// However, this does mean that calling dialog->Close() won't delete the dialog
// unless the handler for wxID_CANCEL does so. So use Destroy() if you want to be
// sure to destroy the dialog.
// The default OnCancel (above) simply ends a modal dialog, and hides a modeless dialog.
static wxList s_closing;
if (s_closing.Member(this))
return; // no loops
s_closing.Append(this);
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
cancelEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(cancelEvent);
s_closing.DeleteObject(this);
}
bool wxDialog::Show(bool show)
{
if ( !show )
{
// if we had disabled other app windows, reenable them back now because
// if they stay disabled Windows will activate another window (one
// which is enabled, anyhow) and we will lose activation
if ( m_windowDisabler )
{
delete m_windowDisabler;
m_windowDisabler = NULL;
}
if ( IsModal() )
EndModal(wxID_CANCEL);
}
if (show && CanDoLayoutAdaptation())
DoLayoutAdaptation();
bool ret = wxDialogBase::Show(show);
if ( show )
InitDialog();
return ret;
}
bool wxDialog::IsModal() const
{
return m_isShowingModal;
}
int wxDialog::ShowModal()
{
if ( IsModal() )
{
wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
// use the apps top level window as parent if none given unless explicitly
// forbidden
if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
{
wxWindow * const parent = GetParentForModalDialog();
if ( parent && parent != this )
{
m_parent = parent;
}
}
Show(true);
m_isShowingModal = true;
wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") );
#if defined(__WXGTK__) || defined(__WXMGL__)
wxBusyCursorSuspender suspender;
// FIXME (FIXME_MGL) - make sure busy cursor disappears under MSW too
#endif
m_windowDisabler = new wxWindowDisabler(this);
if ( !m_eventLoop )
m_eventLoop = new wxEventLoop;
m_eventLoop->Run();
return GetReturnCode();
}
void wxDialog::EndModal(int retCode)
{
wxASSERT_MSG( m_eventLoop, _T("wxDialog is not modal") );
SetReturnCode(retCode);
if ( !IsModal() )
{
wxFAIL_MSG( wxT("wxDialog:EndModal called twice") );
return;
}
m_isShowingModal = false;
m_eventLoop->Exit();
Show(false);
}
| [
"RD@c3d73ce0-8a6f-49c7-b76d-6d57e0e08775"
] | RD@c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 |
fc246f85d707931b9893b5ccf08b4a2da713afcf | b159f9d03e166bc4e5b119808f0fe9bcab84d79d | /Assignment_4/core.cpp | 7f9ed359b140c98a9a20be0e134339bdc90b4f25 | [] | no_license | ThanhHieuDang0706/Programming-Fundamentals-Lab | fc899102dfb49358f08a31a9d6442f8d94975e31 | 4f0b87a4ea6e7538c615dbf7a8b52d04a334b640 | refs/heads/master | 2023-01-11T02:40:40.904979 | 2019-06-30T08:11:38 | 2019-06-30T08:11:38 | 179,829,499 | 1 | 1 | null | 2023-01-04T05:43:13 | 2019-04-06T12:17:06 | C++ | UTF-8 | C++ | false | false | 2,991 | cpp | //
// Created by Nguyen Duc Dung on 2019-04-20.
//
#include "core.h"
using namespace std;
struct recManager
void PrintOutput(const char* pRequest, void* pData, void* &pOutput, int N) {
cout << pRequest << ":";
int* pInt = (int*)pOutput;
for (int i = 0; i < N; ++i) {
cout << ' ' << *pInt++;
}
cout << '\n';
}
void Initialization() {
// TODO: Please implement the initialization step if it is required
// for your program. You can ignore this one if you don't have
// anything to initialize.
char pFName[] = "diabetes.csv";
ifstream csv(pFName);
string tmp;
while (getline(csv, tmp)) ++numLines;
csv.close();
}
void Finalization() {
// TODO: Please implement this finalization step if you have to clean up
// the application before exiting. Please ignore if you don't have
// anything to do before exiting.
// NOTE: Any data that you allocated MUST BE CLEAN UP
}
void LoadData(const char* pFName, void* &pData) {
// TODO: Load the records from the given file. The name of data file
// is given in pFName. The data that you load into is pointed to
// by the pointer pData. You should make decision on what data
// type will be used to store records.
ifstream csv(pFName);
pData = (Record*) pData;
Record* data = new Record[numLines];
pData = data;
for (int i = 0; i < numLines; ++i) {
csv >> (data[i]).pregnancies;
csv.get();
csv >> (data[i]).glucose;
csv.get();
csv >> (data[i]).bloodPressure;
csv.get();
csv >> (data[i]).skinThickness;
csv.get();
csv >> (data[i]).insulin;
csv.get();
csv >> (data[i]).BMI;
csv.get();
csv >> (data[i]).DPF;
csv.get();
csv >> (data[i]).age;
csv.get();
csv >> (data[i]).outcome;
csv.get();
}
csv.close();
}
void ReleaseData(void* &pData) {
// TODO: Release any data that you loaded. Please remember that there
// MUST BE NO MEMORY LEAK in this program.
}
void ProcessRequest(const char* pRequest, void* pData, void* &pOutput, int& N) {
// TODO: Please implement this function to process requests from client.
// The reuqest is given in form of a string pointed by pRequest.
// The data that you stored if pointed by pData.
// The output MUST BE STORED in the memory pointed by pOutput.
// N is the number of integers in the output.
if (strcmp("CR", pRequest) == 0) {
N = 1;
int *output = new int;
pOutput = output;
*output = numLines;
} else if (strcmp("FR", pRequest)) {
}
}
int main () {
Initialization();
void* pData;
LoadData("diabetes.csv", pData);
printf("Done");
struct Record * tmp = (Record*)pData;
cout << tmp[0].pregnancies << endl;
cout << tmp[2].pregnancies << endl;
return 0;
}
| [
"hieu@thanhhieu"
] | hieu@thanhhieu |
f195247fa8ead5c1cf7a55f9374c3877301a7a91 | d297d9467306fd4e0f9df006ecc748a5b7330123 | /SteeringTest/WinMain.cpp | 616082ded011d5a57fc15a13c743a405f424afe7 | [] | no_license | bretthuff22/AI | 46d936ba98878e5fabc5c30b45e1065599a1d4ec | 1c4219fe93320d01eff9ee310e9050c3cb8ad0ad | refs/heads/master | 2021-01-01T05:51:06.433950 | 2015-08-02T03:18:26 | 2015-08-02T03:18:26 | 40,067,573 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 13,561 | cpp | #include <HAIL.h>
#include <SGE.h>
#include "Pikachu.h"
#include "PokemonFactory.h"
using namespace SGE;
const int kNumObstacles = 3;
const int kNumWalls = 3;
unsigned int kNumPikachus = 25;
PokemonFactory factory;
float pikachuSize = 128.0f;
AIWorld aiWorld(factory, Agent::AgentType::kPIKACHU, kNumPikachus, 768.0f, 768.0f, (int)pikachuSize);
SGE_Cursor cursor;
Pikachu pikachu(aiWorld);
std::vector<Pikachu*> pikachus;
SGE_Sprite destination;
SGE_Sprite destinations[10];
unsigned int destCounter = 0;
unsigned int kNumFonts = 15;
SGE_Font behaviorFonts[15];
SVector2 Wrap(SVector2 vector);
void GenerateAIWorld()
{
int screenWidth = IniFile_GetInt("WinWidth", 768.0f);
int screenHeight = IniFile_GetInt("WinHeight", 768.0f);
aiWorld.Clear();
aiWorld.SetScreenSize(screenWidth, screenHeight);
for (int i = 0; i < kNumObstacles; ++i)
{
const float x = RandomFloat(100.0f, screenWidth - 100.f);
const float y = RandomFloat(100.0f, screenHeight - 100.0f);
const float r = RandomFloat(20.0f, 100.0f);
aiWorld.AddObstacle(SVector2(x, y), r);
}
for (int i = 0; i < kNumWalls; ++i)
{
const float x = RandomFloat(100.0f, screenWidth - 100.f);
const float y = RandomFloat(100.0f, screenHeight - 100.0f);
const float x2 = RandomFloat(100.0f, screenWidth - 100.f);
const float y2 = RandomFloat(100.0f, screenHeight - 100.0f);
aiWorld.AddWall(SVector2(x, y), SVector2(x2, y2));
}
for (int i = 0; i < kNumPikachus; ++i)
{
Agent* newAgent = aiWorld.CreateAgent(Agent::AgentType::kPIKACHU);
}
}
void SGE_Initialize()
{
cursor.Load("cursor.png");
destination.Load("carrot.png");
pikachu.Load();
for (unsigned int i = 0; i < 10; ++i)
{
destinations[i].Load("bullet2.png");
destinations[i].SetPosition(-1.0f, -1.0f);
}
GenerateAIWorld();
for (unsigned int i = 0; i < 15; ++i)
{
behaviorFonts[i].Load(12, false, false);
behaviorFonts[i].SetColor(0,0,255);
}
behaviorFonts[0].SetColor(255,0,0);
}
void SGE_Terminate()
{
cursor.Unload();
destination.Unload();
pikachu.Unload();
aiWorld.Clear();
for (unsigned int i = 0; i < 10; ++i)
{
behaviorFonts[i].Unload();
}
}
bool SGE_Update(float deltaTime)
{
cursor.Update(deltaTime);
Agent::SteerMode steerMode = pikachu.GetSteerMode();
if (steerMode != Agent::SteerMode::kWANDER && steerMode != Agent::SteerMode::kINTERPOSE && steerMode != Agent::SteerMode::kPATHFOLLOWING)
{
pikachu.SetDestination(SVector2((int)Input_GetMouseScreenX(), (int)Input_GetMouseScreenY()));
aiWorld.SetDestination(SVector2((int)Input_GetMouseScreenX(), (int)Input_GetMouseScreenY()));
}
else if (steerMode == Agent::SteerMode::kWANDER)
{
SVector2 targetDest = pikachu.GetWanderBehavior().GetTargetDestination();
destination.SetPosition(targetDest);
}
else if (steerMode == Agent::SteerMode::kINTERPOSE)
{
AIWorld::Obstacles obstacles = aiWorld.GetObstacles();
aiWorld.SetObstaclePos(0, Wrap(obstacles[0].center + SVector2(0.0f, 0.5f)));
aiWorld.SetObstaclePos(1, Wrap(obstacles[1].center + SVector2(0.5f, 0.0f)));
pikachu.GetInterposeBehavior().SetDestination(obstacles[0].center, obstacles[1].center);
}
if (steerMode == Agent::SteerMode::kPURSUIT)
{
SVector2 targetDest = pikachu.GetPursuitBehavior().GetTargetDestination();
destination.SetPosition(targetDest);
}
if (steerMode == Agent::SteerMode::kPATHFOLLOWING)
{
if ( Input_IsMousePressed(0) && destCounter < 10)
{
SVector2 targetDest = SVector2(SVector2((int)Input_GetMouseScreenX(), (int)Input_GetMouseScreenY()));
pikachu.AddDestinationForPathFollowing(targetDest);
destinations[destCounter].SetPosition(targetDest);
destCounter++;
}
}
else
{
destCounter = 0;
}
if (steerMode == Agent::SteerMode::kSEPARATION || steerMode == Agent::SteerMode::kCOHESION || steerMode == Agent::SteerMode::kALIGNMENT)
{
aiWorld.Update(deltaTime);
}
if (Input_IsKeyPressed(Keys::F1) && !Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kSEEK);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F2) && !Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kFLEE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F3) && !Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kARRIVE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F4) && !Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kPURSUIT);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F5) && !Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kEVADE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F6))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kWANDER);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F7))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kINTERPOSE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F8))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kHIDE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F9))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kPATHFOLLOWING);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
SVector2 targetDest = pikachu.GetDestination();
pikachu.AddDestinationForPathFollowing(targetDest);
destinations[destCounter].SetPosition(targetDest);
destCounter++;
}
else if (Input_IsKeyPressed(Keys::F10))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kOBSTACLEAVOIDANCE);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F1) && Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kSEPARATION);
aiWorld.SetSteerMode(Agent::SteerMode::kSEPARATION);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F2) && Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kCOHESION);
aiWorld.SetSteerMode(Agent::SteerMode::kCOHESION);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F3) && Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kALIGNMENT);
aiWorld.SetSteerMode(Agent::SteerMode::kALIGNMENT);
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F4) && Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.AddSteerMode(Agent::SteerMode::kSEPARATION);
pikachu.AddSteerMode(Agent::SteerMode::kCOHESION);
pikachu.AddSteerMode(Agent::SteerMode::kALIGNMENT);
aiWorld.AddSteerMode(Agent::SteerMode::kSEPARATION);
aiWorld.AddSteerMode(Agent::SteerMode::kCOHESION);
aiWorld.AddSteerMode(Agent::SteerMode::kALIGNMENT);
behaviorFonts[13].SetColor(255,0,0);
behaviorFonts[14].SetColor(255,0,0);
}
else if (Input_IsKeyPressed(Keys::F5) && Input_IsKeyDown(Keys::LSHIFT))
{
behaviorFonts[(pikachu.GetSteerMode() - Agent::SteerMode::kSEEK)%kNumFonts].SetColor(0,0,255);
pikachu.SetSteerMode(Agent::SteerMode::kNONE);
aiWorld.ClearAgents();
behaviorFonts[13].SetColor(0,0,255);
behaviorFonts[14].SetColor(255,0,0);
}
if (Input_IsKeyPressed(Keys::SPACE))
{
GenerateAIWorld();
}
if (Input_IsKeyPressed(Keys::PERIOD))
{
float speed = pikachu.GetMaxSpeed() + 100.0f;
pikachu.SetMaxSpeed(speed);
aiWorld.SetMaxSpeed(speed);
}
if (Input_IsKeyPressed(Keys::COMMA))
{
float speed = Max(pikachu.GetMaxSpeed() - 100.0f, 0.0f);
pikachu.SetMaxSpeed(speed);
aiWorld.SetMaxSpeed(speed);
}
pikachu.Update(deltaTime);
// follow the carrot
return Input_IsKeyPressed(Keys::ESCAPE);
}
void SGE_Render()
{
int screenWidth = IniFile_GetInt("WinWidth", 768.0f);
int screenHeight = IniFile_GetInt("WinHeight", 768.0f);
behaviorFonts[0].Print("F1 - SEEK", screenWidth - 200.0f, 10.0f);
behaviorFonts[1].Print("F2 - FLEE", screenWidth - 200.0f, 30.0f);
behaviorFonts[2].Print("F3 - ARRIVE", screenWidth - 200.0f, 50.0f);
behaviorFonts[3].Print("F4 - PURSUIT", screenWidth - 200.0f, 70.0f);
behaviorFonts[4].Print("F5 - EVADE", screenWidth - 200.0f, 90.0f);
behaviorFonts[5].Print("F6 - WANDER", screenWidth - 200.0f, 110.0f);
behaviorFonts[6].Print("F7 - INTERPOSE", screenWidth - 200.0f, 130.0f);
behaviorFonts[7].Print("F8 - HIDE", screenWidth - 200.0f, 150.0f);
behaviorFonts[8].Print("F9 - PATH FOLLOWING", screenWidth - 200.0f, 170.0f);
behaviorFonts[9].Print("F10 - OBSTACLE AVOIDANCE", screenWidth - 200.0f, 190.0f);
behaviorFonts[10].Print("SHIFT + F1 - SEPARATION", screenWidth - 200.0f, 250.0f);
behaviorFonts[11].Print("SHIFT + F2 - COHESION", screenWidth - 200.0f, 270.0f);
behaviorFonts[12].Print("SHIFT + F3 - ALIGN", screenWidth - 200.0f, 290.0f);
behaviorFonts[13].Print("SHIFT + F4 - FLOCK", screenWidth - 200.0f, 310.0f);
behaviorFonts[14].Print("SHIFT + F5 - CLEAR PREVIOUS", screenWidth - 200.0f, 370.0f);
Agent::SteerMode steerMode = pikachu.GetSteerMode();
cursor.Render();
for (unsigned int i = 0; i < destCounter; ++i)
{
destinations[i].Render();
}
if (steerMode != Agent::SteerMode::kSEPARATION && steerMode != Agent::SteerMode::kCOHESION && steerMode != Agent::SteerMode::kALIGNMENT)
{
pikachu.Render();
}
else
{
aiWorld.RenderAgents();
}
if (steerMode == Agent::SteerMode::kPURSUIT || steerMode == Agent::SteerMode::kWANDER)
{
destination.Render();
}
if (steerMode == Agent::SteerMode::kWANDER)
{
SCircle circle = pikachu.GetWanderBehavior().GetCircle();
Graphics_DebugCircle(circle.center, circle.radius, 0xFF0000);
}
if (steerMode == Agent::SteerMode::kHIDE)
{
aiWorld.Render();
}
if (steerMode == Agent::SteerMode::kOBSTACLEAVOIDANCE)
{
Graphics_DebugLine(pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineLeft(), 0x00ff00);
Graphics_DebugLine(pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineRight(), 0x00ff00);
Graphics_DebugLine(pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineLeft().from, pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineRight().from, 0x00ff00);
Graphics_DebugLine(pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineLeft().to, pikachu.GetObstacleAvoidanceBehavior().GetBoundingLineRight().to, 0x00ff00);
aiWorld.Render();
}
}
SVector2 Wrap(SVector2 vector)
{
int screenWidth = IniFile_GetInt("WinWidth", 768.0f);
int screenHeight = IniFile_GetInt("WinHeight", 768.0f);
while (vector.x > screenWidth)
{
vector.x -= screenWidth;
}
while (vector.x < 0.0f)
{
vector.x += screenWidth;
}
while (vector.y > screenHeight)
{
vector.y -= screenHeight;
}
while (vector.y < 0.0f)
{
vector.y += screenHeight;
}
return vector;
} | [
"bretthuff22@5affeff0-1185-4ade-bd94-49af79791a39"
] | bretthuff22@5affeff0-1185-4ade-bd94-49af79791a39 |
cf99663e8f58cb1f2af60025eea037d6af51c9c1 | 9dc0e27554c5139534087ec2064d2a07ec3b943f | /semestr_2/testowanie_oprogramowania_-_testy_jednostkowe_i_funkcjonalne/lab2/lab2.cpp | bbdc00d9cd6940016d850fa56ab6bca194740e76 | [] | no_license | rikonek/zut | 82d2bc4084d0d17ab8385181386f391446ec35ac | d236b275ffc19524c64369dd21fa711f735605c7 | refs/heads/master | 2020-12-24T20:00:13.639419 | 2018-01-25T09:53:29 | 2018-01-25T09:53:29 | 86,224,826 | 1 | 3 | null | 2018-01-09T11:40:52 | 2017-03-26T10:36:59 | HTML | UTF-8 | C++ | false | false | 547 | cpp | #include <gmock/gmock.h>
#include "src/Picture.hpp"
#include "src/Rectangle.hpp"
using namespace testing;
TEST(LabTest, TestOK)
{
Picture myPicture;
Rectangle rec1(2,4);
myPicture.addShape(&rec1);
ASSERT_THAT(myPicture.getTotalArea(), 8);
}
TEST(LabTest, TestNOK)
{
Picture myPicture;
Rectangle rec1(2,4);
myPicture.addShape(&rec1);
ASSERT_THAT(myPicture.getTotalArea(), 9);
}
int main(int argc, char *argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| [
"radek@madenet.pl"
] | radek@madenet.pl |
af48acb759860a16f0c6ddeea9ca0d55d4116ea9 | ce99fd71ee599633c60a540d9d866a5fffe97978 | /吉田学園情報ビジネス専門学校@小林将兵/ハッカソン/2018年度 秋ハッカソン/ソースコード/frontbg.cpp | e2f72589d3942728478a5bba575fb63de53f9775 | [] | no_license | SyouheiKobayashi/Kobayashi_Shouhei_GAMEs | 4e6647e6d862dfaea57aa69b9532b53bc369ab36 | caa4a1e085a960e6ae5bfd99abd3aa79731d25e4 | refs/heads/master | 2022-01-06T12:36:14.727298 | 2019-07-10T00:51:23 | 2019-07-10T00:51:23 | 190,696,862 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 4,452 | cpp | //=============================================================================
//
// 背景(バックグラウンド)処理 [FRONTBG.h]
// Author : ABE YUUTAROU
//
//=============================================================================
#include "main.h"
//*****************************************************************************
//マクロ定義
//*****************************************************************************
#define FRONTBG_TEXTURENAMRE "data/TEXTURE/bg002.png" //読み込むテクスチャ
#define FRONTBG_POS_X (0) //背景の左上X座標
#define FRONTBG_POS_Y (0) //背景の左上Y座標
#define FRONTBG_WIDTH (SCREEN_WIDTH)//背景の幅
#define FRONTBG_HEIGHT (SCREEN_HEIGHT)//背景の高さ
#define MAX_TEX (1)
//*****************************************************************************
// グローバル変数
//*****************************************************************************
LPDIRECT3DTEXTURE9 g_pTextureFRONTBG = NULL; //テクスチャポイント
LPDIRECT3DVERTEXBUFFER9 g_pVtxBuffFRONTBG = NULL; //頂点バッファのポイント
//=============================================================================
//初期化処理背景
//=============================================================================
void InitFRONTBG(void)
{
LPDIRECT3DDEVICE9 pDevice; //デバイスへのポインタ
//デバイス取得
pDevice = GetDevice();
//テクスチャ読み込み
D3DXCreateTextureFromFile(pDevice, FRONTBG_TEXTURENAMRE, &g_pTextureFRONTBG);
//頂点バッファの生成
pDevice->CreateVertexBuffer(sizeof(VERTEX_2D) * 4 * 3,
D3DUSAGE_WRITEONLY,
FVF_VERTEX_2D,
D3DPOOL_MANAGED,
&g_pVtxBuffFRONTBG,
NULL);
VERTEX_2D*pVtx; //頂点情報のポインタ
//頂点バッファをロックし、頂点データへのポインタ
g_pVtxBuffFRONTBG->Lock(0, 0, (void**)&pVtx, 0);
for (int nCount = 0; nCount < MAX_TEX; nCount++)
{
//頂点座標設定
//ポジション
pVtx[0].pos = D3DXVECTOR3(0, 0, 0.0f); //右上
pVtx[1].pos = D3DXVECTOR3(FRONTBG_WIDTH, 0, 0.0f);//右下
pVtx[2].pos = D3DXVECTOR3(0, FRONTBG_HEIGHT, 0.0f); //左上
pVtx[3].pos = D3DXVECTOR3(FRONTBG_WIDTH, FRONTBG_HEIGHT, 0.0f); //左下
//RHW
pVtx[0].rhw = 1.0f;
pVtx[1].rhw = 1.0f;
pVtx[2].rhw = 1.0f;
pVtx[3].rhw = 1.0f;
//カラー
pVtx[0].col = D3DCOLOR_RGBA(255, 255, 255, 255);
pVtx[1].col = D3DCOLOR_RGBA(255, 255, 255, 255);
pVtx[2].col = D3DCOLOR_RGBA(255, 255, 255, 255);
pVtx[3].col = D3DCOLOR_RGBA(255, 255, 255, 255);
//テクスチャ座標
pVtx[0].tex = D3DXVECTOR2(0.0f, 0.0f); //右上
pVtx[1].tex = D3DXVECTOR2(1.0f, 0.0f); //右下
pVtx[2].tex = D3DXVECTOR2(0.0f, 1.0f); //左上
pVtx[3].tex = D3DXVECTOR2(1.0f, 1.0f); //左下
pVtx += 4; //頂点ポインタを4つ進める
}
//頂点バッファアンロックする
g_pVtxBuffFRONTBG->Unlock();
}
//=============================================================================
//終了処理更新処理ポリゴン
//=============================================================================
void UninitFRONTBG(void)
{
//テクスチャの破棄
if (g_pTextureFRONTBG != NULL)
{
g_pTextureFRONTBG->Release();
g_pTextureFRONTBG = NULL;
}
//頂点バッファの破棄
if (g_pVtxBuffFRONTBG != NULL)
{
g_pVtxBuffFRONTBG->Release();
g_pVtxBuffFRONTBG = NULL;
}
}
//=============================================================================
//更新処理背景
//=============================================================================
void UpdateFRONTBG(void)
{
}
//=============================================================================
//描画処理背景
//=============================================================================
void DrawFRONTBG(void)
{
LPDIRECT3DDEVICE9 pDevice; //デバイスへのポインタ
//デバイス取得
pDevice = GetDevice();
//頂点バッファをデバイスのデータストリームに設定
pDevice->SetStreamSource(0, g_pVtxBuffFRONTBG, 0, sizeof(VERTEX_2D));
//頂点フォーマット設定
pDevice->SetFVF(FVF_VERTEX_2D);
for (int nCount = 0; nCount < MAX_TEX; nCount++)
{
//テェクスチャの設定
pDevice->SetTexture(0, g_pTextureFRONTBG);
//ポリゴン描画
pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, nCount * 4, 3);
}
}
| [
"k.shouhei222.yoshida.jobi@gmail.com"
] | k.shouhei222.yoshida.jobi@gmail.com |
9a9af441c175e8523786716953ef2dbdd2ad65df | 13fcb4e9aff489d1d00a8165d6dae9cd40e4bf21 | /test/test_graph/test_dfs_paths.cpp | a436c205ccadbddcd89d377d8243466473267c32 | [] | no_license | wfxr/graph | cc50ab3f1c8d4bc1189ae8ec458bd59b62c9eb09 | a79e76eae0d06a7c9665ca13cab32339f937cb58 | refs/heads/master | 2021-01-18T01:54:34.924534 | 2016-09-20T14:42:09 | 2016-09-20T14:42:09 | 68,456,959 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 628 | cpp | //
// Created by Wenxuan on 9/17/2016.
//
#include "graph/dfs_paths.h"
#include <iostream>
using namespace std;
int main() {
const auto graph = create_graph("tiny_graph.txt");
size_t src;
while (cin >> src) {
DFSPaths paths(graph, src);
for (size_t dest = 0; dest < graph.vertex_count(); ++dest) {
cout << src << " to " << dest << ": ";
if (!paths.connected(dest))
cout << "not connect";
else
for (auto v : paths.path_to(dest))
cout << v << (v == dest ? "" : "-");
cout << endl;
}
}
}
| [
"wfxrgm@gmail.com"
] | wfxrgm@gmail.com |
0947fee177acd2f84384f99860574290f6c38f52 | f45c7e146042cd1dc9314e47b162ab92a998cc1c | /src/engine/render/Color.cpp | 264c3963b358c10e4e78b450966e39a1b0345314 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Henauxg/ExperimEngine | 5c3d1af7270b26b06fabdb5736813dc2abfb3ea6 | e031700128239b3fe3901cb0704699c06257b8e9 | refs/heads/master | 2021-06-25T20:38:58.026252 | 2021-04-12T17:36:25 | 2021-04-12T17:36:25 | 225,236,597 | 7 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 736 | cpp | #include "Color.hpp"
namespace experim {
const Color Color::Red = Color(255, 0, 0, 255);
const Color Color::Green = Color(0, 255, 0, 255);
const Color Color::Blue = Color(0, 0, 255, 255);
const Color Color::White = Color(255, 255, 255, 255);
const Color Color::Black = Color(0, 0, 0, 255);
const Color Color::Transparent = Color(0, 0, 0, 0);
Color::Color(uint32_t rgba)
{
r_ = (rgba >> 24) & 0xFF;
g_ = (rgba >> 16) & 0xFF;
b_ = (rgba >> 8) & 0xFF;
a_ = rgba & 0xFF;
}
Color::Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
: r_(r)
, g_(g)
, b_(b)
, a_(a)
{
}
uint32_t Color::toRGBA8Uint()
{
uint32_t rgba = (r_ << 24) + (g_ << 16) + (b_ << 8) + a_;
return rgba;
}
} // namespace experim
| [
"19689618+Henauxg@users.noreply.github.com"
] | 19689618+Henauxg@users.noreply.github.com |
b8aa580a7fdced43ca3329c552f6a72b9091ff50 | 22cbd61a14d7f5f9d81ba25ea62cc0c122c5f743 | /main.cpp | 32df496f3f185152aa707b733678416f1276370f | [] | no_license | Araf179/C-KeyLogger | ee4e69f1391a0b95f1483c91c613dcd6e7a47420 | 3631959b965e6fd1cb65c7ee50fb92772d614452 | refs/heads/master | 2021-05-08T13:58:21.862186 | 2018-02-03T01:29:56 | 2018-02-03T01:29:56 | 120,048,874 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 572 | cpp | #include <iostream>
#include <windows.h>
#include "Helper.h"
#include "KeyConstants.h"
#include "Base64.h"
#include "IO.h"
#include "Timer.h"
#include "SendMail.h"
#include "KeybHook.h"
using namespace std;
int main()
{
MSG Msg;
IO::MKDir(IO::GetOurPath(true));
InstallHook();
//Our main thread
while(GetMessage(&Msg, NULL, 0, 0)){
TranslateMessage(&Msg);
DispatchMessage(&Msg);
//We are translating and sending this message which will not happen.
//Will run like a window
}
MailTimer.Stop();
return 0;
}
| [
"shihabaraf@gmail.com"
] | shihabaraf@gmail.com |
d8896dbdd420026bae8ba93baa90d2bad1277ea2 | 8d57524083efc32b537641cadf0ff0ace6226cb1 | /Framework-EGC-master/Source/Laboratoare/Tema2/Tema2.h | 7a4c3c923bc33fb10ff45fd445707a9711742127 | [] | no_license | razvandorobantu98/EGC-Tema2 | 16725f6a972e407a553b0d77be3ebf6b6dd987d9 | f31f2bad77820ad26fe1ff904dcd02c39f65adc4 | refs/heads/master | 2023-03-10T20:24:08.837316 | 2021-02-25T11:34:00 | 2021-02-25T11:34:00 | 342,221,649 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,892 | h | #pragma once
#include <Component/SimpleScene.h>
#include <Component/Transform/Transform.h>
#include <Core/GPU/Mesh.h>
#include "CameraTema2.h"
class Tema2 : public SimpleScene
{
public:
Tema2();
~Tema2();
void Init() override;
Mesh* CreateMesh(const char* name, const std::vector<VertexFormat>& vertices, const std::vector<unsigned short>& indices);
private:
void FrameStart() override;
void Update(float deltaTimeSeconds) override;
void FrameEnd() override;
void RenderSimpleMesh(Mesh *mesh, Shader *shader, const glm::mat4 &modelMatrix, const glm::vec3 &color = glm::vec3(1));
void OnInputUpdate(float deltaTime, int mods) override;
void OnKeyPress(int key, int mods) override;
void OnKeyRelease(int key, int mods) override;
void OnMouseMove(int mouseX, int mouseY, int deltaX, int deltaY) override;
void OnMouseBtnPress(int mouseX, int mouseY, int button, int mods) override;
void OnMouseBtnRelease(int mouseX, int mouseY, int button, int mods) override;
void OnMouseScroll(int mouseX, int mouseY, int offsetX, int offsetY) override;
void OnWindowResize(int width, int height) override;
void DrawPlane(float deltaTimeSeconds);
void ManageObstacles(float deltaTimeSeconds);
void ManageFuels(float deltaTimeSeconds);
void ManageClouds(float deltaTimeSeconds);
void DrawLives();
void DrawFuel();
void DrawCylinder(float deltaTimeSeconds);
void StartGame();
void EndGame();
float angularStepRotor;
float angularStepPlane;
float transY; //retine cu cat se deplaseaza avionul pe OY
float speed; //retine viteza avionului (X > 0 => avionul urca, X < 0 => avionul coboara)
float rotationCylinder;
float rotationObstacle;
//coordonatele initiale ale obstacolelor
float initObstaclesX[4] = { 0, -2, 0, 2 };
float initObstaclesY[4] = { -2.5, 0, 1.5, 0 };
//coordonatele obstacolelor
float obstaclesX[4] = { 0, 0, 0, 0 };
float obstaclesY[4] = { 0, 0, 0, 0 };
//vector care retine daca un obiect e vizibil sau nu
bool showObstacles[4] = { false, false, false, false };
float rotationClouds;
//coordonatele initiale ale norilor
float initCloudsX[4] = { 0, -2, 0, 2 };
float initCloudsY[4] = { -2.5, 0, 1.5, 0 };
//coordonatele norilor
float cloudsX[4] = { 0, 0, 0, 0 };
float cloudsY[4] = { 0, 0, 0, 0 };
float rotationFuel;
//coordonatele initiale ale bucatilor de combustibil
float initFuelX[4] = { 0, 0, 0, 0 };
float initFuelY[4] = { -2.5, -2.5, -2.5, -2.5 };
//coordonatele bucatilor de combustibil
float fuelX[4] = { 0, 0, 0, 0 };
float fuelY[4] = { 0, 0, 0, 0 };
//vector care retine daca o bucata e vizibila sau nu
bool showFuel[4] = { false, false, false, false };
bool isCylinder = false;
int lives;
float planeFuel;
bool gameRunning;
bool firstStart;
protected:
Tema2Camera::Camera* camera;
glm::mat4 projectionMatrix;
bool renderCameraTarget;
};
| [
"68380239+razvandorobantu98@users.noreply.github.com"
] | 68380239+razvandorobantu98@users.noreply.github.com |
0db6a4637fb5640432e9312386a3ddd70349db06 | 172fdc531f4ab2fad00ebdaf3ab36b7b81ed376e | /dueric_summativesdl/PlayerProj.h | 1369d25843f7faf7d1708b898ad873206ee1993e | [] | no_license | eric-zdw/dueric_summative-sdl-git | c0bab498a502c456a029a119fa419ee11b608812 | b78842593e2457f1bc2926d592ee5e37ff025f46 | refs/heads/master | 2020-05-30T23:23:39.764960 | 2019-02-18T00:20:20 | 2019-02-18T00:20:20 | 60,701,411 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 211 | h | #pragma once
#include "Projectile.h"
#include <SDL.h>
#include <SDL_image.h>
class PlayerProj : public Projectile {
public:
PlayerProj(int x1, int y1, int x2, int y2, double speed, SDL_Renderer *renderer);
}; | [
"eric.zdw@gmail.com"
] | eric.zdw@gmail.com |
6f144b73611df89350c893d241d19c8585c41f70 | 95036e503519f476e653b51209669f156ae6a331 | /escapeTheGhosts/escapeTheGhosts.cpp | 02e7d8b0cd58da379da380475ced3691065162e5 | [] | no_license | jingminglake/Leetcode | c414ff3385c1c6e0ccf17fb51d89bca3e0648afe | 0aa509d74e20bc73a015ebfd966fd3b44aac1f66 | refs/heads/master | 2023-02-19T15:42:28.880314 | 2023-02-14T07:47:52 | 2023-02-14T07:47:52 | 83,025,474 | 18 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 609 | cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) {
long dis = abs(target[0]) + abs(target[1]);
for (vector<int>& p : ghosts) {
long dx = abs (target[0] - p[0]);
long dy = abs (target[1] - p[1]);
if (dx + dy <= dis)
return false;
}
return true;
}
};
int main() {
Solution s;
vector<vector<int>> ghosts = {{1, 0}};
vector<int> target = {2, 0};
cout << s.escapeGhosts(ghosts, target) << endl;
return 0;
}
| [
"yaxionh@yaxionhdeMacBook-Air.local"
] | yaxionh@yaxionhdeMacBook-Air.local |
ca444ee4903514f62191a5cae2dc0e5f13488a4b | 21caa22ba4961174798def5ce0c4fdf3e0b74782 | /src_fused/ozz_animation_offline.cc | 550217ff10d34dcdbf6729a64250766406516f38 | [
"MIT"
] | permissive | bobbyzhu/ozz-animation | 3e64f1bfed594bcb5d54129f398ce2871baa8888 | 71f622e1480bf76d3cc0da5fe90900dc247234c3 | refs/heads/master | 2021-08-11T08:42:19.635385 | 2017-05-29T19:55:34 | 2017-05-29T19:55:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 62,661 | cc | // This file is autogenerated. Do not modify it.
// Including raw_animation.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/raw_animation.h"
#include "ozz/animation/runtime/skeleton.h"
namespace ozz {
namespace animation {
namespace offline {
RawAnimation::RawAnimation() : duration(1.f) {}
RawAnimation::~RawAnimation() {}
namespace {
// Implements key frames' time range and ordering checks.
// See AnimationBuilder::Create for more details.
template <typename _Key>
static bool ValidateTrack(const typename ozz::Vector<_Key>::Std& _track,
float _duration) {
float previous_time = -1.f;
for (size_t k = 0; k < _track.size(); ++k) {
const float frame_time = _track[k].time;
// Tests frame's time is in range [0:duration].
if (frame_time < 0.f || frame_time > _duration) {
return false;
}
// Tests that frames are sorted.
if (frame_time <= previous_time) {
return false;
}
previous_time = frame_time;
}
return true; // Validated.
}
} // namespace
bool RawAnimation::Validate() const {
if (duration <= 0.f) { // Tests duration is valid.
return false;
}
if (tracks.size() > Skeleton::kMaxJoints) { // Tests number of tracks.
return false;
}
// Ensures that all key frames' time are valid, ie: in a strict ascending
// order and within range [0:duration].
for (size_t j = 0; j < tracks.size(); ++j) {
const RawAnimation::JointTrack& track = tracks[j];
if (!ValidateTrack<TranslationKey>(track.translations, duration) ||
!ValidateTrack<RotationKey>(track.rotations, duration) ||
!ValidateTrack<ScaleKey>(track.scales, duration)) {
return false;
}
}
return true; // *this is valid.
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including raw_animation_archive.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/raw_animation.h"
#include "ozz/base/io/archive.h"
#include "ozz/base/maths/math_archive.h"
#include "ozz/base/containers/string_archive.h"
#include "ozz/base/containers/vector_archive.h"
namespace ozz {
namespace io {
template <>
void Save(OArchive& _archive,
const animation::offline::RawAnimation* _animations, size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawAnimation& animation = _animations[i];
_archive << animation.duration;
_archive << animation.tracks;
_archive << animation.name;
}
}
template <>
void Load(IArchive& _archive, animation::offline::RawAnimation* _animations,
size_t _count, uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawAnimation& animation = _animations[i];
_archive >> animation.duration;
_archive >> animation.tracks;
if (_version > 1) {
_archive >> animation.name;
}
}
}
// RawAnimation::*Keys' version can be declared locally as it will be saved from
// this cpp file only.
OZZ_IO_TYPE_VERSION(1, animation::offline::RawAnimation::JointTrack)
template <>
void Save(OArchive& _archive,
const animation::offline::RawAnimation::JointTrack* _tracks,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawAnimation::JointTrack& track = _tracks[i];
_archive << track.translations;
_archive << track.rotations;
_archive << track.scales;
}
}
template <>
void Load(IArchive& _archive,
animation::offline::RawAnimation::JointTrack* _tracks, size_t _count,
uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawAnimation::JointTrack& track = _tracks[i];
_archive >> track.translations;
_archive >> track.rotations;
_archive >> track.scales;
}
}
OZZ_IO_TYPE_VERSION(1, animation::offline::RawAnimation::TranslationKey)
template <>
void Save(OArchive& _archive,
const animation::offline::RawAnimation::TranslationKey* _keys,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawAnimation::TranslationKey& key = _keys[i];
_archive << key.time;
_archive << key.value;
}
}
template <>
void Load(IArchive& _archive,
animation::offline::RawAnimation::TranslationKey* _keys,
size_t _count, uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawAnimation::TranslationKey& key = _keys[i];
_archive >> key.time;
_archive >> key.value;
}
}
OZZ_IO_TYPE_VERSION(1, animation::offline::RawAnimation::RotationKey)
template <>
void Save(OArchive& _archive,
const animation::offline::RawAnimation::RotationKey* _keys,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawAnimation::RotationKey& key = _keys[i];
_archive << key.time;
_archive << key.value;
}
}
template <>
void Load(IArchive& _archive,
animation::offline::RawAnimation::RotationKey* _keys, size_t _count,
uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawAnimation::RotationKey& key = _keys[i];
_archive >> key.time;
_archive >> key.value;
}
}
OZZ_IO_TYPE_VERSION(1, animation::offline::RawAnimation::ScaleKey)
template <>
void Save(OArchive& _archive,
const animation::offline::RawAnimation::ScaleKey* _keys,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawAnimation::ScaleKey& key = _keys[i];
_archive << key.time;
_archive << key.value;
}
}
template <>
void Load(IArchive& _archive, animation::offline::RawAnimation::ScaleKey* _keys,
size_t _count, uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawAnimation::ScaleKey& key = _keys[i];
_archive >> key.time;
_archive >> key.value;
}
}
} // namespace io
} // namespace ozz
// Including raw_animation_utils.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/raw_animation_utils.h"
namespace ozz {
namespace animation {
namespace offline {
// Translation interpolation method.
// This must be the same Lerp as the one used by the sampling job.
math::Float3 LerpTranslation(const math::Float3& _a, const math::Float3& _b,
float _alpha) {
return math::Lerp(_a, _b, _alpha);
}
// Rotation interpolation method.
// This must be the same Lerp as the one used by the sampling job.
// The goal is to take the shortest path between _a and _b. This code replicates
// this behavior that is actually not done at runtime, but when building the
// animation.
math::Quaternion LerpRotation(const math::Quaternion& _a,
const math::Quaternion& _b, float _alpha) {
// Finds the shortest path. This is done by the AnimationBuilder for runtime
// animations.
const float dot = _a.x * _b.x + _a.y * _b.y + _a.z * _b.z + _a.w * _b.w;
return math::NLerp(_a, dot < 0.f ? -_b : _b, _alpha); // _b an -_b are the
// same rotation.
}
// Scale interpolation method.
// This must be the same Lerp as the one used by the sampling job.
math::Float3 LerpScale(const math::Float3& _a, const math::Float3& _b,
float _alpha) {
return math::Lerp(_a, _b, _alpha);
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including animation_builder.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/animation_builder.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <limits>
#include "ozz/base/containers/vector.h"
#include "ozz/base/memory/allocator.h"
#include "ozz/base/maths/simd_math.h"
#include "ozz/animation/offline/raw_animation.h"
#include "ozz/animation/runtime/animation.h"
// Internal include file
#define OZZ_INCLUDE_PRIVATE_HEADER // Allows to include private headers.
// Includes internal include file animation/runtime/animation_keyframe.h
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// Permission is hereby granted, free of charge, to any person obtaining a //
// copy of this software and associated documentation files (the "Software"), //
// to deal in the Software without restriction, including without limitation //
// the rights to use, copy, modify, merge, publish, distribute, sublicense, //
// and/or sell copies of the Software, and to permit persons to whom the //
// Software is furnished to do so, subject to the following conditions: //
// //
// The above copyright notice and this permission notice shall be included in //
// all copies or substantial portions of the Software. //
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL //
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING //
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER //
// DEALINGS IN THE SOFTWARE. //
// //
//----------------------------------------------------------------------------//
#ifndef OZZ_ANIMATION_RUNTIME_ANIMATION_KEYFRAME_H_
#define OZZ_ANIMATION_RUNTIME_ANIMATION_KEYFRAME_H_
#ifndef OZZ_INCLUDE_PRIVATE_HEADER
#error "This header is private, it cannot be included from public headers."
#endif // OZZ_INCLUDE_PRIVATE_HEADER
namespace ozz {
namespace animation {
// Define animation key frame types (translation, rotation, scale). Every type
// as the same base made of the key time and it's track. This is required as
// key frames are not sorted per track, but sorted by time to favor cache
// coherency.
// Key frame values are compressed, according on their type. Decompression is
// efficient because it's done on SoA data and cached during sampling.
// Defines the translation key frame type.
// Translation values are stored as half precision floats with 16 bits per
// component.
struct TranslationKey {
float time;
uint16_t track;
uint16_t value[3];
};
// Defines the rotation key frame type.
// Rotation value is a quaternion. Quaternion are normalized, which means each
// component is in range [0:1]. This property allows to quantize the 3
// components to 3 signed integer 16 bits values. The 4th component is restored
// at runtime, using the knowledge that |w| = sqrt(1 - (a^2 + b^2 + c^2)).
// The sign of this 4th component is stored using 1 bit taken from the track
// member.
//
// In more details, compression algorithm stores the 3 smallest components of
// the quaternion and restores the largest. The 3 smallest can be pre-multiplied
// by sqrt(2) to gain some precision indeed.
//
// Quantization could be reduced to 11-11-10 bits as often used for animation
// key frames, but in this case RotationKey structure would induce 16 bits of
// padding.
struct RotationKey {
float time;
uint16_t track : 13; // The track this key frame belongs to.
uint16_t largest : 2; // The largest component of the quaternion.
uint16_t sign : 1; // The sign of the largest component. 1 for negative.
int16_t value[3]; // The quantized value of the 3 smallest components.
};
// Defines the scale key frame type.
// Scale values are stored as half precision floats with 16 bits per
// component.
struct ScaleKey {
float time;
uint16_t track;
uint16_t value[3];
};
} // namespace animation
} // namespace ozz
#endif // OZZ_ANIMATION_RUNTIME_ANIMATION_KEYFRAME_H_
namespace ozz {
namespace animation {
namespace offline {
namespace {
struct SortingTranslationKey {
uint16_t track;
float prev_key_time;
RawAnimation::TranslationKey key;
};
struct SortingRotationKey {
uint16_t track;
float prev_key_time;
RawAnimation::RotationKey key;
};
struct SortingScaleKey {
uint16_t track;
float prev_key_time;
RawAnimation::ScaleKey key;
};
// Keyframe sorting. Stores first by time and then track number.
template <typename _Key>
bool SortingKeyLess(const _Key& _left, const _Key& _right) {
return _left.prev_key_time < _right.prev_key_time ||
(_left.prev_key_time == _right.prev_key_time &&
_left.track < _right.track);
}
template <typename _SrcKey, typename _DestTrack>
void PushBackIdentityKey(uint16_t _track, float _time, _DestTrack* _dest) {
typedef typename _DestTrack::value_type DestKey;
float prev_time = -1.f;
if (!_dest->empty() && _dest->back().track == _track) {
prev_time = _dest->back().key.time;
}
const DestKey key = {_track, prev_time, {_time, _SrcKey::identity()}};
_dest->push_back(key);
}
// Copies a track from a RawAnimation to an Animation.
// Also fixes up the front (t = 0) and back keys (t = duration).
template <typename _SrcTrack, typename _DestTrack>
void CopyRaw(const _SrcTrack& _src, uint16_t _track, float _duration,
_DestTrack* _dest) {
typedef typename _SrcTrack::value_type SrcKey;
typedef typename _DestTrack::value_type DestKey;
if (_src.size() == 0) { // Adds 2 new keys.
PushBackIdentityKey<SrcKey, _DestTrack>(_track, 0.f, _dest);
PushBackIdentityKey<SrcKey, _DestTrack>(_track, _duration, _dest);
} else if (_src.size() == 1) { // Adds 1 new key.
const SrcKey& raw_key = _src.front();
assert(raw_key.time >= 0 && raw_key.time <= _duration);
const DestKey first = {_track, -1.f, {0.f, raw_key.value}};
_dest->push_back(first);
const DestKey last = {_track, 0.f, {_duration, raw_key.value}};
_dest->push_back(last);
} else { // Copies all keys, and fixes up first and last keys.
float prev_time = -1.f;
if (_src.front().time != 0.f) { // Needs a key at t = 0.f.
const DestKey first = {_track, prev_time, {0.f, _src.front().value}};
_dest->push_back(first);
prev_time = 0.f;
}
for (size_t k = 0; k < _src.size(); ++k) { // Copies all keys.
const SrcKey& raw_key = _src[k];
assert(raw_key.time >= 0 && raw_key.time <= _duration);
const DestKey key = {_track, prev_time, {raw_key.time, raw_key.value}};
_dest->push_back(key);
prev_time = raw_key.time;
}
if (_src.back().time != _duration) { // Needs a key at t = _duration.
const DestKey last = {_track, prev_time, {_duration, _src.back().value}};
_dest->push_back(last);
}
}
assert(_dest->front().key.time == 0.f && _dest->back().key.time == _duration);
}
void CopyToAnimation(ozz::Vector<SortingTranslationKey>::Std* _src,
ozz::Range<TranslationKey>* _dest) {
const size_t src_count = _src->size();
if (!src_count) {
return;
}
// Sort animation keys to favor cache coherency.
std::sort(&_src->front(), (&_src->back()) + 1,
&SortingKeyLess<SortingTranslationKey>);
// Fills output.
const SortingTranslationKey* src = &_src->front();
for (size_t i = 0; i < src_count; ++i) {
TranslationKey& key = _dest->begin[i];
key.time = src[i].key.time;
key.track = src[i].track;
key.value[0] = ozz::math::FloatToHalf(src[i].key.value.x);
key.value[1] = ozz::math::FloatToHalf(src[i].key.value.y);
key.value[2] = ozz::math::FloatToHalf(src[i].key.value.z);
}
}
void CopyToAnimation(ozz::Vector<SortingScaleKey>::Std* _src,
ozz::Range<ScaleKey>* _dest) {
const size_t src_count = _src->size();
if (!src_count) {
return;
}
// Sort animation keys to favor cache coherency.
std::sort(&_src->front(), (&_src->back()) + 1,
&SortingKeyLess<SortingScaleKey>);
// Fills output.
const SortingScaleKey* src = &_src->front();
for (size_t i = 0; i < src_count; ++i) {
ScaleKey& key = _dest->begin[i];
key.time = src[i].key.time;
key.track = src[i].track;
key.value[0] = ozz::math::FloatToHalf(src[i].key.value.x);
key.value[1] = ozz::math::FloatToHalf(src[i].key.value.y);
key.value[2] = ozz::math::FloatToHalf(src[i].key.value.z);
}
}
namespace {
// Compares float absolute values.
bool LessAbs(float _left, float _right) {
return std::abs(_left) < std::abs(_right);
}
// Compresses quaternion to ozz::animation::RotationKey format.
// The 3 smallest components of the quaternion are quantized to 16 bits
// integers, while the largest is recomputed thanks to quaternion normalization
// property (x^2+y^2+z^2+w^2 = 1). Because the 3 components are the 3 smallest,
// their value cannot be greater than sqrt(2)/2. Thus quantization quality is
// improved by pre-multiplying each componenent by sqrt(2).
void CompressQuat(const ozz::math::Quaternion& _src,
ozz::animation::RotationKey* _dest) {
// Finds the largest quaternion component.
const float quat[4] = {_src.x, _src.y, _src.z, _src.w};
const size_t largest = std::max_element(quat, quat + 4, LessAbs) - quat;
assert(largest <= 3);
_dest->largest = largest & 0x3;
// Stores the sign of the largest component.
_dest->sign = quat[largest] < 0.f;
// Quantize the 3 smallest components on 16 bits signed integers.
const float kFloat2Int = 32767.f * math::kSqrt2;
const int kMapping[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}};
const int* map = kMapping[largest];
const int a = static_cast<int>(floor(quat[map[0]] * kFloat2Int + .5f));
const int b = static_cast<int>(floor(quat[map[1]] * kFloat2Int + .5f));
const int c = static_cast<int>(floor(quat[map[2]] * kFloat2Int + .5f));
_dest->value[0] = math::Clamp(-32767, a, 32767) & 0xffff;
_dest->value[1] = math::Clamp(-32767, b, 32767) & 0xffff;
_dest->value[2] = math::Clamp(-32767, c, 32767) & 0xffff;
}
} // namespace
// Specialize for rotations in order to normalize quaternions.
// Consecutive opposite quaternions are also fixed up in order to avoid checking
// for the smallest path during the NLerp runtime algorithm.
void CopyToAnimation(ozz::Vector<SortingRotationKey>::Std* _src,
ozz::Range<RotationKey>* _dest) {
const size_t src_count = _src->size();
if (!src_count) {
return;
}
// Normalize quaternions.
// Also fixes-up successive opposite quaternions that would fail to take the
// shortest path during the normalized-lerp.
// Note that keys are still sorted per-track at that point, which allows this
// algorithm to process all consecutive keys.
size_t track = std::numeric_limits<size_t>::max();
const math::Quaternion identity = math::Quaternion::identity();
SortingRotationKey* src = &_src->front();
for (size_t i = 0; i < src_count; ++i) {
math::Quaternion normalized = NormalizeSafe(src[i].key.value, identity);
if (track != src[i].track) { // First key of the track.
if (normalized.w < 0.f) { // .w eq to a dot with identity quaternion.
normalized = -normalized; // Q an -Q are the same rotation.
}
} else { // Still on the same track: so fixes-up quaternion.
const math::Float4 prev(src[i - 1].key.value.x, src[i - 1].key.value.y,
src[i - 1].key.value.z, src[i - 1].key.value.w);
const math::Float4 curr(normalized.x, normalized.y, normalized.z,
normalized.w);
if (Dot(prev, curr) < 0.f) {
normalized = -normalized; // Q an -Q are the same rotation.
}
}
// Stores fixed-up quaternion.
src[i].key.value = normalized;
track = src[i].track;
}
// Sort.
std::sort(array_begin(*_src), array_end(*_src),
&SortingKeyLess<SortingRotationKey>);
// Fills rotation keys output.
for (size_t i = 0; i < src_count; ++i) {
const SortingRotationKey& skey = src[i];
RotationKey& dkey = _dest->begin[i];
dkey.time = skey.key.time;
dkey.track = skey.track;
// Compress quaternion to destination container.
CompressQuat(skey.key.value, &dkey);
}
}
} // namespace
// Ensures _input's validity and allocates _animation.
// An animation needs to have at least two key frames per joint, the first at
// t = 0 and the last at t = duration. If at least one of those keys are not
// in the RawAnimation then the builder creates it.
Animation* AnimationBuilder::operator()(const RawAnimation& _input) const {
// Tests _raw_animation validity.
if (!_input.Validate()) {
return NULL;
}
// Everything is fine, allocates and fills the animation.
// Nothing can fail now.
Animation* animation = memory::default_allocator()->New<Animation>();
// Sets duration.
const float duration = _input.duration;
animation->duration_ = duration;
// A _duration == 0 would create some division by 0 during sampling.
// Also we need at least to keys with different times, which cannot be done
// if duration is 0.
assert(duration > 0.f); // This case is handled by Validate().
// Sets tracks count. Can be safely casted to uint16_t as number of tracks as
// already been validated.
const uint16_t num_tracks = static_cast<uint16_t>(_input.num_tracks());
animation->num_tracks_ = num_tracks;
const uint16_t num_soa_tracks = math::Align(num_tracks, 4);
// Declares and preallocates tracks to sort.
size_t translations = 0, rotations = 0, scales = 0;
for (int i = 0; i < num_tracks; ++i) {
const RawAnimation::JointTrack& raw_track = _input.tracks[i];
translations += raw_track.translations.size() + 2; // +2 because worst case
rotations += raw_track.rotations.size() + 2; // needs to add the
scales += raw_track.scales.size() + 2; // first and last keys.
}
ozz::Vector<SortingTranslationKey>::Std sorting_translations;
sorting_translations.reserve(translations);
ozz::Vector<SortingRotationKey>::Std sorting_rotations;
sorting_rotations.reserve(rotations);
ozz::Vector<SortingScaleKey>::Std sorting_scales;
sorting_scales.reserve(scales);
// Filters RawAnimation keys and copies them to the output sorting structure.
uint16_t i = 0;
for (; i < num_tracks; ++i) {
const RawAnimation::JointTrack& raw_track = _input.tracks[i];
CopyRaw(raw_track.translations, i, duration, &sorting_translations);
CopyRaw(raw_track.rotations, i, duration, &sorting_rotations);
CopyRaw(raw_track.scales, i, duration, &sorting_scales);
}
// Add enough identity keys to match soa requirements.
for (; i < num_soa_tracks; ++i) {
typedef RawAnimation::TranslationKey SrcTKey;
PushBackIdentityKey<SrcTKey>(i, 0.f, &sorting_translations);
PushBackIdentityKey<SrcTKey>(i, duration, &sorting_translations);
typedef RawAnimation::RotationKey SrcRKey;
PushBackIdentityKey<SrcRKey>(i, 0.f, &sorting_rotations);
PushBackIdentityKey<SrcRKey>(i, duration, &sorting_rotations);
typedef RawAnimation::ScaleKey SrcSKey;
PushBackIdentityKey<SrcSKey>(i, 0.f, &sorting_scales);
PushBackIdentityKey<SrcSKey>(i, duration, &sorting_scales);
}
// Allocate animation members.
animation->Allocate(_input.name.length() + 1, sorting_translations.size(),
sorting_rotations.size(), sorting_scales.size());
// Copy sorted keys to final animation.
CopyToAnimation(&sorting_translations, &animation->translations_);
CopyToAnimation(&sorting_rotations, &animation->rotations_);
CopyToAnimation(&sorting_scales, &animation->scales_);
// Copy animation's name.
strcpy(animation->name_, _input.name.c_str());
return animation; // Success.
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including animation_optimizer.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/animation_optimizer.h"
#include <cassert>
#include <cstddef>
#include "ozz/base/maths/math_constant.h"
#include "ozz/base/maths/math_ex.h"
#include "ozz/animation/offline/raw_animation.h"
#include "ozz/animation/offline/raw_animation_utils.h"
#include "ozz/animation/runtime/skeleton.h"
#include "ozz/animation/runtime/skeleton_utils.h"
namespace ozz {
namespace animation {
namespace offline {
// Setup default values (favoring quality).
AnimationOptimizer::AnimationOptimizer()
: translation_tolerance(1e-3f), // 1 mm.
rotation_tolerance(.1f * math::kPi / 180.f), // 0.1 degree.
scale_tolerance(1e-3f), // 0.1%.
hierarchical_tolerance(1e-3f) { // 1 mm.
}
namespace {
struct JointSpec {
float length;
float scale;
};
typedef ozz::Vector<JointSpec>::Std JointSpecs;
JointSpec Iter(const Skeleton& _skeleton, uint16_t _joint,
const JointSpecs& _local_joint_specs,
float _parent_accumulated_scale,
JointSpecs* _hierarchical_joint_specs) {
JointSpec local_joint_spec = _local_joint_specs[_joint];
JointSpec& hierarchical_joint_spec = _hierarchical_joint_specs->at(_joint);
const Skeleton::JointProperties* properties =
_skeleton.joint_properties().begin;
// Applies parent's scale to this joint.
uint16_t parent = properties[_joint].parent;
if (parent != Skeleton::kNoParentIndex) {
local_joint_spec.length *= _parent_accumulated_scale;
local_joint_spec.scale *= _parent_accumulated_scale;
}
if (properties[_joint].is_leaf) {
// Set leaf length to 0, as track's own tolerance checks are enough for a
// leaf.
hierarchical_joint_spec.length = 0.f;
hierarchical_joint_spec.scale = 1.f;
} else {
// Find first child.
uint16_t child = _joint + 1;
for (; child < _skeleton.num_joints() && properties[child].parent != _joint;
++child) {
}
assert(properties[child].parent == _joint);
// Now iterate childs.
for (; child < _skeleton.num_joints() && properties[child].parent == _joint;
++child) {
// Entering each child.
const JointSpec child_spec =
Iter(_skeleton, child, _local_joint_specs, local_joint_spec.scale,
_hierarchical_joint_specs);
// Accumulated each child specs to this joint.
hierarchical_joint_spec.length =
math::Max(hierarchical_joint_spec.length, child_spec.length);
hierarchical_joint_spec.scale =
math::Max(hierarchical_joint_spec.scale, child_spec.scale);
}
}
// Returns accumulated specs for this joint.
const JointSpec spec = {
hierarchical_joint_spec.length + local_joint_spec.length,
hierarchical_joint_spec.scale * _local_joint_specs[_joint].scale};
return spec;
}
void BuildHierarchicalSpecs(const RawAnimation& _animation,
const Skeleton& _skeleton,
JointSpecs* _hierarchical_joint_specs) {
assert(_animation.num_tracks() == _skeleton.num_joints());
// Early out if no joint.
if (_animation.num_tracks() == 0) {
return;
}
// Extracts maximum translations and scales for each track.
JointSpecs local_joint_specs;
local_joint_specs.resize(_animation.tracks.size());
_hierarchical_joint_specs->resize(_animation.tracks.size());
for (size_t i = 0; i < _animation.tracks.size(); ++i) {
const RawAnimation::JointTrack& track = _animation.tracks[i];
float max_length = 0.f;
for (size_t j = 0; j < track.translations.size(); ++j) {
max_length =
math::Max(max_length, LengthSqr(track.translations[j].value));
}
local_joint_specs[i].length = std::sqrt(max_length);
float max_scale = 0.f;
if (track.scales.size() != 0) {
for (size_t j = 0; j < track.scales.size(); ++j) {
max_scale = math::Max(max_scale, track.scales[j].value.x);
max_scale = math::Max(max_scale, track.scales[j].value.y);
max_scale = math::Max(max_scale, track.scales[j].value.z);
}
} else {
max_scale = 1.f;
}
local_joint_specs[i].scale = max_scale;
}
// Iterates all skeleton roots.
for (uint16_t root = 0;
root < _skeleton.num_joints() &&
_skeleton.joint_properties()[root].parent == Skeleton::kNoParentIndex;
++root) {
// Entering each root.
Iter(_skeleton, root, local_joint_specs, 1.f, _hierarchical_joint_specs);
}
}
// Copy _src keys to _dest but except the ones that can be interpolated.
template <typename _RawTrack, typename _Comparator, typename _Lerp>
void Filter(const _RawTrack& _src, const _Comparator& _comparator,
const _Lerp& _lerp, float _tolerance, float _hierarchical_tolerance,
float _hierarchy_length, _RawTrack* _dest) {
_dest->reserve(_src.size());
// Only copies the key that cannot be interpolated from the others.
size_t last_src_pushed = 0; // Index (in src) of the last pushed key.
for (size_t i = 0; i < _src.size(); ++i) {
// First and last keys are always pushed.
if (i == 0) {
_dest->push_back(_src[i]);
last_src_pushed = i;
} else if (i == _src.size() - 1) {
// Don't push the last value if it's the same as last_src_pushed.
typename _RawTrack::const_reference left = _src[last_src_pushed];
typename _RawTrack::const_reference right = _src[i];
if (!_comparator(left.value, right.value, _tolerance,
_hierarchical_tolerance, _hierarchy_length)) {
_dest->push_back(right);
last_src_pushed = i;
}
} else {
// Only inserts i key if keys in range ]last_src_pushed,i] cannot be
// interpolated from keys last_src_pushed and i + 1.
typename _RawTrack::const_reference left = _src[last_src_pushed];
typename _RawTrack::const_reference right = _src[i + 1];
for (size_t j = last_src_pushed + 1; j <= i; ++j) {
typename _RawTrack::const_reference test = _src[j];
const float alpha = (test.time - left.time) / (right.time - left.time);
assert(alpha >= 0.f && alpha <= 1.f);
if (!_comparator(_lerp(left.value, right.value, alpha), test.value,
_tolerance, _hierarchical_tolerance,
_hierarchy_length)) {
_dest->push_back(_src[i]);
last_src_pushed = i;
break;
}
}
}
}
assert(_dest->size() <= _src.size());
}
// Translation filtering comparator.
bool CompareTranslation(const math::Float3& _a, const math::Float3& _b,
float _tolerance, float _hierarchical_tolerance,
float _hierarchy_scale) {
if (!Compare(_a, _b, _tolerance)) {
return false;
}
// Compute the position of the end of the hierarchy.
const math::Float3 s(_hierarchy_scale);
return Compare(_a * s, _b * s, _hierarchical_tolerance);
}
// Rotation filtering comparator.
bool CompareRotation(const math::Quaternion& _a, const math::Quaternion& _b,
float _tolerance, float _hierarchical_tolerance,
float _hierarchy_length) {
// Compute the shortest unsigned angle between the 2 quaternions.
// diff_w is w component of a-1 * b.
const float diff_w = _a.x * _b.x + _a.y * _b.y + _a.z * _b.z + _a.w * _b.w;
const float angle = 2.f * std::acos(math::Min(std::abs(diff_w), 1.f));
if (std::abs(angle) > _tolerance) {
return false;
}
// Deduces the length of the opposite segment at a distance _hierarchy_length.
const float arc_length = std::sin(angle) * _hierarchy_length;
return std::abs(arc_length) < _hierarchical_tolerance;
}
// Scale filtering comparator.
bool CompareScale(const math::Float3& _a, const math::Float3& _b,
float _tolerance, float _hierarchical_tolerance,
float _hierarchy_length) {
if (!Compare(_a, _b, _tolerance)) {
return false;
}
// Compute the position of the end of the hierarchy, in both cases _a and _b.
const math::Float3 l(_hierarchy_length);
return Compare(_a * l, _b * l, _hierarchical_tolerance);
}
} // namespace
bool AnimationOptimizer::operator()(const RawAnimation& _input,
const Skeleton& _skeleton,
RawAnimation* _output) const {
if (!_output) {
return false;
}
// Reset output animation to default.
*_output = RawAnimation();
// Validate animation.
if (!_input.Validate()) {
return false;
}
// Validates the skeleton matches the animation.
if (_input.num_tracks() != _skeleton.num_joints()) {
return false;
}
// First computes bone lengths, that will be used when filtering.
JointSpecs hierarchical_joint_specs;
BuildHierarchicalSpecs(_input, _skeleton, &hierarchical_joint_specs);
// Rebuilds output animation.
_output->name = _input.name;
_output->duration = _input.duration;
_output->tracks.resize(_input.tracks.size());
for (size_t i = 0; i < _input.tracks.size(); ++i) {
Filter(_input.tracks[i].translations, CompareTranslation, LerpTranslation,
translation_tolerance, hierarchical_tolerance,
hierarchical_joint_specs[i].scale, &_output->tracks[i].translations);
Filter(_input.tracks[i].rotations, CompareRotation, LerpRotation,
rotation_tolerance, hierarchical_tolerance,
hierarchical_joint_specs[i].length, &_output->tracks[i].rotations);
Filter(_input.tracks[i].scales, CompareScale, LerpScale, scale_tolerance,
hierarchical_tolerance, hierarchical_joint_specs[i].length,
&_output->tracks[i].scales);
}
// Output animation is always valid though.
return _output->Validate();
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including additive_animation_builder.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/additive_animation_builder.h"
#include <cassert>
#include <cstddef>
#include "ozz/animation/offline/raw_animation.h"
namespace ozz {
namespace animation {
namespace offline {
namespace {
template <typename _RawTrack, typename _MakeDelta>
void MakeDelta(const _RawTrack& _src, const _MakeDelta& _make_delta,
_RawTrack* _dest) {
_dest->reserve(_src.size());
// Early out if no key.
if (_src.empty()) {
return;
}
// Stores reference value.
typename _RawTrack::const_reference reference = _src[0];
// Copy animation keys.
for (size_t i = 0; i < _src.size(); ++i) {
const typename _RawTrack::value_type delta = {
_src[i].time, _make_delta(reference.value, _src[i].value)};
_dest->push_back(delta);
}
}
math::Float3 MakeDeltaTranslation(const math::Float3& _reference,
const math::Float3& _value) {
return _value - _reference;
}
math::Quaternion MakeDeltaRotation(const math::Quaternion& _reference,
const math::Quaternion& _value) {
return _value * Conjugate(_reference);
}
math::Float3 MakeDeltaScale(const math::Float3& _reference,
const math::Float3& _value) {
return _value / _reference;
}
} // namespace
// Setup default values (favoring quality).
AdditiveAnimationBuilder::AdditiveAnimationBuilder() {}
bool AdditiveAnimationBuilder::operator()(const RawAnimation& _input,
RawAnimation* _output) const {
if (!_output) {
return false;
}
// Reset output animation to default.
*_output = RawAnimation();
// Validate animation.
if (!_input.Validate()) {
return false;
}
// Rebuilds output animation.
_output->duration = _input.duration;
_output->tracks.resize(_input.tracks.size());
for (size_t i = 0; i < _input.tracks.size(); ++i) {
MakeDelta(_input.tracks[i].translations, MakeDeltaTranslation,
&_output->tracks[i].translations);
MakeDelta(_input.tracks[i].rotations, MakeDeltaRotation,
&_output->tracks[i].rotations);
MakeDelta(_input.tracks[i].scales, MakeDeltaScale,
&_output->tracks[i].scales);
}
// Output animation is always valid though.
return _output->Validate();
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including raw_skeleton.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/raw_skeleton.h"
#include "ozz/animation/runtime/skeleton.h"
namespace ozz {
namespace animation {
namespace offline {
RawSkeleton::RawSkeleton() {}
RawSkeleton::~RawSkeleton() {}
bool RawSkeleton::Validate() const {
if (num_joints() > Skeleton::kMaxJoints) {
return false;
}
return true;
}
namespace {
struct JointCounter {
JointCounter() : num_joints(0) {}
void operator()(const RawSkeleton::Joint&, const RawSkeleton::Joint*) {
++num_joints;
}
int num_joints;
};
} // namespace
// Iterates through all the root children and count them.
int RawSkeleton::num_joints() const {
return IterateJointsDF(JointCounter()).num_joints;
}
} // namespace offline
} // namespace animation
} // namespace ozz
// Including raw_skeleton_archive.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/raw_skeleton.h"
#include "ozz/base/io/archive.h"
#include "ozz/base/maths/math_archive.h"
#include "ozz/base/containers/string_archive.h"
#include "ozz/base/containers/vector_archive.h"
namespace ozz {
namespace io {
template <>
void Save(OArchive& _archive, const animation::offline::RawSkeleton* _skeletons,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawSkeleton& skeleton = _skeletons[i];
_archive << skeleton.roots;
}
}
template <>
void Load(IArchive& _archive, animation::offline::RawSkeleton* _skeletons,
size_t _count, uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawSkeleton& skeleton = _skeletons[i];
_archive >> skeleton.roots;
}
}
// RawSkeleton::Joint' version can be declared locally as it will be saved from
// this cpp file only.
OZZ_IO_TYPE_VERSION(1, animation::offline::RawSkeleton::Joint)
template <>
void Save(OArchive& _archive,
const animation::offline::RawSkeleton::Joint* _joints,
size_t _count) {
for (size_t i = 0; i < _count; ++i) {
const animation::offline::RawSkeleton::Joint& joint = _joints[i];
_archive << joint.name;
_archive << joint.transform;
_archive << joint.children;
}
}
template <>
void Load(IArchive& _archive, animation::offline::RawSkeleton::Joint* _joints,
size_t _count, uint32_t _version) {
(void)_version;
for (size_t i = 0; i < _count; ++i) {
animation::offline::RawSkeleton::Joint& joint = _joints[i];
_archive >> joint.name;
_archive >> joint.transform;
_archive >> joint.children;
}
}
} // namespace io
} // namespace ozz
// Including skeleton_builder.cc file.
//----------------------------------------------------------------------------//
// //
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
// and distributed under the MIT License (MIT). //
// //
// Copyright (c) 2017 Guillaume Blanc //
// //
// 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 "ozz/animation/offline/skeleton_builder.h"
#include <cstring>
#include "ozz/animation/offline/raw_skeleton.h"
#include "ozz/animation/runtime/skeleton.h"
#include "ozz/base/containers/vector.h"
#include "ozz/base/maths/soa_transform.h"
#include "ozz/base/memory/allocator.h"
namespace ozz {
namespace animation {
namespace offline {
namespace {
// Stores each traversed joint to a vector.
struct JointLister {
explicit JointLister(int _num_joints) { linear_joints.reserve(_num_joints); }
void operator()(const RawSkeleton::Joint& _current,
const RawSkeleton::Joint* _parent) {
// Looks for the "lister" parent.
int parent = Skeleton::kNoParentIndex;
if (_parent) {
// Start searching from the last joint.
int j = static_cast<int>(linear_joints.size()) - 1;
for (; j >= 0; --j) {
if (linear_joints[j].joint == _parent) {
parent = j;
break;
}
}
assert(parent >= 0);
}
const Joint listed = {&_current, parent};
linear_joints.push_back(listed);
}
struct Joint {
const RawSkeleton::Joint* joint;
int parent;
};
// Array of joints in the traversed DAG order.
ozz::Vector<Joint>::Std linear_joints;
};
} // namespace
// Validates the RawSkeleton and fills a Skeleton.
// Uses RawSkeleton::IterateJointsBF to traverse in DAG breadth-first order.
// This favors cache coherency (when traversing joints) and reduces
// Load-Hit-Stores (reusing the parent that has just been computed).
Skeleton* SkeletonBuilder::operator()(const RawSkeleton& _raw_skeleton) const {
// Tests _raw_skeleton validity.
if (!_raw_skeleton.Validate()) {
return NULL;
}
// Everything is fine, allocates and fills the skeleton.
// Will not fail.
Skeleton* skeleton = memory::default_allocator()->New<Skeleton>();
const int num_joints = _raw_skeleton.num_joints();
// Iterates through all the joint of the raw skeleton and fills a sorted joint
// list.
JointLister lister(num_joints);
_raw_skeleton.IterateJointsBF<JointLister&>(lister);
assert(static_cast<int>(lister.linear_joints.size()) == num_joints);
// Computes name's buffer size.
size_t chars_size = 0;
for (int i = 0; i < num_joints; ++i) {
const RawSkeleton::Joint& current = *lister.linear_joints[i].joint;
chars_size += (current.name.size() + 1) * sizeof(char);
}
// Allocates all skeleton members.
char* cursor = skeleton->Allocate(chars_size, num_joints);
// Copy names. All names are allocated in a single buffer. Only the first name
// is set, all other names array entries must be initialized.
for (int i = 0; i < num_joints; ++i) {
const RawSkeleton::Joint& current = *lister.linear_joints[i].joint;
skeleton->joint_names_[i] = cursor;
strcpy(cursor, current.name.c_str());
cursor += (current.name.size() + 1) * sizeof(char);
}
// Transfers sorted joints hierarchy to the new skeleton.
for (int i = 0; i < num_joints; ++i) {
skeleton->joint_properties_[i].parent = lister.linear_joints[i].parent;
skeleton->joint_properties_[i].is_leaf =
lister.linear_joints[i].joint->children.empty();
}
// Transfers t-poses.
const math::SimdFloat4 w_axis = math::simd_float4::w_axis();
const math::SimdFloat4 zero = math::simd_float4::zero();
const math::SimdFloat4 one = math::simd_float4::one();
for (int i = 0; i < skeleton->num_soa_joints(); ++i) {
math::SimdFloat4 translations[4];
math::SimdFloat4 scales[4];
math::SimdFloat4 rotations[4];
for (int j = 0; j < 4; ++j) {
if (i * 4 + j < num_joints) {
const RawSkeleton::Joint& src_joint =
*lister.linear_joints[i * 4 + j].joint;
translations[j] =
math::simd_float4::Load3PtrU(&src_joint.transform.translation.x);
rotations[j] = math::NormalizeSafe4(
math::simd_float4::LoadPtrU(&src_joint.transform.rotation.x),
w_axis);
scales[j] = math::simd_float4::Load3PtrU(&src_joint.transform.scale.x);
} else {
translations[j] = zero;
rotations[j] = w_axis;
scales[j] = one;
}
}
// Fills the SoaTransform structure.
math::Transpose4x3(translations, &skeleton->bind_pose_[i].translation.x);
math::Transpose4x4(rotations, &skeleton->bind_pose_[i].rotation.x);
math::Transpose4x3(scales, &skeleton->bind_pose_[i].scale.x);
}
return skeleton; // Success.
}
} // namespace offline
} // namespace animation
} // namespace ozz
| [
"guillaumeblanc.sc@gmail.com"
] | guillaumeblanc.sc@gmail.com |
2bd77a4210fa9560dce2a8cd7b76a73e922ef3f7 | 26cc428b3d87f0cd0f1a2e6a51e9da25cd0b651a | /inflowPosition/Blasius_10/linear/0.65/p | 3aebd86ddb7e3c276e31262b1bb6c75eab401c7b | [] | no_license | CagriMetin/BlasiusProblem | 8f4fe708df8f3332d054b233d99a33fbb3c15c2a | 32c4aafd6ddd6ba4c39aef04d01b77a9106125b2 | refs/heads/master | 2020-12-24T19:37:14.665700 | 2016-12-27T19:13:04 | 2016-12-27T19:13:04 | 57,833,097 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 40,661 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.65";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
3105
(
0.00252313
0.00222433
0.00163262
0.00106922
0.000599449
0.000201541
-0.000134613
-0.000393535
-0.000556533
-0.000627205
-0.0006304
-0.000596469
-0.000549171
-0.000502781
-0.000463914
-0.000434106
-0.000412183
-0.000396031
-0.000383617
-0.000373379
-0.000364268
-0.000355658
-0.000347223
-0.000338827
-0.000330439
-0.000322078
-0.000313782
-0.000305587
-0.000297523
-0.000289609
-0.000281858
-0.000274276
-0.000266864
-0.000259622
-0.000252547
-0.000245636
-0.000238886
-0.000232294
-0.000225859
-0.000219578
-0.000213451
-0.000207477
-0.000201654
-0.000195983
-0.000190463
-0.000185093
-0.000179873
-0.000174802
-0.000169878
-0.0001651
-0.000160467
-0.000155978
-0.00015163
-0.000147421
-0.000143349
-0.000139411
-0.000135605
-0.000131927
-0.000128375
-0.000124945
-0.000121632
-0.000118436
-0.000115349
-0.00011237
-0.00010949
-0.00010671
-0.00010402
-0.000101419
-9.88963e-05
-9.6452e-05
-9.4072e-05
-9.176e-05
-8.94956e-05
-8.72874e-05
-8.51087e-05
-8.29723e-05
-8.0845e-05
-7.87447e-05
-7.66291e-05
-7.45254e-05
-7.23757e-05
-7.02234e-05
-6.79889e-05
-6.57343e-05
-6.33572e-05
-6.09408e-05
-5.83515e-05
-5.57061e-05
-5.28241e-05
-4.98698e-05
-4.66043e-05
-4.32485e-05
-3.94881e-05
-3.56261e-05
-3.1237e-05
-2.67394e-05
-2.1558e-05
-1.62838e-05
-1.00862e-05
-3.92076e-06
0.00209709
0.00193869
0.00152201
0.00103628
0.000594295
0.000217134
-9.71652e-05
-0.000338911
-0.000497076
-0.000573452
-0.000586509
-0.000562372
-0.000523413
-0.000483529
-0.00044945
-0.000422935
-0.000403164
-0.000388403
-0.00037692
-0.000367347
-0.000358754
-0.000350578
-0.000342524
-0.000334468
-0.000326388
-0.000318306
-0.000310261
-0.000302293
-0.000294432
-0.000286704
-0.000279121
-0.000271692
-0.00026442
-0.000257307
-0.00025035
-0.000243549
-0.000236901
-0.000230405
-0.000224058
-0.00021786
-0.00021181
-0.000205909
-0.000200154
-0.000194548
-0.000189088
-0.000183776
-0.000178609
-0.000173589
-0.000168713
-0.000163982
-0.000159392
-0.000154944
-0.000150635
-0.000146464
-0.000142427
-0.000138523
-0.000134749
-0.000131102
-0.000127579
-0.000124177
-0.000120892
-0.000117722
-0.000114659
-0.000111704
-0.000108848
-0.00010609
-0.000103421
-0.000100841
-9.83379e-05
-9.5913e-05
-9.35513e-05
-9.12576e-05
-8.901e-05
-8.68193e-05
-8.46563e-05
-8.25363e-05
-8.04237e-05
-7.83389e-05
-7.6237e-05
-7.41484e-05
-7.20111e-05
-6.98735e-05
-6.76504e-05
-6.54099e-05
-6.30434e-05
-6.06404e-05
-5.80605e-05
-5.54285e-05
-5.25545e-05
-4.96133e-05
-4.63543e-05
-4.30116e-05
-3.92556e-05
-3.5407e-05
-3.10196e-05
-2.6536e-05
-2.13516e-05
-1.60939e-05
-9.88778e-06
-3.75678e-06
0.00180034
0.00170424
0.00141562
0.00101389
0.000610365
0.000258089
-3.10992e-05
-0.00025415
-0.000408126
-0.000494546
-0.000524596
-0.000517075
-0.000491294
-0.000461165
-0.000433644
-0.000411133
-0.000393642
-0.000380162
-0.000369454
-0.000360434
-0.000352309
-0.000344574
-0.000336952
-0.000329319
-0.000321642
-0.000313938
-0.000306239
-0.000298585
-0.000291005
-0.000283527
-0.000276167
-0.000268937
-0.000261843
-0.000254889
-0.000248077
-0.000241406
-0.000234877
-0.000228489
-0.000222242
-0.000216136
-0.000210172
-0.000204349
-0.000198669
-0.000193131
-0.000187735
-0.000182483
-0.000177372
-0.000172405
-0.000167579
-0.000162895
-0.000158349
-0.000153944
-0.000149674
-0.00014554
-0.000141539
-0.000137669
-0.000133927
-0.000130311
-0.000126818
-0.000123444
-0.000120186
-0.000117041
-0.000114003
-0.000111072
-0.000108238
-0.000105502
-0.000102854
-0.000100293
-9.78098e-05
-9.5404e-05
-9.30599e-05
-9.07844e-05
-8.85531e-05
-8.63797e-05
-8.42319e-05
-8.21283e-05
-8.00302e-05
-7.79611e-05
-7.58724e-05
-7.37995e-05
-7.1674e-05
-6.95521e-05
-6.73399e-05
-6.51148e-05
-6.27584e-05
-6.0371e-05
-5.77997e-05
-5.51842e-05
-5.23171e-05
-4.9393e-05
-4.61397e-05
-4.28152e-05
-3.90625e-05
-3.52343e-05
-3.08476e-05
-2.63867e-05
-2.12e-05
-1.59675e-05
-9.77198e-06
-3.68726e-06
0.00159599
0.00151869
0.00130747
0.000982968
0.00062737
0.000304225
3.76643e-05
-0.000168894
-0.000316871
-0.000409054
-0.000452822
-0.000461194
-0.000449357
-0.000429745
-0.000409657
-0.000392241
-0.000378199
-0.000367077
-0.000358036
-0.000350258
-0.00034312
-0.000336218
-0.000329328
-0.000322356
-0.000315277
-0.000308112
-0.000300897
-0.000293671
-0.000286473
-0.000279333
-0.000272272
-0.00026531
-0.000258455
-0.000251717
-0.000245099
-0.000238606
-0.000232239
-0.000226
-0.00021989
-0.000213911
-0.000208064
-0.00020235
-0.000196771
-0.000191327
-0.00018602
-0.000180849
-0.000175816
-0.000170921
-0.000166162
-0.000161541
-0.000157055
-0.000152705
-0.000148488
-0.000144404
-0.00014045
-0.000136624
-0.000132924
-0.000129348
-0.000125892
-0.000122555
-0.00011933
-0.000116218
-0.000113211
-0.000110309
-0.000107503
-0.000104795
-0.000102173
-9.9637e-05
-9.71772e-05
-9.47946e-05
-9.24722e-05
-9.02188e-05
-8.80074e-05
-8.58549e-05
-8.37257e-05
-8.16417e-05
-7.95613e-05
-7.7511e-05
-7.54387e-05
-7.33846e-05
-7.1274e-05
-6.9171e-05
-6.69728e-05
-6.47664e-05
-6.24233e-05
-6.0055e-05
-5.74958e-05
-5.49008e-05
-5.20444e-05
-4.9142e-05
-4.58986e-05
-4.25977e-05
-3.88536e-05
-3.5052e-05
-3.0673e-05
-2.62413e-05
-2.10644e-05
-1.58632e-05
-9.70556e-06
-3.67345e-06
0.00143445
0.00136271
0.00119682
0.00093626
0.000632145
0.000342068
9.71929e-05
-9.49139e-05
-0.000236184
-0.000330441
-0.000383359
-0.000404137
-0.000404271
-0.000394266
-0.000381288
-0.000369018
-0.000358704
-0.000350306
-0.000343291
-0.000337066
-0.00033117
-0.000325307
-0.000319324
-0.000313164
-0.000306823
-0.000300328
-0.00029372
-0.000287044
-0.00028034
-0.000273643
-0.000266982
-0.000260377
-0.000253846
-0.0002474
-0.000241047
-0.000234795
-0.000228648
-0.000222612
-0.000216688
-0.000210881
-0.000205193
-0.000199628
-0.000194186
-0.000188871
-0.000183683
-0.000178625
-0.000173697
-0.0001689
-0.000164233
-0.000159699
-0.000155295
-0.000151022
-0.000146878
-0.000142862
-0.000138973
-0.000135208
-0.000131566
-0.000128044
-0.00012464
-0.000121352
-0.000118174
-0.000115107
-0.000112141
-0.00010928
-0.000106512
-0.000103839
-0.000101252
-9.87499e-05
-9.63222e-05
-9.39702e-05
-9.16769e-05
-8.94523e-05
-8.72674e-05
-8.51419e-05
-8.30375e-05
-8.09789e-05
-7.8922e-05
-7.68959e-05
-7.48455e-05
-7.28154e-05
-7.0725e-05
-6.86461e-05
-6.64671e-05
-6.42847e-05
-6.19605e-05
-5.96168e-05
-5.70755e-05
-5.45068e-05
-5.16677e-05
-4.87934e-05
-4.55677e-05
-4.22974e-05
-3.85716e-05
-3.48041e-05
-3.04464e-05
-2.60511e-05
-2.09049e-05
-1.57437e-05
-9.65521e-06
-3.68429e-06
0.00129692
0.00122807
0.00109046
0.00087935
0.000624301
0.000369394
0.000146414
-3.24784e-05
-0.000167024
-0.000261001
-0.000319523
-0.000349496
-0.000359486
-0.000358019
-0.000351664
-0.000344316
-0.000337639
-0.000331952
-0.000326989
-0.000322356
-0.000317736
-0.000312939
-0.000307882
-0.000302549
-0.000296962
-0.00029116
-0.000285187
-0.000279093
-0.00027292
-0.000266706
-0.000260484
-0.000254281
-0.000248114
-0.000242002
-0.000235955
-0.000229984
-0.000224097
-0.0002183
-0.000212598
-0.000206999
-0.000201503
-0.000196118
-0.000190844
-0.000185686
-0.000180646
-0.000175727
-0.000170929
-0.000166255
-0.000161705
-0.00015728
-0.000152979
-0.000148803
-0.000144751
-0.000140822
-0.000137015
-0.000133328
-0.000129761
-0.000126308
-0.000122971
-0.000119746
-0.000116627
-0.000113617
-0.000110705
-0.000107896
-0.000105177
-0.000102551
-0.000100009
-9.75491e-05
-9.51623e-05
-9.28494e-05
-9.05932e-05
-8.84052e-05
-8.62543e-05
-8.4163e-05
-8.20904e-05
-8.00637e-05
-7.80368e-05
-7.60411e-05
-7.40188e-05
-7.2019e-05
-6.99548e-05
-6.79061e-05
-6.57526e-05
-6.36004e-05
-6.13015e-05
-5.8989e-05
-5.64728e-05
-5.39375e-05
-5.1124e-05
-4.82851e-05
-4.50876e-05
-4.18555e-05
-3.81622e-05
-3.44361e-05
-3.01198e-05
-2.57686e-05
-2.06812e-05
-1.55713e-05
-9.58653e-06
-3.68985e-06
0.00117666
0.00111086
0.000993172
0.000819692
0.0006073
0.000386878
0.000186346
2.05259e-05
-0.00010734
-0.000199836
-0.000261562
-0.000298115
-0.000316013
-0.000321989
-0.000321731
-0.00031904
-0.000315847
-0.000312788
-0.000309848
-0.000306811
-0.000303487
-0.000299778
-0.000295662
-0.000291166
-0.000286337
-0.000281228
-0.000275892
-0.000270381
-0.000264741
-0.000259014
-0.000253236
-0.000247438
-0.000241643
-0.000235871
-0.000230137
-0.000224456
-0.000218837
-0.00021329
-0.000207821
-0.000202439
-0.000197148
-0.000191954
-0.000186861
-0.000181874
-0.000176994
-0.000172227
-0.000167573
-0.000163036
-0.000158614
-0.000154312
-0.000150127
-0.000146062
-0.000142114
-0.000138285
-0.000134573
-0.000130975
-0.000127494
-0.000124123
-0.000120863
-0.000117711
-0.000114663
-0.00011172
-0.000108872
-0.000106123
-0.000103463
-0.000100892
-9.84028e-05
-9.59933e-05
-9.36549e-05
-9.13886e-05
-8.91765e-05
-8.70319e-05
-8.49214e-05
-8.28707e-05
-8.08357e-05
-7.88471e-05
-7.68558e-05
-7.48967e-05
-7.29077e-05
-7.09441e-05
-6.89117e-05
-6.68989e-05
-6.47769e-05
-6.26608e-05
-6.03938e-05
-5.81186e-05
-5.56354e-05
-5.31396e-05
-5.0362e-05
-4.75645e-05
-4.44086e-05
-4.12208e-05
-3.75778e-05
-3.38995e-05
-2.96484e-05
-2.53498e-05
-2.0353e-05
-1.53085e-05
-9.46192e-06
-3.65398e-06
0.00107054
0.00100838
0.000906214
0.000761517
0.00058434
0.000395551
0.000217467
6.51411e-05
-5.57625e-05
-0.000146029
-0.000209361
-0.000250462
-0.000274491
-0.000286741
-0.000291939
-0.000293568
-0.000293667
-0.000293122
-0.00029215
-0.0002907
-0.000288691
-0.000286097
-0.000282949
-0.000279309
-0.00027525
-0.00027084
-0.000266143
-0.000261215
-0.000256108
-0.000250867
-0.000245532
-0.000240139
-0.000234713
-0.000229282
-0.000223861
-0.00021847
-0.000213119
-0.000207822
-0.000202586
-0.000197423
-0.000192336
-0.000187336
-0.000182426
-0.000177611
-0.000172895
-0.000168283
-0.000163776
-0.000159379
-0.00015509
-0.000150914
-0.00014685
-0.0001429
-0.000139061
-0.000135337
-0.000131724
-0.000128222
-0.000124831
-0.000121547
-0.00011837
-0.000115297
-0.000112325
-0.000109454
-0.000106674
-0.000103992
-0.000101393
-9.88837e-05
-9.64515e-05
-9.40977e-05
-9.18116e-05
-8.95968e-05
-8.74326e-05
-8.53361e-05
-8.32696e-05
-8.12641e-05
-7.92701e-05
-7.73241e-05
-7.53718e-05
-7.34535e-05
-7.15015e-05
-6.95783e-05
-6.75817e-05
-6.5609e-05
-6.35234e-05
-6.14475e-05
-5.92185e-05
-5.69846e-05
-5.45426e-05
-5.20899e-05
-4.93592e-05
-4.66068e-05
-4.35067e-05
-4.03677e-05
-3.67935e-05
-3.31686e-05
-2.9007e-05
-2.47707e-05
-1.98944e-05
-1.49319e-05
-9.25443e-06
-3.55089e-06
0.000976467
0.00091833
0.000828903
0.000706548
0.000557786
0.000396691
0.000240156
0.000101734
-1.16428e-05
-9.89885e-05
-0.000162779
-0.000206863
-0.000235457
-0.000252779
-0.000262679
-0.000268205
-0.000271357
-0.000273186
-0.000274102
-0.000274205
-0.000273507
-0.000272041
-0.000269877
-0.000267108
-0.000263826
-0.000260121
-0.000256063
-0.000251719
-0.000247144
-0.00024239
-0.000237499
-0.000232511
-0.000227457
-0.000222367
-0.000217261
-0.00021216
-0.000207079
-0.000202033
-0.000197032
-0.000192089
-0.000187209
-0.000182404
-0.000177676
-0.000173035
-0.000168484
-0.000164028
-0.000159668
-0.000155412
-0.000151257
-0.000147209
-0.000143266
-0.000139433
-0.000135705
-0.000132086
-0.000128574
-0.000125169
-0.00012187
-0.000118675
-0.000115581
-0.00011259
-0.000109694
-0.000106897
-0.000104188
-0.000101574
-9.90388e-05
-9.65919e-05
-9.42179e-05
-9.1922e-05
-8.96893e-05
-8.7528e-05
-8.54129e-05
-8.33664e-05
-8.13452e-05
-7.93866e-05
-7.74351e-05
-7.55336e-05
-7.36216e-05
-7.1746e-05
-6.9833e-05
-6.79518e-05
-6.59941e-05
-6.40623e-05
-6.20175e-05
-5.99829e-05
-5.77973e-05
-5.56059e-05
-5.32125e-05
-5.0804e-05
-4.81304e-05
-4.54245e-05
-4.23929e-05
-3.9306e-05
-3.58166e-05
-3.22506e-05
-2.81987e-05
-2.40363e-05
-1.93044e-05
-1.44423e-05
-8.95908e-06
-3.38068e-06
0.000892621
0.000838649
0.00075989
0.000655265
0.000529341
0.000391826
0.000255182
0.000130697
2.54645e-05
-5.82182e-05
-0.000121528
-0.000167381
-0.000199221
-0.000220472
-0.000234268
-0.000243201
-0.000249127
-0.000253165
-0.000255868
-0.000257463
-0.000258046
-0.000257699
-0.000256519
-0.000254622
-0.00025212
-0.000249117
-0.000245697
-0.000241935
-0.000237892
-0.000233624
-0.000229178
-0.000224599
-0.000219919
-0.000215174
-0.000210386
-0.00020558
-0.000200772
-0.000195981
-0.000191218
-0.000186498
-0.000181828
-0.00017722
-0.000172679
-0.000168214
-0.000163829
-0.000159532
-0.000155323
-0.00015121
-0.00014719
-0.000143273
-0.000139452
-0.000135737
-0.000132121
-0.000128611
-0.000125201
-0.000121894
-0.000118688
-0.000115582
-0.000112574
-0.000109665
-0.000106846
-0.000104125
-0.000101486
-9.89408e-05
-9.64704e-05
-9.40872e-05
-9.17718e-05
-8.95347e-05
-8.73556e-05
-8.52485e-05
-8.31828e-05
-8.11868e-05
-7.92115e-05
-7.73001e-05
-7.53917e-05
-7.35347e-05
-7.16642e-05
-6.98312e-05
-6.79586e-05
-6.61191e-05
-6.42028e-05
-6.23112e-05
-6.03107e-05
-5.83168e-05
-5.6179e-05
-5.40297e-05
-5.16909e-05
-4.93266e-05
-4.67179e-05
-4.40597e-05
-4.11059e-05
-3.80748e-05
-3.46814e-05
-3.1181e-05
-2.7253e-05
-2.31771e-05
-1.86059e-05
-1.38634e-05
-8.59305e-06
-3.16773e-06
0.000817415
0.000767561
0.000697859
0.000607615
0.000500187
0.000382486
0.000263653
0.000152658
5.60137e-05
-2.32726e-05
-8.52597e-05
-0.000131898
-0.000165902
-0.000190068
-0.000206969
-0.000218781
-0.000227161
-0.000233219
-0.000237588
-0.000240594
-0.000242404
-0.000243141
-0.000242926
-0.000241891
-0.000240161
-0.000237854
-0.000235066
-0.000231882
-0.000228368
-0.000224586
-0.000220586
-0.000216416
-0.000212114
-0.000207716
-0.00020325
-0.000198743
-0.000194213
-0.000189682
-0.000185161
-0.000180669
-0.000176213
-0.000171807
-0.000167456
-0.000163172
-0.000158958
-0.000154823
-0.000150768
-0.000146801
-0.000142921
-0.000139137
-0.000135443
-0.000131849
-0.000128348
-0.000124948
-0.000121642
-0.000118437
-0.000115326
-0.000112313
-0.000109391
-0.000106566
-0.000103827
-0.000101183
-9.86159e-05
-9.61416e-05
-9.3737e-05
-9.14187e-05
-8.91631e-05
-8.69858e-05
-8.48615e-05
-8.28093e-05
-8.07945e-05
-7.8849e-05
-7.69211e-05
-7.50568e-05
-7.31931e-05
-7.13804e-05
-6.95531e-05
-6.77622e-05
-6.59324e-05
-6.41335e-05
-6.22617e-05
-6.04093e-05
-5.84565e-05
-5.65024e-05
-5.44165e-05
-5.23092e-05
-5.00297e-05
-4.771e-05
-4.51718e-05
-4.25638e-05
-3.96936e-05
-3.67232e-05
-3.34329e-05
-3.00064e-05
-2.62104e-05
-2.22349e-05
-1.78336e-05
-1.323e-05
-8.18487e-06
-2.94426e-06
0.000749502
0.000703622
0.000641708
0.000563346
0.000471082
0.00036998
0.000266777
0.000168426
8.05144e-05
6.23957e-06
-5.36577e-05
-0.000100245
-0.000135522
-0.000161737
-0.00018101
-0.000195166
-0.000205652
-0.000213509
-0.0002194
-0.000223714
-0.000226675
-0.000228443
-0.000229155
-0.000228956
-0.000227981
-0.000226357
-0.000224192
-0.000221577
-0.000218585
-0.000215285
-0.000211729
-0.00020797
-0.000204046
-0.000199999
-0.000195858
-0.000191653
-0.000187405
-0.000183137
-0.000178864
-0.000174604
-0.000170367
-0.000166168
-0.000162012
-0.000157913
-0.000153875
-0.000149906
-0.00014601
-0.000142194
-0.000138458
-0.000134811
-0.000131248
-0.000127779
-0.000124397
-0.000121111
-0.000117914
-0.000114812
-0.0001118
-0.000108883
-0.000106051
-0.000103314
-0.000100656
-9.80917e-05
-9.56003e-05
-9.31987e-05
-9.08627e-05
-8.86112e-05
-8.64182e-05
-8.43022e-05
-8.22353e-05
-8.02391e-05
-7.82779e-05
-7.63837e-05
-7.4506e-05
-7.26892e-05
-7.08732e-05
-6.9105e-05
-6.73238e-05
-6.5575e-05
-6.37914e-05
-6.20329e-05
-6.02089e-05
-5.83959e-05
-5.64944e-05
-5.45808e-05
-5.25501e-05
-5.04864e-05
-4.82698e-05
-4.59973e-05
-4.35332e-05
-4.09799e-05
-3.81971e-05
-3.52942e-05
-3.21109e-05
-2.87681e-05
-2.51084e-05
-2.12471e-05
-1.70203e-05
-1.25739e-05
-7.76116e-06
-2.73391e-06
0.000687781
0.000645686
0.000590546
0.00052215
0.000442475
0.000355308
0.000265664
0.000178874
9.95332e-05
3.0686e-05
-2.64607e-05
-7.22646e-05
-0.000108064
-0.000135593
-0.000156583
-0.000172567
-0.000184791
-0.0001942
-0.000201443
-0.000206942
-0.000210961
-0.000213686
-0.000215272
-0.00021587
-0.000215621
-0.000214659
-0.000213099
-0.000211041
-0.000208562
-0.000205737
-0.00020262
-0.000199267
-0.000195722
-0.000192025
-0.000188211
-0.00018431
-0.000180347
-0.000176347
-0.000172324
-0.000168301
-0.000164287
-0.000160299
-0.000156343
-0.000152434
-0.000148576
-0.000144779
-0.000141046
-0.000137386
-0.000133798
-0.000130293
-0.000126865
-0.000123525
-0.000120267
-0.000117099
-0.000114015
-0.000111022
-0.000108113
-0.000105295
-0.000102557
-9.99105e-05
-9.73395e-05
-9.48575e-05
-9.24453e-05
-9.01193e-05
-8.78555e-05
-8.56733e-05
-8.35465e-05
-8.1494e-05
-7.94882e-05
-7.75498e-05
-7.56458e-05
-7.38046e-05
-7.19806e-05
-7.02127e-05
-6.84479e-05
-6.67256e-05
-6.49941e-05
-6.32886e-05
-6.15549e-05
-5.98383e-05
-5.80654e-05
-5.62938e-05
-5.44468e-05
-5.25764e-05
-5.06038e-05
-4.85872e-05
-4.64365e-05
-4.4216e-05
-4.18283e-05
-3.93362e-05
-3.66434e-05
-3.38163e-05
-3.07424e-05
-2.74942e-05
-2.39731e-05
-2.02394e-05
-1.61893e-05
-1.19166e-05
-7.33924e-06
-2.54581e-06
0.000631348
0.000592832
0.00054364
0.000483709
0.0004146
0.000339188
0.000261245
0.000184842
0.000113674
5.04496e-05
-3.42906e-06
-4.78159e-05
-8.34855e-05
-0.000111699
-0.000133833
-0.000151162
-0.000164754
-0.000175447
-0.000183853
-0.000190395
-0.000195359
-0.000198954
-0.000201345
-0.000202687
-0.000203125
-0.000202796
-0.000201819
-0.000200298
-0.000198318
-0.000195955
-0.00019327
-0.000190318
-0.000187146
-0.000183799
-0.00018031
-0.000176715
-0.000173038
-0.000169307
-0.000165539
-0.000161755
-0.000157968
-0.000154195
-0.000150444
-0.000146729
-0.000143055
-0.000139435
-0.00013587
-0.00013237
-0.000128936
-0.000125577
-0.00012229
-0.000119084
-0.000115954
-0.000112909
-0.000109943
-0.000107062
-0.000104261
-0.000101546
-9.89072e-05
-9.63546e-05
-9.38743e-05
-9.14786e-05
-8.91497e-05
-8.69026e-05
-8.47153e-05
-8.26054e-05
-8.05488e-05
-7.85626e-05
-7.66219e-05
-7.47439e-05
-7.2901e-05
-7.11152e-05
-6.93488e-05
-6.76323e-05
-6.59222e-05
-6.42486e-05
-6.25702e-05
-6.09108e-05
-5.92301e-05
-5.75587e-05
-5.58399e-05
-5.41135e-05
-5.23235e-05
-5.05009e-05
-4.85892e-05
-4.66247e-05
-4.45423e-05
-4.23803e-05
-4.00713e-05
-3.76477e-05
-3.50474e-05
-3.23051e-05
-2.93429e-05
-2.62002e-05
-2.28199e-05
-1.92259e-05
-1.53544e-05
-1.12686e-05
-6.92681e-06
-2.37847e-06
0.000579458
0.000544309
0.000500379
0.000447711
0.000387553
0.000322116
0.000254256
0.000187091
0.000123549
6.59429e-05
1.56887e-05
-2.67572e-05
-6.17323e-05
-9.00812e-05
-0.000112854
-0.000131087
-0.000145688
-0.00015739
-0.000166751
-0.000174179
-0.000179966
-0.00018433
-0.000187445
-0.000189468
-0.000190543
-0.000190808
-0.000190383
-0.000189376
-0.000187875
-0.000185959
-0.000183691
-0.000181132
-0.000178327
-0.000175324
-0.000172159
-0.000168868
-0.000165478
-0.000162017
-0.000158504
-0.000154963
-0.000151406
-0.000147851
-0.000144308
-0.000140792
-0.000137307
-0.000133867
-0.000130475
-0.000127141
-0.000123865
-0.000120657
-0.000117515
-0.000114448
-0.000111452
-0.000108534
-0.00010569
-0.000102927
-0.000100238
-9.76302e-05
-9.50951e-05
-9.26411e-05
-9.02559e-05
-8.79505e-05
-8.57092e-05
-8.35447e-05
-8.14381e-05
-7.94042e-05
-7.7422e-05
-7.55054e-05
-7.36339e-05
-7.18196e-05
-7.00416e-05
-6.83145e-05
-6.66093e-05
-6.49477e-05
-6.32958e-05
-6.16743e-05
-6.00523e-05
-5.84429e-05
-5.68183e-05
-5.51963e-05
-5.35345e-05
-5.18582e-05
-5.01278e-05
-4.83581e-05
-4.65103e-05
-4.46039e-05
-4.25922e-05
-4.04958e-05
-3.82681e-05
-3.5921e-05
-3.34159e-05
-3.07673e-05
-2.79197e-05
-2.4893e-05
-2.16564e-05
-1.82123e-05
-1.45218e-05
-1.06329e-05
-6.52537e-06
-2.22634e-06
0.00053148
0.000499489
0.000460242
0.000413858
0.000361349
0.000304426
0.00024527
0.000186272
0.000129739
7.75971e-05
3.11684e-05
-8.93132e-06
-4.27311e-05
-7.07348e-05
-9.36983e-05
-0.00011244
-0.000127712
-0.000140149
-0.000150251
-0.000158397
-0.000164872
-0.000169895
-0.000173643
-0.000176273
-0.000177926
-0.000178738
-0.000178827
-0.000178302
-0.000177255
-0.000175766
-0.000173901
-0.00017172
-0.000169273
-0.000166607
-0.000163761
-0.00016077
-0.000157665
-0.000154474
-0.000151218
-0.000147921
-0.000144596
-0.000141263
-0.000137931
-0.000134617
-0.000131326
-0.000128071
-0.000124856
-0.000121691
-0.000118579
-0.000115527
-0.000112535
-0.000109611
-0.000106753
-0.000103968
-0.000101251
-9.86094e-05
-9.60378e-05
-9.35421e-05
-9.11151e-05
-8.8764e-05
-8.64786e-05
-8.42677e-05
-8.21186e-05
-8.00407e-05
-7.80191e-05
-7.6065e-05
-7.41614e-05
-7.23183e-05
-7.05198e-05
-6.87734e-05
-6.70639e-05
-6.53995e-05
-6.37589e-05
-6.21564e-05
-6.05659e-05
-5.90008e-05
-5.74382e-05
-5.58834e-05
-5.43182e-05
-5.27501e-05
-5.11481e-05
-4.95275e-05
-4.78598e-05
-4.61483e-05
-4.43675e-05
-4.25258e-05
-4.05878e-05
-3.85637e-05
-3.64207e-05
-3.4158e-05
-3.17519e-05
-2.9205e-05
-2.64758e-05
-2.35747e-05
-2.04857e-05
-1.71998e-05
-1.36934e-05
-1.00084e-05
-6.13362e-06
-2.08413e-06
0.000486877
0.000457839
0.000422784
0.000381881
0.000335958
0.000286349
0.000234724
0.000182926
0.000132771
8.5838e-05
4.33044e-05
5.83872e-06
-2.63922e-05
-5.36332e-05
-7.63903e-05
-9.52802e-05
-0.000110912
-0.000123821
-0.000134448
-0.000143137
-0.000150158
-0.000155723
-0.000160006
-0.000163161
-0.000165324
-0.000166627
-0.000167186
-0.000167108
-0.000166485
-0.000165398
-0.000163915
-0.000162096
-0.000159994
-0.000157656
-0.000155121
-0.000152426
-0.000149603
-0.00014668
-0.00014368
-0.000140627
-0.000137535
-0.000134426
-0.000131308
-0.000128199
-0.000125105
-0.000122039
-0.000119005
-0.000116015
-0.00011307
-0.000110179
-0.000107341
-0.000104566
-0.000101851
-9.92029e-05
-9.66185e-05
-9.41033e-05
-9.16539e-05
-8.9275e-05
-8.6961e-05
-8.47174e-05
-8.25363e-05
-8.04245e-05
-7.83719e-05
-7.63852e-05
-7.44529e-05
-7.2583e-05
-7.07621e-05
-6.89968e-05
-6.72751e-05
-6.56007e-05
-6.39636e-05
-6.23662e-05
-6.07937e-05
-5.92547e-05
-5.77292e-05
-5.62251e-05
-5.47252e-05
-5.32296e-05
-5.17271e-05
-5.02181e-05
-4.86791e-05
-4.71194e-05
-4.55179e-05
-4.38704e-05
-4.216e-05
-4.03889e-05
-3.85291e-05
-3.65838e-05
-3.45293e-05
-3.23583e-05
-3.00562e-05
-2.76186e-05
-2.50123e-05
-2.22451e-05
-1.93088e-05
-1.6188e-05
-1.28693e-05
-9.39289e-06
-5.74949e-06
-1.94817e-06
0.000445181
0.000418906
0.000387622
0.000351542
0.000311339
0.000268047
0.000222956
0.000177497
0.000133104
9.10648e-05
5.23932e-05
1.77426e-05
-1.2613e-05
-3.8737e-05
-6.0936e-05
-7.965e-05
-9.53521e-05
-0.000108484
-0.000119424
-0.000128481
-0.0001359
-0.000141882
-0.000146595
-0.000150185
-0.000152785
-0.000154517
-0.000155495
-0.000155822
-0.000155588
-0.000154874
-0.000153749
-0.000152274
-0.000150501
-0.000148478
-0.000146244
-0.000143839
-0.000141292
-0.000138634
-0.000135888
-0.000133078
-0.000130221
-0.000127336
-0.000124435
-0.000121533
-0.000118639
-0.000115765
-0.000112917
-0.000110105
-0.000107332
-0.000104606
-0.000101928
-9.93065e-05
-9.67391e-05
-9.42331e-05
-9.17858e-05
-8.9402e-05
-8.70798e-05
-8.48225e-05
-8.26262e-05
-8.04951e-05
-7.84229e-05
-7.64151e-05
-7.44635e-05
-7.25726e-05
-7.0734e-05
-6.89528e-05
-6.72188e-05
-6.55359e-05
-6.3895e-05
-6.22973e-05
-6.07362e-05
-5.92106e-05
-5.77099e-05
-5.62389e-05
-5.47819e-05
-5.33436e-05
-5.19099e-05
-5.04785e-05
-4.90423e-05
-4.75974e-05
-4.61251e-05
-4.46316e-05
-4.31001e-05
-4.15225e-05
-3.98866e-05
-3.81918e-05
-3.64146e-05
-3.45552e-05
-3.25936e-05
-3.05209e-05
-2.83285e-05
-2.60074e-05
-2.35293e-05
-2.09034e-05
-1.81253e-05
-1.51756e-05
-1.20483e-05
-8.78369e-06
-5.37084e-06
-1.81603e-06
0.000405981
0.000382284
0.000354433
0.000322651
0.000287459
0.000249651
0.000210239
0.000170355
0.000131142
9.36472e-05
5.87262e-05
2.69774e-05
-1.28207e-06
-2.60009e-05
-4.73365e-05
-6.55821e-05
-8.10887e-05
-9.42079e-05
-0.000105256
-0.000114502
-0.000122167
-0.000128437
-0.000133468
-0.000137399
-0.000140353
-0.000142446
-0.000143785
-0.000144469
-0.000144585
-0.000144213
-0.000143419
-0.000142264
-0.000140802
-0.000139079
-0.000137135
-0.000135009
-0.000132733
-0.000130335
-0.00012784
-0.000125273
-0.000122649
-0.000119989
-0.000117306
-0.000114614
-0.000111923
-0.000109245
-0.000106586
-0.000103956
-0.000101359
-9.88026e-05
-9.62888e-05
-9.38252e-05
-9.14106e-05
-8.90515e-05
-8.67464e-05
-8.4499e-05
-8.2309e-05
-8.01783e-05
-7.81047e-05
-7.60909e-05
-7.41326e-05
-7.22335e-05
-7.03876e-05
-6.85974e-05
-6.68569e-05
-6.51693e-05
-6.35264e-05
-6.19306e-05
-6.03748e-05
-5.88585e-05
-5.73774e-05
-5.59281e-05
-5.45033e-05
-5.3105e-05
-5.17205e-05
-5.03527e-05
-4.89891e-05
-4.76268e-05
-4.62611e-05
-4.48849e-05
-4.34839e-05
-4.20619e-05
-4.06044e-05
-3.9102e-05
-3.7546e-05
-3.59331e-05
-3.42431e-05
-3.2476e-05
-3.06131e-05
-2.8645e-05
-2.6568e-05
-2.43701e-05
-2.20267e-05
-1.95489e-05
-1.69341e-05
-1.41608e-05
-1.12292e-05
-8.17897e-06
-4.99591e-06
-1.68579e-06
0.000368869
0.000347586
0.000322948
0.000295065
0.000264301
0.000231282
0.000196825
0.000161846
0.000127272
9.39562e-05
6.26129e-05
3.37671e-05
7.7375e-06
-1.53606e-05
-3.55817e-05
-5.31042e-05
-6.81743e-05
-8.10607e-05
-9.202e-05
-0.000101281
-0.00010904
-0.000115463
-0.000120695
-0.000124863
-0.000128083
-0.000130461
-0.000132098
-0.000133085
-0.000133505
-0.000133435
-0.00013294
-0.000132079
-0.000130905
-0.000129465
-0.000127797
-0.00012594
-0.000123925
-0.000121781
-0.000119533
-0.000117205
-0.000114814
-0.000112379
-0.000109915
-0.000107434
-0.000104948
-0.000102469
-0.000100002
-9.75583e-05
-9.51417e-05
-9.276e-05
-9.0415e-05
-8.81144e-05
-8.58575e-05
-8.36505e-05
-8.14925e-05
-7.93869e-05
-7.73342e-05
-7.53352e-05
-7.33893e-05
-7.14981e-05
-6.96586e-05
-6.78735e-05
-6.61379e-05
-6.44535e-05
-6.28159e-05
-6.12267e-05
-5.96796e-05
-5.81756e-05
-5.67092e-05
-5.52793e-05
-5.38825e-05
-5.25141e-05
-5.11696e-05
-4.98488e-05
-4.8541e-05
-4.72484e-05
-4.59593e-05
-4.4671e-05
-4.33802e-05
-4.20776e-05
-4.07523e-05
-3.94075e-05
-3.80287e-05
-3.66066e-05
-3.51359e-05
-3.3611e-05
-3.20136e-05
-3.03444e-05
-2.85863e-05
-2.673e-05
-2.47741e-05
-2.27054e-05
-2.05033e-05
-1.81806e-05
-1.57341e-05
-1.31418e-05
-1.04107e-05
-7.57742e-06
-4.62379e-06
-1.55623e-06
0.000326599
0.000308214
0.000287269
0.000263629
0.000237564
0.000209579
0.000180324
0.000150519
0.000120898
9.21304e-05
6.47876e-05
3.93071e-05
1.59843e-05
-5.02896e-06
-2.37074e-05
-4.01282e-05
-5.44372e-05
-6.68168e-05
-7.74583e-05
-8.6544e-05
-9.42384e-05
-0.000100687
-0.000106017
-0.000110342
-0.000113767
-0.000116388
-0.000118293
-0.000119568
-0.000120289
-0.000120526
-0.000120342
-0.000119794
-0.000118932
-0.000117801
-0.00011644
-0.000114885
-0.000113167
-0.000111315
-0.000109353
-0.000107304
-0.000105186
-0.000103017
-0.000100811
-9.85836e-05
-9.63438e-05
-9.41028e-05
-9.1869e-05
-8.96506e-05
-8.74532e-05
-8.52837e-05
-8.31447e-05
-8.10435e-05
-7.89801e-05
-7.69599e-05
-7.49829e-05
-7.30518e-05
-7.11686e-05
-6.93326e-05
-6.75447e-05
-6.58053e-05
-6.41131e-05
-6.24698e-05
-6.08713e-05
-5.93187e-05
-5.78092e-05
-5.63431e-05
-5.49155e-05
-5.35266e-05
-5.21719e-05
-5.08505e-05
-4.95595e-05
-4.82932e-05
-4.70492e-05
-4.58263e-05
-4.46154e-05
-4.34177e-05
-4.22226e-05
-4.10283e-05
-3.98322e-05
-3.8623e-05
-3.73937e-05
-3.61466e-05
-3.48679e-05
-3.35479e-05
-3.21845e-05
-3.07712e-05
-2.92917e-05
-2.77457e-05
-2.61187e-05
-2.4404e-05
-2.26002e-05
-2.06916e-05
-1.86651e-05
-1.65353e-05
-1.42954e-05
-1.1923e-05
-9.43554e-06
-6.86396e-06
-4.18411e-06
-1.40429e-06
0.000280025
0.000264659
0.000247391
0.000228083
0.000206834
0.000183979
0.000160013
0.000135498
0.000110997
8.70235e-05
6.40173e-05
4.23253e-05
2.22008e-05
3.80221e-06
-1.27992e-05
-2.76084e-05
-4.06895e-05
-5.2147e-05
-6.21067e-05
-7.07007e-05
-7.80573e-05
-8.4295e-05
-8.95215e-05
-9.38345e-05
-9.73231e-05
-0.000100071
-0.000102154
-0.000103647
-0.000104616
-0.000105125
-0.000105231
-0.000104986
-0.000104436
-0.000103624
-0.000102586
-0.000101357
-9.99644e-05
-9.8437e-05
-9.67973e-05
-9.5067e-05
-9.32638e-05
-9.14049e-05
-8.95045e-05
-8.75755e-05
-8.56289e-05
-8.36744e-05
-8.17207e-05
-7.97756e-05
-7.78447e-05
-7.59346e-05
-7.4048e-05
-7.2192e-05
-7.0367e-05
-6.8578e-05
-6.68252e-05
-6.51113e-05
-6.34388e-05
-6.18063e-05
-6.02157e-05
-5.86668e-05
-5.71591e-05
-5.56942e-05
-5.4268e-05
-5.28819e-05
-5.15337e-05
-5.02234e-05
-4.89471e-05
-4.77043e-05
-4.64917e-05
-4.53083e-05
-4.41517e-05
-4.30163e-05
-4.19007e-05
-4.08028e-05
-3.97163e-05
-3.86408e-05
-3.7566e-05
-3.64932e-05
-3.54188e-05
-3.43301e-05
-3.32249e-05
-3.21038e-05
-3.09536e-05
-2.97666e-05
-2.8541e-05
-2.72707e-05
-2.59433e-05
-2.45562e-05
-2.30955e-05
-2.1561e-05
-1.99515e-05
-1.82453e-05
-1.64381e-05
-1.45492e-05
-1.25651e-05
-1.04629e-05
-8.272e-06
-6.01614e-06
-3.66387e-06
-1.22738e-06
0.000232845
0.000220515
0.000206858
0.000191598
0.000174756
0.000156574
0.000137436
0.000117781
9.80426e-05
7.86125e-05
5.98229e-05
4.19405e-05
2.51686e-05
9.64818e-06
-4.5364e-06
-1.73536e-05
-2.88161e-05
-3.89722e-05
-4.78946e-05
-5.567e-05
-6.23908e-05
-6.81475e-05
-7.30264e-05
-7.71074e-05
-8.04643e-05
-8.31661e-05
-8.52769e-05
-8.68583e-05
-8.79668e-05
-8.86563e-05
-8.89759e-05
-8.89716e-05
-8.86846e-05
-8.81527e-05
-8.7409e-05
-8.64841e-05
-8.54044e-05
-8.4195e-05
-8.28766e-05
-8.1469e-05
-7.99888e-05
-7.84515e-05
-7.68707e-05
-7.52578e-05
-7.36235e-05
-7.19766e-05
-7.03254e-05
-6.86771e-05
-6.70369e-05
-6.54111e-05
-6.38025e-05
-6.22175e-05
-6.06566e-05
-5.91245e-05
-5.76217e-05
-5.61507e-05
-5.4714e-05
-5.331e-05
-5.19413e-05
-5.06072e-05
-4.93078e-05
-4.80445e-05
-4.68134e-05
-4.56166e-05
-4.44519e-05
-4.33188e-05
-4.22148e-05
-4.1139e-05
-4.00888e-05
-3.90638e-05
-3.8061e-05
-3.70759e-05
-3.61084e-05
-3.51547e-05
-3.42112e-05
-3.3277e-05
-3.23419e-05
-3.14096e-05
-3.04758e-05
-2.95273e-05
-2.85662e-05
-2.75915e-05
-2.65898e-05
-2.55572e-05
-2.44922e-05
-2.33872e-05
-2.22344e-05
-2.1031e-05
-1.97629e-05
-1.84341e-05
-1.70442e-05
-1.55695e-05
-1.40112e-05
-1.23902e-05
-1.06888e-05
-8.88726e-06
-7.02125e-06
-5.1054e-06
-3.10607e-06
-1.03955e-06
0.00018501
0.000175537
0.000165201
0.000153655
0.000140848
0.000126953
0.000112267
9.71308e-05
8.18745e-05
6.67904e-05
5.21233e-05
3.80686e-05
2.47775e-05
1.23608e-05
8.94021e-07
-9.58078e-06
-1.90508e-05
-2.75293e-05
-3.5051e-05
-4.16658e-05
-4.74336e-05
-5.24178e-05
-5.66826e-05
-6.0289e-05
-6.32949e-05
-6.57547e-05
-6.77191e-05
-6.92368e-05
-7.03526e-05
-7.11097e-05
-7.15482e-05
-7.17057e-05
-7.16167e-05
-7.13128e-05
-7.08221e-05
-7.01709e-05
-6.93817e-05
-6.8476e-05
-6.74715e-05
-6.63853e-05
-6.5232e-05
-6.40247e-05
-6.27756e-05
-6.14943e-05
-6.01904e-05
-5.88716e-05
-5.75454e-05
-5.62178e-05
-5.48936e-05
-5.35783e-05
-5.22746e-05
-5.09881e-05
-4.9719e-05
-4.84718e-05
-4.7247e-05
-4.60471e-05
-4.48739e-05
-4.37259e-05
-4.26064e-05
-4.1514e-05
-4.04498e-05
-3.94141e-05
-3.84037e-05
-3.74213e-05
-3.6465e-05
-3.55337e-05
-3.46256e-05
-3.37403e-05
-3.28758e-05
-3.20318e-05
-3.12053e-05
-3.03925e-05
-2.95949e-05
-2.8808e-05
-2.80287e-05
-2.72567e-05
-2.6484e-05
-2.57142e-05
-2.49419e-05
-2.41563e-05
-2.33623e-05
-2.25569e-05
-2.17274e-05
-2.08728e-05
-1.99935e-05
-1.90809e-05
-1.8128e-05
-1.71341e-05
-1.60896e-05
-1.49966e-05
-1.38524e-05
-1.26403e-05
-1.1366e-05
-1.00424e-05
-8.65098e-06
-7.18317e-06
-5.6737e-06
-4.12272e-06
-2.50356e-06
-8.39342e-07
0.00013586
0.000129128
0.000121825
0.000113659
0.000104575
9.4688e-05
8.42079e-05
7.33778e-05
6.24339e-05
5.1583e-05
4.09947e-05
3.08019e-05
2.11071e-05
1.19867e-05
3.49648e-06
-4.32677e-06
-1.14631e-05
-1.79091e-05
-2.36764e-05
-2.87887e-05
-3.32804e-05
-3.71907e-05
-4.05627e-05
-4.34387e-05
-4.586e-05
-4.78663e-05
-4.94942e-05
-5.07793e-05
-5.1754e-05
-5.24502e-05
-5.28971e-05
-5.31232e-05
-5.31545e-05
-5.30149e-05
-5.27261e-05
-5.23087e-05
-5.17801e-05
-5.11572e-05
-5.04536e-05
-4.96829e-05
-4.88563e-05
-4.79846e-05
-4.70771e-05
-4.61412e-05
-4.5185e-05
-4.42143e-05
-4.32356e-05
-4.22531e-05
-4.12708e-05
-4.02933e-05
-3.93227e-05
-3.8364e-05
-3.74164e-05
-3.64841e-05
-3.55674e-05
-3.46689e-05
-3.37896e-05
-3.2928e-05
-3.20872e-05
-3.12662e-05
-3.04664e-05
-2.9687e-05
-2.89259e-05
-2.8186e-05
-2.74653e-05
-2.67631e-05
-2.60776e-05
-2.54089e-05
-2.47562e-05
-2.41187e-05
-2.34937e-05
-2.28782e-05
-2.22746e-05
-2.16794e-05
-2.10893e-05
-2.05029e-05
-1.99173e-05
-1.93354e-05
-1.87485e-05
-1.81512e-05
-1.75502e-05
-1.69394e-05
-1.63092e-05
-1.56602e-05
-1.49935e-05
-1.4303e-05
-1.35805e-05
-1.28251e-05
-1.2036e-05
-1.12133e-05
-1.03468e-05
-9.42961e-06
-8.47557e-06
-7.48438e-06
-6.43517e-06
-5.33508e-06
-4.2154e-06
-3.05888e-06
-1.84955e-06
-6.24913e-07
8.44116e-05
8.0337e-05
7.58605e-05
7.08746e-05
6.53521e-05
5.93503e-05
5.29851e-05
4.63979e-05
3.97303e-05
3.31077e-05
2.66321e-05
2.03812e-05
1.44143e-05
8.77526e-06
3.49719e-06
-1.3963e-06
-5.88943e-06
-9.97488e-06
-1.36539e-05
-1.69351e-05
-1.98349e-05
-2.23736e-05
-2.45754e-05
-2.64648e-05
-2.80668e-05
-2.94055e-05
-3.05036e-05
-3.13828e-05
-3.20628e-05
-3.25635e-05
-3.29026e-05
-3.30982e-05
-3.31665e-05
-3.31226e-05
-3.29805e-05
-3.27533e-05
-3.24524e-05
-3.20889e-05
-3.16712e-05
-3.12084e-05
-3.07077e-05
-3.01763e-05
-2.96203e-05
-2.9044e-05
-2.84535e-05
-2.78518e-05
-2.7244e-05
-2.66326e-05
-2.60198e-05
-2.54092e-05
-2.4802e-05
-2.42018e-05
-2.36077e-05
-2.30226e-05
-2.24466e-05
-2.1882e-05
-2.1329e-05
-2.07865e-05
-2.0257e-05
-1.97393e-05
-1.92356e-05
-1.87438e-05
-1.8263e-05
-1.7796e-05
-1.73407e-05
-1.68973e-05
-1.64637e-05
-1.60402e-05
-1.56275e-05
-1.52242e-05
-1.48283e-05
-1.44381e-05
-1.40555e-05
-1.36784e-05
-1.33047e-05
-1.29316e-05
-1.25593e-05
-1.21919e-05
-1.18184e-05
-1.14376e-05
-1.10573e-05
-1.06694e-05
-1.02682e-05
-9.85594e-06
-9.43227e-06
-8.99443e-06
-8.53641e-06
-8.05512e-06
-7.55453e-06
-7.03679e-06
-6.4871e-06
-5.90356e-06
-5.30434e-06
-4.68334e-06
-4.01852e-06
-3.32467e-06
-2.62819e-06
-1.90377e-06
-1.13771e-06
-3.58133e-07
2.88475e-05
2.74812e-05
2.59962e-05
2.43224e-05
2.24548e-05
2.04221e-05
1.82671e-05
1.60371e-05
1.3778e-05
1.1532e-05
9.33332e-06
7.20817e-06
5.17604e-06
3.25106e-06
1.44421e-06
-2.36594e-07
-1.78539e-06
-3.1989e-06
-4.47642e-06
-5.61982e-06
-6.63367e-06
-7.52404e-06
-8.29875e-06
-8.96569e-06
-9.53335e-06
-1.00098e-05
-1.04028e-05
-1.07198e-05
-1.09673e-05
-1.11522e-05
-1.12805e-05
-1.13585e-05
-1.13915e-05
-1.1385e-05
-1.13437e-05
-1.12723e-05
-1.11747e-05
-1.10549e-05
-1.09156e-05
-1.07603e-05
-1.05914e-05
-1.04113e-05
-1.02224e-05
-1.0026e-05
-9.82447e-06
-9.61861e-06
-9.41048e-06
-9.20077e-06
-8.99038e-06
-8.78051e-06
-8.57168e-06
-8.36517e-06
-8.1605e-06
-7.95896e-06
-7.76024e-06
-7.56564e-06
-7.37486e-06
-7.18753e-06
-7.00476e-06
-6.82575e-06
-6.65195e-06
-6.48194e-06
-6.31567e-06
-6.15425e-06
-5.99668e-06
-5.84339e-06
-5.69332e-06
-5.54668e-06
-5.40381e-06
-5.26426e-06
-5.12707e-06
-4.99184e-06
-4.85927e-06
-4.72848e-06
-4.59928e-06
-4.46962e-06
-4.34024e-06
-4.2134e-06
-4.08368e-06
-3.9511e-06
-3.81954e-06
-3.68498e-06
-3.5456e-06
-3.40248e-06
-3.25548e-06
-3.10365e-06
-2.94501e-06
-2.77778e-06
-2.60391e-06
-2.42539e-06
-2.23516e-06
-2.03196e-06
-1.82538e-06
-1.61215e-06
-1.38171e-06
-1.14142e-06
-9.02819e-07
-6.53405e-07
-3.88815e-07
-1.24991e-07
0.000490965
0.000473295
0.000500455
0.000529691
0.000582672
0.000628139
0.000698369
0.000764553
0.000862452
0.000962976
0.00110951
0.00127493
0.00151878
0.00181342
0.00221237
0.000488768
0.000473571
0.00049971
0.000529511
0.000580525
0.000627375
0.000694396
0.000763187
0.000855644
0.000960276
0.00109644
0.00126434
0.0014775
0.00173757
0.00197677
0.000485613
0.000474239
0.000498121
0.00052904
0.000576873
0.000625752
0.000689034
0.000759956
0.000847361
0.000952906
0.0010797
0.00123961
0.00142029
0.00162263
0.00176525
0.000482014
0.000474464
0.000496059
0.000527548
0.000572661
0.000622671
0.00068311
0.000754285
0.000837888
0.000940406
0.00105879
0.00120241
0.00135366
0.00150264
0.00159244
0.000477817
0.000473967
0.000493565
0.000525068
0.000567907
0.00061807
0.000676384
0.000746216
0.000826459
0.000923396
0.00103271
0.00115731
0.00128187
0.00139046
0.00144824
0.000473009
0.000472574
0.000490631
0.000521593
0.00056252
0.000611973
0.000668499
0.000735911
0.000812532
0.00090246
0.00100151
0.00110774
0.00120855
0.00128763
0.00132201
0.000467674
0.000470128
0.000487172
0.000517109
0.000556364
0.000604421
0.000659175
0.000723453
0.000795878
0.000878042
0.000966163
0.00105565
0.00113599
0.00119282
0.00120914
0.000461848
0.000466528
0.000483009
0.000511626
0.000549284
0.000595471
0.000648213
0.000708898
0.000776489
0.000850624
0.000927779
0.00100232
0.00106526
0.00110466
0.00110745
0.000455508
0.000461741
0.000477946
0.000505144
0.000541147
0.000585153
0.000635497
0.000692288
0.00075454
0.000820693
0.000887284
0.000948585
0.000996866
0.00102247
0.00101552
0.000448589
0.000455788
0.000471825
0.000497623
0.000531849
0.000573459
0.000621
0.00067368
0.000730306
0.000788698
0.000845402
0.000895069
0.000931104
0.000945897
0.000932195
0.000440996
0.000448701
0.000464535
0.000488989
0.000521316
0.000560363
0.000604761
0.000653168
0.000704083
0.000755056
0.000802698
0.000842239
0.000868167
0.000874624
0.000856415
0.000432627
0.000440501
0.000456002
0.000479158
0.000509485
0.00054584
0.000586852
0.000630883
0.000676158
0.000720144
0.00075962
0.00079045
0.000808148
0.000808292
0.000787232
0.00042338
0.000431187
0.00044619
0.000468049
0.00049631
0.000529877
0.000567359
0.000606985
0.000646801
0.000684306
0.000716526
0.000739959
0.000751045
0.000746497
0.000723802
0.000413157
0.000420738
0.000435081
0.0004556
0.000481753
0.000512479
0.000546378
0.000581646
0.000616265
0.000647841
0.000673702
0.000690936
0.000696779
0.000688825
0.000665393
0.000401876
0.000409119
0.000422658
0.00044177
0.000465787
0.00049366
0.000524
0.000555037
0.000584785
0.000611009
0.000631361
0.000643469
0.000645215
0.000634874
0.000611371
0.000389463
0.000396286
0.000408908
0.000426537
0.000448402
0.00047345
0.00050032
0.000527321
0.000552567
0.000574023
0.000589664
0.000597586
0.000596187
0.000584265
0.000561186
0.000375853
0.000382197
0.000393814
0.000409895
0.000429605
0.000451886
0.000475426
0.00049864
0.000519786
0.000537053
0.000548719
0.00055327
0.000549513
0.000536649
0.000514355
0.000360991
0.000366812
0.000377361
0.000391848
0.000409413
0.000429015
0.000449401
0.000469114
0.000486582
0.000500219
0.000508584
0.000510475
0.000505012
0.000491699
0.000470449
0.000344826
0.000350096
0.000359541
0.000372409
0.000387859
0.000404887
0.000422321
0.000438841
0.000453053
0.000463591
0.000469266
0.000469122
0.000462506
0.00044912
0.000429077
0.000327316
0.000332025
0.000340352
0.000351603
0.000364988
0.000379564
0.000394261
0.000407897
0.00041926
0.000427189
0.00043071
0.000429075
0.000421798
0.00040867
0.000389876
0.000304846
0.000308902
0.000315913
0.00032528
0.000336296
0.000348127
0.000359829
0.000370395
0.000378811
0.000384144
0.000385638
0.000382753
0.00037518
0.000362803
0.000345551
0.000275421
0.00027873
0.000284248
0.000291502
0.000299921
0.000308817
0.00031742
0.000324917
0.000330506
0.000333495
0.000333337
0.000329636
0.000322161
0.000310848
0.000295862
0.000240761
0.00024332
0.000247384
0.000252613
0.000258589
0.000264797
0.000270648
0.000275522
0.000278834
0.000280097
0.000278917
0.000275012
0.000268226
0.000258521
0.000245946
0.000200056
0.000201903
0.000204642
0.000208063
0.000211898
0.000215799
0.000219361
0.000222157
0.000223805
0.00022397
0.000222373
0.000218809
0.000213144
0.000205307
0.000195283
0.000152491
0.000153702
0.000155335
0.000157283
0.000159407
0.000161508
0.000163347
0.000164682
0.000165272
0.000164897
0.000163363
0.000160521
0.000156264
0.000150522
0.000143248
9.72946e-05
9.79718e-05
9.87734e-05
9.96637e-05
0.000100595
0.00010148
0.000102217
0.000102684
0.00010275
0.000102287
0.000101174
9.93136e-05
9.66375e-05
9.31175e-05
8.8775e-05
3.38672e-05
3.4095e-05
3.43173e-05
3.45383e-05
3.47606e-05
3.49673e-05
3.51297e-05
3.52107e-05
3.51697e-05
3.49672e-05
3.45647e-05
3.39318e-05
3.30421e-05
3.18688e-05
3.03727e-05
)
;
boundaryField
{
top
{
type fixedValue;
value uniform 0;
}
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
plate
{
type zeroGradient;
}
symmBound
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"cagri.metin.ege@gmail.com"
] | cagri.metin.ege@gmail.com | |
2af5fe08de2ac00de8db35065405f775f46efa96 | 0ba03e9dbe5bab3768ea850270a1e3d2fad98d16 | /Source/File.cpp | c4bd2ec01873672e9087ace25535835fb8ccc61d | [] | no_license | Mr-Jingles/BlitzFTP-CLI | c440fd0660bebb602ac383511ba0798d31b0b018 | fb8076b89a70d71f62375d0d51a7d44a5bf8dcda | refs/heads/master | 2021-06-05T18:22:43.656649 | 2016-08-31T06:02:10 | 2016-08-31T06:02:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,734 | cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: File.cpp
* Author: Edward
*
* Created on 08 March 2016, 01:49
*/
#include "../Header/File.h"
int CURRENT_BLOCK_NUMBER;
string FILE_PATH;
File::File()
{
//initilize variables on construction
CURRENT_BLOCK_NUMBER = 0;
FILE_PATH = "";
//-----------debugging------------------
cout << "\nFile Object Created\n";
//----------debugging-------------------
}
File::~File()
{
//--------debugging------------------
cout << "\nFile Object Deleted\n";
//-----------------------------------
}
int File::SetFileData(string PathToFile)
{
FILE_PATH = PathToFile;
//current block number needs to be set
//using the method set block number
ifstream inputstream(PathToFile.c_str(), ifstream::in);
string FileData = "";
for (int counter = CURRENT_BLOCK_NUMBER; counter < 512 + CURRENT_BLOCK_NUMBER;
counter++)
{
for (int counter = 0; counter < 512 * CURRENT_BLOCK_NUMBER; counter++)
{
//read and discard all data up until the
//correct block is reached
string temp = "";
getline(inputstream, temp);
}
//get 512 bytes of data to send
getline(inputstream, FileData);
}
if (inputstream.is_open() == true)
inputstream.close();
return 0;
}
void File::setCurrentBlockNumber(int newBlockNumber)
{
CURRENT_BLOCK_NUMBER = newBlockNumber;
}
int File::getCurrentBlockNumber()
{
return CURRENT_BLOCK_NUMBER;
}
string File::getCurrentFilePath()
{
return FILE_PATH;
} | [
"Edward.Collins@live.co.uk"
] | Edward.Collins@live.co.uk |
330517be27a6b0e1749fb8d07016c8d3437b3813 | 726cf6a267312666a32a5b92de7343a51a8bd90f | /game_v3_lb3/LIve/Things/Things.h | 9fef5396cf08774dbd1206bec396e185de9b902b | [] | no_license | Sergei4302/BAZA | 9137b7e62384ec824ae742f3db4f3a6adac7901b | f1d9978154db25e5e927158c421fdc0db21a106d | refs/heads/master | 2022-02-07T05:24:27.387388 | 2021-12-27T07:24:40 | 2021-12-27T07:24:40 | 237,601,129 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 292 | h | //
// Created by cergey on 01.12.2021.
//
#include "../InterfaceUnit/LiveType.h"
#include "../PLAYER.h"
#ifndef UNTITLED3_THINGS_H
#define UNTITLED3_THINGS_H
class Things : public Object{
public:
virtual ~Things()=default;
virtual bool IsAvailable();
};
#endif //UNTITLED3_THINGS_H
| [
"tikhon4302@gmail.com"
] | tikhon4302@gmail.com |
7d2108a115bbdb41bc084c1c5f7e76a10d5f1960 | 436b97887f6b62c751a8861b6b17068c92d1ecf5 | /CODE/4-开发板程序/开发板增加实验程序/6-5110液晶显示/2-DS18B20在5110温度显示/main.cpp | 82183695287c58cf1a6a50423085061acc4e0c6d | [] | no_license | Edragon/MSP430 | 4e57eda1407bbf6bfdc83b637e4803f7dcecd8a6 | f5df247df778e6a395488fa505b53d525e2ae16f | refs/heads/main | 2023-02-01T10:27:52.540147 | 2020-12-04T15:18:43 | 2020-12-04T15:18:43 | 317,265,706 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 13,831 | cpp | #include <msp430x14x.h>
#include <math.h>
#define CPU_F ((double)1000000)
#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0))
#define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0))
#define uchar unsigned char
#define uint unsignded int
#define res1 P4OUT|=BIT6; //复位,0复位
#define res0 P4OUT&=~BIT6;
#define sce1 P4OUT|=BIT5; //片选
#define sce0 P4OUT&=~BIT5; //片选
#define dc1 P4OUT|=BIT4; //1写数据,0写指令
#define dc0 P4OUT&=~BIT4;
#define sdin1 P4OUT|=BIT3; //数据
#define sdin0 P4OUT&=~BIT3;
#define sclk1 P4OUT|=BIT2; //时钟
#define sclk0 P4OUT&=~BIT2;
#define DQ1 P1OUT|= 0x40 //DS18B20接口为P1.6口
#define DQ0 P1OUT&=~0x40
float Temper;
unsigned int a,b,c;
unsigned char Error=0;
unsigned int i=9,j=4,k=0,l=3,m=4,n=1,p=1;//声明数据类型
unsigned char zimu[]={
/*-- 文字: 0 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0xF8,0x04,0x04,0x04,0xF8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,
/*-- 文字: 1 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x00,0x08,0xFC,0x00,0x00,0x00,0x00,0x02,0x03,0x02,0x00,0x00,
/*-- 文字: 2 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x18,0x84,0x44,0x24,0x18,0x00,0x03,0x02,0x02,0x02,0x02,0x00,
/*-- 文字: 3 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x08,0x04,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,
/*-- 文字: 4 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x40,0xB0,0x88,0xFC,0x80,0x00,0x00,0x00,0x00,0x03,0x02,0x00,
/*-- 文字: 5 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x3C,0x24,0x24,0x24,0xC4,0x00,0x01,0x02,0x02,0x02,0x01,0x00,
/*-- 文字: 6 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0xF8,0x24,0x24,0x2C,0xC0,0x00,0x01,0x02,0x02,0x02,0x01,0x00,
/*-- 文字: 7 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x0C,0x04,0xE4,0x1C,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,
/*-- 文字: 8 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0xD8,0x24,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,
/*-- 文字: 9 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x38,0x44,0x44,0x44,0xF8,0x00,0x00,0x03,0x02,0x02,0x01,0x00,
/*-- 文字: : --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
/*-- 文字: --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: . --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,
/*-- 文字: --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0x00,0x00,0x1C,0x22,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=6x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=6x16 --*/
0xC0,0x20,0x20,0x40,0x00,0x00,0x03,0x04,0x04,0x02,0x00,0x00,
};
void weishu(float k)
{
int q=k;
a=q/10;
b=q%10;
float p=k-a*10-b;
c=p*10;
}
unsigned char hanzi[]=
{
/*-- 文字: 温 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=12x16 --*/
0x89,0x72,0x00,0xC0,0x5F,0xD5,0x55,0xD5,0x55,0xDF,0x00,0x00,0x07,0x00,0x04,0x07,
0x04,0x07,0x04,0x07,0x04,0x07,0x04,0x00,
/*-- 文字: 度 --*/
/*-- 宋体9; 此字体下对应的点阵为:宽x高=12x12 --*/
/*-- 高度不是8的倍数,现调整为:宽度x高度=12x16 --*/
0x00,0xFE,0x0A,0x8A,0xBE,0xAA,0xAB,0xAA,0xBE,0x0A,0x0A,0x00,0x06,0x01,0x04,0x04,
0x04,0x03,0x02,0x03,0x04,0x04,0x04,0x00,
};
/*--------------------------------------------
LCD_write_byte: 使用SPI接口写数据到LCD
输入参数:dt:写入的数据;
command :写数据/命令选择;
编写日期:20080918
----------------------------------------------*/
void LCD_write_byte(unsigned char dt, unsigned char command)
{
unsigned char i;
sce0;
if(command==1)
{dc1; }
else {dc0;}
for(i=0;i<8;i++)
{
if(dt&0x80)
{sdin1;}
else
{sdin0;}
dt=dt<<1;
sclk0;
sclk1;
}
dc1;
sce1;
sdin1;
}
/*---------------------------------------
LCD_init: 3310LCD初始化
编写日期:20080918
----------------------------------------- */
void LCD_init(void)
{
res0;
delay_ms(1);
res1;
LCD_write_byte(0x21,0);//初始化Lcd,功能设定使用扩充指令
LCD_write_byte(0xd0,0);//设定液晶偏置电压
LCD_write_byte(0x20,0);//使用基本指令
LCD_write_byte(0x0C,0);//设定显示模式,正常显示
}
/*-------------------------------------------
LCD_set_XY: 设置LCD坐标函数
输入参数:X:0-83 Y:0-5
编写日期:20080918
---------------------------------------------*/
void LCD_set_XY(unsigned char X, unsigned char Y)
{
LCD_write_byte(0x40 | Y, 0);// column
LCD_write_byte(0x80 | X, 0);// row
}
/*------------------------------------------
LCD_clear: LCD清屏函数
编写日期:20080918
--------------------------------------------*/
void LCD_clear(void)
{
unsigned char t;
unsigned char k;
LCD_set_XY(0,0);
for(t=0;t<6;t++)
{
for(k=0;k<84;k++)
{
LCD_write_byte(0x00,1);
}
}
}
/*---------------------------------------------
LCD_write_shu: 显示8(宽)*16(高)点阵列数字字母符号等半角类
输入参数:c:显示的字符;
编写日期:20080918
-----------------------------------------------*/
void LCD_write_shu(unsigned char row, unsigned char page,unsigned char c) //row:列 page:页 dd:字符
{
unsigned char i;
LCD_set_XY(row*6, page);// 列,页
for(i=0; i<6;i++)
{
LCD_write_byte(zimu[c*12+i],1);
}
LCD_set_XY(row*6, page+1);// 列,页
for(i=6; i<12;i++)
{
LCD_write_byte(zimu[c*12+i],1);
}
}
/*---------------------------------------------
LCD_write_hanzi: 显示12(宽)*16(高)点阵列汉字等半角类
输入参数:c:显示的字符;
编写日期:20080918
-----------------------------------------------*/
void LCD_write_hanzi(unsigned char row, unsigned char page,unsigned char c) //row:列 page:页 dd:字符
{
unsigned char i;
LCD_set_XY(row*6, page);// 列,页
for(i=0; i<12;i++)
{
LCD_write_byte(hanzi[c*24+i],1);
}
LCD_set_XY(row*6, page+1);// 列,页
for(i=12; i<24;i++)
{
LCD_write_byte(hanzi[c*24+i],1);
}
}
//=======================================================================================
//============功能:写18B20 =============================================================
//=======================================================================================
void Write_18B20(unsigned char n)
{
unsigned char i;
for(i=0;i<8;i++)
{
P1DIR|=0X40;
DQ0;
_NOP();_NOP(); //==延时5us===
_NOP();_NOP();_NOP();
if((n&0X01)==0X01)
DQ1;
else DQ0;
n=n>>1;
delay_us(60); //==延时50us 以上===
DQ1;
}
}
//=======================================================================================
//============功能:读取18B20 ===========================================================
//=======================================================================================
unsigned char Read_18B20(void)
{
unsigned char i;
unsigned char temp;
for(i=0;i<8;i++)
{
temp=temp>>1;
P1DIR|=0X40;
DQ0;
_NOP(); //==延时1us===
DQ1;
_NOP();_NOP(); //==延时5us===
_NOP();_NOP();_NOP();
P1DIR&=~0x40;
if((P1IN&0x40)==0)
{
temp=temp&0x7F;
}else
{
temp=temp|0x80;
}
delay_us(45); //==延时40us===
P1DIR|=0x40;
DQ1;
}
return temp;
}
//=======================================================================================
//============DS18B20的初始化 ==========================================================
//=======================================================================================
void Init (void)
{
P1DIR|=0X40;
DQ0;
delay_us(600); //==延时500us=================
DQ1;
delay_us(50); //==延时16~60us==============
P1DIR&=~0x40;
if((P1IN&0x40)==0x40) //==0001 1111b=1f ===========
{
Error=1; //==失败1=====================
P1DIR|=0x40;
DQ0;
}else
{
Error=0; //==初始化成功================
P1DIR|=0x40;
DQ1;
delay_us(500);
}
}
//=======================================================================================
//======指令描述:跳过ROM命令,指定代码为CCH,忽略64位ROM地址,直接向DS1820发温度变换命令,===
// 适用于单片机工作.
//=======================================================================================
void Skip(void)
{
Write_18B20(0xcc);
}
//=======================================================================================
//========== 指令描述:温度转换命令,指定代码为44H.启动DS1820进行温度转换,12位转换时最长===
// 为750ms(9位为93.75ms).结果存入内部9字节RAM中.
//=======================================================================================
void Convert (void)
{
Write_18B20(0x44);
}
//=======================================================================================
//================指令描述:读暂存器,指定代码为BEH.读内部RAM中9字节的内容.================
//=======================================================================================
void ReadDo (void)
{
Write_18B20(0xbe);
}
//=======================================================================================
void ReadTemp (void)
{
char temp_low,temp_high; //== 温度值 =====
unsigned int temperature;
temp_low=Read_18B20(); //== 读低位 =====
temp_high=Read_18B20(); //== 读高位 =====
temperature=(temp_high&0x0f); //=== 屏蔽高4位==
temperature<<=8; //=== 将temp_high部分数据移到temperature高8位===
temperature|=temp_low; //=== 将高低两字节内部合并成一个16位数据===
Temper=temperature*0.0625; //=== 计算真实温度值===
}
//=======================================================================================
//============获取DS18B20的温度值========================================================
//=======================================================================================
//=== MCU对DS18B20进行温度转换时,其操作必须满足以下过程:
//=== 1- 每一次读写之前都要对DS18B20进行复位.
//=== 2- 完成复位后发送一条ROM命令到DS18B20.
//=== 3- 最后发送一条RAM命令到DS18B20.
void GetTemp(void)
{
Init(); //=== DS1820初始化===
Skip(); //=== 跳过64位ROM(ROM命令)===
Convert(); //=== 转换(RAM命令)===
// delay_ms(300); //=== 60000x5us=0.3s===
Init(); //=== DS1820初始化===
Skip(); //=== 跳过64位ROM===
ReadDo(); //=== 读暂存器===
ReadTemp(); //=== 读取温度值===
}
main()
{
WDTCTL = WDTPW + WDTHOLD;
// DCOCTL=CALDCO_1MHZ;
// BCSCTL1=CALBC1_1MHZ;
P4DIR=0XFF;
res0;
delay_us(100);
res1;
LCD_init(); //初始化LCD模块
LCD_clear(); //清屏幕
LCD_write_shu(0,2,11);
LCD_write_shu(1,2,11);
LCD_write_hanzi(2,2,0);//温
LCD_write_hanzi(4,2,1);//度
LCD_write_shu(6,2,11);
LCD_write_shu(7,2,11);
LCD_write_shu(8,2,0);
LCD_write_shu(9,2,0);
LCD_write_shu(10,2,12);
LCD_write_shu(11,2,0);
LCD_write_shu(12,2,13);
LCD_write_shu(13,2,14);
while(1)
{
GetTemp();
weishu(Temper);
LCD_write_shu(8,2,a);
LCD_write_shu(9,2,b);
LCD_write_shu(11,2,c);
}
}
| [
"hechaogm@gmail.com"
] | hechaogm@gmail.com |
aaee4046da35d73a146452a2394fcaf3c4129af1 | dcede2ae6b5bce21a30dc7578672f52be005df63 | /Dialog_ModifyPassWd.h | 5e12df7deb664af3a03b3cc3412054fc1a851700 | [] | no_license | weichangzhi/lddoa | d4edc0029f3fa48c158497f22f6f8eb3de5e4b0b | 7c059e532ad088fb2d36c4b69c6d17092a55e93a | refs/heads/master | 2021-01-01T19:51:03.024989 | 2014-09-22T15:57:39 | 2014-09-22T15:57:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,459 | h | #if !defined(AFX_DIALOG_MODIFYPASSWD_H__D106B839_8A39_4A71_B5D4_595DA2E03B45__INCLUDED_)
#define AFX_DIALOG_MODIFYPASSWD_H__D106B839_8A39_4A71_B5D4_595DA2E03B45__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Dialog_ModifyPassWd.h : header file
//
#include "XPButton.h"
/////////////////////////////////////////////////////////////////////////////
// CDialog_ModifyPassWd dialog
class CDialog_ModifyPassWd : public CDialog
{
// Construction
public:
CDialog_ModifyPassWd(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDialog_ModifyPassWd)
enum { IDD = IDD_DIALOG_MODIFY_PASSWD };
CXPButton m_btnOK;
CXPButton m_btnCANCEL;
CString m_new_passwd;
CString m_new_passwd2;
CString m_passwd;
CString m_user;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialog_ModifyPassWd)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDialog_ModifyPassWd)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOG_MODIFYPASSWD_H__D106B839_8A39_4A71_B5D4_595DA2E03B45__INCLUDED_)
| [
"414607680@qq.com"
] | 414607680@qq.com |
3c2869a4eed2b64773d71bad0bf4acfce4e82035 | 4c3c52528493da55ca6281f5a033db073dbd283a | /app/native/include/png++/color.hpp | b5ffde2c4ee9986b8d6bb0950263f8e1ac4ebfe8 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | Touched/JiggleMap | 9b5a99e422fcc44c61bb89cd346d7a5e42410f03 | b82dccfdc7d8ba509ff9e029f87c4b12c73c90de | refs/heads/master | 2022-12-10T18:50:40.171949 | 2017-06-10T15:11:36 | 2017-06-10T18:22:25 | 91,897,479 | 14 | 3 | MIT | 2022-12-06T21:01:23 | 2017-05-20T15:17:42 | C++ | UTF-8 | C++ | false | false | 2,296 | hpp | /*
* Copyright (C) 2007,2008 Alex Shulgin
*
* This file is part of png++ the C++ wrapper for libpng. PNG++ is free
* software; the exact copying conditions are as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PNGPP_COLOR_HPP_INCLUDED
#define PNGPP_COLOR_HPP_INCLUDED
#include "types.hpp"
namespace png
{
/**
* \brief PNG color struct extension. Adds constructors.
*/
struct color
: png_color
{
explicit color(byte r = 0, byte g = 0, byte b = 0)
{
this->red = r;
this->green = g;
this->blue = b;
}
/**
* \brief Initializes color with a copy of png_color object.
*/
color(png_color const& other)
{
this->red = other.red;
this->green = other.green;
this->blue = other.blue;
}
};
} // namespace png
#endif // PNGPP_COLOR_HPP_INCLUDED
| [
"jtouched@gmail.com"
] | jtouched@gmail.com |
7f2a6c4f753fc6ad87baed071ba4c3d13f61b046 | bd802006327c330167c74f1e214dab5f1598a6ba | /include/Block.h | 973d5f1daa9d5ee97e3d15f615cd15929c022b65 | [] | no_license | akash-punna/BlockodokuConsoleGame | 7cb5961a3c21dbc8268e876bd6e27477fb391413 | 73ec0b2f517d41091a38852f068cf2dbc76d9e99 | refs/heads/main | 2023-02-28T06:02:26.141535 | 2021-02-06T16:53:13 | 2021-02-06T16:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,776 | h | #ifndef BLOCK_H
#define BLOCK_H
#include<iostream>
#include <vector>
#include <utility> // for pair
using namespace std;
class Block {
private:
int x, y; // coordinates on the grid
protected:
vector<vector<char>> shape;
public:
void set_position(int x, int y) {
this -> x = x;
this -> y = y;
}
pair<int, int> get_position() {
return make_pair(x, y);
}
vector<vector<char>> get_shape() {
return shape;
}
void display();
};
void Block :: display() {
for(auto row : shape) {
for(char ch : row) {
cout << ch << " ";
}
cout << endl;
}
}
/**
===============================
Blocks used are:
1. Single
2. Two horizontal, aka call it hor_bar
3. Two vertical, aka it ver_bar
4. 4 blocks square, aka square
5. L shaped, aka l
6. Mirror of L ,aka mirror_l
7. Inverted T shaped - 3 blocks horizontally + 1 block above the middle one, aka inv_t
8. T shaped - 3 blocks horizontally + 1 block below the middle one, aka t
9. Weird Z block, aka z
===============================
**/
class Block_single: public Block {
public:
Block_single() {
set_shape();
}
void set_shape() {
shape.push_back({'o'});
}
};
class Block_hor_bar: public Block {
public:
Block_hor_bar() {
set_shape();
}
void set_shape() {
shape.push_back({'o', 'o', 'o'});
}
};
class Block_ver_bar: public Block {
public:
Block_ver_bar() {
set_shape();
}
void set_shape() {
shape.push_back({'o'});
shape.push_back({'o'});
shape.push_back({'o'});
}
};
class Block_square: public Block {
public:
Block_square() {
set_shape();
}
void set_shape() {
shape.push_back({'o', 'o'});
shape.push_back({'o', 'o'});
}
};
class Block_l: public Block {
public:
Block_l() {
set_shape();
}
void set_shape() {
shape.push_back({'o'});
shape.push_back({'o', 'o'});
}
};
class Block_mirror_l: public Block {
public:
Block_mirror_l() {
set_shape();
}
void set_shape() {
shape.push_back({' ' , 'o'});
shape.push_back({'o', 'o'});
}
};
class Block_inv_t: public Block {
public:
Block_inv_t() {
set_shape();
}
void set_shape() {
shape.push_back({' ' , 'o'});
shape.push_back({'o', 'o', 'o'});
}
};
class Block_t: public Block {
public:
Block_t() {
set_shape();
}
void set_shape() {
shape.push_back({'o', 'o', 'o'});
shape.push_back({' ' , 'o'});
}
};
class Block_z: public Block {
public:
Block_z() {
set_shape();
}
void set_shape() {
shape.push_back({'o', 'o'});
shape.push_back({' ' , 'o'});
shape.push_back({' ' , 'o', 'o'});
}
};
// utility functions -----------
Block* get_block() {
Block* b;
int c = rand() % 9;
switch(c) {
case 0:
b = new Block_single;
break;
case 1:
b = new Block_hor_bar;
break;
case 2:
b = new Block_ver_bar;
break;
case 3:
b = new Block_l;
break;
case 4:
b = new Block_mirror_l;
break;
case 5:
b = new Block_square;
break;
case 6:
b = new Block_t;
break;
case 7:
b = new Block_inv_t;
break;
case 8:
b = new Block_z;
break;
}
return b;
}
void display_blocks(Block* b1, Block* b2, Block* b3) {
cout << "1." << endl;
b1 -> display();
cout << endl << endl;
cout << "2." << endl;
b2 -> display();
cout << endl << endl;
cout << "3." << endl;
b3 -> display();
cout << endl;
}
#endif // BLOCK_H
| [
"52968975+khssupriya@users.noreply.github.com"
] | 52968975+khssupriya@users.noreply.github.com |
ece0b4e0eb0634c8cb94d2ed604e21db718c5e47 | 6f2b6e9d77fc4dd5e1dae8ba6e5a66eb7c7ae849 | /sstd_boost/sstd/boost/fusion/include/iterator_range.hpp | 30b48ef2bbc1971bfbafa730d40d396c5df42b19 | [
"BSL-1.0"
] | permissive | KqSMea8/sstd_library | 9e4e622e1b01bed5de7322c2682539400d13dd58 | 0fcb815f50d538517e70a788914da7fbbe786ce1 | refs/heads/master | 2020-05-03T21:07:01.650034 | 2019-04-01T00:10:47 | 2019-04-01T00:10:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 556 | hpp | /*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_INCLUDE_ITERATOR_RANGE)
#define FUSION_INCLUDE_ITERATOR_RANGE
#include <sstd/boost/fusion/support/config.hpp>
#include <sstd/boost/fusion/view/iterator_range.hpp>
#endif
| [
"zhaixueqiang@hotmail.com"
] | zhaixueqiang@hotmail.com |
5c98767b4e96ad056ec24c01132c18d1c8a6edd9 | 06465dcc5555b938f6fe4505eb3eaa0e806b6666 | /src_2_8/HolodeckGui/LogListView.h | a40682cbe00805fb077deeaee477f876f3734a82 | [
"MIT"
] | permissive | michaelolson01/Holodeck | c94413b69c0ff355736a8df51e924f2f4733493e | 54b97675a73b668f8eec8d9c8a8c7733e1a53db3 | refs/heads/master | 2022-05-10T01:37:09.187095 | 2017-11-16T23:23:10 | 2017-11-16T23:23:10 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 4,356 | h | //*************************************************************************
// Copyright (C) Security Innovation, LLC, 2002-2003 – All Rights Reserved.
//
// FILE: LogListView.h
//
// DESCRIPTION: Contains definition for the class LogListView
//
//=========================================================================
// Modification History
//
// Date SCR Name Purpose
// ----------- --- ----------- ------------------------------------------
// 13 Mar 2003 B. Shirey File created.
//*************************************************************************
#pragma once
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#include <stdio.h>
#include "FilterListView.h"
#include "TimeStampFilterForm.h"
#include "GenericListFilterForm.h"
#include "FunctionsFilterForm.h"
#include "ParamFilterForm.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;
using namespace System::Windows::Forms;
namespace HolodeckGui
{
public __delegate void FilterUpdateDelegate();
//*********************************************************************
// defines the log panes' list view control
//*********************************************************************
public __gc class LogListView : public HolodeckGui::FilterListView
{
private:
ArrayList *allColumns;
ColumnHeader *timeStampHeader;
ColumnHeader *threadIDHeader;
ColumnHeader *categoryHeader;
ColumnHeader *dllHeader;
ColumnHeader *functionHeader;
ColumnHeader *returnValueHeader;
ColumnHeader *errorCodeHeader;
ColumnHeader *exceptionHeader;
ColumnHeader *parameterHeaders[];
FunctionDatabase::InterceptedFunctionDB * interceptedFunctionDB;
EventHandler *Filter_OKClick;
public:
LogListView();
~LogListView();
[Browsable(false)]
__property ArrayList *get_AllColumns() { return allColumns; }
[Browsable(false)]
__property ColumnHeader *get_TimeStampHeader() { return timeStampHeader; }
[Browsable(false)]
__property ColumnHeader *get_ThreadIDHeader() { return threadIDHeader; }
[Browsable(false)]
__property ColumnHeader *get_CategoryHeader() { return categoryHeader; }
[Browsable(false)]
__property ColumnHeader *get_DllHeader() { return dllHeader; }
[Browsable(false)]
__property ColumnHeader *get_FunctionHeader() { return functionHeader; }
[Browsable(false)]
__property ColumnHeader *get_ReturnValueHeader() { return returnValueHeader; }
[Browsable(false)]
__property ColumnHeader *get_ErrorCodeHeader() { return errorCodeHeader; }
[Browsable(false)]
__property ColumnHeader *get_ExceptionHeader() { return exceptionHeader; }
ColumnHeader *GetParameterHeader(int paramIndex) { return parameterHeaders[paramIndex]; }
void customfilter_TimeStamp(System::Object * sender, EventArgs * e);
void customfilter_ThreadID(System::Object * sender, EventArgs * e);
void customfilter_Category(System::Object * sender, EventArgs * e);
void customfilter_DLL(System::Object * sender, EventArgs * e);
void customfilter_Functions(System::Object * sender, EventArgs * e);
void customfilter_ReturnValue(System::Object * sender, EventArgs * e);
void customfilter_ErrorCode(System::Object * sender, EventArgs * e);
void customfilter_Exception(System::Object * sender, EventArgs * e);
void customfilter_Params(System::Object * sender, EventArgs * e);
void filter_OKClick(System::Object * sender, EventArgs * e);
void customfilter_ThreadID_RefreshValues(System::Object * sender, EventArgs * e);
void customfilter_ReturnValue_RefreshValues(System::Object * sender, EventArgs * e);
void customfilter_ErrorCode_RefreshValues(System::Object * sender, EventArgs *);
void customfilter_Exception_RefreshValues(System::Object * sender, EventArgs * e);
TimeStampFilterForm * timeStampFilterForm;
GenericListFilterForm * threadIDFilterForm;
GenericListFilterForm * categoryFilterForm;
GenericListFilterForm * dllFilterForm;
FunctionsFilterForm * functionsFilterForm;
GenericListFilterForm * returnValueFilterForm;
GenericListFilterForm * errorCodeFilterForm;
GenericListFilterForm * exceptionFilterForm;
ParamFilterForm * paramFilterForm;
FilterUpdateDelegate * OnFilterUpdate;
};
} | [
"joebasirico@gmail.com"
] | joebasirico@gmail.com |
877f734048e50b3623911a5a79aa97f1bfbb1346 | 3a7247e5382e028de6f06d4be35d5300fb08bf83 | /Rune Engine/Rune/Helper/RuHelper_EventManager.h | da8f1296acc85d199703f2bc5791a14f8b5bb19c | [] | no_license | g91/RomLibraries | 8c68cfabe6a68dad7937941a9ec90c3948588a85 | 55a98a86057500527e208a6fd593397839465384 | refs/heads/main | 2023-05-14T07:03:34.253295 | 2021-06-08T07:44:44 | 2021-06-08T07:44:44 | 356,100,453 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,583 | h | /*!
@project Rune
@file RuHelper_EventManager.h
Copyright (c) 2004-2006 All rights reserved
@author John Tang
@date 2006/10/30
*/
#ifndef _RUHELPER_EVENTMANAGER_H_
#define _RUHELPER_EVENTMANAGER_H_
#include "../Scene/Base/RuEntityBase.h"
#include "../Rune.h"
#include "../Rune Engine Audio.h"
#pragma unmanaged
// ************************************************************************************************************************************************************
class CRuGlobalEventManager_Sample
{
protected:
struct SoundEventDescriptor
{
CRuArrayList<PTRVALUE> m_soundHandles; //!< List of active sound handles for the sprite
};
CRuGUID m_GUID; //!< GUID used for internal event registration
CRuEntity_Container_Impl* m_controllerFrame; //!< Frame that contains all controllers
CRuFusion_AudioLibrary* m_audioLibrary;
CRuCamera* m_camera;
CRuHashMap<PTRVALUE, SoundEventDescriptor *>* m_soundEvents; //!< Hash of active sound events
// Sound volume levels
REAL m_masterSoundLevel;
REAL m_ambientSoundLevel;
REAL m_musicSoundLevel;
REAL m_soundFXSoundLevel;
REAL m_uiSoundLevel;
REAL m_musicFrequency;
// Settings
BOOL m_enableSoundFX;
BOOL m_enableMusic;
// Zone & triggers
INT32 m_timeGroup;
CRuWorld_ZoneSettings* m_zoneSettings;
CRuWorld_Trigger* m_musicTrigger;
CRuWorld_Trigger* m_ambienceTrigger;
CRuWorld_Trigger* m_supplementAmbienceTrigger;
CRuWorld_Trigger* m_randomAmbienceTrigger;
CRuArrayList<CRuWorld_Trigger *> m_3DAmbienceTriggers;
CRuHashMap<CRuGUID, CRuWorld_Trigger *>* m_3DAmbienceTriggerHash;
CRuTernaryStringTree<CRuWorld_Trigger *> m_3DAmbienceGroupTriggers;
CRuHashMap<CRuGUID, PTRVALUE>* m_active3DAmbienceSounds;
CRuArrayList<CRuGUID> m_deleted3DAmbienceTriggers;
// Persistent sound handles
PTRVALUE m_musicSoundHandle;
PTRVALUE m_ambientSoundHandle;
PTRVALUE m_supplementAmbientSoundHandle;
BOOL m_rerollMusic;
CRuString m_activeMusicName;
CRuString m_activeAmbienceName;
CRuString m_activeSupplementAmbienceName;
REAL m_timeToNextRandomAmbienceRoll;
REAL m_timeToNextMusicRoll;
public:
CRuGlobalEventManager_Sample();
virtual ~CRuGlobalEventManager_Sample();
void SetAudioLibrary(CRuFusion_AudioLibrary *audioLibrary);
void SetCamera(CRuCamera *camera);
void Update(REAL elapsedTime);
void RegisterEventHandlers(CRuEntity *entity, PTRVALUE userData);
// Event handlers
BOOL HandleEvent_Dispose(RuEventArgs *eventArgs);
BOOL HandleEvent_Trigger(RuEventArgs *eventArgs);
void StopSpriteSounds(void *sprite);
// Zone and trigger handling
void SetTimeGroup(INT32 timeGroup);
void SetZoneSettings(CRuWorld_ZoneSettings *zoneSettings);
void SetMusicTrigger(CRuWorld_Trigger *musicTrigger);
void SetAmbienceTrigger(CRuWorld_Trigger *ambienceTrigger);
void SetSupplementAmbienceTrigger(CRuWorld_Trigger *supplementAmbienceTrigger);
void SetRandomAmbienceTrigger(CRuWorld_Trigger *randomAmbienceTrigger);
// 3D ambience trigger handling
void AddRef3DAmbienceTriggers();
void Clear3DAmbienceTriggers();
CRuArrayList<CRuWorld_Trigger *>& Get3DAmbienceTriggers();
void Update3DAmbienceTriggers(REAL elapsedTime);
void StartActive3DAmbienceTriggers();
void UpdateActive3DAmbienceTriggers();
void Insert3DAmbienceGroupTriggers();
BOOL Insert3DAmbienceGroupTriggersCallback(const char *key, void *data);
void StopInactive3DAmbienceTriggers();
BOOL StopInactive3DAmbienceTriggersCallback(const void *key, void *data);
protected:
void PushSoundEvent(void *sprite, PTRVALUE soundHandle);
void ClearSoundEventQueue();
BOOL ClearSoundEventQueueCallback(const void *key, void *data);
// Event handlers
BOOL PlaybackFinishedHandler(RuEventArgs *eventArgs);
BOOL EngineSettingsChangedHandler(const char *settingName, const RuPropertyType &setting);
void GetSettingsFromEngine();
};
// ************************************************************************************************************************************************************
#pragma managed
#endif
| [
"domo@xc0r3.net"
] | domo@xc0r3.net |
4dc0eee2e977ab8df77265580793c3bf5505b308 | 4880587b0d629aee80a5a969c7373ee0cbf5bc25 | /src/core/modules/engine/eiface_engine_base.cpp | 8bbec55fd7a8fc868d2f0a293e1ba3d9ba627d6c | [] | no_license | aurorapar/Source.Python | a180dcb4a910502b5797f05a19e9f9c5bdf67e61 | b84df87f67ecb0fb2487e68e8b4b6bee3944f506 | refs/heads/master | 2022-10-08T15:42:24.758342 | 2013-09-20T19:07:16 | 2013-09-20T19:07:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,054 | cpp | /**
* =============================================================================
* Source Python
* Copyright (C) 2012 Source Python Development Team. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, the Source Python Team gives you permission
* to link the code of this program (as well as its derivative works) to
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, the Source.Python
* Development Team grants this exception to all derivative works.
*/
//---------------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------------
#include "eiface_engine_base.h"
#include "../../utility/sp_util.h"
//---------------------------------------------------------------------------------
// Globals
//---------------------------------------------------------------------------------
extern CGlobalVars *gpGlobals;
//---------------------------------------------------------------------------------
// Methods
//---------------------------------------------------------------------------------
KeyValues * CEngineServerImplementationBase::get_launch_options()
{
return NULL;
}
bool CEngineServerImplementationBase::is_userid_in_use( int userID )
{
for(int i = 1; i <= gpGlobals->maxClients; i++)
{
edict_t *pPlayer = PEntityOfEntIndex(i);
if( !pPlayer || pPlayer->IsFree() )
{
continue;
}
if (engine->GetPlayerUserId(pPlayer) == userID)
{
return true;
}
}
return false;
}
int CEngineServerImplementationBase::get_loading_progress_for_userid( int userID )
{
return 0;
}
bool CEngineServerImplementationBase::is_log_enabled()
{
return false;
}
ISpatialPartition * CEngineServerImplementationBase::create_spatial_partition( const CVector &worldmin, const CVector &worldmax )
{
return NULL;
}
float CEngineServerImplementationBase::get_timescale() const
{
return 1.0f;
}
bool CEngineServerImplementationBase::is_level_main_menu_background()
{
return false;
}
bool CEngineServerImplementationBase::is_any_client_low_violence()
{
return false;
}
bool CEngineServerImplementationBase::is_split_screen_player( int ent_index )
{
return false;
}
CEdict* CEngineServerImplementationBase::get_split_screen_player_attach_to_edict( int ent_num )
{
return NULL;
}
int CEngineServerImplementationBase::get_num_split_screen_users_attached_to_edict( int ent_num )
{
return 0;
}
CEdict* CEngineServerImplementationBase::get_split_screen_player_for_edict(int ent_num, int slot)
{
return NULL;
}
bool CEngineServerImplementationBase::is_override_load_game_ents_on()
{
return false;
}
void CEngineServerImplementationBase::force_flush_entity(int ent_index)
{
}
ISPSharedMemory * CEngineServerImplementationBase::get_single_player_shared_memory_space( const char *name, int ent_num )
{
return NULL;
}
void * CEngineServerImplementationBase::alloc_level_static_data( size_t bytes )
{
return NULL;
}
bool CEngineServerImplementationBase::is_creating_reslist()
{
return false;
}
bool CEngineServerImplementationBase::is_creating_xbox_reslist()
{
return false;
}
bool CEngineServerImplementationBase::is_dedicated_server_for_xbox()
{
return false;
}
bool CEngineServerImplementationBase::is_dedicated_server_for_ps3()
{
return false;
}
void CEngineServerImplementationBase::pause( bool bPause, bool bForce /*= false */ )
{
}
void CEngineServerImplementationBase::set_timescale( float flTimescale )
{
}
void CEngineServerImplementationBase::host_validate_session()
{
}
void CEngineServerImplementationBase::refresh_screen_if_necessary()
{
}
bool CEngineServerImplementationBase::has_paintmap()
{
return false;
}
bool CEngineServerImplementationBase::sphere_paint_surface( const model_t *pModel, const CVector & vPosition, unsigned char color, float flSphereRadius, float flPaintCoatPercent )
{
return false;
}
void CEngineServerImplementationBase::sphere_trace_paint_surface( const model_t *pModel, const CVector & vPosition, const CVector & vContactNormal, float flSphereRadius, CUtlVector<unsigned char> & surfColors )
{
}
void CEngineServerImplementationBase::remove_all_paint()
{
}
void CEngineServerImplementationBase::paint_all_surfaces( unsigned char color )
{
}
void CEngineServerImplementationBase::remove_paint( const model_t *pModel )
{
}
uint64 CEngineServerImplementationBase::get_client_xuid( CEdict* edict )
{
return 0;
}
bool CEngineServerImplementationBase::is_active_app()
{
return true;
}
void CEngineServerImplementationBase::set_no_clip_enabled( bool bEnabled )
{
}
void CEngineServerImplementationBase::get_paint_map_data_rle( CUtlVector<unsigned int> &mapdata )
{
}
void CEngineServerImplementationBase::load_paint_map_data_rle( CUtlVector<unsigned int> &mapdata )
{
}
void CEngineServerImplementationBase::send_paint_map_data_to_client( CEdict* edict )
{
}
float CEngineServerImplementationBase::get_latency_for_choreo_sounds()
{
return 0.0f;
}
int CEngineServerImplementationBase::get_client_cross_play_platform( int client_index )
{
return 0;
}
void CEngineServerImplementationBase::ensure_instance_baseline( int ent_num )
{
}
bool CEngineServerImplementationBase::reserver_server_for_queued_game( const char *szReservationPayload )
{
return false;
}
| [
"satoon101@gmail.com"
] | satoon101@gmail.com |
b248bcd2cc8b1eeaf1af25310cea7483bf7556cd | b87b1ea4da844298c21ec8a413c012993dedfb18 | /lib/gcc/arm-linux-gnueabihf/8.3.0/plugin/include/auto-host.h | a3f9dfb1fa5f5248dcc8215c6e58802d866bca9b | [
"MIT"
] | permissive | a-DelaCruz/cross-pi-gcc | 6cee489acac028c371a2e52eb905f1a0a56dc9f3 | 50cbcef613e45fcedc412da8077be9fc08ccb661 | refs/heads/master | 2020-05-02T20:11:57.609452 | 2019-03-30T14:36:17 | 2019-03-30T14:36:17 | 178,183,470 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 53,871 | h | /* auto-host.h. Generated from config.in by configure. */
/* config.in. Generated from configure.ac by autoheader. */
/* Define if this compiler should be built as the offload target compiler. */
#ifndef USED_FOR_TARGET
/* #undef ACCEL_COMPILER */
#endif
/* Define if building universal (internal helper macro) */
#ifndef USED_FOR_TARGET
/* #undef AC_APPLE_UNIVERSAL_BUILD */
#endif
/* Define to the assembler option to enable compressed debug sections. */
#ifndef USED_FOR_TARGET
#define AS_COMPRESS_DEBUG_OPTION "--compress-debug-sections"
#endif
/* Define to the assembler option to disable compressed debug sections. */
#ifndef USED_FOR_TARGET
#define AS_NO_COMPRESS_DEBUG_OPTION "--nocompress-debug-sections"
#endif
/* Define as the number of bits in a byte, if `limits.h' doesn't. */
#ifndef USED_FOR_TARGET
/* #undef CHAR_BIT */
#endif
/* Define to 0/1 if you want more run-time sanity checks. This one gets a grab
bag of miscellaneous but relatively cheap checks. */
#ifndef USED_FOR_TARGET
#define CHECKING_P 0
#endif
/* Define 0/1 to force the choice for exception handling model. */
#ifndef USED_FOR_TARGET
#define CONFIG_SJLJ_EXCEPTIONS 0
#endif
/* Define to enable the use of a default assembler. */
#ifndef USED_FOR_TARGET
/* #undef DEFAULT_ASSEMBLER */
#endif
/* Define to enable the use of a default linker. */
#ifndef USED_FOR_TARGET
/* #undef DEFAULT_LINKER */
#endif
/* Define if you want to use __cxa_atexit, rather than atexit, to register C++
destructors for local statics and global objects. This is essential for
fully standards-compliant handling of destructors, but requires
__cxa_atexit in libc. */
#ifndef USED_FOR_TARGET
#define DEFAULT_USE_CXA_ATEXIT 2
#endif
/* The default for -fdiagnostics-color option */
#ifndef USED_FOR_TARGET
#define DIAGNOSTICS_COLOR_DEFAULT DIAGNOSTICS_COLOR_AUTO
#endif
/* Define if you want assertions enabled. This is a cheap check. */
#ifndef USED_FOR_TARGET
#define ENABLE_ASSERT_CHECKING 1
#endif
/* Define to 1 to specify that we are using the BID decimal floating point
format instead of DPD */
#ifndef USED_FOR_TARGET
#define ENABLE_DECIMAL_BID_FORMAT 0
#endif
/* Define to 1 to enable decimal float extension to C. */
#ifndef USED_FOR_TARGET
#define ENABLE_DECIMAL_FLOAT 0
#endif
/* Define if your target supports default PIE and it is enabled. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_DEFAULT_PIE */
#endif
/* Define if your target supports default stack protector and it is enabled.
*/
#ifndef USED_FOR_TARGET
/* #undef ENABLE_DEFAULT_SSP */
#endif
/* Define if you want more run-time sanity checks for dataflow. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_DF_CHECKING */
#endif
/* Define to 0/1 if you want extra run-time checking that might affect code
generation. */
#ifndef USED_FOR_TARGET
#define ENABLE_EXTRA_CHECKING 0
#endif
/* Define to 1 to enable fixed-point arithmetic extension to C. */
#ifndef USED_FOR_TARGET
#define ENABLE_FIXED_POINT 1
#endif
/* Define if you want fold checked that it never destructs its argument. This
is quite expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_FOLD_CHECKING */
#endif
/* Define if you want the garbage collector to operate in maximally paranoid
mode, validating the entire heap and collecting garbage at every
opportunity. This is extremely expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_GC_ALWAYS_COLLECT */
#endif
/* Define if you want the garbage collector to do object poisoning and other
memory allocation checks. This is quite expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_GC_CHECKING */
#endif
/* Define if you want operations on GIMPLE (the basic data structure of the
high-level optimizers) to be checked for dynamic type safety at runtime.
This is moderately expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_GIMPLE_CHECKING */
#endif
/* Define this to enable support for generating HSAIL. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_HSA */
#endif
/* Define if gcc should always pass --build-id to linker. */
#ifndef USED_FOR_TARGET
#define ENABLE_LD_BUILDID 1
#endif
/* Define to 1 to enable libquadmath support */
#ifndef USED_FOR_TARGET
#define ENABLE_LIBQUADMATH_SUPPORT 1
#endif
/* Define to enable LTO support. */
#ifndef USED_FOR_TARGET
#define ENABLE_LTO 1
#endif
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#ifndef USED_FOR_TARGET
#define ENABLE_NLS 1
#endif
/* Define this to enable support for offloading. */
#ifndef USED_FOR_TARGET
#define ENABLE_OFFLOADING 0
#endif
/* Define to enable plugin support. */
#ifndef USED_FOR_TARGET
#define ENABLE_PLUGIN 1
#endif
/* Define if you want all operations on RTL (the basic data structure of the
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_RTL_CHECKING */
#endif
/* Define if you want RTL flag accesses to be checked against the RTL codes
that are supported for each access macro. This is relatively cheap. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_RTL_FLAG_CHECKING */
#endif
/* Define if you want runtime assertions enabled. This is a cheap check. */
#define ENABLE_RUNTIME_CHECKING 1
/* Define if you want all operations on trees (the basic data structure of the
front ends) to be checked for dynamic type safety at runtime. This is
moderately expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_TREE_CHECKING */
#endif
/* Define if you want all gimple types to be verified after gimplifiation.
This is cheap. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_TYPES_CHECKING */
#endif
/* Define to get calls to the valgrind runtime enabled. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_VALGRIND_ANNOTATIONS */
#endif
/* Define if you want to run subprograms and generated programs through
valgrind (a memory checker). This is extremely expensive. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_VALGRIND_CHECKING */
#endif
/* Define 0/1 if vtable verification feature is enabled. */
#ifndef USED_FOR_TARGET
#define ENABLE_VTABLE_VERIFY 0
#endif
/* Define to 1 if installation paths should be looked up in the Windows
Registry. Ignored on non-Windows hosts. */
#ifndef USED_FOR_TARGET
/* #undef ENABLE_WIN32_REGISTRY */
#endif
/* Define to the name of a file containing a list of extra machine modes for
this architecture. */
#ifndef USED_FOR_TARGET
#define EXTRA_MODES_FILE "config/arm/arm-modes.def"
#endif
/* Define to enable detailed memory allocation stats gathering. */
#ifndef USED_FOR_TARGET
#define GATHER_STATISTICS 0
#endif
/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
#ifndef USED_FOR_TARGET
#define GWINSZ_IN_SYS_IOCTL 1
#endif
/* mcontext_t fields start with __ */
#ifndef USED_FOR_TARGET
/* #undef HAS_MCONTEXT_T_UNDERSCORES */
#endif
/* Define if your assembler supports architecture modifiers. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_ARCHITECTURE_MODIFIERS */
#endif
/* Define if your avr assembler supports -mgcc-isr option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_AVR_MGCCISR_OPTION */
#endif
/* Define if your avr assembler supports --mlink-relax option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_AVR_MLINK_RELAX_OPTION */
#endif
/* Define if your avr assembler supports -mrmw option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_AVR_MRMW_OPTION */
#endif
/* Define if your assembler supports cmpb. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_CMPB */
#endif
/* Define to the level of your assembler's compressed debug section support.
*/
#ifndef USED_FOR_TARGET
#define HAVE_AS_COMPRESS_DEBUG 2
#endif
/* Define if your assembler supports the DCI/ICI instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_DCI */
#endif
/* Define if your assembler supports the --debug-prefix-map option. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_DEBUG_PREFIX_MAP 1
#endif
/* Define if your assembler supports DFP instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_DFP */
#endif
/* Define if your assembler supports .module. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_DOT_MODULE */
#endif
/* Define if your assembler supports DSPR1 mult. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_DSPR1_MULT */
#endif
/* Define if your assembler supports .dtprelword. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_DTPRELWORD */
#endif
/* Define if your assembler supports dwarf2 .file/.loc directives, and
preserves file table indices exactly as given. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_DWARF2_DEBUG_LINE 1
#endif
/* Define if your assembler supports views in dwarf2 .loc directives. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_DWARF2_DEBUG_VIEW 1
#endif
/* Define if your assembler supports the R_PPC64_ENTRY relocation. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_ENTRY_MARKERS */
#endif
/* Define if your assembler supports explicit relocations. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_EXPLICIT_RELOCS */
#endif
/* Define if your assembler supports FMAF, HPC, and VIS 3.0 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_FMAF_HPC_VIS3 */
#endif
/* Define if your assembler supports fprnd. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_FPRND */
#endif
/* Define if your assembler supports the --gdwarf2 option. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_GDWARF2_DEBUG_FLAG 1
#endif
/* Define if your assembler supports .gnu_attribute. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_GNU_ATTRIBUTE */
#endif
/* Define true if the assembler supports '.long foo@GOTOFF'. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_GOTOFF_IN_DATA */
#endif
/* Define if your assembler supports the --gstabs option. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_GSTABS_DEBUG_FLAG 1
#endif
/* Define if your assembler supports the Sun syntax for cmov. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_CMOV_SUN_SYNTAX */
#endif
/* Define if your assembler supports the subtraction of symbols in different
sections. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_DIFF_SECT_DELTA */
#endif
/* Define if your assembler supports the ffreep mnemonic. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_FFREEP */
#endif
/* Define if your assembler uses fildq and fistq mnemonics. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_FILDQ */
#endif
/* Define if your assembler uses filds and fists mnemonics. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_FILDS */
#endif
/* Define 0/1 if your assembler and linker support @GOT. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_GOT32X */
#endif
/* Define if your assembler supports HLE prefixes. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_HLE */
#endif
/* Define if your assembler supports interunit movq mnemonic. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_INTERUNIT_MOVQ */
#endif
/* Define if your assembler supports the .quad directive. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_QUAD */
#endif
/* Define if the assembler supports 'rep <insn>, lock <insn>'. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_REP_LOCK_PREFIX */
#endif
/* Define if your assembler supports the sahf mnemonic in 64bit mode. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_SAHF */
#endif
/* Define if your assembler supports the swap suffix. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_SWAP */
#endif
/* Define if your assembler and linker support @tlsgdplt. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_TLSGDPLT */
#endif
/* Define to 1 if your assembler and linker support @tlsldm. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_TLSLDM */
#endif
/* Define to 1 if your assembler and linker support @tlsldmplt. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_TLSLDMPLT */
#endif
/* Define 0/1 if your assembler and linker support calling ___tls_get_addr via
GOT. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_TLS_GET_ADDR_GOT */
#endif
/* Define if your assembler supports the 'ud2' mnemonic. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_IX86_UD2 */
#endif
/* Define if your assembler supports the lituse_jsrdirect relocation. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_JSRDIRECT_RELOCS */
#endif
/* Define if your assembler supports .sleb128 and .uleb128. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_LEB128 1
#endif
/* Define if your assembler supports LEON instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_LEON */
#endif
/* Define if the assembler won't complain about a line such as # 0 "" 2. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_LINE_ZERO 1
#endif
/* Define if your assembler supports ltoffx and ldxmov relocations. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_LTOFFX_LDXMOV_RELOCS */
#endif
/* Define if your assembler supports LWSYNC instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_LWSYNC */
#endif
/* Define if your assembler supports the -mabi option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_MABI_OPTION */
#endif
/* Define if your assembler supports .machine and .machinemode. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_MACHINE_MACHINEMODE */
#endif
/* Define if your assembler supports mfcr field. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_MFCRF */
#endif
/* Define if your assembler supports mffgpr and mftgpr. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_MFPGPR */
#endif
/* Define if your Mac OS X assembler supports the -mmacos-version-min option.
*/
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_MMACOSX_VERSION_MIN_OPTION */
#endif
/* Define if the assembler understands -mnan=. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_NAN */
#endif
/* Define if your assembler supports the -no-mul-bug-abort option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION */
#endif
/* Define if the assembler understands -mno-shared. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_NO_SHARED */
#endif
/* Define if your assembler supports offsetable %lo(). */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_OFFSETABLE_LO10 */
#endif
/* Define if your assembler supports popcntb field. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_POPCNTB */
#endif
/* Define if your assembler supports POPCNTD instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_POPCNTD */
#endif
/* Define if your assembler supports POWER8 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_POWER8 */
#endif
/* Define if your assembler supports POWER9 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_POWER9 */
#endif
/* Define if your assembler supports .ref */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_REF */
#endif
/* Define if your assembler supports .register. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_REGISTER_PSEUDO_OP */
#endif
/* Define if your assembler supports R_PPC_REL16 relocs. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_REL16 */
#endif
/* Define if your assembler supports -relax option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_RELAX_OPTION */
#endif
/* Define if your assembler supports relocs needed by -fpic. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SMALL_PIC_RELOCS */
#endif
/* Define if your assembler supports SPARC4 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC4 */
#endif
/* Define if your assembler supports SPARC5 and VIS 4.0 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC5_VIS4 */
#endif
/* Define if your assembler supports SPARC6 instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC6 */
#endif
/* Define if your assembler and linker support GOTDATA_OP relocs. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC_GOTDATA_OP */
#endif
/* Define if your assembler and linker support unaligned PC relative relocs.
*/
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC_UA_PCREL */
#endif
/* Define if your assembler and linker support unaligned PC relative relocs
against hidden symbols. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_SPARC_UA_PCREL_HIDDEN */
#endif
/* Define if your assembler supports .stabs. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_STABS_DIRECTIVE 1
#endif
/* Define if your assembler and linker support thread-local storage. */
#ifndef USED_FOR_TARGET
#define HAVE_AS_TLS 1
#endif
/* Define if your assembler supports arg info for __tls_get_addr. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_TLS_MARKERS */
#endif
/* Define if your assembler supports VSX instructions. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_VSX */
#endif
/* Define if your assembler supports -xbrace_comment option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_AS_XBRACE_COMMENT_OPTION */
#endif
/* Define to 1 if you have the `atoq' function. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_ATOQ */
#endif
/* Define to 1 if you have the `clearerr_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_CLEARERR_UNLOCKED 1
#endif
/* Define to 1 if you have the `clock' function. */
#ifndef USED_FOR_TARGET
#define HAVE_CLOCK 1
#endif
/* Define if <time.h> defines clock_t. */
#ifndef USED_FOR_TARGET
#define HAVE_CLOCK_T 1
#endif
/* Define 0/1 if your assembler and linker support COMDAT groups. */
#ifndef USED_FOR_TARGET
#define HAVE_COMDAT_GROUP 1
#endif
/* Define to 1 if we found a declaration for 'abort', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ABORT 1
#endif
/* Define to 1 if we found a declaration for 'asprintf', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ASPRINTF 1
#endif
/* Define to 1 if we found a declaration for 'atof', otherwise define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ATOF 1
#endif
/* Define to 1 if we found a declaration for 'atol', otherwise define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ATOL 1
#endif
/* Define to 1 if we found a declaration for 'atoll', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ATOLL 1
#endif
/* Define to 1 if you have the declaration of `basename(const char*)', and to
0 if you don't. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_BASENAME 1
#endif
/* Define to 1 if we found a declaration for 'calloc', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_CALLOC 1
#endif
/* Define to 1 if we found a declaration for 'clearerr_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_CLEARERR_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'clock', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_CLOCK 1
#endif
/* Define to 1 if we found a declaration for 'errno', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_ERRNO 1
#endif
/* Define to 1 if we found a declaration for 'feof_unlocked', otherwise define
to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FEOF_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'ferror_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FERROR_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fflush_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FFLUSH_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'ffs', otherwise define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FFS 1
#endif
/* Define to 1 if we found a declaration for 'fgetc_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FGETC_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fgets_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FGETS_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fileno_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FILENO_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fprintf_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FPRINTF_UNLOCKED 0
#endif
/* Define to 1 if we found a declaration for 'fputc_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FPUTC_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fputs_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FPUTS_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'fread_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FREAD_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'free', otherwise define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FREE 1
#endif
/* Define to 1 if we found a declaration for 'fwrite_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_FWRITE_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'getchar_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETCHAR_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'getcwd', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETCWD 1
#endif
/* Define to 1 if we found a declaration for 'getc_unlocked', otherwise define
to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETC_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'getenv', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETENV 1
#endif
/* Define to 1 if we found a declaration for 'getopt', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETOPT 1
#endif
/* Define to 1 if we found a declaration for 'getpagesize', otherwise define
to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETPAGESIZE 1
#endif
/* Define to 1 if we found a declaration for 'getrlimit', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETRLIMIT 1
#endif
/* Define to 1 if we found a declaration for 'getrusage', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETRUSAGE 1
#endif
/* Define to 1 if we found a declaration for 'getwd', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_GETWD 1
#endif
/* Define to 1 if we found a declaration for 'ldgetname', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_LDGETNAME 0
#endif
/* Define to 1 if we found a declaration for 'madvise', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_MADVISE 1
#endif
/* Define to 1 if we found a declaration for 'malloc', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_MALLOC 1
#endif
/* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise
define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_PUTCHAR_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'putc_unlocked', otherwise define
to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_PUTC_UNLOCKED 1
#endif
/* Define to 1 if we found a declaration for 'realloc', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_REALLOC 1
#endif
/* Define to 1 if we found a declaration for 'sbrk', otherwise define to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_SBRK 1
#endif
/* Define to 1 if we found a declaration for 'setenv', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_SETENV 1
#endif
/* Define to 1 if we found a declaration for 'setrlimit', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_SETRLIMIT 1
#endif
/* Define to 1 if we found a declaration for 'sigaltstack', otherwise define
to 0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_SIGALTSTACK 1
#endif
/* Define to 1 if we found a declaration for 'snprintf', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_SNPRINTF 1
#endif
/* Define to 1 if we found a declaration for 'stpcpy', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STPCPY 1
#endif
/* Define to 1 if we found a declaration for 'strnlen', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRNLEN 1
#endif
/* Define to 1 if we found a declaration for 'strsignal', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRSIGNAL 1
#endif
/* Define to 1 if you have the declaration of `strstr(const char*,const
char*)', and to 0 if you don't. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRSTR 1
#endif
/* Define to 1 if we found a declaration for 'strtol', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRTOL 1
#endif
/* Define to 1 if we found a declaration for 'strtoll', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRTOLL 1
#endif
/* Define to 1 if we found a declaration for 'strtoul', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRTOUL 1
#endif
/* Define to 1 if we found a declaration for 'strtoull', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRTOULL 1
#endif
/* Define to 1 if we found a declaration for 'strverscmp', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_STRVERSCMP 1
#endif
/* Define to 1 if we found a declaration for 'times', otherwise define to 0.
*/
#ifndef USED_FOR_TARGET
#define HAVE_DECL_TIMES 1
#endif
/* Define to 1 if we found a declaration for 'unsetenv', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_UNSETENV 1
#endif
/* Define to 1 if we found a declaration for 'vasprintf', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_VASPRINTF 1
#endif
/* Define to 1 if we found a declaration for 'vsnprintf', otherwise define to
0. */
#ifndef USED_FOR_TARGET
#define HAVE_DECL_VSNPRINTF 1
#endif
/* Define to 1 if you have the <direct.h> header file. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_DIRECT_H */
#endif
/* Define to 1 if you have the <dlfcn.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_DLFCN_H 1
#endif
/* Define to 1 if you have the <ext/hash_map> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_EXT_HASH_MAP 1
#endif
/* Define to 1 if you have the <fcntl.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_FCNTL_H 1
#endif
/* Define to 1 if you have the `feof_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FEOF_UNLOCKED 1
#endif
/* Define to 1 if you have the `ferror_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FERROR_UNLOCKED 1
#endif
/* Define to 1 if you have the `fflush_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FFLUSH_UNLOCKED 1
#endif
/* Define to 1 if you have the `fgetc_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FGETC_UNLOCKED 1
#endif
/* Define to 1 if you have the `fgets_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FGETS_UNLOCKED 1
#endif
/* Define to 1 if you have the `fileno_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FILENO_UNLOCKED 1
#endif
/* Define to 1 if you have the `fork' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FORK 1
#endif
/* Define to 1 if you have the `fprintf_unlocked' function. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_FPRINTF_UNLOCKED */
#endif
/* Define to 1 if you have the `fputc_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FPUTC_UNLOCKED 1
#endif
/* Define to 1 if you have the `fputs_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FPUTS_UNLOCKED 1
#endif
/* Define to 1 if you have the `fread_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FREAD_UNLOCKED 1
#endif
/* Define to 1 if you have the <ftw.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_FTW_H 1
#endif
/* Define to 1 if you have the `fwrite_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_FWRITE_UNLOCKED 1
#endif
/* Define if your assembler supports specifying the alignment of objects
allocated using the GAS .comm command. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_ALIGNED_COMM */
#endif
/* Define if your assembler supports .balign and .p2align. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
#endif
/* Define 0/1 if your assembler supports CFI directives. */
#define HAVE_GAS_CFI_DIRECTIVE 1
/* Define 0/1 if your assembler supports .cfi_personality. */
#define HAVE_GAS_CFI_PERSONALITY_DIRECTIVE 1
/* Define 0/1 if your assembler supports .cfi_sections. */
#define HAVE_GAS_CFI_SECTIONS_DIRECTIVE 1
/* Define if your assembler supports the .loc discriminator sub-directive. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_DISCRIMINATOR 1
#endif
/* Define if your assembler supports @gnu_unique_object. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_GNU_UNIQUE_OBJECT 1
#endif
/* Define if your assembler and linker support .hidden. */
#define HAVE_GAS_HIDDEN 1
/* Define if your assembler supports .lcomm with an alignment field. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_LCOMM_WITH_ALIGNMENT */
#endif
/* Define if your assembler supports .literal16. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_LITERAL16 */
#endif
/* Define if your assembler supports specifying the maximum number of bytes to
skip when using the GAS .p2align command. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
#endif
/* Define if your assembler supports the .set micromips directive */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_MICROMIPS */
#endif
/* Define if your assembler supports .nsubspa comdat option. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_NSUBSPA_COMDAT */
#endif
/* Define if your assembler and linker support 32-bit section relative relocs
via '.secrel32 label'. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_PE_SECREL32_RELOC */
#endif
/* Define if your assembler supports specifying the section flag e. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GAS_SECTION_EXCLUDE */
#endif
/* Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.
*/
#ifndef USED_FOR_TARGET
#define HAVE_GAS_SHF_MERGE 1
#endif
/* Define if your assembler supports .subsection and .subsection -1 starts
emitting at the beginning of your section. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_SUBSECTION_ORDERING 1
#endif
/* Define if your assembler supports .weak. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_WEAK 1
#endif
/* Define if your assembler supports .weakref. */
#ifndef USED_FOR_TARGET
#define HAVE_GAS_WEAKREF 1
#endif
/* Define to 1 if you have the `getchar_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_GETCHAR_UNLOCKED 1
#endif
/* Define to 1 if you have the `getc_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_GETC_UNLOCKED 1
#endif
/* Define to 1 if you have the `getrlimit' function. */
#ifndef USED_FOR_TARGET
#define HAVE_GETRLIMIT 1
#endif
/* Define to 1 if you have the `getrusage' function. */
#ifndef USED_FOR_TARGET
#define HAVE_GETRUSAGE 1
#endif
/* Define to 1 if you have the `gettimeofday' function. */
#ifndef USED_FOR_TARGET
#define HAVE_GETTIMEOFDAY 1
#endif
/* Define to 1 if using GNU as. */
#ifndef USED_FOR_TARGET
#define HAVE_GNU_AS 1
#endif
/* Define if your system supports gnu indirect functions. */
#ifndef USED_FOR_TARGET
#define HAVE_GNU_INDIRECT_FUNCTION 1
#endif
/* Define to 1 if using GNU ld. */
#ifndef USED_FOR_TARGET
#define HAVE_GNU_LD 1
#endif
/* Define if the gold linker supports split stack and is available as a
non-default */
#ifndef USED_FOR_TARGET
/* #undef HAVE_GOLD_NON_DEFAULT_SPLIT_STACK */
#endif
/* Define if you have the iconv() function. */
#ifndef USED_FOR_TARGET
#define HAVE_ICONV 1
#endif
/* Define to 1 if you have the <iconv.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_ICONV_H 1
#endif
/* Define 0/1 if .init_array/.fini_array sections are available and working.
*/
#ifndef USED_FOR_TARGET
#define HAVE_INITFINI_ARRAY_SUPPORT 0
#endif
/* Define to 1 if the system has the type `intmax_t'. */
#ifndef USED_FOR_TARGET
#define HAVE_INTMAX_T 1
#endif
/* Define to 1 if the system has the type `intptr_t'. */
#ifndef USED_FOR_TARGET
#define HAVE_INTPTR_T 1
#endif
/* Define if you have a working <inttypes.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_INTTYPES_H 1
#endif
/* Define to 1 if you have the `kill' function. */
#ifndef USED_FOR_TARGET
#define HAVE_KILL 1
#endif
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#ifndef USED_FOR_TARGET
#define HAVE_LANGINFO_CODESET 1
#endif
/* Define to 1 if you have the <langinfo.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_LANGINFO_H 1
#endif
/* Define if your <locale.h> file defines LC_MESSAGES. */
#ifndef USED_FOR_TARGET
#define HAVE_LC_MESSAGES 1
#endif
/* Define to 1 if you have the <ldfcn.h> header file. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LDFCN_H */
#endif
/* Define if your linker supports --as-needed/--no-as-needed or equivalent
options. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_AS_NEEDED 1
#endif
/* Define if your default avr linker script for avrxmega3 leaves .rodata in
flash. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_AVR_AVRXMEGA3_RODATA_IN_FLASH */
#endif
/* Define if your linker supports -z bndplt */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_BNDPLT_SUPPORT */
#endif
/* Define if your linker supports --build-id. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_BUILDID 1
#endif
/* Define if the linker supports clearing hardware capabilities via mapfile.
*/
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_CLEARCAP */
#endif
/* Define to the level of your linker's compressed debug section support. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_COMPRESS_DEBUG 3
#endif
/* Define if your linker supports --demangle option. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_DEMANGLE 1
#endif
/* Define 0/1 if your linker supports CIE v3 in .eh_frame. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_EH_FRAME_CIEV3 1
#endif
/* Define if your linker supports .eh_frame_hdr. */
#define HAVE_LD_EH_FRAME_HDR 1
/* Define if your linker supports garbage collection of sections in presence
of EH frames. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_EH_GC_SECTIONS */
#endif
/* Define if your linker has buggy garbage collection of sections support when
.text.startup.foo like sections are used. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_EH_GC_SECTIONS_BUG */
#endif
/* Define if your PowerPC64 linker supports a large TOC. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_LARGE_TOC */
#endif
/* Define if your PowerPC64 linker only needs function descriptor syms. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_NO_DOT_SYMS */
#endif
/* Define if your linker can relax absolute .eh_frame personality pointers
into PC-relative form. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_PERSONALITY_RELAXATION */
#endif
/* Define if your linker supports PIE option. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_PIE 1
#endif
/* Define 0/1 if your linker supports -pie option with copy reloc. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_PIE_COPYRELOC 0
#endif
/* Define if your PowerPC linker has .gnu.attributes long double support. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE */
#endif
/* Define if your linker supports --push-state/--pop-state */
#ifndef USED_FOR_TARGET
#define HAVE_LD_PUSHPOPSTATE_SUPPORT 1
#endif
/* Define if your linker links a mix of read-only and read-write sections into
a read-write section. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_RO_RW_SECTION_MIXING 1
#endif
/* Define if your linker supports the *_sol2 emulations. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_LD_SOL2_EMULATION */
#endif
/* Define if your linker supports -Bstatic/-Bdynamic or equivalent options. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_STATIC_DYNAMIC 1
#endif
/* Define if your linker supports --sysroot. */
#ifndef USED_FOR_TARGET
#define HAVE_LD_SYSROOT 1
#endif
/* Define to 1 if you have the <limits.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_LIMITS_H 1
#endif
/* Define to 1 if you have the <locale.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_LOCALE_H 1
#endif
/* Define to 1 if the system has the type `long long'. */
#ifndef USED_FOR_TARGET
#define HAVE_LONG_LONG 1
#endif
/* Define to 1 if the system has the type `long long int'. */
#ifndef USED_FOR_TARGET
#define HAVE_LONG_LONG_INT 1
#endif
/* Define to the level of your linker's plugin support. */
#ifndef USED_FOR_TARGET
#define HAVE_LTO_PLUGIN 2
#endif
/* Define to 1 if you have the `madvise' function. */
#ifndef USED_FOR_TARGET
#define HAVE_MADVISE 1
#endif
/* Define to 1 if you have the <malloc.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_MALLOC_H 1
#endif
/* Define to 1 if you have the `mbstowcs' function. */
#ifndef USED_FOR_TARGET
#define HAVE_MBSTOWCS 1
#endif
/* Define if valgrind's memcheck.h header is installed. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_MEMCHECK_H */
#endif
/* Define to 1 if you have the <memory.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_MEMORY_H 1
#endif
/* Define to 1 if you have the `mmap' function. */
#ifndef USED_FOR_TARGET
#define HAVE_MMAP 1
#endif
/* Define if mmap with MAP_ANON(YMOUS) works. */
#ifndef USED_FOR_TARGET
#define HAVE_MMAP_ANON 1
#endif
/* Define if mmap of /dev/zero works. */
#ifndef USED_FOR_TARGET
#define HAVE_MMAP_DEV_ZERO 1
#endif
/* Define if read-only mmap of a plain file works. */
#ifndef USED_FOR_TARGET
#define HAVE_MMAP_FILE 1
#endif
/* Define to 1 if you have the `nl_langinfo' function. */
#ifndef USED_FOR_TARGET
#define HAVE_NL_LANGINFO 1
#endif
/* Define to 1 if you have the `popen' function. */
#ifndef USED_FOR_TARGET
#define HAVE_POPEN 1
#endif
/* Define to 1 if you have the `putchar_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_PUTCHAR_UNLOCKED 1
#endif
/* Define to 1 if you have the `putc_unlocked' function. */
#ifndef USED_FOR_TARGET
#define HAVE_PUTC_UNLOCKED 1
#endif
/* Define to 1 if you have the `setlocale' function. */
#ifndef USED_FOR_TARGET
#define HAVE_SETLOCALE 1
#endif
/* Define to 1 if you have the `setrlimit' function. */
#ifndef USED_FOR_TARGET
#define HAVE_SETRLIMIT 1
#endif
/* Define if the system-provided CRTs are present on Solaris. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_SOLARIS_CRTS */
#endif
/* Define to 1 if you have the <stddef.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_STDDEF_H 1
#endif
/* Define to 1 if you have the <stdint.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_STDLIB_H 1
#endif
/* Define to 1 if you have the <strings.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_STRINGS_H 1
#endif
/* Define to 1 if you have the <string.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_STRING_H 1
#endif
/* Define to 1 if you have the `strsignal' function. */
#ifndef USED_FOR_TARGET
#define HAVE_STRSIGNAL 1
#endif
/* Define if <sys/times.h> defines struct tms. */
#ifndef USED_FOR_TARGET
#define HAVE_STRUCT_TMS 1
#endif
/* Define if <utility> defines std::swap. */
#ifndef USED_FOR_TARGET
#define HAVE_SWAP_IN_UTILITY 1
#endif
/* Define to 1 if you have the `sysconf' function. */
#ifndef USED_FOR_TARGET
#define HAVE_SYSCONF 1
#endif
/* Define to 1 if you have the <sys/file.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_FILE_H 1
#endif
/* Define to 1 if you have the <sys/mman.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_MMAN_H 1
#endif
/* Define to 1 if you have the <sys/param.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_PARAM_H 1
#endif
/* Define to 1 if you have the <sys/resource.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_RESOURCE_H 1
#endif
/* Define if your target C library provides sys/sdt.h */
/* #undef HAVE_SYS_SDT_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_STAT_H 1
#endif
/* Define to 1 if you have the <sys/times.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_TIMES_H 1
#endif
/* Define to 1 if you have the <sys/time.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_TIME_H 1
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_TYPES_H 1
#endif
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#ifndef USED_FOR_TARGET
#define HAVE_SYS_WAIT_H 1
#endif
/* Define to 1 if you have the `times' function. */
#ifndef USED_FOR_TARGET
#define HAVE_TIMES 1
#endif
/* Define to 1 if you have the <time.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_TIME_H 1
#endif
/* Define to 1 if you have the <tr1/unordered_map> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_TR1_UNORDERED_MAP 1
#endif
/* Define to 1 if the system has the type `uintmax_t'. */
#ifndef USED_FOR_TARGET
#define HAVE_UINTMAX_T 1
#endif
/* Define to 1 if the system has the type `uintptr_t'. */
#ifndef USED_FOR_TARGET
#define HAVE_UINTPTR_T 1
#endif
/* Define to 1 if you have the <unistd.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_UNISTD_H 1
#endif
/* Define to 1 if you have the <unordered_map> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_UNORDERED_MAP 1
#endif
/* Define to 1 if the system has the type `unsigned long long int'. */
#ifndef USED_FOR_TARGET
#define HAVE_UNSIGNED_LONG_LONG_INT 1
#endif
/* Define if valgrind's valgrind/memcheck.h header is installed. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_VALGRIND_MEMCHECK_H */
#endif
/* Define to 1 if you have the `vfork' function. */
#ifndef USED_FOR_TARGET
#define HAVE_VFORK 1
#endif
/* Define to 1 if you have the <vfork.h> header file. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_VFORK_H */
#endif
/* Define to 1 if you have the <wchar.h> header file. */
#ifndef USED_FOR_TARGET
#define HAVE_WCHAR_H 1
#endif
/* Define to 1 if you have the `wcswidth' function. */
#ifndef USED_FOR_TARGET
#define HAVE_WCSWIDTH 1
#endif
/* Define to 1 if `fork' works. */
#ifndef USED_FOR_TARGET
#define HAVE_WORKING_FORK 1
#endif
/* Define this macro if mbstowcs does not crash when its first argument is
NULL. */
#ifndef USED_FOR_TARGET
#define HAVE_WORKING_MBSTOWCS 1
#endif
/* Define to 1 if `vfork' works. */
#ifndef USED_FOR_TARGET
#define HAVE_WORKING_VFORK 1
#endif
/* Define if your assembler supports AIX debug frame section label reference.
*/
#ifndef USED_FOR_TARGET
/* #undef HAVE_XCOFF_DWARF_EXTRAS */
#endif
/* Define if isl is in use. */
#ifndef USED_FOR_TARGET
/* #undef HAVE_isl */
#endif
/* Define if F_SETLKW supported by fcntl. */
#ifndef USED_FOR_TARGET
#define HOST_HAS_F_SETLKW 1
#endif
/* Define as const if the declaration of iconv() needs const. */
#ifndef USED_FOR_TARGET
#define ICONV_CONST
#endif
/* Define if int64_t uses long as underlying type. */
#ifndef USED_FOR_TARGET
#define INT64_T_IS_LONG 1
#endif
/* Define to 1 if ld64 supports '-export_dynamic'. */
#ifndef USED_FOR_TARGET
/* #undef LD64_HAS_EXPORT_DYNAMIC */
#endif
/* Define to ld64 version. */
#ifndef USED_FOR_TARGET
/* #undef LD64_VERSION */
#endif
/* Define to the linker option to ignore unused dependencies. */
#ifndef USED_FOR_TARGET
#define LD_AS_NEEDED_OPTION "--as-needed"
#endif
/* Define to the linker option to enable compressed debug sections. */
#ifndef USED_FOR_TARGET
#define LD_COMPRESS_DEBUG_OPTION "--compress-debug-sections"
#endif
/* Define to the linker option to enable use of shared objects. */
#ifndef USED_FOR_TARGET
#define LD_DYNAMIC_OPTION "-Bdynamic"
#endif
/* Define to the linker option to keep unused dependencies. */
#ifndef USED_FOR_TARGET
#define LD_NO_AS_NEEDED_OPTION "--no-as-needed"
#endif
/* Define to the linker option to disable use of shared objects. */
#ifndef USED_FOR_TARGET
#define LD_STATIC_OPTION "-Bstatic"
#endif
/* The linker hash style */
#ifndef USED_FOR_TARGET
/* #undef LINKER_HASH_STYLE */
#endif
/* Define to the name of the LTO plugin DSO that must be passed to the
linker's -plugin=LIB option. */
#ifndef USED_FOR_TARGET
#define LTOPLUGINSONAME "liblto_plugin.so"
#endif
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#ifndef USED_FOR_TARGET
#define LT_OBJDIR ".libs/"
#endif
/* Value to set mingw's _dowildcard to. */
#ifndef USED_FOR_TARGET
/* #undef MINGW_DOWILDCARD */
#endif
/* Define if host mkdir takes a single argument. */
#ifndef USED_FOR_TARGET
/* #undef MKDIR_TAKES_ONE_ARG */
#endif
/* Define to offload targets, separated by commas. */
#ifndef USED_FOR_TARGET
#define OFFLOAD_TARGETS ""
#endif
/* Define to the address where bug reports for this package should be sent. */
#ifndef USED_FOR_TARGET
#define PACKAGE_BUGREPORT ""
#endif
/* Define to the full name of this package. */
#ifndef USED_FOR_TARGET
#define PACKAGE_NAME ""
#endif
/* Define to the full name and version of this package. */
#ifndef USED_FOR_TARGET
#define PACKAGE_STRING ""
#endif
/* Define to the one symbol short name of this package. */
#ifndef USED_FOR_TARGET
#define PACKAGE_TARNAME ""
#endif
/* Define to the home page for this package. */
#ifndef USED_FOR_TARGET
#define PACKAGE_URL ""
#endif
/* Define to the version of this package. */
#ifndef USED_FOR_TARGET
#define PACKAGE_VERSION ""
#endif
/* Specify plugin linker */
#ifndef USED_FOR_TARGET
#define PLUGIN_LD_SUFFIX "ld"
#endif
/* Define to .TOC. alignment forced by your linker. */
#ifndef USED_FOR_TARGET
/* #undef POWERPC64_TOC_POINTER_ALIGNMENT */
#endif
/* Define to PREFIX/include if cpp should also search that directory. */
#ifndef USED_FOR_TARGET
/* #undef PREFIX_INCLUDE_DIR */
#endif
/* The size of `int', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_INT 4
#endif
/* The size of `long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_LONG 8
#endif
/* The size of `long long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_LONG_LONG 8
#endif
/* The size of `short', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_SHORT 2
#endif
/* The size of `void *', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#define SIZEOF_VOID_P 8
#endif
/* Define to 1 if you have the ANSI C header files. */
#ifndef USED_FOR_TARGET
#define STDC_HEADERS 1
#endif
/* Define if you can safely include both <string.h> and <strings.h>. */
#ifndef USED_FOR_TARGET
#define STRING_WITH_STRINGS 1
#endif
/* Define if TFmode long double should be the default */
#ifndef USED_FOR_TARGET
/* #undef TARGET_DEFAULT_LONG_DOUBLE_128 */
#endif
/* Define if your target C library provides the `dl_iterate_phdr' function. */
/* #undef TARGET_DL_ITERATE_PHDR */
/* GNU C Library major version number used on the target, or 0. */
#ifndef USED_FOR_TARGET
#define TARGET_GLIBC_MAJOR 2
#endif
/* GNU C Library minor version number used on the target, or 0. */
#ifndef USED_FOR_TARGET
#define TARGET_GLIBC_MINOR 28
#endif
/* Define if your target C Library provides the AT_HWCAP value in the TCB */
#ifndef USED_FOR_TARGET
/* #undef TARGET_LIBC_PROVIDES_HWCAP_IN_TCB */
#endif
/* Define if your target C library provides stack protector support */
#ifndef USED_FOR_TARGET
#define TARGET_LIBC_PROVIDES_SSP 1
#endif
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#ifndef USED_FOR_TARGET
#define TIME_WITH_SYS_TIME 1
#endif
/* Define to the flag used to mark TLS sections if the default (`T') doesn't
work. */
#ifndef USED_FOR_TARGET
/* #undef TLS_SECTION_ASM_FLAG */
#endif
/* Define if your assembler mis-optimizes .eh_frame data. */
#ifndef USED_FOR_TARGET
/* #undef USE_AS_TRADITIONAL_FORMAT */
#endif
/* Define if you want to generate code by default that assumes that the Cygwin
DLL exports wrappers to support libstdc++ function replacement. */
#ifndef USED_FOR_TARGET
/* #undef USE_CYGWIN_LIBSTDCXX_WRAPPERS */
#endif
/* Define 0/1 if your linker supports hidden thunks in linkonce sections. */
#ifndef USED_FOR_TARGET
/* #undef USE_HIDDEN_LINKONCE */
#endif
/* Define to 1 if the 'long long' type is wider than 'long' but still
efficiently supported by the host hardware. */
#ifndef USED_FOR_TARGET
/* #undef USE_LONG_LONG_FOR_WIDEST_FAST_INT */
#endif
/* Define if we should use leading underscore on 64 bit mingw targets */
#ifndef USED_FOR_TARGET
/* #undef USE_MINGW64_LEADING_UNDERSCORES */
#endif
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Define to be the last component of the Windows registry key under which to
look for installation paths. The full key used will be
HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}.
The default is the GCC version number. */
#ifndef USED_FOR_TARGET
/* #undef WIN32_REGISTRY_KEY */
#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#ifndef USED_FOR_TARGET
/* #undef _FILE_OFFSET_BITS */
#endif
/* Define for large files, on AIX-style hosts. */
#ifndef USED_FOR_TARGET
/* #undef _LARGE_FILES */
#endif
/* Define to 1 if on MINIX. */
#ifndef USED_FOR_TARGET
/* #undef _MINIX */
#endif
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#ifndef USED_FOR_TARGET
/* #undef _POSIX_1_SOURCE */
#endif
/* Define to 1 if you need to in order for `stat' and other things to work. */
#ifndef USED_FOR_TARGET
/* #undef _POSIX_SOURCE */
#endif
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#ifndef USED_FOR_TARGET
/* #undef _UINT32_T */
#endif
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#ifndef USED_FOR_TARGET
/* #undef _UINT64_T */
#endif
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#ifndef USED_FOR_TARGET
/* #undef _UINT8_T */
#endif
/* Define to `char *' if <sys/types.h> does not define. */
#ifndef USED_FOR_TARGET
/* #undef caddr_t */
#endif
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef int16_t */
#endif
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef int32_t */
#endif
/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef int64_t */
#endif
/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef int8_t */
#endif
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
not define. */
#ifndef USED_FOR_TARGET
/* #undef intmax_t */
#endif
/* Define to the type of a signed integer type wide enough to hold a pointer,
if such a type exists, and if the system does not define it. */
#ifndef USED_FOR_TARGET
/* #undef intptr_t */
#endif
/* Define to `int' if <sys/types.h> does not define. */
#ifndef USED_FOR_TARGET
/* #undef pid_t */
#endif
/* Define to `long' if <sys/resource.h> doesn't define. */
#ifndef USED_FOR_TARGET
/* #undef rlim_t */
#endif
/* Define to `int' if <sys/types.h> does not define. */
#ifndef USED_FOR_TARGET
/* #undef ssize_t */
#endif
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef uint16_t */
#endif
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef uint32_t */
#endif
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef uint64_t */
#endif
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#ifndef USED_FOR_TARGET
/* #undef uint8_t */
#endif
/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
do not define. */
#ifndef USED_FOR_TARGET
/* #undef uintmax_t */
#endif
/* Define to the type of an unsigned integer type wide enough to hold a
pointer, if such a type exists, and if the system does not define it. */
#ifndef USED_FOR_TARGET
/* #undef uintptr_t */
#endif
/* Define as `fork' if `vfork' does not work. */
#ifndef USED_FOR_TARGET
/* #undef vfork */
#endif
| [
"delacruzallanjay@gmail.com"
] | delacruzallanjay@gmail.com |
725320957ab251233c230910a090ac4e6fe908a1 | 965225d196d9246f40cc8d4255a24315103fef47 | /ch02/EXE2_6_3/many.cpp | 5be602cd3102a943b782b619b4896afa3d3c3a74 | [] | no_license | LinuxKernelDevelopment/cppprimer | 52fa1739e11e8bf4fda84f19083b33cfac930f3c | 28724e6db5cde4c8cd3f188ac6130425bc711fa9 | refs/heads/master | 2020-05-25T09:22:33.271140 | 2019-05-21T00:32:28 | 2019-05-21T00:32:28 | 187,732,717 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 810 | cpp | #include <iostream>
#include "header.h"
int main(void)
{
Sales_data total;
double price;
if (std::cin >> total.bookNo >> total.units_sold >> price) {
Sales_data trans;
total.revenue = total.units_sold * price;
while (std::cin >> trans.bookNo >> trans.units_sold >> price) {
if (total.bookNo == trans.bookNo) {
total.units_sold += trans.units_sold;
total.revenue += trans.revenue;
} else {
std::cout << total.bookNo << '\t' << total.units_sold << '\t' << total.revenue <<
std::endl;
total.bookNo = trans.bookNo;
total.units_sold = trans.units_sold;
total.revenue = trans.revenue;
}
}
std::cout << total.bookNo << '\t' << total.units_sold << '\t' << total.revenue << std::endl;
} else {
std::cerr << "No data?!" << std::endl;
return -1;
}
return 0;
}
| [
"weizhefix@gmail.com"
] | weizhefix@gmail.com |
b3616b6e778155857dff69524b203c14b923bbda | 3b9b4049a8e7d38b49e07bb752780b2f1d792851 | /src/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc | 447592e0aae01d6a6fe6d9e999e78b19f8da8089 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | webosce/chromium53 | f8e745e91363586aee9620c609aacf15b3261540 | 9171447efcf0bb393d41d1dc877c7c13c46d8e38 | refs/heads/webosce | 2020-03-26T23:08:14.416858 | 2018-08-23T08:35:17 | 2018-09-20T14:25:18 | 145,513,343 | 0 | 2 | Apache-2.0 | 2019-08-21T22:44:55 | 2018-08-21T05:52:31 | null | UTF-8 | C++ | false | false | 41,699 | cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "extensions/browser/api/system_display/display_info_provider.h"
#include <stdint.h>
#include "ash/common/ash_switches.h"
#include "ash/display/display_manager.h"
#include "ash/display/screen_orientation_controller_chromeos.h"
#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "extensions/common/api/system_display.h"
#include "ui/display/display.h"
#include "ui/display/manager/display_layout.h"
#include "ui/gfx/geometry/rect.h"
namespace extensions {
namespace {
using DisplayUnitInfoList = DisplayInfoProvider::DisplayUnitInfoList;
using DisplayLayoutList = DisplayInfoProvider::DisplayLayoutList;
class DisplayInfoProviderChromeosTest : public ash::test::AshTestBase {
public:
DisplayInfoProviderChromeosTest() {}
~DisplayInfoProviderChromeosTest() override {}
void SetUp() override {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
ash::switches::kAshUseFirstDisplayAsInternal);
ash::test::AshTestBase::SetUp();
}
protected:
void CallSetDisplayUnitInfo(
const std::string& display_id,
const api::system_display::DisplayProperties& info,
bool* success,
std::string* error) {
// Reset error messsage.
(*error).clear();
*success = DisplayInfoProvider::Get()->SetInfo(display_id, info, error);
}
bool DisplayExists(int64_t display_id) const {
const display::Display& display =
GetDisplayManager()->GetDisplayForId(display_id);
return display.id() != display::Display::kInvalidDisplayID;
}
ash::DisplayManager* GetDisplayManager() const {
return ash::Shell::GetInstance()->display_manager();
}
std::string SystemInfoDisplayInsetsToString(
const api::system_display::Insets& insets) const {
// Order to match gfx::Insets::ToString().
return base::StringPrintf(
"%d,%d,%d,%d", insets.top, insets.left, insets.bottom, insets.right);
}
std::string SystemInfoDisplayBoundsToString(
const api::system_display::Bounds& bounds) const {
// Order to match gfx::Rect::ToString().
return base::StringPrintf(
"%d,%d %dx%d", bounds.left, bounds.top, bounds.width, bounds.height);
}
private:
DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderChromeosTest);
};
TEST_F(DisplayInfoProviderChromeosTest, GetBasic) {
UpdateDisplay("500x600,400x520");
DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
int64_t display_id;
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[0].overscan));
EXPECT_EQ(0, result[0].rotation);
EXPECT_TRUE(result[0].is_primary);
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_TRUE(result[0].is_enabled);
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ(GetDisplayManager()->GetDisplayNameForId(display_id),
result[1].name);
// The second display is positioned left of the primary display, whose width
// is 500.
EXPECT_EQ("500,0 400x520", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan));
EXPECT_EQ(0, result[1].rotation);
EXPECT_FALSE(result[1].is_primary);
EXPECT_EQ(96, result[1].dpi_x);
EXPECT_EQ(96, result[1].dpi_y);
EXPECT_TRUE(result[1].mirroring_source_id.empty());
EXPECT_TRUE(result[1].is_enabled);
}
TEST_F(DisplayInfoProviderChromeosTest, GetWithUnifiedDesktop) {
UpdateDisplay("500x600,400x520");
// Check initial state.
EXPECT_FALSE(GetDisplayManager()->IsInUnifiedMode());
DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
int64_t display_id;
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[0].overscan));
EXPECT_EQ(0, result[0].rotation);
EXPECT_TRUE(result[0].is_primary);
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_TRUE(result[0].is_enabled);
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ(GetDisplayManager()->GetDisplayNameForId(display_id),
result[1].name);
// Initial multipple display configuration.
EXPECT_EQ("500,0 400x520", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan));
EXPECT_EQ(0, result[1].rotation);
EXPECT_FALSE(result[1].is_primary);
EXPECT_EQ(96, result[1].dpi_x);
EXPECT_EQ(96, result[1].dpi_y);
EXPECT_TRUE(result[1].mirroring_source_id.empty());
EXPECT_TRUE(result[1].is_enabled);
// Enable unified.
GetDisplayManager()->SetUnifiedDesktopEnabled(true);
EXPECT_TRUE(GetDisplayManager()->IsInUnifiedMode());
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[0].overscan));
EXPECT_EQ(0, result[0].rotation);
EXPECT_TRUE(result[0].is_primary);
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_TRUE(result[0].is_enabled);
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
EXPECT_EQ(GetDisplayManager()->GetDisplayNameForId(display_id),
result[1].name);
// After enabling unified the second display is scaled to meet the height for
// the first. Which also affects the DPI below.
EXPECT_EQ("500,0 461x600", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan));
EXPECT_EQ(0, result[1].rotation);
EXPECT_FALSE(result[1].is_primary);
EXPECT_FLOAT_EQ(111, round(result[1].dpi_x));
EXPECT_FLOAT_EQ(111, round(result[1].dpi_y));
EXPECT_TRUE(result[1].mirroring_source_id.empty());
EXPECT_TRUE(result[1].is_enabled);
// Disable unified and check that once again it matches initial situation.
GetDisplayManager()->SetUnifiedDesktopEnabled(false);
EXPECT_FALSE(GetDisplayManager()->IsInUnifiedMode());
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[0].overscan));
EXPECT_EQ(0, result[0].rotation);
EXPECT_TRUE(result[0].is_primary);
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_TRUE(result[0].is_enabled);
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ(GetDisplayManager()->GetDisplayNameForId(display_id),
result[1].name);
EXPECT_EQ("500,0 400x520", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan));
EXPECT_EQ(0, result[1].rotation);
EXPECT_FALSE(result[1].is_primary);
EXPECT_EQ(96, result[1].dpi_x);
EXPECT_EQ(96, result[1].dpi_y);
EXPECT_TRUE(result[1].mirroring_source_id.empty());
EXPECT_TRUE(result[1].is_enabled);
}
TEST_F(DisplayInfoProviderChromeosTest, GetRotation) {
UpdateDisplay("500x600/r");
DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(1u, result.size());
int64_t display_id;
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(90, result[0].rotation);
GetDisplayManager()->SetDisplayRotation(
display_id, display::Display::ROTATE_270,
display::Display::ROTATION_SOURCE_ACTIVE);
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(1u, result.size());
EXPECT_EQ(base::Int64ToString(display_id), result[0].id);
EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(270, result[0].rotation);
GetDisplayManager()->SetDisplayRotation(
display_id, display::Display::ROTATE_180,
display::Display::ROTATION_SOURCE_ACTIVE);
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(1u, result.size());
EXPECT_EQ(base::Int64ToString(display_id), result[0].id);
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(180, result[0].rotation);
GetDisplayManager()->SetDisplayRotation(
display_id, display::Display::ROTATE_0,
display::Display::ROTATION_SOURCE_ACTIVE);
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(1u, result.size());
EXPECT_EQ(base::Int64ToString(display_id), result[0].id);
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(0, result[0].rotation);
}
TEST_F(DisplayInfoProviderChromeosTest, GetDPI) {
UpdateDisplay("500x600,400x520*2");
DisplayUnitInfoList result;
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_EQ("500,0 200x260", SystemInfoDisplayBoundsToString(result[1].bounds));
// DPI should be 96 (native dpi) * 200 (display) / 400 (native) when ui scale
// is 2.
EXPECT_EQ(96 / 2, result[1].dpi_x);
EXPECT_EQ(96 / 2, result[1].dpi_y);
ash::test::SwapPrimaryDisplay();
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ("-500,0 500x600",
SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ(96, result[0].dpi_x);
EXPECT_EQ(96, result[0].dpi_y);
EXPECT_EQ("0,0 200x260", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ(96 / 2, result[1].dpi_x);
EXPECT_EQ(96 / 2, result[1].dpi_y);
}
TEST_F(DisplayInfoProviderChromeosTest, GetVisibleArea) {
UpdateDisplay("640x720*2/o, 400x520/o");
DisplayUnitInfoList result;
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
int64_t display_id;
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id))
<< "Display id must be convertable to integer: " << result[1].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
// Default overscan is 5%.
EXPECT_EQ("304,0 380x494", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("13,10,13,10", SystemInfoDisplayInsetsToString(result[1].overscan));
GetDisplayManager()->SetOverscanInsets(display_id,
gfx::Insets(20, 30, 50, 60));
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ(base::Int64ToString(display_id), result[1].id);
EXPECT_EQ("304,0 310x450", SystemInfoDisplayBoundsToString(result[1].bounds));
EXPECT_EQ("20,30,50,60", SystemInfoDisplayInsetsToString(result[1].overscan));
// Set insets for the primary screen. Note that it has 2x scale.
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
EXPECT_EQ("0,0 304x342", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("9,8,9,8", SystemInfoDisplayInsetsToString(result[0].overscan));
GetDisplayManager()->SetOverscanInsets(display_id,
gfx::Insets(10, 20, 30, 40));
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ(base::Int64ToString(display_id), result[0].id);
EXPECT_EQ("0,0 260x320", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("10,20,30,40", SystemInfoDisplayInsetsToString(result[0].overscan));
}
TEST_F(DisplayInfoProviderChromeosTest, GetMirroring) {
UpdateDisplay("600x600, 400x520/o");
DisplayUnitInfoList result;
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
int64_t display_id_primary;
ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id_primary))
<< "Display id must be convertable to integer: " << result[0].id;
ASSERT_TRUE(DisplayExists(display_id_primary)) << display_id_primary
<< " not found";
int64_t display_id_secondary;
ASSERT_TRUE(base::StringToInt64(result[1].id, &display_id_secondary))
<< "Display id must be convertable to integer: " << result[1].id;
ASSERT_TRUE(DisplayExists(display_id_secondary)) << display_id_secondary
<< " not found";
ASSERT_FALSE(GetDisplayManager()->IsInMirrorMode());
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_TRUE(result[1].mirroring_source_id.empty());
GetDisplayManager()->SetMirrorMode(true);
ASSERT_TRUE(GetDisplayManager()->IsInMirrorMode());
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(1u, result.size());
EXPECT_EQ(base::Int64ToString(display_id_primary), result[0].id);
EXPECT_EQ(base::Int64ToString(display_id_secondary),
result[0].mirroring_source_id);
GetDisplayManager()->SetMirrorMode(false);
ASSERT_FALSE(GetDisplayManager()->IsInMirrorMode());
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ(base::Int64ToString(display_id_primary), result[0].id);
EXPECT_TRUE(result[0].mirroring_source_id.empty());
EXPECT_EQ(base::Int64ToString(display_id_secondary), result[1].id);
EXPECT_TRUE(result[1].mirroring_source_id.empty());
}
TEST_F(DisplayInfoProviderChromeosTest, GetBounds) {
UpdateDisplay("600x600, 400x520");
GetDisplayManager()->SetLayoutForCurrentDisplays(
ash::test::CreateDisplayLayout(display::DisplayPlacement::LEFT, -40));
DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ("0,0 600x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("-400,-40 400x520",
SystemInfoDisplayBoundsToString(result[1].bounds));
GetDisplayManager()->SetLayoutForCurrentDisplays(
ash::test::CreateDisplayLayout(display::DisplayPlacement::TOP, 40));
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ("0,0 600x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("40,-520 400x520",
SystemInfoDisplayBoundsToString(result[1].bounds));
GetDisplayManager()->SetLayoutForCurrentDisplays(
ash::test::CreateDisplayLayout(display::DisplayPlacement::BOTTOM, 80));
result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_EQ(2u, result.size());
EXPECT_EQ("0,0 600x600", SystemInfoDisplayBoundsToString(result[0].bounds));
EXPECT_EQ("80,600 400x520",
SystemInfoDisplayBoundsToString(result[1].bounds));
}
TEST_F(DisplayInfoProviderChromeosTest, Layout) {
UpdateDisplay("500x400,500x400,500x400");
DisplayUnitInfoList displays =
DisplayInfoProvider::Get()->GetAllDisplaysInfo();
std::string primary_id = displays[0].id;
ASSERT_EQ(3u, displays.size());
DisplayLayoutList layout = DisplayInfoProvider::Get()->GetDisplayLayout();
ASSERT_EQ(2u, layout.size());
// Confirm layout.
EXPECT_EQ(displays[1].id, layout[0].id);
EXPECT_EQ(primary_id, layout[0].parent_id);
EXPECT_EQ(api::system_display::LAYOUT_POSITION_RIGHT, layout[0].position);
EXPECT_EQ(0, layout[0].offset);
EXPECT_EQ(displays[2].id, layout[1].id);
EXPECT_EQ(layout[0].id, layout[1].parent_id);
EXPECT_EQ(api::system_display::LAYOUT_POSITION_RIGHT, layout[1].position);
EXPECT_EQ(0, layout[1].offset);
// Modify layout.
layout[0].offset = 100;
layout[1].parent_id = primary_id;
layout[1].position = api::system_display::LAYOUT_POSITION_BOTTOM;
layout[1].offset = -100;
// Update with modified layout.
ASSERT_TRUE(DisplayInfoProvider::Get()->SetDisplayLayout(layout));
// Get updated layout.
layout = DisplayInfoProvider::Get()->GetDisplayLayout();
// Confirm modified layout.
EXPECT_EQ(displays[1].id, layout[0].id);
EXPECT_EQ(primary_id, layout[0].parent_id);
EXPECT_EQ(api::system_display::LAYOUT_POSITION_RIGHT, layout[0].position);
EXPECT_EQ(100, layout[0].offset);
EXPECT_EQ(displays[2].id, layout[1].id);
EXPECT_EQ(primary_id, layout[1].parent_id);
EXPECT_EQ(api::system_display::LAYOUT_POSITION_BOTTOM, layout[1].position);
EXPECT_EQ(-100, layout[1].offset);
// TODO(stevenjb/oshima): Implement and test illegal layout prevention.
// Test setting invalid layout fails.
layout[0].parent_id = displays[2].id;
layout[1].parent_id = displays[1].id;
EXPECT_FALSE(DisplayInfoProvider::Get()->SetDisplayLayout(layout));
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftExact) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-520));
info.bounds_origin_y.reset(new int(50));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-520,50 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightExact) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(1200));
info.bounds_origin_y.reset(new int(100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("1200,100 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopExact) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(1100));
info.bounds_origin_y.reset(new int(-400));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("1100,-400 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginBottomExact) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-350));
info.bounds_origin_y.reset(new int(600));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-350,600 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSameCenter) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(340));
info.bounds_origin_y.reset(new int(100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("1200,100 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftOutside) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-1040));
info.bounds_origin_y.reset(new int(100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-520,100 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopOutside) {
UpdateDisplay("1200x600,520x400");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-360));
info.bounds_origin_y.reset(new int(-301));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-360,-400 520x400", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest,
SetBoundsOriginLeftButSharesBottomSide) {
UpdateDisplay("1200x600,1000x100");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-650));
info.bounds_origin_y.reset(new int(700));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-650,600 1000x100", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightButSharesTopSide) {
UpdateDisplay("1200x600,1000x100");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(850));
info.bounds_origin_y.reset(new int(-150));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("850,-100 1000x100", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopButSharesLeftSide) {
UpdateDisplay("1200x600,1000x100/l");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(-150));
info.bounds_origin_y.reset(new int(-650));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("-100,-650 100x1000", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest,
SetBoundsOriginBottomButSharesRightSide) {
UpdateDisplay("1200x600,1000x100/l");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(1350));
info.bounds_origin_y.reset(new int(450));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("1200,450 100x1000", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginPrimaryHiDPI) {
UpdateDisplay("1200x600*2,500x500");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(250));
info.bounds_origin_y.reset(new int(-100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("600,-100 500x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSecondaryHiDPI) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(450));
info.bounds_origin_y.reset(new int(-100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
ASSERT_TRUE(error.empty());
EXPECT_EQ("450,-500 300x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBounds) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(0x200001));
info.bounds_origin_y.reset(new int(-100));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
ASSERT_EQ("Bounds origin x out of bounds.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBoundsNegative) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(300));
info.bounds_origin_y.reset(new int(-0x200001));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
ASSERT_EQ("Bounds origin y out of bounds.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginMaxValues) {
UpdateDisplay("1200x4600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(200000));
info.bounds_origin_y.reset(new int(10));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("1200,10 300x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOnPrimary) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(300));
info.is_primary.reset(new bool(true));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
ASSERT_EQ("Bounds origin not allowed for the primary display.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
// The operation failed because the primary property would be set before
// setting bounds. The primary display shouldn't have been changed, though.
EXPECT_NE(display::Screen::GetScreen()->GetPrimaryDisplay().id(),
secondary.id());
}
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
const display::Display& primary =
display::Screen::GetScreen()->GetPrimaryDisplay();
api::system_display::DisplayProperties info;
info.bounds_origin_x.reset(new int(300));
info.mirroring_source_id.reset(
new std::string(base::Int64ToString(primary.id())));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
ASSERT_EQ("No other parameter should be set alongside mirroringSourceId.",
error);
}
TEST_F(DisplayInfoProviderChromeosTest, SetRotation) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.rotation.reset(new int(90));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("1200,0 500x300", secondary.bounds().ToString());
EXPECT_EQ(display::Display::ROTATE_90, secondary.rotation());
info.rotation.reset(new int(270));
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("1200,0 500x300", secondary.bounds().ToString());
EXPECT_EQ(display::Display::ROTATE_270, secondary.rotation());
info.rotation.reset(new int(180));
// Switch primary display.
info.is_primary.reset(new bool(true));
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("0,0 300x500", secondary.bounds().ToString());
EXPECT_EQ(display::Display::ROTATE_180, secondary.rotation());
EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().id(),
secondary.id());
info.rotation.reset(new int(0));
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("0,0 300x500", secondary.bounds().ToString());
EXPECT_EQ(display::Display::ROTATE_0, secondary.rotation());
EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().id(),
secondary.id());
}
// Tests that rotation changes made before entering maximize mode are restored
// upon exiting maximize mode, and that a rotation lock is not set.
TEST_F(DisplayInfoProviderChromeosTest, SetRotationBeforeMaximizeMode) {
ash::ScreenOrientationController* screen_orientation_controller =
ash::Shell::GetInstance()->screen_orientation_controller();
api::system_display::DisplayProperties info;
info.rotation.reset(new int(90));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(display::Display::InternalDisplayId()), info,
&success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_FALSE(screen_orientation_controller->rotation_locked());
// Entering maximize mode enables accelerometer screen rotations.
ash::Shell::GetInstance()
->maximize_mode_controller()
->EnableMaximizeModeWindowManager(true);
// Rotation lock should not activate because DisplayInfoProvider::SetInfo()
// was called when not in maximize mode.
EXPECT_FALSE(screen_orientation_controller->rotation_locked());
// ScreenOrientationController rotations override display info.
screen_orientation_controller->SetDisplayRotation(
display::Display::ROTATE_0, display::Display::ROTATION_SOURCE_ACTIVE);
EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation());
// Exiting maximize mode should restore the initial rotation
ash::Shell::GetInstance()
->maximize_mode_controller()
->EnableMaximizeModeWindowManager(false);
EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
}
// Tests that rotation changes made during maximize mode lock the display
// against accelerometer rotations.
TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringMaximizeMode) {
// Entering maximize mode enables accelerometer screen rotations.
ash::Shell::GetInstance()
->maximize_mode_controller()
->EnableMaximizeModeWindowManager(true);
ASSERT_FALSE(ash::Shell::GetInstance()
->screen_orientation_controller()
->rotation_locked());
api::system_display::DisplayProperties info;
info.rotation.reset(new int(90));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(display::Display::InternalDisplayId()), info,
&success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_TRUE(ash::Shell::GetInstance()
->screen_orientation_controller()
->rotation_locked());
}
TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.rotation.reset(new int(91));
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Invalid rotation.", error);
}
TEST_F(DisplayInfoProviderChromeosTest, SetNegativeOverscan) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.overscan.reset(new api::system_display::Insets);
info.overscan->left = -10;
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Negative overscan not allowed.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
info.overscan->left = 0;
info.overscan->right = -200;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Negative overscan not allowed.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
info.overscan->right = 0;
info.overscan->top = -300;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Negative overscan not allowed.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
info.overscan->right = 0;
info.overscan->top = -1000;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Negative overscan not allowed.", error);
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
info.overscan->right = 0;
info.overscan->top = 0;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString());
}
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanHorizontalBounds) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.overscan.reset(new api::system_display::Insets);
// Horizontal overscan is 151, which would make the bounds width 149.
info.overscan->left = 50;
info.overscan->top = 10;
info.overscan->right = 101;
info.overscan->bottom = 20;
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Horizontal overscan is more than half of the screen width.",
error);
}
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanVerticalBounds) {
UpdateDisplay("1200x600,600x1000");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.overscan.reset(new api::system_display::Insets);
// Vertical overscan is 501, which would make the bounds height 499.
info.overscan->left = 20;
info.overscan->top = 250;
info.overscan->right = 101;
info.overscan->bottom = 251;
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Vertical overscan is more than half of the screen height.", error);
}
TEST_F(DisplayInfoProviderChromeosTest, SetOverscan) {
UpdateDisplay("1200x600,600x1000*2");
const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay();
api::system_display::DisplayProperties info;
info.overscan.reset(new api::system_display::Insets);
info.overscan->left = 20;
info.overscan->top = 199;
info.overscan->right = 130;
info.overscan->bottom = 51;
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(secondary.id()), info, &success, &error);
ASSERT_TRUE(success);
EXPECT_TRUE(error.empty());
EXPECT_EQ("1200,0 150x250", secondary.bounds().ToString());
const gfx::Insets overscan =
GetDisplayManager()->GetOverscanInsets(secondary.id());
EXPECT_EQ(20, overscan.left());
EXPECT_EQ(199, overscan.top());
EXPECT_EQ(130, overscan.right());
EXPECT_EQ(51, overscan.bottom());
}
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanForInternal) {
UpdateDisplay("1200x600,600x1000*2");
const int64_t internal_display_id =
ash::test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay();
api::system_display::DisplayProperties info;
info.overscan.reset(new api::system_display::Insets);
// Vertical overscan is 501, which would make the bounds height 499.
info.overscan->left = 20;
info.overscan->top = 20;
info.overscan->right = 20;
info.overscan->bottom = 20;
bool success = false;
std::string error;
CallSetDisplayUnitInfo(
base::Int64ToString(internal_display_id), info, &success, &error);
ASSERT_FALSE(success);
EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error);
}
TEST_F(DisplayInfoProviderChromeosTest, DisplayMode) {
UpdateDisplay("1200x600,600x1000");
DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
ASSERT_GE(result.size(), 1u);
const api::system_display::DisplayUnitInfo& primary_info = result[0];
// Ensure that we have two modes for the primary display so that we can
// test chaning modes.
ASSERT_GE(primary_info.modes.size(), 2u);
// Get the currently active mode and one other mode to switch to.
int64_t id;
base::StringToInt64(primary_info.id, &id);
ash::DisplayMode active_mode =
GetDisplayManager()->GetActiveModeForDisplayId(id);
const api::system_display::DisplayMode* cur_mode = nullptr;
const api::system_display::DisplayMode* other_mode = nullptr;
for (const auto& mode : primary_info.modes) {
if (mode.is_selected)
cur_mode = &mode;
else if (!other_mode)
other_mode = &mode;
if (cur_mode && other_mode)
break;
}
ASSERT_TRUE(cur_mode);
ASSERT_TRUE(other_mode);
ASSERT_NE(other_mode, cur_mode);
// Verify that other_mode differs from the active mode.
ash::DisplayMode other_mode_ash;
other_mode_ash.size.SetSize(other_mode->width_in_native_pixels,
other_mode->height_in_native_pixels);
other_mode_ash.ui_scale = other_mode->ui_scale;
other_mode_ash.device_scale_factor = other_mode->device_scale_factor;
EXPECT_FALSE(active_mode.IsEquivalent(other_mode_ash));
// Switch modes.
api::system_display::DisplayProperties info;
info.display_mode =
api::system_display::DisplayMode::FromValue(*other_mode->ToValue());
bool success = false;
std::string error;
CallSetDisplayUnitInfo(base::Int64ToString(id), info, &success, &error);
ASSERT_TRUE(success);
// Verify that other_mode now matches the active mode.
active_mode = GetDisplayManager()->GetActiveModeForDisplayId(id);
EXPECT_TRUE(active_mode.IsEquivalent(other_mode_ash));
}
} // namespace
} // namespace extensions
| [
"changhyeok.bae@lge.com"
] | changhyeok.bae@lge.com |
41c90aa1bfb8f1e06ea29ea160bb1ad11eefb001 | a078b20c748c9dafa9902588c0678e0ef757d426 | /create_2d_weighted_hist.cpp | b9ce5b406c5dc8a30543d4ebd8e622e1e3039a1b | [] | no_license | hemicuda71/MC-3 | ed7f66e137a10cfe6bd11a9a33558fe03dd542bd | d03328355c6467c19a73e0d01081ae641c1cc875 | refs/heads/master | 2020-12-24T20:33:47.138406 | 2016-05-08T20:41:10 | 2016-05-08T20:41:10 | 58,330,438 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,884 | cpp | // 2d hist with weighted values
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <string.h> // for memset
#include <stdlib.h> /* atoi */
using namespace std;
const int XRES = 100;
const int YRES = 100;
const double BURN_IN = 0.3;
int main(int argc, char* argv[])
{
int i, j, n, XPARAM, YPARAM;
ifstream setupfile("setup.txt");
ifstream chain_file("chain.txt");
// parameters to plot together
XPARAM = atoi(argv[1]);
YPARAM = atoi(argv[2]);
// read setup file
double DELTA_TEMP, ANNEALING_FACTOR, STD_GUESS;
int NSTATES, NCHAINS, NPARAMS, DIN, DOUT, NDATA, SWAP_RATE, PRINT_FREQ;
setupfile >> NSTATES >> NCHAINS >> NPARAMS >> DIN >> DOUT >> NDATA >> DELTA_TEMP
>> ANNEALING_FACTOR >> STD_GUESS >> SWAP_RATE >> PRINT_FREQ;
printf("NSTATES: %i NCHAINS: %i NPARAMS: %i DIN: %i DOUT: %i NDATA: %i\n",
NSTATES, NCHAINS, NPARAMS, DIN, DOUT, NDATA);
printf("DELTA_TEMP: %f ANNEALING_FACTOR: %f STD_GUESS: %f\n",
DELTA_TEMP, ANNEALING_FACTOR, STD_GUESS);
printf("SWAP_RATE: %i PRINT_FREQ: %i\n", SWAP_RATE, PRINT_FREQ);
cout << "BURN_IN fraction: " << BURN_IN << endl;
string param_names[] = {"powerlaw1", "powerlaw2", "powerlaw3", "powerlaw4",
"E1", "E2", "E3", ".txt"};
string h_string("2dhist_");
string file_name(h_string + param_names[XPARAM] + param_names[YPARAM] + param_names[NPARAMS]);
char file_name_char[file_name.size()+1];
strcpy(file_name_char, file_name.c_str());
//const char *param_names[] = {"powerlaw1", "powerlaw2", "powerlaw3", "powerlaw4",
// "E1", "E2", "E3"};
double *state_range, *state_cur, dud, xi;
state_range = new double[2*NPARAMS];
state_cur = new double[NPARAMS];
for(i = 0; i < NPARAMS; i++)
setupfile >> dud >> state_range[2*i] >> state_range[2*i+1];
setupfile.close();
double XMIN = state_range[2*XPARAM], XMAX = state_range[2*XPARAM + 1];
double YMIN = state_range[2*YPARAM], YMAX = state_range[2*YPARAM + 1];
int xid, yid;
double *histogram;
const int HIST_SIZE = XRES * YRES;
histogram = new double[HIST_SIZE];
memset(histogram, 0, HIST_SIZE*sizeof(double));
// read chain file
for(n = 0; n < NSTATES/PRINT_FREQ; n++) {
chain_file >> dud;
for(i = 0; i < NPARAMS; i++)
chain_file >> state_cur[i];
chain_file >> xi;
if(n > BURN_IN * NSTATES/PRINT_FREQ) {
xid = (XRES-1) * (state_cur[XPARAM] - XMIN) / (XMAX - XMIN);
yid = (YRES-1) * (state_cur[YPARAM] - YMIN) / (YMAX - YMIN);
histogram[xid + yid*XRES] += 1.0 / xi;
}
}
// print to file to be plotted in SciDavis
ofstream hist_file(file_name_char);
cout << "Printing histogram file: " << file_name_char << endl << endl;
for(j = 0; j < YRES; j++) {
for(i = 0; i < XRES; i++) {
hist_file << (histogram[i + j*XRES] > 0 ? log(histogram[i + j*XRES]) : 0.0) << ' ' ;
}
hist_file << endl;
}
hist_file.close();
delete[] state_range, state_cur, histogram;
return 0;
} | [
"hemicuda71rocks@yahoo.com"
] | hemicuda71rocks@yahoo.com |
4c18cc80796fe03be19595db9d7490241a2207e1 | 4896e73d08739ccc69f67090c7c6c708eea0edf9 | /test/Classes/Native/UnityEngine.IMGUIModule.cpp | d5ea0115e32d11f1dca9295db7be99041d600a33 | [] | no_license | chiii0916/GoogleVR_Fire | 4a0268fe76416c2b0f975a3286a8b28d35119a46 | 3e8aa89d278d05392664ab4f307c54b5fc1e3fda | refs/heads/main | 2023-03-25T04:35:59.390138 | 2021-03-25T02:57:54 | 2021-03-25T02:57:54 | 348,572,779 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 131 | cpp | version https://git-lfs.github.com/spec/v1
oid sha256:f3e9f8e0bdfd23c997d35c7680336a832837d50626c03fa4602e497585a17daa
size 761007
| [
"cvcv232318@gmail.com"
] | cvcv232318@gmail.com |
d2785c56b4387e07464f5637335c7679912f7c6f | 3b37295cd108961c512db0d54cbeaf32e30c81c1 | /raycast.cpp | 0de75f7ec9d9ce2b56b3d3eca93e7952a3fa2336 | [] | no_license | Nuos/renderer | b85ac6ebf0eec7fe6206af226644f784cd398c31 | a8e0ba889c53cd4c11496230e2f8cc22e7f69093 | refs/heads/master | 2021-01-21T16:38:32.118725 | 2014-01-17T00:31:55 | 2014-01-17T00:31:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,437 | cpp | #include "mathlib3d.h"
#include <gl/freeglut.h>
#include <gl/gl.h>
#include "raycast.h"
bool rayCast(int x, int y,point3D corner,vec3D boxSize, point3D campos,vec3D rotation) {
GLdouble pNear[3];
GLdouble pFar[3];
float inter[3]; // intersection point
//get 3D position of mouse cursor on near and far clipping planes
Get3DPos(x, y, 0.0, pNear);
Get3DPos(x, y, 1.0, pFar);
//create a ray originating at the camera position, and using the vector between the two points for the direction
//vec3D newRayOrigin(myCam->m_pos.x, myCam->m_pos.y, myCam->m_pos.z);
vec3D newRayOrigin(campos.x,campos.y,campos.z);
//ray direction is the vector (pFar - pNear)
vec3D newRayDir(pFar[0] - newRayOrigin.x,pFar[1] - newRayOrigin.y,pFar[2] - newRayOrigin.z);
//normalize the ray direction
newRayDir.length();
newRayDir.normalize();
//find d (normal of plane coords * point on plane coords * -1
//test + find the point of intersection
if (rayBoxTest(newRayDir, newRayOrigin , inter, corner, boxSize, rotation)) {
return true;
}
else {
return false;
}
}
// takes a defining corners and tests if its in the box
bool rayBoxTest(vec3D newRayDir, vec3D newRayOrigin , float inter[], point3D corner,vec3D boxSize,vec3D rotation) {
//calculate points from from size + corner point
point3D p1 = corner;
point3D p2(corner.x - boxSize.x, corner.y, corner.z);
point3D p3(corner.x, corner.y - boxSize.y, corner.z);
point3D p4(corner.x - boxSize.x, corner.y - boxSize.y, corner.z);
point3D p5(corner.x, corner.y,corner.z- boxSize.z);
point3D p6(corner.x - boxSize.x, corner.y, corner.z- boxSize.z);
point3D p7(corner.x, corner.y- boxSize.y, corner.z-boxSize.z);
point3D p8(corner.x- boxSize.x, corner.y - boxSize.y, corner.z-boxSize.z);
float d;
//calculate vectors and normal for each face
vec3D v12 = createVec(p1,p2);
vec3D v13 = createVec(p1,p3);
vec3D v56 = createVec(p5,p6);
vec3D v57 = createVec(p5,p7);
vec3D v15 = createVec(p1,p5);
vec3D v34 = createVec(p3,p4);
vec3D v37 = createVec(p3,p7);
vec3D v68 = createVec(p6,p8);
vec3D v48 = createVec(p4,p8);
//find the normal for each face + normalize
vec3D norm = crossVec(v12,v13); norm.normalize();
vec3D norm2 = crossVec(v56,v57); norm2.normalize();
vec3D norm3 = crossVec(v15, v12); norm3.normalize();
vec3D norm4 = crossVec(v34,v37); norm4.normalize();
vec3D norm5 = crossVec(v15,v13); norm5.normalize();
vec3D norm6 = crossVec(v68, v48); norm6.normalize();
//front face check
d = -1*(norm.x*p1.x +norm.y*p1.y + norm.z*p1.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm, inter, d, corner, boxSize,rotation))
return true;
//find the normal for back
d = -1*(norm2.x*p5.x + norm2.y*p5.y + norm2.z*p5.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm, inter, d, corner, boxSize,rotation))
return true;
//top normal
d = -1*(norm3.x*p1.x +norm3.y*p1.y + norm3.z*p1.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm3, inter, d, corner, boxSize,rotation))
return true;
//bottom normal
d = -1*(norm4.x*p3.x +norm4.y*p3.y + norm4.z*p3.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm4, inter, d, corner, boxSize,rotation))
return true;
//side 1
d = -1*(norm5.x*p1.x +norm5.y*p1.y + norm5.z*p1.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm5, inter, d, corner, boxSize,rotation))
return true;
//side 2
d = -1*(norm6.x*p8.x + norm2.y*p8.y + norm2.z*p8.z);
if (rayPlaneTest(newRayDir,newRayOrigin, norm6, inter, d, corner, boxSize,rotation))
return true;
return false;
}
bool rayPlaneTest(vec3D newRayDir, vec3D newRayOrigin ,vec3D groundPlaneNorm,float inter[],float &d, point3D corner,vec3D boxSize, vec3D rotation) {
//first compute N dot Ray direction, if 0, no intersection because parallel
if (dotVec(groundPlaneNorm,newRayDir) == 0) {
inter[0] = 1000;
inter[1] = 1000;
inter[2] = 1000;
return false;
}
//since point on the ray = rayorg + t*raydirection
//solve for t such that POI = rayorg + t*raydirection
float t = -1*( ( dotVec(groundPlaneNorm,newRayOrigin) + d) / dotVec(groundPlaneNorm, newRayDir) );
// intersection point = newRayOrigin + t*newRayDir
vec3D poi = (newRayOrigin + (newRayDir*t));
point3D fpoi = rotateX(point3D(poi.x,poi.y,poi.z),-rotation.x);
fpoi = rotateY(fpoi, -rotation.y);
fpoi = rotateZ(fpoi, -rotation.z);
inter[0] = fpoi.x;
inter[1] = fpoi.y;
inter[2] = fpoi.z;
//preform a check on that face that POI is within the face
if ( ((inter[0] <= corner.x && inter[0] >= corner.x - boxSize.x) || (inter[0] <= corner.x - boxSize.x && inter[0] >= corner.x ))
&& ((inter[1] <= corner.y && inter[1] >= corner.y - boxSize.y) || (inter[1] <= corner.y - boxSize.y && inter[1] >= corner.y ))
&& ((inter[2] <= corner.z && inter[2] >= corner.z - boxSize.z)) || (inter[2] <= corner.z - boxSize.z && inter[2] >= corner.z ))
{
//then it is in the 1 face
return true;
}
else {
// not in the face
return false;
}
}
void Get3DPos(int x, int y, float winz, GLdouble point[3])
{
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
//get the matrices
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
glGetDoublev( GL_PROJECTION_MATRIX, projection );
glGetIntegerv( GL_VIEWPORT, viewport );
//"un-project" the 2D point giving the 3D position corresponding to the provided depth (winz)
gluUnProject( (float)(x), (float)(viewport[3]-y), winz, modelview, projection, viewport, &point[0], &point[1], &point[2]);
}
| [
"adambysice@gmail.com"
] | adambysice@gmail.com |
bd93fd2109c59526b8d49d880437683780cc71b6 | 1bbb19e305a39a046c50e046dbb574f6b321b8dd | /libraries/TEA5767Radio/TEA5767Radio.cpp | f5c22e39b8f387fba22ed016f55b8da26de3a6e5 | [] | no_license | car13romani/arduino | 22b36ab9be7eb8a854488727396e2b2d137dae14 | 96924dc511d0a5867b87fbdab51318a06127606f | refs/heads/master | 2019-07-11T19:22:37.895698 | 2017-11-16T17:26:01 | 2017-11-16T17:26:01 | 110,992,920 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,442 | cpp | /*
TEA5767 I2C FM Radio Library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
The latest version of this library can always be found at
http://arduiniana.org.
Simon Monk 2013
*/
#include <Arduino.h>
#include <TEA5767Radio.h>
TEA5767Radio::TEA5767Radio(int address)
{
_address = address;
}
TEA5767Radio::TEA5767Radio()
{
_address = 0x60;
}
void TEA5767Radio::setFrequency(float frequency)
{
unsigned int frequencyB = 4 * (frequency * 1000000 + 225000) / 32768;
byte frequencyH = frequencyB >> 8;
byte frequencyL = frequencyB & 0XFF;
Wire.beginTransmission(_address);
Wire.write(frequencyH);
Wire.write(frequencyL);
Wire.write(0xB0);
Wire.write(0x10);
Wire.write(0x00);
Wire.endTransmission();
delay(100);
}
| [
"car13romani@gmail.com"
] | car13romani@gmail.com |
b1b5c0f1eca5df51cf24a96094c6f2b8a81c939e | 77d72a16cba98842190b6f03d424fccca9708adb | /td4/balloons.cpp | 0f66ace2c471970b2350adb8849d2e79308652a6 | [] | no_license | gabsn/competitive-programming | f883a0d2bae3bf7cb9e1eaaa9699b9309d750679 | ff128bc4991b149c9d28f5ad1284063485bd6f34 | refs/heads/master | 2021-01-23T03:42:46.027810 | 2017-11-06T20:27:58 | 2017-11-06T20:27:58 | 86,110,190 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,665 | cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define v(x) vector<x >
#define vv(x) vector<vector<x > >
#define it(x) std::vector<x>::iterator
#define rit(x) std::vector<x>::reverse_iterator
#define NMAX 6
struct Point {
int x, y, z, id;
double box_distance, r;
};
Point points[6];
v(Point) balloons;
double distances[6][6];
void display(int n) {
for (int i=0; i<n; ++i) {
cout << points[i].x << " " << points[i].y << " " << points[i].z << " box_distance : " << points[i].box_distance << endl;
}
}
void distance(int n) {
for (int i=0; i<n; ++i) {
for (int j=i; j<n; ++j) {
distances[i][j] = sqrt(pow(points[i].x-points[j].x,2) + pow(points[i].y-points[j].y,2) + pow(points[i].z-points[j].z,2));
if (i != j)
distances[j][i] = distances[i][j];
}
}
}
int main() {
ios_base::sync_with_stdio(0);
cout << setprecision(50);
int n, box_volume;
double empty_volume, result;
v(int) first_corner(3), opposite_corner(3);
int i_test_case = 0;
do {
i_test_case++;
cin >> n;
if (n == 0)
return 0;
for (int i=0; i<3; ++i)
cin >> first_corner[i];
for (int i=0; i<3; ++i)
cin >> opposite_corner[i];
for (int i=0; i<n; ++i) {
int x,y,z;
cin >> x >> y >> z;
if (x < opposite_corner[0] && x > first_corner[0] &&
y < opposite_corner[1] && y > first_corner[1] &&
z < opposite_corner[2] && z > first_corner[2]) {
points[i].x = x;
points[i].y = y;
points[i].z = z;
points[i].box_distance = min({abs(points[i].x-first_corner[0]),abs(points[i].x-opposite_corner[0]),
abs(points[i].y-first_corner[1]),abs(points[i].y-opposite_corner[1]),
abs(points[i].z-first_corner[2]),abs(points[i].z-opposite_corner[2])});
} else {
n--;
i--;
}
}
int permutation[n];
for (int i=0; i<n; ++i)
permutation[i] = i;
box_volume = abs((opposite_corner[0]-first_corner[0])*
(opposite_corner[1]-first_corner[1])*
(opposite_corner[2]-first_corner[2]));
result = box_volume;
distance(n);
//for (int i=0; i<n; ++i) {
// for (int j=0; j<n; ++j)
// cout << distances[i][j] << " ";
// cout << endl;
//}
do {
empty_volume = box_volume;
balloons.clear();
for (auto i : permutation) {
//cout << i << " ";
Point p = points[i];
double r = p.box_distance;
for (auto b : balloons) {
r = min(r,max(distances[i][b.id]-b.r,(double)0));
}
double volume = 4.0/3*M_PI*pow(r,3);
//cout << "volume : " << volume << " & r : " << r << endl;
empty_volume -= volume;
if (r != 0) {
p.r = r;
p.id = i;
balloons.push_back(p);
}
}
//cout << endl << "empty_volume : " << empty_volume << endl;
result = min(result, empty_volume);
} while (next_permutation(permutation, permutation+n));
cout << "Box " << i_test_case << ": " << round(result) << endl << endl;
} while (1);
return 0;
}
| [
"gabin.marignier@gmail.com"
] | gabin.marignier@gmail.com |
1adfa2c863ca54889bc7e6521c4a2bccc48d09af | 58a0ba5ee99ec7a0bba36748ba96a557eb798023 | /CodeForces/Complete/700-799/792C-DivideByThree.cpp | 88a4867e2a2c7102e9f3d978b4e3c5078489dcbd | [
"MIT"
] | permissive | adityanjr/code-DS-ALGO | 5bdd503fb5f70d459c8e9b8e58690f9da159dd53 | 1c104c33d2f56fe671d586b702528a559925f875 | refs/heads/master | 2022-10-22T21:22:09.640237 | 2022-10-18T15:38:46 | 2022-10-18T15:38:46 | 217,567,198 | 40 | 54 | MIT | 2022-10-18T15:38:47 | 2019-10-25T15:50:28 | C++ | UTF-8 | C++ | false | false | 1,807 | cpp | #include <iostream>
int main(){
std::ios_base::sync_with_stdio(false);
std::string s; std::cin >> s;
int n(0);
bool hasZero(false);
for(int p = 0; p < s.size(); p++){n = 10 * n + (s[p] - '0'); n %= 3; hasZero |= (s[p] == '0');}
if(n == 0){std::cout << s << std::endl; return 0;}
long posA(-1), posB(-1); std::string tA(""), tB("");
for(int p = s.size() - 1; p >= 0; p--){if((s[p] - '0') % 3 == n){posA = p; break;}}
if(posA > 0){
for(int p = 0; p < s.size(); p++){if(p == posA){continue;}; std::cout << s[p];}
std::cout << std::endl;
return 0;
}
else if(posA == 0){
long ind(1);
while(s[ind] == '0'){++ind;}
for(int p = ind; p < s.size(); p++){tA += s[p];}
if(tA.size() == 0 && hasZero){tA = "0";}
}
posA = posB = -1;
int nB = 3 - n;
for(int p = s.size() - 1; p >= 0; p--){
if(((s[p] - '0') % 3 == nB) && (posA < 0)){posA = p;}
else if(((s[p] - '0') % 3 == nB) && (posA > 0)){posB = p;}
if(posA >= 0 && posB >= 0){break;}
}
if((tA.size() <= 0) && (posA < 0 || posB < 0 || s.size() <= 2)){std::cout << "-1" << std::endl; return 0;}
if(posA >= 0 && posB >= 0){
if(posB > 0){for(int p = 0; p < s.size(); p++){if(p == posA || p == posB){continue;}; tB += s[p];}}
else{
long ind(1);
while(s[ind] == '0'){++ind;}
if(ind == posA){++ind; while(s[ind] == '0'){++ind;}}
for(int p = ind; p < s.size(); p++){if(p == posA || p == posB){continue;}; tB += s[p];}
}
if(tB.size() == 0 && hasZero){tB = "0";}
}
if(tA.size() <= 0 && tB.size() <= 0){std::cout << "-1" << std::endl;}
else{std::cout << ((tA.size() > tB.size()) ? tA : tB) << std::endl;}
return 0;
}
| [
"samant04aditya@gmail.com"
] | samant04aditya@gmail.com |
58227d4056d13ce3f282300cd399228670452cf1 | 52c80e385eebb5010c8f27f164d900fb77fdeddb | /69/uniform/time | d01f0013e03f2032a364e2b93c219d3bc3911902 | [] | no_license | urfcRepo/scriptingPython | ad2fa6fd1799841ea3736eebef61b667e48acc3a | 9dd0813630b77e7f55575021a2e1a8a07f9680b8 | refs/heads/main | 2023-05-09T18:14:37.018179 | 2021-06-09T01:24:09 | 2021-06-09T01:24:09 | 358,670,265 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 964 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1812 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "69/uniform";
object time;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
value 69;
name "69";
index 69;
deltaT 1;
deltaT0 1;
// ************************************************************************* //
| [
"blandy.ps@chetumal.tecnm.mx"
] | blandy.ps@chetumal.tecnm.mx | |
96c1d033a965007d04d6ececb7761570bbea7827 | d4b7687fa0c1f3787238eaac93fdaf8d62cf7c78 | /C++/문제 1-2-1.cpp | 012958822f54c72c17107ce627179bff1b344b73 | [] | no_license | dlswer23/cpp | 6f4d9d99471be7df87e0914c04bb7be9261bb893 | c257fd961fd87845198e7a3f1e114c8614a39464 | refs/heads/master | 2023-02-21T20:58:37.740639 | 2021-01-28T14:18:08 | 2021-01-28T14:18:08 | 284,013,836 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 274 | cpp | #include<iostream>
int main() {
int num1 = 20, num2 = 30;
swap(&num1, &num2);
count << num1 << ' ' << num2 << endl;
char ch1 = 'A', ch2 << endl;
double dbl1 = 1.111, dbl2 = 5.555;
swap(&dbl1, &dbl2);
cout << dbl1 << ' ' << dbl2 << endl;
return 0;
} | [
"lbj4298@naver.com"
] | lbj4298@naver.com |
cd1daeb90a831d7c4279bede126cb98424e4da61 | 3ff1fe3888e34cd3576d91319bf0f08ca955940f | /waf/src/v20180125/model/DescribeDomainsResponse.cpp | 5621fd738bc319f3dd54d985c0916fbea5a5d000 | [
"Apache-2.0"
] | permissive | TencentCloud/tencentcloud-sdk-cpp | 9f5df8220eaaf72f7eaee07b2ede94f89313651f | 42a76b812b81d1b52ec6a217fafc8faa135e06ca | refs/heads/master | 2023-08-30T03:22:45.269556 | 2023-08-30T00:45:39 | 2023-08-30T00:45:39 | 188,991,963 | 55 | 37 | Apache-2.0 | 2023-08-17T03:13:20 | 2019-05-28T08:56:08 | C++ | UTF-8 | C++ | false | false | 5,281 | cpp | /*
* 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/waf/v20180125/model/DescribeDomainsResponse.h>
#include <tencentcloud/core/utils/rapidjson/document.h>
#include <tencentcloud/core/utils/rapidjson/writer.h>
#include <tencentcloud/core/utils/rapidjson/stringbuffer.h>
using TencentCloud::CoreInternalOutcome;
using namespace TencentCloud::Waf::V20180125::Model;
using namespace std;
DescribeDomainsResponse::DescribeDomainsResponse() :
m_totalHasBeenSet(false),
m_domainsHasBeenSet(false)
{
}
CoreInternalOutcome DescribeDomainsResponse::Deserialize(const string &payload)
{
rapidjson::Document d;
d.Parse(payload.c_str());
if (d.HasParseError() || !d.IsObject())
{
return CoreInternalOutcome(Core::Error("response not json format"));
}
if (!d.HasMember("Response") || !d["Response"].IsObject())
{
return CoreInternalOutcome(Core::Error("response `Response` is null or not object"));
}
rapidjson::Value &rsp = d["Response"];
if (!rsp.HasMember("RequestId") || !rsp["RequestId"].IsString())
{
return CoreInternalOutcome(Core::Error("response `Response.RequestId` is null or not string"));
}
string requestId(rsp["RequestId"].GetString());
SetRequestId(requestId);
if (rsp.HasMember("Error"))
{
if (!rsp["Error"].IsObject() ||
!rsp["Error"].HasMember("Code") || !rsp["Error"]["Code"].IsString() ||
!rsp["Error"].HasMember("Message") || !rsp["Error"]["Message"].IsString())
{
return CoreInternalOutcome(Core::Error("response `Response.Error` format error").SetRequestId(requestId));
}
string errorCode(rsp["Error"]["Code"].GetString());
string errorMsg(rsp["Error"]["Message"].GetString());
return CoreInternalOutcome(Core::Error(errorCode, errorMsg).SetRequestId(requestId));
}
if (rsp.HasMember("Total") && !rsp["Total"].IsNull())
{
if (!rsp["Total"].IsUint64())
{
return CoreInternalOutcome(Core::Error("response `Total` IsUint64=false incorrectly").SetRequestId(requestId));
}
m_total = rsp["Total"].GetUint64();
m_totalHasBeenSet = true;
}
if (rsp.HasMember("Domains") && !rsp["Domains"].IsNull())
{
if (!rsp["Domains"].IsArray())
return CoreInternalOutcome(Core::Error("response `Domains` is not array type"));
const rapidjson::Value &tmpValue = rsp["Domains"];
for (rapidjson::Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr)
{
DomainInfo item;
CoreInternalOutcome outcome = item.Deserialize(*itr);
if (!outcome.IsSuccess())
{
outcome.GetError().SetRequestId(requestId);
return outcome;
}
m_domains.push_back(item);
}
m_domainsHasBeenSet = true;
}
return CoreInternalOutcome(true);
}
string DescribeDomainsResponse::ToJsonString() const
{
rapidjson::Document value;
value.SetObject();
rapidjson::Document::AllocatorType& allocator = value.GetAllocator();
if (m_totalHasBeenSet)
{
rapidjson::Value iKey(rapidjson::kStringType);
string key = "Total";
iKey.SetString(key.c_str(), allocator);
value.AddMember(iKey, m_total, allocator);
}
if (m_domainsHasBeenSet)
{
rapidjson::Value iKey(rapidjson::kStringType);
string key = "Domains";
iKey.SetString(key.c_str(), allocator);
value.AddMember(iKey, rapidjson::Value(rapidjson::kArrayType).Move(), allocator);
int i=0;
for (auto itr = m_domains.begin(); itr != m_domains.end(); ++itr, ++i)
{
value[key.c_str()].PushBack(rapidjson::Value(rapidjson::kObjectType).Move(), allocator);
(*itr).ToJsonObject(value[key.c_str()][i], allocator);
}
}
rapidjson::Value iKey(rapidjson::kStringType);
string key = "RequestId";
iKey.SetString(key.c_str(), allocator);
value.AddMember(iKey, rapidjson::Value().SetString(GetRequestId().c_str(), allocator), allocator);
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
value.Accept(writer);
return buffer.GetString();
}
uint64_t DescribeDomainsResponse::GetTotal() const
{
return m_total;
}
bool DescribeDomainsResponse::TotalHasBeenSet() const
{
return m_totalHasBeenSet;
}
vector<DomainInfo> DescribeDomainsResponse::GetDomains() const
{
return m_domains;
}
bool DescribeDomainsResponse::DomainsHasBeenSet() const
{
return m_domainsHasBeenSet;
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
97729b9c00d25f06826fe8520f272238b484cf17 | 923de32093b57ee6825eede83edade1c292d2bc5 | /x86_64/host/usr/x86_64-linux-gnu/sysroot/usr/local/lib/wx/include/gtk2-unicode-static-3.0/wx/setup.h | 7fa863c641a9c72cb3647f1a85370b0254ee6b9c | [] | no_license | yasriady/toolchain2 | 1d7282cde4ef2ae4a59bc3e768bae9f058fdf349 | 65ec2fc03a3c9558a8ef5f87070847d8989b790d | refs/heads/master | 2020-12-07T02:22:08.658389 | 2016-01-11T09:58:43 | 2016-01-11T09:58:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,539 | h | /* lib/wx/include/gtk2-unicode-static-3.0/wx/setup.h. Generated from setup.h.in by configure. */
/* This define (__WX_SETUP_H__) is used both to ensure setup.h is included
* only once and to indicate that we are building using configure. */
#ifndef __WX_SETUP_H__
#define __WX_SETUP_H__
/* never undefine inline or const keywords for C++ compilation */
#ifndef __cplusplus
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define as __inline if that's what the C compiler calls it. */
/* #undef inline */
#endif /* __cplusplus */
/* fill in with the string wxGetOsDescription() will return */
#define WXWIN_OS_DESCRIPTION "Linux 3.16.0-57-generic x86_64"
/* the installation location prefix from configure */
#define wxINSTALL_PREFIX "/opt/dveltool/toolchain/x86_64/sysroot/usr/local"
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if ssize_t type is available. */
#define HAVE_SSIZE_T 1
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define this to get extra features from GNU libc. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define this if your version of GTK+ is greater than 1.2.7 */
/* #undef __WXGTK127__ */
/* Define this if your version of GTK+ is greater than 2.0 */
#define __WXGTK20__ 1
/* Define this if your version of GTK+ is greater than 2.6 */
/* #undef __WXGTK26__ */
/* Define this if your version of GTK+ is greater than 2.10 */
#define __WXGTK210__ 1
/* Define this if your version of GTK+ is greater than 2.18 */
#define __WXGTK218__ 1
/* Define this if your version of GTK+ is >= 3.0 */
/* #undef __WXGTK3__ */
/* Define this if you want to use GPE features */
/* #undef __WXGPE__ */
/* Define this if your version of Motif is greater than 2.0 */
/* #undef __WXMOTIF20__ */
/* Define this if you are using Lesstif */
/* #undef __WXLESSTIF__ */
/*
* Define to 1 for Unix[-like] system
*/
#define wxUSE_UNIX 1
#define __UNIX__ 1
/* #undef __AIX__ */
/* #undef __BSD__ */
/* #undef __DARWIN__ */
/* #undef __EMX__ */
/* #undef __FREEBSD__ */
/* #undef __HPUX__ */
#define __LINUX__ 1
/* #undef __NETBSD__ */
/* #undef __OPENBSD__ */
/* #undef __OSF__ */
/* #undef __QNX__ */
/* #undef __SGI__ */
/* #undef __SOLARIS__ */
/* #undef __SUN__ */
/* #undef __SUNOS__ */
/* #undef __SVR4__ */
/* #undef __SYSV__ */
/* #undef __ULTRIX__ */
/* #undef __UNIXWARE__ */
/* #undef __VMS__ */
/* #undef __IA64__ */
/* #undef __ALPHA__ */
/* NanoX (with wxX11) */
#define wxUSE_NANOX 0
/* PowerPC Darwin & Mac OS X */
/* #undef __POWERPC__ */
/* #undef TARGET_CARBON */
/* Hack to make IOGraphicsTypes.h not define Point conflicting with MacTypes */
/* #undef __Point__ */
/* MS-DOS with DJGPP */
/* #undef __DOS__ */
/* Stupid hack; __WINDOWS__ clashes with wx/defs.h */
#ifndef __WINDOWS__
/* #undef __WINDOWS__ */
#endif
#ifndef __WIN32__
/* #undef __WIN32__ */
#endif
#ifndef __GNUWIN32__
/* #undef __GNUWIN32__ */
#endif
#ifndef STRICT
/* #undef STRICT */
#endif
#ifndef WINVER
/* #undef WINVER */
#endif
/* OS/2 with EMX */
/* #undef __OS2__ */
/* --- start common options --- */
#ifndef wxUSE_GUI
#define wxUSE_GUI 1
#endif
#define WXWIN_COMPATIBILITY_2_6 0
#define WXWIN_COMPATIBILITY_2_8 1
#define wxDIALOG_UNIT_COMPATIBILITY 0
#define wxUSE_ON_FATAL_EXCEPTION 1
#define wxUSE_STACKWALKER 1
#define wxUSE_DEBUGREPORT 1
#define wxUSE_DEBUG_CONTEXT 0
#define wxUSE_MEMORY_TRACING 0
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
#define wxUSE_DEBUG_NEW_ALWAYS 0
#ifndef wxUSE_UNICODE
#define wxUSE_UNICODE 1
#endif
#define wxUSE_WCHAR_T 1
#define wxUSE_EXCEPTIONS 1
#define wxUSE_EXTENDED_RTTI 0
#define wxUSE_LOG 1
#define wxUSE_LOGWINDOW 1
#define wxUSE_LOGGUI 1
#define wxUSE_LOG_DIALOG 1
#define wxUSE_CMDLINE_PARSER 1
#define wxUSE_THREADS 1
#define wxUSE_STREAMS 1
#define wxUSE_PRINTF_POS_PARAMS 1
#define wxUSE_COMPILER_TLS 1
#define wxUSE_STL 0
#if defined(__DMC__) || defined(__WATCOMC__) \
|| (defined(_MSC_VER) && _MSC_VER < 1200)
#define wxUSE_STD_DEFAULT 0
#else
#define wxUSE_STD_DEFAULT 0
#endif
#define wxUSE_STD_CONTAINERS 0
#define wxUSE_STD_IOSTREAM 1
#define wxUSE_STD_STRING 1
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
#define wxUSE_IOSTREAMH 0
#define wxUSE_LONGLONG 1
#define wxUSE_BASE64 1
#define wxUSE_CONSOLE_EVENTLOOP 1
#define wxUSE_FILE 1
#define wxUSE_FFILE 1
#define wxUSE_FSVOLUME 1
#define wxUSE_STDPATHS 1
#define wxUSE_TEXTBUFFER 1
#define wxUSE_TEXTFILE 1
#define wxUSE_INTL 1
#define wxUSE_XLOCALE 1
#define wxUSE_DATETIME 1
#define wxUSE_TIMER 1
#define wxUSE_STOPWATCH 1
#define wxUSE_FSWATCHER 1
#define wxUSE_CONFIG 1
#define wxUSE_CONFIG_NATIVE 1
#define wxUSE_DIALUP_MANAGER 1
#define wxUSE_DYNLIB_CLASS 1
#define wxUSE_DYNAMIC_LOADER 1
#define wxUSE_SOCKETS 1
#define wxUSE_IPV6 0
#define wxUSE_FILESYSTEM 1
#define wxUSE_FS_ZIP 1
#define wxUSE_FS_ARCHIVE 1
#define wxUSE_FS_INET 1
#define wxUSE_ARCHIVE_STREAMS 1
#define wxUSE_ZIPSTREAM 1
#define wxUSE_TARSTREAM 1
#define wxUSE_ZLIB 1
#define wxUSE_APPLE_IEEE 1
#define wxUSE_JOYSTICK 1
#define wxUSE_FONTENUM 1
#define wxUSE_FONTMAP 1
#define wxUSE_MIMETYPE 1
#define wxUSE_PROTOCOL 1
#define wxUSE_PROTOCOL_FILE 1
#define wxUSE_PROTOCOL_FTP 1
#define wxUSE_PROTOCOL_HTTP 1
#define wxUSE_URL 1
#define wxUSE_URL_NATIVE 0
#define wxUSE_VARIANT 1
#define wxUSE_ANY 1
#define wxUSE_REGEX 1
#define wxUSE_SYSTEM_OPTIONS 1
#define wxUSE_SOUND 1
#define wxUSE_MEDIACTRL 0
#define wxUSE_XRC 1
#define wxUSE_XML 1
#define wxUSE_AUI 1
#define wxUSE_RIBBON 1
#define wxUSE_PROPGRID 1
#define wxUSE_STC 1
#define wxUSE_WEBVIEW 0
#ifdef __WXMSW__
#define wxUSE_WEBVIEW_IE 0
#else
#define wxUSE_WEBVIEW_IE 0
#endif
#if defined(__WXGTK__) || defined(__WXOSX__)
#define wxUSE_WEBVIEW_WEBKIT 0
#else
#define wxUSE_WEBVIEW_WEBKIT 0
#endif
#ifdef _MSC_VER
# if _MSC_VER >= 1310
#define wxUSE_GRAPHICS_CONTEXT 1
# else
# define wxUSE_GRAPHICS_CONTEXT 1
# endif
#else
# define wxUSE_GRAPHICS_CONTEXT 1
#endif
#define wxUSE_CAIRO 1
#define wxUSE_CONTROLS 1
#define wxUSE_MARKUP 1
#define wxUSE_POPUPWIN 1
#define wxUSE_TIPWINDOW 1
#define wxUSE_ANIMATIONCTRL 1
#define wxUSE_BANNERWINDOW 1
#define wxUSE_BUTTON 1
#define wxUSE_BMPBUTTON 1
#define wxUSE_CALENDARCTRL 1
#define wxUSE_CHECKBOX 1
#define wxUSE_CHECKLISTBOX 1
#define wxUSE_CHOICE 1
#define wxUSE_COLLPANE 1
#define wxUSE_COLOURPICKERCTRL 1
#define wxUSE_COMBOBOX 1
#define wxUSE_COMMANDLINKBUTTON 1
#define wxUSE_DATAVIEWCTRL 1
#define wxUSE_DATEPICKCTRL 1
#define wxUSE_DIRPICKERCTRL 1
#define wxUSE_EDITABLELISTBOX 1
#define wxUSE_FILECTRL 1
#define wxUSE_FILEPICKERCTRL 1
#define wxUSE_FONTPICKERCTRL 1
#define wxUSE_GAUGE 1
#define wxUSE_HEADERCTRL 1
#define wxUSE_HYPERLINKCTRL 1
#define wxUSE_LISTBOX 1
#define wxUSE_LISTCTRL 1
#define wxUSE_RADIOBOX 1
#define wxUSE_RADIOBTN 1
#define wxUSE_RICHMSGDLG 1
#define wxUSE_SCROLLBAR 1
#define wxUSE_SEARCHCTRL 1
#define wxUSE_SLIDER 1
#define wxUSE_SPINBTN 1
#define wxUSE_SPINCTRL 1
#define wxUSE_STATBOX 1
#define wxUSE_STATLINE 1
#define wxUSE_STATTEXT 1
#define wxUSE_STATBMP 1
#define wxUSE_TEXTCTRL 1
#define wxUSE_TIMEPICKCTRL 1
#define wxUSE_TOGGLEBTN 1
#define wxUSE_TREECTRL 1
#define wxUSE_TREELISTCTRL 1
#define wxUSE_STATUSBAR 1
#define wxUSE_NATIVE_STATUSBAR 1
#define wxUSE_TOOLBAR 1
#define wxUSE_TOOLBAR_NATIVE 1
#define wxUSE_NOTEBOOK 1
#define wxUSE_LISTBOOK 1
#define wxUSE_CHOICEBOOK 1
#define wxUSE_TREEBOOK 1
#define wxUSE_TOOLBOOK 1
#define wxUSE_TASKBARICON 1
#define wxUSE_GRID 1
#define wxUSE_MINIFRAME 1
#define wxUSE_COMBOCTRL 1
#define wxUSE_ODCOMBOBOX 1
#define wxUSE_BITMAPCOMBOBOX 1
#define wxUSE_REARRANGECTRL 1
#define wxUSE_ACCEL 1
#define wxUSE_ARTPROVIDER_STD 1
#define wxUSE_ARTPROVIDER_TANGO 0
#define wxUSE_HOTKEY 0
#define wxUSE_CARET 1
#define wxUSE_DISPLAY 1
#define wxUSE_GEOMETRY 1
#define wxUSE_IMAGLIST 1
#define wxUSE_INFOBAR 1
#define wxUSE_MENUS 1
#define wxUSE_NOTIFICATION_MESSAGE 1
#define wxUSE_PREFERENCES_EDITOR 1
#define wxUSE_RICHTOOLTIP 1
#define wxUSE_SASH 1
#define wxUSE_SPLITTER 1
#define wxUSE_TOOLTIPS 1
#define wxUSE_VALIDATORS 1
#ifdef __WXMSW__
#define wxUSE_AUTOID_MANAGEMENT 0
#else
#define wxUSE_AUTOID_MANAGEMENT 0
#endif
#define wxUSE_COMMON_DIALOGS 0
#define wxUSE_BUSYINFO 1
#define wxUSE_CHOICEDLG 1
#define wxUSE_COLOURDLG 1
#define wxUSE_DIRDLG 1
#define wxUSE_FILEDLG 1
#define wxUSE_FINDREPLDLG 1
#define wxUSE_FONTDLG 1
#define wxUSE_MSGDLG 1
#define wxUSE_PROGRESSDLG 1
#define wxUSE_STARTUP_TIPS 1
#define wxUSE_TEXTDLG 1
#define wxUSE_NUMBERDLG 1
#define wxUSE_SPLASH 1
#define wxUSE_WIZARDDLG 1
#define wxUSE_ABOUTDLG 1
#define wxUSE_FILE_HISTORY 1
#define wxUSE_METAFILE 0
#define wxUSE_ENH_METAFILE 0
#define wxUSE_WIN_METAFILES_ALWAYS 0
#define wxUSE_MDI 1
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
#define wxUSE_MDI_ARCHITECTURE 1
#define wxUSE_PRINTING_ARCHITECTURE 1
#define wxUSE_HTML 1
#define wxUSE_GLCANVAS 0
#define wxUSE_RICHTEXT 1
#define wxUSE_CLIPBOARD 1
#define wxUSE_DATAOBJ 1
#define wxUSE_DRAG_AND_DROP 1
#define wxUSE_ACCESSIBILITY 0
#define wxUSE_SNGLINST_CHECKER 1
#define wxUSE_DRAGIMAGE 1
#define wxUSE_IPC 1
#define wxUSE_HELP 1
#define wxUSE_MS_HTML_HELP 0
#define wxUSE_WXHTML_HELP 1
#define wxUSE_CONSTRAINTS 1
#define wxUSE_SPLINES 1
#define wxUSE_MOUSEWHEEL 1
#define wxUSE_UIACTIONSIMULATOR 1
#define wxUSE_POSTSCRIPT 1
#define wxUSE_AFM_FOR_POSTSCRIPT 1
#define wxUSE_SVG 1
#define wxUSE_DC_TRANSFORM_MATRIX 1
#define wxUSE_IMAGE 1
#define wxUSE_LIBPNG 1
#define wxUSE_LIBJPEG 1
#define wxUSE_LIBTIFF 1
#define wxUSE_TGA 1
#define wxUSE_GIF 1
#define wxUSE_PNM 1
#define wxUSE_PCX 1
#define wxUSE_IFF 1
#define wxUSE_XPM 1
#define wxUSE_ICO_CUR 1
#define wxUSE_PALETTE 1
#define wxUSE_ALL_THEMES 0
#define wxUSE_THEME_GTK 0
#define wxUSE_THEME_METAL 0
#define wxUSE_THEME_MONO 0
#define wxUSE_THEME_WIN32 0
/* --- end common options --- */
/*
* Unix-specific options
*/
#define wxUSE_SELECT_DISPATCHER 1
#define wxUSE_EPOLL_DISPATCHER 1
#define wxUSE_UNICODE_UTF8 0
#define wxUSE_UTF8_LOCALE_ONLY 0
/*
Use GStreamer for Unix.
Default is 0 as this requires a lot of dependencies which might not be
available.
Recommended setting: 1 (wxMediaCtrl won't work by default without it).
*/
#define wxUSE_GSTREAMER 0
/* --- start MSW options --- */
#ifndef wxUSE_UNICODE_MSLU
#define wxUSE_UNICODE_MSLU 0
#endif
#define wxUSE_MFC 0
#define wxUSE_OLE 0
#define wxUSE_OLE_AUTOMATION 0
#define wxUSE_ACTIVEX 0
#define wxUSE_DC_CACHEING 0
#define wxUSE_WXDIB 0
#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
#define wxUSE_REGKEY 0
#define wxUSE_RICHEDIT 1
#define wxUSE_RICHEDIT2 1
#define wxUSE_OWNER_DRAWN 0
#define wxUSE_TASKBARICON_BALLOONS 1
#define wxUSE_UXTHEME 0
#define wxUSE_INKEDIT 0
#define wxUSE_INICONF 0
#define wxUSE_DATEPICKCTRL_GENERIC 0
#define wxUSE_TIMEPICKCTRL_GENERIC 0
#define wxUSE_CRASHREPORT 0
/* --- end MSW options --- */
/*
* Define if your compiler supports the explicit keyword
*/
#define HAVE_EXPLICIT 1
/*
* Define if your compiler has C99 va_copy
*/
#define HAVE_VA_COPY 1
/*
* Define if va_list type is an array
*/
/* #undef VA_LIST_IS_ARRAY */
/*
* Define if the compiler supports variadic macros
*/
#define HAVE_VARIADIC_MACROS 1
/*
* Define if you don't want variadic macros to be used even if they are
* supported by the compiler.
*/
/* #undef wxNO_VARIADIC_MACROS */
/*
* Define if your compiler has std::wstring
*/
#define HAVE_STD_WSTRING 1
/*
* Define if your compiler has compliant std::string::compare
*/
/* #undef HAVE_STD_STRING_COMPARE */
/*
* Define if your compiler has <hash_map>
*/
/* #undef HAVE_HASH_MAP */
/*
* Define if your compiler has <ext/hash_map>
*/
/* #undef HAVE_EXT_HASH_MAP */
/*
* Define if your compiler has std::hash_map/hash_set
*/
/* #undef HAVE_STD_HASH_MAP */
/*
* Define if your compiler has __gnu_cxx::hash_map/hash_set
*/
/* #undef HAVE_GNU_CXX_HASH_MAP */
/*
* Define if your compiler has std::unordered_map
*/
/* #undef HAVE_STD_UNORDERED_MAP */
/*
* Define if your compiler has std::unordered_set
*/
/* #undef HAVE_STD_UNORDERED_SET */
/*
* Define if your compiler has std::tr1::unordered_map
*/
/* #undef HAVE_TR1_UNORDERED_MAP */
/*
* Define if your compiler has std::tr1::unordered_set
*/
/* #undef HAVE_TR1_UNORDERED_SET */
/*
* Define if your compiler has <tr1/type_traits>
*/
#define HAVE_TR1_TYPE_TRAITS 1
/*
* Define if your compiler has <type_traits>
*/
/* #undef HAVE_TYPE_TRAITS */
/*
* Define if the compiler supports simple visibility declarations.
*/
/* #undef HAVE_VISIBILITY */
/*
* Define if the compiler supports GCC's atomic memory access builtins
*/
#define HAVE_GCC_ATOMIC_BUILTINS 1
/*
* Define if compiler's visibility support in libstdc++ is broken
*/
/* #undef HAVE_BROKEN_LIBSTDCXX_VISIBILITY */
/*
* The built-in regex supports advanced REs in additional to POSIX's basic
* and extended. Your system regex probably won't support this, and in this
* case WX_NO_REGEX_ADVANCED should be defined.
*/
/* #undef WX_NO_REGEX_ADVANCED */
/*
* On GNU systems use re_search instead of regexec, since the latter does a
* strlen on the search text affecting the performance of some operations.
*/
/* #undef HAVE_RE_SEARCH */
/*
* Use SDL for audio (Unix)
*/
#define wxUSE_LIBSDL 0
/*
* Compile sound backends as plugins
*/
#define wxUSE_PLUGINS 0
/*
* Use GTK print for printing under GTK+ 2.10+
*/
#define wxUSE_GTKPRINT 1
/*
* Use GNOME VFS for MIME types
*/
#define wxUSE_LIBGNOMEVFS 0
/*
* Use the Hildon framework
*/
#define wxUSE_LIBHILDON 0
/*
* Use the Hildon 2.0 framework
*/
#define wxUSE_LIBHILDON2 0
/*
* Use libnotify library.
*/
#define wxUSE_LIBNOTIFY 0
/*
* Use libnotify 0.7+ API.
*/
#define wxUSE_LIBNOTIFY_0_7 0
/*
* Use libXpm
*/
#define wxHAVE_LIB_XPM 0
/*
* Define if you have pthread_cleanup_push/pop()
*/
#define wxHAVE_PTHREAD_CLEANUP 1
/*
* Define if compiler has __thread keyword.
*/
#define HAVE___THREAD_KEYWORD 1
/*
* Define if large (64 bit file offsets) files are supported.
*/
#define HAVE_LARGEFILE_SUPPORT 1
/*
* Use OpenGL
*/
#define wxUSE_OPENGL 0
/*
* Use MS HTML Help via libmspack (Unix)
*/
#define wxUSE_LIBMSPACK 0
/*
* Matthews garbage collection (used for MrEd?)
*/
#define WXGARBAGE_COLLECTION_ON 0
/*
* wxWebKitCtrl
*/
#define wxUSE_WEBKIT 0
/*
* Objective-C class name uniquifying
*/
#define wxUSE_OBJC_UNIQUIFYING 0
/*
* The const keyword is being introduced more in wxWindows.
* You can use this setting to maintain backward compatibility.
* If 0: will use const wherever possible.
* If 1: will use const only where necessary
* for precompiled headers to work.
* If 2: will be totally backward compatible, but precompiled
* headers may not work and program size will be larger.
*/
#define CONST_COMPATIBILITY 0
/*
* use the session manager to detect KDE/GNOME
*/
#define wxUSE_DETECT_SM 1
/* define with the name of timezone variable */
#define WX_TIMEZONE timezone
/* The type of 3rd argument to getsockname() - usually size_t or int */
#define WX_SOCKLEN_T socklen_t
/* The type of 5th argument to getsockopt() - usually size_t or int */
#define SOCKOPTLEN_T socklen_t
/* The type of statvfs(2) argument */
#define WX_STATFS_T struct statfs
/* The signal handler prototype */
#define wxTYPE_SA_HANDLER int
/* gettimeofday() usually takes 2 arguments, but some really old systems might
* have only one, in which case define WX_GETTIMEOFDAY_NO_TZ */
/* #undef WX_GETTIMEOFDAY_NO_TZ */
/* struct tm doesn't always have the tm_gmtoff field, define this if it does */
#define WX_GMTOFF_IN_TM 1
/* Define if you have poll(2) function */
/* #undef HAVE_POLL */
/* Define if you have pw_gecos field in struct passwd */
#define HAVE_PW_GECOS 1
/* Define if you have __cxa_demangle() in <cxxabi.h> */
#define HAVE_CXA_DEMANGLE 1
/* Define if you have dlopen() */
#define HAVE_DLOPEN 1
/* Define if you have gettimeofday() */
#define HAVE_GETTIMEOFDAY 1
/* Define if fsync() is available */
#define HAVE_FSYNC 1
/* Define if round() is available */
#define HAVE_ROUND 1
/* Define if you have ftime() */
/* #undef HAVE_FTIME */
/* Define if you have nanosleep() */
#define HAVE_NANOSLEEP 1
/* Define if you have sched_yield */
#define HAVE_SCHED_YIELD 1
/* Define if you have pthread_mutexattr_t and functions to work with it */
#define HAVE_PTHREAD_MUTEXATTR_T 1
/* Define if you have pthread_mutexattr_settype() declaration */
#define HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL 1
/* Define if you have PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP */
/* #undef HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER */
/* Define if you have pthread_cancel */
#define HAVE_PTHREAD_CANCEL 1
/* Define if you have pthread_mutex_timedlock */
#define HAVE_PTHREAD_MUTEX_TIMEDLOCK 1
/* Define if you have pthread_attr_setstacksize */
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
/* Define if you have shl_load() */
/* #undef HAVE_SHL_LOAD */
/* Define if you have snprintf() */
#define HAVE_SNPRINTF 1
/* Define if you have snprintf() declaration in the header */
#define HAVE_SNPRINTF_DECL 1
/* Define if you have a snprintf() which supports positional arguments
(defined in the unix98 standard) */
#define HAVE_UNIX98_PRINTF 1
/* define if you have statfs function */
#define HAVE_STATFS 1
/* define if you have statfs prototype */
#define HAVE_STATFS_DECL 1
/* define if you have statvfs function */
/* #undef HAVE_STATVFS */
/* Define if you have strtoull() and strtoll() */
#define HAVE_STRTOULL 1
/* Define if you have all functions to set thread priority */
#define HAVE_THREAD_PRIORITY_FUNCTIONS 1
/* Define if you have vsnprintf() */
#define HAVE_VSNPRINTF 1
/* Define if you have vsnprintf() declaration in the header */
#define HAVE_VSNPRINTF_DECL 1
/* Define if you have a _broken_ vsnprintf() declaration in the header,
* with 'char*' for the 3rd parameter instead of 'const char*' */
/* #undef HAVE_BROKEN_VSNPRINTF_DECL */
/* Define if you have a _broken_ vsscanf() declaration in the header,
* with 'char*' for the 1st parameter instead of 'const char*' */
/* #undef HAVE_BROKEN_VSSCANF_DECL */
/* Define if you have vsscanf() */
#define HAVE_VSSCANF 1
/* Define if you have vsscanf() declaration in the header */
#define HAVE_VSSCANF_DECL 1
/* Define if you have usleep() */
/* #undef HAVE_USLEEP */
/* Define if you have wcscasecmp() function */
#define HAVE_WCSCASECMP 1
/* Define if you have wcsncasecmp() function */
#define HAVE_WCSNCASECMP 1
/* Define if you have wcslen function */
#define HAVE_WCSLEN 1
/* Define if you have wcsdup function */
#define HAVE_WCSDUP 1
/* Define if you have wcsftime() function */
#define HAVE_WCSFTIME 1
/* Define if you have strnlen() function */
#define HAVE_STRNLEN 1
/* Define if you have wcsnlen() function */
#define HAVE_WCSNLEN 1
/* Define if you have wcstoull() and wcstoll() */
/* #undef HAVE_WCSTOULL */
/* The number of bytes in a wchar_t. */
#define SIZEOF_WCHAR_T 4
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a pointer. */
#define SIZEOF_VOID_P 8
/* The number of bytes in a long. */
#define SIZEOF_LONG 8
/* The number of bytes in a long long. */
#define SIZEOF_LONG_LONG 8
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* The number of bytes in a size_t. */
#define SIZEOF_SIZE_T 8
/* Define if size_t on your machine is the same type as unsigned int. */
/* #undef wxSIZE_T_IS_UINT */
/* Define if size_t on your machine is the same type as unsigned long. */
#define wxSIZE_T_IS_ULONG 1
/* Define if wchar_t is distinct type in your compiler. */
#define wxWCHAR_T_IS_REAL_TYPE 1
/* Define if you have the dlerror function. */
#define HAVE_DLERROR 1
/* Define if you have Posix fnctl() function. */
#define HAVE_FCNTL 1
/* Define if you have BSD flock() function. */
/* #undef HAVE_FLOCK */
/* Define if you have getaddrinfo function. */
/* #undef HAVE_GETADDRINFO */
/* Define if you have a gethostbyname_r function taking 6 arguments. */
#define HAVE_FUNC_GETHOSTBYNAME_R_6 1
/* Define if you have a gethostbyname_r function taking 5 arguments. */
/* #undef HAVE_FUNC_GETHOSTBYNAME_R_5 */
/* Define if you have a gethostbyname_r function taking 3 arguments. */
/* #undef HAVE_FUNC_GETHOSTBYNAME_R_3 */
/* Define if you only have a gethostbyname function */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have a getservbyname_r function taking 6 arguments. */
#define HAVE_FUNC_GETSERVBYNAME_R_6 1
/* Define if you have a getservbyname_r function taking 5 arguments. */
/* #undef HAVE_FUNC_GETSERVBYNAME_R_5 */
/* Define if you have a getservbyname_r function taking 4 arguments. */
/* #undef HAVE_FUNC_GETSERVBYNAME_R_4 */
/* Define if you only have a getservbyname function */
/* #undef HAVE_GETSERVBYNAME */
/* Define if you have the gmtime_r function. */
#define HAVE_GMTIME_R 1
/* Define if you have the inet_addr function. */
#define HAVE_INET_ADDR 1
/* Define if you have the inet_aton function. */
#define HAVE_INET_ATON 1
/* Define if you have the localtime_r function. */
#define HAVE_LOCALTIME_R 1
/* Define if you have the mktemp function. */
/* #undef HAVE_MKTEMP */
/* Define if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define if you have the putenv function. */
/* #undef HAVE_PUTENV */
/* Define if you have the setenv function. */
#define HAVE_SETENV 1
/* Define if you have strtok_r function. */
#define HAVE_STRTOK_R 1
/* Define if you have thr_setconcurrency function */
/* #undef HAVE_THR_SETCONCURRENCY */
/* Define if you have pthread_setconcurrency function */
#define HAVE_PTHREAD_SET_CONCURRENCY 1
/* Define if you have the uname function. */
#define HAVE_UNAME 1
/* Define if you have the unsetenv function. */
#define HAVE_UNSETENV 1
/* Define if you have the <X11/XKBlib.h> header file. */
#define HAVE_X11_XKBLIB_H 1
/* Define if you have the <X11/extensions/xf86vmode.h> header file. */
#define HAVE_X11_EXTENSIONS_XF86VMODE_H 1
/* Define if you have the <sched.h> header file. */
#define HAVE_SCHED_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <fcntl.h> header file. */
/* #undef HAVE_FCNTL_H */
/* Define if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define if you have the <wcstr.h> header file. */
/* #undef HAVE_WCSTR_H */
/* Define if you have <widec.h> (Solaris only) */
/* #undef HAVE_WIDEC_H */
/* Define if you have the <iconv.h> header file and iconv() symbol. */
#define HAVE_ICONV 1
/* Define as "const" if the declaration of iconv() needs const. */
#define ICONV_CONST
/* Define if you have the <langinfo.h> header file. */
#define HAVE_LANGINFO_H 1
/* Define if you have the <w32api.h> header file (mingw,cygwin). */
/* #undef HAVE_W32API_H */
/* Define if you have the <sys/soundcard.h> header file. */
#define HAVE_SYS_SOUNDCARD_H 1
/* Define if you have wcsrtombs() function */
#define HAVE_WCSRTOMBS 1
/* Define this if you have putws() */
/* #undef HAVE_PUTWS */
/* Define this if you have fputws() */
#define HAVE_FPUTWS 1
/* Define this if you have wprintf() and related functions */
#define HAVE_WPRINTF 1
/* Define this if you have vswprintf() and related functions */
#define HAVE_VSWPRINTF 1
/* Define this if you have _vsnwprintf */
/* #undef HAVE__VSNWPRINTF */
/* vswscanf() */
#define HAVE_VSWSCANF 1
/* Define if fseeko and ftello are available. */
#define HAVE_FSEEKO 1
/* Define this if you are using gtk and gdk contains support for X11R6 XIM */
/* #undef HAVE_XIM */
/* Define this if you have X11/extensions/shape.h */
/* #undef HAVE_XSHAPE */
/* Define this if you have type SPBCDATA */
/* #undef HAVE_SPBCDATA */
/* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */
/* #undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE */
/* Define if you have Pango xft support */
/* #undef HAVE_PANGO_XFT */
/* Define if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define if you have abi::__forced_unwind in your <cxxabi.h>. */
#define HAVE_ABI_FORCEDUNWIND 1
/* Define if fdopen is available. */
#define HAVE_FDOPEN 1
/* Define if sysconf is available. */
#define HAVE_SYSCONF 1
/* Define if getpwuid_r is available. */
#define HAVE_GETPWUID_R 1
/* Define if getgrgid_r is available. */
#define HAVE_GETGRGID_R 1
/* Define if setpriority() is available. */
#define HAVE_SETPRIORITY 1
/* Define if locale_t is available */
#define HAVE_LOCALE_T 1
/* Define if you have inotify_xxx() functions. */
#define wxHAS_INOTIFY 1
/* Define if you have kqueu_xxx() functions. */
/* #undef wxHAS_KQUEUE */
/* -------------------------------------------------------------------------
Win32 adjustments section
------------------------------------------------------------------------- */
#ifdef __WIN32__
/* When using an external jpeg library and the Windows headers already define
* boolean, define to the type used by the jpeg library for boolean. */
/* #undef wxHACK_BOOLEAN */
/* Define if the header pbt.h is missing. */
/* #undef NEED_PBT_H */
#endif /* __WIN32__ */
/* --------------------------------------------------------*
* This stuff is static, it doesn't get modified directly
* by configure.
*/
/*
define some constants identifying wxWindows version in more details than
just the version number
*/
/* wxLogChain class available */
#define wxHAS_LOG_CHAIN
/* define this when wxDC::Blit() respects SetDeviceOrigin() in wxGTK */
/* #undef wxHAS_WORKING_GTK_DC_BLIT */
#endif /* __WX_SETUP_H__ */
| [
"yasriady@yahoo.com"
] | yasriady@yahoo.com |
74f482b3acd9eda89ef38baa529b2b9d5d01aaa6 | e7048e0c504bf52660214efedae436952d082111 | /ca/communityconfigurationproject_e/AI_ImprovedAIDispersionCoefForCoaxMGs/config.cpp | 8a936f9fa17885032e22c281d98869555db2098e | [] | no_license | RomKaz/work-in-progress | cf08e95636309c4b66701857bd3ae78ea96c8a3b | 61acddd17411055f3706e8cde95e10f4a4949e67 | refs/heads/master | 2020-12-30T10:23:10.094084 | 2015-06-29T22:44:08 | 2015-06-29T22:44:08 | 38,160,476 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,029 | cpp | ////////////////////////////////////////////////////////////////////
//DeRap: Produced from mikero's Dos Tools Dll version 4.65
//Fri Oct 31 06:13:56 2014 : Source 'file' date Fri Oct 31 06:13:56 2014
//http://dev-heaven.net/projects/list_files/mikero-pbodll
////////////////////////////////////////////////////////////////////
#define _ARMA_
//Class CommunityConfigurationProject_E : AI_ImprovedAIDispersionCoefForCoaxMGs\config.bin{
class cfgPatches
{
class CA_CommunityConfigurationProject_E_AI_ImprovedAIDispersionCoefForCoaxMGs
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"CA_CommunityConfigurationProject_E"};
};
};
class CfgWeapons
{
class MGun;
class PKT: MGun
{
aiDispersionCoefX = 21;
aiDispersionCoefY = 21;
};
class PKT_MG_Nest: PKT{};
class PKT_veh: PKT_MG_Nest{};
class PKTBC_veh: PKT_veh
{
aiDispersionCoefX = 14;
aiDispersionCoefY = 14;
};
class M240_veh;
class M240BC_veh: M240_veh
{
aiDispersionCoefX = 14;
aiDispersionCoefY = 14;
};
};
//};
| [
"romkaz1978@gmail.com"
] | romkaz1978@gmail.com |
de30e057a18844ecdb53d380b0614d8234996be0 | f0b84e3432c02d67b93efeafbbf1a801fa21ded3 | /ziy/Classes/scripts/ScriptPara/Script61_3d_GetGood.h | aa13b71fc3de052d219e9ceb606385b73f19c077 | [] | no_license | qwe00921/game-1 | d49a096f096b7de0a2da7764632b20ad929d4926 | 2c7bd14a75ee8cd65528309bca33033f170c813a | refs/heads/master | 2021-05-14T19:10:16.374869 | 2017-05-27T09:18:06 | 2017-05-27T09:18:06 | 116,101,350 | 1 | 0 | null | 2018-01-03T06:38:41 | 2018-01-03T06:38:41 | null | UTF-8 | C++ | false | false | 581 | h | #ifndef _ScriptGetGood_H_
#define _ScriptGetGood_H_
class ScriptGetGood : public Script
{
public:
ScriptGetGood()
{
cmd = CMD_GET_GOOD;
}
ScriptGetGood(int iActorId, int iGoodsId, int iCount)
{
cmd = CMD_GET_GOOD;
m_iActorId = iActorId;
m_iGoodsId = iGoodsId;
m_iCount = iCount;
}
int HandleScript();
int HandleRScript(RedeScreenPtr scr);
int initPara(char*SceneData, int index);
private:
int m_iCount;
short unkown1;
short m_iGoodsId;
short unkown2;
short good_level;
short unkown3;
short show_action;
short unkown4;
short m_iActorId;
};
#endif | [
"tangchengyu@bantus.cn"
] | tangchengyu@bantus.cn |
23822e44eebe7f6a7ebbca1d47ebdbfdb28e7905 | ace8772a066a02f17a0e32889bfb46106adcc7b7 | /examples/keyboard_client/keyboard_client.cc | a9ef5e1412fbc6063abef7e286ac09cf4d7dff57 | [
"BSD-3-Clause"
] | permissive | vardhan-cr/mojo | 425c33ed25ce36d49730a8029a5dfaaa1d915fba | ee613ac335d90d314567134e76bee77bcf70d67d | refs/heads/master | 2021-01-17T21:23:26.751994 | 2015-07-30T23:22:15 | 2015-07-30T23:22:15 | 39,977,863 | 0 | 0 | null | 2015-07-31T00:07:15 | 2015-07-31T00:07:14 | null | UTF-8 | C++ | false | false | 13,120 | cc | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/macros.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/gpu/gl_texture.h"
#include "mojo/gpu/texture_cache.h"
#include "mojo/gpu/texture_uploader.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/services/keyboard/public/interfaces/keyboard.mojom.h"
#include "mojo/services/view_manager/public/cpp/view.h"
#include "mojo/services/view_manager/public/cpp/view_manager.h"
#include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h"
#include "mojo/services/view_manager/public/cpp/view_manager_delegate.h"
#include "mojo/services/view_manager/public/cpp/view_observer.h"
#include "mojo/skia/ganesh_context.h"
#include "mojo/skia/ganesh_surface.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkTypeface.h"
namespace examples {
mojo::Size ToSize(const mojo::Rect& rect) {
mojo::Size size;
size.width = rect.width;
size.height = rect.height;
return size;
}
class ViewTextureUploader {
public:
ViewTextureUploader(base::WeakPtr<mojo::GLContext> gl_context,
mojo::SurfacePtr* surface,
mojo::View* view,
mojo::TextureCache* texture_cache,
base::Callback<void(SkCanvas*)> draw_callback)
: gl_context_(gl_context),
surface_(surface),
texture_cache_(texture_cache),
view_(view),
draw_callback_(draw_callback),
weak_factory_(this) {
gr_context_.reset(new mojo::GaneshContext(gl_context_));
submit_frame_callback_ = base::Bind(&ViewTextureUploader::OnFrameComplete,
weak_factory_.GetWeakPtr());
}
void Draw(uint32_t surface_id) {
mojo::GaneshContext::Scope scope(gr_context_.get());
mojo::Size view_size = ToSize(view_->bounds());
scoped_ptr<mojo::TextureCache::TextureInfo> texture_info(
texture_cache_->GetTexture(view_size).Pass());
mojo::GaneshSurface ganesh_surface(gr_context_.get(),
texture_info->Texture().Pass());
gr_context_->gr()->resetContext(kTextureBinding_GrGLBackendState);
SkCanvas* canvas = ganesh_surface.canvas();
draw_callback_.Run(canvas);
scoped_ptr<mojo::GLTexture> surface_texture(
ganesh_surface.TakeTexture().Pass());
mojo::FramePtr frame = mojo::TextureUploader::GetUploadFrame(
gl_context_, texture_info->ResourceId(), surface_texture);
texture_cache_->NotifyPendingResourceReturn(texture_info->ResourceId(),
surface_texture.Pass());
(*surface_)->SubmitFrame(surface_id, frame.Pass(), submit_frame_callback_);
}
void OnFrameComplete() {}
private:
base::WeakPtr<mojo::GLContext> gl_context_;
scoped_ptr<mojo::GaneshContext> gr_context_;
mojo::SurfacePtr* surface_;
mojo::TextureCache* texture_cache_;
mojo::View* view_;
base::Callback<void(SkCanvas*)> draw_callback_;
base::Closure submit_frame_callback_;
base::WeakPtrFactory<ViewTextureUploader> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ViewTextureUploader);
};
class KeyboardDelegate : public mojo::ApplicationDelegate,
public keyboard::KeyboardClient,
public mojo::ViewManagerDelegate,
public mojo::ViewObserver {
public:
KeyboardDelegate()
: binding_(this),
shell_(nullptr),
keyboard_view_(nullptr),
text_view_(nullptr),
root_view_(nullptr),
root_view_surface_id_(1u),
text_view_surface_id_(2u),
id_namespace_(0u),
text_view_height_(0),
weak_factory_(this) {}
~KeyboardDelegate() override {}
void SetIdNamespace(uint32_t id_namespace) {
id_namespace_ = id_namespace;
UpdateSurfaceIds();
}
void UpdateSurfaceIds() {
auto text_view_surface_id = mojo::SurfaceId::New();
text_view_surface_id->id_namespace = id_namespace_;
text_view_surface_id->local = text_view_surface_id_;
text_view_->SetSurfaceId(text_view_surface_id.Pass());
auto root_view_surface_id = mojo::SurfaceId::New();
root_view_surface_id->id_namespace = id_namespace_;
root_view_surface_id->local = root_view_surface_id_;
root_view_->SetSurfaceId(root_view_surface_id.Pass());
}
// mojo::ApplicationDelegate implementation.
void Initialize(mojo::ApplicationImpl* app) override {
shell_ = app->shell();
view_manager_client_factory_.reset(
new mojo::ViewManagerClientFactory(shell_, this));
}
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
connection->AddService(view_manager_client_factory_.get());
return true;
}
// mojo::ViewManagerDelegate implementation.
void OnEmbed(mojo::View* root,
mojo::InterfaceRequest<mojo::ServiceProvider> services,
mojo::ServiceProviderPtr exposed_services) override {
root_view_ = root;
root->AddObserver(this);
keyboard_view_ = root->view_manager()->CreateView();
text_view_ = root->view_manager()->CreateView();
skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
SkTypeface::CreateFromName("Arial", SkTypeface::kNormal));
text_paint_.setTypeface(typeface.get());
text_paint_.setColor(SK_ColorBLACK);
text_paint_.setAntiAlias(true);
text_paint_.setTextAlign(SkPaint::kLeft_Align);
UpdateViewBounds(root->bounds());
root->AddChild(text_view_);
text_view_->SetVisible(true);
root->AddChild(keyboard_view_);
keyboard_view_->SetVisible(true);
mojo::ServiceProviderPtr keyboard_sp;
keyboard_view_->Embed("mojo:keyboard_native", GetProxy(&keyboard_sp),
nullptr);
keyboard_sp->ConnectToService(keyboard::KeyboardService::Name_,
GetProxy(&keyboard_).PassMessagePipe());
keyboard_->ShowByRequest();
keyboard_->Hide();
keyboard::KeyboardClientPtr keyboard_client;
auto request = mojo::GetProxy(&keyboard_client);
binding_.Bind(request.Pass());
keyboard_->Show(keyboard_client.Pass());
mojo::ServiceProviderPtr surfaces_service_provider;
shell_->ConnectToApplication("mojo:surfaces_service",
mojo::GetProxy(&surfaces_service_provider),
nullptr);
mojo::ConnectToService(surfaces_service_provider.get(), &surface_);
gl_context_ = mojo::GLContext::Create(shell_);
surface_->CreateSurface(root_view_surface_id_);
surface_->CreateSurface(text_view_surface_id_);
surface_->GetIdNamespace(
base::Bind(&KeyboardDelegate::SetIdNamespace, base::Unretained(this)));
mojo::ResourceReturnerPtr resource_returner;
texture_cache_.reset(
new mojo::TextureCache(gl_context_, &resource_returner));
text_view_texture_uploader_.reset(new ViewTextureUploader(
gl_context_, &surface_, text_view_, texture_cache_.get(),
base::Bind(&KeyboardDelegate::DrawTextView,
weak_factory_.GetWeakPtr())));
root_view_texture_uploader_.reset(new ViewTextureUploader(
gl_context_, &surface_, root, texture_cache_.get(),
base::Bind(&KeyboardDelegate::DrawRootView,
weak_factory_.GetWeakPtr())));
surface_->SetResourceReturner(resource_returner.Pass());
DrawText();
}
void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {
}
// keyboard::KeyboardClient implementation.
void CommitCompletion(keyboard::CompletionDataPtr completion) override {
DrawText();
}
void CommitCorrection(keyboard::CorrectionDataPtr correction) override {
DrawText();
}
void CommitText(const mojo::String& text,
int32_t new_cursor_position) override {
std::string combined(text_[1]);
combined.append(text);
SkRect bounds;
text_paint_.measureText(combined.data(), combined.size(), &bounds);
if (bounds.width() > text_view_->bounds().width) {
text_[0] = text_[1];
text_[1] = text;
} else {
text_[1].append(text);
}
DrawText();
}
void DeleteSurroundingText(int32_t before_length,
int32_t after_length) override {
// treat negative and zero |before_length| values as no-op.
if (before_length > 0) {
if (before_length > static_cast<int32_t>(text_[1].size())) {
before_length = text_[1].size();
}
text_[1].erase(text_[1].end() - before_length, text_[1].end());
}
DrawText();
}
void SetComposingRegion(int32_t start, int32_t end) override { DrawText(); }
void SetComposingText(const mojo::String& text,
int32_t new_cursor_position) override {
DrawText();
}
void SetSelection(int32_t start, int32_t end) override { DrawText(); }
// mojo::ViewObserver implementation.
void OnViewDestroyed(mojo::View* view) override {
if (view == text_view_) {
text_view_->RemoveObserver(this);
text_view_ = nullptr;
}
}
void OnViewBoundsChanged(mojo::View* view,
const mojo::Rect& old_bounds,
const mojo::Rect& new_bounds) override {
surface_->DestroySurface(root_view_surface_id_);
surface_->DestroySurface(text_view_surface_id_);
root_view_surface_id_ += 2;
text_view_surface_id_ += 2;
surface_->CreateSurface(root_view_surface_id_);
surface_->CreateSurface(text_view_surface_id_);
UpdateSurfaceIds();
UpdateViewBounds(new_bounds);
DrawText();
}
void UpdateViewBounds(const mojo::Rect& root_bounds) {
float keyboard_height = (root_bounds.width > root_bounds.height)
? root_bounds.width * 0.3f
: root_bounds.width * 0.6f;
text_view_height_ = root_bounds.height - keyboard_height;
float row_height = text_view_height_ / 2.0f;
text_paint_.setTextSize(row_height / 1.7f);
// One third of the keyboard view's height will be used for overlapping
// views behind it (text_view_ in this case). Thus create the keyboard 50%
// taller than the area we want the keys to be drawn to.
float overlap = keyboard_height / 2;
mojo::Rect keyboard_bounds;
keyboard_bounds.x = root_bounds.x;
keyboard_bounds.y = root_bounds.y + text_view_height_ - overlap;
keyboard_bounds.width = root_bounds.width;
keyboard_bounds.height = root_bounds.height - text_view_height_ + overlap;
keyboard_view_->SetBounds(keyboard_bounds);
mojo::Rect text_view_bounds;
text_view_bounds.x = root_bounds.x;
text_view_bounds.y = root_bounds.y;
text_view_bounds.width = root_bounds.width;
text_view_bounds.height = text_view_height_;
text_view_->SetBounds(text_view_bounds);
}
void DrawText() {
if (root_view_texture_uploader_) {
root_view_texture_uploader_->Draw(root_view_surface_id_);
}
if (text_view_texture_uploader_) {
text_view_texture_uploader_->Draw(text_view_surface_id_);
}
}
void DrawTextView(SkCanvas* canvas) {
canvas->clear(SK_ColorRED);
float row_height = text_view_height_ / 2.0f;
float text_baseline_offset = row_height / 5.0f;
if (!text_[0].empty()) {
canvas->drawText(text_[0].data(), text_[0].size(), 0.0f,
row_height - text_baseline_offset, text_paint_);
}
if (!text_[1].empty()) {
canvas->drawText(text_[1].data(), text_[1].size(), 0.0f,
(2.0f * row_height) - text_baseline_offset, text_paint_);
}
canvas->flush();
}
void DrawRootView(SkCanvas* canvas) {
canvas->clear(SK_ColorDKGRAY);
canvas->flush();
}
private:
mojo::Binding<keyboard::KeyboardClient> binding_;
keyboard::KeyboardServicePtr keyboard_;
scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_;
mojo::Shell* shell_;
mojo::View* keyboard_view_;
mojo::View* text_view_;
mojo::View* root_view_;
uint32_t root_view_surface_id_;
uint32_t text_view_surface_id_;
uint32_t id_namespace_;
base::WeakPtr<mojo::GLContext> gl_context_;
mojo::SurfacePtr surface_;
scoped_ptr<mojo::TextureCache> texture_cache_;
scoped_ptr<ViewTextureUploader> text_view_texture_uploader_;
scoped_ptr<ViewTextureUploader> root_view_texture_uploader_;
int text_view_height_;
std::string text_[2];
SkPaint text_paint_;
base::WeakPtrFactory<KeyboardDelegate> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(KeyboardDelegate);
};
} // namespace examples
MojoResult MojoMain(MojoHandle application_request) {
mojo::ApplicationRunnerChromium runner(new examples::KeyboardDelegate);
return runner.Run(application_request);
}
| [
"anwilson@chromium.org"
] | anwilson@chromium.org |
49dc3ec94f299b6c42584fa3a641efb23cc5131e | bdee7507bc5d17c18a8e59883fec176fe7928509 | /gameSetup/main.cpp | f0d90b276d8c66e6b70f2accb878f8cd6f24fcf0 | [] | no_license | meemknight/gameLayer | 4ab02da055523d47222e6f0981b7ad649b3923a8 | 4b0b94f567ac6f00a4e25da2cf482003ce8f5bde | refs/heads/master | 2023-07-02T05:36:06.052490 | 2021-08-04T08:48:21 | 2021-08-04T08:48:21 | 273,767,187 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,264 | cpp | #include <Windows.h>
#include "gameStructs.h"
#include <GL/glew.h>
BOOL WINAPI DllMain(
HINSTANCE hinstDLL,
DWORD fdwReason,
LPVOID lpvReserved
)
{
if(fdwReason == DLL_PROCESS_ATTACH)
{
// OutputDebugString("gameLayer: dll attached");
}
return true;
}
FreeListAllocator* allocator = nullptr;
Console* console = nullptr;
#pragma region allocator
void* operator new (std::size_t count)
{
auto a = allocator->threadSafeAllocate(count);
return a;
}
void* operator new[](std::size_t count)
{
auto a = allocator->threadSafeAllocate(count);
return a;
}
void operator delete (void* ptr)
{
allocator->threadSafeFree(ptr);
}
void operator delete[](void* ptr)
{
allocator->threadSafeFree(ptr);
}
#pragma endregion
extern "C" __declspec(dllexport) void onCreate(GameMemory* mem, HeapMemory * heapMemory,
WindowSettings *windowSettings, PlatformFunctions * platformFunctions)
{
#pragma region necesary setup
allocator = &heapMemory->allocator;
new(mem) GameMemory; // *mem = GameMemory();
console = &platformFunctions->console;
glewExperimental = true;
if (glewInit() != GLEW_OK)
{
MessageBoxA(0, "glewInit", "Error from glew", MB_ICONERROR);
}
gl2d::setErrorFuncCallback([](const char* c) {console->elog(c); });
gl2d::init();
#pragma endregion
//set the size of the window
windowSettings->w = 640;
windowSettings->h = 360;
//windowSettings->drawWithOpenGl = true;
//windowSettings->lockFpsIfNotVsync = 60;
//windowSettings->vsyncWithOpengl = true;
//gl2d::setVsync(1);
mem->renderer.create();
mem->background.loadFromFile("resources//background.png");
mem->dot.loadFromFile("resources//dot.png");
mem->characterTexture.loadFromFile("resources//character.png");
mem->ps.initParticleSystem(4000);
const char* mapShape =
" X X"
" X X"
" XXXX "
" X "
" X "
" XX XXXX "
" "
" XX X X "
" X X X"
" X X XX";
mem->mapData.create(10, 10, mapShape);
mem->player.pos = {};
mem->player.dimensions = {60,60};
}
//this might be usefull to change variables on runtime
extern "C" __declspec(dllexport) void onReload(GameMemory * mem, HeapMemory * heapMemory,
WindowSettings * windowSettings, PlatformFunctions * platformFunctions)
{
#pragma region necesary setup
allocator = &heapMemory->allocator;
console = &platformFunctions->console;
glewExperimental = true;
if (glewInit() != GLEW_OK)
{
MessageBoxA(0, "glewInit", "Error from glew", MB_ICONERROR);
}
gl2d::setErrorFuncCallback([](const char* c) {console->elog(c); });
gl2d::init();
#pragma endregion
platformFunctions->console.log("reloaded...");
}
extern "C" __declspec(dllexport) void gameLogic(GameInput * input, GameMemory * mem,
HeapMemory * heapMemory, VolatileMemory * volatileMemory, GameWindowBuffer * windowBuffer,
WindowSettings * windowSettings, PlatformFunctions * platformFunctions)
{
#pragma region per frame setup
allocator = &heapMemory->allocator;
float deltaTime = input->deltaTime;
console = &platformFunctions->console;
glClear(GL_COLOR_BUFFER_BIT);
//glViewport(0, 0, windowBuffer->w, windowBuffer->h);
mem->renderer.updateWindowMetrics(windowBuffer->w, windowBuffer->h);
if(windowSettings->fullScreen)
{
mem->renderer.currentCamera.zoom = windowSettings->w / 1920.f;
}else
{
windowSettings->w = 640;
windowSettings->h = 360;
mem->renderer.currentCamera.zoom = windowSettings->w / 1920.f;
}
//mem->renderer.currentCamera.zoom = 0.5;
//mem->renderer.currentCamera.target = { mem->posX, mem->posY };
float w = windowBuffer->w;
float h = windowBuffer->h;
auto& renderer = mem->renderer;
#pragma endregion
//platformFunctions->keepPlayingMusic("resources//jungle.wav", 0.1);
if(input->keyBoard[Button::NR1].pressed)
{
platformFunctions->playSound("resources/weird.wav", 0.1);
}
if(input->keyBoard[Button::NR2].held)
{
platformFunctions->keepPlayingMusic("resources/jungle.wav", 0.08);
}
mem->ps.pixelateFactor = 2;
//do game logic
//all the global variabels will be stored in "mem"
// mem->positionX
//if you want to add any you can do so in gameStructs.h
#pragma region part1
mem->deathParticle.positionX = { -40,40 };
mem->deathParticle.positionY = { -40,40 };
mem->deathParticle.particleLifeTime = { 1,1.1 };
mem->deathParticle.directionX = { -30,30 };
mem->deathParticle.directionY = { -30,30 };
mem->deathParticle.createApearence.size = { 40, 40 };
mem->deathParticle.dragX = { 0,0 };
mem->deathParticle.dragY = { 0,0 };
mem->deathParticle.rotation = { 0, 360 };
mem->deathParticle.rotationSpeed = { -50, 50 };
mem->deathParticle.rotationDrag = { 0, 0 };
mem->deathParticle.createApearence.color1 = { 0.9, 0.9, 0.9, 0.9 };
mem->deathParticle.createApearence.color2 = { 1, 1, 1, 1 };
mem->deathParticle.createEndApearence.color1 = { 0.9, 0.4, 0.5, 1 };
mem->deathParticle.createEndApearence.size = { 1,1 };
mem->deathParticle.tranzitionType = gl2d::TRANZITION_TYPES::abruptCurbe;
//mem->deathParticle.deathRattle = &mem->deathParticle;
mem->deathParticle.onCreateCount = 20;
mem->emitPart.onCreateCount = 2;
mem->emitPart.particleLifeTime = { 1, 1 };
mem->emitPart.directionX = { -20,200 };
mem->emitPart.directionY = { 30, 60 };
mem->emitPart.createApearence.size = { 10, 10 };
mem->emitPart.dragX = { -10,10 };
mem->emitPart.dragY = { 200,250 };
mem->emitPart.rotation = { 0, 0 };
mem->emitPart.rotationSpeed = { 0, 0 };
mem->emitPart.rotationDrag = { 0, 0 };
mem->emitPart.createApearence.color1 = { 0, 0.3, 0.5, 0.6 };
mem->emitPart.createApearence.color2 = { 0.1, 0.4, 0.6, 0.7 };
mem->emitPart.createEndApearence.color1 = { 0.5,0.5,0.5,0.6 };
mem->emitPart.createEndApearence.size = { 2,2 };
mem->emitPart.tranzitionType = gl2d::TRANZITION_TYPES::curbe;
//mem->emitPart.texturePtr = &mem->dot;
mem->emitPart.deathRattle = nullptr;
mem->emitPart.positionX = { -2,2 };
mem->emitPart.positionY = { -10,0 };
mem->particleSettings.onCreateCount = 5;
mem->particleSettings.subemitParticleTime = {0.1, 0.2};
mem->particleSettings.particleLifeTime = { 1, 1 };
mem->particleSettings.directionX = { -300,300 };
mem->particleSettings.directionY = {-300,300};
mem->particleSettings.createApearence.size = { 40, 40 };
mem->particleSettings.dragX = { -50,50 };
mem->particleSettings.dragY = { -50,50 };
mem->particleSettings.rotation = { 0, 360 };
mem->particleSettings.rotationSpeed = { 0, 10 };
mem->particleSettings.rotationDrag = { 0, 100 };
mem->particleSettings.createApearence.color1 = { 0, 0.2, 0.4, 0.7 };
mem->particleSettings.createApearence.color2 = { 0.1, 0.4, 0.5, 0.8 };
mem->particleSettings.createEndApearence.color1 = { 1,0.5,0.5,0.6 };
mem->particleSettings.createEndApearence.size = {25,25};
mem->particleSettings.tranzitionType = gl2d::TRANZITION_TYPES::wave;
mem->particleSettings.texturePtr = &mem->dot;
mem->particleSettings.deathRattle = &mem->deathParticle;
//mem->particleSettings.subemitParticle = &mem->emitPart;
mem->particleSettings.positionX = { -20,20 };
mem->particleSettings.positionY = { -20,20 };
#pragma endregion
mem->firePart.onCreateCount = 10;
mem->firePart.subemitParticleTime = {};
mem->firePart.particleLifeTime = {0.9, 1.5};
mem->firePart.directionX = { -8,8 };
mem->firePart.directionY = { -4,-6 };
mem->firePart.createApearence.size = { 30, 30 };
mem->firePart.dragX = { -5,5 };
mem->firePart.dragY = { -50,-80 };
mem->firePart.rotation = { 0, 360 };
mem->firePart.rotationSpeed = { 0, 10 };
mem->firePart.rotationDrag = { 0, 100 };
mem->firePart.createApearence.color1 = { 0.1, 0.3, 0.8, 0.3 };
mem->firePart.createApearence.color2 = { 0.2, 0.4, 0.9, 0.4 };
mem->firePart.createEndApearence.color1 = { 0.6,0.4,0.7,0.1 };
mem->firePart.createEndApearence.size = { 10,15 };
mem->firePart.tranzitionType = gl2d::TRANZITION_TYPES::wave;
//mem->firePart.texturePtr = &mem->dot;
mem->firePart.deathRattle = &mem->smokePart;
mem->firePart.subemitParticle = nullptr;
mem->firePart.positionX = { -20,20 };
mem->firePart.positionY = { -20,20 };
mem->smokePart.onCreateCount = 1;
mem->smokePart.subemitParticle = nullptr;
mem->smokePart.subemitParticleTime = {};
mem->smokePart.particleLifeTime = { 0.9, 1 };
mem->smokePart.directionX = { -8,8 };
mem->smokePart.directionY = { -4,-6 };
mem->smokePart.createApearence.size = { 10, 15 };
mem->smokePart.dragX = { -5,5 };
mem->smokePart.dragY = { -50,-80 };
mem->smokePart.rotation = { 0, 360 };
mem->smokePart.rotationSpeed = { 0, 10 };
mem->smokePart.rotationDrag = { 0, 100 };
mem->smokePart.createApearence.color1 = { 0.3, 0.1, 0.1, 0.5 };
mem->smokePart.createApearence.color2 = { 0.5, 0.2, 0.2, 0.6 };
mem->smokePart.createEndApearence.color1 = { 0.1,0.1,0.1,0.2 };
mem->smokePart.createEndApearence.size = { 2,5 };
mem->smokePart.tranzitionType = gl2d::TRANZITION_TYPES::curbe;
//mem->smokePart.texturePtr = &mem->dot;
//mem->smokePart.deathRattle = &mem->emitPart;
//mem->smokePart.subemitParticle = &mem->emitPart;
mem->smokePart.positionX = { -20,20 };
mem->smokePart.positionY = { -20,20 };
//the volatile memory persists only for one frame
char* c = (char*)volatileMemory->allocate(100);
char* c1 = (char*)volatileMemory->allocate(100);
c[10] = 10;
c1[10] = 10;
//you can change the window settings
//!they will take place next frame
//windowSettings->w = 600;
//windowSettings->h = 400;
//windowSettings->drawWithOpenGl = true;
mem->test = 0;
char color1 = 255-input->controllers[0].LT * 254;
char color2 = 255-input->controllers[0].RT * 254;
renderer.renderRectangle({ 0,0, 1500, 800 }, {}, 0, mem->background);
//move player
float speed = 620 * deltaTime;
glm::vec2 dir = {};
if(input->keyBoard[Button::W].held || input->anyController.Up.held)
{
dir.y -= 1;
}
if (input->keyBoard[Button::S].held || input->anyController.Down.held)
{
dir.y += 1;
}
if (input->keyBoard[Button::A].held || input->anyController.Left.held)
{
dir.x -= 1;
}
if (input->keyBoard[Button::D].held || input->anyController.Right.held)
{
dir.x += 1;
}
dir.x += input->anyController.LThumb.x;
dir.y -= input->anyController.LThumb.y;
if(dir.x || dir.y)
dir = glm::normalize(dir) * speed;
if (input->keyBoard[Button::Q].held )
{
mem->renderer.currentCamera.rotation -= speed;
}
if (input->keyBoard[Button::E].held )
{
mem->renderer.currentCamera.rotation += speed;
}
if (input->keyBoard[Button::Enter].released)
{
windowSettings->fullScreen = !windowSettings->fullScreen;
}
if (input->keyBoard[Button::Space].released)
{
mem->ps.postProcessing = !mem->ps.postProcessing;
}
if (input->leftMouse.held)
{
glm::vec2 p = {
mem->player.pos.x + (input->mouseX - w / 2.f) / mem->renderer.currentCamera.zoom,
mem->player.pos.y + (input->mouseY - h / 2.f) / mem->renderer.currentCamera.zoom
};
p = { input->mouseX , input->mouseY };
p = mem->renderer.currentCamera.convertPoint(p, w, h);
mem->ps.emitParticleWave(&mem->firePart, p);
}
#pragma region drawMap
auto& mapData = mem->mapData;
for (int y = 0; y < mapData.h; y++)
for (int x = 0; x < mapData.w; x++)
{
if(mapData.get(x,y).type == 'X')
{
auto s = mapData.BLOCK_SIZE;
renderer.renderRectangle({ x * s, y * s, s, s }, Colors_Green);
}
}
#pragma endregion
mem->player.move(dir);
mem->player.resolveConstrains(mem->mapData);
mem->player.updateMove();
mem->renderer.currentCamera.follow({ mem->player.pos }, deltaTime * 100, 30, windowBuffer->w, windowBuffer->h);
mem->player.draw(renderer, deltaTime, mem->characterTexture);
//auto beginTime = __rdtsc();
mem->ps.applyMovement(deltaTime);
//auto endTime = __rdtsc();
//auto clocks = endTime - beginTime;
//console->log(std::to_string(clocks).c_str());
mem->ps.draw(mem->renderer);
mem->renderer.flush();
//mem->renderer.renderRectangle({ 10,10,100,100 }, Colors_Green);
//mem->renderer.flush();
}
extern "C" __declspec(dllexport) void onClose(GameMemory * mem, HeapMemory * heapMemory,
WindowSettings * windowSettings, PlatformFunctions * platformFunctions)
{
#pragma region necesary setup
allocator = &heapMemory->allocator;
console = &platformFunctions->console;
#pragma endregion
} | [
"vladalex420@gmail.com"
] | vladalex420@gmail.com |
d7f309cb47054cd864bf96e6a7b57a258f19221e | 8afb5afd38548c631f6f9536846039ef6cb297b9 | /_REPO/MICROSOFT/PowerToys/src/modules/previewpane/powerpreview/settings.h | 15cd5edcc5e2594255640f1ad209e3fea5a8718d | [
"MIT",
"BSL-1.0",
"Unlicense",
"LicenseRef-scancode-generic-cla"
] | permissive | bgoonz/UsefulResourceRepo2.0 | d87588ffd668bb498f7787b896cc7b20d83ce0ad | 2cb4b45dd14a230aa0e800042e893f8dfb23beda | refs/heads/master | 2023-03-17T01:22:05.254751 | 2022-08-11T03:18:22 | 2022-08-11T03:18:22 | 382,628,698 | 10 | 12 | MIT | 2022-10-10T14:13:54 | 2021-07-03T13:58:52 | null | UTF-8 | C++ | false | false | 1,488 | h | #pragma once
#include <string>
#include "Generated Files/resource.h"
#include <common/SettingsAPI/settings_objects.h>
#include "registry_wrapper_interface.h"
namespace PowerPreviewSettings
{
// PowerToy Windows Explorer File Preview Settings.
class FileExplorerPreviewSettings
{
private:
bool m_toggleSettingEnabled;
std::wstring m_toggleSettingName;
std::wstring m_toggleSettingDescription;
std::wstring m_registryValueData;
LPCWSTR m_clsid;
protected:
std::unique_ptr<RegistryWrapperIface> m_registryWrapper;
public:
FileExplorerPreviewSettings(bool toggleSettingEnabled, const std::wstring& toggleSettingName, const std::wstring& toggleSettingDescription, LPCWSTR clsid, const std::wstring& registryValueData, std::unique_ptr<RegistryWrapperIface>);
virtual bool GetToggleSettingState() const;
virtual void UpdateToggleSettingState(bool state);
virtual std::wstring GetToggleSettingName() const;
virtual std::wstring GetToggleSettingDescription() const;
virtual LPCWSTR GetCLSID() const;
virtual std::wstring GetRegistryValueData() const;
virtual void LoadState(PowerToysSettings::PowerToyValues& settings);
virtual bool UpdateState(PowerToysSettings::PowerToyValues& settings, bool enabled, bool isElevated);
virtual LONG Enable() = 0;
virtual LONG Disable() = 0;
virtual bool CheckRegistryState() = 0;
};
}
| [
"bryan.guner@gmail.com"
] | bryan.guner@gmail.com |
75d8386f39cd57ca808490688dac18db21d50b1d | ef91a0d2742274151949b848e34f3398e75a7b5b | /PyoFilter_mac/JuceLibraryCode/JuceHeader.h | e6d937d2900efa80c778aace16310a4bd6c8f0c9 | [] | no_license | JVanBuskirk/PyoFilter | 6a6e5784cad6298ca56774cb4d884a2685464efc | 0698e7c41ec4cde533a841f5b18f0c5ec88c27e4 | refs/heads/master | 2021-03-19T11:53:59.100450 | 2018-07-25T01:02:50 | 2018-07-25T01:02:50 | 98,043,005 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,557 | h | /*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
This is the header file that your files should include in order to get all the
JUCE library headers. You should avoid including the JUCE headers directly in
your own source files, because that wouldn't pick up the correct configuration
options for your app.
*/
#pragma once
#include "AppConfig.h"
#include <juce_audio_basics/juce_audio_basics.h>
#include <juce_audio_devices/juce_audio_devices.h>
#include <juce_audio_formats/juce_audio_formats.h>
#include <juce_audio_plugin_client/juce_audio_plugin_client.h>
#include <juce_audio_processors/juce_audio_processors.h>
#include <juce_core/juce_core.h>
#include <juce_cryptography/juce_cryptography.h>
#include <juce_data_structures/juce_data_structures.h>
#include <juce_events/juce_events.h>
#include <juce_graphics/juce_graphics.h>
#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>
#include "BinaryData.h"
#if ! DONT_SET_USING_JUCE_NAMESPACE
// If your code uses a lot of JUCE classes, then this will obviously save you
// a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
using namespace juce;
#endif
#if ! JUCE_DONT_DECLARE_PROJECTINFO
namespace ProjectInfo
{
const char* const projectName = "PyoFilter";
const char* const versionString = "1.0.0";
const int versionNumber = 0x10000;
}
#endif
| [
"jeremyvanb@yahoo.com"
] | jeremyvanb@yahoo.com |
dbf19bbd19619fdd28e1e89d99f6998c754621c2 | 14248aaedfa5f77c7fc5dd8c3741604fb987de5c | /luogu/P4492.cpp | 24b1f38b0501ebbc4b5f749d13a4ddc5646db405 | [] | no_license | atubo/online-judge | fc51012465a1bd07561b921f5c7d064e336a4cd2 | 8774f6c608bb209a1ebbb721d6bbfdb5c1d1ce9b | refs/heads/master | 2021-11-22T19:48:14.279016 | 2021-08-29T23:16:16 | 2021-08-29T23:16:16 | 13,290,232 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 919 | cpp | // https://www.luogu.org/problem/P4492
// [HAOI2018]苹果树
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010;
int N, P;
int C[MAXN][MAXN];
int F[MAXN];
int add(int64_t a, int64_t b) {
return (a + b) % P;
}
int mul(int64_t a, int64_t b) {
return (a * b) % P;
}
void build() {
C[0][0] = 1;
for (int i = 1; i <= N; i++) {
C[i][0] = 1;
for (int j = 1; j <= i; j++) {
C[i][j] = add(C[i-1][j-1], C[i-1][j]);
}
}
F[0] = 1;
for (int i = 1; i <= N; i++) {
F[i] = mul(F[i-1], i);
}
}
int main() {
scanf("%d%d", &N, &P);
build();
int ret = 0;
for (int i = 2; i <= N; i++) {
for (int s = 1; s <= N-i+1; s++) {
int64_t t = F[s];
t = mul(t, C[N-i][s-1]);
t = mul(t, s);
t = mul(t, N-s);
t = mul(t, F[N-s-1]);
t = mul(t, i);
t = mul(t, i-1);
ret = add(ret, t);
}
}
printf("%d\n", ret);
return 0;
}
| [
"err722@yahoo.com"
] | err722@yahoo.com |
e5521139b53213ac659be34112fc7b8da3b0b7c7 | bdfda25eb8f35346081d9cfb0ce00c845e771a72 | /Plugins/BasisCore/Intermediate/Build/Win64/UE4/Inc/BasisCore/BasisCore.init.gen.cpp | ce69b52689dc8baa96c76fc663900d51c7aef7dd | [] | no_license | kkcedar8520/UnrealDestiny | bf062b284efd500b482d13585e086318de2fc10e | 3dbe4af01597948edae1cf546ec5d957f0e04b81 | refs/heads/master | 2023-03-29T15:28:10.726572 | 2021-04-08T15:03:14 | 2021-04-08T15:03:14 | 355,240,409 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,067 | cpp | // Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/GeneratedCppIncludes.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4883)
#endif
PRAGMA_DISABLE_DEPRECATION_WARNINGS
void EmptyLinkFunctionForGeneratedCodeBasisCore_init() {}
UPackage* Z_Construct_UPackage__Script_BasisCore()
{
static UPackage* ReturnPackage = nullptr;
if (!ReturnPackage)
{
static const UE4CodeGen_Private::FPackageParams PackageParams = {
"/Script/BasisCore",
nullptr,
0,
PKG_CompiledIn | 0x00000000,
0x7A369AAC,
0x7600CB53,
METADATA_PARAMS(nullptr, 0)
};
UE4CodeGen_Private::ConstructUPackage(ReturnPackage, PackageParams);
}
return ReturnPackage;
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#ifdef _MSC_VER
#pragma warning (pop)
#endif
| [
"fishgenius@naver.com"
] | fishgenius@naver.com |
e503923c97ef07a8c080a8d56820d819bd7fb6ff | a2111a80faf35749d74a533e123d9da9da108214 | /raw/pmsb13/pmsb13-data-20130530/sources/fjt74l9mlcqisdus/2013-05-10T23-42-06.770+0200/sandbox/my_sandbox/apps/blastX/test_file.cpp | a3072cca67a8a5d2e0c43d4408ff94cd8c287843 | [
"MIT"
] | permissive | bkahlert/seqan-research | f2c550d539f511825842a60f6b994c1f0a3934c2 | 21945be863855077eec7cbdb51c3450afcf560a3 | refs/heads/master | 2022-12-24T13:05:48.828734 | 2015-07-01T01:56:22 | 2015-07-01T01:56:22 | 21,610,669 | 1 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 11,173 | cpp | // BLASTX IMPLEMENTIERUNG VON ANNKATRIN BRESSIN UND MARJAN FAIZI
// SOFTWAREPROJEKT VOM 2.4. - 29.5.2012
// VERSION VOM 04.MAI.2013
#undef SEQAN_ENABLE_TESTING
#define SEQAN_ENABLE_TESTING 1
#include "own_functions.h"
/*
// TEST GET_ALPHABET_FORCE ---------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_get_alphabet_force)
{
StringSet<String<AminoAcid> > result;
String<AminoAcid> temp;
append(temp, "CDQNRQNCDCCDRCCQQQQCE");
appendValue(result, temp);
StringSet<String<AminoAcid> > alphabet = GET_ALPHABET_FORCE();
//SEQAN_ASSERT_EQ(result, alphabet);
}
// TEST GET_ALPHABET_FORCE ---------------------------------------------------------------------------------------------
// TEST GET_ALPHABET ---------------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_get_alphabet)
{
}
// TEST GET_ALPHABET ---------------------------------------------------------------------------------------------------
*/
// TEST HASH FUNKTION --------------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_hash)
{
// normaler Eingabewert fuer hash funktion
int result = hash(1,0,3);
SEQAN_ASSERT(result>=0 && result<=63);
// zu hoher Eingabewert in hash funktion
result = hash(4,7,900);
SEQAN_ASSERT_EQ(result,-1);
// zu niedriger Eingabewert in hash funktion
result = hash(4,-7,-900);
SEQAN_ASSERT_EQ(result,-1);
// Eingabewert N
result = hash(4,0,1);
SEQAN_ASSERT_EQ(result,-1);
// cast von normalen char
result = hash((int)'G',(int)'K',(int)'J');
SEQAN_ASSERT_EQ(result,-1);
}
// TEST HASH FUNKTION --------------------------------------------------------------------------------------------------
// TEST GET AMINOACID POS FUNKTION -------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_get_amino_acid_pos)
{
int result;
// alle Moeglichen Eingabewerte fuer get_amino_acid_pos
for (int i=0;i<=63;++i){
result = get_Amino_Acid_Pos(i);
SEQAN_ASSERT(result>=0 && result<=21);
}
// alle Moegliche und nicht Moegliche Eingabewerte
for (int i=-100;i<=100;++i){
result = get_Amino_Acid_Pos(i);
SEQAN_ASSERT(result>=0 && result<=21 || result==-1);
}
// Punktprobe
result = get_Amino_Acid_Pos(7); // Threonin Eingabe
SEQAN_ASSERT_EQ(result,16);
}
// TEST GET AMINOACID POS FUNKTION -------------------------------------------------------------------------------------
// TEST GET AMINOACID POS UND HASH FUNKTION ----------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_apps_get_amino_acid_pos_and_hash)
{
// Punkttest hash funktion und get_amino_acid_pos
int hash_value = hash(0,0,0); // Lysin
int result = get_Amino_Acid_Pos(hash_value);
SEQAN_ASSERT(result==11);
hash_value = hash(3,3,3); // Phenylalanin
result = get_Amino_Acid_Pos(hash_value);
SEQAN_ASSERT(result==13);
hash_value = hash(1,0,3); // Histidin
result = get_Amino_Acid_Pos(hash_value);
SEQAN_ASSERT(result==8);
hash_value = hash(0,2,3); // Serin
result = get_Amino_Acid_Pos(hash_value);
SEQAN_ASSERT(result==15);
hash_value = hash(3,2,0); // stop
result = get_Amino_Acid_Pos(hash_value);
SEQAN_ASSERT(result==20);
}
// TEST GET AMINOACID POS UND HASH FUNKTION ----------------------------------------------------------------------------
// TEST GET_TRANSLATE_FROM_CODON ---------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_get_translate_from_codon)
{
// Punkttest für gültige Eingabeparameter
StrSetSA alphabet = GET_ALPHABET_FORCE();
String<Dna> triplet = "GCT";
int result = get_translate_from_codon(triplet,alphabet[0],1); // Alanin
SEQAN_ASSERT(result==4);
triplet = "CTA";
result = get_translate_from_codon(triplet,alphabet[0],1); // Leucin
SEQAN_ASSERT(result==4);
triplet = "GTT";
result = get_translate_from_codon(triplet,alphabet[0],1); // Valin
SEQAN_ASSERT(result==4);
triplet = "TGG";
result = get_translate_from_codon(triplet,alphabet[0],1); // Tryptophan
SEQAN_ASSERT(result==5);
triplet = "GAA";
result = get_translate_from_codon(triplet,alphabet[0],1); // Glutaminsäure
SEQAN_ASSERT(result==2);
triplet = "GCT";
result = get_translate_from_codon(triplet,alphabet[0],0); // Alanin
SEQAN_ASSERT(result==0);
triplet = "CTA";
result = get_translate_from_codon(triplet,alphabet[0],0); // Leucin
SEQAN_ASSERT(result==10);
triplet = "GTT";
result = get_translate_from_codon(triplet,alphabet[0],0); // Valin
SEQAN_ASSERT(result==19);
triplet = "TGG";
result = get_translate_from_codon(triplet,alphabet[0],0); // Tryptophan
SEQAN_ASSERT(result==17);
triplet = "GAA";
result = get_translate_from_codon(triplet,alphabet[0],0); // Glutaminsäure
SEQAN_ASSERT(result==6);
}
// TEST GET_TRANSLATE_FROM_CODON ---------------------------------------------------------------------------------------
// TEST TRANSLATE ------------------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_translate)
{
StrSetSA trans_reads;
StrSetSA alphabet = GET_ALPHABET_FORCE();
String<Dna> read = "ACGATGACGATCAGTACGATACAGTAC";
for (int frame=0;frame<6;++frame){
int result = translate(trans_reads,read,alphabet[0],frame,1);
SEQAN_ASSERT_EQ(result,0);
SEQAN_ASSERT_EQ(length(trans_reads),frame+1);
}
SEQAN_ASSERT_EQ(trans_reads[0],"QRQCQQCQQ");
SEQAN_ASSERT_EQ(trans_reads[1],"DEDQCDQQ");
SEQAN_ASSERT_EQ(trans_reads[2],"NNNQQNQC");
SEQAN_ASSERT_EQ(trans_reads[3],"CCQDQNDDD");
// SEQAN_ASSERT_EQ(trans_reads[4],"");
// SEQAN_ASSERT_EQ(trans_reads[5],"");
clear(trans_reads);
for (int frame=0;frame<6;++frame){
int result = translate(trans_reads,read,alphabet[0],frame,1);
SEQAN_ASSERT_EQ(result,0);
SEQAN_ASSERT_EQ(length(trans_reads),frame+1);
}
}
// TEST TRANSLATE ------------------------------------------------------------------------------------------------------
/*
// TEST TRANSLATE_READS ------------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_translate_reads)
{
StrSetSA trans_reads;
StrSetSA alphabet = GET_ALPHABET_FORCE();
StringSet<String<Dna>> read;
appendValue(read,"ACGATGCAGTCAGTGTCA");
appendValue(read,"GTGATCGTACGTCAGGTA");
int result = translate_reads(read,trans_reads,alphabet[0]);
SEQAN_ASSERT_EQ(length(trans_reads),12);
SEQAN_ASSERT_EQ(trans_reads[0],"QRQQCQ");
SEQAN_ASSERT_EQ(trans_reads[1],"DRQQR");
SEQAN_ASSERT_EQ(trans_reads[2],"NCCQC");
SEQAN_ASSERT_EQ(trans_reads[3],"EDECDD");
SEQAN_ASSERT_EQ(trans_reads[4],"NQNRC");
SEQAN_ASSERT_EQ(trans_reads[5],"QCQCQ");
SEQAN_ASSERT_EQ(trans_reads[6],"CCCDQC");
SEQAN_ASSERT_EQ(trans_reads[7],"EQQCD");
SEQAN_ASSERT_EQ(trans_reads[8],"NDQQC");
SEQAN_ASSERT_EQ(trans_reads[9],"QCQQND");
SEQAN_ASSERT_EQ(trans_reads[10],"QEDQC");
SEQAN_ASSERT_EQ(trans_reads[11],"CNCDQ");
}
// TEST TRANSLATE_READS ------------------------------------------------------------------------------------------------
// TEST TRANSLATE_DATABASE ---------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_translate_database)
{
StrSetSA trans_proteine;
StrSetSA alphabet = GET_ALPHABET_FORCE();
StrSetSA proteine;
appendValue(proteine,"QNEVGNATILNVWPF");
appendValue(proteine,"ARNDCQEGHILKMFPSTWYV");
int result = translate_database(trans_proteine,proteine,alphabet[0]);
SEQAN_ASSERT_EQ(length(trans_proteine),2);
SEQAN_ASSERT_EQ(trans_proteine[0],"QQNCCQCQCCQCQCC");
SEQAN_ASSERT_EQ(trans_proteine[1],"CDQNRQNCDCCDRCCQQQQC");
}
// TEST TRANSLATE_DATABASE ---------------------------------------------------------------------------------------------
// TEST APPEND_TO_MATCH_FOUND ------------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_append_to_match_found)
{
Match_found test;
Pair<unsigned int,unsigned int> x (1,10);
Pair<unsigned int,unsigned int> y (1,13);
Pair<unsigned int,unsigned int> z (13,0);
int seed = 3;
append_to_match_found(test,x,y,z,seed,10);
SEQAN_ASSERT_EQ(test.position_read,1);
SEQAN_ASSERT_EQ(test.begin_read,5);
SEQAN_ASSERT_EQ(test.end_read,8);
SEQAN_ASSERT_EQ(test.position_protein,1);
SEQAN_ASSERT_EQ(test.begin_protein,5);
SEQAN_ASSERT_EQ(test.end_protein,8);
}
// TEST APPEND_TO_MATCH_FOUND ------------------------------------------------------------------------------------------
// TEST APPEND_TO_FIND_MATCHES -----------------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_find_matches)
{
StrSetSA trans_proteine;
StrSetSA trans_reads;
appendValue (trans_reads,"QCQ");
appendValue(trans_proteine,"CRCQQCQQ");
Match_found test0;
int seed = 3;
int distance = 0;
int result = find_matches(trans_proteine,trans_reads,seed,distance,test0);
SEQAN_ASSERT_EQ(result,0);
SEQAN_ASSERT_EQ(test0.position_read,0);
SEQAN_ASSERT_EQ(test0.begin_read,0);
SEQAN_ASSERT_EQ(test0.end_read,3);
SEQAN_ASSERT_EQ(test0.position_protein,0);
SEQAN_ASSERT_EQ(test0.begin_protein,4);
SEQAN_ASSERT_EQ(test0.end_protein,7);
appendValue (trans_reads,"CQQ");
appendValue(trans_proteine,"QCQQCRCQ");
Match_found test;
result = find_matches(trans_proteine,trans_reads,seed,distance,test);
}
// TEST APPEND_TO_FIND_MATCHES -----------------------------------------------------------------------------------------
// TEST APPEND_TO_FIND_MATCHES_FOR_ALL ---------------------------------------------------------------------------------
SEQAN_DEFINE_TEST(test_my_app_find_matches_for_all)
{
}
// TEST APPEND_TO_FIND_MATCHES_FOR_ALL ---------------------------------------------------------------------------------
*/
// TEST DURCHLAUF ------------------------------------------------------------------------------------------------------
// Normale eingabe
SEQAN_BEGIN_TESTSUITE(test_my_app_funcs)
{
// SEQAN_CALL_TEST(test_my_app_get_alphabet_force);
// SEQAN_CALL_TEST(test_my_app_get_alphabet);
SEQAN_CALL_TEST(test_my_app_hash);
SEQAN_CALL_TEST(test_my_app_get_amino_acid_pos);
SEQAN_CALL_TEST(test_my_apps_get_amino_acid_pos_and_hash);
SEQAN_CALL_TEST(test_my_app_get_translate_from_codon);
SEQAN_CALL_TEST(test_my_app_translate);
// SEQAN_CALL_TEST(test_my_app_translate_reads);
// SEQAN_CALL_TEST(test_my_app_translate_database);
// SEQAN_CALL_TEST(test_my_app_append_to_match_found);
// SEQAN_CALL_TEST(test_my_app_find_matches);
// SEQAN_CALL_TEST(test_my_app_find_matches_for_all);
}
SEQAN_END_TESTSUITE
// TEST DURCHLAUF ------------------------------------------------------------------------------------------------------
| [
"mail@bkahlert.com"
] | mail@bkahlert.com |
3c81ab46f2dc8bf273059b5af9ebfd085e08b34f | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5686313294495744_0/C++/AISarkin/c.cpp | 3b4a2977126f4a3e6a8ad35ba723c887f75cd0b6 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 2,623 | cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
using namespace std;
#define TASKNAME ""
void solve(int test_number);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.setf(ios::fixed);
cout.precision(9);
cerr.setf(ios::fixed);
cerr.precision(3);
#ifdef LOCAL
freopen("test.in", "r", stdin);
freopen("test.out", "w", stdout);
#else
#endif
int n;
cin >> n;
for (int i = 0; i < n; i++) {
solve(i);
}
}
const int MAX_N = 2005;
string topic[MAX_N][2], topics[MAX_N * 2];
pair<int, int> nums[MAX_N];
int flow[2 * MAX_N][2 * MAX_N], cap[2 * MAX_N][2 * MAX_N];
const int SRC = 2 * MAX_N - 1;
const int DST = SRC - 1;
bool vis[MAX_N * 2];
int dfs(int u) {
if (u == DST) {
return 1;
}
if (vis[u]) {
return 0;
}
vis[u] = true;
for (int j = 0; j < MAX_N * 2; j++) {
if (!vis[j] && flow[u][j] < cap[u][j] && dfs(j)) {
flow[u][j]++;
flow[j][u]--;
return 1;
}
}
return 0;
}
void solve(int test_number) {
int n;
cin >> n;
int sz = 0;
for (int i = 0; i < n; i++) {
cin >> topic[i][0] >> topic[i][1];
topics[sz++] = topic[i][0];
topics[sz++] = topic[i][1];
}
sort(topics, topics + sz);
sz = unique(topics, topics + sz) - topics;
vector<int> topics_l, topics_r;
for (int i = 0; i < n; i++) {
nums[i] = make_pair(lower_bound(topics, topics + sz, topic[i][0]) - topics,
lower_bound(topics, topics + sz, topic[i][1]) - topics);
topics_l.push_back(nums[i].first);
topics_r.push_back(nums[i].second);
}
sort(topics_l.begin(), topics_l.end());
topics_l.resize(unique(topics_l.begin(), topics_l.end()) - topics_l.begin());
sort(topics_r.begin(), topics_r.end());
topics_r.resize(unique(topics_r.begin(), topics_r.end()) - topics_r.begin());
memset(flow, 0, sizeof(flow));
memset(cap, 0, sizeof(cap));
for (int i = 0; i < n; i++) {
cap[nums[i].first][nums[i].second + MAX_N]++;
}
for (int i = 0; i < MAX_N - 4; i++) {
cap[SRC][i] = 1;
cap[i + MAX_N][DST] = 1;
}
int flow = 0;
memset(vis, false, sizeof(vis));
while (dfs(SRC)) {
flow++;
memset(vis, false, sizeof(vis));
}
cout << "Case #" << test_number + 1 << ": ";
cout << n - (int)topics_l.size() - (int)topics_r.size() + flow << endl;
}
| [
"alexandra1.back@gmail.com"
] | alexandra1.back@gmail.com |
a53003782e8ddc9dac73e6dbd4d6265268b4ee88 | d2387d5584411182da870b8fdc9d654fc9b2298c | /local_addons/ofxOpenCv/libs/opencv/include/opencv2/cudev/grid/histogram.hpp | 154f73771bacc3eeafa7c75738fe3fb9537524f4 | [
"MIT"
] | permissive | ofZach/RTP_MIT_RECODED | f841b7da33d7aa473d68740861dd295c62db1a91 | dbfcc5d36983445b7e71f01beea17ee60b124017 | refs/heads/master | 2020-08-29T18:10:17.822839 | 2019-11-01T14:56:39 | 2019-11-01T14:56:39 | 218,122,505 | 12 | 8 | MIT | 2019-11-01T14:56:41 | 2019-10-28T18:54:45 | C++ | UTF-8 | C++ | false | false | 4,751 | hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#pragma once
#ifndef __OPENCV_CUDEV_GRID_HISTOGRAM_HPP__
#define __OPENCV_CUDEV_GRID_HISTOGRAM_HPP__
#include "../common.hpp"
#include "../ptr2d/traits.hpp"
#include "../ptr2d/gpumat.hpp"
#include "../ptr2d/mask.hpp"
#include "detail/histogram.hpp"
namespace cv { namespace cudev {
//! @addtogroup cudev
//! @{
template <int BIN_COUNT, class Policy, class SrcPtr, typename ResType, class MaskPtr>
__host__ void gridHistogram_(const SrcPtr& src, GpuMat_<ResType>& dst, const MaskPtr& mask, Stream& stream = Stream::Null())
{
CV_Assert( deviceSupports(SHARED_ATOMICS) );
const int rows = getRows(src);
const int cols = getCols(src);
CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
dst.create(1, BIN_COUNT);
dst.setTo(0, stream);
grid_histogram_detail::histogram<BIN_COUNT, Policy>(shrinkPtr(src),
dst[0],
shrinkPtr(mask),
rows, cols,
StreamAccessor::getStream(stream));
}
template <int BIN_COUNT, class Policy, class SrcPtr, typename ResType>
__host__ void gridHistogram_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
CV_Assert( deviceSupports(SHARED_ATOMICS) );
const int rows = getRows(src);
const int cols = getCols(src);
dst.create(1, BIN_COUNT);
dst.setTo(0, stream);
grid_histogram_detail::histogram<BIN_COUNT, Policy>(shrinkPtr(src),
dst[0],
WithOutMask(),
rows, cols,
StreamAccessor::getStream(stream));
}
// default policy
struct DefaultHistogramPolicy
{
enum {
block_size_x = 32,
block_size_y = 8
};
};
template <int BIN_COUNT, class SrcPtr, typename ResType, class MaskPtr>
__host__ void gridHistogram(const SrcPtr& src, GpuMat_<ResType>& dst, const MaskPtr& mask, Stream& stream = Stream::Null())
{
gridHistogram_<BIN_COUNT, DefaultHistogramPolicy>(src, dst, mask, stream);
}
template <int BIN_COUNT, class SrcPtr, typename ResType>
__host__ void gridHistogram(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
gridHistogram_<BIN_COUNT, DefaultHistogramPolicy>(src, dst, stream);
}
//! @}
}}
#endif
| [
"peter.beshai@gmail.com"
] | peter.beshai@gmail.com |
274c962a2154c8fa3f43acc4efdec387874ab516 | 572024902ee45d7246bceff508f1035f8c464693 | /third_party/skia/tools/bookmaker/spellCheck.cpp | 6f50cb3bb527d187a05626136dcdc22ac8549e93 | [
"MIT",
"BSD-3-Clause"
] | permissive | mediabuff/Prelude | 539a275a52d65e1bf84dc218772ea24fff384391 | 601507c6dc8cf27999ceffc0fef97afba2bd764d | refs/heads/master | 2020-03-12T16:31:18.951711 | 2018-03-27T13:36:22 | 2018-04-05T19:31:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,576 | cpp | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "bookmaker.h"
#include "SkOSFile.h"
#include "SkOSPath.h"
/*
things to do
if cap word is beginning of sentence, add it to table as lower-case
word must have only a single initial capital
if word is camel cased, look for :: matches on suffix
when function crosses lines, whole thing isn't seen as a 'word' e.g., search for largeArc in path
words in external not seen
*/
struct CheckEntry {
string fFile;
int fLine;
int fCount;
};
class SpellCheck : public ParserCommon {
public:
SpellCheck(const BmhParser& bmh) : ParserCommon()
, fBmhParser(bmh) {
this->reset();
}
bool check(const char* match);
void report(SkCommandLineFlags::StringArray report);
private:
enum class TableState {
kNone,
kRow,
kColumn,
};
bool check(Definition* );
bool checkable(MarkType markType);
void childCheck(const Definition* def, const char* start);
void leafCheck(const char* start, const char* end);
bool parseFromFile(const char* path) override { return true; }
void printCheck(const string& str);
void reset() override {
INHERITED::resetCommon();
fMethod = nullptr;
fRoot = nullptr;
fTableState = TableState::kNone;
fInCode = false;
fInConst = false;
fInFormula = false;
fInDescription = false;
fInStdOut = false;
}
void wordCheck(const string& str);
void wordCheck(ptrdiff_t len, const char* ch);
unordered_map<string, CheckEntry> fCode;
unordered_map<string, CheckEntry> fColons;
unordered_map<string, CheckEntry> fDigits;
unordered_map<string, CheckEntry> fDots;
unordered_map<string, CheckEntry> fParens; // also hold destructors, operators
unordered_map<string, CheckEntry> fUnderscores;
unordered_map<string, CheckEntry> fWords;
const BmhParser& fBmhParser;
Definition* fMethod;
RootDefinition* fRoot;
TableState fTableState;
bool fInCode;
bool fInConst;
bool fInDescription;
bool fInFormula;
bool fInStdOut;
typedef ParserCommon INHERITED;
};
/* This doesn't perform a traditional spell or grammar check, although
maybe it should. Instead it looks for words used uncommonly and lower
case words that match capitalized words that are not sentence starters.
It also looks for articles preceeding capitalized words and their
modifiers to try to maintain a consistent voice.
Maybe also look for passive verbs (e.g. 'is') and suggest active ones?
*/
void BmhParser::spellCheck(const char* match, SkCommandLineFlags::StringArray report) const {
SpellCheck checker(*this);
checker.check(match);
checker.report(report);
}
bool SpellCheck::check(const char* match) {
for (const auto& topic : fBmhParser.fTopicMap) {
Definition* topicDef = topic.second;
if (topicDef->fParent) {
continue;
}
if (!topicDef->isRoot()) {
return this->reportError<bool>("expected root topic");
}
fRoot = topicDef->asRoot();
if (string::npos == fRoot->fFileName.rfind(match)) {
continue;
}
this->check(topicDef);
}
return true;
}
static bool all_lower(const string& str) {
for (auto c : str) {
if (!islower(c)) {
return false;
}
}
return true;
}
bool SpellCheck::check(Definition* def) {
fFileName = def->fFileName;
fLineCount = def->fLineCount;
string printable = def->printableName();
const char* textStart = def->fContentStart;
if (MarkType::kParam != def->fMarkType && MarkType::kConst != def->fMarkType &&
MarkType::kPrivate != def->fMarkType && TableState::kNone != fTableState) {
fTableState = TableState::kNone;
}
switch (def->fMarkType) {
case MarkType::kAlias:
break;
case MarkType::kAnchor:
break;
case MarkType::kBug:
break;
case MarkType::kClass:
this->wordCheck(def->fName);
break;
case MarkType::kCode:
fInCode = true;
break;
case MarkType::kColumn:
break;
case MarkType::kComment:
break;
case MarkType::kConst: {
fInConst = true;
if (TableState::kNone == fTableState) {
fTableState = TableState::kRow;
}
if (TableState::kRow == fTableState) {
fTableState = TableState::kColumn;
}
this->wordCheck(def->fName);
const char* lineEnd = strchr(textStart, '\n');
this->wordCheck(lineEnd - textStart, textStart);
textStart = lineEnd;
} break;
case MarkType::kDefine:
break;
case MarkType::kDefinedBy:
break;
case MarkType::kDeprecated:
break;
case MarkType::kDescription:
fInDescription = true;
break;
case MarkType::kDoxygen:
break;
case MarkType::kEnum:
case MarkType::kEnumClass:
this->wordCheck(def->fName);
break;
case MarkType::kError:
break;
case MarkType::kExample:
break;
case MarkType::kExperimental:
break;
case MarkType::kExternal:
break;
case MarkType::kFile:
break;
case MarkType::kFormula:
fInFormula = true;
break;
case MarkType::kFunction:
break;
case MarkType::kHeight:
break;
case MarkType::kImage:
break;
case MarkType::kLegend:
break;
case MarkType::kLink:
break;
case MarkType::kList:
break;
case MarkType::kLiteral:
break;
case MarkType::kMarkChar:
break;
case MarkType::kMember:
break;
case MarkType::kMethod: {
string method_name = def->methodName();
if (all_lower(method_name)) {
method_name += "()";
}
string formattedStr = def->formatFunction();
if (!def->isClone() && Definition::MethodType::kOperator != def->fMethodType) {
this->wordCheck(method_name);
}
fTableState = TableState::kNone;
fMethod = def;
} break;
case MarkType::kNoExample:
break;
case MarkType::kOutdent:
break;
case MarkType::kParam: {
if (TableState::kNone == fTableState) {
fTableState = TableState::kRow;
}
if (TableState::kRow == fTableState) {
fTableState = TableState::kColumn;
}
TextParser paramParser(def->fFileName, def->fStart, def->fContentStart,
def->fLineCount);
paramParser.skipWhiteSpace();
SkASSERT(paramParser.startsWith("#Param"));
paramParser.next(); // skip hash
paramParser.skipToNonAlphaNum(); // skip Param
paramParser.skipSpace();
const char* paramName = paramParser.fChar;
paramParser.skipToSpace();
fInCode = true;
this->wordCheck(paramParser.fChar - paramName, paramName);
fInCode = false;
} break;
case MarkType::kPlatform:
break;
case MarkType::kPrivate:
break;
case MarkType::kReturn:
break;
case MarkType::kRow:
break;
case MarkType::kSeeAlso:
break;
case MarkType::kStdOut: {
fInStdOut = true;
TextParser code(def);
code.skipSpace();
while (!code.eof()) {
const char* end = code.trimmedLineEnd();
this->wordCheck(end - code.fChar, code.fChar);
code.skipToLineStart();
}
fInStdOut = false;
} break;
case MarkType::kStruct:
fRoot = def->asRoot();
this->wordCheck(def->fName);
break;
case MarkType::kSubstitute:
break;
case MarkType::kSubtopic:
this->printCheck(printable);
break;
case MarkType::kTable:
break;
case MarkType::kTemplate:
break;
case MarkType::kText:
break;
case MarkType::kTime:
break;
case MarkType::kToDo:
break;
case MarkType::kTopic:
this->printCheck(printable);
break;
case MarkType::kTrack:
// don't output children
return true;
case MarkType::kTypedef:
break;
case MarkType::kUnion:
break;
case MarkType::kVolatile:
break;
case MarkType::kWidth:
break;
default:
SkASSERT(0); // handle everything
break;
}
this->childCheck(def, textStart);
switch (def->fMarkType) { // post child work, at least for tables
case MarkType::kCode:
fInCode = false;
break;
case MarkType::kColumn:
break;
case MarkType::kDescription:
fInDescription = false;
break;
case MarkType::kEnum:
case MarkType::kEnumClass:
break;
case MarkType::kExample:
break;
case MarkType::kFormula:
fInFormula = false;
break;
case MarkType::kLegend:
break;
case MarkType::kMethod:
fMethod = nullptr;
break;
case MarkType::kConst:
fInConst = false;
case MarkType::kParam:
SkASSERT(TableState::kColumn == fTableState);
fTableState = TableState::kRow;
break;
case MarkType::kReturn:
case MarkType::kSeeAlso:
break;
case MarkType::kRow:
break;
case MarkType::kStruct:
fRoot = fRoot->rootParent();
break;
case MarkType::kTable:
break;
default:
break;
}
return true;
}
bool SpellCheck::checkable(MarkType markType) {
return BmhParser::Resolvable::kYes == fBmhParser.fMaps[(int) markType].fResolve;
}
void SpellCheck::childCheck(const Definition* def, const char* start) {
const char* end;
fLineCount = def->fLineCount;
if (def->isRoot()) {
fRoot = const_cast<RootDefinition*>(def->asRoot());
}
for (auto& child : def->fChildren) {
end = child->fStart;
if (this->checkable(def->fMarkType)) {
this->leafCheck(start, end);
}
this->check(child);
start = child->fTerminator;
}
if (this->checkable(def->fMarkType)) {
end = def->fContentEnd;
this->leafCheck(start, end);
}
}
void SpellCheck::leafCheck(const char* start, const char* end) {
const char* chPtr = start;
int inAngles = 0;
int inParens = 0;
bool inQuotes = false;
bool allLower = true;
char priorCh = 0;
char lastCh = 0;
const char* wordStart = nullptr;
const char* wordEnd = nullptr;
const char* possibleEnd = nullptr;
do {
if (wordStart && wordEnd) {
if (!allLower || (!inQuotes && '\"' != lastCh && !inParens
&& ')' != lastCh && !inAngles && '>' != lastCh)) {
string word(wordStart, (possibleEnd ? possibleEnd : wordEnd) - wordStart);
wordCheck(word);
}
wordStart = nullptr;
}
if (chPtr == end) {
break;
}
switch (*chPtr) {
case '>':
if (isalpha(lastCh)) {
--inAngles;
SkASSERT(inAngles >= 0);
}
wordEnd = chPtr;
break;
case '(':
++inParens;
possibleEnd = chPtr;
break;
case ')':
--inParens;
if ('(' == lastCh) {
wordEnd = chPtr + 1;
} else {
wordEnd = chPtr;
}
SkASSERT(inParens >= 0 || fInStdOut);
break;
case '\"':
inQuotes = !inQuotes;
wordEnd = chPtr;
SkASSERT(inQuotes == !wordStart);
break;
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
case 'Z':
allLower = false;
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'z':
if (!wordStart) {
wordStart = chPtr;
wordEnd = nullptr;
possibleEnd = nullptr;
allLower = 'a' <= *chPtr;
if ('<' == lastCh || ('<' == priorCh && '/' == lastCh)) {
++inAngles;
}
}
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '_':
allLower = false;
case '-': // note that dash doesn't clear allLower
break;
default:
wordEnd = chPtr;
break;
}
priorCh = lastCh;
lastCh = *chPtr;
} while (++chPtr <= end);
}
void SpellCheck::printCheck(const string& str) {
string word;
for (std::stringstream stream(str); stream >> word; ) {
wordCheck(word);
}
}
static bool stringCompare(const std::pair<string, CheckEntry>& i, const std::pair<string, CheckEntry>& j) {
return i.first.compare(j.first) < 0;
}
void SpellCheck::report(SkCommandLineFlags::StringArray report) {
vector<std::pair<string, CheckEntry>> elems(fWords.begin(), fWords.end());
std::sort(elems.begin(), elems.end(), stringCompare);
if (report.contains("once")) {
for (auto iter : elems) {
if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("markup.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
continue;
}
if (iter.second.fCount == 1) {
SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
iter.first.c_str());
}
}
SkDebugf("\n");
return;
}
if (report.contains("all")) {
int column = 0;
char lastInitial = 'a';
int count = 0;
for (auto iter : elems) {
if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("markup.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
continue;
}
string check = iter.first.c_str();
bool allLower = true;
for (auto c : check) {
if (isupper(c)) {
allLower = false;
break;
}
}
if (!allLower) {
continue;
}
if (column + check.length() > 100 || check[0] != lastInitial) {
SkDebugf("\n");
column = 0;
}
if (check[0] != lastInitial) {
SkDebugf("\n");
lastInitial = check[0];
}
SkDebugf("%s ", check.c_str());
column += check.length();
++count;
}
SkDebugf("\n\ncount = %d\n", count);
return;
}
int index = 0;
const char* mispelled = report[0];
for (auto iter : elems) {
if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("markup.bmh")) {
continue;
}
if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
continue;
}
string check = iter.first.c_str();
while (check.compare(mispelled) > 0) {
SkDebugf("%s not found\n", mispelled);
if (report.count() == ++index) {
break;
}
}
if (report.count() == index) {
break;
}
if (check.compare(mispelled) == 0) {
SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
iter.first.c_str());
if (report.count() == ++index) {
break;
}
}
}
}
void SpellCheck::wordCheck(const string& str) {
if ("nullptr" == str) {
return; // doesn't seem worth it, treating nullptr as a word in need of correction
}
bool hasColon = false;
bool hasDot = false;
bool hasParen = false;
bool hasUnderscore = false;
bool sawDash = false;
bool sawDigit = false;
bool sawSpecial = false;
SkASSERT(str.length() > 0);
SkASSERT(isalpha(str[0]) || '~' == str[0]);
for (char ch : str) {
if (isalpha(ch) || '-' == ch) {
sawDash |= '-' == ch;
continue;
}
bool isColon = ':' == ch;
hasColon |= isColon;
bool isDot = '.' == ch;
hasDot |= isDot;
bool isParen = '(' == ch || ')' == ch || '~' == ch || '=' == ch || '!' == ch ||
'[' == ch || ']' == ch;
hasParen |= isParen;
bool isUnderscore = '_' == ch;
hasUnderscore |= isUnderscore;
if (isColon || isDot || isUnderscore || isParen) {
continue;
}
if (isdigit(ch)) {
sawDigit = true;
continue;
}
if ('&' == ch || ',' == ch || ' ' == ch) {
sawSpecial = true;
continue;
}
SkASSERT(0);
}
if (sawSpecial && !hasParen) {
SkASSERT(0);
}
bool inCode = fInCode;
if (hasUnderscore && isupper(str[0]) && ('S' != str[0] || 'K' != str[1])
&& !hasColon && !hasDot && !hasParen && !fInStdOut && !inCode && !fInConst
&& !sawDigit && !sawSpecial && !sawDash) {
std::istringstream ss(str);
string token;
while (std::getline(ss, token, '_')) {
if (token.length()) {
this->wordCheck(token);
}
}
return;
}
if (!hasColon && !hasDot && !hasParen && !hasUnderscore
&& !fInStdOut && !inCode && !fInConst && !sawDigit
&& islower(str[0]) && isupper(str[1])) {
inCode = true;
}
bool methodParam = false;
if (fMethod) {
for (auto child : fMethod->fChildren) {
if (MarkType::kParam == child->fMarkType && str == child->fName) {
methodParam = true;
break;
}
}
}
auto& mappy = hasColon ? fColons :
hasDot ? fDots :
hasParen ? fParens :
hasUnderscore ? fUnderscores :
fInStdOut || fInFormula || inCode || fInConst || methodParam ? fCode :
sawDigit ? fDigits : fWords;
auto iter = mappy.find(str);
if (mappy.end() != iter) {
iter->second.fCount += 1;
} else {
CheckEntry* entry = &mappy[str];
entry->fFile = fFileName;
entry->fLine = fLineCount;
entry->fCount = 1;
}
}
void SpellCheck::wordCheck(ptrdiff_t len, const char* ch) {
leafCheck(ch, ch + len);
}
| [
"xzwang2005@gmail.com"
] | xzwang2005@gmail.com |
4385b8697acadefb58793df076adb58fd5cacba1 | 52f579cb029589b71f2e787e297c6e4e6f11ec43 | /src/qt/addressbookpage.h | 47c88cece74672ad5bd67ee8f2c71a6416dfb0bc | [
"MIT"
] | permissive | RossClelland/uscbuild | fa093e53bdf3ca68d1db4d73e3e9276ff10a46a9 | db77df86e94ba4362040d5bedf1c71e5b4f01654 | refs/heads/master | 2021-01-24T13:19:00.570675 | 2018-02-27T18:14:59 | 2018-02-27T18:14:59 | 123,169,482 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,463 | h | // Copyright (c) 2011-2015 The Uscoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef USCOIN_QT_ADDRESSBOOKPAGE_H
#define USCOIN_QT_ADDRESSBOOKPAGE_H
#include <QDialog>
class AddressTableModel;
class PlatformStyle;
namespace Ui {
class AddressBookPage;
}
QT_BEGIN_NAMESPACE
class QItemSelection;
class QMenu;
class QModelIndex;
class QSortFilterProxyModel;
QT_END_NAMESPACE
/** Widget that shows a list of sending or receiving addresses.
*/
class AddressBookPage : public QDialog
{
Q_OBJECT
public:
enum Tabs {
SendingTab = 0,
ReceivingTab = 1
};
enum Mode {
ForSelection, /**< Open address book to pick address */
ForEditing /**< Open address book for editing */
};
explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
~AddressBookPage();
void setModel(AddressTableModel *model);
const QString &getReturnValue() const { return returnValue; }
public Q_SLOTS:
void done(int retval);
private:
Ui::AddressBookPage *ui;
AddressTableModel *model;
Mode mode;
Tabs tab;
QString returnValue;
QSortFilterProxyModel *proxyModel;
QMenu *contextMenu;
QAction *deleteAction; // to be able to explicitly disable it
QString newAddressToSelect;
private Q_SLOTS:
/** Delete currently selected address entry */
void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */
void on_newAddress_clicked();
/** Copy address of currently selected address entry to clipboard */
void on_copyAddress_clicked();
/** Copy label of currently selected address entry to clipboard (no button) */
void onCopyLabelAction();
/** Edit currently selected address entry (no button) */
void onEditAction();
/** Export button clicked */
void on_exportButton_clicked();
/** Set button states based on selected tab and selection */
void selectionChanged();
/** Spawn contextual menu (right mouse menu) for address book entry */
void contextualMenu(const QPoint &point);
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
Q_SIGNALS:
void sendCoins(QString addr);
};
#endif // USCOIN_QT_ADDRESSBOOKPAGE_H
| [
"34719071+RossClelland@users.noreply.github.com"
] | 34719071+RossClelland@users.noreply.github.com |
128ba74fc2b2a936d7cfca695832f1e63ef8c55d | a7ff72d839e1717bdf111af03c3340f50d75d4bb | /modules/geom/include/fvision/geom/Camera1D.h | 79b0c4bff4945f0a31ba82b8af9d2aa17bdc5e2b | [] | no_license | ly774508966/fvision2010 | 0dec33e38e297a93ae5555a69ddb9090ef5efc91 | 4bac98f5717fc2080fa23b567f0353dda25ecba2 | refs/heads/master | 2021-05-29T09:55:51.762640 | 2012-06-01T15:10:32 | 2012-06-01T15:10:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,693 | h | #pragma once
#include <cv.h>
#include <iostream>
#include <vector>
namespace fvision {
/** Internal paramters of 1D camera
*
* 1. focal length
* 2. principal point; assume lies in the center of the image
*
* K = [f, px;
* 0, 1]
*
* ix = x * f / y + px
*
*/
class Camera1DInternal {
public:
Camera1DInternal() {}
Camera1DInternal(double focalLength, double imageWidth);
//default destructor
//default copy constructor and copy assignement
static Camera1DInternal createWithFocalLengthAndImageWidth(double focalLength, double imageWidth);
static Camera1DInternal createWithFocalLengthAndPrincipalPoint(double focalLength, double principalPoint);
public:
double calculateImagePoint(const CvPoint2D32f& p) const {
return p.x * focalLength / p.y + px;
}
double operator() (const CvPoint2D32f& p) const {
return calculateImagePoint(p);
}
/**
* if the image point is outside the image boundary, return false
*/
bool isPoint1DInImage(double x) const {
if (x >= 0 && x < imageWidth) return true;
else return false;
}
public: //GETTERS
double getFov() const { return fov; }
double getFocalLength() const { return focalLength; }
double getImageWidth() const { return imageWidth; }
double getPrincipalPoint() const { return px; }
private:
double focalLength;
double imageWidth;
double px; //principal point
double fov; //field of view
};
/** The pose of the 1D camera
*
* 1. center
* 2. orientation
*
* R = [cos(theta), -sin(theta);
* sin(theta, cos(theta)]
*
* clockwise rotation of camera
* counter clockwise rotation of points
*
* if theta = 0, the princpal axis is the y axis
*
* p' = R * (p - c)
*
*/
class Camera1DExternal {
public:
Camera1DExternal();
Camera1DExternal(const CvPoint2D32f& c, double theta) {
this->c = c;
this->theta = theta;
}
public:
CvPoint2D32f transformPoint(const CvPoint2D32f& p) const ;
CvPoint2D32f operator() (const CvPoint2D32f& p) const {
return transformPoint(p);
}
double project(const CvPoint2D32f& p) const {
CvPoint2D32f tp = transformPoint(p);
return tp.x / tp.y;
}
double getAngle() const { return theta; }
CvPoint2D32f getPosition() const { return c; }
void setAngle(double angle) { this->theta = angle; }
void setPosition(const CvPoint2D32f& position) { this->c = position; }
private:
CvPoint2D32f c; //center
double theta; //orientation
};
/**
* 1D Camera
*
* center: x, y
* orientation: theta
*
*/
class Camera1D {
public:
//default
//
Camera1D();
public:
Camera1D(double focalLength, double imageWidth, const CvPoint2D32f& c, double theta);
Camera1D(const Camera1DInternal& camInternal, const Camera1DExternal& camExternal);
static Camera1D create(double focalLength, double principalPoint, const CvPoint2D32f& camPosition, double camAngle);
public:
~Camera1D(void);
//default destructor
//default copy constructor and copy assignement
public:
double project(const CvPoint2D32f& p) const {
return calculateImagePoint(p);
}
std::vector<double> project(const std::vector<CvPoint2D32f>& ps) const ;
double calculateImagePoint(const CvPoint2D32f& p) const {
return cameraInternal.calculateImagePoint(cameraExternal.transformPoint(p));
}
double operator() (const CvPoint2D32f& p) const {
return calculateImagePoint(p);
}
bool isPoint1DInImage(double x) const {
return cameraInternal.isPoint1DInImage(x);
}
std::vector<double> calculateImagePoints(const std::vector<CvPoint2D32f>& pts) const ;
/**
* only return the image points that are inside the image, i.e., in [0, imageWidth)
*/
std::vector<double> calculateImagePointsWithinImage(const std::vector<CvPoint2D32f>& pts, std::vector<int>& is) const ;
public:
Camera1DInternal getInternal() const { return cameraInternal; }
Camera1DExternal getExternal() const { return cameraExternal; }
double getFocalLength() const { return cameraInternal.getFocalLength(); }
double getPrincipalPoint() const { return cameraInternal.getPrincipalPoint(); }
friend std::ostream& operator<<(std::ostream& os, const Camera1D& camera);
private:
Camera1DExternal cameraExternal;
Camera1DInternal cameraInternal;
};
std::ostream& operator<<(std::ostream& os, const Camera1DInternal& cameraInternal);
std::ostream& operator<<(std::ostream& os, const Camera1DExternal& cameraExternal);
std::ostream& operator<<(std::ostream& os, const Camera1D& camera);
std::istream& operator>>(std::istream& is, Camera1DExternal& cameraExternal);
} | [
"ferryzhou@gmail.com"
] | ferryzhou@gmail.com |
83734789b1d926f5ba9c24a9bb92a8932efae5cc | 5b64d6e83d83f97a0a5e6c2d7d2fe77df59a4014 | /hw2-1_gray_level_resolution/src/hw2_1_gray_level_resolution.cpp | ea6754b7b94a9b774a910e9fbb056ca12acf5513 | [] | no_license | justin-changqi/2018_fall_computer_vision | 8f6909cd85ea61b21338a4a196c34a66606ac8ad | 834af00da081d0ea5ad7a79c07285e0d60990e13 | refs/heads/master | 2020-03-29T15:40:40.597789 | 2018-12-03T21:40:11 | 2018-12-03T21:40:11 | 150,075,002 | 2 | 1 | null | 2018-11-04T16:47:38 | 2018-09-24T08:39:46 | C++ | UTF-8 | C++ | false | false | 4,291 | cpp | #include "hw2_1_gray_level_resolution.hpp"
void loadRawFile(cv::Mat &dst_img, std::string file_path, int width, int height)
{
std::FILE* f = std::fopen(file_path.c_str(), "rb");
// std::vector<char> buf(width*height); // char is trivally copyable
unsigned char buf[width][height];
std::fread(&buf[0], sizeof buf[0], width*height, f);
for (int i = 0; i < dst_img.rows; i++)
{
for (int j = 0; j < dst_img.cols; j++)
{
dst_img.at<char>(i, j) = buf[i][j];
}
}
std::fclose(f);
}
cv::Mat getQuantizeImage(cv::Mat &src, int num_bit)
{
cv::Mat img_out(src.rows, src.cols, CV_8UC1);
char mask = 0xff << (8-num_bit);
for (int i = 0; i < src.rows; i++)
{
for (int j = 0; j < src.cols; j++)
{
img_out.at<char>(i, j) = src.at<char>(i, j) & mask;
}
}
return img_out;
}
void showImage(std::string win_name, cv::Mat &show_img)
{
static int win_move_x = 50;
static int win_move_y = 50;
cv::namedWindow(win_name, 0);
cv::resizeWindow(win_name, show_img.cols, show_img.rows);
cv::moveWindow(win_name, win_move_x, win_move_y);
cv::imshow(win_name, show_img); //display Image
win_move_x += show_img.cols;
if (win_move_x > 1920-256)
{
win_move_x = 50;
win_move_y += (show_img.rows+35);
}
}
void showAllImages(std::vector<cv::Mat> &list, std::string prefix)
{
for (int i = 0; i < list.size(); i++)
{
showImage(prefix + " " + std::to_string(i + 1) + " bits", list[i]);
}
}
double getMSE(cv::Mat &src, cv::Mat &target)
{
double mse = 0;
for (int i = 0; i < src.rows; i++)
{
for (int j = 0; j < src.cols; j++)
{
unsigned char src_value = src.at<char>(i, j);
unsigned char target_value = target.at<char>(i, j);
mse += pow(src_value - target_value, 2);
}
}
return mse/(src.rows * src.cols);
}
double getPSNR(double mse, int num_bits)
{
char max_i = 0xff >> (8 - num_bits);
return 10 * log10(pow(max_i, 2) / mse);
}
void saveAllImage(std::vector<cv::Mat> &list,
std::string save_folder,
std::string prefix)
{
for (int i = 0; i < list.size(); i++)
{
std::string save_file = save_folder + prefix + " " +
std::to_string(i + 1) + " bits.png";
cv::imwrite(save_file, list[i]);
}
}
int main(int argc, char **argv)
{
cv::Mat lena_src(256, 256, CV_8UC1);
cv::Mat baboon_src(256, 256, CV_8UC1);
loadRawFile(lena_src, "../images/lena_256.raw", 256, 256);
loadRawFile(baboon_src, "../images/baboon_256.raw", 256, 256);
std::vector<cv::Mat> lena_result_list;
std::vector<cv::Mat> baboon_result_list;
// get quantize data from 1 bit to 8 bits
for (int i = 1; i <= 8; i++)
{
lena_result_list.push_back(getQuantizeImage(lena_src, i));
baboon_result_list.push_back(getQuantizeImage(baboon_src, i));
}
// calculate MSE and PSNR
std::vector<double> lena_mse_list;
std::vector<double> lena_psnr_list;
std::vector<double> baboon_mse_list;
std::vector<double> baboon_psnr_list;
for (int i = 0; i < 8; i++)
{
double lena_mse = getMSE(lena_src, lena_result_list[i]);
double baboon_mse = getMSE(baboon_src, baboon_result_list[i]);
lena_mse_list.push_back(lena_mse);
baboon_mse_list.push_back(baboon_mse);
lena_psnr_list.push_back(getPSNR(lena_mse, i+1));
baboon_psnr_list.push_back(getPSNR(baboon_mse, i+1));
}
std::cout << "Lena MSE:" << std::endl;
for (int i = 0; i < 8; i++)
{
std::cout << " lena " << i+1 << " bits: " << lena_mse_list[i] << std::endl;
}
std::cout << "Lena PSNR:" << std::endl;
for (int i = 0; i < 8; i++)
{
std::cout << " lena " << i+1 << " bits: " << lena_psnr_list[i] << " db" << std::endl;
}
std::cout << "Baboon MSE:" << std::endl;
for (int i = 0; i < 8; i++)
{
std::cout << " baboon " << i+1 << " bits: " << baboon_mse_list[i] << std::endl;
}
std::cout << "Baboon PSNR:" << std::endl;
for (int i = 0; i < 8; i++)
{
std::cout << " lena " << i+1 << " bits: " << baboon_psnr_list[i] << " db" << std::endl;
}
saveAllImage(lena_result_list, "../result_img_2_1/", "lena");
saveAllImage(baboon_result_list, "../result_img_2_1/", "baboon");
showAllImages(lena_result_list, "lena");
showAllImages(baboon_result_list, "baboon");
cv::waitKey(0);
return 0;
} | [
"justin840727@gmail.com"
] | justin840727@gmail.com |
6c1214b38a86e9ec295ea1aeaff070fe6f0e08dd | eaf3b70870841c0db8189343c7bd1c18cac89a30 | /rx_fltk_glcanvas.h | 8d07eb339da018d9e82fac1e0d185a7d3f3aaed0 | [] | no_license | makasone/fltk_sph_ice | 169090b838ae35f4dce25832fad3d11f492a0bcf | dc9e6320773c03b0be79e6ca6784b971e79dd444 | refs/heads/master | 2021-01-22T00:59:01.955005 | 2015-09-17T06:34:44 | 2015-09-17T06:34:44 | 27,175,619 | 5 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 20,729 | h | /*!
@file rx_fltk_glcanvas.h
@brief FLTKによるOpenGLウィンドウクラス
@author Makoto Fujisawa
@date 2011-09
*/
#ifndef _RX_FLTK_GLCANVAS_H_
#define _RX_FLTK_GLCANVAS_H_
//-----------------------------------------------------------------------------
// インクルードライブラリ
//-----------------------------------------------------------------------------
#pragma comment(lib, "libtet.lib")
//-----------------------------------------------------------------------------
// インクルードファイル
//-----------------------------------------------------------------------------
#include <iostream>
// STL
#include <vector>
#include <string>
// FLTK
#include <FL/Fl.H>
#include <FL/Fl_Gl_Window.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Spinner.H>
#include <FL/Fl_Value_Slider.H>
#include <FL/Fl_Round_Button.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Text_Editor.H>
#include "rx_sph_commons.h"
#include "rx_sph_config.h"
#include "rx_fltk_widgets.h"
#include "rx_trackball.h"
#include "rx_model.h"
#include "rx_pov.h"
#include "rx_texture.h"
//追加::
#include "HeatTransfar.h"
#include "Ice_SM.h"
#include "IceStructure.h"
#include "IceObject.h"
#include "tetgen.h"
#include <UtilityScript\mk_Vector2D.h>
#include "QueryCounter.h"
#include "mk_ArrayScript.h"
#include <time.h>
#include <omp.h>
#include <fstream>
#include <algorithm>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include "test.h"
using namespace std;
//-----------------------------------------------------------------------------
// 定義/定数
//-----------------------------------------------------------------------------
class rxFlWindow;
class rxParticleSystemBase;
struct rxCell;
class rxMCMeshCPU;
class rxMCMeshGPU;
class rxSSMeshCPU;
class rxSSMeshGPU;
// ここの定義でSPH法のGPU,CPUなどを切り替える
#define RX_USE_GPU
//#define RX_USE_DD
//#define RX_USE_PBD
#if defined(RX_USE_GPU)
#if defined(RX_USE_PBD)
#define RXSPH rxPBDSPH_GPU
#else
#define RXSPH rxSPH_GPU
#endif
#else
#if defined(RX_USE_PBD)
#define RXSPH rxPBDSPH
#elif defined(RX_USE_DD)
#define RXSPH rxDDSPH
#else
#define RXSPH rxSPH
#endif
#endif
//クラスタを作成する際の粒子数,四面体数を指定
//もう使ってない
//#define ICENUM 27
//#define ICENUM 125
//#define ICENUM 729
//#define ICENUM 1331 //11_11_11 or バニーモデル
//#define TETRANUM 10900 //バニーモデルの場合の四面体数
//#define ICENUM 2197 //13_13_13 or バニーモデル
//#define SIDE 13
//#define ICENUM 3463 //バニーモデル
//#define ICENUM 4913 //17_17_17
//#define TETRANUM 26000
//#define ICENUM 6859 //19_19_19
//#define ICENUM 9261 //21_21_21
//#define ICENUM 12167
//#define ICENUM 15625 //25_25_25
//#define ICENUM 19683 //27_27_27
//#define TETRANUM 110000
//#define ICENUM 24389 //29_29_29
//(1000, 1000, 1000);
//(3000, 3000, 12000);
//(5000, 5000, 26000); //粒子数4913個の場合のパラメータ
//(7000, 7000, 37000);
//(13000, 13000, 50000);
//(10000, 10000, 1);
//(16000, 16000, 1);
//(16000, 16000, 90000);
//(20000, 20000, 110000);
//(24400, 24400, 137000); //動かなかった.
//表面のみの場合
//#define ICENUM 6 //1_1_1
//#define ICENUM 27
//#define ICENUM 54 //3_3_3
//#define ICENUM 1014
//#define ICENUM 2646 //21_21_21
//#define ICENUM 5046 //29_29_29
#define HIGHNUM 8
// 描画フラグ
enum
{
RXD_PARTICLE = 0x0001, //!< パーティクル
RXD_VELOCITY = 0x0002, //!< 速度場
RXD_NORMAL = 0x0004, //!< 法線
RXD_BBOX = 0x0008, //!< AABB(シミュレーション空間)
RXD_CELLS = 0x0010, //!< 近傍探索用分割セル
RXD_MESH = 0x0020, //!< メッシュ
RXD_SOLID = 0x0040, //!< 固体
RXD_REFRAC = 0x0080, //!< 屈折描画
RXD_TURB_VELOC = 0x0100, //!< 乱流速度場
RXD_FOAM = 0x0200, //!< 泡
RXD_PARAMS = 0x0400, //!< パラメータ画面描画
RXD_ANISOTROPICS = 0x0800, //!< 異方性カーネル
RXD_UPDATED_PRTS = 0x1000, //!<
RXD_AXIS = 0x2000, //!< 軸
RXD_BPARTICLE = 0x4000, //!< 境界パーティクル
RXD_DEBUG_VECTOR = 0x8000, //!< デバッグ用のベクトル場
};
const string RX_DRAW_STR[] = {
"Particle", "p",
"Velocity", "v",
"Normal", "n",
"AABB (Simulation Space)", "b",
"Cells", "d",
"Mesh", "m",
"Solid", "o",
"Refrac", "r",
"Turbulence Velocity", "t",
"Foam", "F",
"Params", "P",
"Anisotoropics", "A",
"Updated Particles", "u",
"Axis", "",
"Boundary Particle", "B",
"Debug Vectors", "",
"-1"
};
// パーティクル描画方法
enum
{
RXP_POINTSPRITE = 0,
RXP_POINT,
RXP_POINT_UPSAMPLE,
RXP_POINT_NONE,
IDP_END,
};
const string RX_PARTICLE_DRAW[] = {
"Point Sprite", "^1",
"GL_POINT", "^2",
"Upsampling", "^3",
"None", "^4",
"-1"
};
// 三角形メッシュ生成法
enum
{
RXM_MC_CPU = 0,
RXM_MC_GPU,
RXM_SSM_CPU,
RXM_SSM_GPU,
};
const string RX_TRIANGULATION_METHOD[] = {
"Marching Cubes (CPU)", "",
"Marching Cubes (GPU)", "",
"Screen Space Mesh (CPU)", "",
"Screen Space Mesh (GPU)", "",
"-1"
};
// 固体描画
enum
{
RXS_VERTEX = 0x0001,
RXS_EDGE = 0x0002,
RXS_FACE = 0x0004,
RXS_NORMAL = 0x0008,
RXS_MOVE = 0x0010,
RXS_END
};
const string RXS_STR[] = {
"Vertex", "",
"Edge", "",
"Face", "",
"Normal", "",
"Move", "",
"-1"
};
//! 描画領域サイズ候補
const string RX_CANVAS_SIZE_STR[] = {
"1920x1080", "",
"1280x720", "",
"1024x768", "",
"800x800", "",
"800x600", "",
"640x480", "",
"-1",
};
//! SPH設定
enum SettingMode
{
ID_SPH_MESH = 0, // メッシュ生成
ID_SPH_INPUT, // パーティクルデータ出力
ID_SPH_OUTPUT, // パーティクルデータ入力
ID_SPH_MESH_OUTPUT, // メッシュ出力
ID_SPH_INLET, // 流入境界
ID_SPH_VC,
ID_SPH_PS_TURB,
ID_SPH_SPS_TURB,
ID_HEAT, //追加 熱処理
ID_SM, //追加 SM法
ID_ICE, //追加 氷構造
ID_SPH_ANISOTROPIC, // 異方性カーネル
ID_SPH_END,
};
//-----------------------------------------------------------------------------
//! rxFlGLWindowクラス - fltkによるOpenGLウィンドウ
//-----------------------------------------------------------------------------
class rxFlGLWindow : public Fl_Gl_Window
{
protected:
int m_iWinW; //!< 描画ウィンドウの幅
int m_iWinH; //!< 描画ウィンドウの高さ
int m_iMouseButton; //!< マウスボタンの状態
int m_iKeyMod; //!< 修飾キーの状態
rxTrackball m_tbView; //!< トラックボール
double m_fBGColor[3]; //!< 背景色
bool m_bAnimation; //!< アニメーションON/OFF
bool m_bFullscreen; //!< フルスクリーンON/OFF
rxFlWindow *m_pParent; //!< 親クラス
vector<rxPolygons> m_vPolys; //!< ポリゴンオブジェクト
// FTGL
unsigned long m_ulFontSize; //!< フォントサイズ
//
// 粒子法関連変数
//
rxParticleSystemBase *m_pPS; //!< SPH
double m_fDt; //!< タイムステップ幅
double m_fGravity; //!< 重力加速度
int m_iCurrentStep; //!< 現在のステップ数
bool m_bPause; //!< シミュレーションのポーズフラグ
//追加
vector<string> m_stSimuFiles; //シミュレーションパラメータを保存したファイル群
int m_uSimulationNum; //シミュレーション回数
public:
//
// 追加 熱処理関連変数
//
vector<float> m_fIntrps; //SPH法とSM法の線形補間のパラメータ配列 各パーティクルごとに適用してやる
Vec2 m_ht_vStartPoint; //矩形内の粒子温度を上げるための始点
Vec2 m_ht_vEndPoint; //終点
bool m_ht_bRectFlag; //矩形内温度変化機能を利用するかのフラグ
vector<int> m_ht_vSelectedVertices;
float m_fMakeParticleTemp;
//
//追加 相変化オブジェクト
//
IceObject* m_iceObj;
//
// 追加 SM法関連変数
//
vector<Ice_SM*> m_sm_connects; //関係情報クラスタ
vector<Ice_SM*> m_sm_calcs; //計算処理クラスタ
int m_iIcePrtNum; //初期の固体粒子数
int m_iIceTtrNum; //初期の固体粒子の四面体数
int m_iClusteresNum; //クラスタの数 使用中のクラスタで最大の値
int m_iTetraNum; //未使用 四面体の数
int m_iTetraNumNum; //デバッグ用
int m_iMaxClusterNum; //最大クラスタ数,最大粒子数
int m_iIceItr; //固体運動計算の反復回数
//
// 追加 氷構造関連変数
//
IceStructure *m_ice;
int meltPIndx;
int debugIndx;
float *m_fIceFlag; //氷のフラグ デバイスメモリ
bool *testFlag; //実行速度を確かめるための実験
vector<vector<int>> m_vviTetraList; //四面体の組み合わせリスト
int m_iLayer; //計算処理クラスタ作成のために取得する近傍クラスタの,レイヤー数
int m_iShowClusterIndx; //GUIで表示するクラスタ番号 0〜クラスタ数 値はctr+shift+qで変化させる
int m_iShowHighClstrIndx;
int m_iShowTetraIndx; //GUIで表示する四面体番号 0〜四面体数 値はctr+shift+aで変化させる
//objファイル
rxPolygons m_poly;
//
//追加 処理切り替え
//
int m_bMode; //現在の処理モード
enum
{
MODE_SPH = 0,
MODE_HEAT,
MODE_SM,
MODE_ICE,
MODE_NUM,
};
//追加 レンダリングパラメータ
double m_etaRatio;
double m_fresnelBias;
double m_fresnelPower;
double m_fresnelScale;
//落下開始フラグ
bool m_bFall;
protected:
// シーン
//string m_strCurrentScene; //!< 現在のシーンの名前
//vector<string> m_vSceneFiles; //!< シーンファイルリスト
//int m_iSceneFileNum; //!< シーンファイルの数
rxSPHConfig m_Scene;
int m_iSimuSetting; //!< ミュレーション設定保存用
// パーティクル情報出力
string m_strSphOutputName0 ;
string m_strSphOutputHeader;
// パーティクル情報入力
string m_strSphInputName0 ;
string m_strSphInputHeader;
// 固体移動フラグ
bool m_bSolidMove;
// 固体の動き
Vec3 m_vMovePos[2];
double m_fMoveMaxVel;
bool m_bMoveSolid;
int m_iMoveStart;
//
// メッシュ
//
uint m_iNumVrts, m_iNumTris; //!< 生成されたメッシュの頂点数とメッシュ数
int m_iVertexStore; //!< サンプリングボリューム数に対する予想される頂点数(nx*ny*store)
int m_iMeshMaxN; //!< メッシュ化グリッド数(境界がもっとも長い軸方向の分割数)
int m_iMeshN[3]; //!< メッシュ化グリッド数
Vec3 m_vMeshBoundaryExt; //!< メッシュ境界ボックスの各辺の長さの1/2
Vec3 m_vMeshBoundaryCen; //!< メッシュ境界ボックスの中心座標
rxPolygons m_Poly; //!< メッシュ
//vector<rxPolygons*> m_vSolidPoly;//!< 固体メッシュ
rxMaterialOBJ m_matPoly;
GLuint m_uVrtVBO; //!< メッシュ頂点(VBO)
GLuint m_uTriVBO; //!< メッシュポリゴン(VBO)
GLuint m_uNrmVBO; //!< メッシュ頂点法線(VBO)
//追加:固体用
uint m_iNumVrts_solid, m_iNumTris_solid; //!< 生成されたメッシュの頂点数とメッシュ数
GLuint m_uVrtVBO_solid; //!< メッシュ頂点(VBO)
GLuint m_uTriVBO_solid; //!< メッシュポリゴン(VBO)
GLuint m_uNrmVBO_solid; //!< メッシュ頂点法線(VBO)
int m_iDimVBO;
// メッシュ出力
int m_iSaveMeshSpacing;
// 背景画像
bool m_bUseCubeMap; //!< キューブマップ使用フラグ
rxCubeMapData m_CubeMap; //!< キューブマップ
// メッシュ生成
rxMCMeshCPU *m_pMCMeshCPU;
rxMCMeshGPU *m_pMCMeshGPU;
rxSSMeshCPU *m_pSSMCPU; //!< Screen Space Mesh
rxSSMeshGPU *m_pSSMGPU; //!< Screen Space Mesh by CUDA
int m_iDepthFiltering; //!< 平滑化(デプスマップ0x01, 輪郭0x02)
int m_iSSDebugOutput;
double m_fSpacing; //!< デプスマップのサンプリング間隔
double m_fPrtRad; //!< パーティクルの半径
double m_fZmax; //!< 輪郭となるデプス差の閾値
int m_iNfilter; //!< デプス値平滑化のフィルタサイズ
int m_iNiters; //!< 輪郭平滑化の反復回数
double m_fProjectionMatrix[16]; //!< 透視投影行列
double m_fModelviewMatrix[16]; //!< モデルビュー行列
int m_iPickedParticle; //!< マウスピックされたパーティクル
public:
// 描画フラグ
int m_iDraw; //!< 描画フラグ
int m_iDrawPS; //!< パーティクル描画方法
int m_iColorType; //!< パーティクル描画時の色
int m_iTriangulationMethod; //!< 三角形メッシュ生成法
int m_iSolidDraw; //!< 固体描画
// シミュレーション設定
bitset<32> m_bsSimuSetting; //!< ミュレーション設定フラグ
double m_fVScale; //!< ベクトル場描画時のスケール
double m_fMeshThr; //!< 陰関数メッシュ化時の閾値
// シーンリスト
vector<string> m_vSceneTitles; //!< シーンファイルリスト
int m_iCurrentSceneIdx; //!< 現在のシーンファイル
// 画像出力
int m_iSaveImageSpacing; //!< 画像保存間隔(=-1なら保存しない)
public:
//! コンストラクタ
rxFlGLWindow(int x, int y, int w, int h, const char* l, void *parent);
//! デストラクタ
~rxFlGLWindow();
public:
// OpenGL初期化
void InitGL(void);
// OpenGL描画
void Projection(void);
vector<string> SetDrawString(void);
void ReDisplay(void);
// GUIコールバック
void Display(void);
void Resize(int w, int h);
void Mouse(int button, int state, int x, int y);
void Motion(int x, int y);
void PassiveMotion(int x, int y);
void Idle(void);
void Timer(void);
void Keyboard(int key, int x, int y);
void SpecialKey(int key, int x, int y);
// マウスピック用
static void Projection_s(void* x);
static void DisplayForPick_s(void* x);
void DisplayForPick(void);
void PickParticle(int x, int y);
// 視点
void InitView(void);
// アニメーション
static void OnTimer_s(void* x);
static void OnIdle_s(void* x);
// アニメーション切り替え
bool SwitchIdle(int on);
// フルスクリーン切り替え
void SwitchFullScreen(int win = 1);
int IsFullScreen(void);
// ファイル入出力
void OpenFile(const string &fn);
void SaveFile(const string &fn);
void SaveDisplay(const string &fn);
void SaveDisplay(const int &stp);
void SaveMesh(const string fn, rxPolygons &polys);
void SaveMesh(const int &stp, rxPolygons &polys);
// FTGLフォント設定
int SetupFonts(const char* file);
//追加:シミュレーション
void ResetSimulation();
void UpdateShaderParamRatio(float etaRatio){ m_etaRatio = etaRatio; }
void UpdateShaderParamBias(float bias){ m_fresnelBias = bias; }
void UpdateShaderParamPower(float power){ m_fresnelPower = power; }
void UpdateShaderParamScale(float scale){ m_fresnelScale = scale; }
void ApplyNowData();
void SetObjMove(bool flag){ m_bSolidMove = flag; }
void StepParticleColor(void);
public:
// メッシュ生成
bool CalMeshSPH(int nmax, double thr = 300.0);
bool ResetMesh(void);
void SetMeshCreation(void);
RXREAL GetImplicitSPH(double x, double y, double z);
protected:
bool calMeshSPH_CPU(int nmax, double thr = 300.0);
bool calMeshSPH_GPU(int nmax, double thr = 300.0);
bool calMeshSPH_SSM(int nmax, double thr = 300.0);
bool calMeshSPH_SSM_GPU(int nmax, double thr = 300.0);
// SPH
void InitSPH(rxSPHConfig &sph_scene);
void InitSPH(void){ InitSPH(m_Scene); }
void AddSphere(void);
void StepPS(double dt);
void ComputeFPS(void);
void DivideString(const string &org, vector<string> &div);
void DrawParticleVector(RXREAL *prts, RXREAL *vels, int n, int d, double *c0, double *c1, double len = 0.1);
void DrawParticlePoints(unsigned int vbo, int n, unsigned int color_vbo = 0, RXREAL *data = 0);
void DrawSubParticles(void);
void CreateVBO(GLuint* vbo, unsigned int size);
void DeleteVBO(GLuint* vbo);
void DrawLiquidSurface(void);
//追加:氷用
void DrawSolidSurface(void);
//追加:高速化パス
void DrawFastPath(RXREAL *prts, RXREAL *vels, int n, int d, double *c0, double *c1, double len = 0.1);
void SetParticleColorType(int type, int change = 0);
void RenderSphScene(void);
//追加::氷
void InitIceObj(void);
void StepTimeEvent(void);
void CountTetraHedra(int tIndx, vector<int>& pList);
void MakeTetraInfo(int tIndx, int* PtoTNum);
void MakeTetraInfo(int tIndx, vector<int> pList);
//追加::粒子ベース::クラスタ
void MakeCluster(int pIndx);
void MakeClusterFromNeight();
void StepIceObj();
void StepIceStructure();
void StepHeatTransfer();
void StepClusterCPU(double dt);
void StepClusterGPU(double dt);
//追加::粒子ベース::固体情報(クラスタ情報)
void MakeClusterInfo(int cIndx);
void SearchReconstructCluster_Freeze(const vector<int>& pList, vector<int>& cList, vector<int>& lList);
void SearchReconstructTetra_Freeze(const vector<int>& pList, vector<int>& tList, vector<int>& lList);
void UpdateInfo_Delete_TandP(const vector<int>& tList, const vector<int>& deleteList);
void SetClusterInfo(const vector<int>& pList, const vector<int>& cList, const vector<int>& lList);
void SetTetraInfo(const vector<int>& pList, const vector<int>& cList, const vector<int>& lList);
void SetFreezeClusterInfo(const vector<int>& pList);
void CheckDeleteTetra(vector<int>& tList, vector<int>& lList);
void CheckSameTetra(int tIndx, const vector<int>& searchList, vector<int>& deleteList);
void CheckIncludeTetra(int tIndx, const vector<int>& searchList, vector<int>& deleteList);
void RemoveReconstructTetra(vector<int>& tList, vector<int>& lList, vector<int>& deleteTList);
//追加::四面体ベース::SM法
void InitSM(rxSPHConfig &sph_scene);
void InitSM_Layer(rxSPHConfig &sph_scene);
void StepSM(double dt);
void AddVertexToCluster(int pIndx, int cIndx);
//追加::四面体ベース::氷構造
void InitICE(rxSPHConfig &sph_scene);
void InitICE_Layer(rxSPHConfig &sph_scene);
void StepICE_Melt(void);
void StepICE_Freeze(void);
bool StepICE_Freeze_MakeCluster(vector<int>& pList);
bool StepICE_Freeze_AddParticle(vector<int>& pList);
bool StepICE_Freeze_PhaseChangeParticles(vector<int>& pList);
void StepICE_CalcParametor(double dt);
void StepICE_Interpolation(double dt);
void StepICE_ClusterConstruct(void);
void ReConstructCalcCluster(void);
void ReConstructCalcCluster_Melt(vector<int>& pIndxList);
void ReConstructCalcCluster_Freeze(vector<int>& pIndxList);
vector<int> GetNeighborDistanceIceParticles(int pIndx, int layer, int num);
vector<int> CheckSameCluster_Connect(int cIndx);
void CheckZeroCluster_Connect(int cIndx);
void DeleteIceInfoParticle(int pIndx);
void DeleteIceInfoCluster(int cIndx);
//追加::その他処理
void Collision(Vec3 &p, Vec3 &np, Vec3 &v, int obj); //衝突判定クラス
void ClearPick(void);
void ClearRect(void);
void UpdateInfo();
//追加::四面体作成のための処理
void MakeFreezeTetrahedra(vector<int>& pList, vector<int>& tList);
void MakeFreezeTetrahedra_OnlyFreezeParticle(const vector<int>& pList, vector<int>& tList);
void AddFreezeTetrahedra(const vector<int>& pList, vector<int>& tList);
void DumpParticleData();
private:
//! 描画コールバック関数のオーバーライド
void draw(void)
{
if(!context_valid()) InitGL();
if(!valid()) Resize(w(), h());
Display(); // OpenGL描画
}
//! リサイズコールバック関数のオーバーライド
void resize(int x_, int y_, int w_, int h_)
{
Fl_Gl_Window::resize(x_, y_, w_, h_);
//Resize(w_, h_);
}
public:
// イベントハンドラ
int handle(int e); // handle関数のオーバーライド
// メニューイベントハンドラ
static void OnMenuDraw_s(Fl_Widget *widget, void* x);
inline void OnMenuDraw(double val, string label);
static void OnMenuSimulation_s(Fl_Widget *widget, void* x);
inline void OnMenuSimulation(double val, string label);
static void OnMenuParticle_s(Fl_Widget *widget, void* x);
inline void OnMenuParticle(double val, string label);
inline void OnMenuParticleColor(double val, string label);
inline void OnMenuParticleDraw(double val, string label);
static void OnMenuSolid_s(Fl_Widget *widget, void* x);
inline void OnMenuSolid(double val, string label);
static void OnMenuTriangulation_s(Fl_Widget *widget, void* x);
inline void OnMenuTriangulation(double val, string label);
static void OnMenuScene_s(Fl_Widget *widget, void* x);
inline void OnMenuScene(double val, string label);
};
#endif // #ifdef _RX_FLTK_GLCANVAS_H_
| [
"makasone@gmail.com"
] | makasone@gmail.com |
a2c21e55c25f0659c9c1305d92e1a6267f5b51b6 | a26ea2f32d1e60cd984f82de4f681c3d3e475c16 | /item07/time_keeper.cc | c25dc278943f9585eb11e0a29c36d57e3a0b24d1 | [] | no_license | wondsn/C_plus_plus_Effective | cd79d221f3522e113805fc1b7b41ca247dd5718f | 616b442172638e0fb206a9a0af28c49e207cbb9d | refs/heads/master | 2022-05-12T22:42:22.540993 | 2018-09-13T13:41:44 | 2018-09-13T13:41:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 256 | cc | #include <iostream>
class TimeKeeper {
public:
TimeKeeper();
virtual ~TimeKeeper();
};
class AtomicClock : public TimeKeeper {
};
class WatchClock : public TimeKeeper {
};
class WristWatch : public TimeKeeper {
};
int main() {
return 0;
}
| [
"kimgs0725@gmail.com"
] | kimgs0725@gmail.com |
9bf4938915a947531e39dda7a3d8b5d7c34b334a | 0ca3d403b5794f55ef3999a4f9c5bb44fa4c602d | /src/xtd.tunit/include/xtd/tunit/abort_error.h | 0d6773b0415cf7e29bd212ac7fed7b13227386ae | [
"MIT"
] | permissive | ExternalRepositories/xtd | 3bf26ff9bced18263f4d1a9bd551addd9976e115 | 5889d69900ad22a00fcb640d7850a1d599cf593a | refs/heads/master | 2023-07-15T16:52:14.008306 | 2021-08-26T20:25:22 | 2021-08-26T20:25:22 | 375,167,847 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,399 | h | /// @file
/// @brief Contains xtd::tunit::abort_error exception.
/// @copyright Copyright (c) 2021 Gammasoft. All rights reserved.
#pragma once
#include <xtd/ustring.h>
#include <stdexcept>
/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
namespace xtd {
/// @brief The tunit namespace contains a unit test library.
namespace tunit {
/// @brief Exception thow when abort.
/// @par Library
/// xtd.tunit
/// @ingroup xtd_tunit exceptions
class abort_error : public std::exception {
public:
/// @brief Create a new instance of abort_error class.
/// @param message Message string associate to the error.
explicit abort_error(const xtd::ustring& message) : message_(message) {}
/// @brief Create a new instance of abort_error class.
/// @param message Message string associate to the error.
explicit abort_error(const char* message) : message_(message) {}
/// @cond
abort_error(const abort_error&) = default;
abort_error& operator=(const abort_error&) = default;
/// @endcond
/// @brief Returns a string that represents the current abort_error.
/// @return string A string that represents the current abort_error.
const char* what() const noexcept {return message_.c_str();}
private:
xtd::ustring message_;
};
}
}
| [
"gammasoft71@gmail.com"
] | gammasoft71@gmail.com |
9dcd803158853d2c841f55eb71e37bd5dcc13d28 | c87b625d005a845804b8398934be0465fa76065e | /sheet CF-B/Effective Approach.cpp | d3f682f8cd9387d6962152022d199ab83a579787 | [] | no_license | mohammed-elkomy/competitive | 5204fb725524f65a0eb65e6a1e6b828cdcdf9824 | 2bddf922a86bdf6140ecd161e3394896a007edd1 | refs/heads/master | 2020-01-19T21:13:05.619506 | 2017-06-13T12:59:55 | 2017-06-13T12:59:55 | 94,213,016 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 517 | cpp | #include <iostream>
#include <cstring>
//Effective Approach
using namespace std;
int main() {
//freopen("j.txt", "r", stdin);
int ocu[100005],n,m,i,temp;unsigned long long comF=0,comL=0;
memset(ocu,-1,sizeof ocu);
cin >>n;
for(i=0 ; i < n ; i++)
{
scanf("%d",&temp);
if(ocu[temp] == -1) ocu[temp] = i+1;
}
cin >>m;
for(i=0 ; i < m ; i++)
scanf("%d",&temp), comF +=ocu[temp],comL +=(n-ocu[temp]+1);
printf("%llu %llu\n",comF,comL);
return 0;
}
| [
"mohammedalaaelkomy@gmail.com"
] | mohammedalaaelkomy@gmail.com |
7a67cbfc40fad0a3102fccc2e08fce11b313660d | ba6ef4e867d6b611b0058fc8d33a72ca6074e02a | /file_format/ai_bmp.cpp | bf762bf53845566b1a0cc93a2777da0b2f8e79cb | [] | no_license | Proxmiff/XaraVG-lib | 3d3f8c9d8176678a887672ab251b593e3913988c | 8fd443b42c94c9fce26e4e4337dec4647756c530 | refs/heads/master | 2021-01-11T13:33:51.866796 | 2016-05-14T14:48:36 | 2016-05-14T14:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 18,831 | cpp |
// ai_bmp.cpp: implementation of the AIBitmapProcessor class.
#include "camtypes.h"
#include "ai_bmp.h"
#include "page.h"
#include "ai5_eps.h"
#include "progress.h"
#include "nodebmp.h"
DECLARE_SOURCE("$Revision");
#define new CAM_DEBUG_NEW
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
AIBitmapProcessor::AIBitmapProcessor() :
mpNewBitmap(0),
mLastIndex(0)
{
}
AIBitmapProcessor::~AIBitmapProcessor()
{
delete mpNewBitmap;
mpNewBitmap = 0;
}
/********************************************************************************************
> BOOL AIBitmapProcessor::BeginRaster()
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Purpose: Allows the bitmap process to intialize itself for a new bitmap
signalled by the %BeginRaster comment.
Returns: TRUE if the definition was processed,
FALSE if not used by this filter..
********************************************************************************************/
BOOL AIBitmapProcessor::BeginRaster()
{
ENSURE(mpNewBitmap == NULL, "mpNewBitmap is not NULL");
return TRUE;
}
/********************************************************************************************
> BOOL AIBitmapProcessor::DecodeXI( AI5EPSFilter& filter )
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Returns: TRUE if the definition was processed,
FALSE if not used by this filter..
Purpose: Decodes the EPS XI, bitmap definition in an Illustrator 5 file
The format of the operator is:
[ a b c d tx ty ] llx lly urx ury h w bits ImageType AlphaChannelCount reserved bin-ascii ImageMask XI
********************************************************************************************/
BOOL AIBitmapProcessor::DecodeXI( AI5EPSFilter& filter )
{
// Graeme (18/4/00) - This code isn't very pretty, but it's necessary because of the way
// in which the bitmap is stored. If I try a GetCoordPair () to get the bitmap positions,
// the image will be misrendered because the transformation should take place due to the
// tx and ty components of the matrix. Note also that the bitmap's position in Adobe
// Illustrator is taken from the top left corner, whilst we use the bottom left.
/////////////////
// Get the page origin.
/////////////////
// Graeme (18/4/00) - Declare variables to get the origin of the page within Camelot's
// co-ordinate space.
Document *pDocument = filter.GetDocument ();
Spread *pSpread = pDocument->FindFirstSpread ();
Page *pPage = pSpread->FindFirstPageInSpread ();
DocCoord Origin = pPage->GetPageRect ().lo;
/////////////////
// decode the bitmap parameters
/////////////////
Matrix ImageMatrix;
DocCoord Translation;
INT32 h, w, bits, ImageType, AlphaChannelCount, reserved, bin_ascii, ImageMask;
INT32 llx, lly, urx, ury;
INT32 nLength = 0;
INT32 nLineLength = 0;
INT32 nMaxLineOffset = 0;
INT32 nChannels = 0;
NodeBitmap* pNodeBitmap = NULL;
DocCoord p;
// Graeme (18/4/00) - I've replaced the Pop with PopCoordPair for extracting the
// bounding co-ordinates of the bitmap. This means that they will be scaled up
// into the Xara co-ordinate space. I've also reversed the popping of h and w
// from the stack - their order is incorrect in the AI documentation.
if ( !filter.GetStack().Pop(&ImageMask) ||
!filter.GetStack().Pop(&bin_ascii) ||
!filter.GetStack().Pop(&reserved) ||
!filter.GetStack().Pop(&AlphaChannelCount) ||
!filter.GetStack().Pop(&ImageType) ||
!filter.GetStack().Pop(&bits) ||
!filter.GetStack().Pop(&h) ||
!filter.GetStack().Pop(&w) ||
!filter.GetStack().PopCoord(&ury) ||
!filter.GetStack().PopCoord(&urx) ||
!filter.GetStack().PopCoord(&lly) ||
!filter.GetStack().PopCoord(&llx) ||
!filter.GetStack().Pop( &ImageMatrix, TRUE )
)
goto EPSError;
/////////////////
// create space for the tentative bitmap
/////////////////
///////////////////
// ImageType gives the number of channels per pixel
// bits is the bits per channel
// However we will convert CMYK bitmaps to RGB
///////////////////
switch ( ImageType )
{
case 1: // greyscale
nChannels = 1;
break;
case 3: // rgb
nChannels = 3;
break;
case 4: // CMYK
nChannels = 3;
break;
default: // unknown
goto EPSError;
}
mpNewBitmap = new KernelBitmap( w, h, bits * nChannels, 96 );
if ( !mpNewBitmap )
goto EPSError;
///////////////////
// We can import greyscale bitmaps as well
///////////////////
if ( ImageType == 1 )
mpNewBitmap->SetAsGreyscale();
/////////////////
// get the binary data
/////////////////
nLength = mpNewBitmap->GetActualBitmap()->GetBitmapSize();
nLineLength = mpNewBitmap->GetActualBitmap()->GetScanlineSize();
nMaxLineOffset = (( w * mpNewBitmap->GetActualBitmap()->GetBPP() ) / 8) - 1;
if ( !ReadImageData( filter, ImageType, mpNewBitmap->GetBitmapBits(), nLength, nLineLength, nMaxLineOffset ) )
goto EPSError;
/////////////////////
// insert the image into the document
/////////////////////
// Get a new NodeBitmap object to import into. Don't know what the 12,12 bit does
pNodeBitmap = new NodeBitmap;
if ( !pNodeBitmap || !pNodeBitmap->SetUpPath(12,12) )
goto EPSError;
pNodeBitmap->GetBitmapRef()->Attach( mpNewBitmap, filter.GetDocument() );
/////////////////
// set up the bounds of the shape containing the bitmap
/////////////////
// Graeme (18/4/00) - Adjust the values of lly and ury before they're transformed.
lly -= h * EPSScaleFactor;
ury -= h * EPSScaleFactor;
// Graeme (18/4/00) - Modify the matrix to place the bitmap in the correct place.
ImageMatrix.GetTranslation ( Translation ); // Extract the translation component.
Translation += Origin; // Add the page origin to it.
ImageMatrix.SetTranslation ( Translation ); // And reset the value in the matrix.
// Graeme (17/4/00) - Colin overlooked setting up the bounding parallelogram when he
// wrote this code, and I've just added this.
p.x = llx;
p.y = ury;
ImageMatrix.transform( &p );
pNodeBitmap->InkPath.InsertMoveTo( p );
pNodeBitmap->Parallel [0] = p;
p.x = urx;
p.y = ury;
ImageMatrix.transform( &p );
pNodeBitmap->InkPath.InsertLineTo( p );
pNodeBitmap->Parallel [1] = p;
p.x = urx;
p.y = lly;
ImageMatrix.transform( &p );
pNodeBitmap->InkPath.InsertLineTo( p );
pNodeBitmap->Parallel [2] = p;
p.x = llx;
p.y = lly;
ImageMatrix.transform( &p );
pNodeBitmap->InkPath.InsertLineTo( p );
pNodeBitmap->Parallel [3] = p;
p.x = llx;
p.y = ury;
ImageMatrix.transform( &p );
pNodeBitmap->InkPath.InsertLineTo( p );
pNodeBitmap->InkPath.CloseSubPath();
// Graeme (18/4/00) - It is necessary to set the default attributes up for a
// new node bitmap before inserting it into the tree. Otherwise it's rendered
// as a greyscale image, even if it is colour, because there's a start colour
// value set.
pNodeBitmap->ApplyDefaultBitmapAttrs ( NULL );
filter.AddNewNode( pNodeBitmap );
return TRUE;
EPSError:
if ( mpNewBitmap )
{
delete mpNewBitmap;
mpNewBitmap = 0;
}
return FALSE;
}
/********************************************************************************************
> BOOL AIBitmapProcessor::EndRaster()
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Purpose: Allows the bitmap processor to complete the bitmap
signalled by the %EndRaster comment.
Returns: TRUE if the definition was processed,
FALSE if not used by this filter..
********************************************************************************************/
BOOL AIBitmapProcessor::EndRaster()
{
ENSURE(mpNewBitmap != NULL, "mpNewBitmap is NULL");
/////////////////
// add bitmap to tentative bitmap list, giving an index number
/////////////////
mBitmaps.AddBitmap( mpNewBitmap, mLastIndex );
// up the index number
++mLastIndex;
// We're done with this bitmap.
mpNewBitmap = NULL;
return TRUE;
}
////////////////////////// IMPLEMENTATION /////////////////////////////////////////////////////
/********************************************************************************************
> BOOL AIBitmapProcessor::ReadImageData( AI5EPSFilter* const pFilter, const INT32 ImageType, ADDR pData, INT32 nLength ) const
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Returns: TRUE if the image was read correctly
FALSE if the data length differed from the expected given in nLength
in,out: pData: A pointer to an allocated block of memory to hold the decoded
hexadecimal data.
in: nLength: The expected number of bytes decoded from the stream
ImageType: The AI ImageType given in the XI definition
Purpose: Decodes the hex string style data following an image (XI) operator
placing it in the given buffer. This allows the bitmap data to be read into
a bitmap.
Each line begins %XXXX where XXXX are hex numbers.
Assumes that the first % token has not yet been read.
********************************************************************************************/
BOOL AIBitmapProcessor::ReadImageData( AI5EPSFilter& filter, const INT32 ImageType, ADDR pDataStart, INT32 nLength, INT32 nLineLength, INT32 nMaxLineOffset )
{
////////////////
// ignore the whitespace (EOL)
////////////////
filter.GetEPSFile()->GetToken();
////////////////
// read the first % line
////////////////
filter.GetEPSFile()->GetToken();
/////////////////
// We need some running values
/////////////////
BYTE ColourVal[4] = {0,0,0,0};
UINT32 nShift = 0; // which colour component is being read
////////////////
// start with last line
////////////////
ADDR pCurrentLine = pDataStart + nLength - nLineLength;
INT32 nLineOffset = 0;
while ( pCurrentLine >= pDataStart && !filter.GetEPSFile()->eof() )
{
// the data ends with a comment
if ( camStrncmp( filter.GetTokenBuf(), _T("%%EndData"), 9 ) == 0 )
break;
////////////////
// update progress
////////////////
const INT32 nCharsRead = filter.GetEPSFile()->GetCharsRead();
if ( nCharsRead > (filter.GetLastProgressUpdate() + 2048) )
{
if ( !ContinueSlowJob( nCharsRead ) )
{
// Abort operation - make sure nodes are deleted and not added to the tree.
ERROR(_R(IDT_IMPORT_USERABORT), FALSE);
}
else
{
filter.GetLastProgressUpdate() = nCharsRead;
}
}
////////////////
// Decode the token into hex data (starting after the %)
////////////////
INT32 nBytes = 0;
switch ( ImageType )
{
case 1: // greyscale
nBytes = filter.DecodeHexString( pCurrentLine, nLength, 1 );
break;
case 3: // rgb
nBytes = DecodeHexStringAsRGB( filter, pCurrentLine, nLineOffset, nLineLength, nMaxLineOffset, 1, ColourVal, nShift );
break;
case 4: // CMYK
nBytes = DecodeHexStringAsCMYK( filter, pCurrentLine, nLineOffset, nLineLength, nMaxLineOffset, 1, ColourVal, nShift );
break;
}
if ( nBytes == -1 )
{
// Error
TRACE( _T("Error in AI5 image data\n") );
break;
}
///////////////
// get the next token
///////////////
filter.GetEPSFile()->GetToken();
}
return ( pDataStart - pCurrentLine == nLineLength ) ? TRUE : FALSE;
}
/********************************************************************************************
> bool inline CharToHex( const char& cDigit, BYTE& lNum )
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Purpose: Converts a hex character to a numeric byte.
Inputs: cDigit - the hex character (0-9,A-F)
Outputs: nNum the original value with the hex character ORred into it
Returns: true if the character were valid
false otherwise
********************************************************************************************/
bool inline CharToHex( const char& cDigit, BYTE& nNum )
{
char ch = camToupper(cDigit);
if ( (ch >= '0') && (ch <= '9') )
{
nNum |= (BYTE) (ch - '0');
}
else if ((ch >= 'A') && (ch <= 'F'))
{
nNum |= (BYTE) (ch - 'A') + 10;
}
else
{
// Error in hex data
return false;
}
return true;
}
/********************************************************************************************
> BYTE ColourValueToByte(const double& Value)
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Inputs: Value - The colour value, as a double.
Returns: BYTE - The colour value, as a byte.
Purpose: Converts a colour value from a double to a BYTE.
********************************************************************************************/
BYTE ColourValueToByte(const double& Value)
{
return BYTE(floor(Value * double(255) + 0.5));
}
/********************************************************************************************
> INT32 AIBitmapProcessor::DecodeHexStringAsCMYK( AI5EPSFilter& filter, ADDR& pCurrentLine,
INT32& nLineOffset, INT32 nLineLength, INT32 nMaxLineOffset, UINT32 nStart, BYTE CMYKval[], UINT32& nShift )
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Purpose: Treat the current token as a hex string, and decode it into a BGR bitmap.
Inputs: filter the filter doing the import
nLineLength the maximum number of bytes to read from the hex string.
nMaxLineOffset the width of the bitmap - 1
nStart where in TokenBuf (the member that contains the semantic value of
the token) to start the decoding
in,out: pCurrentLine the line in the bitmap to place the binary data into
nLineOffset the offset into the current line that will be read next
CMYKval the accumulated CMYK value
nShift the index into CMYKVal giving the next value to read
Returns: If an error occurs (i.e. invalid hex data) then -1 is returned.
This is way too complicated but I copied the code from the base class and
worked from there.
How about read the bitmap line by line getting an RGB value from the appropriate
"BitmapParser", say.
********************************************************************************************/
INT32 AIBitmapProcessor::DecodeHexStringAsCMYK( AI5EPSFilter& filter, ADDR& pCurrentLine, INT32& nLineOffset, INT32 nLineLength, INT32 nMaxLineOffset, UINT32 nStart, BYTE CMYKval[], UINT32& nShift )
{
UINT32 nTokenLen = camStrlen(filter.GetTokenBuf() + nStart);
// Assume hex strings are even-numbered in length for the moment
if ( (nTokenLen & 1) != 0 )
{
TRACE( _T("Bad hex string length in DecodeHexString\n") );
return -1;
}
/////////////////
// Decode the string two characters at a time keeping a running CMYK value
/////////////////
double dRed, dGreen, dBlue;
double dKey;
UINT32 i;
for ( i = nStart; i < nTokenLen; i += 2 )
{
/////////////////
// read in the CMYK value one component at at time
// first clear the next value
///////////////////
CMYKval[nShift] = 0;
if ( !CharToHex( filter.GetTokenBuf()[i], CMYKval[nShift] ) )
return -1;
CMYKval[nShift] <<= 4;
if ( !CharToHex( filter.GetTokenBuf()[i + 1], CMYKval[nShift] ) )
return -1;
++nShift;
///////////////////
// once we have a complete CMYK value, stick it in the bitmap
///////////////////
if ( nShift > 3 )
{
/////////////////
// Convert the colour into an RGB format.
/////////////////
dKey = double(CMYKval[3]) / 255.0;
dRed = 1.0 - (min(1.0, (double(CMYKval[0]) / 255.0 + dKey )));
dGreen = 1.0 - (min(1.0, (double(CMYKval[1]) / 255.0 + dKey )));
dBlue = 1.0 - (min(1.0, (double(CMYKval[2]) / 255.0 + dKey )));
/////////////////
// Set the value for the current pixel in the bitmap.
/////////////////
pCurrentLine[nLineOffset++] = ColourValueToByte( dBlue );
pCurrentLine[nLineOffset++] = ColourValueToByte( dGreen );
pCurrentLine[nLineOffset++] = ColourValueToByte( dRed );
if ( nLineOffset > nMaxLineOffset )
{
pCurrentLine -= nLineLength;
nLineOffset = 0;
}
/////////////////
// start the next CMYK value
/////////////////
nShift = 0;
}
}
// How much data did we read?
return i;
}
/********************************************************************************************
> INT32 AIBitmapProcessor::DecodeHexStringAsRGB( AI5EPSFilter& filter, ADDR& pCurrentLine,
INT32& nLineOffset, INT32 nLineLength, INT32 nMaxLineOffset, UINT32 nStart, BYTE RGBVal[], UINT32& nShift )
Author: Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Created: 23/03/00
Purpose: Treat the current token as a hex string, and decode it into a BGR bitmap.
Inputs: filter the filter doing the import
nLineLength the maximum number of bytes to read from the hex string.
nMaxLineOffset the width of the bitmap - 1
nStart where in TokenBuf (the member that contains the semantic value of
the token) to start the decoding
in,out: pCurrentLine the line in the bitmap to place the binary data into
nLineOffset the offset into the current line that will be read next
RGBVal the accumulated RGB value
nShift the index into RGBVal giving the next value to read
Returns: If an error occurs (i.e. invalid hex data) then -1 is returned.
This is way too complicated but I copied the code from the base class and
worked from there.
How about read the bitmap line by line getting an RGB value from the appropriate
"BitmapParser", say.
********************************************************************************************/
INT32 AIBitmapProcessor::DecodeHexStringAsRGB( AI5EPSFilter& filter, ADDR& pCurrentLine, INT32& nLineOffset, INT32 nLineLength, INT32 nMaxLineOffset, UINT32 nStart, BYTE RGBVal[], UINT32& nShift )
{
UINT32 nTokenLen = camStrlen(filter.GetTokenBuf() + nStart);
// Assume hex strings are even-numbered in length for the moment
if ( (nTokenLen & 1) != 0 )
{
TRACE( _T("Bad hex string length in DecodeHexString\n") );
return -1;
}
/////////////////
// Decode the string two characters at a time
/////////////////
UINT32 i;
for ( i = nStart; i < nTokenLen; i += 2 )
{
RGBVal[nShift] = 0;
if ( !CharToHex( filter.GetTokenBuf()[i], RGBVal[nShift] ) )
return -1;
RGBVal[nShift] <<= 4;
if ( !CharToHex( filter.GetTokenBuf()[i + 1], RGBVal[nShift] ) )
return -1;
++nShift;
///////////////////
// once we have a complete RGB value, stick it in the bitmap
// reversing it to BGR
///////////////////
if ( nShift > 2 )
{
pCurrentLine[nLineOffset++] = RGBVal[2];
pCurrentLine[nLineOffset++] = RGBVal[1];
pCurrentLine[nLineOffset++] = RGBVal[0];
if ( nLineOffset > nMaxLineOffset )
{
pCurrentLine -= nLineLength;
nLineOffset = 0;
}
nShift = 0;
}
}
// How much data did we read?
return i;
}
| [
"neon.king.fr@gmail.com"
] | neon.king.fr@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.