blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 6 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 26 | license_type stringclasses 2 values | repo_name stringlengths 7 95 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 57 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 197k 639M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 11 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 34 values | src_encoding stringclasses 18 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 11 9.86M | extension stringclasses 27 values | content stringlengths 11 9.86M | authors listlengths 1 1 | author stringlengths 0 70 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
80971fcfe1d80c6bb8f631ad5661f806c7db278f | d17b8bd573cd1a1bbccf8f8392742925e4b4275a | /HelloGL/HelloGL/GLUTCallbacks.cpp | ad678ee8a43773e38333d45982d682c1bbe3f80f | [] | no_license | AdamMilbourne/uniWork | 192249736cc1d8ea9426941175c224739fc80ed7 | 7ba1cc2abf99e161a581f0a39b5f91c3ad0e4ef0 | refs/heads/main | 2023-04-07T06:03:13.303680 | 2021-04-21T07:35:32 | 2021-04-21T07:35:32 | 300,587,886 | 1 | 0 | null | 2020-10-02T11:29:57 | 2020-10-02T11:05:14 | null | UTF-8 | C++ | false | false | 794 | cpp | #include "GLUTCallbacks.h"
#include "HelloGL.h"
//namespace implementation
namespace GLUTCallbacks
{
namespace
{
//initialise to a null pointer before we do anything
HelloGL* helloGL = nullptr;
}
void Init(HelloGL* gl)
{
helloGL = gl;
}
void Display()
{
if (helloGL != nullptr)
{
helloGL->Display();
}
//keyboard input set up
glutKeyboardFunc(Keyboard);
}
void GLUTCallbacks::Timer(int prefferedRefresh)
{
int updateTime = glutGet(GLUT_ELAPSED_TIME);
helloGL->Update();
updateTime = glutGet(GLUT_ELAPSED_TIME) - updateTime;
glutTimerFunc(prefferedRefresh - updateTime, GLUTCallbacks::Timer, prefferedRefresh);
}
void GLUTCallbacks::Keyboard(unsigned char key, int x, int y)
{
//pointer to keyoard function
helloGL->Keyboard(key, x, y);
}
}
| [
"milbourneadam@yahoo.com"
] | milbourneadam@yahoo.com |
59fc14d46b64b4bb818a2500dbf1529c78d9251c | 8af716c46074aabf43d6c8856015d8e44e863576 | /src/clientversion.h | f1ff7bd1e9d1560a1a90dbe23b53e37b60a4b7e8 | [
"MIT"
] | permissive | coinwebfactory/acrecore | 089bc945becd76fee47429c20be444d7b2460f34 | cba71d56d2a3036be506a982f23661e9de33b03b | refs/heads/master | 2020-03-23T06:44:27.396884 | 2018-07-17T03:32:27 | 2018-07-17T03:32:27 | 141,226,622 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,216 | h | // Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2017 The Acre developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CLIENTVERSION_H
#define BITCOIN_CLIENTVERSION_H
#if defined(HAVE_CONFIG_H)
#include "config/acre-config.h"
#else
/**
* client versioning and copyright year
*/
//! These need to be macros, as clientversion.cpp's and acre*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
/**
* Copyright year (2009-this)
* Todo: update this when changing our copyright comments in the source
*/
#define COPYRIGHT_YEAR 2018
#endif //HAVE_CONFIG_H
/**
* Converts the parameter X to a string after macro replacement on X has been performed.
* Don't merge these into one macro!
*/
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
//! Copyright string used in Windows .rc files
#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers, 2014-" STRINGIZE(COPYRIGHT_YEAR) " The Dash Core Developers, 2015-" STRINGIZE(COPYRIGHT_YEAR) " The PIVX Core Developers, 2017-" STRINGIZE(COPYRIGHT_YEAR) " The Acre Core Developers"
/**
* acred-res.rc includes this file, but it cannot cope with real c++ code.
* WINDRES_PREPROC is defined to indicate that its pre-processor is running.
* Anything other than a define should be guarded below.
*/
#if !defined(WINDRES_PREPROC)
#include <string>
#include <vector>
static const int CLIENT_VERSION =
1000000 * CLIENT_VERSION_MAJOR ///
+ 10000 * CLIENT_VERSION_MINOR ///
+ 100 * CLIENT_VERSION_REVISION ///
+ 1 * CLIENT_VERSION_BUILD;
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
std::string FormatFullVersion();
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
#endif // WINDRES_PREPROC
#endif // BITCOIN_CLIENTVERSION_H
| [
"root@vultr.guest"
] | root@vultr.guest |
e2ee8b93943930ad4b22f279a407c03376c69e88 | fb7ffa19e2fd795e0565407c2053ce0dc8f00912 | /snapDeformer.cpp | 5f6fb04fce298ed41f5119154757e9ea3ba37d40 | [] | no_license | mburch13/SnapDeformer | 9f7aaca584bdc7939644fc07974108445f51c8a7 | 30cc54a326fe6d40f2df5e1a08d4e6764e4687ba | refs/heads/master | 2022-12-17T15:47:17.020035 | 2020-09-28T16:41:41 | 2020-09-28T16:41:41 | 299,371,252 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,732 | cpp | //snapDeformer.cpp
#include "snapDeformer.h"
#include <maya/MItGeometry.h>
#include <maya/MItMeshVertex.h>
#include <maya/MFnMesh.h>
#include <maya/MItMeshPolygon.h>
#include "maya/MDataHandle.h"
#include "maya/MArrayDataHandle.h"
#include <maya/MPlug.h>
#define SMALL (float)1e-6
#define BIG_DIST 99999
MTypeId snapDeformer::typeId(0x00108b13); //define value for typeId
//needed attributes
MObject snapDeformer::referencedMesh;
MObject snapDeformer::rebind;
MObject snapDeformer::driverMesh;
MObject snapDeformer::idAssociation;
snapDeformer::snapDeformer(){
initialized = 0;
elemCount = 0;
bindArray = MIntArray();
}
void* snapDeformer::creator(){
return new snapDeformer();
}
MStatus snapDeformer::initialize(){
MFnNumericAttribute numAttr;
MFnTypedAttribute tAttr;
rebind = numAttr.create("rebind", "rbn", MFnNumericData::kBoolean, 0);
numAttr.setKeyable(true);
numAttr.setStorable(true);
addAttribute(rebind);
idAssociation = numAttr.create("idAssociation", "ida", MFnNumericData::kInt, 0);
numAttr.setKeyable(true);
numAttr.setStorable(true);
numAttr.setArray(true);
addAttribute(idAssociation);
driverMesh = tAttr.create("driverMesh", "drm", MFnData::kMesh);
tAttr.setKeyable(true);
tAttr.setStorable(true);
addAttribute(driverMesh);
attributeAffects(driverMesh, outputGeom);
attributeAffects(rebind, outputGeom);
MGlobal::executeCommand("makePaintable -attrType multiFloat -sm deformer snapDeformer weights");
return MS::kSuccess;
}
MStatus snapDeformer::deform(MDataBlock& data, MItGeometry& iter, const MMatrix& localToWorldMatrix, unsigned int mIndex){
//check if driver mesh is connected
MPlug driverMeshPlug(thisMObject(), driverMesh);
if(driverMeshPlug.isConnected() == false){
return MS::kNotImplemented;
}
MObject driverMeshV = data.inputValue(driverMesh).asMesh();
MArrayDataHandle idAssociationV = data.inputArrayValue(idAssociation); //handle for arrays accessing array value
idAssociationV.jumpToArrayElement(0);
double envelopeV = data.inputValue(envelope).asFloat();
bool rebindV = data.inputValue(rebind).asBool();
//if envelope is not 0
if(envelopeV < SMALL){
return MS::kSuccess;
}
//driver points
MPointArray driverPoint;
MFnMesh driverGeoFn(driverMeshV);
driverGeoFn.getPoints(driverPoint, MSpace::kWorld);
//get input point
MPointArray pos;
iter.allPositions(pos, MSpace::kWorld);
//check for rebind
if(rebindV == 1){
initData(driverMeshV, pos, bindArray, idAssociation);
}
if(elemCount == 0){
elemCount = iter.exactCount();
}
//check if bind array is empty or messed up
int arrayLength = bindArray.length();
if(elemCount != arrayLength || initialized == 0 || arrayLength == 0){
ensureIndexes(idAssociation, iter.exactCount()); //read from attributes
//loop attribute and read value
MArrayDataHandle idsHandle = data.inputArrayValue(idAssociation);
idsHandle.jumpToArrayElement(0);
int count = iter.exactCount();
bindArray.setLength(count);
for(int i = 0; i < count; i++, idsHandle.next()){
bindArray[i] = idsHandle.inputValue().asInt();
}
//set value in controller variables
elemCount = count;
initialized = 1;
}
if(elemCount != iter.exactCount()){
MGlobal::displayError("Mismatch between saved bind index and current mesh vertex, please rebind");
return MS::kSuccess;
}
//loop all elements and set the size
MVector delta, current, target;
for(int i=0; i<elemCount; i++){
delta = driverPoint[bindArray[i]] - pos[i]; //compute delta from position and final posistion
pos[i] = pos[i] + (delta*envelopeV); //scale the delta by the envelope amount
}
iter.setAllPositions(pos);
return MS::kSuccess;
}
MStatus snapDeformer::shouldSave(const MPlug& plug, bool& result){
//based on attribute name determine what to save
//save everything
result = true;
return MS::kSuccess;
}
void snapDeformer::initData(MObject& driverMesh, MPointArray& deformedPoints, MIntArray& bindArray, MObject& attribute){
int count = deformedPoints.length();
bindArray.setLength(count);
//declare needed functions sets and get all points
MFnMesh meshFn(driverMesh);
MItMeshPolygon faceIter(driverMesh);
MPointArray driverPoints;
meshFn.getPoints(driverPoints, MSpace::kWorld);
//declare all the needed variables of the loop
MPlug attrPlug(thisMObject(), attribute);
MDataHandle handle;
MPoint closest;
int closestFace, oldIndex, minId;
unsigned int v;
MIntArray vertices;
double minDist, dist;
MVector base, end, vec;
for(int i=0; i<count; i++){
meshFn.getClosestPoint(deformedPoints[i], closest, MSpace::kWorld, &closestFace); //closest face
//find closest vertex
faceIter.setIndex(closestFace, oldIndex);
vertices.setLength(0);
faceIter.getVertices(vertices);
//convert MPoint to MVector
base = MVector(closest);
minDist = BIG_DIST;
for(v=0; v<vertices.length(); v++){
end = MVector(driverPoints[vertices[v]]);
vec = end - base;
dist = vec.length();
if(dist < minDist){
minDist = dist;
minId = vertices[v];
}
}
bindArray[i] = int(minId);
//ensure we got the attribute indicies
attrPlug.selectAncestorLogicalIndex(i, attribute);
attrPlug.getValue(handle);
attrPlug.setValue(minId);
}
initialized = 1;
elemCount = count;
}
void snapDeformer::ensureIndexes(MObject& attribute, int indexSize){
//loops the index in order to creat them if needed
MPlug attrPlug(thisMObject(), attribute);
MDataHandle handle;
for(int i=0; i<indexSize; i++){
attrPlug.selectAncestorLogicalIndex(i, attribute);
attrPlug.getValue(handle);
}
}
| [
"46796707+mburch13@users.noreply.github.com"
] | 46796707+mburch13@users.noreply.github.com |
9385dabce07c96c8d7aeacfee43e01123c096b0f | 8751230f16a776e5a61754c7d38c0c2380efbf42 | /src/openexr/exrstdattr/main.cpp | 9697e8bb8f11d09c0b702114679b8762645d2ca9 | [
"MIT"
] | permissive | willzhou/appleseed | 0b5dc66480809c92b358264de6e9f628a5758922 | ea08888796006387c800c23b63a8ca7bb3c9b675 | refs/heads/master | 2021-01-20T23:16:42.617460 | 2012-05-31T08:29:22 | 2012-05-31T08:29:22 | 4,506,046 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,864 | cpp | ///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// 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 Industrial Light & Magic nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// exrstdattr -- a program that can set the values of most
// standard attributes in an OpenEXR image file's header.
//
//-----------------------------------------------------------------------------
#include <ImfStandardAttributes.h>
#include <ImfVecAttribute.h>
#include <ImfInputFile.h>
#include <ImfOutputFile.h>
#include <ImfTiledOutputFile.h>
#include <map>
#include <string>
#include <iostream>
#include <exception>
#include <stdlib.h>
using namespace std;
using namespace Imf;
using namespace Imath;
void
usageMessage (const char argv0[], bool verbose = false)
{
cerr << "usage: " << argv0 << " [options] infile outfile" << endl;
if (verbose)
{
cerr << "\n"
"Reads an OpenEXR image from infile, sets the values of\n"
"one or more standard attributes in the image's header,\n"
"and saves the result in outfile. Infile and outfile must\n"
"not refer to the same file (the program cannot edit an\n"
"image file \"in place\").\n"
"\n"
"Options for setting attribute values:\n"
"\n"
" -chromaticities f f f f f f f f\n"
" CIE xy chromaticities for the red, green\n"
" and blue primaries, and for the white point\n"
" (8 floats)\n"
"\n"
" -whiteLuminance f\n"
" white luminance, in candelas per square meter\n"
" (float, >= 0.0)\n"
"\n"
" -xDensity f\n"
" horizontal output density, in pixels per inch\n"
" (float, >= 0.0)\n"
"\n"
" -owner s\n"
" name of the owner of the image (string)\n"
"\n"
" -comments s\n"
" additional information about the image (string)\n"
"\n"
" -capDate s\n"
" date when the image was created or\n"
" captured, in local time (string,\n"
" formatted as YYYY:MM:DD hh:mm:ss)\n"
"\n"
" -utcOffset f\n"
" offset of local time at capDate from UTC, in\n"
" seconds (float, UTC == local time + x)\n"
"\n"
" -longitude f\n"
" -latitude f\n"
" -altitude f\n"
" location where the image was recorded, in\n"
" degrees east of Greenwich and north of the\n"
" equator, and in meters above sea level\n"
" (float)\n"
"\n"
" -focus f\n"
" the camera's focus distance, in meters\n"
" (float, > 0, or \"infinity\")\n"
"\n"
" -expTime f\n"
" exposure time, in seconds (float, >= 0)\n"
"\n"
" -aperture f\n"
" lens apterture, in f-stops (float, >= 0)\n"
"\n"
" -isoSpeed f\n"
" effective speed of the film or image\n"
" sensor that was used to record the image\n"
" (float, >= 0)\n"
"\n"
" -envmap s\n"
" indicates that the image is an environment map\n"
" (string, LATLONG or CUBE)\n"
"\n"
" -keyCode i i i i i i i\n"
" key code that uniquely identifies a motion\n"
" picture film frame using 7 integers:\n"
" * film manufacturer code (0 - 99)\n"
" * film type code (0 - 99)\n"
" * prefix to identify film roll (0 - 999999)\n"
" * count, increments once every perfsPerCount\n"
" perforations (0 - 9999)\n"
" * offset of frame, in perforations from\n"
" zero-frame reference mark (0 - 119)\n"
" * number of perforations per frame (1 - 15)\n"
" * number of perforations per count (20 - 120)\n"
"\n"
" -timeCode i i\n"
" SMPTE time and control code, specified as a pair\n"
" of 8-digit base-16 integers. The first number\n"
" contains the time address and flags (drop frame,\n"
" color frame, field/phase, bgf0, bgf1, bgf2).\n"
" The second number contains the user data and\n"
" control codes.\n"
"\n"
" -wrapmodes s\n"
" if the image is used as a texture map, specifies\n"
" how the image should be extrapolated outside the\n"
" zero-to-one texture coordinate range\n"
" (string, e.g. \"clamp\" or \"periodic,clamp\")\n"
"\n"
" -pixelAspectRatio f\n"
" width divided by height of a pixel\n"
" (float, >= 0)\n"
"\n"
" -screenWindowWidth f\n"
" width of the screen window (float, >= 0)\n"
"\n"
" -screenWindowCenter f f\n"
" center of the screen window (2 floats)\n"
"\n"
"Other Options:\n"
"\n"
" -h prints this message\n";
cerr << endl;
}
exit (1);
}
typedef map <string, Attribute *> AttrMap;
void
isNonNegative (const char attrName[], float f)
{
if (f < 0)
{
cerr << "The value for the " << attrName << " attribute "
"must not be less than zero." << endl;
exit (1);
}
}
void
isPositive (const char attrName[], float f)
{
if (f <= 0)
{
cerr << "The value for the " << attrName << " attribute "
"must be greater than zero." << endl;
exit (1);
}
}
void
notValidDate (const char attrName[])
{
cerr << "The value for the " << attrName << " attribute "
"is not a valid date of the form \"YYYY:MM:DD yy:mm:ss\"." << endl;
exit (1);
}
int
strToInt (const char str[], int length)
{
int x = 0;
for (int i = 0; i < length; ++i)
{
if (str[i] < '0' || str[i] > '9')
return -1;
x = x * 10 + (str[i] - '0');
}
return x;
}
void
isDate (const char attrName[], const char str[])
{
//
// Check that str represents a valid
// date of the form YYYY:MM:DD hh:mm:ss.
//
if (strlen (str) != 19 ||
str[4] != ':' || str[7] != ':' ||
str[10] != ' ' ||
str[13] != ':' || str[16] != ':')
{
notValidDate (attrName);
}
int Y = strToInt (str + 0, 4); // year
int M = strToInt (str + 5, 2); // month
int D = strToInt (str + 8, 2); // day
int h = strToInt (str + 11, 2); // hour
int m = strToInt (str + 14, 2); // minute
int s = strToInt (str + 17, 2); // second
if (Y < 0 ||
M < 1 || M > 12 ||
D < 1 ||
h < 0 || h > 23 ||
m < 0 || m > 59 ||
s < 0 || s > 59)
{
notValidDate (attrName);
}
if (M == 2)
{
bool leapYear = (Y % 4 == 0) && (Y % 100 != 0 || Y % 400 == 0);
if (D > (leapYear? 29: 28))
notValidDate (attrName);
}
else if (M == 4 || M == 6 || M == 9 || M == 11)
{
if (D > 30)
notValidDate (attrName);
}
else
{
if (D > 31)
notValidDate (attrName);
}
}
void
getFloat (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs,
void (*check) (const char attrName[], float f) = 0)
{
if (i > argc - 2)
usageMessage (argv[0]);
float f = strtod (argv[i + 1], 0);
if (check)
check (attrName, f);
attrs[attrName] = new FloatAttribute (f);
i += 2;
}
void
getPosFloatOrInf (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs)
{
if (i > argc - 2)
usageMessage (argv[0]);
float f;
if (!strcmp (argv[i + 1], "inf") || !strcmp (argv[i + 1], "infinity"))
{
f = float (half::posInf());
}
else
{
f = strtod (argv[i + 1], 0);
if (f <= 0)
{
cerr << "The value for the " << attrName << " attribute "
"must be greater than zero, or \"infinity\"." << endl;
exit (1);
}
}
attrs[attrName] = new FloatAttribute (f);
i += 2;
}
void
getV2f (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs,
void (*check) (const char attrName[], const V2f &v) = 0)
{
if (i > argc - 3)
usageMessage (argv[0]);
V2f v (strtod (argv[i + 1], 0), strtod (argv[i + 2], 0));
if (check)
check (attrName, v);
attrs[attrName] = new V2fAttribute (v);
i += 3;
}
void
getString (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs,
void (*check) (const char attrName[], const char str[]) = 0)
{
if (i > argc - 2)
usageMessage (argv[0]);
const char *str = argv[i + 1];
if (check)
check (attrName, str);
attrs[attrName] = new StringAttribute (str);
i += 2;
}
void
getChromaticities (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs)
{
if (i > argc - 9)
usageMessage (argv[0]);
ChromaticitiesAttribute *a = new ChromaticitiesAttribute;
attrs[attrName] = a;
a->value().red.x = strtod (argv[i + 1], 0);
a->value().red.y = strtod (argv[i + 2], 0);
a->value().green.x = strtod (argv[i + 3], 0);
a->value().green.y = strtod (argv[i + 4], 0);
a->value().blue.x = strtod (argv[i + 5], 0);
a->value().blue.y = strtod (argv[i + 6], 0);
a->value().white.x = strtod (argv[i + 7], 0);
a->value().white.y = strtod (argv[i + 8], 0);
i += 9;
}
void
getEnvmap (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs)
{
if (i > argc - 2)
usageMessage (argv[0]);
char *str = argv[i + 1];
Envmap type;
if (!strcmp (str, "latlong") || !strcmp (str, "LATLONG"))
{
type = ENVMAP_LATLONG;
}
else if (!strcmp (str, "cube") || !strcmp (str, "CUBE"))
{
type = ENVMAP_CUBE;
}
else
{
cerr << "The value for the " << attrName << " attribute "
"must be either LATLONG or CUBE." << endl;
exit (1);
}
attrs[attrName] = new EnvmapAttribute (type);
i += 2;
}
void
getKeyCode (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs)
{
if (i > argc - 8)
usageMessage (argv[0]);
KeyCodeAttribute *a = new KeyCodeAttribute;
attrs[attrName] = a;
a->value().setFilmMfcCode (strtol (argv[i + 1], 0, 0));
a->value().setFilmType (strtol (argv[i + 2], 0, 0));
a->value().setPrefix (strtol (argv[i + 3], 0, 0));
a->value().setCount (strtol (argv[i + 4], 0, 0));
a->value().setPerfOffset (strtol (argv[i + 5], 0, 0));
a->value().setPerfsPerFrame (strtol (argv[i + 6], 0, 0));
a->value().setPerfsPerCount (strtol (argv[i + 7], 0, 0));
i += 8;
}
void
getTimeCode (const char attrName[],
int argc,
char **argv,
int &i,
AttrMap &attrs)
{
if (i > argc - 3)
usageMessage (argv[0]);
TimeCodeAttribute *a = new TimeCodeAttribute;
attrs[attrName] = a;
a->value().setTimeAndFlags (strtoul (argv[i + 1], 0, 16));
a->value().setUserData (strtoul (argv[i + 2], 0, 16));
i += 3;
}
int
main(int argc, char **argv)
{
//
// Parse the command line.
//
if (argc < 2)
usageMessage (argv[0], true);
int exitStatus = 0;
try
{
const char *inFileName = 0;
const char *outFileName = 0;
AttrMap attrs;
int i = 1;
while (i < argc)
{
const char *attrName = argv[i] + 1;
if (!strcmp (argv[i], "-chromaticities"))
{
getChromaticities (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-whiteLuminance"))
{
getFloat (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-xDensity"))
{
getFloat (attrName, argc, argv, i, attrs, isPositive);
}
else if (!strcmp (argv[i], "-owner"))
{
getString (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-comments"))
{
getString (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-capDate"))
{
getString (attrName, argc, argv, i, attrs, isDate);
}
else if (!strcmp (argv[i], "-utcOffset"))
{
getFloat (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-longitude"))
{
getFloat (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-latitude"))
{
getFloat (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-altitude"))
{
getFloat (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-focus"))
{
getPosFloatOrInf (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-expTime"))
{
getFloat (attrName, argc, argv, i, attrs, isPositive);
}
else if (!strcmp (argv[i], "-aperture"))
{
getFloat (attrName, argc, argv, i, attrs, isPositive);
}
else if (!strcmp (argv[i], "-isoSpeed"))
{
getFloat (attrName, argc, argv, i, attrs, isPositive);
}
else if (!strcmp (argv[i], "-envmap"))
{
getEnvmap (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-keyCode"))
{
getKeyCode (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-timeCode"))
{
getTimeCode (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-wrapmodes"))
{
getString (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-pixelAspectRatio"))
{
getFloat (attrName, argc, argv, i, attrs, isPositive);
}
else if (!strcmp (argv[i], "-screenWindowWidth"))
{
getFloat (attrName, argc, argv, i, attrs, isNonNegative);
}
else if (!strcmp (argv[i], "-screenWindowCenter"))
{
getV2f (attrName, argc, argv, i, attrs);
}
else if (!strcmp (argv[i], "-h"))
{
usageMessage (argv[0], true);
}
else
{
if (inFileName == 0)
inFileName = argv[i];
else
outFileName = argv[i];
i += 1;
}
}
if (inFileName == 0 || outFileName == 0)
usageMessage (argv[0]);
if (!strcmp (inFileName, outFileName))
{
cerr << "Input and output cannot be the same file." << endl;
return 1;
}
//
// Load the input file, add the new attributes,
// and save the result in the output file.
//
InputFile in (inFileName);
Header header = in.header();
for (AttrMap::const_iterator i = attrs.begin(); i != attrs.end(); ++i)
header.insert (i->first.c_str(), *i->second);
if (header.hasTileDescription())
{
TiledOutputFile out (outFileName, header);
out.copyPixels (in);
}
else
{
OutputFile out (outFileName, header);
out.copyPixels (in);
}
}
catch (const exception &e)
{
cerr << e.what() << endl;
exitStatus = 1;
}
return exitStatus;
}
| [
"beaune@aist.enst.fr"
] | beaune@aist.enst.fr |
fbccddd1147eb867839cf74eea39f5c4e706931c | c23b42b301b365f6c074dd71fdb6cd63a7944a54 | /contest/Daejeon/2016/j.cpp | 54789fda15e7c65d6476b7b3fef4159870b6dc3b | [] | no_license | NTUwanderer/PECaveros | 6c3b8a44b43f6b72a182f83ff0eb908c2e944841 | 8d068ea05ee96f54ee92dffa7426d3619b21c0bd | refs/heads/master | 2020-03-27T22:15:49.847016 | 2019-01-04T14:20:25 | 2019-01-04T14:20:25 | 147,217,616 | 1 | 0 | null | 2018-09-03T14:40:49 | 2018-09-03T14:40:49 | null | UTF-8 | C++ | false | false | 569 | cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define N 505050
typedef long long LL;
int n , t[ N ];
LL x[ N ] , y[ N ];
bool solve(){
vector< pair<LL,LL> > v;
for( int i = 0 ; i < n ; i ++ )
v.push_back( { { x[ i ] , y[ i ] } , t[ i ] } );
if( v[ 0 ].second != 1 ) return false;
if( v.back().second != 1 ) return false;
return true;
}
int main(){
while( scanf( "%d" , &n ) == 1 ){
for( int i = 0 ; i < n ; i ++ )
scanf( "%lld%lld%d" , &x[ i ] , &y[ i ] , &t[ i ] );
if( not solve() )
puts( "-1" );
}
}
| [
"c.c.hsu01@gmail.com"
] | c.c.hsu01@gmail.com |
e2e6209d7c6307c4780abbc75fa8a3d80b379972 | d80fd3a98114f5b0a260e558768d1188a96ee85a | /src/rpcblockchain.cpp | e34f4bf53b9d798563035384f700ea0c9692f9d2 | [
"MIT"
] | permissive | gkcproject/gkccash_core | 9c599c5377683b25d9974d8c0f8983ce820676ab | 1bec1d5dd91fde93276f2ddb2cc63b93f02ba3e9 | refs/heads/master | 2023-06-16T01:10:42.286710 | 2021-06-28T09:49:04 | 2021-06-28T09:49:04 | 257,286,295 | 67 | 17 | MIT | 2021-01-04T01:39:57 | 2020-04-20T13:16:14 | C++ | UTF-8 | C++ | false | false | 107,663 | cpp | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "base58.h"
#include "checkpoints.h"
#include "clientversion.h"
#include "contractconfig.h"
#include "main.h"
#include "rpcserver.h"
#include "sync.h"
#include "txdb.h"
#include "util.h"
#include "core_io.h"
#include "utilmoneystr.h"
#include <stdint.h>
#include <univalue.h>
#include <string>
#include <algorithm>
using namespace std;
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
double GetDifficulty(const CBlockIndex* blockindex)
{
// Floating point number that is a multiple of the minimum difficulty,
// minimum difficulty = 1.0.
if (blockindex == NULL) {
if (chainActive.Tip() == NULL)
return 1.0;
else
blockindex = chainActive.Tip();
}
int nShift = (blockindex->nBits >> 24) & 0xff;
double dDiff =
(double)0x0000ffff / (double)(blockindex->nBits & 0x00ffffff);
while (nShift < 29) {
dDiff *= 256.0;
nShift++;
}
while (nShift > 29) {
dDiff /= 256.0;
nShift--;
}
return dDiff;
}
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
{
UniValue result(UniValue::VOBJ);
result.push_back(Pair("hash", block.GetHash().GetHex()));
int confirmations = -1;
// Only report confirmations if the block is on the main chain
if (chainActive.Contains(blockindex))
confirmations = chainActive.Height() - blockindex->nHeight + 1;
result.push_back(Pair("confirmations", confirmations));
result.push_back(Pair("size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)));
result.push_back(Pair("height", blockindex->nHeight));
result.push_back(Pair("version", block.nVersion));
result.push_back(Pair("merkleroot", block.hashMerkleRoot.GetHex()));
result.push_back(Pair("acc_checkpoint", block.nAccumulatorCheckpoint.GetHex()));
UniValue txs(UniValue::VARR);
BOOST_FOREACH (const CTransaction& tx, block.vtx) {
if (txDetails) {
UniValue objTx(UniValue::VOBJ);
TxToJSON(tx, uint256(0), objTx);
txs.push_back(objTx);
} else
txs.push_back(tx.GetHash().GetHex());
}
result.push_back(Pair("tx", txs));
result.push_back(Pair("time", block.GetBlockTime()));
result.push_back(Pair("nonce", (uint64_t)block.nNonce));
result.push_back(Pair("bits", strprintf("%08x", block.nBits)));
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
result.push_back(Pair("chainwork", blockindex->nChainWork.GetHex()));
if (blockindex->pprev)
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
CBlockIndex* pnext = chainActive.Next(blockindex);
if (pnext)
result.push_back(Pair("nextblockhash", pnext->GetBlockHash().GetHex()));
result.push_back(Pair("moneysupply",ValueFromAmount(blockindex->nMoneySupply)));
UniValue ztsrObj(UniValue::VOBJ);
for (auto denom : libzerocoin::zerocoinDenomList) {
ztsrObj.push_back(Pair(to_string(denom), ValueFromAmount(blockindex->mapZerocoinSupply.at(denom) * (denom*COIN))));
}
ztsrObj.push_back(Pair("total", ValueFromAmount(blockindex->GetZerocoinSupply())));
result.push_back(Pair("zGKCsupply", ztsrObj));
return result;
}
UniValue blockHeaderToJSON(const CBlock& block, const CBlockIndex* blockindex)
{
UniValue result(UniValue::VOBJ);
result.push_back(Pair("version", block.nVersion));
if (blockindex->pprev)
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
result.push_back(Pair("merkleroot", block.hashMerkleRoot.GetHex()));
result.push_back(Pair("time", block.GetBlockTime()));
result.push_back(Pair("bits", strprintf("%08x", block.nBits)));
result.push_back(Pair("nonce", (uint64_t)block.nNonce));
result.push_back(Pair("hash",blockindex->GetBlockHash().GetHex()));
result.push_back(Pair("height",blockindex->nHeight));
return result;
}
UniValue getblockcount(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getblockcount\n"
"\nReturns the number of blocks in the longest block chain.\n"
"\nResult:\n"
"n (numeric) The current block count\n"
"\nExamples:\n" +
HelpExampleCli("getblockcount", "") + HelpExampleRpc("getblockcount", ""));
return chainActive.Height();
}
UniValue getbestblockhash(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getbestblockhash\n"
"\nReturns the hash of the best (tip) block in the longest block chain.\n"
"\nResult\n"
"\"hex\" (string) the block hash hex encoded\n"
"\nExamples\n" +
HelpExampleCli("getbestblockhash", "") + HelpExampleRpc("getbestblockhash", ""));
return chainActive.Tip()->GetBlockHash().GetHex();
}
UniValue getdifficulty(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getdifficulty\n"
"\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n"
"\nResult:\n"
"n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\n"
"\nExamples:\n" +
HelpExampleCli("getdifficulty", "") + HelpExampleRpc("getdifficulty", ""));
return GetDifficulty();
}
UniValue getrawmempool(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getrawmempool ( verbose )\n"
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
"\nArguments:\n"
"1. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n"
"\nResult: (for verbose = false):\n"
"[ (json array of string)\n"
" \"transactionid\" (string) The transaction id\n"
" ,...\n"
"]\n"
"\nResult: (for verbose = true):\n"
"{ (json object)\n"
" \"transactionid\" : { (json object)\n"
" \"size\" : n, (numeric) transaction size in bytes\n"
" \"fee\" : n, (numeric) transaction fee in gkc\n"
" \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n"
" \"height\" : n, (numeric) block height when transaction entered pool\n"
" \"startingpriority\" : n, (numeric) priority when transaction entered pool\n"
" \"currentpriority\" : n, (numeric) transaction priority now\n"
" \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n"
" \"transactionid\", (string) parent transaction id\n"
" ... ]\n"
" }, ...\n"
"]\n"
"\nExamples\n" +
HelpExampleCli("getrawmempool", "true") + HelpExampleRpc("getrawmempool", "true"));
bool fVerbose = false;
if (params.size() > 0)
fVerbose = params[0].get_bool();
if (fVerbose) {
LOCK(mempool.cs);
UniValue o(UniValue::VOBJ);
BOOST_FOREACH (const PAIRTYPE(uint256, CTxMemPoolEntry) & entry, mempool.mapTx) {
const uint256& hash = entry.first;
const CTxMemPoolEntry& e = entry.second;
UniValue info(UniValue::VOBJ);
info.push_back(Pair("size", (int)e.GetTxSize()));
info.push_back(Pair("fee", ValueFromAmount(e.GetFee())));
info.push_back(Pair("time", e.GetTime()));
info.push_back(Pair("height", (int)e.GetHeight()));
info.push_back(Pair("startingpriority", e.GetPriority(e.GetHeight())));
info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height())));
const CTransaction& tx = e.GetTx();
set<string> setDepends;
BOOST_FOREACH (const CTxIn& txin, tx.vin) {
if (mempool.exists(txin.prevout.hash))
setDepends.insert(txin.prevout.hash.ToString());
}
UniValue depends(UniValue::VARR);
BOOST_FOREACH(const string& dep, setDepends) {
depends.push_back(dep);
}
info.push_back(Pair("depends", depends));
o.push_back(Pair(hash.ToString(), info));
}
return o;
} else {
vector<uint256> vtxid;
mempool.queryHashes(vtxid);
UniValue a(UniValue::VARR);
BOOST_FOREACH (const uint256& hash, vtxid)
a.push_back(hash.ToString());
return a;
}
}
UniValue getblockhash(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getblockhash index\n"
"\nReturns hash of block in best-block-chain at index provided.\n"
"\nArguments:\n"
"1. index (numeric, required) The block index\n"
"\nResult:\n"
"\"hash\" (string) The block hash\n"
"\nExamples:\n" +
HelpExampleCli("getblockhash", "1000") + HelpExampleRpc("getblockhash", "1000"));
int nHeight = params[0].get_int();
if (nHeight < 0 || nHeight > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
CBlockIndex* pblockindex = chainActive[nHeight];
return pblockindex->GetBlockHash().GetHex();
}
//------------------cpoy from blockexplorer.cpp
inline std::string utostr(unsigned int n)
{
return strprintf("%u", n);
}
static std::string makeHRef(const std::string& Str)
{
return "<a href=\"" + Str + "\">" + Str + "</a>";
}
CTxOut getPrevOut2(const COutPoint& out)
{
CTransaction tx;
uint256 hashBlock;
if (GetTransaction(out.hash, tx, hashBlock, true))
return tx.vout[out.n];
return CTxOut();
}
static CAmount getTxIn(const CTransaction& tx)
{
if (tx.IsCoinBase())
return 0;
CAmount Sum = 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
Sum += getPrevOut2(tx.vin[i].prevout).nValue;
return Sum;
}
static std::string ValueToString(CAmount nValue, bool AllowNegative = false)
{
if (nValue < 0 && !AllowNegative)
return "<span>unknown</span>";
double value = nValue*1.0/100000000;
std::string Str = std::to_string(value);
if (AllowNegative && nValue > 0)
Str = '+' + Str;
else if(AllowNegative && nValue < 0)
Str = '-' + Str;
return std::string("<span>") + Str + "</span>";
}
static std::string ValueToString2(CAmount nValue, bool AllowNegative = false)
{
if (nValue < 0 && !AllowNegative)
return "unknown";
int64_t n_abs = (nValue > 0 ? nValue : -nValue);
int64_t quotient = n_abs / COIN;
int64_t remainder = n_abs % COIN;
std::string Str = strprintf("%lld.%08lld",quotient,remainder);
if (AllowNegative && nValue > 0)
Str = '+' + Str;
else if(AllowNegative && nValue < 0)
Str = '-' + Str;
return Str;
}
string FormatScript2(const CScript& script)
{
string ret;
CScript::const_iterator it = script.begin();
opcodetype op;
while (it != script.end()) {
CScript::const_iterator it2 = it;
vector<unsigned char> vch;
if (script.GetOp2(it, op, &vch)) {
if (op == OP_0) {
ret += "0 ";
continue;
} else if ((op >= OP_1 && op <= OP_16) || op == OP_1NEGATE) {
ret += strprintf("%i ", op - OP_1NEGATE - 1);
continue;
} else if (op >= OP_NOP && op <= OP_CHECKMULTISIGVERIFY) {
string str(GetOpName(op));
if (str.substr(0, 3) == string("OP_")) {
ret += str.substr(3, string::npos) + " ";
continue;
}
}
if (vch.size() > 0) {
ret += strprintf("0x%x 0x%x ", HexStr(it2, it - vch.size()), HexStr(it - vch.size(), it));
} else {
ret += strprintf("0x%x", HexStr(it2, it));
}
continue;
}
ret += strprintf("0x%x ", HexStr(it2, script.end()));
break;
}
return ret.substr(0, ret.size() - 1);
}
static std::string ScriptToString(const CScript& Script, bool Long = false, bool Highlight = false)
{
if (Script.empty())
return "unknown";
CTxDestination Dest;
CBitcoinAddress Address;
if (ExtractDestination(Script, Dest) && Address.Set(Dest)) {
if (Highlight)
return "<span class=\"addr\">" + Address.ToString() + "</span>";
else
return makeHRef(Address.ToString());
} else
return Long ? "<pre>" + FormatScript2(Script) + "</pre>" : "Non-standard script";
}
static std::string ScriptToString2(const CScript& Script, bool Long = false, bool Highlight = false)
{
if (Script.empty())
return "unknown";
CTxDestination Dest;
CBitcoinAddress Address;
if (ExtractDestination(Script, Dest) && Address.Set(Dest)) {
return Address.ToString();
} else
return (Long || Script.Find(OP_RETURN)==1) ? FormatScript2(Script): "Non-standard script";
}
static std::string TimeToString(uint64_t Time)
{
time_t t;
tm* local;
char buf[128]= {0};
t = (long int)Time;
local = localtime(&t);
strftime(buf, 64, "%Y-%m-%d %H:%M:%S", local);
return buf;
}
static std::string makeHTMLTableRow(const std::string* pCells, int n)
{
std::string Result = "<tr>";
for (int i = 0; i < n; i++) {
Result += "<td class=\"d" + utostr(i) + "\">";
Result += pCells[i];
Result += "</td>";
}
Result += "</tr>";
return Result;
}
static const char* table = "<table>";
static std::string makeHTMLTable(const std::string* pCells, int nRows, int nColumns)
{
std::string Table = table;
for (int i = 0; i < nRows; i++)
Table += makeHTMLTableRow(pCells + i * nColumns, nColumns);
Table += "</table>";
return Table;
}
static std::string TxToRow(const CTransaction& tx, const CKeyID& Highlight = CKeyID(), const std::string& Prepend = std::string(), int64_t* pSum = NULL)
{
std::string InAmounts, InAddresses, OutAmounts, OutAddresses;
int64_t Delta = 0;
for (unsigned int j = 0; j < tx.vin.size(); j++) {
if (tx.IsCoinBase()) {
InAmounts += ValueToString(tx.GetValueOut());
InAddresses += "coinbase";
} else {
CTxOut PrevOut = getPrevOut2(tx.vin[j].prevout);
InAmounts += ValueToString(PrevOut.nValue);
CKeyID KeyID = uint160(1);
CTxDestination PrevOutDest;
if (ExtractDestination(PrevOut.scriptPubKey, PrevOutDest)) {
if (typeid(CKeyID) == PrevOutDest.type()) {
KeyID = boost:: get<CKeyID>(PrevOutDest);
}
}
InAddresses += ScriptToString(PrevOut.scriptPubKey, false, KeyID == Highlight).c_str();
if (KeyID == Highlight)
Delta -= PrevOut.nValue;
}
if (j + 1 != tx.vin.size()) {
InAmounts += "<br/>";
InAddresses += "<br/>";
}
}
for (unsigned int j = 0; j < tx.vout.size(); j++) {
CTxOut Out = tx.vout[j];
OutAmounts += ValueToString(Out.nValue);
CKeyID KeyID = uint160(1);
CTxDestination TxOutDest;
if (ExtractDestination(Out.scriptPubKey, TxOutDest)) {
if (typeid(CKeyID) == TxOutDest.type()) {
KeyID = boost:: get<CKeyID>(TxOutDest);
}
}
OutAddresses += ScriptToString(Out.scriptPubKey, false, KeyID == Highlight);
if (KeyID == Highlight)
Delta += Out.nValue;
if (j + 1 != tx.vout.size()) {
OutAmounts += "<br/>";
OutAddresses += "<br/>";
}
}
std::string List[8] =
{
Prepend,
makeHRef(tx.GetHash().GetHex()),
InAddresses,
InAmounts,
OutAddresses,
OutAmounts,
"",
""
};
int n = sizeof(List) / sizeof(std::string) - 2;
if (CKeyID() != Highlight) {
List[n++] = std::string("<font color=\"") + ((Delta > 0) ? "green" : "red") + "\">" + ValueToString(Delta, true) + "</font>";
*pSum += Delta;
List[n++] = ValueToString(*pSum);
return makeHTMLTableRow(List, n);
}
return makeHTMLTableRow(List + 1, n - 1);
}
static UniValue TxToRow2(const CTransaction& tx, const CBlockIndex* pIndex, const CScript& Highlight = CScript(), const std::string& Prepend = std::string(), int64_t* pSum = NULL)
{
const bool isCoinbase = tx.IsCoinBase();
const bool isCoinstake = tx.IsCoinStake();
int64_t coinstakeInputAmount = 0;
CAmount totalIn = 0, totalOut = 0;
UniValue info(UniValue::VOBJ);
UniValue from_array(UniValue::VARR);
UniValue to_array(UniValue::VARR);
int64_t Delta = 0;
for (unsigned int j = 0; j < tx.vin.size(); j++) {
std::string InAmounts, InAddresses;
if (tx.IsCoinBase()) {
InAmounts = ValueToString2(0);
InAddresses = "coinbase";
} else if (isCoinstake) {
InAmounts = "Proof of Stake";
InAddresses = "coinstake";
CTxOut PrevOut = getPrevOut2(tx.vin[j].prevout);
coinstakeInputAmount = PrevOut.nValue;
totalIn += PrevOut.nValue;
} else {
CTxOut PrevOut = getPrevOut2(tx.vin[j].prevout);
totalIn += PrevOut.nValue;
InAmounts = ValueToString2(PrevOut.nValue);
InAddresses = ScriptToString2(PrevOut.scriptPubKey, false, PrevOut.scriptPubKey == Highlight).c_str();
if (PrevOut.scriptPubKey == Highlight)
Delta -= PrevOut.nValue;
}
UniValue from_item(UniValue::VOBJ);
from_item.push_back(Pair(InAddresses,InAmounts));
from_array.push_back(from_item);
}
const bool isContractTx = isCoinstake && tx.vout.size() > 1 && tx.vout[1].scriptPubKey.HasOpVmHashState();
const int minerOutIndexFirst = isContractTx ? 2 : 1;
bool hasMinerOutIndexSecond = false;
for (unsigned int j = 0; j < tx.vout.size(); j++) {
if(isCoinstake && j==0)
continue;
std::string OutAmounts, OutAddresses;
CTxOut Out = tx.vout[j];
totalOut += Out.nValue;
if(isCoinstake) {
if(pIndex && pIndex->nHeight >= Entrustment::GetInstance().forkHeightForSpecifyMinerRewardReceiver && Out.nValue == coinstakeInputAmount) {
if(j==minerOutIndexFirst)
continue;
}
else if(j==minerOutIndexFirst) {
if(Out.nValue >= coinstakeInputAmount)
OutAmounts = ValueToString2(Out.nValue - coinstakeInputAmount);
else {
coinstakeInputAmount -= Out.nValue;
hasMinerOutIndexSecond = true;
continue;
}
}
else if(hasMinerOutIndexSecond && j==minerOutIndexFirst+1) {
if(Out.nValue >= coinstakeInputAmount)
OutAmounts = ValueToString2(Out.nValue - coinstakeInputAmount);
}
}
if(OutAmounts.empty())
OutAmounts = ValueToString2(Out.nValue);
OutAddresses = ScriptToString2(Out.scriptPubKey, false, Out.scriptPubKey == Highlight);
if (Out.scriptPubKey == Highlight)
Delta += Out.nValue;
UniValue to_item(UniValue::VOBJ);
to_item.push_back(Pair(OutAddresses,OutAmounts));
to_array.push_back(to_item);
}
info.push_back(Pair("txid", tx.GetHash().GetHex()));
info.push_back(Pair("type", tx.GetTypeString()));
info.push_back(Pair("from_array",from_array ));
info.push_back(Pair("to_array",to_array ));
info.push_back(Pair("total_out",(isCoinbase || isCoinstake) ? ValueToString2(totalOut-totalIn) : std::string()));
return info;
}
std::string getexplorerBlockHash2(int64_t Height)
{
std::string genesisblockhash = "0000041e482b9b9691d98eefb48473405c0b8ec31b76df3797c74a78680ef818";
CBlockIndex* pindexBest = mapBlockIndex[chainActive.Tip()->GetBlockHash()];
if ((Height < 0) || (Height > pindexBest->nHeight)) {
return genesisblockhash;
}
CBlock block;
CBlockIndex* pblockindex = mapBlockIndex[chainActive.Tip()->GetBlockHash()];
while (pblockindex->nHeight > Height)
pblockindex = pblockindex->pprev;
return pblockindex->GetBlockHash().GetHex(); // pblockindex->phashBlock->GetHex();
}
const CBlockIndex* getexplorerBlockIndex2(int64_t height)
{
std::string hex = getexplorerBlockHash2(height);
uint256 hash = uint256S(hex);
return mapBlockIndex[hash];
}
UniValue BlocksToString(int64_t from,int64_t to)
{
UniValue res(UniValue::VOBJ);
for(int64_t i = from ;i <= to;i++)
{
const CBlockIndex* pBlock = getexplorerBlockIndex2(i);
if(pBlock == nullptr)
continue;
CBlock block;
ReadBlockFromDisk(block, pBlock);
CAmount totalOut = 0;
for (unsigned int i = 0; i < block.vtx.size(); i++) {
const CTransaction& tx = block.vtx[i];
CAmount In = getTxIn(tx);
CAmount Out = tx.GetValueOut();
if(tx.IsCoinStake())
totalOut += (Out-In);
else
totalOut += Out;
}
UniValue info(UniValue::VOBJ);
info.push_back(Pair("Timestamp", TimeToString(block.nTime)));
info.push_back(Pair("Transactions", itostr(block.vtx.size())));
info.push_back(Pair("Value", ValueToString2(totalOut)));
info.push_back(Pair("Difficulty", strprintf("%.4f", GetDifficulty(pBlock))));
res.push_back(Pair(itostr(i), info));
}
return res;
}
UniValue BlockToString2(CBlockIndex* pBlock)
{
if (!pBlock)
return "";
UniValue info(UniValue::VOBJ);
UniValue tx_array(UniValue::VARR);
CBlock block;
ReadBlockFromDisk(block, pBlock);
CAmount Fees = 0;
CAmount OutVolume = 0;
CAmount Reward = 0;
std::string TxLabels[] = {"Hash", "From", "Amount", "To", "Amount"};
std::string TxContent = table + makeHTMLTableRow(TxLabels, sizeof(TxLabels) / sizeof(std::string));
for (unsigned int i = 0; i < block.vtx.size(); i++) {
const CTransaction& tx = block.vtx[i];
tx_array.push_back( TxToRow2(tx, pBlock) );
CAmount In = getTxIn(tx);
CAmount Out = tx.GetValueOut();
if (tx.IsCoinBase())
Reward += Out;
else if (In < 0)
Fees = -Params().MaxMoneyOut();
else if(tx.IsCoinStake()) {
OutVolume += (Out-In);
}
else {
Fees += (In - Out);
OutVolume += Out;
}
}
TxContent += "</table>";
CAmount Generated;
if (pBlock->nHeight == 0)
Generated = OutVolume;
else
Generated = GetBlockValue(pBlock->nHeight - 1);
// return TimeToString(block.nTime);
// return strprintf("%.4f", GetDifficulty(pBlock));
std::string BlockContentCells[] =
{
"Height", itostr(pBlock->nHeight),
"Size", itostr(GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)),
"Number of Transactions", itostr(block.vtx.size()),
"Value Out", ValueToString(OutVolume),
"Fees", ValueToString(Fees),
"Generated", ValueToString(Generated),
"Timestamp", TimeToString(block.nTime),
"Difficulty", strprintf("%.4f", GetDifficulty(pBlock)),
"Bits", utostr(block.nBits),
"Nonce", utostr(block.nNonce),
"Version", itostr(block.nVersion),
"Hash", "<pre>" + block.GetHash().GetHex() + "</pre>",
"Merkle Root", "<pre>" + block.hashMerkleRoot.GetHex() + "</pre>",
// _("Hash Whole Block"), "<pre>" + block.hashWholeBlock.GetHex() + "</pre>"
// _("Miner Signature"), "<pre>" + block.MinerSignature.ToString() + "</pre>"
};
info.push_back(Pair("height",itostr(pBlock->nHeight)));
info.push_back(Pair("size",itostr(GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))));
info.push_back(Pair("tx_num",itostr(block.vtx.size())));
info.push_back(Pair("value_out",ValueToString2(OutVolume)));
info.push_back(Pair("fees",ValueToString2(Fees)));
info.push_back(Pair("generated",ValueToString2(Generated)));
info.push_back(Pair("timestamp",TimeToString(block.nTime)));
info.push_back(Pair("difficulty",strprintf("%.4f", GetDifficulty(pBlock))));
info.push_back(Pair("bits",utostr(block.nBits)));
info.push_back(Pair("nonce",utostr(block.nNonce)));
info.push_back(Pair("version",itostr(block.nVersion)));
info.push_back(Pair("hash",block.GetHash().GetHex()));
info.push_back(Pair("merkle_root",block.hashMerkleRoot.GetHex()));
info.push_back(Pair("tx_array",tx_array));
return info;
}
UniValue getblockhashexplorer(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ);
if (fHelp || params.size() != 1)
throw runtime_error(
"getblockhashexplorer index\n"
"\nReturns hash of block in best-block-chain at index provided.\n"
"\nArguments:\n"
"1. index (numeric, required) The block index\n"
"\nResult:\n"
"\"hash\" (string) The block hash\n"
"\nExamples:\n" +
HelpExampleCli("getblockhashexplorer", "1000") + HelpExampleRpc("getblockhashexplorer", "1000"));
int64_t nHeight = (int64_t)(params[0].get_int());
if (nHeight < 0 || nHeight > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
const CBlockIndex* block_index = getexplorerBlockIndex2(nHeight);
if(block_index == nullptr)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block not found");
result = BlockToString2((CBlockIndex*)block_index);
return result;
}
void getNextIn2(const COutPoint& Out, uint256& Hash, unsigned int& n)
{
// Hash = 0;
// n = 0;
// if (paddressmap)
// paddressmap->ReadNextIn(Out, Hash, n);
}
UniValue TxToString2(uint256 BlockHash, const CTransaction& tx)
{
const bool isCoinbase = tx.IsCoinBase();
const bool isCoinstake = tx.IsCoinStake();
int64_t coinstakeInputAmount = 0;
CAmount Input = 0;
CAmount Output = tx.GetValueOut();
UniValue info(UniValue::VOBJ);
UniValue in_txes(UniValue::VOBJ);
UniValue out_txes(UniValue::VOBJ);
CBlockIndex* pIndex = nullptr;
BlockMap::iterator iter = mapBlockIndex.find(BlockHash);
if (iter != mapBlockIndex.end())
pIndex = iter->second;
std::string InputsContentCells[] = {"#", "Taken from", "Address", "Amount"};
std::string InputsContent = makeHTMLTableRow(InputsContentCells, sizeof(InputsContentCells) / sizeof(std::string));
std::string OutputsContentCells[] = {"#", "Redeemed in", "Address", "Amount"};
std::string OutputsContent = makeHTMLTableRow(OutputsContentCells, sizeof(OutputsContentCells) / sizeof(std::string));
if (tx.IsCoinBase()) {
std::string InputsContentCells[] =
{
"0",
"coinbase",
"-",
ValueToString(0)};
InputsContent += makeHTMLTableRow(InputsContentCells, sizeof(InputsContentCells) / sizeof(std::string));
UniValue tx(UniValue::VOBJ);
tx.push_back(Pair("from","coinbase"));
tx.push_back(Pair("number",itostr(0)));
tx.push_back(Pair("address","coinbase"));
tx.push_back(Pair("amount",ValueToString2(0)));
in_txes.push_back(Pair("0",tx));
} else
for (unsigned int i = 0; i < tx.vin.size(); i++) {
COutPoint Out = tx.vin[i].prevout;
CTxOut PrevOut = getPrevOut2(tx.vin[i].prevout);
if (PrevOut.nValue < 0)
Input = -Params().MaxMoneyOut();
else
Input += PrevOut.nValue;
std::string InputsContentCells[] =
{
itostr(i),
"<span>" + makeHRef(Out.hash.GetHex()) + ":" + itostr(Out.n) + "</span>",
ScriptToString(PrevOut.scriptPubKey, true),
ValueToString(PrevOut.nValue)};
InputsContent += makeHTMLTableRow(InputsContentCells, sizeof(InputsContentCells) / sizeof(std::string));
UniValue tx(UniValue::VOBJ);
tx.push_back(Pair("from",Out.hash.GetHex()));
tx.push_back(Pair("number",itostr(Out.n)));
if(isCoinstake) {
tx.push_back(Pair("address","coinstake"));
tx.push_back(Pair("amount","Proof of Stake"));
coinstakeInputAmount = PrevOut.nValue;
} else {
tx.push_back(Pair("address",ScriptToString2(PrevOut.scriptPubKey, true)));
tx.push_back(Pair("amount",ValueToString2(PrevOut.nValue)));
}
in_txes.push_back(Pair(itostr(i),tx));
}
const bool isContractTx = isCoinstake && tx.vout.size() > 1 && tx.vout[1].scriptPubKey.HasOpVmHashState();
const int minerOutIndexFirst = isContractTx ? 2 : 1;
bool hasMinerOutIndexSecond = false;
uint256 TxHash = tx.GetHash();
for (unsigned int i = 0; i < tx.vout.size(); i++) {
if(isCoinstake && i==0)
continue;
const CTxOut& Out = tx.vout[i];
std::string OutAmounts;
if(isCoinstake) {
if(pIndex && pIndex->nHeight >= Entrustment::GetInstance().forkHeightForSpecifyMinerRewardReceiver && Out.nValue == coinstakeInputAmount) {
if(i==minerOutIndexFirst)
continue;
}
else if(i==minerOutIndexFirst) {
if(Out.nValue >= coinstakeInputAmount)
OutAmounts = ValueToString2(Out.nValue - coinstakeInputAmount);
else {
coinstakeInputAmount -= Out.nValue;
hasMinerOutIndexSecond = true;
continue;
}
}
else if(hasMinerOutIndexSecond && i==minerOutIndexFirst+1) {
if(Out.nValue >= coinstakeInputAmount)
OutAmounts = ValueToString2(Out.nValue - coinstakeInputAmount);
}
}
if(OutAmounts.empty())
OutAmounts = ValueToString2(Out.nValue);
uint256 HashNext = uint256S("0");
unsigned int nNext = 0;
bool fAddrIndex = false;
getNextIn2(COutPoint(TxHash, i), HashNext, nNext);
std::string OutputsContentCells[] =
{
itostr(i),
(HashNext == uint256S("0")) ? (fAddrIndex ? "no" : "unknown") : "<span>" + makeHRef(HashNext.GetHex()) + ":" + itostr(nNext) + "</span>",
ScriptToString(Out.scriptPubKey, true),
ValueToString(Out.nValue)};
OutputsContent += makeHTMLTableRow(OutputsContentCells, sizeof(OutputsContentCells) / sizeof(std::string));
UniValue tx(UniValue::VOBJ);
tx.push_back(Pair("redeemed_in",(HashNext == uint256S("0")) ? (fAddrIndex ? "no" : "unknown") : makeHRef(HashNext.GetHex()) + ":" + itostr(nNext) ));
tx.push_back(Pair("address",ScriptToString2(Out.scriptPubKey, false)));
tx.push_back(Pair("amount",OutAmounts));
out_txes.push_back(Pair(itostr(i),tx));
}
InputsContent = table + InputsContent + "</table>";
OutputsContent = table + OutputsContent + "</table>";
std::string Hash = TxHash.GetHex();
if(isCoinstake){
Input -= coinstakeInputAmount;
Output -= coinstakeInputAmount;
}
std::string Labels[] =
{
"In Block", "",
"Size", itostr(GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)),
"Input", ValueToString(Input),
"Output", ValueToString(Output),
"Fees", ValueToString(isCoinbase || isCoinstake ? 0 : Input - Output),
"Timestamp", "",
"Hash", "<pre>" + Hash + "</pre>",
};
info.push_back(Pair("size",itostr(GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION))));
info.push_back(Pair("input",ValueToString2(Input)));
info.push_back(Pair("output",ValueToString2(Output)));
info.push_back(Pair("fees",ValueToString2(isCoinbase || isCoinstake ? 0 : Input - Output)));
info.push_back(Pair("hash",Hash));
info.push_back(Pair("out_txes",out_txes));
info.push_back(Pair("in_txes",in_txes));
bool height_time_parsed = false;
if (pIndex) {
// Labels[0 * 2 + 1] = makeHRef(itostr(pIndex->nHeight));
// Labels[5 * 2 + 1] = TimeToString(pIndex->nTime);
height_time_parsed = true;
info.pushKV("height",itostr(pIndex->nHeight));
info.pushKV("timestamp",TimeToString(pIndex->nTime));
}
if(!height_time_parsed){
info.pushKV("height","");
info.pushKV("timestamp","");
}
// std::string Content;
// Content += "<h2>Transaction <span>" + Hash + "</span></h2>";
// Content += makeHTMLTable(Labels, sizeof(Labels) / (2 * sizeof(std::string)), 2);
// Content += "</br>";
// Content += "<h3>Inputs</h3>";
// Content += InputsContent;
// Content += "</br>";
// Content += "<h3>Outputs</h3>";
// Content += OutputsContent;
info.push_back(Pair("total_out",(isCoinbase || isCoinstake) ? ValueToString2(Output-Input) : std::string()));
return info;
}
UniValue gettxexplorer(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ);
if (fHelp || params.size() != 1)
throw runtime_error(
"gettxexplorer txid\n"
"\nReturns tx of txid in best-block-chain.\n"
"\nArguments:\n"
"1. txid (string, required) The txid\n"
"\nResult:\n"
"\"hash\" (string) The block txid\n"
"\nExamples:\n" +
HelpExampleCli("gettxexplorer", "dae45bd9250b18a940cde56c92ac9821d868cb386ee5a18fbb85885a911438c5") + HelpExampleRpc("gettxexplorer", "dae45bd9250b18a940cde56c92ac9821d868cb386ee5a18fbb85885a911438c5"));
std::string strHash = params[0].get_str();
uint256 hash(strHash);
CTransaction tx;
uint256 hashBlock = 0;
// std::string tx_str;
if (GetTransaction(hash, tx, hashBlock, true)) {
result = TxToString2(hashBlock, tx);
}
else
{
throw JSONRPCError(RPC_INVALID_PARAMETER, "Tx not found");
}
// result.push_back(Pair("txid", strHash));
// result.push_back(Pair("tx_str", tx_str));
return result;
}
bool AddressToString2(const CBitcoinAddress& Address, UniValue & Result)
{
CAmount Balance = 0;
CAmount TotalRecv = 0;
CAmount TotalSent = 0;
CAmount NetIncome = 0;
CKeyID KeyID;
UniValue uvTransactions(UniValue::VARR);
if (!Address.GetKeyID(KeyID))
return false;
if (!fAddrIndex) {
return false;
} else {
std::vector<CDiskTxPos> vTxDiskPos;
paddressmap->GetTxs(vTxDiskPos, CScriptID(KeyID));
BOOST_FOREACH (const CDiskTxPos& diskpos, vTxDiskPos)
{
CBlock block;
CTransaction tx;
ReadTransaction(diskpos, tx, block);
BlockMap::iterator iter = mapBlockIndex.find(block.GetHash());
if (iter == mapBlockIndex.end())
continue;
CBlockIndex* pindex = (*iter).second;
if (!pindex || !chainActive.Contains(pindex))
continue;
UniValue uvTx(UniValue::VOBJ);
UniValue uvTxIns(UniValue::VARR);
UniValue uvTxOuts(UniValue::VARR);
NetIncome = 0;
for (const auto & txin : tx.vin) {
UniValue uvTxIn(UniValue::VARR);
if (tx.IsCoinBase()) {
uvTxIn.push_back("coinbase");
uvTxIn.push_back(ValueFromAmount(tx.GetValueOut()));
} else {
CTxOut PrevOut = getPrevOut(txin);
CKeyID PrevKeyID;
CTxDestination PrevTxDest;
CBitcoinAddress PrevAddress;
if (ExtractDestination(PrevOut.scriptPubKey, PrevTxDest) && PrevAddress.Set(PrevTxDest)) {
if (typeid(CKeyID) == PrevTxDest.type()) {
PrevKeyID = boost::get<CKeyID>(PrevTxDest);
if (KeyID == PrevKeyID) {
NetIncome -= PrevOut.nValue;
TotalSent += PrevOut.nValue;
}
}
uvTxIn.push_back(PrevAddress.ToString());
} else {
uvTxIn.push_back(FormatScript(PrevOut.scriptPubKey));
}
uvTxIn.push_back(ValueFromAmount(PrevOut.nValue));
}
uvTxIns.push_back(uvTxIn);
}
for (const auto & txout : tx.vout) {
UniValue uvTxOut(UniValue::VARR);
CKeyID TxOutKeyID;
CTxDestination TxOutDest;
CBitcoinAddress TxOutAddress;
if (ExtractDestination(txout.scriptPubKey, TxOutDest) && TxOutAddress.Set(TxOutDest)) {
if (typeid(CKeyID) == TxOutDest.type()) {
TxOutKeyID = boost::get<CKeyID>(TxOutDest);
if (KeyID == TxOutKeyID) {
NetIncome += txout.nValue;
TotalRecv += txout.nValue;
}
}
uvTxOut.push_back(TxOutAddress.ToString());
} else {
uvTxOut.push_back(FormatScript(txout.scriptPubKey));
}
uvTxOut.push_back(ValueFromAmount(txout.nValue));
uvTxOuts.push_back(uvTxOut);
}
uvTx.push_back(Pair("Date", TimeToString(pindex->nTime)));
uvTx.push_back(Pair("Hash", tx.GetHash().GetHex()));
uvTx.push_back(std::make_pair("From", uvTxIns));
uvTx.push_back(std::make_pair("To", uvTxOuts));
uvTx.push_back(std::make_pair("Delta", ValueFromAmount(NetIncome)));
uvTx.push_back(std::make_pair("Balance", ValueFromAmount(TotalRecv - TotalSent)));
uvTransactions.push_back(uvTx);
}
Result.push_back(Pair("address", Address.ToString()));
Result.push_back(std::make_pair("received", ValueFromAmount(TotalRecv)));
Result.push_back(std::make_pair("sent", ValueFromAmount(TotalSent)));
Result.push_back(std::make_pair("balance", ValueFromAmount(TotalRecv - TotalSent)));
Result.push_back(std::make_pair("transactions", uvTransactions));
}
return true;
}
UniValue getblocksinfoexplorer(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"getblocksinfoexplorer from to\n"
"\nReturns blocksinfo from height \"from\" to height \"to\" in best-block-chain.\n"
"\nArguments:\n"
"1. from (numeric, required) The height from\n"
"2. to (numeric, required) The height to\n"
"\nResult:\n"
"\"hash\" (string) The height from\n"
"\nExamples:\n" +
HelpExampleCli("getblocksinfoexplorer", "10 25") + HelpExampleRpc("getblocksinfoexplorer","10 25"));
LogPrint("explorer","getblocksinfoexplorer | info | param[0]: isObj=%d, isStr=%d, isNum=%d\n",params[0].isObject(),params[0].isStr(),params[0].isNum());
LogPrint("explorer","getblocksinfoexplorer | info | param[1]: isObj=%d, isStr=%d, isNum=%d\n",params[1].isObject(),params[1].isStr(),params[1].isNum());
int64_t from = 0, to = 0;
if(params[0].isStr())
from = atoi64(params[0].get_str());
else
from = (int64_t)(params[0].get_int());
LogPrint("explorer","getblocksinfoexplorer | info | from=%lld\n",from);
if(params[1].isStr())
to = atoi64(params[1].get_str());
else
to = (int64_t)(params[1].get_int());
LogPrint("explorer","getblocksinfoexplorer | info | to=%lld\n",to);
if (from < 0 || from > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block from out of range");
if (to < 0 || to > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block to out of range");
if (to < from)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block to out of range");
return BlocksToString(from,to);
}
UniValue getqueryexplorer(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ);
if (fHelp || params.size() != 1)
throw runtime_error(
"getqueryexplorer hash\n"
"\nReturns info of hash in best-block-chain.\n"
"\nArguments:\n"
"1. hash (string, required) The hash\n"
"\nResult:\n"
"\"hash\" (string) The hash\n"
"\nExamples:\n" +
HelpExampleCli("getqueryexplorer", "8e6d5b52c0242972c285a0046d5904991887ef528d45ae043afdb02c4737786c") + HelpExampleRpc("getqueryexplorer", "8e6d5b52c0242972c285a0046d5904991887ef528d45ae043afdb02c4737786c"));
std::string strHash;
LogPrint("explorer","getqueryexplorer | info | param[0]: isObj=%d, isStr=%d\n",params[0].isObject(),params[0].isStr());
try
{
strHash = params[0].get_str();
}
catch(std::runtime_error& e)
{
int64_t nHeight = (int64_t)(params[0].get_int());
if (nHeight < 0 || nHeight > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
const CBlockIndex* block_index = getexplorerBlockIndex2(nHeight);
if(block_index == nullptr)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block not found");
result = BlockToString2((CBlockIndex*)block_index);
result.push_back(Pair("type","block"));
return result;
}
// If the query is not an integer, assume it is a block hash
uint256 hash = uint256S(strHash);
// std::map<uint256, CBlockIndex*>::iterator iter = mapBlockIndex.find(hash);
BlockMap::iterator iter = mapBlockIndex.find(hash);
if (iter != mapBlockIndex.end()) {
result = BlockToString2(iter->second);
result.push_back(Pair("type","block"));
return result;
}
// If the query is neither an integer nor a block hash, assume a transaction hash
CTransaction tx;
uint256 hashBlock = 0;
// std::string tx_str;
if (GetTransaction(hash, tx, hashBlock, true)) {
result = TxToString2(hashBlock, tx);
result.push_back(Pair("type","transaction"));
// result.push_back(Pair("tx_str", tx_str));
return result;
}
// If the query is not an integer, nor a block hash, nor a transaction hash, assume an address
CBitcoinAddress Address;
std::string address_str;
Address.SetString(strHash);
if (Address.IsValid()) {
if (AddressToString2(Address, result))
{
result.push_back(Pair("type","address"));
return result;
}
}
throw JSONRPCError(RPC_INVALID_PARAMETER, "Query Invalid");
return result;
}
UniValue getaddressbalance(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 3)
throw runtime_error(
"getaddressbalance startheight endheight address1 [address2] [...]\n"
"\nReturns balance of address between height range [start,end). \n"
"\nArguments:\n"
"1. startheight (string, required) The start height of blockchain\n"
"2. endheight (string, required) The end height of blockchain.\n"
"3. address1 (string, required) The GKC address\n"
"n. addressn (string, optional) The GKC address\n"
"\nResult:\n"
"\"balance\" (string) The balance of address within blockheight range\n"
"\nExamples:\n" +
HelpExampleCli("getaddressbalance", "0 99999 UWTD1rHBFXG5dtvNDuabnXSFfh7W8XhUeD") + HelpExampleRpc("getaddressbalance", "0 99999 UWTD1rHBFXG5dtvNDuabnXSFfh7W8XhUeD"));
if (!fAddrIndex)
throw JSONRPCError(RPC_INVALID_PARAMETER, "This RPC supported in explorer only!");
BlockHeight startheight = 0, endheight = 0;
std::map<CBitcoinAddress,CAmount> addrMap;
startheight = atoi(params[0].get_str());
endheight = atoi(params[1].get_str());
int addrLen = params.size() - 2;
for(int i=0; i<addrLen; i++){
addrMap[CBitcoinAddress(params[2+i].get_str())] = 0;
}
UniValue result(UniValue::VOBJ);
CAmount totalBalance = 0;
UniValue balanceArray(UniValue::VARR);
for(std::map<CBitcoinAddress,CAmount>::iterator addrIt = addrMap.begin(); addrIt != addrMap.end(); addrIt++){
const CBitcoinAddress addr = addrIt->first;
CAmount& balance = addrIt->second;
CKeyID keyID;
assert(balance == 0);
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid GKC address");
std::vector<CDiskTxPos> vTxDiskPos;
paddressmap->GetTxs(vTxDiskPos, CScriptID(keyID));
BOOST_FOREACH (const CDiskTxPos& diskpos, vTxDiskPos)
{
CBlock block;
CTransaction tx;
ReadTransaction(diskpos, tx, block);
BlockMap::iterator iter = mapBlockIndex.find(block.GetHash());
if (iter == mapBlockIndex.end())
continue;
CBlockIndex* pindex = (*iter).second;
if (!pindex || !chainActive.Contains(pindex))
continue;
if(pindex->nHeight < startheight || endheight <= pindex->nHeight)
continue;
CAmount NetIncome = 0;
for (const auto & txin : tx.vin) {
if (tx.IsCoinBase())
continue;
CTxOut PrevOut = getPrevOut(txin);
CKeyID PrevKeyID;
CTxDestination PrevTxDest;
CBitcoinAddress PrevAddress;
if (ExtractDestination(PrevOut.scriptPubKey, PrevTxDest) && PrevAddress.Set(PrevTxDest)) {
if (typeid(CKeyID) == PrevTxDest.type()) {
PrevKeyID = boost::get<CKeyID>(PrevTxDest);
if (keyID == PrevKeyID) {
NetIncome -= PrevOut.nValue;
}
}
}
}
for (const auto & txout : tx.vout) {
CKeyID TxOutKeyID;
CTxDestination TxOutDest;
CBitcoinAddress TxOutAddress;
if (ExtractDestination(txout.scriptPubKey, TxOutDest) && TxOutAddress.Set(TxOutDest)) {
if (typeid(CKeyID) == TxOutDest.type()) {
TxOutKeyID = boost::get<CKeyID>(TxOutDest);
if (keyID == TxOutKeyID) {
NetIncome += txout.nValue;
}
}
}
}
balance += NetIncome;
}
UniValue balanceObj(UniValue::VOBJ);
balanceObj.push_back(Pair(addr.ToString(),ValueFromAmount(balance).write()));
balanceArray.push_back(balanceObj);
totalBalance += balance;
}
if(addrLen == 1) {
result = ValueFromAmount(totalBalance).write();
} else {
result.push_back(Pair("addr_balance",balanceArray));
result.push_back(Pair("total",ValueFromAmount(totalBalance).write()));
}
return result;
}
UniValue getaddressexplorer(const UniValue& params, bool fHelp)
{
UniValue result(UniValue::VOBJ);
if (fHelp || params.size() != 1)
throw runtime_error(
"getaddressexplorer address\n"
"\nReturns txes of address in best-block-chain.\n"
"\nArguments:\n"
"1. txid (string, required) The address\n"
"\nResult:\n"
"\"hash\" (string) The address\n"
"\nExamples:\n" +
HelpExampleCli("getaddressexplorer", "UWTD1rHBFXG5dtvNDuabnXSFfh7W8XhUeD") + HelpExampleRpc("getaddressexplorer", "UWTD1rHBFXG5dtvNDuabnXSFfh7W8XhUeD"));
std::string strHash = params[0].get_str();
std::string address_str;
CBitcoinAddress Address;
Address.SetString(strHash);
if (Address.IsValid()) {
if (!AddressToString2(Address, result))
throw JSONRPCError(RPC_INVALID_PARAMETER, "Address No Txes");
}
else
{
throw JSONRPCError(RPC_INVALID_PARAMETER, "Address Invalid");
}
return result;
}
UniValue getblock(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getblock \"hash\" ( verbose )\n"
"\nIf verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
"If verbose is true, returns an Object with information about block <hash>.\n"
"\nArguments:\n"
"1. \"hash\" (string, required) The block hash\n"
"2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n"
"\nResult (for verbose = true):\n"
"{\n"
" \"hash\" : \"hash\", (string) the block hash (same as provided)\n"
" \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n"
" \"size\" : n, (numeric) The block size\n"
" \"height\" : n, (numeric) The block height or index\n"
" \"version\" : n, (numeric) The block version\n"
" \"merkleroot\" : \"xxxx\", (string) The merkle root\n"
" \"tx\" : [ (array of string) The transaction ids\n"
" \"transactionid\" (string) The transaction id\n"
" ,...\n"
" ],\n"
" \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"nonce\" : n, (numeric) The nonce\n"
" \"bits\" : \"1d00ffff\", (string) The bits\n"
" \"difficulty\" : x.xxx, (numeric) The difficulty\n"
" \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n"
" \"nextblockhash\" : \"hash\" (string) The hash of the next block\n"
" \"moneysupply\" : \"supply\" (numeric) The money supply when this block was added to the blockchain\n"
" \"zGKCsupply\" :\n"
" {\n"
" \"1\" : n, (numeric) supply of 1 zGKC denomination\n"
" \"5\" : n, (numeric) supply of 5 zGKC denomination\n"
" \"10\" : n, (numeric) supply of 10 zGKC denomination\n"
" \"50\" : n, (numeric) supply of 50 zGKC denomination\n"
" \"100\" : n, (numeric) supply of 100 zGKC denomination\n"
" \"500\" : n, (numeric) supply of 500 zGKC denomination\n"
" \"1000\" : n, (numeric) supply of 1000 zGKC denomination\n"
" \"5000\" : n, (numeric) supply of 5000 zGKC denomination\n"
" \"total\" : n, (numeric) The total supply of all zGKC denominations\n"
" }\n"
"}\n"
"\nResult (for verbose=false):\n"
"\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n"
"\nExamples:\n" +
HelpExampleCli("getblock", "\"00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2\"") + HelpExampleRpc("getblock", "\"00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2\""));
std::string strHash = params[0].get_str();
uint256 hash(strHash);
bool fVerbose = true;
if (params.size() > 1)
fVerbose = params[1].get_bool();
if (mapBlockIndex.count(hash) == 0)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
CBlock block;
CBlockIndex* pblockindex = mapBlockIndex[hash];
if (!ReadBlockFromDisk(block, pblockindex))
throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk");
if (!fVerbose) {
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
ssBlock << block;
std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());
return strHex;
}
return blockToJSON(block, pblockindex);
}
UniValue getblockbalance(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1)
throw runtime_error("getblockbalance blockhash [address] [address] [...]");
uint256 blockhash;
std::set<CBitcoinAddress> addrFilter;
blockhash.SetHex(params[0].get_str());
int addrLen = params.size() - 1;
for(int i=0; i<addrLen; i++){
addrFilter.insert(CBitcoinAddress(params[1+i].get_str()));
}
const bool useFilter = !addrFilter.empty();
if (mapBlockIndex.count(blockhash) == 0)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
CBlock block;
CBlockIndex* pblockindex = mapBlockIndex[blockhash];
if (!ReadBlockFromDisk(block, pblockindex))
throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk");
std::map<CBitcoinAddress,std::pair<CAmount,CAmount> > addrBalanceMap;
for (const CTransaction& tx: block.vtx) {
CAmount NetIncome = 0;
for (const CTxIn & txin : tx.vin) {
CTxOut PrevOut = getPrevOut(txin);
CTxDestination PrevTxDest;
CBitcoinAddress PrevAddress;
if (ExtractDestination(PrevOut.scriptPubKey, PrevTxDest) && PrevAddress.Set(PrevTxDest)) {
if(useFilter && addrFilter.count(PrevAddress)==0)
continue;
if(addrBalanceMap.count(PrevAddress)==0)
addrBalanceMap[PrevAddress] = std::make_pair<CAmount,CAmount>(0,0);
addrBalanceMap[PrevAddress].first += PrevOut.nValue;
}
}
for (const CTxOut & txout : tx.vout) {
CTxDestination TxOutDest;
CBitcoinAddress TxOutAddress;
if (ExtractDestination(txout.scriptPubKey, TxOutDest) && TxOutAddress.Set(TxOutDest)) {
if(useFilter && addrFilter.count(TxOutAddress)==0)
continue;
if(addrBalanceMap.count(TxOutAddress)==0)
addrBalanceMap[TxOutAddress] = std::make_pair<CAmount,CAmount>(0,0);
addrBalanceMap[TxOutAddress].second += txout.nValue;
}
}
}
UniValue result(UniValue::VARR);
for(std::map<CBitcoinAddress,std::pair<CAmount,CAmount>>::const_iterator it = addrBalanceMap.begin(); it != addrBalanceMap.end(); it++){
UniValue addrBalanceObj(UniValue::VOBJ);
addrBalanceObj.push_back(Pair("address",it->first.ToString()));
addrBalanceObj.push_back(Pair("send",ValueFromAmount(it->second.first).write()));
addrBalanceObj.push_back(Pair("recv",ValueFromAmount(it->second.second).write()));
addrBalanceObj.push_back(Pair("balance",ValueFromAmount(it->second.second-it->second.first).write()));
result.push_back(addrBalanceObj);
}
return result;
}
UniValue getblockheader(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getblockheader \"hash\" ( verbose )\n"
"\nIf verbose is false, returns a string that is serialized, hex-encoded data for block 'hash' header.\n"
"If verbose is true, returns an Object with information about block <hash> header.\n"
"\nArguments:\n"
"1. \"hash\" (string, required) The block hash\n"
"2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n"
"\nResult (for verbose = true):\n"
"{\n"
" \"version\" : n, (numeric) The block version\n"
" \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n"
" \"merkleroot\" : \"xxxx\", (string) The merkle root\n"
" \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n"
" \"bits\" : \"1d00ffff\", (string) The bits\n"
" \"nonce\" : n, (numeric) The nonce\n"
"}\n"
"\nResult (for verbose=false):\n"
"\"data\" (string) A string that is serialized, hex-encoded data for block 'hash' header.\n"
"\nExamples:\n" +
HelpExampleCli("getblockheader", "\"00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2\"") + HelpExampleRpc("getblockheader", "\"00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2\""));
std::string strHash = params[0].get_str();
uint256 hash(strHash);
bool fVerbose = true;
if (params.size() > 1)
fVerbose = params[1].get_bool();
if (mapBlockIndex.count(hash) == 0)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
CBlock block;
CBlockIndex* pblockindex = mapBlockIndex[hash];
if (!ReadBlockFromDisk(block, pblockindex))
throw JSONRPCError(RPC_INTERNAL_ERROR, "Can't read block from disk");
if (!fVerbose) {
CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);
ssBlock << block.GetBlockHeader();
std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());
return strHex;
}
return blockHeaderToJSON(block, pblockindex);
}
UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"gettxoutsetinfo\n"
"\nReturns statistics about the unspent transaction output set.\n"
"Note this call may take some time.\n"
"\nResult:\n"
"{\n"
" \"height\":n, (numeric) The current block height (index)\n"
" \"bestblock\": \"hex\", (string) the best block hash hex\n"
" \"transactions\": n, (numeric) The number of transactions\n"
" \"txouts\": n, (numeric) The number of output transactions\n"
" \"bytes_serialized\": n, (numeric) The serialized size\n"
" \"hash_serialized\": \"hash\", (string) The serialized hash\n"
" \"total_amount\": x.xxx (numeric) The total amount\n"
"}\n"
"\nExamples:\n" +
HelpExampleCli("gettxoutsetinfo", "") + HelpExampleRpc("gettxoutsetinfo", ""));
UniValue ret(UniValue::VOBJ);
CCoinsStats stats;
FlushStateToDisk();
if (pcoinsTip->GetStats(stats)) {
ret.push_back(Pair("height", (int64_t)stats.nHeight));
ret.push_back(Pair("bestblock", stats.hashBlock.GetHex()));
ret.push_back(Pair("transactions", (int64_t)stats.nTransactions));
ret.push_back(Pair("txouts", (int64_t)stats.nTransactionOutputs));
ret.push_back(Pair("bytes_serialized", (int64_t)stats.nSerializedSize));
ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex()));
ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount)));
}
return ret;
}
UniValue gettxout(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 3)
throw runtime_error(
"gettxout \"txid\" n ( includemempool )\n"
"\nReturns details about an unspent transaction output.\n"
"\nArguments:\n"
"1. \"txid\" (string, required) The transaction id\n"
"2. n (numeric, required) vout value\n"
"3. includemempool (boolean, optional) Whether to included the mem pool\n"
"\nResult:\n"
"{\n"
" \"bestblock\" : \"hash\", (string) the block hash\n"
" \"confirmations\" : n, (numeric) The number of confirmations\n"
" \"value\" : x.xxx, (numeric) The transaction value in btc\n"
" \"scriptPubKey\" : { (json object)\n"
" \"asm\" : \"code\", (string) \n"
" \"hex\" : \"hex\", (string) \n"
" \"reqSigs\" : n, (numeric) Number of required signatures\n"
" \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n"
" \"addresses\" : [ (array of string) array of gkc addresses\n"
" \"gkcaddress\" (string) gkc address\n"
" ,...\n"
" ]\n"
" },\n"
" \"version\" : n, (numeric) The version\n"
" \"coinbase\" : true|false (boolean) Coinbase or not\n"
"}\n"
"\nExamples:\n"
"\nGet unspent transactions\n" +
HelpExampleCli("listunspent", "") +
"\nView the details\n" + HelpExampleCli("gettxout", "\"txid\" 1") +
"\nAs a json rpc call\n" + HelpExampleRpc("gettxout", "\"txid\", 1"));
UniValue ret(UniValue::VOBJ);
std::string strHash = params[0].get_str();
uint256 hash(strHash);
int n = params[1].get_int();
bool fMempool = true;
if (params.size() > 2)
fMempool = params[2].get_bool();
CCoins coins;
if (fMempool) {
LOCK(mempool.cs);
CCoinsViewMemPool view(pcoinsTip, mempool);
if (!view.GetCoins(hash, coins))
return NullUniValue;
mempool.pruneSpent(hash, coins); // TODO: this should be done by the CCoinsViewMemPool
} else {
if (!pcoinsTip->GetCoins(hash, coins))
return NullUniValue;
}
if (n < 0 || (unsigned int)n >= coins.vout.size() || coins.vout[n].IsNull())
return NullUniValue;
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex* pindex = it->second;
ret.push_back(Pair("bestblock", pindex->GetBlockHash().GetHex()));
if ((unsigned int)coins.nHeight == MEMPOOL_HEIGHT)
ret.push_back(Pair("confirmations", 0));
else
ret.push_back(Pair("confirmations", pindex->nHeight - coins.nHeight + 1));
ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue)));
UniValue o(UniValue::VOBJ);
ScriptPubKeyToJSON(coins.vout[n].scriptPubKey, o, true);
ret.push_back(Pair("scriptPubKey", o));
ret.push_back(Pair("version", coins.nVersion));
ret.push_back(Pair("coinbase", coins.fCoinBase));
#ifdef DPOS
const CTxOut& txout = coins.vout[n];
ret.push_back(Pair("type", txout.GetTypeString()));
#endif
return ret;
}
UniValue verifychain(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"verifychain ( numblocks )\n"
"\nVerifies blockchain database.\n"
"\nArguments:\n"
"1. numblocks (numeric, optional, default=288, 0=all) The number of blocks to check.\n"
"\nResult:\n"
"true|false (boolean) Verified or not\n"
"\nExamples:\n" +
HelpExampleCli("verifychain", "") + HelpExampleRpc("verifychain", ""));
int nCheckLevel = 4;
int nCheckDepth = GetArg("-checkblocks", 288);
if (params.size() > 0)
nCheckDepth = params[1].get_int();
return CVerifyDB().VerifyDB(pcoinsTip, nCheckLevel, nCheckDepth);
}
/////////////////////////////////////////////////////gkc-vm
UniValue getaccountinfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1)
throw std::runtime_error(
"getaccountinfo \"address\"\n"
"\nArgument:\n"
"1. \"address\" (string, required) The account address\n");
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
LOCK(cs_main);
std::string strAddr = params[0].get_str();
if (strAddr.size() != 40 || !IsHex(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Incorrect address");
if (!AddressInUse(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Address does not exist");
dev::Address addrAccount(strAddr);
UniValue result(UniValue::VOBJ);
result.push_back(Pair("address", strAddr));
result.push_back(Pair("balance", GetContractBalance(addrAccount)));
std::vector<uint8_t> code = GetContractCode(addrAccount);
std::map<dev::h256, std::pair<dev::u256, dev::u256>> storage = GetStorageByAddress(strAddr);
UniValue storageUV(UniValue::VOBJ);
for (auto j: storage)
{
UniValue e(UniValue::VOBJ);
e.pushKV(dev::toHex(dev::h256(j.second.first)), dev::toHex(dev::h256(j.second.second)));
storageUV.push_back(Pair(j.first.hex(), e));
}
result.push_back(Pair("storage", storageUV));
result.push_back(Pair("code", HexStr(code.begin(), code.end())));
dev::h256 hash;
uint32_t nVout;
dev::u256 value;
uint8_t alive;
if (GetContractVin(addrAccount, hash, nVout, value, alive))
{
UniValue vin(UniValue::VOBJ);
valtype vchHash(hash.asBytes());
vin.push_back(Pair("hash", HexStr(vchHash.rbegin(), vchHash.rend())));
vin.push_back(Pair("nVout", uint64_t(nVout)));
vin.push_back(Pair("value", uint64_t(value)));
vin.push_back(Pair("alive", uint8_t(alive)));
result.push_back(Pair("vin", vin));
}
return result;
}
UniValue getstorage(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1)
throw std::runtime_error(
"getstorage \"address\"\n"
"\nArgument:\n"
"1. \"address\" (string, required) The address to get the storage from\n"
"2. \"blockNum\" (string, optional) Number of block to get state from, \"latest\" keyword supported. Latest if not passed.\n"
"3. \"index\" (number, optional) Zero-based index position of the storage\n");
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
LOCK(cs_main);
std::string strAddr = params[0].get_str();
if (strAddr.size() != 40 || !IsHex(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Incorrect address");
if (params.size() > 1)
{
if (params[1].isNum())
{
auto blockNum = params[1].get_int();
if ((blockNum < 0 && blockNum != -1) || blockNum > chainActive.Height())
throw JSONRPCError(RPC_INVALID_PARAMS, "Incorrect block number");
if (blockNum != -1)
{
uint256 hashStateRoot;
uint256 hashUTXORoot;
CBlock block;
if (!ReadBlockFromDisk(block, chainActive[blockNum]))
{
std::ostringstream stringStream;
stringStream << "ReadBlockFromDisk failed at hegiht " << chainActive[blockNum]->nHeight << " hash: " << chainActive[blockNum]->GetBlockHash().ToString();
throw JSONRPCError(RPC_INVALID_PARAMS, stringStream.str());
} else
{
if(block.GetVMState(hashStateRoot, hashUTXORoot) == RET_VM_STATE_ERR){
throw JSONRPCError(RPC_INVALID_PARAMS, "Incorrect GetVMState");
}
}
SetTemporaryState(hashStateRoot, hashUTXORoot);
// ifContractObj->SetTemporaryState(chainActive[blockNum]->hashStateRoot,
// chainActive[blockNum]->hashUTXORoot);
}
} else
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Incorrect block number");
}
}
if (!AddressInUse(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Address does not exist");
UniValue result(UniValue::VOBJ);
bool onlyIndex = params.size() > 2;
unsigned index = 0;
if (onlyIndex)
index = params[2].get_int();
std::map<dev::h256, std::pair<dev::u256, dev::u256>> storage = GetStorageByAddress(strAddr);
if (onlyIndex)
{
if (index >= storage.size())
{
std::ostringstream stringStream;
stringStream << "Storage size: " << storage.size() << " got index: " << index;
throw JSONRPCError(RPC_INVALID_PARAMS, stringStream.str());
}
auto elem = std::next(storage.begin(), index);
UniValue e(UniValue::VOBJ);
storage = {{elem->first, {elem->second.first, elem->second.second}}};
}
for (const auto &j: storage)
{
UniValue e(UniValue::VOBJ);
e.pushKV(dev::toHex(dev::h256(j.second.first)), dev::toHex(dev::h256(j.second.second)));
result.push_back(Pair(j.first.hex(), e));
}
return result;
}
UniValue callcontract(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 2)
throw std::runtime_error(
"callcontract \"address\" \"data\" ( address )\n"
"\nArgument:\n"
"1. \"address\" (string, required) The account address\n"
"2. \"data\" (string, required) The data hex string\n"
"3. address (string, optional) The sender address hex string\n"
"4. gasLimit (numeric or string, optional) gasLimit, default: " +
i64tostr(DEFAULT_GAS_LIMIT_OP_SEND) + "\n");
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
LOCK(cs_main);
std::string strAddr = params[0].get_str();
std::string data = params[1].get_str();
if (!IsHex(data))
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid data (data not hex)");
if (strAddr.size() != 40 || !IsHex(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Incorrect address");
CBlockIndex * pBlockIndex = chainActive.Tip();
if (pBlockIndex->nHeight < Params().Contract_StartHeight())
throw JSONRPCError(RPC_INVALID_REQUEST, "contract not enabled.");
if (!AddressInUse(strAddr))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Address does not exist");
string sender = "";
if (params.size() == 3)
{
CBitcoinAddress btcSenderAddress(params[2].get_str());
if (btcSenderAddress.IsValid())
{
CKeyID keyid;
btcSenderAddress.GetKeyID(keyid);
sender = HexStr(valtype(keyid.begin(), keyid.end()));
} else
{
sender = params[2].get_str();
}
}
uint64_t gasLimit = 0;
if (params.size() == 4)
{
// gasLimit = params[3].get_int();
if (params[3].isNum())
{
gasLimit = params[3].get_int64();
} else if (params[3].isStr())
{
gasLimit = atoi64(params[3].get_str());
} else
{
throw JSONRPCError(RPC_TYPE_ERROR, "JSON value for gasLimit is not (numeric or string)");
}
}
UniValue result(UniValue::VOBJ);
result.push_back(Pair("address", strAddr));
RPCCallContract(result, strAddr, ParseHex(data), sender, gasLimit);
return result;
}
UniValue SimpleCallContract(const std::string& contractAddr, const std::string& function)
{
UniValue params(UniValue::VARR);
params.push_back(contractAddr);
params.push_back(function);
return callcontract(params,false);
}
uint256 GetOutputNumber(const std::string& outputStr)
{
if(outputStr.length()==64)
{
return uint256(outputStr);
}
return 0;
}
std::string GetOutputAddress(const std::string& outputStr)
{
if(outputStr.length()==64)
{
return outputStr.substr(24);
}
return 0;
}
std::string GetOutputString(const std::string& outputStr)
{
std::string result;
if(outputStr.length()==192)
{
char temp[65]={0};
const char *script = outputStr.c_str();
memcpy(temp, script, 64);
int aa;
sscanf(temp,"%x",&aa);
memcpy(temp, script+64, 64);
sscanf(temp,"%x",&aa);
memcpy(temp, script+128, 64);
int i=0;
int array[32];
while(i<aa)
{
char t[3] = {0};
memcpy(t, temp+i*2, 2);
int b = 0;
sscanf(t,"%x",&b);
result.push_back((char)b);
i++;
}
}
return result;
}
UniValue gettokeninfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1)
throw std::runtime_error(
"gettokeninfo \"address\"\n"
"\nArgument:\n"
"1. \"address\" (string, required) The ERC20(Token) contract address\n");
std::string contractAddr = params[0].get_str();
std::string fn_name("06fdde03");
std::string fn_totalSupply("18160ddd");
std::string fn_totalFee("1df4ccfc");
std::string fn_decimals("313ce567");
std::string fn_version("54fd4d50");
std::string fn_symbol("95d89b41");
std::string fn_owner("8da5cb5b");
UniValue callResult;
callResult = SimpleCallContract(contractAddr,fn_name);
std::string name = GetOutputString(callResult["executionResult"]["output"].get_str());
callResult = SimpleCallContract(contractAddr,fn_totalSupply);
int64_t totalSupply = GetOutputNumber(callResult["executionResult"]["output"].get_str()).Get64();
callResult = SimpleCallContract(contractAddr,fn_totalFee);
int64_t totalFee = GetOutputNumber(callResult["executionResult"]["output"].get_str()).Get64();
callResult = SimpleCallContract(contractAddr,fn_decimals);
int64_t decimals = GetOutputNumber(callResult["executionResult"]["output"].get_str()).Get64();
callResult = SimpleCallContract(contractAddr,fn_version);
std::string version = GetOutputString(callResult["executionResult"]["output"].get_str());
callResult = SimpleCallContract(contractAddr,fn_symbol);
std::string symbol = GetOutputString(callResult["executionResult"]["output"].get_str());
callResult = SimpleCallContract(contractAddr,fn_owner);
std::string owner = GetOutputAddress(callResult["executionResult"]["output"].get_str());
UniValue result(UniValue::VOBJ);
result.push_back(Pair("name",name));
result.push_back(Pair("totalSupply",totalSupply));
result.push_back(Pair("totalFee",totalFee));
result.push_back(Pair("decimals",decimals));
result.push_back(Pair("version",version));
result.push_back(Pair("symbol",symbol));
result.push_back(Pair("owner",owner));
return result;
}
void assignJSON(UniValue& entry, const TransactionReceiptInfo& resExec) {
entry.push_back(Pair("blockHash", resExec.blockHash.GetHex()));
entry.push_back(Pair("blockNumber", uint64_t(resExec.blockNumber)));
entry.push_back(Pair("transactionHash", resExec.transactionHash.GetHex()));
entry.push_back(Pair("transactionIndex", uint64_t(resExec.transactionIndex)));
entry.push_back(Pair("from", resExec.from.hex()));
entry.push_back(Pair("to", resExec.to.hex()));
entry.push_back(Pair("cumulativeGasUsed", CAmount(resExec.cumulativeGasUsed)));
entry.push_back(Pair("gasUsed", CAmount(resExec.gasUsed)));
entry.push_back(Pair("contractAddress", resExec.contractAddress.hex()));
std::stringstream ss;
ss << resExec.excepted;
entry.push_back(Pair("excepted",ss.str()));
}
void assignJSON(UniValue& logEntry, const dev::eth::LogEntry& log,
bool includeAddress) {
if (includeAddress) {
logEntry.push_back(Pair("address", log.address.hex()));
}
UniValue topics(UniValue::VARR);
for (dev::h256 hash : log.topics) {
topics.push_back(hash.hex());
}
logEntry.push_back(Pair("topics", topics));
logEntry.push_back(Pair("data", HexStr(log.data)));
}
void transactionReceiptInfoToJSON(const TransactionReceiptInfo& resExec, UniValue& entry) {
assignJSON(entry, resExec);
const auto& logs = resExec.logs;
UniValue logEntries(UniValue::VARR);
for(const auto&log : logs){
UniValue logEntry(UniValue::VOBJ);
assignJSON(logEntry, log, true);
logEntries.push_back(logEntry);
}
entry.push_back(Pair("log", logEntries));
}
//////-------gkc
size_t parseUInt(const UniValue &val, size_t defaultVal)
{
if (val.isNull())
{
return defaultVal;
} else
{
int n = -1;
if(val.isStr())
n = atoi(val.get_str().c_str());
else if(val.isNum())
n = val.get_int();
else
n = 0;
if (n < 0)
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Expects unsigned integer");
}
return n;
}
}
int parseInt(const UniValue &val, int defaultVal)
{
int n = defaultVal;
if(val.isNum())
n = val.get_int();
else if(val.isStr())
n = atoi(val.get_str().c_str());
return n;
}
bool parseBool(const UniValue &val, bool defaultVal)
{
bool b = defaultVal;
if(val.isBool())
b = val.get_bool();
else if(val.isStr())
b = (val.get_str() != "false" && val.get_str() != "0");
else if(val.isNum())
b = (val.get_int() != 0);
return b;
}
int parseBlockHeight(const UniValue &val)
{
if (val.isStr())
{
auto blockKey = val.get_str();
if (blockKey == "latest")
{
return chainActive.Height();;
} else
{
throw JSONRPCError(RPC_INVALID_PARAMS, "invalid block number");
}
}
if (val.isNum())
{
int blockHeight = val.get_int();
if (blockHeight < 0)
{
return chainActive.Height();;
}
return blockHeight;
}
throw JSONRPCError(RPC_INVALID_PARAMS, "invalid block number");
}
int parseBlockHeight(const UniValue &val, int defaultVal)
{
if (val.isNull())
{
return defaultVal;
} else
{
return parseBlockHeight(val);
}
}
dev::h160 parseParamH160(const UniValue &val)
{
if (!val.isStr())
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Invalid hex 160");
}
auto addrStr = val.get_str();
if (addrStr.length() != 40 || !IsHex(addrStr))
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Invalid hex 160 string");
}
return dev::h160(addrStr);
}
void parseParam(const UniValue &val, std::vector<dev::h160> &h160s)
{
if (val.isNull())
{
return;
}
// Treat a string as an array of length 1
if (val.isStr())
{
h160s.push_back(parseParamH160(val.get_str()));
return;
}
if (!val.isArray())
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Expect an array of hex 160 strings");
}
auto vals = val.getValues();
h160s.resize(vals.size());
std::transform(vals.begin(), vals.end(), h160s.begin(), [](UniValue val) -> dev::h160
{
return parseParamH160(val);
});
}
void parseParam(const UniValue &val, std::set<dev::h160> &h160s)
{
std::vector<dev::h160> v;
parseParam(val, v);
h160s.insert(v.begin(), v.end());
}
void parseParam(const UniValue &val, std::vector<boost::optional<dev::h256>> &h256s)
{
if (val.isNull())
{
return;
}
if (!val.isArray())
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Expect an array of hex 256 strings");
}
auto vals = val.getValues();
h256s.resize(vals.size());
std::transform(vals.begin(), vals.end(), h256s.begin(), [](UniValue val) -> boost::optional<dev::h256>
{
if (val.isNull())
{
return boost::optional<dev::h256>();
}
if (!val.isStr())
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Invalid hex 256 string");
}
auto addrStr = val.get_str();
if (addrStr.length() != 64 || !IsHex(addrStr))
{
throw JSONRPCError(RPC_INVALID_PARAMS, "Invalid hex 256 string");
}
return boost::optional<dev::h256>(dev::h256(addrStr));
});
}
class SearchLogsParams
{
public:
size_t fromBlock;
size_t toBlock;
size_t minconf;
std::set<dev::h160> addresses;
std::vector<boost::optional<dev::h256>> topics;
SearchLogsParams(const UniValue ¶ms)
{
// std::unique_lock<std::mutex> lock(cs_blockchange);
setFromBlock(params[0]);
setToBlock(params[1]);
parseParam(params[2]["addresses"], addresses);
parseParam(params[3]["topics"], topics);
minconf = parseUInt(params[4], 0);
}
private:
void setFromBlock(const UniValue &val)
{
if (!val.isNull())
{
fromBlock = parseBlockHeight(val);
} else
{
fromBlock = chainActive.Height();;
}
}
void setToBlock(const UniValue &val)
{
if (!val.isNull())
{
toBlock = parseBlockHeight(val);
} else
{
toBlock = chainActive.Height();;
}
}
};
/// ----------gkc
UniValue searchlogs(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 8)
throw std::runtime_error(
"searchlogs <fromBlock> <toBlock> (address) (topics)\n"
"requires -logevents to be enabled"
"\nArgument:\n"
"1. \"fromBlock\" (numeric, required) The number of the earliest block (latest may be given to mean the most recent block).\n"
"2. \"toBlock\" (string, required) The number of the latest block (-1 may be given to mean the most recent block).\n"
"3. \"address\" (string, optional) An address or a list of addresses to only get logs from particular account(s).\n"
"4. \"topics\" (string, optional) An array of values from which at least one must appear in the log entries. The order is important, if you want to leave topics out use null, e.g. [\"null\", \"0x00...\"]. \n"
"5. \"minconf\" (uint, optional, default=0) Minimal number of confirmations before a log is returned\n"
"6. \"reverseOrder\" (bool, optional, default=\"false\") \n"
"7. \"offset\" (numeric, optional, default=0) \n"
"8. \"count\" (numeric, optional, default=-1) \n"
"\nExamples:\n"
+ HelpExampleCli("searchlogs",
"0 100 '{\"addresses\": [\"12ae42729af478ca92c8c66773a3e32115717be4\"]}' '{\"topics\": [\"null\",\"b436c2bf863ccd7b8f63171201efd4792066b4ce8e543dde9c3e9e9ab98e216c\"]}'")
+ HelpExampleRpc("searchlogs",
"0 100 {\"addresses\": [\"12ae42729af478ca92c8c66773a3e32115717be4\"]} {\"topics\": [\"null\",\"b436c2bf863ccd7b8f63171201efd4792066b4ce8e543dde9c3e9e9ab98e216c\"]}"));
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
if (!fLogEvents)
throw JSONRPCError(RPC_INTERNAL_ERROR, "Events indexing disabled");
int curheight = 0;
LOCK(cs_main);
SearchLogsParams params_(params);
bool reverseOrder = parseBool(params[5],false);
int offset = parseInt(params[6],0);
int count = parseInt(params[7],-1);
std::vector<std::vector<uint256>> hashesToBlock;
curheight = pblocktree->ReadHeightIndex(params_.fromBlock, params_.toBlock, params_.minconf,
hashesToBlock,
params_.addresses);
if (curheight == -1)
{
throw JSONRPCError(RPC_INVALID_PARAMETER, "Incorrect params");
}
UniValue result(UniValue::VARR);
auto topics = params_.topics;
if(reverseOrder)
std::reverse(hashesToBlock.begin(),hashesToBlock.end());
int index = 0;
bool fEnd = false;
for (auto &hashesTx : hashesToBlock)
{
if(reverseOrder)
std::reverse(hashesTx.begin(),hashesTx.end());
for (const auto &e : hashesTx)
{
std::vector<TransactionReceiptInfo> receipts = GetResult(e);
for (const auto &receipt : receipts)
{
if (receipt.logs.empty())
{
continue;
}
if (!topics.empty())
{
for (size_t i = 0; i < topics.size(); i++)
{
const auto &tc = topics[i];
if (!tc)
{
continue;
}
for (const auto &log: receipt.logs)
{
auto filterTopicContent = tc.get();
if (i >= log.topics.size())
{
continue;
}
if (filterTopicContent == log.topics[i])
{
goto push;
}
}
}
// Skip the log if none of the topics are matched
continue;
}
push:
if(index < offset){
index++;
continue;
}
UniValue tri(UniValue::VOBJ);
transactionReceiptInfoToJSON(receipt, tri);
result.push_back(tri);
index++;
if(count > -1 && index >= offset+count)
fEnd = true;
if(fEnd)
break;
}
if(fEnd)
break;
}
if(fEnd)
break;
}
return result;
}
UniValue gettransactionreceipt(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() < 1)
throw std::runtime_error(
"gettransactionreceipt \"hash\"\n"
"requires -logevents to be enabled"
"\nArgument:\n"
"1. \"hash\" (string, required) The transaction hash\n");
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
if (!fLogEvents)
throw JSONRPCError(RPC_INTERNAL_ERROR, "Events indexing disabled");
LOCK(cs_main);
std::string hashTemp = params[0].get_str();
if (hashTemp.size() != 64)
{
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Incorrect hash");
}
uint256 hash(uint256S(hashTemp));
std::vector<TransactionReceiptInfo> transactionReceiptInfo = GetResult(hash);
UniValue result(UniValue::VARR);
for (TransactionReceiptInfo &t : transactionReceiptInfo)
{
UniValue tri(UniValue::VOBJ);
transactionReceiptInfoToJSON(t, tri);
result.push_back(tri);
}
return result;
}
UniValue listcontracts(const UniValue& params, bool fHelp)
{
if (fHelp)
throw std::runtime_error(
"listcontracts (start maxDisplay)\n"
"\nArgument:\n"
"1. start (numeric or string, optional) The starting account index, default 1\n"
"2. maxDisplay (numeric or string, optional) Max accounts to list, default 20\n");
bool IsEnabled = (chainActive.Tip()->nVersion > ZEROCOIN_VERSION);
if (!IsEnabled)
throw JSONRPCError(RPC_INTERNAL_ERROR, "not arrive to the contract height,disabled");
LOCK(cs_main);
int start = 1;
if (params.size() > 0)
{
start = params[0].get_int();
if (start <= 0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid start, min=1");
}
int maxDisplay = 20;
if (params.size() > 1)
{
maxDisplay = params[1].get_int();
if (maxDisplay <= 0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid maxDisplay");
}
UniValue result(UniValue::VOBJ);
std::unordered_map<dev::h160, dev::u256> map = GetContractList();
int contractsCount = (int)map.size();
if (contractsCount > 0 && start > contractsCount)
throw JSONRPCError(RPC_TYPE_ERROR, "start greater than max index " + itostr(contractsCount));
int itStartPos = std::min(start - 1, contractsCount);
int i = 0;
for (auto it = std::next(map.begin(), itStartPos); it != map.end(); it++)
{
CAmount balance = GetContractBalance(it->first);
result.push_back(Pair(it->first.hex(), ValueFromAmount(balance)));
i++;
if (i == maxDisplay)
break;
}
return result;
}
///////////////////////////////////////////////////////
UniValue getblockchaininfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getblockchaininfo\n"
"Returns an object containing various state info regarding block chain processing.\n"
"\nResult:\n"
"{\n"
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
" \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n"
" \"bestblockhash\": \"...\", (string) the hash of the currently best block\n"
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
"}\n"
"\nExamples:\n" +
HelpExampleCli("getblockchaininfo", "") + HelpExampleRpc("getblockchaininfo", ""));
UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("chain", Params().NetworkIDString()));
obj.push_back(Pair("blocks", (int)chainActive.Height()));
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1));
obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex()));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip())));
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
return obj;
}
/** Comparison function for sorting the getchaintips heads. */
struct CompareBlocksByHeight {
bool operator()(const CBlockIndex* a, const CBlockIndex* b) const
{
/* Make sure that unequal blocks with the same height do not compare
equal. Use the pointers themselves to make a distinction. */
if (a->nHeight != b->nHeight)
return (a->nHeight > b->nHeight);
return a < b;
}
};
UniValue getchaintips(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getchaintips\n"
"Return information about all known tips in the block tree,"
" including the main chain as well as orphaned branches.\n"
"\nResult:\n"
"[\n"
" {\n"
" \"height\": xxxx, (numeric) height of the chain tip\n"
" \"hash\": \"xxxx\", (string) block hash of the tip\n"
" \"branchlen\": 0 (numeric) zero for main chain\n"
" \"status\": \"active\" (string) \"active\" for the main chain\n"
" },\n"
" {\n"
" \"height\": xxxx,\n"
" \"hash\": \"xxxx\",\n"
" \"branchlen\": 1 (numeric) length of branch connecting the tip to the main chain\n"
" \"status\": \"xxxx\" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)\n"
" }\n"
"]\n"
"Possible values for status:\n"
"1. \"invalid\" This branch contains at least one invalid block\n"
"2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n"
"3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n"
"4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n"
"5. \"active\" This is the tip of the active main chain, which is certainly valid\n"
"\nExamples:\n" +
HelpExampleCli("getchaintips", "") + HelpExampleRpc("getchaintips", ""));
/* Build up a list of chain tips. We start with the list of all
known blocks, and successively remove blocks that appear as pprev
of another block. */
std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;
BOOST_FOREACH (const PAIRTYPE(const uint256, CBlockIndex*) & item, mapBlockIndex)
setTips.insert(item.second);
BOOST_FOREACH (const PAIRTYPE(const uint256, CBlockIndex*) & item, mapBlockIndex) {
const CBlockIndex* pprev = item.second->pprev;
if (pprev)
setTips.erase(pprev);
}
// Always report the currently active tip.
setTips.insert(chainActive.Tip());
/* Construct the output array. */
UniValue res(UniValue::VARR);
BOOST_FOREACH (const CBlockIndex* block, setTips) {
UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("height", block->nHeight));
obj.push_back(Pair("hash", block->phashBlock->GetHex()));
const int branchLen = block->nHeight - chainActive.FindFork(block)->nHeight;
obj.push_back(Pair("branchlen", branchLen));
string status;
if (chainActive.Contains(block)) {
// This block is part of the currently active chain.
status = "active";
} else if (block->nStatus & BLOCK_FAILED_MASK) {
// This block or one of its ancestors is invalid.
status = "invalid";
} else if (block->nChainTx == 0) {
// This block cannot be connected because full block data for it or one of its parents is missing.
status = "headers-only";
} else if (block->IsValid(BLOCK_VALID_SCRIPTS)) {
// This block is fully validated, but no longer part of the active chain. It was probably the active block once, but was reorganized.
status = "valid-fork";
} else if (block->IsValid(BLOCK_VALID_TREE)) {
// The headers for this block are valid, but it has not been validated. It was probably never part of the most-work chain.
status = "valid-headers";
} else {
// No clue.
status = "unknown";
}
obj.push_back(Pair("status", status));
res.push_back(obj);
}
return res;
}
UniValue getfeeinfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getfeeinfo blocks\n"
"\nReturns details of transaction fees over the last n blocks.\n"
"\nArguments:\n"
"1. blocks (int, required) the number of blocks to get transaction data from\n"
"\nResult:\n"
"{\n"
" \"txcount\": xxxxx (numeric) Current tx count\n"
" \"txbytes\": xxxxx (numeric) Sum of all tx sizes\n"
" \"ttlfee\": xxxxx (numeric) Sum of all fees\n"
" \"feeperkb\": xxxxx (numeric) Average fee per kb over the block range\n"
" \"rec_highpriorityfee_perkb\": xxxxx (numeric) Recommended fee per kb to use for a high priority tx\n"
"}\n"
"\nExamples:\n" +
HelpExampleCli("getfeeinfo", "5") + HelpExampleRpc("getfeeinfo", "5"));
int nBlocks = params[0].get_int();
int nBestHeight = chainActive.Height();
int nStartHeight = nBestHeight - nBlocks;
if (nBlocks < 0 || nStartHeight <= 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "invalid start height");
CAmount nFees = 0;
int64_t nBytes = 0;
int64_t nTotal = 0;
for (int i = nStartHeight; i <= nBestHeight; i++) {
CBlockIndex* pindex = chainActive[i];
CBlock block;
if (!ReadBlockFromDisk(block, pindex))
throw JSONRPCError(RPC_DATABASE_ERROR, "failed to read block from disk");
CAmount nValueIn = 0;
CAmount nValueOut = 0;
for (const CTransaction& tx : block.vtx) {
if (tx.IsCoinBase() || tx.IsCoinStake())
continue;
for (unsigned int j = 0; j < tx.vin.size(); j++) {
if (tx.vin[j].scriptSig.IsZerocoinSpend()) {
nValueIn += tx.vin[j].nSequence * COIN;
continue;
}
COutPoint prevout = tx.vin[j].prevout;
CTransaction txPrev;
uint256 hashBlock;
if(!GetTransaction(prevout.hash, txPrev, hashBlock, true))
throw JSONRPCError(RPC_DATABASE_ERROR, "failed to read tx from disk");
nValueIn += txPrev.vout[prevout.n].nValue;
}
for (unsigned int j = 0; j < tx.vout.size(); j++) {
nValueOut += tx.vout[j].nValue;
}
nFees += nValueIn - nValueOut;
nBytes += tx.GetSerializeSize(SER_NETWORK, CLIENT_VERSION);
nTotal++;
}
pindex = chainActive.Next(pindex);
if (!pindex)
break;
}
UniValue ret(UniValue::VOBJ);
CFeeRate nFeeRate = CFeeRate(nFees, nBytes);
ret.push_back(Pair("txcount", (int64_t)nTotal));
ret.push_back(Pair("txbytes", (int64_t)nBytes));
ret.push_back(Pair("ttlfee", FormatMoney(nFees)));
ret.push_back(Pair("feeperkb", FormatMoney(nFeeRate.GetFeePerK())));
ret.push_back(Pair("rec_highpriorityfee_perkb", FormatMoney(nFeeRate.GetFeePerK() + 1000)));
return ret;
}
UniValue getmempoolinfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getmempoolinfo\n"
"\nReturns details on the active state of the TX memory pool.\n"
"\nResult:\n"
"{\n"
" \"size\": xxxxx (numeric) Current tx count\n"
" \"bytes\": xxxxx (numeric) Sum of all tx sizes\n"
"}\n"
"\nExamples:\n" +
HelpExampleCli("getmempoolinfo", "") + HelpExampleRpc("getmempoolinfo", ""));
UniValue ret(UniValue::VOBJ);
ret.push_back(Pair("size", (int64_t)mempool.size()));
ret.push_back(Pair("bytes", (int64_t)mempool.GetTotalTxSize()));
return ret;
}
UniValue hashstateandutxo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"hashstateandutxo \n"
"\nShows globalState hashstate and hashutxo.\n"
"\nArguments:\n"
"\nResult:\n"
"\nExamples:\n" +
HelpExampleCli("hashstateandutxo","") + HelpExampleRpc("hashstateandutxo",""));
UniValue hashstateandutxo(UniValue::VARR);
{
LOCK(cs_main);
uint256 hashStateRoot, hashUTXORoot;
hashStateRoot.SetNull();
hashUTXORoot.SetNull();
GetState(hashStateRoot,hashUTXORoot);
UniValue state_obj(UniValue::VOBJ);
UniValue utxo_obj(UniValue::VOBJ);
state_obj.push_back(Pair("state", hashStateRoot.GetHex()));
utxo_obj.push_back(Pair("utxo",hashUTXORoot.GetHex() ));
hashstateandutxo.push_back(state_obj);
hashstateandutxo.push_back(utxo_obj);
}
return hashstateandutxo;
}
UniValue invalidateblock(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"invalidateblock \"hash\"\n"
"\nPermanently marks a block as invalid, as if it violated a consensus rule.\n"
"\nArguments:\n"
"1. hash (string, required) the hash of the block to mark as invalid\n"
"\nResult:\n"
"\nExamples:\n" +
HelpExampleCli("invalidateblock", "\"blockhash\"") + HelpExampleRpc("invalidateblock", "\"blockhash\""));
std::string strHash = params[0].get_str();
uint256 hash(strHash);
CValidationState state;
{
LOCK(cs_main);
if (mapBlockIndex.count(hash) == 0)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
CBlockIndex* pblockindex = mapBlockIndex[hash];
InvalidateBlock(state, pblockindex);
}
if (state.IsValid()) {
ActivateBestChain(state);
}
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());
}
return NullUniValue;
}
UniValue reconsiderblock(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"reconsiderblock \"hash\"\n"
"\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\n"
"This can be used to undo the effects of invalidateblock.\n"
"\nArguments:\n"
"1. hash (string, required) the hash of the block to reconsider\n"
"\nResult:\n"
"\nExamples:\n" +
HelpExampleCli("reconsiderblock", "\"blockhash\"") + HelpExampleRpc("reconsiderblock", "\"blockhash\""));
std::string strHash = params[0].get_str();
uint256 hash(strHash);
CValidationState state;
{
LOCK(cs_main);
if (mapBlockIndex.count(hash) == 0)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
CBlockIndex* pblockindex = mapBlockIndex[hash];
ReconsiderBlock(state, pblockindex);
}
if (state.IsValid()) {
ActivateBestChain(state);
}
if (!state.IsValid()) {
throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());
}
return NullUniValue;
}
UniValue getinvalid (const UniValue& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getinvalid \n"
"\nGet a summary of invalidated outpoints.\n"
"\nArguments:\n"
"1. all (string, optional) return a full list of outpoints even if they are spent\n"
"\nExamples:\n" +
HelpExampleCli("getinvalid", "\"all\"") + HelpExampleRpc("getinvalid", "\"all\""));
string strCommand;
if (params.size() == 1){
strCommand = params[0].get_str();
}
if (strCommand == "serials") {
UniValue ret(UniValue::VARR);
CAmount nSerialTotal = 0;
for (auto it : mapInvalidSerials) {
UniValue objSerial(UniValue::VOBJ);
objSerial.push_back(Pair(it.first.GetHex(), FormatMoney(it.second)));
nSerialTotal += it.second;
ret.push_back(objSerial);
}
UniValue objTotal(UniValue::VOBJ);
objTotal.push_back(Pair("total_value", FormatMoney(nSerialTotal)));
ret.push_back(objTotal);
return ret;
}
bool fShowAll = false;
if (strCommand == "all")
fShowAll = true;
CAmount nUnspent = 0;
CAmount nMint = 0;
CAmount nMixedValid = 0;
map<CBitcoinAddress, CAmount> mapBanAddress;
map<COutPoint, int> mapMixedValid;
UniValue ret(UniValue::VARR);
for (auto it : mapInvalidOutPoints) {
COutPoint out = it.first;
//Get the tx that the outpoint is from
CTransaction tx;
uint256 hashBlock;
if (!GetTransaction(out.hash, tx, hashBlock, true)) {
continue;
}
UniValue objTx(UniValue::VOBJ);
objTx.push_back(Pair("inv_out", it.first.ToString()));
CAmount nValue = tx.vout[out.n].nValue;
objTx.push_back(Pair("value", FormatMoney(nValue)));
//Search the txin's to see if any of them are "valid".
UniValue objMixedValid(UniValue::VOBJ);
//if some of the other inputs are valid
for(CTxIn in2 : tx.vin) {
//See if this is already accounted for
if(mapInvalidOutPoints.count(in2.prevout) || mapMixedValid.count(in2.prevout))
continue;
CTransaction txPrev;
uint256 hashBlock;
if(!GetTransaction(in2.prevout.hash, txPrev, hashBlock, true))
continue;
//This is a valid outpoint that mixed with an invalid outpoint. Investigate this person.
//Information leakage, not covering their tracks well enough
CAmount nValid = txPrev.vout[in2.prevout.n].nValue;
objMixedValid.push_back(Pair(FormatMoney(nValid), in2.prevout.ToString()));
nMixedValid += nValid;
mapMixedValid[in2.prevout] = 1;
}
//Check whether this bad outpoint has been spent
bool fSpent = false;
CCoinsViewCache cache(pcoinsTip);
const CCoins* coins = cache.AccessCoins(out.hash);
if (!coins || !coins->IsAvailable(out.n))
fSpent = true;
objTx.push_back(Pair("spent", fSpent));
if (!objMixedValid.empty())
objTx.push_back(Pair("mixed_with_valid", objMixedValid));
CScript scriptPubKey = tx.vout[out.n].scriptPubKey;
if (scriptPubKey.IsZerocoinMint()) {
nMint += nValue;
} else if (!fSpent) {
CTxDestination dest;
if (!ExtractDestination(scriptPubKey, dest)) {
continue;
}
CBitcoinAddress address(dest);
mapBanAddress[address] += nValue;
nUnspent += nValue;
}
if (fSpent && !fShowAll)
continue;
ret.push_back(objTx);
}
UniValue objAddresses(UniValue::VOBJ);
for (auto it : mapBanAddress)
objAddresses.push_back(Pair(it.first.ToString(), FormatMoney(it.second)));
UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("addresses_with_invalid", objAddresses));
obj.push_back(Pair("total_unspent", FormatMoney(nUnspent)));
obj.push_back(Pair("total_minted", FormatMoney(nMint)));
obj.push_back(Pair("total_valid_used", FormatMoney(nMixedValid)));
ret.push_back(obj);
return ret;
}
UniValue findserial(const UniValue& params, bool fHelp)
{
if(fHelp || params.size() != 1)
throw runtime_error(
"findserial \"serial\"\n"
"\nSearches the zerocoin database for a zerocoin spend transaction that contains the specified serial\n"
"\nArguments:\n"
"1. serial (string, required) the serial of a zerocoin spend to search for.\n"
"\nResult:\n"
"{\n"
" \"success\": true/false (boolean) Whether the serial was found\n"
" \"txid\": xxxxx (numeric) The transaction that contains the spent serial\n"
"}\n"
"\nExamples:\n" +
HelpExampleCli("findserial", "\"serial\"") + HelpExampleRpc("findserial", "\"serial\""));
std::string strSerial = params[0].get_str();
CBigNum bnSerial = 0;
bnSerial.SetHex(strSerial);
if (!bnSerial)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid serial");
uint256 txid = 0;
bool fSuccess = zerocoinDB->ReadCoinSpend(bnSerial, txid);
UniValue ret(UniValue::VOBJ);
ret.push_back(Pair("success", fSuccess));
ret.push_back(Pair("txid", txid.GetHex()));
return ret;
}
| [
"gkcproject@hotmail.com"
] | gkcproject@hotmail.com |
4730565361c0a63332b2e6631a3b07c649704f77 | c07cffaef958b70eded200b217e59ca2a3a815ac | /src/Vortex/Vortex.cpp | 883551ea94bdd60e559b9bfa4401ae3b9f8a0131 | [] | no_license | PietjeBell88/Vortex3D | a15eb97f7fe4e6ca27e7ddde75d9e8e69c1363ac | 5d45dec615be5a4eb894db0b5db795a6557bbc51 | refs/heads/master | 2021-01-20T00:50:29.745426 | 2009-11-29T15:17:22 | 2009-11-29T15:17:22 | 442,764 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,063 | cpp | // Copyright (c) 2009, Pietje Bell <pietjebell@ana-chan.com>
// 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 Pietje Bell Group nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
///////////
// Headers
#include "Vortex.h"
/////////////
// Namespace
using std::string;
using blitz::TinyMatrix;
///////////////
// Constructor
Vortex::Vortex( const Vortex3dParam ¶m )
{
this->radius = param.radius;
this->velocity = param.velocity;
this->angle = param.angle;
this->fl_mu = param.fl_mu;
this->fl_density = param.fl_density;
this->fl_nu = param.fl_nu;
this->interpolate = param.interpolate;
this->rotategrav = param.rotategrav;
this->grid = param.roi_grid;
this->delimiter = param.roi_delimiter;
this->dx = param.roi_dx;
this->dy = param.roi_dy;
this->dz = param.roi_dz;
}
//////////////
// Destructor
Vortex::~Vortex() {}
////////////////////////////
// Initialize Interpolation
// Can't do interpolation initialization in the constructor, results in pure function call.
// As MSDN says: "Do not call overridable methods in constructors".
void Vortex::initInterpolate()
{
v.resize( grid(0), grid(1), grid(2) );
accelfluid.resize( grid(0), grid(1), grid(2) );
SetupVortexGrid( &v, &accelfluid );
}
////////////////////
// Public Functions
bool Vortex::outsideBox( const Vector3d &pos )
{
if ( pos(0) <= delimiter(0, 0) || pos(0) > delimiter(0, 1) ||
pos(1) <= delimiter(1, 0) || pos(1) > delimiter(1, 1) ||
pos(2) <= delimiter(2, 0) || pos(2) > delimiter(2, 1) )
{
return true;
}
return false;
}
Vector3d Vortex::getDuDtAt( const Vector3d &pos )
{
if ( interpolate == true )
return Interpolate3DCube( accelfluid, pos );
else
return dudtAngle( pos );
}
Vector3d Vortex::getVelocityAt( const Vector3d &pos )
{
if ( interpolate == true )
return Interpolate3DCube( v, pos );
else
return velocityAngle( pos );
}
VectorField Vortex::getVectorField()
{
return v;
}
///////////////////////////////////////////////////////////////////
// Transformation matrix from [v_r, v_phi, v_z] to [v_x, v_y, v_z]
TinyMatrix<double, 3, 3> Vortex::cil2Cart( double phi )
{
TinyMatrix<double, 3, 3> M;
M = cos(phi), -sin(phi), 0,
sin(phi), cos(phi), 0,
0, 0, 1;
return M;
}
//////////////////////////////////////////////////////////////////////////////////////
// Rotation matrix for rotation around the x axis ("folding the y-axis to the z-axis")
TinyMatrix<double, 3, 3> Vortex::rotate_x( double angle )
{
TinyMatrix<double, 3, 3> M;
M = 1, 0, 0,
0, cos(angle), -sin(angle),
0, sin(angle), cos(angle);
return M;
}
///////////////////
// Interpolation
Vector3d Vortex::Interpolate3DCube( const VectorField &v, const Vector3d &pos )
{
/*
This function interpolates the velocity in matrix U to the position of a particle at P.
It does this by interpolating linearly by assigning weights to each corner of the surrounding box.
This function requires uniform gridspacing.
*/
/*
Start by finding the lower index values of the box surrounding the particle.
Of course, this step requires that the size of the index does not exceed the integer gridRange.
*/
int i = static_cast<int> (floor((pos(0) - delimiter(0, 0)) / dx));
int j = static_cast<int> (floor((pos(1) - delimiter(1, 0)) / dy));
int k = static_cast<int> (floor((pos(2) - delimiter(2, 0)) / dz));
/*
* Calculate the weighting factors for each corner of the box
* Note: 0 <= x < 1 (and same for y and z)
* Because the position of the particle can be negative, make it positive first
* and then do a modulo. Doing modulo on a negavite value can be confusing and inconsistent.
*/
double x = fmod(pos(0) - delimiter(0, 0), dx) / dx;
double y = fmod(pos(1) - delimiter(1, 0), dy) / dy;
double z = fmod(pos(2) - delimiter(2, 0), dz) / dz;
//Do a weighted addition of all the corners of the cube surrounding the particle.
//Please note that v(i,j,k) is indeed a Vector3d
return v(i, j, k) * (1 - x) * (1 - y) * (1 - z) + v(i + 1, j, k) * x * (1
- y) * (1 - z) + v(i, j + 1, k) * (1 - x) * y * (1 - z) + v(i, j, k
+ 1) * (1 - x) * (1 - y) * z + v(i + 1, j, k + 1) * x * (1 - y) * z
+ v(i, j + 1, k + 1) * (1 - x) * y * z + v(i + 1, j + 1, k) * x * y
* (1 - z) + v(i + 1, j + 1, k + 1) * x * y * z;
}
////////////////////////////////////////
// Vortex Velocity and Du/Dt Getters
Vector3d Vortex::velocityCarthesian( const Vector3d &pos )
{
const double &x = pos(0);
const double &y = pos(1);
const double &z = pos(2);
double r = sqrt( x * x + y * y );
double phi = atan2( y, x );
return product( cil2Cart( phi ), velocityCylinder( r, phi, z ) );
}
Vector3d Vortex::dudtCarthesian( const Vector3d &pos )
{
const double &x = pos(0);
const double &y = pos(1);
const double &z = pos(2);
double r = sqrt( x * x + y * y );
double phi = atan2( y, x );
return product( cil2Cart( phi ), dudtCylinder( r, phi, z ) );
}
Vector3d Vortex::velocityAngle( const Vector3d &pos )
{
if (rotategrav)
return velocityCarthesian( pos );
else
return product( rotate_x( angle ), velocityCarthesian( product( rotate_x( -angle ), pos ) ) );
}
Vector3d Vortex::dudtAngle( const Vector3d &pos )
{
if (rotategrav)
return dudtCarthesian( pos );
else
return product( rotate_x( angle ), dudtCarthesian( product( rotate_x( -angle ), pos ) ) );
}
//////////////////////////
// Initialize Vortex Grid
void Vortex::SetupVortexGrid(VectorField *v, VectorField *accelfluid)
{
#pragma omp parallel for
for ( int i = 0; i < grid(0); i++ )
{
// What x-coordinate are we at?
double x = delimiter(0, 0) + i * dx;
for ( int j = 0; j < grid(1); j++ )
{
// What y-coordinate are we at?
double y = delimiter(1, 0) + j * dy;
for ( int k = 0; k < grid(2); k++ )
{
// What z-coordinate are we at?
double z = delimiter(2, 0) + k * dz;
// Calculate and set the velocities for each direction in the VectorField
// Of course you can't have a negative index, so save each at their index+1
(*v)(i, j, k) = velocityAngle( Vector3d( x, y, z ) );
(*accelfluid)(i, j, k) = dudtAngle( Vector3d( x, y, z ) );
}
}
}
}
| [
"pietjebell@ana-chan.com"
] | pietjebell@ana-chan.com |
59c5209e856baf961ef114ba7b884f59206872e8 | 9f16ceb7f674234889f796a5b99d342f9edf3399 | /sldWindowMax.cpp | ccb89f2ffaae9b47d1c5a8d09d4f14df8cd5ccf7 | [] | no_license | Segfred/leetcode | 382297025b790790a38f079d5938e158c3bd8260 | b102c4d9abea9caad0b08b7df0d9e89bc6dbc115 | refs/heads/master | 2021-06-11T05:10:21.853331 | 2021-04-03T02:42:59 | 2021-04-03T02:42:59 | 87,050,255 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,239 | cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
if(nums.size()<k) return {};
vector<int> res{};
deque<int> deq{};
for(int i=0;i<(int)nums.size();++i){
if(!deq.empty()&&deq.back()==i-k) deq.pop_back();//也可以先判断是否窗口满了,这样不会超过size,并且更快
while(!deq.empty()&&nums[i]>=nums[deq.front()]) deq.pop_front();//是和nums[front]比较,不是和front比较,注意存的是下标!
deq.emplace_front(i);//存的是下标,不是数本身,先存入新数,再判断窗口是否满了
if(i>=k-1) res.emplace_back(nums[deq.back()]);//存到结果的是nums[]下标,不是下标
}
return res;
}
};
class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
if(nums.size()<k) return {};
vector<int> res{};
deque<int> deq{};//decreasing deque to save the index
int i=0;
while(i<(int)nums.size()){
while(!deq.empty()&&nums[i]>nums[deq.front()]) deq.pop_front();//在删掉我之前,我的潜力最大
deq.push_front(i);
if(i++>=k-1) res.push_back(nums[deq.back()]);//maximum is on the bottom,只是加1还没参与计算,deq元素个数所以不会超
if(deq.back()==i-k) deq.pop_back();
}
return res;
}
};
| [
"noreply@github.com"
] | noreply@github.com |
ad6445721e232339a226acb1760589b09bb85723 | 8f794474974201d465308793f12a84bf8aa6cd07 | /Laba6/C.cpp | 23cc4501f0120c9224d5d71d2d1dc02238b504a9 | [] | no_license | ilyaShevchuk/-Algorithms-and-data-structures | 17731300c639268a50392236028eeacc598caf39 | 2eea40624f6d904d1c70e2d3babd7ae1ac902327 | refs/heads/main | 2023-02-18T06:26:46.916188 | 2021-01-21T12:33:47 | 2021-01-21T12:33:47 | 331,571,313 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,464 | cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
class Tree {
public:
struct Node {
int value;
Node *left = nullptr;
Node *right = nullptr;
Node(int value) : value{value}, left{nullptr}, right{nullptr} {}
};
Node *root = nullptr;
int next(Node *New_Node, int key, Node *result) {
if (New_Node == nullptr)
return result->value;
if (New_Node->value <= key) {
next(New_Node->right, key, result);
} else {
result->value = New_Node->value;
next(New_Node->left, key, result);
}
return (result->value);
}
int prev(Node *New_Node, int key, Node *result) {
if (New_Node == nullptr)
return result->value;
if (New_Node->value >= key) {
prev(New_Node->left, key, result);
} else {
result->value = New_Node->value;
prev(New_Node->right, key, result);
}
return (result->value);
}
string exists(int key) {
if(this->root == nullptr)
return "false";
Node* New_Node = this->root;
while (New_Node != nullptr){
if(New_Node->value == key)
return "true";
if(key < New_Node->value)
New_Node = New_Node->left;
else
New_Node = New_Node->right;
}
return "false";
}
void insert(int key) {
Node *New_Node = this->root;
if (New_Node == nullptr) {
this->root = new Node(key);
} else {
while (true) {
if (New_Node->value == key) return;
if (key < New_Node->value) {
if (New_Node->left == nullptr) {
New_Node->left = new Node(key);
return;
} else
New_Node = New_Node->left;
} else {
if (New_Node->right == nullptr) {
New_Node->right = new Node(key);
return;
} else
New_Node = New_Node->right;
}
}
}
}
void remove(int key) {
if(this->root == nullptr)
return;
Node *New_Node = root, *parent = nullptr;
while (New_Node != nullptr){
if(New_Node->value == key)
break;
parent = New_Node;
if(key < New_Node->value)
New_Node = New_Node->left;
else
New_Node = New_Node->right;
}
if(New_Node == nullptr)
return;
if(New_Node->right == nullptr){
if(parent == nullptr)
root = New_Node->left;
else
if(New_Node == parent->left)
parent->left = New_Node->left;
else
parent->right = New_Node->left;
} else {
Node *mostLeft = New_Node->right;
parent = nullptr;
while (mostLeft->left != nullptr) {
parent = mostLeft;
mostLeft = mostLeft->left;
}
if(parent != nullptr)
parent->left = mostLeft->right;
else
New_Node->right = mostLeft->right;
New_Node->value = mostLeft->value;
}
}
};
int main() {
ifstream fin("bstsimple.in");
ofstream fout("bstsimple.out");
Tree Wood;
string comm;
int key, x;
while (fin >> comm >> key) {
if (comm == "insert") {
Wood.insert(key);
} else if (comm == "delete") {
Wood.remove(key);
} else if (comm == "exists") {
auto res = Wood.exists(key);
fout << res << endl;
} else if (comm == "next") {
auto result = new Tree::Node(key);
int m = Wood.next(Wood.root, key, result);
if (m != key) {
fout << m << endl;
} else {
fout << "none" << endl;
}
} else if (comm == "prev") {
auto result = new Tree::Node(key);
int m = Wood.prev(Wood.root, key, result);
if (m != key) {
fout << m << endl;
} else {
fout << "none" << endl;
}
}
}
} | [
"noreply@github.com"
] | noreply@github.com |
1bb20dcf55de51edc0632f7053f57a32ffb2acba | be91c8c7034dad2d79ae05a9baa970d13b521149 | /1018.binary-prefix-divisible-by-5.cpp | 23efc5630625c194b9f9cc06d59f8c9696ad18ad | [] | no_license | miaodi/leetcode_practice | 83ef8faec24c3a88c267498303264664cfe8789d | bd3cac5187b99875d3d0a971b2c13b8cfc7bf25c | refs/heads/master | 2020-04-24T17:55:32.404699 | 2019-09-14T17:35:38 | 2019-09-14T17:35:38 | 172,163,177 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,555 | cpp | /*
* @lc app=leetcode id=1018 lang=cpp
*
* [1018] Binary Prefix Divisible By 5
*
* https://leetcode.com/problems/binary-prefix-divisible-by-5/description/
*
* algorithms
* Easy (43.89%)
* Total Accepted: 5.4K
* Total Submissions: 12.2K
* Testcase Example: '[0,1,1]'
*
* Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to
* A[i] interpreted as a binary number (from most-significant-bit to
* least-significant-bit.)
*
* Return a list of booleans answer, where answer[i] is true if and only if N_i
* is divisible by 5.
*
* Example 1:
*
*
* Input: [0,1,1]
* Output: [true,false,false]
* Explanation:
* The input numbers in binary are 0, 01, 011; which are 0, 1, and 3 in
* base-10. Only the first number is divisible by 5, so answer[0] is true.
*
*
* Example 2:
*
*
* Input: [1,1,1]
* Output: [false,false,false]
*
*
* Example 3:
*
*
* Input: [0,1,1,1,1,1]
* Output: [true,false,false,false,true,false]
*
*
* Example 4:
*
*
* Input: [1,1,1,0,1]
* Output: [false,false,false,false,false]
*
*
*
*
* Note:
*
*
* 1 <= A.length <= 30000
* A[i] is 0 or 1
*
*/
class Solution {
public:
vector<bool> prefixesDivBy5(vector<int>& A) {
int val = 0;
vector<bool> res(A.size());
for(int i=0;i<A.size();i++){
val=val*2+A[i];
val = val%10;
if(val==0||val==5){
res[i]=true;
}else{
res[i]=false;
}
}
return res;
}
};
| [
"miaodi1987@gmail.com"
] | miaodi1987@gmail.com |
bfcdf435d7f0e42e5eef45e2341b71d2206205f6 | 3ff1fe3888e34cd3576d91319bf0f08ca955940f | /cpdp/include/tencentcloud/cpdp/v20190820/model/ContractPayListResult.h | 56afb3413a5c8688cdec025b21dddbf14667a851 | [
"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 | 23,029 | h | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TENCENTCLOUD_CPDP_V20190820_MODEL_CONTRACTPAYLISTRESULT_H_
#define TENCENTCLOUD_CPDP_V20190820_MODEL_CONTRACTPAYLISTRESULT_H_
#include <string>
#include <vector>
#include <map>
#include <tencentcloud/core/utils/rapidjson/document.h>
#include <tencentcloud/core/utils/rapidjson/writer.h>
#include <tencentcloud/core/utils/rapidjson/stringbuffer.h>
#include <tencentcloud/core/AbstractModel.h>
namespace TencentCloud
{
namespace Cpdp
{
namespace V20190820
{
namespace Model
{
/**
* 合同-支付方式列表响应对象
*/
class ContractPayListResult : public AbstractModel
{
public:
ContractPayListResult();
~ContractPayListResult() = default;
void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const;
CoreInternalOutcome Deserialize(const rapidjson::Value &value);
/**
* 获取支付方式编号
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentId 支付方式编号
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentId() const;
/**
* 设置支付方式编号
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentId 支付方式编号
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentId(const std::string& _paymentId);
/**
* 判断参数 PaymentId 是否已赋值
* @return PaymentId 是否已赋值
*
*/
bool PaymentIdHasBeenSet() const;
/**
* 获取支持的交易类型(多个以小写逗号分开,0现金,1刷卡,2主扫,3被扫,4JSPAY,5预授权)
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentType 支持的交易类型(多个以小写逗号分开,0现金,1刷卡,2主扫,3被扫,4JSPAY,5预授权)
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentType() const;
/**
* 设置支持的交易类型(多个以小写逗号分开,0现金,1刷卡,2主扫,3被扫,4JSPAY,5预授权)
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentType 支持的交易类型(多个以小写逗号分开,0现金,1刷卡,2主扫,3被扫,4JSPAY,5预授权)
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentType(const std::string& _paymentType);
/**
* 判断参数 PaymentType 是否已赋值
* @return PaymentType 是否已赋值
*
*/
bool PaymentTypeHasBeenSet() const;
/**
* 获取支付标签
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentTag 支付标签
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentTag() const;
/**
* 设置支付标签
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentTag 支付标签
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentTag(const std::string& _paymentTag);
/**
* 判断参数 PaymentTag 是否已赋值
* @return PaymentTag 是否已赋值
*
*/
bool PaymentTagHasBeenSet() const;
/**
* 获取支付方式图片url路径
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentIcon 支付方式图片url路径
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentIcon() const;
/**
* 设置支付方式图片url路径
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentIcon 支付方式图片url路径
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentIcon(const std::string& _paymentIcon);
/**
* 判断参数 PaymentIcon 是否已赋值
* @return PaymentIcon 是否已赋值
*
*/
bool PaymentIconHasBeenSet() const;
/**
* 获取付款方式名称
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentName 付款方式名称
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentName() const;
/**
* 设置付款方式名称
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentName 付款方式名称
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentName(const std::string& _paymentName);
/**
* 判断参数 PaymentName 是否已赋值
* @return PaymentName 是否已赋值
*
*/
bool PaymentNameHasBeenSet() const;
/**
* 获取付款方式名称(内部名称)
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentInternalName 付款方式名称(内部名称)
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentInternalName() const;
/**
* 设置付款方式名称(内部名称)
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentInternalName 付款方式名称(内部名称)
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentInternalName(const std::string& _paymentInternalName);
/**
* 判断参数 PaymentInternalName 是否已赋值
* @return PaymentInternalName 是否已赋值
*
*/
bool PaymentInternalNameHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionOne 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionOne() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionOne 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionOne(const std::string& _paymentOptionOne);
/**
* 判断参数 PaymentOptionOne 是否已赋值
* @return PaymentOptionOne 是否已赋值
*
*/
bool PaymentOptionOneHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionTwo 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionTwo() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionTwo 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionTwo(const std::string& _paymentOptionTwo);
/**
* 判断参数 PaymentOptionTwo 是否已赋值
* @return PaymentOptionTwo 是否已赋值
*
*/
bool PaymentOptionTwoHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionThree 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionThree() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionThree 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionThree(const std::string& _paymentOptionThree);
/**
* 判断参数 PaymentOptionThree 是否已赋值
* @return PaymentOptionThree 是否已赋值
*
*/
bool PaymentOptionThreeHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionFour 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionFour() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionFour 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionFour(const std::string& _paymentOptionFour);
/**
* 判断参数 PaymentOptionFour 是否已赋值
* @return PaymentOptionFour 是否已赋值
*
*/
bool PaymentOptionFourHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionFive 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionFive() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionFive 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionFive(const std::string& _paymentOptionFive);
/**
* 判断参数 PaymentOptionFive 是否已赋值
* @return PaymentOptionFive 是否已赋值
*
*/
bool PaymentOptionFiveHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionSix 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionSix() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionSix 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionSix(const std::string& _paymentOptionSix);
/**
* 判断参数 PaymentOptionSix 是否已赋值
* @return PaymentOptionSix 是否已赋值
*
*/
bool PaymentOptionSixHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionSeven 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionSeven() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionSeven 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionSeven(const std::string& _paymentOptionSeven);
/**
* 判断参数 PaymentOptionSeven 是否已赋值
* @return PaymentOptionSeven 是否已赋值
*
*/
bool PaymentOptionSevenHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionOther 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionOther() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionOther 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionOther(const std::string& _paymentOptionOther);
/**
* 判断参数 PaymentOptionOther 是否已赋值
* @return PaymentOptionOther 是否已赋值
*
*/
bool PaymentOptionOtherHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionNine 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionNine() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionNine 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionNine(const std::string& _paymentOptionNine);
/**
* 判断参数 PaymentOptionNine 是否已赋值
* @return PaymentOptionNine 是否已赋值
*
*/
bool PaymentOptionNineHasBeenSet() const;
/**
* 获取支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @return PaymentOptionTen 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
std::string GetPaymentOptionTen() const;
/**
* 设置支付方式
注意:此字段可能返回 null,表示取不到有效值。
* @param _paymentOptionTen 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*
*/
void SetPaymentOptionTen(const std::string& _paymentOptionTen);
/**
* 判断参数 PaymentOptionTen 是否已赋值
* @return PaymentOptionTen 是否已赋值
*
*/
bool PaymentOptionTenHasBeenSet() const;
private:
/**
* 支付方式编号
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentId;
bool m_paymentIdHasBeenSet;
/**
* 支持的交易类型(多个以小写逗号分开,0现金,1刷卡,2主扫,3被扫,4JSPAY,5预授权)
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentType;
bool m_paymentTypeHasBeenSet;
/**
* 支付标签
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentTag;
bool m_paymentTagHasBeenSet;
/**
* 支付方式图片url路径
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentIcon;
bool m_paymentIconHasBeenSet;
/**
* 付款方式名称
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentName;
bool m_paymentNameHasBeenSet;
/**
* 付款方式名称(内部名称)
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentInternalName;
bool m_paymentInternalNameHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionOne;
bool m_paymentOptionOneHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionTwo;
bool m_paymentOptionTwoHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionThree;
bool m_paymentOptionThreeHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionFour;
bool m_paymentOptionFourHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionFive;
bool m_paymentOptionFiveHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionSix;
bool m_paymentOptionSixHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionSeven;
bool m_paymentOptionSevenHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionOther;
bool m_paymentOptionOtherHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionNine;
bool m_paymentOptionNineHasBeenSet;
/**
* 支付方式
注意:此字段可能返回 null,表示取不到有效值。
*/
std::string m_paymentOptionTen;
bool m_paymentOptionTenHasBeenSet;
};
}
}
}
}
#endif // !TENCENTCLOUD_CPDP_V20190820_MODEL_CONTRACTPAYLISTRESULT_H_
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
875ef3611218e50af4b5d5294697735a3d327ca7 | 7356f96be38a175fb8c8e54d14421b3a4461c6f5 | /infra/timer/DerivedTimerService.cpp | 135b3f0aaffd67eadc2967904d280c5fadab073d | [
"LicenseRef-scancode-protobuf",
"LicenseRef-scancode-x11-xconsortium-veillard",
"BSD-3-Clause",
"MIT",
"Apache-2.0",
"BSD-2-Clause",
"Unlicense",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | bkvenkatesh/embeddedinfralib | 5381509a4ed676a111b0d14d7a2a82bb74c39998 | 6a61684c37642a9e37bc757a29e5fbce18705529 | refs/heads/master | 2021-06-25T03:20:01.966169 | 2020-12-24T15:47:10 | 2020-12-24T15:47:10 | 179,512,848 | 1 | 0 | NOASSERTION | 2020-12-24T15:47:42 | 2019-04-04T14:22:01 | C++ | UTF-8 | C++ | false | false | 995 | cpp | #include "infra/timer/DerivedTimerService.hpp"
namespace infra
{
DerivedTimerService::DerivedTimerService(uint32_t id, TimerService& baseTimerService)
: TimerService(id)
, baseTimerService(baseTimerService)
, timer(baseTimerService.Id())
{}
void DerivedTimerService::NextTriggerChanged()
{
nextTrigger = NextTrigger() - shift;
if (NextTrigger() != TimePoint::max())
timer.Start(nextTrigger, [this]() { Progressed(nextTrigger + shift); });
else
timer.Cancel();
}
TimePoint DerivedTimerService::Now() const
{
return baseTimerService.Now() + shift;
}
Duration DerivedTimerService::Resolution() const
{
return baseTimerService.Resolution();
}
void DerivedTimerService::Shift(Duration shift)
{
this->shift = shift;
NextTriggerChanged();
}
Duration DerivedTimerService::GetCurrentShift() const
{
return shift;
}
}
| [
"bart.golsteijn@philips.com"
] | bart.golsteijn@philips.com |
f6790595031dd8bc715a27ea191136cea2a45dc3 | 9c308bab9621c8a2a9e5b43016f0b5c14722a0f5 | /Syncer.cpp | 40d1f36e32d9c411a1fdb6c3a4c98ee31c28c2a4 | [] | no_license | Maniulo/FFmpeg-SDL-tutorial | c01d3fc5035898d148e0ab288d90f45565acfcaa | dd7586c6c6985bf094d9dcd4521d08dcdcd74cc7 | refs/heads/master | 2021-01-22T22:21:21.452219 | 2013-10-09T19:17:47 | 2013-10-09T19:17:47 | 12,451,820 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,244 | cpp | extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/mem.h>
#include <libavutil/time.h>
}
#include "Video.cpp"
#include "Audio.cpp"
/* no AV sync correction is done if below the AV sync threshold */
#define AV_SYNC_THRESHOLD 0.01
/* no AV correction is done if too big error */
#define AV_NOSYNC_THRESHOLD 10.0
#include <SDL.h>
class Syncer
{
private:
Audio *A;
Video *V;
double previousClock;
double previousDelay;
public:
Syncer(Video *v, Audio *a)
{
V = v;
A = a;
previousClock = 0;
previousDelay = 0;
}
double computeFrameDelay()
{
// fprintf(stdout, "%f", V->VideoClock());
double delay = V->VideoClock() - previousClock;
if (delay <= 0.0 || delay >= 1.0) {
// Incorrect delay - use previous one
delay = previousDelay;
}
// Save for next time
previousClock = V->VideoClock();
previousDelay = delay;
// Update delay to sync to audio
double diff = V->VideoClock() - A->AudioClock();
if (diff <= -delay) delay = 0; // Audio is ahead of video; display video ASAP
if (diff >= delay) delay = 2 * delay; // Video is ahead of audio; delay video
return delay;
}
}; | [
"m.mezhenin@gmail.com"
] | m.mezhenin@gmail.com |
12f1ce850cc74124a04aa684bddaac08b95c5192 | f6ad1c5e9736c548ee8d41a7aca36b28888db74a | /gdgzez/yhx-lxl/day5/B/B.cpp | d69c38d9fc600f404ca7e955977ee144e8736174 | [] | no_license | cnyali-czy/code | 7fabf17711e1579969442888efe3af6fedf55469 | a86661dce437276979e8c83d8c97fb72579459dd | refs/heads/master | 2021-07-22T18:59:15.270296 | 2021-07-14T08:01:13 | 2021-07-14T08:01:13 | 122,709,732 | 0 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 5,013 | cpp | /*
Problem: B.cpp
Time: 2021-06-23 18:49
Author: CraZYali
E-Mail: yms-chenziyang@outlook.com
*/
#define REP(i, s, e) for (register int i(s), end_##i(e); i <= end_##i; i++)
#define DEP(i, s, e) for (register int i(s), end_##i(e); i >= end_##i; i--)
#define DEBUG fprintf(stderr, "Passing [%s] in Line %d\n", __FUNCTION__, __LINE__)
#define chkmax(a, b) (a < (b) ? a = (b) : a)
#define chkmin(a, b) (a > (b) ? a = (b) : a)
#ifdef CraZYali
#include <ctime>
#endif
#include <algorithm>
#include <set>
#include <vector>
#include <iostream>
#include <cstdio>
#define i64 long long
using namespace std;
const int maxn = 3e5 + 10;
template <typename T>
inline T read()
{
T ans = 0, flag = 1;
char c = getchar();
while (!isdigit(c))
{
if (c == '-') flag = -1;
c = getchar();
}
while (isdigit(c))
{
ans = ans * 10 + (c - 48);
c = getchar();
}
return ans * flag;
}
#define file(FILE_NAME) freopen(FILE_NAME".in", "r", stdin), freopen(FILE_NAME".out", "w", stdout)
int n, q, a[maxn];
namespace bf
{
void work()
{
while (q--)
{
int opt = read<int>(), l = read<int>(), r = read<int>();
if (opt == 1)
{
int x = read<int>();
static int b[maxn];
REP(i, l, r) b[i] = a[i];
REP(i, l, r) a[x + i - l] = b[i];
}
else if (opt == 2) REP(i, l, r) a[i] >>= 1;
else
{
i64 ans = 0;
REP(i, l, r) ans += a[i];
printf("%lld\n", ans);
}
}
}
}
namespace cheat
{
const int b1 = 500, b2 = 4000;
int blg[maxn], L[maxn], R[maxn];
struct node
{
vector <int> a;
mutable vector <i64> s;
mutable int l, r, k;
node(int l = 0) : l(l) {}
node(int l, int r, vector <int> a, int k = 0) : l(l), r(r), a(a), k(k)
{
if (k <= 30) for (auto &i : a) i >>= k;
else a = vector <int> (a.size(), 0);
k = 0;
s.clear();
i64 sum = 0;
auto b = a;
do
{
sum = 0;
for (auto &i : b) sum += i, i /= 2;
s.emplace_back(sum);
}while (sum);
reverse(s.begin(), s.end());
}
inline bool operator < (const node &B) const {return l < B.l;}
};
set <node> ssr;
#define IT set <node> :: iterator
IT split(int pos)
{
if (pos > n) return ssr.end();
auto it = ssr.lower_bound(node(pos));
if (it != ssr.end() && it -> l == pos) return it;
if (it == ssr.begin())
return ssr.emplace(pos, pos, vector <int> {0}).first;
--it;
int l = it -> l, r = it -> r, k = it -> k;
vector <int> a1, a2, a = it -> a;
ssr.erase(it);
if (r < pos)
return ssr.emplace(pos, pos, vector <int> {0}).first;
if (k <= 30)
{
for (auto &i : a) i >>= k;
k = 0;
}
else
return ssr.emplace(pos, pos, vector <int> {0}).first;
REP(i, l, pos - 1) a1.emplace_back(a[i - l]);
REP(i, pos, r) a2.emplace_back(a[i - l]);
int L = l, R = pos - 1;vector <int> real;
while (L <= R && !a1[L - l]) L++;
while (L <= R && !a1.back()) a1.pop_back(), R--;
REP(i, L, R) real.emplace_back(a1[i - l]);
if (L <= R) ssr.emplace(L, R, real, k);
L = pos;R = r;real.clear();
while (L <= R && !a2[L - pos]) L++;
while (L <= R && !a2.back()) a2.pop_back(), R--;
REP(i, L, R) real.emplace_back(a2[i - pos]);
if (L <= R) return ssr.emplace(L, R, real).first;
return ssr.emplace(pos, pos, vector <int> {0}).first;
}
void rebuild_a()
{
REP(i, 1, n) a[i] = 0;
for (auto i : ssr)
REP(j, i.l, i.r) a[j] = i.k <= 30 ? i.a[j - i.l] >> i.k : 0;
}
void rebuild_s()
{
ssr.clear();
REP(i, 1, blg[n])
{
vector <int> A;
int flg = 0;
REP(j, L[i], R[i]) A.emplace_back(a[j]), flg |= a[j];
if (!flg) continue;
ssr.emplace(L[i], R[i], A);
}
}
void rebuild()
{
rebuild_a();
rebuild_s();
}
void work()
{
REP(i, 1, n) blg[i] = (i - 1) / b1 + 1;
REP(i, 1, n) R[blg[i]] = i;
DEP(i, n, 1) L[blg[i]] = i;
rebuild_s();
REP(Case, 1, q)
{
int opt = read<int>(), l = read<int>(), r = read<int>();
if (opt == 1)
{
int x = read<int>();
auto itr = split(r + 1), itl = split(l);
vector <node> vec;
for (auto it = itl; it != itr; it++) vec.emplace_back(*it);
itr = split(x + r - l + 1), itl = split(x);
ssr.erase(itl, itr);
for (auto i : vec)
{
auto t = i;
t.l += x - l;t.r += x - l;
ssr.emplace(t);
}
}
else if (opt == 2)
{
auto itr = split(r + 1), itl = split(l);
for (auto it = itl; it != itr;)
{
it -> k++;
if (it -> s.size() > 1)
{
it -> s.pop_back();
it++;
}else it = ssr.erase(it);
}
}
else
{
i64 ans = 0;
auto itr = split(r + 1), itl = split(l);
for (auto it = itl; it != itr; it++) ans += it -> s.back();
printf("%lld\n", ans);
}
if (ssr.size() > b2) rebuild();
if (Case % 5000 == 0) fprintf(stderr, "Done %d / %d = %.2lf%%\n", Case, q, Case * 100. / q);
}
}
}
int main()
{
#ifdef CraZYali
file("B");
#endif
n = read<int>();
REP(i, 1, n) a[i] = read<int>();
q = read<int>();
if (n <= 3e4 && q <= 3e4) bf :: work();
else cheat :: work();
#ifdef CraZYali
cerr << clock() * 1. / CLOCKS_PER_SEC << endl;
#endif
return 0;
}
| [
"yms-chenziyang@outlook.com"
] | yms-chenziyang@outlook.com |
65fd36b920e1bbc9614b4e18177de0d24ca093e4 | b1366db929b24e9a2af5341c6ed6150985d8fe3b | /fe5226/main.cpp | d5011e0aadfbc7d1176f6d7d715b0edf7d7a39c7 | [] | no_license | WhispeRre/fe5226 | c1e31f417ac6aa6ea8b628d1e788c217bea42fbf | ebfcc43584911a1af4cc06a04f78adb949c145b5 | refs/heads/master | 2023-07-29T05:31:52.385499 | 2019-10-26T03:59:22 | 2019-10-26T03:59:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,894 | cpp | //
// main.cpp
// fe5226
//
// Created by Xiaoman Li on 12/10/19.
// Copyright © 2019 Xiaoman Li. All rights reserved.
//
#define _USE_MATH_DEFINES // cause import of some macros like M_PI
#include <stdio.h>
#include <iomanip> // needed to format the output
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <typeinfo>
#include <list>
#include <vector>
#include <exception>
#include <sstream>
#include <set>
using namespace std;
//bool same_parity (int x, int y) {
// // x and y are passed as copies, changes in the function won't be passed to the main function
// return ((x % 2) == (y % 2));
//}
void randAB (int n, double *dst, double a, double b) {
for (unsigned i = 0; i < n; ++i)
dst[i] = (static_cast<double>(rand())/static_cast<double>(RAND_MAX))*(b - a) + a;
}
struct MyArray {
const size_t initial_size = 1;
const size_t growth_factor = 2;
size_t capacity = initial_size;
size_t length = 0; // size_t is shortcut for unsigned int?
int *v;
};
int getInteger() {
int x;
cout << "Input a number (<0 to terminate the program): " << endl;
do {
cin >> x;
} while (cin.bad());
return x;
}
void printArray(const MyArray &numbers) {
for (size_t j = 0; j < numbers.length; ++j)
cout << numbers.v[j] << ", ";
cout << endl;
}
template <typename Container>
void print(const Container& c, const string& msg) {
cout << "Size: " << c.size()
// << ", Capcaity: " << c.capacity()
<< endl;
for (auto it = c.cbegin(); it != c.cend(); ++it) {
cout << *it << ", ";
}
cout << msg << "\n";
}
template <typename T>
const T& i_th_element (const list<T>& l, size_t i) {
// scope here is used to shorten the lift of the statment, to void mistakes.
auto it = l.begin();
size_t j = 0;
while (j < i) {
if (it != l.cend()) {
++j;
++it;
}
else {
cout << "Cannot get the " << i << "th element. This List is too short! " << "\n";
exit(-1);
}
}
return *it;
}
pair<double, double> roots(double a, double b, double c) {
double delta = b * b -4.0 * a * c;
if (delta < 0) {
ostringstream os;
os << __FILE__ << ": line " // macros
<< __LINE__ << ", " // macros
<< "Negative discriminant " << delta << "\n";
throw invalid_argument(os.str());
}
double disc = sqrt(delta); // this can cause an error if (delta < 0)
double a2 = 2 * a;
return make_pair((-b + disc) / a2, -(b + disc) / a2);
}
int main () {
// std::set<int> myset = {10, 20, 30, 40, 50};
// std::set<int>::iterator it;
//
// it = myset.find(70);
// cout << *it << endl;
// cout << *(myset.end());
// if (it != myset.end())
// cout << "Number found" << endl;
// else
// cout << "Number not found" << endl;
//
// double a = 1, b = 1, c = 1;
// try {
// auto res = roots(a, b, c);
// cout << res.first << res.second << "\n";
// return 0;
// }
// catch (const invalid_argument& e) {
// cout << e.what() << "\n";
// return -1;
// }
//
//
// list<int> v(3, 4);
// print(v, "Create");
//
// for (auto& x : v) {
// x = rand() % 10;
// }
// print(v, "Rand");
//
// cout << i_th_element(v, 4);
// vector<int> v;
// print(v, "Create");
//
// v.reserve(20);
// print(v, "Reserved");
//
// v.assign(20, 5);
// print(v, "Assigned");
//
// v.push_back(0);
// print(v, "Pushed back");
//
// v.clear();
// print(v, "Cleared");
//
//
// v.shrink_to_fit(); // shrink capacity to size of the vector
// MyArray numbers;
// numbers.v = new int[numbers.capacity];
// while (true) {
// int x = getInteger();
// if (x < 0) {
// break;
// }
// if (numbers.length == numbers.capacity) {
// int *temp = new int[numbers.capacity*numbers.growth_factor];
// for (size_t i = 0; i < numbers.length; ++i)
// temp[i] = numbers.v[i];
// delete[] numbers.v;
// numbers.v = temp;
// }
// numbers.v[numbers.length++] = x;
// }
//
// printArray(numbers);
// struct ComplexNumber {
// double realpart;
// double imagpart;
// };
//
// ComplexNumber *p = new ComplexNumber[2];
// p[0] = {1, 2};
// p[1] = {3, 4};
// cout << p[0].imagpart << " " << p[1].imagpart << endl;
//
// delete [] p;
//
// const char x[] = {'H', 'e', 'l', 'l', 'o', 0};
// const char y[] = "Hello";
// cout << sizeof(y)<< endl; // output 6
//
// double x[10];
// randAB (10, x, 1, 5);
//
// for (unsigned i = 0; i < 10; ++i) {
// cout << x[i] << endl;
// }
//
// const unsigned nPoints = 10;
// double step = M_PI / nPoints; // here nPoints is lifted to double
// for (unsigned i = 0; i < 2*nPoints; ++i) {
// double x = i*step;
// cout << fixed << setprecision(3)
// << setw(8) << x << ", "
// << setw(8) << sin(x)*cos(x)
// << "\n";
// }
// cout << "\n";
//
//struct MyArray {
// const size_t initial_size = 1;
// const size_t growth_factor = 2;
//
// size_t capacity = initial_size;
// size_t length = 0; // size_t is shortcut for unsigned int?
//
// int *v;
//};
//
//int main () {
//
// int x;
//
// MyArray numbers;
// numbers.v = new int[numbers.capacity];
//
// while (true) {
// cout << "Input a number (<0 to terminate the program): " << endl;
// cin >> x;
// if (x < 0)
// break;
//
// if (numbers.length == numbers.capacity) {
// int *temp = new int[numbers.capacity*numbers.growth_factor];
// for (size_t i = 0; i < numbers.length; ++i)
// temp[i] = numbers.v[i];
// delete[] numbers.v;
// numbers.v = temp;
// }
// numbers.v[numbers.length++] = x;
// }
//
// for (size_t j = 0; j < numbers.length; ++j)
// cout << numbers.v[j] << ", ";
// cout << endl;
// const char *msg[] = {"hello", "world"};
// // initialized an array of points that are pointing to a character array
// cout << msg[1] << endl;
// int x[5] = {1,2,3,4,5};
// int *y = x; // pointer pointing to the first element of the array
// // int *y = NULL; is OK,but int *y; is not a good practice
//
// cout << "Size of x: " << sizeof(x) << endl;
// cout << "Size of y: " << sizeof(y) << endl;
//
// for (int i = 0; i < 5; i++) {
// cout << x[i] << " " << y[i] << endl;
// }
//
// y = x + 1;
//
// for (int i = 0; i < 5; i++) {
// cout << x[i] << " " << y[i] << endl;
// }
// cout << *(x + 1) << endl;
// cout << (x + 2)[-1] << endl;
//
//
// y[2] = 0;
//
// for (int i = 0; i < 5; i++) {
// cout << x[i] << " " << y[i] << endl;
// }
//
// for (int *y = x; y != x + 5;) {
// cout << *++y << endl; // should pay attention to ++*y, *++y, *y++
// }
// // find all prime numbers
// unsigned primes[80];
//
// unsigned nPrimesFound = 0;
// unsigned upperBound = 100;
//
// for (int i = 2; i < upperBound; i++) {
// unsigned largest = static_cast<unsigned>(sqrt(static_cast<double>(i)));
// bool isPrime = true;
// for (unsigned j = 0; j < nPrimesFound; j++) {
// if (primes[j] > largest)
// break;
// if (i % primes[j] == 0) {
// isPrime = false;
// break;
// }
// }
// if (isPrime)
// primes[nPrimesFound++] = i;
// }
//
// for (unsigned i = 0; i < nPrimesFound ; i++) {
// cout << primes[i] << " ";
// }
// // check minimum, maximum and average of an array
// const unsigned n = 100;
// double x[n];
//
// for (int i = 0; i < 100; i++) {
// x[i] = rand();
// }
//
// double mi = x[0], ma = x[0], ave = x[0];
//
// for (int i = 1; i < 100; i++) {
// if (x[i] < mi)
// mi = x[i];
// if (x[i] > ma)
// ma = x[i];
// ave += x[i];
// }
// ave /= n;
// cout << "The minimum is: " << mi << endl;
// cout << "The maximum is: " << ma << endl;
// cout << "The average is: " << ave << endl;
// int x[] = {1, 2, 3, 4, 5, 6, 7, 8};
// cout << "Size of the array " << sizeof(x) << endl; //return the number of bytes in memory taken by the variable
// const unsigned length = sizeof(x) / sizeof(x[0]); // number of elements in the array
// cout << length << endl;
//
// for (int i = 0; i < length; i++) {
// cout << x[i] << "\n";
// }
//
// // another way to iterate over an array, useful in the case index info is not available
// int j = 0;
// for (auto xi : x) {
// cout << j << " : " << xi << endl;
// j++;
// }
// int x;
// cin >> x;
// bool isPrime = x != 1;
// for (int i = 2; i < x; i ++) // can check i < (int) sqrt(x) to save computation time
// if (x % i == 0) {
// isPrime = false;
// break;
// }
//
// cout << "The number " << x << " is " << (isPrime ? "" : "not") << " prime. \n";
// Practice to sum up all the digits of the inputted number.
// int x, sum = 0;
// cout << "Please input a number: ";
// cin >> x;
// do {
// sum += x % 10;
// x /= 10;
// }while(x > 0);
// cout << "Sum of digits = " << sum << "\n";
// int x;
// cout << "Please input a number: \n";
// bool ok = (bool)(cin >> x); // (bool) is explicit cast here
// if (ok) {
// cout << "Number inputted \n" ;
// }
// char c1 = 72, c2 = 'e', c3 = 'e', c4 = 111; // only single quote allowed for character
// int x, y;
// cin >> x >> y;
// cout << x++ << endl; // print x and then assign x = x + 1
// cout << ++y << endl; // assign y = y + 1 and then print y
// bool y = (1000 < x) && (x <= 10000)
// && ((x % 2) != 0)
// && ((x % 7) == 0)
// && (((x % 41) == 0) || ((x % 43) == 0));
#if 0
double xa, xb, ya, yb;
cout << "Enter xa: ";
cin >> xa;
cout << "Enter ya: ";
cin >> ya;
cout << "Enter xb: ";
cin >> xb;
cout << "Enter yb: ";
cin >> yb;
double dx = xa - xb;
double dy = ya - yb;
cout << "The distance is: "
<< sqrt(pow(dx, 2) + dy*dy)
<< endl;
// pow() is quite expensive and costly, not suggested if the expression is simple.
#endif
return 0;
}
| [
"xiaomanli@Xiaomans-MacBook-Pro.local"
] | xiaomanli@Xiaomans-MacBook-Pro.local |
ab2fb4eada23317251ada60700e3ea487846ebfc | 8d8b618bed48595e2475cfef3ddc502810024026 | /Divide_and_Conquer/Median_Of_Two_Sorted_Arrays.cpp | 4ea78b29602d9f08ae9c4300fc9fbc43748976bf | [
"MIT"
] | permissive | AABHINAAV/InterviewPrep | acef002b69be61ca1ff0858559f1b4bd24ce2203 | 22a7574206ddc63eba89517f7b68a3d2f4d467f5 | refs/heads/master | 2022-01-09T20:06:41.828170 | 2019-05-21T09:33:52 | 2019-05-21T09:33:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,469 | cpp | //given two sorted arrays of same size.Find the median if the two arrays are merged
//Time Complexity: O(logn)
#include<iostream>
#include<vector>
using namespace std;
//finds the median of two sorted arrays
/*
if the m1 is the median of array1 and m2 is the median of array2 then :
if m1 > m2:
it means all elements on LHS of m2 will lie on left side of m1 ,so median
will shift for the sorted array.Since elements on LHS of m1 have increased
so for m1 the median is in the LHS and for m2 ,elements on RHS
may be on LHS of m1 or may not be,so its median will be in RHS
keep doing this untill each array has 2 elements remaining
when there are 2 elements in each array then,
median = (max(a[0],b[0]) + min(a[1],b[1]) ) /2
*/
int findMedian(vector<int> a, vector<int> b){
//check if the elements left are 2 for each array or not
if(a.size() == 2 && b.size() == 2)
return (max(a[0],b[0]) + min(a[1],b[1]) )/2;
int m1 = a.size()/2;
int m2 = b.size()/2;
//median lie in LHS of a and RHS of b
if(a[m1] > b[m2]){
return findMedian(vector<int> {a.begin(),a.begin()+m1+1},
vector<int> {b.begin()+ m2,b.end()}
);
}
else if(a[m1] < b[m2]){
return findMedian(vector<int> {a.begin()+ m1,a.end()},
vector<int> {b.begin(),b.begin()+m2+1}
);
}
//when the medians are same
else
return a[m1];
}
int main(){
vector<int> a = {1, 12, 15, 26, 38};
vector<int> b = {2, 13, 17, 30, 45};
int median = 0;
cout<< findMedian(a,b);
}
| [
"susanta18@outlook.com"
] | susanta18@outlook.com |
2c51ea62eda0feca61118f89869a4a6702403570 | de1fc8272ca500fb13a93c9d053cdd75634329cd | /Learning/struct_in_struct/struct_define_struct.cpp | 157b8888f9577e4312022208a8610c2b8cfa3e14 | [] | no_license | hohaidang/CPP_Basic2Advance | ada69129123c14491c29803a3f7224b924616a80 | cdb733e9b24c7ad4927deab57fff389f521d0ea3 | refs/heads/master | 2021-05-21T10:31:46.627204 | 2021-03-29T07:16:43 | 2021-03-29T07:16:43 | 252,654,029 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 516 | cpp | #include <iostream>
struct dang1 {
#define IMPORT(MsgBase) \
public: \
int a;
};
template<typename base>
struct dang2 : base{
IMPORT(base)
};
int main() {
// dang2 inherit tu dang1, va dang 1 co 1 cai #define IMPORT
// tu do struct dang2 se co bien public: int a; nhung dang1 se khong co bien nao
dang2<dang1> my_struc;
my_struc.a = 15;
std::cout << "sizeof dang1 = " << sizeof(dang1) << '\n';
std::cout << "sizeof dang2 = " << sizeof(dang2<dang1>) << '\n';
return 0;
} | [
"hohaidang.khtn@gmail.com"
] | hohaidang.khtn@gmail.com |
34997861457fde50b884a2b9efaa2336ce092b40 | e198d6305f2b6264fbb1a7bdfafdf88454143bb4 | /contests/timus/train/1011.cpp | 461864a8abccb031b04bf68b2d7d25d83baf9cbe | [] | no_license | Yan-Song/burdakovd | e4ba668b5db19026dbf505fb715be0456d229527 | 0b3b90943b3f8e2341ed96a99e25c1dc314b3095 | refs/heads/master | 2021-01-10T14:39:45.788552 | 2013-01-02T10:51:02 | 2013-01-02T10:51:02 | 43,729,389 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 782 | cpp | #include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <algorithm>
#pragma comment(linker, "/STACK:16777216")
#define mset(block,value) memset(block,value,sizeof(block))
typedef long long i64;
#define eps 0.000000001
using namespace std;
int main()
{
i64 n=1;
double p,q;
cin>>p>>q;
//p/=100;
//q/=100;
int P=floor(p*100+0.5);
int Q=floor(q*100+0.5);
while(true)
{
++n;
for(i64 j=0; j<n; j++)
if((j*10000>P*n)&&(j*10000<Q*n))
{
cout<<n<<endl;
return 0;
}
//cout<<"("<<n<<") ("<<p*n<<", "<<q*n<<")"<<endl;
}
cout<<n<<endl;
return 0;
}
| [
"icqkill@gmail.com"
] | icqkill@gmail.com |
eb03dce869fc07e5aa7ace5ab6b9f6d7525fb1ed | de7e771699065ec21a340ada1060a3cf0bec3091 | /spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.cpp | 463e1d3a2f7868289d1cacc6381b4cfed2582adb | [] | no_license | sraihan73/Lucene- | 0d7290bacba05c33b8d5762e0a2a30c1ec8cf110 | 1fe2b48428dcbd1feb3e10202ec991a5ca0d54f3 | refs/heads/master | 2020-03-31T07:23:46.505891 | 2018-12-08T14:57:54 | 2018-12-08T14:57:54 | 152,020,180 | 7 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,729 | cpp | using namespace std;
#include "GeoPathTest.h"
namespace org::apache::lucene::spatial3d::geom
{
using org::junit::Test;
// import static org.apache.lucene.util.SloppyMath.toRadians;
// import static org.junit.Assert.assertEquals;
// import static org.junit.Assert.assertFalse;
// import static org.junit.Assert.assertTrue;
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testPathDistance()
void GeoPathTest::testPathDistance()
{
// Start with a really simple case
shared_ptr<GeoStandardPath> p;
shared_ptr<GeoPoint> gp;
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
p->addPoint(0.0, 0.0);
p->addPoint(0.0, 0.1);
p->addPoint(0.0, 0.2);
p->done();
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, M_PI * 0.5, 0.15);
assertEquals(numeric_limits<double>::infinity(),
p->computeDistance(DistanceStyle::ARC, gp), 0.0);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.05, 0.15);
assertEquals(0.15 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.12);
assertEquals(0.12 + 0.0, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.15, 0.05);
assertEquals(numeric_limits<double>::infinity(),
p->computeDistance(DistanceStyle::ARC, gp), 0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.25);
assertEquals(0.20 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, -0.05);
assertEquals(0.0 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
// Compute path distances now
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
p->addPoint(0.0, 0.0);
p->addPoint(0.0, 0.1);
p->addPoint(0.0, 0.2);
p->done();
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.05, 0.15);
assertEquals(0.15 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
assertEquals(0.15, p->computeNearestDistance(DistanceStyle::ARC, gp),
0.000001);
assertEquals(0.10, p->computeDeltaDistance(DistanceStyle::ARC, gp), 0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.12);
assertEquals(0.12, p->computeDistance(DistanceStyle::ARC, gp), 0.000001);
assertEquals(0.12, p->computeNearestDistance(DistanceStyle::ARC, gp),
0.000001);
assertEquals(0.0, p->computeDeltaDistance(DistanceStyle::ARC, gp), 0.000001);
// Now try a vertical path, and make sure distances are as expected
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
p->addPoint(-M_PI * 0.25, -0.5);
p->addPoint(M_PI * 0.25, -0.5);
p->done();
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.0);
assertEquals(numeric_limits<double>::infinity(),
p->computeDistance(DistanceStyle::ARC, gp), 0.0);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.1, -1.0);
assertEquals(numeric_limits<double>::infinity(),
p->computeDistance(DistanceStyle::ARC, gp), 0.0);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, M_PI * 0.25 + 0.05, -0.5);
assertEquals(M_PI * 0.5 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -M_PI * 0.25 - 0.05, -0.5);
assertEquals(0.0 + 0.05, p->computeDistance(DistanceStyle::ARC, gp),
0.000001);
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testPathPointWithin()
void GeoPathTest::testPathPointWithin()
{
// Tests whether we can properly detect whether a point is within a path or
// not
shared_ptr<GeoStandardPath> p;
shared_ptr<GeoPoint> gp;
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
// Build a diagonal path crossing the equator
p->addPoint(-0.2, -0.2);
p->addPoint(0.2, 0.2);
p->done();
// Test points on the path
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.2, -0.2);
assertTrue(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.0);
assertTrue(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.1, 0.1);
assertTrue(p->isWithin(gp));
// Test points off the path
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.2, 0.2);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -M_PI * 0.5, 0.0);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.2, -0.2);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, M_PI);
assertFalse(p->isWithin(gp));
// Repeat the test, but across the terminator
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
// Build a diagonal path crossing the equator
p->addPoint(-0.2, M_PI - 0.2);
p->addPoint(0.2, -M_PI + 0.2);
p->done();
// Test points on the path
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.2, M_PI - 0.2);
assertTrue(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, M_PI);
assertTrue(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.1, -M_PI + 0.1);
assertTrue(p->isWithin(gp));
// Test points off the path
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -0.2, -M_PI + 0.2);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, -M_PI * 0.5, 0.0);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.2, M_PI - 0.2);
assertFalse(p->isWithin(gp));
gp = make_shared<GeoPoint>(PlanetModel::SPHERE, 0.0, 0.0);
assertFalse(p->isWithin(gp));
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testGetRelationship()
void GeoPathTest::testGetRelationship()
{
shared_ptr<GeoArea> rect;
shared_ptr<GeoStandardPath> p;
shared_ptr<GeoStandardPath> c;
shared_ptr<GeoPoint> point;
shared_ptr<GeoPoint> pointApprox;
int relationship;
shared_ptr<GeoArea> area;
shared_ptr<PlanetModel> planetModel;
planetModel = make_shared<PlanetModel>(1.151145876105594, 0.8488541238944061);
c = make_shared<GeoStandardPath>(planetModel, 0.008726646259971648);
c->addPoint(-0.6925658899376476, 0.6316613927914589);
c->addPoint(0.27828548161836364, 0.6785795524104564);
c->done();
point = make_shared<GeoPoint>(planetModel, -0.49298555067758226,
0.9892440995026406);
pointApprox = make_shared<GeoPoint>(0.5110940362119821, 0.7774603209946239,
-0.49984312299556544);
area = GeoAreaFactory::makeGeoArea(
planetModel, 0.49937141144985997, 0.5161765426256085, 0.3337218719537796,
0.8544419570901649, -0.6347692823688085, 0.3069696588119369);
assertTrue(!c->isWithin(point));
// Start by testing the basic kinds of relationship, increasing in order of
// difficulty.
p = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
p->addPoint(-0.3, -0.3);
p->addPoint(0.3, 0.3);
p->done();
// Easiest: The path is wholly contains the georect
rect =
make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.05, -0.05, -0.05, 0.05);
assertEquals(GeoArea::CONTAINS, rect->getRelationship(p));
// Next easiest: Some endpoints of the rectangle are inside, and some are
// outside.
rect =
make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.05, -0.05, -0.05, 0.5);
assertEquals(GeoArea::OVERLAPS, rect->getRelationship(p));
// Now, all points are outside, but the figures intersect
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.05, -0.05, -0.5, 0.5);
assertEquals(GeoArea::OVERLAPS, rect->getRelationship(p));
// Finally, all points are outside, and the figures *do not* intersect
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.5, -0.5, -0.5, 0.5);
assertEquals(GeoArea::WITHIN, rect->getRelationship(p));
// Check that segment edge overlap detection works
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.1, 0.0, -0.1, 0.0);
assertEquals(GeoArea::OVERLAPS, rect->getRelationship(p));
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.2, 0.1, -0.2, -0.1);
assertEquals(GeoArea::DISJOINT, rect->getRelationship(p));
// Check if overlap at endpoints behaves as expected next
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.5, -0.5, -0.5, -0.35);
assertEquals(GeoArea::OVERLAPS, rect->getRelationship(p));
rect = make_shared<GeoRectangle>(PlanetModel::SPHERE, 0.5, -0.5, -0.5, -0.45);
assertEquals(GeoArea::DISJOINT, rect->getRelationship(p));
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testPathBounds()
void GeoPathTest::testPathBounds()
{
shared_ptr<GeoStandardPath> c;
shared_ptr<LatLonBounds> b;
shared_ptr<XYZBounds> xyzb;
shared_ptr<GeoPoint> point;
int relationship;
shared_ptr<GeoArea> area;
shared_ptr<PlanetModel> planetModel;
planetModel = make_shared<PlanetModel>(0.751521665790406, 1.248478334209594);
c = make_shared<GeoStandardPath>(planetModel, 0.7504915783575618);
c->addPoint(0.10869761172400265, 0.08895880215465272);
c->addPoint(0.22467878641991612, 0.10972973084229565);
c->addPoint(-0.7398772468744732, -0.4465812941383364);
c->addPoint(-0.18462055300079366, -0.6713857796763727);
c->done();
point = make_shared<GeoPoint>(planetModel, -0.626645355125733,
-1.409304625439381);
xyzb = make_shared<XYZBounds>();
c->getBounds(xyzb);
area = GeoAreaFactory::makeGeoArea(planetModel, xyzb->getMinimumX(),
xyzb->getMaximumX(), xyzb->getMinimumY(),
xyzb->getMaximumY(), xyzb->getMinimumZ(),
xyzb->getMaximumZ());
relationship = area->getRelationship(c);
assertTrue(relationship == GeoArea::WITHIN ||
relationship == GeoArea::OVERLAPS);
assertTrue(area->isWithin(point));
// No longer true due to fixed GeoStandardPath waypoints.
// assertTrue(c.isWithin(point));
c = make_shared<GeoStandardPath>(PlanetModel::WGS84, 0.6894050545377601);
c->addPoint(-0.0788176065762948, 0.9431251741731624);
c->addPoint(0.510387871458147, 0.5327078872484678);
c->addPoint(-0.5624521609859962, 1.5398841746888388);
c->addPoint(-0.5025171434638661, -0.5895998642788894);
c->done();
point = make_shared<GeoPoint>(PlanetModel::WGS84, 0.023652082107211682,
0.023131910152748437);
// System.err.println("Point.x = "+point.x+"; point.y="+point.y+";
// point.z="+point.z);
assertTrue(c->isWithin(point));
xyzb = make_shared<XYZBounds>();
c->getBounds(xyzb);
area = GeoAreaFactory::makeGeoArea(PlanetModel::WGS84, xyzb->getMinimumX(),
xyzb->getMaximumX(), xyzb->getMinimumY(),
xyzb->getMaximumY(), xyzb->getMinimumZ(),
xyzb->getMaximumZ());
// System.err.println("minx="+xyzb.getMinimumX()+" maxx="+xyzb.getMaximumX()+"
// miny="+xyzb.getMinimumY()+" maxy="+xyzb.getMaximumY()+"
// minz="+xyzb.getMinimumZ()+" maxz="+xyzb.getMaximumZ());
// System.err.println("point.x="+point.x+" point.y="+point.y+"
// point.z="+point.z);
relationship = area->getRelationship(c);
assertTrue(relationship == GeoArea::WITHIN ||
relationship == GeoArea::OVERLAPS);
assertTrue(area->isWithin(point));
c = make_shared<GeoStandardPath>(PlanetModel::WGS84, 0.7766715171374766);
c->addPoint(-0.2751718361148076, -0.7786721269011477);
c->addPoint(0.5728375851539309, -1.2700115736820465);
c->done();
point = make_shared<GeoPoint>(PlanetModel::WGS84, -0.01580760332365284,
-0.03956004622490505);
assertTrue(c->isWithin(point));
xyzb = make_shared<XYZBounds>();
c->getBounds(xyzb);
area = GeoAreaFactory::makeGeoArea(PlanetModel::WGS84, xyzb->getMinimumX(),
xyzb->getMaximumX(), xyzb->getMinimumY(),
xyzb->getMaximumY(), xyzb->getMinimumZ(),
xyzb->getMaximumZ());
// System.err.println("minx="+xyzb.getMinimumX()+" maxx="+xyzb.getMaximumX()+"
// miny="+xyzb.getMinimumY()+" maxy="+xyzb.getMaximumY()+"
// minz="+xyzb.getMinimumZ()+" maxz="+xyzb.getMaximumZ());
// System.err.println("point.x="+point.x+" point.y="+point.y+"
// point.z="+point.z);
relationship = area->getRelationship(c);
assertTrue(relationship == GeoArea::WITHIN ||
relationship == GeoArea::OVERLAPS);
assertTrue(area->isWithin(point));
c = make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
c->addPoint(-0.3, -0.3);
c->addPoint(0.3, 0.3);
c->done();
b = make_shared<LatLonBounds>();
c->getBounds(b);
assertFalse(b->checkNoLongitudeBound());
assertFalse(b->checkNoTopLatitudeBound());
assertFalse(b->checkNoBottomLatitudeBound());
assertEquals(-0.4046919, b->getLeftLongitude(), 0.000001);
assertEquals(0.4046919, b->getRightLongitude(), 0.000001);
assertEquals(-0.3999999, b->getMinLatitude(), 0.000001);
assertEquals(0.3999999, b->getMaxLatitude(), 0.000001);
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testCoLinear()
void GeoPathTest::testCoLinear()
{
// p1: (12,-90), p2: (11, -55), (129, -90)
shared_ptr<GeoStandardPath> p =
make_shared<GeoStandardPath>(PlanetModel::SPHERE, 0.1);
p->addPoint(toRadians(-90), toRadians(12)); // south pole
p->addPoint(toRadians(-55), toRadians(11));
p->addPoint(toRadians(-90), toRadians(129)); // south pole again
p->done(); // at least test this doesn't bomb like it used too -- LUCENE-6520
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testFailure1()
void GeoPathTest::testFailure1()
{
/*
GeoStandardPath: {planetmodel=PlanetModel.WGS84, width=1.117010721276371(64.0),
points={[ [lat=2.18531083006635E-12,
lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16,
Z=2.187755873813378E-12])], [lat=0.0,
lon=-3.141592653589793([X=-1.0011188539924791, Y=-1.226017000107956E-16,
Z=0.0])]]}}
*/
std::deque<std::shared_ptr<GeoPoint>> points = {
make_shared<GeoPoint>(PlanetModel::WGS84, 2.18531083006635E-12,
-3.141592653589793),
make_shared<GeoPoint>(PlanetModel::WGS84, 0.0, -3.141592653589793)};
shared_ptr<GeoPath> *const path;
try {
path = GeoPathFactory::makeGeoPath(PlanetModel::WGS84, 1.117010721276371,
points);
} catch (const invalid_argument &e) {
return;
}
assertTrue(false);
shared_ptr<GeoPoint> *const point = make_shared<GeoPoint>(
PlanetModel::WGS84, -2.848117399637174E-91, -1.1092122135274942);
System::err::println(L"point = " + point);
shared_ptr<XYZBounds> *const bounds = make_shared<XYZBounds>();
path->getBounds(bounds);
shared_ptr<XYZSolid> *const solid = XYZSolidFactory::makeXYZSolid(
PlanetModel::WGS84, bounds->getMinimumX(), bounds->getMaximumX(),
bounds->getMinimumY(), bounds->getMaximumY(), bounds->getMinimumZ(),
bounds->getMaximumZ());
assertTrue(path->isWithin(point));
assertTrue(solid->isWithin(point));
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testInterpolation()
void GeoPathTest::testInterpolation()
{
constexpr double lat = 52.51607;
constexpr double lon = 13.37698;
const std::deque<double> pathLats =
std::deque<double>{52.5355, 52.54, 52.5626, 52.5665, 52.6007,
52.6135, 52.6303, 52.6651, 52.7074};
const std::deque<double> pathLons =
std::deque<double>{13.3634, 13.3704, 13.3307, 13.3076, 13.2806,
13.2484, 13.2406, 13.241, 13.1926};
// Set up a point in the right way
shared_ptr<GeoPoint> *const carPoint = make_shared<GeoPoint>(
PlanetModel::SPHERE, toRadians(lat), toRadians(lon));
// Create the path, but use a tiny width (e.g. zero)
std::deque<std::shared_ptr<GeoPoint>> pathPoints(pathLats.size());
for (int i = 0; i < pathPoints.size(); i++) {
pathPoints[i] = make_shared<GeoPoint>(
PlanetModel::SPHERE, toRadians(pathLats[i]), toRadians(pathLons[i]));
}
// Construct a path with no width
shared_ptr<GeoPath> *const thisPath =
GeoPathFactory::makeGeoPath(PlanetModel::SPHERE, 0.0, pathPoints);
// Construct a path with a width
shared_ptr<GeoPath> *const legacyPath =
GeoPathFactory::makeGeoPath(PlanetModel::SPHERE, 1e-6, pathPoints);
// Compute the inside distance to the atPoint using zero-width path
constexpr double distance =
thisPath->computeNearestDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using legacy path
constexpr double legacyDistance =
legacyPath->computeNearestDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using the legacy formula
constexpr double oldFormulaDistance =
thisPath->computeDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using the legacy formula with the legacy shape
constexpr double oldFormulaLegacyDistance =
legacyPath->computeDistance(DistanceStyle::ARC, carPoint);
// These should be about the same
assertEquals(legacyDistance, distance, 1e-12);
assertEquals(oldFormulaLegacyDistance, oldFormulaDistance, 1e-12);
// This isn't true because example search center is off of the path.
// assertEquals(oldFormulaDistance, distance, 1e-12);
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testInterpolation2()
void GeoPathTest::testInterpolation2()
{
constexpr double lat = 52.5665;
constexpr double lon = 13.3076;
const std::deque<double> pathLats =
std::deque<double>{52.5355, 52.54, 52.5626, 52.5665, 52.6007,
52.6135, 52.6303, 52.6651, 52.7074};
const std::deque<double> pathLons =
std::deque<double>{13.3634, 13.3704, 13.3307, 13.3076, 13.2806,
13.2484, 13.2406, 13.241, 13.1926};
shared_ptr<GeoPoint> *const carPoint = make_shared<GeoPoint>(
PlanetModel::SPHERE, toRadians(lat), toRadians(lon));
std::deque<std::shared_ptr<GeoPoint>> pathPoints(pathLats.size());
for (int i = 0; i < pathPoints.size(); i++) {
pathPoints[i] = make_shared<GeoPoint>(
PlanetModel::SPHERE, toRadians(pathLats[i]), toRadians(pathLons[i]));
}
// Construct a path with no width
shared_ptr<GeoPath> *const thisPath =
GeoPathFactory::makeGeoPath(PlanetModel::SPHERE, 0.0, pathPoints);
// Construct a path with a width
shared_ptr<GeoPath> *const legacyPath =
GeoPathFactory::makeGeoPath(PlanetModel::SPHERE, 1e-6, pathPoints);
// Compute the inside distance to the atPoint using zero-width path
constexpr double distance =
thisPath->computeNearestDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using legacy path
constexpr double legacyDistance =
legacyPath->computeNearestDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using the legacy formula
constexpr double oldFormulaDistance =
thisPath->computeDistance(DistanceStyle::ARC, carPoint);
// Compute the inside distance using the legacy formula with the legacy shape
constexpr double oldFormulaLegacyDistance =
legacyPath->computeDistance(DistanceStyle::ARC, carPoint);
// These should be about the same
assertEquals(legacyDistance, distance, 1e-12);
assertEquals(oldFormulaLegacyDistance, oldFormulaDistance, 1e-12);
// Since the point we picked is actually on the path, this should also be true
assertEquals(oldFormulaDistance, distance, 1e-12);
}
// C++ TODO: Most Java annotations will not have direct C++ equivalents:
// ORIGINAL LINE: @Test public void testIdenticalPoints()
void GeoPathTest::testIdenticalPoints()
{
shared_ptr<PlanetModel> planetModel = PlanetModel::WGS84;
shared_ptr<GeoPoint> point1 = make_shared<GeoPoint>(
planetModel, 1.5707963267948963, -2.4818290647609542E-148);
shared_ptr<GeoPoint> point2 =
make_shared<GeoPoint>(planetModel, 1.570796326794895, -3.5E-323);
shared_ptr<GeoPoint> point3 =
make_shared<GeoPoint>(planetModel, 4.4E-323, -3.1415926535897896);
shared_ptr<GeoPath> path = GeoPathFactory::makeGeoPath(
planetModel, 0,
std::deque<std::shared_ptr<GeoPoint>>{point1, point2, point3});
shared_ptr<GeoPoint> point = make_shared<GeoPoint>(
planetModel, -1.5707963267948952, 2.369064805649877E-284);
// If not filtered the point is wrongly in set
assertFalse(path->isWithin(point));
// If not filtered it throws error
path = GeoPathFactory::makeGeoPath(
planetModel, 1e-6,
std::deque<std::shared_ptr<GeoPoint>>{point1, point2, point3});
assertFalse(path->isWithin(point));
shared_ptr<GeoPoint> point4 = make_shared<GeoPoint>(planetModel, 1.5, 0);
shared_ptr<GeoPoint> point5 = make_shared<GeoPoint>(planetModel, 1.5, 0);
shared_ptr<GeoPoint> point6 =
make_shared<GeoPoint>(planetModel, 4.4E-323, -3.1415926535897896);
// If not filtered creates a degenerated Vector
path = GeoPathFactory::makeGeoPath(
planetModel, 0,
std::deque<std::shared_ptr<GeoPoint>>{point4, point5, point6});
path = GeoPathFactory::makeGeoPath(
planetModel, 0.5,
std::deque<std::shared_ptr<GeoPoint>>{point4, point5, point6});
}
} // namespace org::apache::lucene::spatial3d::geom | [
"smamunr@fedora.localdomain"
] | smamunr@fedora.localdomain |
4c6f7c2c77b1a6b657b03e98084a5dbbb24e25ba | f1deaf930b567e4aa607d5701268a7e376ca2c88 | /MotorDriver.h | feab2f2b641adfea4b414a665ddeff51d4a8bcac | [] | no_license | chriswood/MotorDriver | 86fffb5dd263e30f8def7c0f0780f5674fb6576f | dc9535ec9801de780b225a443ea8a13242edb543 | refs/heads/master | 2016-09-11T05:06:54.014811 | 2015-04-18T03:48:26 | 2015-04-18T03:48:26 | 34,117,003 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 939 | h | #ifndef __MOTORDRIVER_H__
#define __MOTORDRIVER_H__
#include <Arduino.h>
/******Pins definitions*************/
#define MOTORSHIELD_IN1 8
#define MOTORSHIELD_IN2 11
#define MOTORSHIELD_IN3 12
#define MOTORSHIELD_IN4 13
#define SPEEDPIN_A 9
#define SPEEDPIN_B 10
/**************Motor ID**********************/
#define MOTORA 0
#define MOTORB 1
#define MOTOR_POSITION_LEFT 0
#define MOTOR_POSITION_RIGHT 1
#define CLOCKWISE 0
#define COUNTER_CLOCKWISE 1
#define USE_DC_MOTOR 0
struct MotorStruct
{
int8_t speed;
uint8_t direction;
};
/**Class for Motor Shield**/
class MotorDriver
{
MotorStruct motorA;
MotorStruct motorB;
public:
void init();
void forward();
void backward();
void rotateLeft();
void rotateRight();
void setSpeed(int8_t speed, uint8_t motorID);
void rotate(uint8_t direction, uint8_t motorID);
void stop();
};
extern MotorDriver motordriver;
#endif
| [
"chris314159@gmail.com"
] | chris314159@gmail.com |
6402a49e6184d15d57a69702bf567963d9ca18a1 | 04331306d6769224dedf8ea7ec54b2026f765bde | /include/VolleyBallPlayer.hpp | 01945716edd9bd190134f674fff93fbf189d4461 | [] | no_license | steciuk/PROI_2-sports-club | f1c991609fbe4c35d267d79f733d8df6751c9a64 | ed20db6a1e57e47e907b751b6ba8f3df92a540f6 | refs/heads/master | 2023-03-17T14:25:53.809544 | 2021-03-11T15:07:57 | 2021-03-11T15:07:57 | 186,284,985 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 629 | hpp | #ifndef VOLLEYBALLPLAYER_HPP
#define VOLLEYBALLPLAYER_HPP
#include <iostream>
#include <string>
#include "../include/Player.hpp"
#include "../include/SpecyficPlayer.hpp"
class VolleyBallPlayer : public Player, public SpecyficPlayer
{
private:
std::string position;
int height;
public:
VolleyBallPlayer(const std::string name, const std::string surname, const int shirtNumber, const std::string position, const int height);
VolleyBallPlayer();
~VolleyBallPlayer();
// std::string getInfo();
virtual void showPosition();
std::string getHeight();
};
#endif
| [
"steciuk77@gmail.com"
] | steciuk77@gmail.com |
116cf924e47c35f43ff8a4aba2760853a4a775b2 | 02ce8a5d3386aa639ef1c2c2fdd6da8d0de158f9 | /ACE-5.6.1/ACE_wrappers/apps/drwho/SMR_Client.h | 0f565b8901da12cae17dba13060111eca4e8af33 | [] | no_license | azraelly/knetwork | 932e27a22b1ee621742acf57618083ecab23bca1 | 69e30ee08d0c8e66c1cfb00d7ae3ba6983ff935c | refs/heads/master | 2021-01-20T13:48:24.909756 | 2010-07-03T13:59:39 | 2010-07-03T13:59:39 | 39,634,314 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 554 | h | /* -*- C++ -*- */
// $Id: SMR_Client.h 16777 1998-10-20 02:34:57Z levine $
// ============================================================================
//
// = LIBRARY
// drwho
//
// = FILENAME
// SMR_Client.h
//
// = AUTHOR
// Douglas C. Schmidt
//
// ============================================================================
#ifndef _SMR_CLIENT_H
#define _SMR_CLIENT_H
#include "SM_Client.h"
class SMR_Client : public SM_Client
{
public:
SMR_Client (short port_number);
virtual ~SMR_Client (void);
};
#endif /* _SMR_CLIENT_H */
| [
"yuwuxiong2010@gmail.com"
] | yuwuxiong2010@gmail.com |
fc77e6af2d3e9861820a216456a8fd973d190e83 | 57cd5d90e13bedf4f66c2dd3d5b73f298c55f024 | /GraphicEQ/Source/FilterComponent.h | 2bba17ce48db85cead81bbeac25c99185c9e5267 | [] | no_license | YanlanCai/GraphicEQ-1 | 2a9fa4a2deeeebfb418efed933e6a10aea0e3e18 | 308d34b5e09e7c3f71c2752c42699c1d6ff2f7da | refs/heads/master | 2023-03-01T22:03:48.052673 | 2021-02-10T21:34:43 | 2021-02-10T21:34:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,612 | h | /*
==============================================================================
FilterComponent.h
Created: 22 Dec 2020 1:15:04pm
Author: Arron Shah
==============================================================================
*/
#pragma once
#include <JuceHeader.h>
#include "Filter.h"
#include "UIElementProperties.h"
#include <memory>
#include "FilterResponseCurveComponent.h"
#include "AverageFilterResponseCurveComponent.h"
#include "Filter.h"
/** A component class for controlling a Filter object through UI elements.*/
/** Allows for the control of the filter frequency, resonance and gain through rotary sliders. Can also pass filter magnitude data to a FilterResponseCurveComponent.
@param vt a reference to a ValueTree object where the filter parameters will be stored.
@param type a filterType enum specifying the type of IIR filter (low shelf, high shelf or peak).
@see filterType
@see Filter
@see FilterResponseCurveComponent*/
class FilterComponent : public Component,
public Button::Listener,
public ValueTree::Listener
{
public:
/** Constructor
@param vt specifies the value tree to attach to UI elements
@param type speifies the type of the filter*/
FilterComponent(ValueTree& vt, enum filterType type);
/** Destructor */
~FilterComponent();
//Component
void paint (juce::Graphics& g) override;
void resized() override;
/** Sets the filter that this component controls
@param filterRef a pointer to a Filter object
@see Filter*/
void setFilter(Filter* filterRef);
/** Sets the filter response curve component that this component controls
@param frcc a pointer to a FilterResponseCurveComponent object
@see FilterResponseCurveComponent*/
void setFilterResponseComponent(FilterResponseCurveComponent* frcc);
/** Sets the AverageFilterResponseCurveComponent that this component sends data to
@param afrcc a pointer to an AverageFilterResponseCurveComponent object
@see AverageFilterResponseCurveComponent*/
void setAverageFilterResponseComponent(AverageFilterResponseCurveComponent* afrcc);
/** Passes a new parameter value to the filter that this component controls
@param parameterName specifies the name of the parameter (frequency/resonance/gain)
@param parameterValue specifies the value of the parameter*/
void updateFilterParameter(String parameterName, float parameterValue);
//Button listener
void buttonClicked(Button* button) override;
//ValueTree listener
void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged, const Identifier& property) override;
/** Updates all response curves affected by the filter that this component controls*/
void updateResponseCurves();
private:
Slider frequencySlider;
Slider gainSlider;
Slider resonanceSlider;
TextButton filterOn;
std::unique_ptr<ValueTreeSliderAttachment> frequencySliderAttachment;
std::unique_ptr<ValueTreeSliderAttachment> resonanceSliderAttachment;
std::unique_ptr<ValueTreeSliderAttachment> gainSliderAttachment;
FilterResponseCurveComponent* filterResponseComponent {nullptr};
Filter* filter {nullptr};
ValueTree filterSubTree;
ValueTree& valueTree;
float filterType = 0;;
AverageFilterResponseCurveComponent* averageFilterResponseCurveComponent {nullptr};
};
| [
"arron.shah@gmail.com"
] | arron.shah@gmail.com |
30d542c7ffeb6c2e447b4858039be2fe4e465190 | 8f11b828a75180161963f082a772e410ad1d95c6 | /tools/vision_tool_v2/src/Frame.cpp | cc6f259b0fd69c6a99ed82999d5924100f6d421e | [] | no_license | venkatarajasekhar/tortuga | c0d61703d90a6f4e84d57f6750c01786ad21d214 | f6336fb4d58b11ddfda62ce114097703340e9abd | refs/heads/master | 2020-12-25T23:57:25.036347 | 2017-02-17T05:01:47 | 2017-02-17T05:01:47 | 43,284,285 | 0 | 0 | null | 2017-02-17T05:01:48 | 2015-09-28T06:39:21 | C++ | UTF-8 | C++ | false | false | 14,173 | cpp | /*
* Copyright (C) 2008 Robotics at Maryland
* Copyright (C) 2008 Joseph Lisee <jlisee@umd.edu>
* All rights reserved.
*
* Author: Joseph Lisee <jlisee@umd.edu>
* File: tools/vision_tool/src/App.cpp
*/
// STD Includes
#include <iostream>
// Library Includes
#include <wx/frame.h>
#include <wx/menu.h>
#include <wx/sizer.h>
#include <wx/msgdlg.h>
#include <wx/dirdlg.h>
#include <wx/filedlg.h>
#include <wx/timer.h>
#include <wx/button.h>
#include <wx/textctrl.h>
#include <wx/utils.h>
#include <wx/filename.h>
#include <wx/stattext.h>
// For cvSaveImage
#include "highgui.h"
// Project Includes
#include "Frame.h"
#include "IPLMovie.h"
#include "MediaControlPanel.h"
#include "DetectorControlPanel.h"
#include "Model.h"
#include "vision/include/Image.h"
namespace ram {
namespace tools {
namespace visiontool {
BEGIN_EVENT_TABLE(Frame, wxFrame)
EVT_MENU(ID_Quit, Frame::onQuit)
EVT_MENU(ID_About, Frame::onAbout)
EVT_MENU(ID_OpenFile, Frame::onOpenFile)
EVT_MENU(ID_OpenCamera, Frame::onOpenCamera)
EVT_MENU(ID_OpenForwardCamera, Frame::onOpenForwardCamera)
EVT_MENU(ID_OpenDownwardCamera, Frame::onOpenDownwardCamera)
EVT_MENU(ID_SetDir, Frame::onSetDirectory)
EVT_MENU(ID_SaveImage, Frame::onSaveImage)
EVT_MENU(ID_SaveAsImage, Frame::onSaveAsImage)
END_EVENT_TABLE()
Frame::Frame(const wxString& title, const wxPoint& pos, const wxSize& size) :
wxFrame((wxFrame *)NULL, -1, title, pos, size),
m_mediaControlPanel(0),
m_rawMovie(0),
m_detectorMovie(0),
m_model(new Model),
m_idNum(1)
{
// File Menu
wxMenu *menuFile = new wxMenu;
menuFile->Append(ID_OpenFile, _T("Open Video &File"));
menuFile->Append(ID_OpenCamera, _T("Open Local CV &Camera"));
menuFile->Append(ID_OpenForwardCamera, _T("Open tortuga4:50000"));
menuFile->Append(ID_OpenDownwardCamera, _T("Open tortuga4:50001"));
menuFile->Append(ID_About, _T("&About..."));
menuFile->AppendSeparator();
menuFile->Append(ID_Quit, _T("E&xit\tCtrl+Q"));
// Image Menu
wxMenu *menuImage = new wxMenu;
menuImage->Append(ID_SetDir, _T("Set &Directory..."));
menuImage->AppendSeparator();
menuImage->Append(ID_SaveImage, _T("&Save\tCtrl+S"));
menuImage->Append(ID_SaveAsImage, _T("Save &Image..."));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menuFile, _T("&File") );
menuBar->Append( menuImage, _T("&Image") );
SetMenuBar( menuBar );
// Create our controls
m_mediaControlPanel = new MediaControlPanel(m_model, this);
m_rawMovie = new IPLMovie(this, m_model, Model::NEW_RAW_IMAGE);
m_detectorMovie = new IPLMovie(this, m_model, Model::NEW_PROCESSED_IMAGE);
m_ch1Movie = new IPLMovie(this, m_model, Model::NEW_CH1_IMAGE, wxSize(320, 240));
m_ch2Movie = new IPLMovie(this, m_model, Model::NEW_CH2_IMAGE, wxSize(320, 240));
m_ch3Movie = new IPLMovie(this, m_model, Model::NEW_CH3_IMAGE, wxSize(320, 240));
m_ch1HistMovie = new IPLMovie(this, m_model, Model::NEW_CH1_HIST_IMAGE,
wxSize(120, 120));
m_ch2HistMovie = new IPLMovie(this, m_model, Model::NEW_CH2_HIST_IMAGE,
wxSize(120, 120));
m_ch3HistMovie = new IPLMovie(this, m_model, Model::NEW_CH3_HIST_IMAGE,
wxSize(120, 120));
m_ch12HistMovie = new IPLMovie(this, m_model, Model::NEW_CH12_HIST_IMAGE,
wxSize(120, 120));
m_ch23HistMovie = new IPLMovie(this, m_model, Model::NEW_CH23_HIST_IMAGE,
wxSize(120, 120));
m_ch13HistMovie = new IPLMovie(this, m_model, Model::NEW_CH13_HIST_IMAGE,
wxSize(120, 120));
wxButton* config = new wxButton(this, wxID_ANY, wxT("Config File"));
wxString defaultPath;
wxGetEnv(_T("RAM_SVN_DIR"), &defaultPath);
m_configText = new wxTextCtrl(this, wxID_ANY, defaultPath,
wxDefaultPosition, wxDefaultSize,
wxTE_READONLY);
wxButton* detectorHide = new wxButton(this, wxID_ANY,
wxT("Show/Hide Detector"));
// Place controls in the sizer
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(m_mediaControlPanel, 0, wxEXPAND, 0);
wxBoxSizer* row = new wxBoxSizer(wxHORIZONTAL);
row->Add(config, 0, wxALL, 3);
row->Add(m_configText, 1, wxALIGN_CENTER | wxTOP | wxBOTTOM, 3);
row->Add(detectorHide, 0, wxALL, 3);
sizer->Add(row, 0, wxEXPAND, 0);
wxBoxSizer* movieTitleSizer = new wxBoxSizer(wxHORIZONTAL);
movieTitleSizer->Add(
new wxStaticText(this, wxID_ANY, _T("Raw Image")),
1, wxEXPAND | wxALL, 2);
movieTitleSizer->Add(
new wxStaticText(this, wxID_ANY, _T("Detector Debug Output")),
1, wxEXPAND | wxALL, 2);
m_rawMovie->SetWindowStyle(wxBORDER_RAISED);
m_detectorMovie->SetWindowStyle(wxBORDER_RAISED);
wxBoxSizer* movieSizer = new wxBoxSizer(wxHORIZONTAL);
movieSizer->Add(m_rawMovie, 1, wxSHAPED | wxALL, 2);
movieSizer->Add(m_detectorMovie, 1, wxSHAPED | wxALL, 2);
sizer->Add(movieTitleSizer, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
sizer->Add(movieSizer, 4, wxEXPAND | wxLEFT | wxRIGHT, 5);
// Single Channel Histogram Sizers
wxBoxSizer *ch1HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch1HistText = new wxStaticText(this, wxID_ANY, _T("Ch1 Hist"));
ch1HistSizer->Add(ch1HistText, 0, wxEXPAND | wxALL, 1);
ch1HistSizer->Add(m_ch1HistMovie, 1, wxSHAPED);
wxBoxSizer *ch2HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch2HistText = new wxStaticText(this, wxID_ANY, _T("Ch2 Hist"));
ch2HistSizer->Add(ch2HistText, 0, wxEXPAND | wxALL, 1);
ch2HistSizer->Add(m_ch2HistMovie, 1, wxSHAPED);
wxBoxSizer *ch3HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch3HistText = new wxStaticText(this, wxID_ANY, _T("Ch3 Hist"));
ch3HistSizer->Add(ch3HistText, 0, wxEXPAND | wxALL, 1);
ch3HistSizer->Add(m_ch3HistMovie, 1, wxSHAPED);
// 2D Histogram Sizers
wxBoxSizer *ch12HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch12HistText = new wxStaticText(this, wxID_ANY, _T("Ch1 vs. Ch2 Hist"));
ch12HistSizer->Add(ch12HistText, 0, wxEXPAND | wxALL, 1);
ch12HistSizer->Add(m_ch12HistMovie, 1, wxSHAPED);
wxBoxSizer *ch23HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch23HistText = new wxStaticText(this, wxID_ANY, _T("Ch2 vs. Ch3 Hist"));
ch23HistSizer->Add(ch23HistText, 0, wxEXPAND | wxALL, 1);
ch23HistSizer->Add(m_ch23HistMovie, 1, wxSHAPED);
wxBoxSizer *ch13HistSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText *ch13HistText = new wxStaticText(this, wxID_ANY, _T("Ch1 vs. Ch3 Hist"));
ch13HistSizer->Add(ch13HistText, 0, wxEXPAND | wxALL, 1);
ch13HistSizer->Add(m_ch13HistMovie, 1, wxSHAPED);
// Overall Sizer for Histograms
wxFlexGridSizer *histImgMovieSizer = new wxFlexGridSizer(2, 3, 0, 0);
histImgMovieSizer->Add(ch1HistSizer, 1, wxEXPAND | wxALL, 1);
histImgMovieSizer->Add(ch2HistSizer, 1, wxEXPAND | wxALL, 1);
histImgMovieSizer->Add(ch3HistSizer, 1, wxEXPAND | wxALL, 1);
histImgMovieSizer->Add(ch12HistSizer, 1, wxEXPAND | wxALL, 1);
histImgMovieSizer->Add(ch23HistSizer, 1, wxEXPAND | wxALL, 1);
histImgMovieSizer->Add(ch13HistSizer, 1, wxEXPAND | wxALL, 1);
// Individual Channel Image Sizers
wxBoxSizer *ch1Sizer = new wxBoxSizer(wxVERTICAL);
ch1Sizer->Add(
new wxStaticText(this, wxID_ANY, _T("Channel 1"), wxDefaultPosition,
wxDefaultSize, wxALIGN_LEFT),
0, wxEXPAND | wxLEFT | wxRIGHT, 5);
ch1Sizer->Add(m_ch1Movie, 1, wxSHAPED);
wxBoxSizer *ch2Sizer = new wxBoxSizer(wxVERTICAL);
ch2Sizer->Add(
new wxStaticText(this, wxID_ANY, _T("Channel 2"), wxDefaultPosition,
wxDefaultSize, wxALIGN_LEFT),
0, wxEXPAND | wxLEFT | wxRIGHT, 5);
ch2Sizer->Add(m_ch2Movie, 1, wxSHAPED);
wxBoxSizer *ch3Sizer = new wxBoxSizer(wxVERTICAL);
ch3Sizer->Add(
new wxStaticText(this, wxID_ANY, _T("Channel 3"), wxDefaultPosition,
wxDefaultSize, wxALIGN_LEFT),
0, wxEXPAND | wxLEFT | wxRIGHT, 5);
ch3Sizer->Add(m_ch3Movie, 1, wxSHAPED);
wxBoxSizer *smallMovieSizer = new wxBoxSizer(wxHORIZONTAL);
smallMovieSizer->Add(ch1Sizer, 1, wxSHAPED | wxALL, 2);
smallMovieSizer->Add(ch2Sizer, 1, wxSHAPED | wxALL, 2);
smallMovieSizer->Add(ch3Sizer, 1, wxSHAPED | wxALL, 2);
smallMovieSizer->Add(histImgMovieSizer, 1, wxEXPAND | wxALL, 2);
sizer->Add(smallMovieSizer, 2, wxEXPAND | wxRIGHT | wxLEFT | wxBOTTOM, 5);
sizer->SetSizeHints(this);
SetSizer(sizer);
// Create the seperate frame for the detector panel
wxPoint framePosition = GetPosition();
framePosition.x += GetSize().GetWidth();
wxSize frameSize(GetSize().GetWidth()/3, GetSize().GetHeight());
m_detectorFrame =
new wxFrame(this, wxID_ANY, _T("Detector Control"),
framePosition, frameSize);
// Add a sizer and the detector control panel to it
sizer = new wxBoxSizer(wxVERTICAL);
wxPanel* detectorControlPanel = new DetectorControlPanel(
m_model, m_detectorFrame);
sizer->Add(detectorControlPanel, 1, wxEXPAND, 0);
m_detectorFrame->SetSizer(sizer);
m_detectorFrame->Show();
// Register for events
Connect(detectorHide->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(Frame::onShowHideDetector));
Connect(config->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(Frame::onSetConfigPath));
// Connect(GetId(), wxEVT_CLOSE_WINDOW,
// wxCloseEventHandler(Frame::onClose), this);
// Connect(m_detectorFrame->GetId(), wxEVT_CLOSE_WINDOW,
// wxCloseEventHandler(Frame::onDetectorFrameClose), this);
}
void Frame::onQuit(wxCommandEvent& WXUNUSED(event))
{
m_model->stop();
Close(true);
}
void Frame::onClose(wxCloseEvent& event)
{
// Stop video playback when we shut down
Destroy();
}
void Frame::onAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_T("An application to view live or recored video"),
_T("About Vision Tool"), wxOK | wxICON_INFORMATION, this);
}
void Frame::onOpenFile(wxCommandEvent& event)
{
wxString filepath = wxFileSelector(_T("Choose a video file to open"));
if ( !filepath.empty() )
{
// Have the model open the file
m_model->openFile(std::string(filepath.mb_str()));
// Place the file name in the title bar
wxString filename;
wxString extension;
wxFileName::SplitPath(filepath, NULL, &filename, &extension);
SetTitle(wxString(_T("Vision Tool - ")) + filename + _T(".") +
extension);
}
}
void Frame::onOpenCamera(wxCommandEvent& event)
{
m_model->openCamera();
}
void Frame::onOpenForwardCamera(wxCommandEvent& event)
{
m_model->openNetworkCamera("tortuga4", 50000);
}
void Frame::onOpenDownwardCamera(wxCommandEvent& event)
{
m_model->openNetworkCamera("tortuga4", 50001);
}
void Frame::onSetDirectory(wxCommandEvent& event)
{
wxDirDialog chooser(this);
int id = chooser.ShowModal();
if (id == wxID_OK) {
m_saveDir = chooser.GetPath();
m_idNum = 1;
}
}
bool Frame::saveImage(wxString pathname, bool suppressError)
{
vision::Image* image = m_model->getLatestImage();
image->setPixelFormat(ram::vision::Image::PF_BGR_8);
// Check that there is an image to save
if (image == NULL) {
// Don't create the message dialog if we suppress the window
if (suppressError)
return false;
// Create a message saying there was an error saving
wxMessageDialog messageWindow(this,
_T("Error: Could not save the image.\n"
"(The video cannot be playing while "
"saving an image)"),
_T("ERROR!"), wxOK);
messageWindow.ShowModal();
return false;
}
// No error, save the image
image->setPixelFormat(ram::vision::Image::PF_BGR_8);
cvSaveImage(pathname.mb_str(wxConvUTF8),
image->asIplImage());
return true;
}
void Frame::onSaveAsImage(wxCommandEvent& event)
{
wxFileDialog saveWindow(this, _T("Save file..."), _T(""), _T(""),
_T("*.*"), wxSAVE | wxOVERWRITE_PROMPT);
int result = saveWindow.ShowModal();
if (result == wxID_OK) {
saveImage(saveWindow.GetPath());
}
}
wxString Frame::numToString(int num)
{
wxString s = wxString::Format(_T("%d"), num);
short zeros = 4 - s.length();
wxString ret;
ret.Append(_T('0'), zeros);
ret.Append(s);
ret.Append(_T(".png"));
return ret;
}
void Frame::onSaveImage(wxCommandEvent& event)
{
// Save to the default path
// Find a file that doesn't exist
wxFileName filename(m_saveDir, numToString(m_idNum));
while (filename.FileExists()) {
m_idNum++;
filename = wxFileName(m_saveDir, numToString(m_idNum));
}
wxString fullpath(filename.GetFullPath());
std::cout << "Quick save to " << fullpath.mb_str(wxConvUTF8) << std::endl;
// Save image and suppress any error to be handled by this function
bool ret = saveImage(fullpath, true);
if (!ret) {
std::cerr << "Quick save failed. Try stopping the video.\n";
}
}
void Frame::onShowHideDetector(wxCommandEvent& event)
{
// Toggle the shown status of the frame
m_detectorFrame->Show(!m_detectorFrame->IsShown());
}
void Frame::onDetectorFrameClose(wxCloseEvent& event)
{
// If we don't have to close, just hide the window
if (event.CanVeto())
{
m_detectorFrame->Hide();
event.Veto();
}
else
{
m_detectorFrame->Destroy();
}
}
void Frame::onSetConfigPath(wxCommandEvent& event)
{
wxString filename = wxFileSelector(_T("Choose a config file"),
m_configText->GetValue());
if ( !filename.empty() )
{
m_configText->SetValue(filename);
m_model->setConfigPath(std::string(filename.mb_str()));
}
}
} // namespace visiontool
} // namespace tools
} // namespace ram
| [
"jwonders88@gmail.com"
] | jwonders88@gmail.com |
8fc389b85b15103939b4310d09c997be05cc5389 | 964a25cedee5c447cd79ad9f3934ca6ccece50a0 | /pitypes.h | fbb07ff088601919e5ab072ce7c539641b779b78 | [] | no_license | sivabudh/pism | a08d076a7fbc53bcf4c36ffd29a60205dbbaa6ba | 4e39d09ec8c2205cc648dee10973044c12217b69 | refs/heads/master | 2020-03-27T01:15:49.682785 | 2018-08-24T06:49:11 | 2018-08-24T06:49:11 | 145,695,012 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 253 | h | #pragma once
using PumpID = int;
namespace PITHUNDER {
struct Messages
{
PumpID pumpId;
PumpID m_unit_id() // To mimic the real Messages members
{
return pumpId;
}
};
}
struct PumpServiceRequest
{
PumpID pumpId;
};
| [
"sivabudh.u@codium.co"
] | sivabudh.u@codium.co |
78d569688c308c3406677a7fd13ec4f4db0f9dbb | fabe2d9262ed0404f796d1b2cba4ffc5a83c7ff1 | /chapter9/9-2.cpp | 935227f316ff4748c38790c539efd99e2e7f8753 | [
"MIT"
] | permissive | GSNICE/ZK_04743 | 20ceece3ea8e7e9a979ea16690a8b913e7a391f5 | 7e49fc5045cc127c72a14d1717c34c939871f1d0 | refs/heads/master | 2023-04-06T17:03:50.816210 | 2020-09-06T03:09:49 | 2020-09-06T03:09:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 904 | cpp | #include <iostream>
using namespace std;
template<class T> //类类型T
void Swap(T &x, T &y) //可以交换类对象
{
T tmp = x;
x = y;
y = tmp;
}
class myDate
{
public:
myDate();
myDate(int, int, int);
void printDate()const;
private:
int year, month, day;
};
myDate::myDate()
{
year = 1970;
month = 1;
day = 1;
}
myDate::myDate(int y, int m, int d)
{
year = y;
month = m;
day = d;
}
void myDate::printDate()const
{
cout << year << "/" << month << "/" << day;
return;
}
int main()
{
int n = 1, m = 2;
Swap(n, m); //编译器自动生成void Swap(int &, int &)函数
double f = 1.2, g = 2.3;
Swap(f, g); //编译器自动生成void Swap(double &, double &)函数
myDate d1, d2(2000,1,1);
Swap(d1, d2); //编译器自动生成void Swap(myDate &, myDate &)函数
return 0;
}
| [
"wewin-tech@foxmail.com"
] | wewin-tech@foxmail.com |
7aa985f8667e5c5c379856199f920b7ca89b37ef | a963d48092f5a27b0875db68d673065b13398895 | /boost_lib/boost_1_55_0-windows/libs/asio/example/cpp11/echo/async_tcp_echo_server.cpp | cbdca9b2206cea42c83f9360cd927e984c281a00 | [] | no_license | james1023/test_boost | 219130db778bff512555bb29e5e59afaf59594b6 | 11100d6a913d5c5411f89ff3a32b7e654e91a104 | refs/heads/master | 2020-05-20T12:19:36.754779 | 2017-03-02T03:30:01 | 2017-03-02T03:30:01 | 35,875,247 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,332 | cpp | //
// async_tcp_echo_server.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// 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)
//
#include <cstdlib>
#include <iostream>
#include <memory>
#include <utility>
#include <boost/asio.hpp>
using boost::asio::ip::tcp;
class session
: public std::enable_shared_from_this<session>
{
public:
session(tcp::socket socket)
: socket_(std::move(socket))
{
}
void start()
{
do_read();
}
private:
void do_read()
{
auto self(shared_from_this());
socket_.async_read_some(boost::asio::buffer(data_, max_length),
[this, self](boost::system::error_code ec, std::size_t length)
{
if (!ec)
{
do_write(length);
}
});
}
void do_write(std::size_t length)
{
auto self(shared_from_this());
boost::asio::async_write(socket_, boost::asio::buffer(data_, length),
[this, self](boost::system::error_code ec, std::size_t /*length*/)
{
if (!ec)
{
do_read();
}
});
}
tcp::socket socket_;
enum { max_length = 1024 };
char data_[max_length];
};
class server
{
public:
server(boost::asio::io_service& io_service, short port)
: acceptor_(io_service, tcp::endpoint(tcp::v4(), port)),
socket_(io_service)
{
do_accept();
}
private:
void do_accept()
{
acceptor_.async_accept(socket_,
[this](boost::system::error_code ec)
{
if (!ec)
{
std::make_shared<session>(std::move(socket_))->start();
}
do_accept();
});
}
tcp::acceptor acceptor_;
tcp::socket socket_;
};
int main(int argc, char* argv[])
{
try
{
if (argc != 2)
{
std::cerr << "Usage: async_tcp_echo_server <port>\n";
return 1;
}
boost::asio::io_service io_service;
server s(io_service, std::atoi(argv[1]));
io_service.run();
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
}
| [
"james.huang@avtech.com.tw"
] | james.huang@avtech.com.tw |
055519c22765e7c9c479d38ea79d8178633116aa | a6a2227aabdc178696aaf47d6f0beda4f659b0c8 | /jul17&18/509_A.cpp | 2fa7da8a5503fb96ffa2c9a1266ac3e5ebbe512b | [] | no_license | girach/codeforces | 2f49c674d0daa39ca389be901a08344be834cc2f | 8808180d8ba9ebc739db235cc17b7e91c2f71975 | refs/heads/master | 2020-03-21T08:52:03.358029 | 2018-06-23T19:08:58 | 2018-06-23T19:08:58 | 138,370,109 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 264 | cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n][n] = {0};
for (int i=0;i<n;i++) {
a[i][0]= a[0][i] = 1;
}
for (int i=1;i<n;i++) {
for (int j=1;j<n;j++) {
a[i][j] = a[i-1][j]+a[i][j-1];
}
}
cout << a[n-1][n-1];
} | [
"mdbilalgirach7@gmail.com"
] | mdbilalgirach7@gmail.com |
2d6a57562d217e04b1ea159ba6b85355d402ac1d | 5829edf0fadec5b79878f87db05b6222806106d6 | /src/math/filter/LeastSquareFilter.cpp | 934f3f28fcc449fc19c6a9b9e7141f85c9da6c67 | [] | no_license | Hadjubuntu/breeze-bb | 3636aa334b630bfa63be81f88e08036366ce6cca | b4a271baad0ccf76c527662cb572dab741bf7965 | refs/heads/master | 2021-04-18T23:14:01.022777 | 2017-04-14T07:06:50 | 2017-04-14T07:06:50 | 56,091,357 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,251 | cpp | /**
* breeze-arm
* LeastSquare.cpp
* ----------------------------
*
* ----------------------------
* Created on: Jan 22, 2016
* Author: Adrien HADJ-SALAH
*/
#include <stdio.h>
#include "LeastSquareFilter.h"
LeastSquareFilter::LeastSquareFilter()
{
// Default constructor
}
void LeastSquareFilter::genericComputeLinearFunc(float *res, std::vector<float> X, std::vector<float> Y)
{
int n = Y.size();
res[0] = 0.0;
res[1] = 0.0;
if (n > 0) {
float meanX = mean(X);
std::vector<float> x_minus_meanx = addScalar(X, -meanX);
std::vector<float> x_minus_meanx_square = product(x_minus_meanx, x_minus_meanx);
float SSxx = sum(x_minus_meanx_square);
//
float sumY = sum(Y);
float sumX = n * (n-1) / 2.0;
std::vector<float> x_product_y = product(X, Y);
float SSxy = sum(x_product_y) - sumX * sumY / n;
//
float b1 = 0.0;
if (SSxx != 0.0) {
b1 = SSxy / SSxx;
}
float b0 = sumY / n - b1 * sumX / n;
res[0] = b0;
res[1] = b1;
}
}
float LeastSquareFilter::apply(std::vector<float> Y, int idx)
{
// Compute linear function parameter
int n = Y.size();
float func[2];
std::vector<float> X = createSimpleVector(n);
genericComputeLinearFunc(func, X, Y);
printf("func %.2f\n",func[0]);
// Use idx + 1 to simulate "future"
return func[0] + func[1] * (idx+1);
}
std::vector<float> LeastSquareFilter::createSimpleVector(int n)
{
std::vector<float> res;
res.reserve(n);
for (int i = 0; i < n; i ++)
{
res.push_back((float) i);
}
return res;
}
float LeastSquareFilter::mean(std::vector<float> pX)
{
int n = pX.size();
int sum = 0;
for (int v: pX) {
sum += v;
}
return ((float)sum) / n;
}
std::vector<float> LeastSquareFilter::addScalar(std::vector<float> pVect, float pScalar)
{
std::vector<float> res;
int n = pVect.size();
res.reserve(n);
for (int v: pVect)
{
res.push_back(v + pScalar);
}
return res;
}
std::vector<float> LeastSquareFilter::product(std::vector<float> A, std::vector<float> B)
{
std::vector<float> res;
int n = A.size();
res.reserve(n);
for (int i=0; i < n; i ++)
{
res.push_back(A.at(i) * B.at(i));
}
return res;
}
float LeastSquareFilter::sum(std::vector<float> A)
{
float res = 0.0;
for (float v : A)
{
res += v;
}
return res;
}
| [
"adrien.hadj.salah@gmail.com"
] | adrien.hadj.salah@gmail.com |
03191aa8199bbb505860b9ab744b25e96ee4902a | fb3dcc33e7eb9b22d77bc69d56b9e186da931709 | /source/GameState.h | 599ce55cb2222dd54d52a4f12c55aca06662cfca | [] | no_license | xiaoqian19940510/sparcraft | 796460aca14a36307daceaf6fe78f24e215dbeb4 | 00b98d30ac7b213c72b443aa6c8b9515e21ac9a4 | refs/heads/master | 2020-03-20T03:50:33.947882 | 2014-05-11T00:49:08 | 2014-05-11T00:49:08 | 137,161,451 | 4 | 0 | null | 2018-06-13T04:12:09 | 2018-06-13T04:12:08 | null | UTF-8 | C++ | false | false | 8,721 | h | #pragma once
#include "Common.h"
#include <algorithm>
#include "MoveArray.h"
#include "Hash.h"
#include "Map.h"
#include "Unit.h"
#include "GraphViz.hpp"
#include "Array.hpp"
typedef boost::shared_ptr<SparCraft::Map> MapPtr;
namespace SparCraft
{
class GameState
{
Map _map;
Array2D<Unit, Constants::Num_Players, Constants::Max_Units> _units;
Array2D<int, Constants::Num_Players, Constants::Max_Units> _unitIndex;
Array<Unit, 1> _neutralUnits;
Array<UnitCountType, Constants::Num_Players> _numUnits;
Array<UnitCountType, Constants::Num_Players> _prevNumUnits;
Array<float, Constants::Num_Players> _totalLTD;
Array<float, Constants::Num_Players> _totalSumSQRT;
Array<int, Constants::Num_Players> _numMovements;
Array<int, Constants::Num_Players> _prevHPSum;
TimeType _currentTime;
size_t _maxUnits;
TimeType _sameHPFrames;
// checks to see if the unit array is full before adding a unit to the state
bool checkFull(const IDType & player) const;
bool checkUniqueUnitIDs() const;
void performUnitAction(const UnitAction & theMove);
public:
bool checkCollisions;
GameState();
GameState(const std::string & filename);
// misc functions
void finishedMoving();
void beforeMoving();
void updateGameTime();
bool playerDead(const IDType & player) const;
bool isTerminal() const;
// unit data functions
size_t numUnits(const IDType & player) const;
size_t prevNumUnits(const IDType & player) const;
size_t numNeutralUnits() const;
size_t closestEnemyUnitDistance(const Unit & unit) const;
// Unit functions
void sortUnits();
void addUnit(const Unit & u);
void addUnitClosestLegalPos(const Unit & u);
void addUnit(const BWAPI::UnitType unitType, const IDType playerID, const Position & pos);
void addUnitWithID(const Unit & u);
void addNeutralUnit(const Unit & unit);
const Unit & getUnit(const IDType & player, const UnitCountType & unitIndex) const;
const Unit & getUnitByID(const IDType & unitID) const;
Unit & getUnit(const IDType & player, const UnitCountType & unitIndex);
const Unit & getUnitByID(const IDType & player, const IDType & unitID) const;
Unit & getUnitByID(const IDType & player, const IDType & unitID);
boost::optional<const Unit&> getUnitByIDOpt(const IDType & player, const IDType & unitID) const;
boost::optional<const Unit&> getUnitByIDOpt(const IDType & unitID) const;
const Unit& getClosestEnemyUnit(const IDType & player, const IDType & unitIndex) const;
const Unit& getClosestOurUnit(const IDType & player, const IDType & unitIndex) const;
bool isPowered(const SparCraft::Position &pos, const IDType & player) const;
const boost::optional<const Unit&> getClosestEnemyUnitOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestEnemyThreatOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestEnemyBuildingOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurUnitOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurBuildingOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurDamagedBuildingOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurWoundedUnitOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurPylonOpt(const IDType & player, const IDType & unitIndex) const;
const boost::optional<const Unit&> getClosestOurPylonOpt(const IDType & player, const SparCraft::Position &pos) const;
std::vector<IDType> getUnitIDs(const IDType & player) const;
std::vector<IDType> getBuildingIDs(const IDType & player) const;
std::vector<IDType> getAliveUnitIDs(const IDType & player) const;
std::vector<IDType> getAliveBuildingIDs(const IDType & player) const;
bool hasMobileAttackUnits(IDType player) const;
bool hasDamageDealingUnits(IDType player) const;
std::vector<IDType> getAliveUnitsInCircleIDs(IDType player, const Position &pos, int radius) const;
const Unit & getUnitDirect(const IDType & player, const IDType & unit) const;
const Unit & getNeutralUnit(const size_t & u) const;
// game time functions
void setTime(const TimeType & time);
TimeType getTime() const;
// evaluation functions
StateEvalScore eval( const IDType & player, const IDType & evalMethod,
const IDType p1Script = PlayerModels::NOKDPS,
const IDType p2Script = PlayerModels::NOKDPS) const;
ScoreType evalLTD(const IDType & player) const;
ScoreType evalLTD2(const IDType & player) const;
ScoreType LTD(const IDType & player) const;
ScoreType LTD2(const IDType & player) const;
StateEvalScore evalSim(const IDType & player, const IDType & p1, const IDType & p2) const;
IDType getEnemy(const IDType & player) const;
// unit hitpoint calculations, needed for LTD2 evaluation
void calculateStartingHealth();
void setTotalLTD(const float & p1, const float & p2);
void setTotalLTD2(const float & p1, const float & p2);
const float & getTotalLTD(const IDType & player) const;
const float & getTotalLTD2(const IDType & player) const;
// move related functions
void generateMoves(MoveArray & moves, const IDType & playerIndex) const;
void makeMoves(const std::vector<UnitAction> & moves);
const int & getNumMovements(const IDType & player) const;
IDType whoCanMove() const;
bool bothCanMove() const;
// map-related functions
void setMap(const Map & map);
const Map & getMap() const;
bool isWalkable(const Position & pos) const;
bool isFlyable(const Position & pos) const;
// hashing functions
HashType calculateHash(const size_t & hashNum) const;
// state i/o functions
void print(int indent = 0) const;
void write(const std::string & filename) const;
void read(const std::string & filename);
};
}
| [
"nbarriga@gmail.com"
] | nbarriga@gmail.com |
35b4df56d927df86e0ac27fcf8ed79d7551a6134 | d114891078cb1954594daeaa4c0be5716859918a | /LabWork4/Cylinder.cpp | 48b99fa48f71c1c391441b58d524e33fc071e5ff | [] | no_license | LevKostychenko/4LabWork | 9896b249ea24df178f24b4a9d2787f972ca29bac | 5387b16ed067eb1c598197001ff7e38367274b37 | refs/heads/master | 2020-08-05T17:34:10.172894 | 2019-10-03T17:15:42 | 2019-10-03T17:15:42 | 212,635,398 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 826 | cpp | #include "pch.h"
#include "Cylinder.h"
Cylinder::Cylinder(double xa, double ya, double za,
double xb, double yb, double zb,
double xc, double yc, double zc)
{
this->Radius = sqrt(pow((xa - xb), 2) + pow((ya - yb), 2) + pow((za - zb), 2));
this->Height = sqrt(pow((xa - xc), 2) + pow((ya - yc), 2) + pow((za - zc), 2));
}
Cylinder::Cylinder(Point a, Point b, Point c)
{
this->Radius = sqrt(pow((a.X - b.X), 2) + pow((a.Y - b.Y), 2) + pow((a.Z - b.Z), 2));
this->Height = sqrt(pow((a.X - c.X), 2) + pow((a.Y - c.Y), 2) + pow((a.Z - c.Z), 2));
}
double Cylinder::GetArea()
{
return 2 * M_PI * this->Height * this->Radius;
}
double Cylinder::GetVolume()
{
return M_PI * pow(this->Radius, 2) * this->Height;
}
void Cylinder::PrintName()
{
std::cout << "This is Cylinder!" << std::endl;
}
Cylinder::~Cylinder()
{
}
| [
"lev.kostychenko@gmail.com"
] | lev.kostychenko@gmail.com |
b90614f9cdfb67709b7c24f848f8afca8f250ec0 | 3503ca10b545f4a758e7f50e6170909a45cbb544 | /2829.cpp | e58894c19332dd15a55da54471430d6a5f4d996a | [] | no_license | YongHoonJJo/BOJ | 531f660e841b7e9dce2afcf1f16a4acf0b408f32 | 575caa436abdb69eae48ac4d482365e4801c8a08 | refs/heads/master | 2021-05-02T18:32:33.936520 | 2019-06-22T17:16:13 | 2019-06-22T17:16:13 | 63,855,378 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 846 | cpp | #include <stdio.h>
int n, m[402][402];
int sumA[402][402], sumB[402][402];
int ans = -987654321;
int max(int a, int b)
{
return a > b ? a : b;
}
int go(int i, int j, int k)
{
int A=-100000000, B=0;
if(i+k <=n && j+k <=n) {
A = sumA[i+k][j+k]-sumA[i-1][j-1];
}
j += k;
if(j-k > 0 && i+k <= n) {
B = sumB[i+k][j-k]-sumB[i-1][j+1];
}
return A-B;
}
int main()
{
int i, j, k;
scanf("%d", &n);
for(i=1; i<=n; i++) {
for(j=1; j<=n; j++) {
scanf("%d", &m[i][j]);
sumA[i][j] = sumB[i][j] = m[i][j];
}
}
for(i=2; i<=n; i++) {
for(j=2; j<=n; j++)
sumA[i][j] += sumA[i-1][j-1];
}
for(i=2; i<=n; i++) {
for(j=1; j<n; j++)
sumB[i][j] += sumB[i-1][j+1];
}
for(i=1; i<=n; i++) {
for(j=1; j<=n; j++) {
for(k=0; k<n; k++) {
ans = max(ans, go(i, j, k));
}
}
}
printf("%d\n", ans);
return 0;
}
| [
"starctak@gmail.com"
] | starctak@gmail.com |
d0a3b70c348401ad2ac378832da2925eccf84dfc | 66c9d369172413174e8e21ed4049fc7a4fcbcba3 | /jhljx的GC处理.cpp | 09ff5483ff47c27ca9493480b87e70c9917c8a8d | [] | no_license | Xrvitd/C_code | f145d629a0e3fc36eef4721f649ccaa2c0567f5d | caf03c0ccb2413ff4b768f1e7bddc882de3bb825 | refs/heads/master | 2020-03-10T04:56:45.196112 | 2018-04-12T07:02:54 | 2018-04-12T07:02:54 | 129,205,311 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,325 | cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cstdlib>
#include<string>
#include<bitset>
#include<iomanip>
#include<deque>
#define INF 1000000000
#define fi first
#define se second
#define N 100005
#define P 1000000007
#define debug(x) cerr<<#x<<"="<<x<<endl
#define MP(x,y) make_pair(x,y)
using namespace std;
int n,m,a[1000001];
inline int get_num()
{
int num = 0;
char c;
bool flag = false;
while ((c = getchar()) == ' ' || c == '\n' || c == '\r');
if (c == '-') flag = true;
else num = c - '0';
while (isdigit(c = getchar()))
num = num * 10 + c - '0';
return (flag ? -1 : 1) * num;
}
bool pd(int x)
{
int k=0;
for(int i=1;i<=n;i++)
{
if(a[i])
{
i=i+x-1;
k++;
if(k>m)return 0;
}
}
return 1;
}
int just_doit()
{
int l=0,r=n,mid;
while(l<r)
{
mid=(l+r)>>1;
if(pd(mid))
{
r=mid;
}else
{
l=mid+1;
}
}
return l;
}
int main()
{
int k=0;
while(cin>>n>>m)
{
k++;
string s;
cin>>s;
for(int i=1;i<=n;i++)
{
a[i]=s[i-1]-'0';
}
if(m==0||n==0)
{
cout<<"Case "<<k<<": "<<0<<"\n";
continue;
}
cout<<"Case "<<k<<": "<<just_doit()<<"\n";
}
}
| [
"noreply@github.com"
] | noreply@github.com |
094600ab726d994ac5f2c411df5f40cbd7b0d9f3 | 87fbbc3f396a8216653db5c50f0564e5ada7d824 | /geos_test/collection/flowcollection.cpp | 3a90189c2850b94cdfcc6f90c6f98ed6639ffa5a | [] | no_license | Jzjsnow/geos_test | 5b0ac24c591bb2f3cf9bb34c2c59024d98b3194a | c2346ef167a8f7b23f0f22b508926a8b1dc128b1 | refs/heads/master | 2020-08-29T05:20:12.973700 | 2019-10-28T01:13:24 | 2019-10-28T01:13:24 | 217,940,979 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 944 | cpp | #include "flowcollection.h"
//#include "gdal_priv.h"
flowcollection::flowcollection(string filename, bool with_headers, string delimeter)
{
string templine;
ifstream ifs(filename);
vector<flowdata> tempflows;
while (getline(ifs, templine))
{
if (with_headers)
{
with_headers = 0;
continue;
}
try {
//vector<string> strVec=auxiliary_func::split(templine,",");
vector<string> strVec = auxiliary_func::split(templine, delimeter);
if (strVec.size() != 3)
{
delimeter = "\t";
strVec = auxiliary_func::split(templine, delimeter);
}
if (strVec.size() != 3)
{
delimeter = " ";
strVec = auxiliary_func::split(templine, delimeter);
}
if (strVec.size() == 3)
{
tempflows.push_back(flowdata(stoi(strVec[0]), stoi(strVec[1]), stod(strVec[2])));
}
}
catch (...) {
}
}
flows = tempflows;
}
int flowcollection::Countflowid()
{
return layerConnection->GetFeatureCount();
} | [
"5797454@qq.com"
] | 5797454@qq.com |
14989890edd5f779f50ccfbde673e116207799e4 | d640dd0bd6eb45c0f3cf21965852fd86c1d9ec52 | /test/random/module/real/special/stirling/regular/stirling.hpp | 46895684854ae9a381e9ea870bcbb6975afb0aa0 | [
"MIT"
] | permissive | microblink/eve | 43a5f5d06fbf629823f66872a9d23b8039d39e3b | 0c720df47a0cbf5f200e13fa164886b309045d91 | refs/heads/main | 2023-08-31T05:38:16.176316 | 2021-09-21T07:36:29 | 2021-09-21T07:36:29 | 416,764,853 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 862 | hpp | //==================================================================================================
/*
EVE - Expressive Vector Engine
Copyright : EVE Contributors & Maintainers
SPDX-License-Identifier: MIT
*/
//==================================================================================================
#include <eve/function/stirling.hpp>
#include <eve/constant/maxlog.hpp>
#include <eve/constant/minlog.hpp>
#include "producers.hpp"
#include <cmath>
TTS_CASE_TPL("wide random check on stirling", EVE_TYPE)
{
auto std_stirling = [](auto e) { return std::stirling(e); };
auto eve_stirling = [](auto e) { return eve::stirling(e); };
eve::uniform_prng<T> p ( eve::minlog(eve::as<EVE_VALUE>())
, eve::maxlog(eve::as<EVE_VALUE>()) - 1
);
TTS_RANGE_CHECK(p, std_stirling, eve_stirling);
}
| [
"noreply@github.com"
] | noreply@github.com |
bdf079fa8366f70ab65937df0f948ba9c6ff5f6c | bd6547aa8d6a4bf6c251a75fd04bf1ff413655d2 | /Robot/TCD/FrameTaskDman/DialogTask/TaskSpecification/TSNonOnlineBusiness.h | a34f9a0dd7f217c790fe0c071d92bd76926ee95e | [] | no_license | semanticparsing/navigation_code | 8c324f9ef6bb96d0fce013c08e44481d2019214e | 1a7388f24dfe3f194643be316de5d92bfc213c71 | refs/heads/master | 2020-03-25T08:12:45.956783 | 2018-07-13T10:03:38 | 2018-07-13T10:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 372 | h | // Author : zhangxuanfeng
// Email : zhangxuanfeng@trio.ai
// Date : 2018-05-08 14:30
// Description: 未上线业务
#ifndef _TS_NON_ONLINE_BUSINESS_H__
#define _TS_NON_ONLINE_BUSINESS_H__
#include "Robot/TCD/FrameTaskDman/DMCore/Core.h"
#include "Robot/TCD/FrameTaskDman/DMCore/Agents/AllAgents.h"
namespace TrioTDM {
void RegisterNonOnlineBusiness();
}
#endif
| [
"hitdzl@gmail.com"
] | hitdzl@gmail.com |
40fe2b944f793c7af7e56b5f38e4d7986d8f80b1 | b3ab2120518a1b2d211d40324985374bae8458fa | /ReverseCuthillMcKee.cpp | bc29a38b0d7801b19d241bde6d3051e068b68992 | [] | no_license | evalen43/ReverseCuthillMcKee | 2b82e2f2d12a72214b98e542c85334ee94fb2c0b | decade3789af136a8180dde7b15ffe6f8f4f1b11 | refs/heads/master | 2023-05-30T03:05:14.369235 | 2021-06-15T02:28:29 | 2021-06-15T02:28:29 | 375,798,865 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,794 | cpp | // ReverseCuthillMcKee.cpp : This file contains the 'main' function. Program execution begins and
// ends there. C++ program for Implementation of Reverse Cuthill Mckee Algorithm
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <vector>
#include <queue>
#include <string>
using namespace std;
vector<int> globalDegree;
int ne = 0;
vector<vector<int>> edges;
int findIndex(vector<pair<int, int> > a, int x)
{
for (int i = 0; i < a.size(); i++)
if (a[i].first == x)
return i;
return -1;
}
int findIndex2(vector<pair<int, int> > a, int x)
{
for (int i = 0; i < a.size(); i++)
if (a[i].second == x)
return i;
return -1;
}
bool compareDegree(int i, int j)
{
return ::globalDegree[i] < ::globalDegree[j];
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v)
{
for (int i = 0; i < v.size(); i++)
out << v[i] << ' ';
return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<vector<T>> const& v)
{
for (int i = 0; i < v.size(); i++)
{
for(int j=0;j<v[0].size();j++)
out << v[i][j] << ' ';
out << endl;
}
return out;
}
class ReorderingSSM
{
private:
vector<vector<int> > _matrix;
int index1=-1,index2=-1;
public:
// Constructor and Destructor
ReorderingSSM(vector<vector<int>> edges,vector<pair<int,int>> nodes,int nn)
{
//_matrix = m;
int j1, j2;
//int ne1 = edges.size();
for (int i = 0; i < nn; i++) {
vector<int> datai;
for (int j = 0; j < nn; j++)
datai.push_back(0.0);
_matrix.push_back(datai);
}
for (int i = 0; i < edges.size(); i++) {
j1 = edges[i][0];
j2 = edges[i][1];
index1 = findIndex2(nodes, j1);
index2 = findIndex2(nodes, j2);
_matrix[index1][index2] = 1;
_matrix[index2][index1] = 1;
}
cout << _matrix<<endl;
}
ReorderingSSM() {}
~ReorderingSSM() {}
// class methods
// Function to generate degree for all nodes
vector<int> degreeGenerator()
{
vector<int> degrees;
for (int i = 0; i < _matrix.size(); i++) {
int count = 0;
for (int j = 0; j < _matrix[0].size(); j++) {
count += _matrix[i][j];
}
degrees.push_back(count);
}
cout << "Degress" << endl;
cout << degrees << endl;
return degrees;
}
// Implementation of Cuthill-Mckee algorithm
vector<int> CuthillMckee()
{
vector<int> degrees = degreeGenerator();
::globalDegree = degrees;
queue<int> Q;
vector<int> R;
vector<pair<int, int> > notVisited;
for (int i = 0; i < degrees.size(); i++)
notVisited.push_back(make_pair(i, degrees[i]));
// Vector notVisited helps in running BFS even when there are disjoind graphs
while (notVisited.size()) {
int minNodeIndex = 0;
for (int i = 0; i < notVisited.size(); i++)
if (notVisited[i].second < notVisited[minNodeIndex].second)
minNodeIndex = i;
Q.push(notVisited[minNodeIndex].first); 0,
notVisited.erase(notVisited.begin()
+ findIndex(notVisited,
notVisited[Q.front()].first));
// Simple BFS
while (!Q.empty()) {
vector<int> toSort;
for (int i = 0; i < _matrix[0].size(); i++) {
if (i != Q.front() && _matrix[Q.front()][i] == 1
&& findIndex(notVisited, i) != -1) {
toSort.push_back(i);
notVisited.erase(notVisited.begin()
+ findIndex(notVisited, i));
}
}
sort(toSort.begin(), toSort.end(), compareDegree);
for (int i = 0; i < toSort.size(); i++)
Q.push(toSort[i]);
R.push_back(Q.front());
Q.pop();
}
}
return R;
}
// Implementation of reverse Cuthill-Mckee algorithm
vector<int> ReverseCuthillMckee()
{
vector<int> cuthill = CuthillMckee();
int n = cuthill.size();
if (n % 2 == 0)
n -= 1;
n = n / 2;
for (int i = 0; i <= n; i++) {
int j = cuthill[cuthill.size() - 1 - i];
cuthill[cuthill.size() - 1 - i] = cuthill[i];
cuthill[i] = j;
}
return cuthill;
}
};
int main()
{
vector<pair<int, int>> nodes;
int diff = 0;
int band = 0;
string filein;
int ne = 0,nn=0;
int j1 = 0, j2 = 0, index1=0,index2=0;
std::cout << "Enter File Name!\n";
cin >> filein ;
ifstream myfile;
myfile.open(filein);
if (myfile.is_open())
{
diff = 0;
myfile >> nn >> ne;
for (int i = 0; i < nn; i++) {
myfile >> j1;
nodes.push_back(make_pair(i,j1));
}
for(int i=0;i<ne;i++)
{
myfile >> j1 >> j2;
band = abs(j1 - j2);
if (band > diff) diff = band;
vector<int> inc;
inc.push_back(j1);
inc.push_back(j2);
edges.push_back(inc);
}
myfile.close();
cout << "Number of edges: "<<ne<<' ' <<"Number of Node: " <<' ' << nn<<" Bandwidth: " << diff << endl;
}
else
{
cout << "File not Found" << endl;
return -1;
}
// This is the test graph,
// check out the above graph photo
//matrix[0] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0 };
//matrix[1] = { 1, 0, 0, 0, 1, 0, 1, 0, 0, 1 };
//matrix[2] = { 0, 0, 0, 0, 1, 0, 1, 0, 0, 0 };
//matrix[3] = { 0, 0, 0, 0, 1, 1, 0, 0, 1, 0 };
//matrix[4] = { 0, 0, 0, 0, 1, 1, 0, 0, 1, 0 };
//matrix[5] = { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 };
//matrix[6] = { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
//matrix[7] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 };
//matrix[8] = { 1, 0, 0, 1, 0, 0, 0, 1, 0, 0 };
//matrix[9] = { 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 };
ReorderingSSM m(edges,nodes,nn);
vector<int> r = m.ReverseCuthillMckee();
int r0; int r1;
cout << "Permutation order of objects: " << r << endl;
cout << "Original Edges" << endl;
cout << edges;
cout << "New Edges" << endl;
diff = 0;
for (int i = 0; i < edges.size(); i++) {
j1 = edges[i][0];
j2 = edges[i][1];
index1 = findIndex2(nodes, j1);
index2 = findIndex2(nodes, j2);
r0 = r[index1]; r1 = r[index2];
band = abs(r0 - r1);
if (band>diff) diff = band;
cout << nodes[r0].second << ' ' << nodes[r1].second << endl;
}
cout << "New bandwidth: " << diff << endl;
return 0;
}
| [
"edvallen@hotmail.com"
] | edvallen@hotmail.com |
f7d8a76678ad68320f9f6816694765046190c0aa | b269392cc4727b226e15b3f08e9efb41a7f4b048 | /POJ/POJ 1127.cpp | b29db4c8235fb0922ff55a0cd0b0ae5e8f973158 | [] | no_license | ThoseBygones/ACM_Code | edbc31b95077e75d3b17277d843cc24b6223cc0c | 2e8afd599b8065ae52b925653f6ea79c51a1818f | refs/heads/master | 2022-11-12T08:23:55.232349 | 2022-10-30T14:17:23 | 2022-10-30T14:17:23 | 91,112,483 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,047 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define EPS 1e-10
typedef double Type;
int sign(Type x)
{
return x<-EPS?-1:(x>EPS?1:0);
}
struct Point
{
Type x,y;
Point(Type x,Type y):x(x),y(y) {}
Point() {}
void read()
{
scanf("%lf %lf",&x,&y);
}
bool operator==(const Point& p) const
{
return sign(x-p.x)==0&&sign(y-p.y)==0;
}
Point operator-(const Point& p) const
{
return Point(x-p.x,y-p.y);
}
Point operator*(const Type t) const
{
return Point(t*x,t*y);
}
Point operator+(const Point & p) const
{
return Point(x+p.x,y+p.y);
}
bool operator<(const Point& p) const
{
return sign(x-p.x)==0?sign(y-p.y)<0:sign(x-p.x)<0;
}
};
ostream& operator<<(ostream& out,Point p)
{
out<<p.x<<" "<<p.y;
return out;
}
typedef Point Vector;
struct Line
{
Point a,b;
Line() {}
Line(Point a,Point b):a(a),b(b) {}
};
typedef Line SegMent;
//叉积
Type Cross(Vector a,Vector b)
{
return a.x*b.y-a.y*b.x;
}
Type Cross(Point &a,Point &b,Point &c)
{
return Cross(a-c,b-c);
}
//点积
Type Dot(Vector a,Vector b)
{
return a.x*b.x+a.y*b.y;
}
//线段规范相交
bool SegMentProperIntersect(SegMent &s1,SegMent& s2){
Type c1 = Cross(s1.b-s1.a,s2.a-s1.a),c2 = Cross(s1.b-s1.a,s2.b-s1.a),
c3 = Cross(s2.b-s2.a,s1.a-s2.a),c4 = Cross(s2.b-s2.a,s1.b-s2.a);
return sign(c1)*sign(c2)<0&&sign(c3)*sign(c4)<0;
}
//判断点在线段上
bool OnSegMent(Point &p,SegMent& s)
{
//小于0不包含端点,小于等于包含端点
return sign(Cross(s.a-p,s.b-p))==0&&sign(Dot(s.a-p,s.b-p))<=0;
}
//线段不规范相交
bool SegMentNotProperIntersect(SegMent& s1,SegMent& s2)
{
return OnSegMent(s1.a,s2)||OnSegMent(s1.b,s2)||OnSegMent(s2.a,s1)||OnSegMent(s2.b,s1);
}
SegMent s[15];
int fa[15];
int dep[15];
int findset(int x)
{
if(x!=fa[x])
return fa[x]=findset(fa[x]);
return fa[x];
}
void unionset(int x,int y)
{
int xx=findset(x);
int yy=findset(y);
if(xx!=yy)
{
if(dep[xx]>dep[yy]) //比较两个集合的深度
fa[yy]=xx;
else
{
fa[xx]=yy;
if(dep[xx]==dep[yy])
dep[yy]++;
}
}
}
int main()
{
int n;
while(~scanf("%d",&n),n)
{
for(int i=1; i<=n; i++)
{
s[i].a.read();
s[i].b.read();
fa[i]=i;
dep[i]=0;
}
for(int i=1; i<=n; i++)
{
for(int j=i+1; j<=n; j++)
{
if(SegMentProperIntersect(s[i],s[j])||SegMentNotProperIntersect(s[i],s[j]))
unionset(i,j);
}
}
int a,b;
while(~scanf("%d%d",&a,&b))
{
if(a==0 && b==0)
break;
if(findset(a)==findset(b))
puts("CONNECTED");
else
puts("NOT CONNECTED");
}
}
return 0;
}
| [
"1273789365@qq.com"
] | 1273789365@qq.com |
fcfae6f96b83a76e992429847beffe65c46da050 | 6047b3b605e47692af45f5c49869fa0cc409d46a | /chrome/browser/ui/views/overlay/overlay_window_views.h | f0a4fec9b51edffab1031e418a0b6df3be9e5385 | [
"BSD-3-Clause"
] | permissive | liglee/chromium | 87d9dfd6c513cf456edb600080354b77fe56bd62 | 1b6d8638caf9c57f132175426f795a10eb4c769c | refs/heads/master | 2023-03-03T13:15:38.361656 | 2018-04-24T08:27:31 | 2018-04-24T08:27:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,525 | h | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_OVERLAY_OVERLAY_WINDOW_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_OVERLAY_OVERLAY_WINDOW_VIEWS_H_
#include "content/public/browser/overlay_window.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/widget/widget.h"
// The Chrome desktop implementation of OverlayWindow. This will only be
// implemented in views, which will support all desktop platforms.
class OverlayWindowViews : public content::OverlayWindow, public views::Widget {
public:
explicit OverlayWindowViews(
content::PictureInPictureWindowController* controller);
~OverlayWindowViews() override;
// OverlayWindow:
bool IsActive() const override;
void Show() override;
void Close() override;
bool IsVisible() const override;
bool IsAlwaysOnTop() const override;
ui::Layer* GetLayer() override;
gfx::Rect GetBounds() const override;
void UpdateVideoSize(const gfx::Size& natural_size) override;
// views::Widget:
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
void OnNativeWidgetWorkspaceChanged() override;
void OnMouseEvent(ui::MouseEvent* event) override;
// views::internal::NativeWidgetDelegate:
void OnNativeWidgetSizeChanged(const gfx::Size& new_size) override;
private:
// Determine the intended bounds of |this|. This should be called when there
// is reason for the bounds to change, such as switching primary displays or
// playing a new video (i.e. different aspect ratio). This also updates
// |min_size_| and |max_size_|.
gfx::Rect CalculateAndUpdateBounds();
// Not owned; |controller_| owns |this|.
content::PictureInPictureWindowController* controller_;
// The upper and lower bounds of |current_size_|. These are determined by the
// size of the primary display work area when Picture-in-Picture is initiated.
// TODO(apacible): Update these bounds when the display the window is on
// changes. http://crbug.com/819673
gfx::Size min_size_;
gfx::Size max_size_;
// Current size of the Picture-in-Picture window.
gfx::Size current_size_;
// The natural size of the video to show. This is used to compute sizing and
// ensuring factors such as aspect ratio is maintained.
gfx::Size natural_size_;
DISALLOW_COPY_AND_ASSIGN(OverlayWindowViews);
};
#endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_OVERLAY_WINDOW_VIEWS_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
a780b5814a82e3450d15381db8f45d12581f674b | 27ccf4415efbbe538a2667a6b857c100656782ed | /01_baekjoon/01_BOJ_Step/Steps/Steps/Step14(Sorting)/Step14_08_1181.cpp | 1273bf99a1d5004fdb771a10e0617b59be1c19a9 | [] | no_license | WONILLISM/Algorithm | 315cc71646ee036ad3324b2a12ca51a7ea3c4ff3 | 82b323c0dc1187090a85659ed09a6ef975ce3419 | refs/heads/master | 2020-06-15T02:54:39.995963 | 2020-04-28T12:07:58 | 2020-04-28T12:07:58 | 194,092,117 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,218 | cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<deque>
#include<algorithm>
#define endl '\n';
#define ll long long
#define PII pair<int,int>
using namespace std;
const int MAX = 51;
char board[MAX][MAX];
int visit[MAX][MAX];
int N, M, sx, sy, ans = 32;
int dx[] = { 1,0 }, dy[] = { 0,1 };
string white[8] = {
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" }
};
string black[8] = {
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" },
{ "BWBWBWBW" },
{ "WBWBWBWB" }
};
void process(int y, int x) {
int cntW = 0, cntB = 0;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (white[i][j] != board[y + i][x + j])cntW++;
if (black[i][j] != board[y + i][x + j])cntB++;
}
}
ans = min(ans, min(cntW,cntB));
}
void solution() {
for (int i = 0; i < N - 7; i++) {
for (int j = 0; j < M - 7; j++) {
process(i, j);
}
}
cout << ans << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> M;
for (int i = 0; i < N; i++)
cin >> board[i];
solution();
return 0;
} | [
"wonillism@gmail.com"
] | wonillism@gmail.com |
ff5a6b765b40bc244f2c46ca352f84f95b827566 | 84a9cf5fd65066cd6c32b4fc885925985231ecde | /Plugins2/ElementalEngine/NavMesh/StaticLibSymbols.cpp | 5625501f899631d70806efdf7e594ffb1ac6bdc1 | [] | no_license | acemon33/ElementalEngine2 | f3239a608e8eb3f0ffb53a74a33fa5e2a38e4891 | e30d691ed95e3811c68e748c703734688a801891 | refs/heads/master | 2020-09-22T06:17:42.037960 | 2013-02-11T21:08:07 | 2013-02-11T21:08:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 483 | cpp | //Autogenerated Static Lib File:
//Generated on: 03/23/09 14:27:41
#include ".\StaticLibSymbols.h"
#ifdef _LIB
void *NAVMESH_LIBEXTERNS[] = {
(void *)&CNavMeshManagerRO,
(void *)&CNavMeshObjectRO,
(void *)&CNavMeshManagerRO,
(void *)&CNavMeshRenderObjectRO,
(void *)&GenerateNavMesh_CNavMeshObjectRM,
(void *)&VisualizeNavMesh_CNavMeshObjectRM,
(void *)&Start_CNavMeshManagerRM,
(void *)&Stop_CNavMeshManagerRM,
(void *)0
};
#endif //#ifdef _LIB
| [
"klhurley@yahoo.com"
] | klhurley@yahoo.com |
819dfb692e4e213899f1931e24defd101b8cedcc | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h | 1f90b50139aa782be05d69c69099f9434b02c376 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"MIT",
"Apache-2.0"
] | permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | C++ | false | false | 9,280 | h | /*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE OR ITS 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.
*/
#ifndef IDBObjectStore_h
#define IDBObjectStore_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/SerializedScriptValue.h"
#include "modules/indexeddb/IDBCursor.h"
#include "modules/indexeddb/IDBIndex.h"
#include "modules/indexeddb/IDBIndexParameters.h"
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBKeyRange.h"
#include "modules/indexeddb/IDBMetadata.h"
#include "modules/indexeddb/IDBRequest.h"
#include "modules/indexeddb/IDBTransaction.h"
#include "public/platform/modules/indexeddb/WebIDBCursor.h"
#include "public/platform/modules/indexeddb/WebIDBDatabase.h"
#include "public/platform/modules/indexeddb/WebIDBTypes.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
namespace blink {
class DOMStringList;
class IDBAny;
class ExceptionState;
class IDBObjectStore final : public GarbageCollectedFinalized<IDBObjectStore>,
public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static IDBObjectStore* create(RefPtr<IDBObjectStoreMetadata> metadata,
IDBTransaction* transaction) {
return new IDBObjectStore(std::move(metadata), transaction);
}
~IDBObjectStore() {}
DECLARE_TRACE();
const IDBObjectStoreMetadata& metadata() const { return *m_metadata; }
const IDBKeyPath& idbKeyPath() const { return metadata().keyPath; }
// Implement the IDBObjectStore IDL
int64_t id() const { return metadata().id; }
const String& name() const { return metadata().name; }
void setName(const String& name, ExceptionState&);
ScriptValue keyPath(ScriptState*) const;
DOMStringList* indexNames() const;
IDBTransaction* transaction() const { return m_transaction.get(); }
bool autoIncrement() const { return metadata().autoIncrement; }
IDBRequest* openCursor(ScriptState*,
const ScriptValue& range,
const String& direction,
ExceptionState&);
IDBRequest* openKeyCursor(ScriptState*,
const ScriptValue& range,
const String& direction,
ExceptionState&);
IDBRequest* get(ScriptState*, const ScriptValue& key, ExceptionState&);
IDBRequest* getKey(ScriptState*, const ScriptValue& key, ExceptionState&);
IDBRequest* getAll(ScriptState*,
const ScriptValue& range,
unsigned long maxCount,
ExceptionState&);
IDBRequest* getAll(ScriptState*, const ScriptValue& range, ExceptionState&);
IDBRequest* getAllKeys(ScriptState*,
const ScriptValue& range,
unsigned long maxCount,
ExceptionState&);
IDBRequest* getAllKeys(ScriptState*,
const ScriptValue& range,
ExceptionState&);
IDBRequest* add(ScriptState*,
const ScriptValue&,
const ScriptValue& key,
ExceptionState&);
IDBRequest* put(ScriptState*,
const ScriptValue&,
const ScriptValue& key,
ExceptionState&);
IDBRequest* deleteFunction(ScriptState*,
const ScriptValue& key,
ExceptionState&);
IDBRequest* clear(ScriptState*, ExceptionState&);
IDBIndex* createIndex(ScriptState* scriptState,
const String& name,
const StringOrStringSequence& keyPath,
const IDBIndexParameters& options,
ExceptionState& exceptionState) {
return createIndex(scriptState, name, IDBKeyPath(keyPath), options,
exceptionState);
}
IDBIndex* index(const String& name, ExceptionState&);
void deleteIndex(const String& name, ExceptionState&);
IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&);
// Used by IDBCursor::update():
IDBRequest* put(ScriptState*,
WebIDBPutMode,
IDBAny* source,
const ScriptValue&,
IDBKey*,
ExceptionState&);
// Used internally and by InspectorIndexedDBAgent:
IDBRequest* openCursor(ScriptState*,
IDBKeyRange*,
WebIDBCursorDirection,
WebIDBTaskType = WebIDBTaskTypeNormal);
void markDeleted();
bool isDeleted() const { return m_deleted; }
// True if this object store was created in its associated transaction.
// Only valid if the store's associated transaction is a versionchange.
bool isNewlyCreated() const {
DCHECK(m_transaction->isVersionChange());
// Object store IDs are allocated sequentially, so we can tell if an object
// store was created in this transaction by comparing its ID against the
// database's maximum object store ID at the time when the transaction was
// started.
return id() > m_transaction->oldMaxObjectStoreId();
}
// Clears the cache used to implement the index() method.
//
// This should be called when the store's transaction clears its reference
// to this IDBObjectStore instance, so the store can clear its references to
// IDBIndex instances. This way, Oilpan can garbage-collect the instances
// that are not referenced in JavaScript.
//
// For most stores, the condition above is met when the transaction
// finishes. The exception is stores that are created and deleted in the
// same transaction. Those stores will remain marked for deletion even if
// the transaction aborts, so the transaction can forget about them (and
// clear their index caches) right when they are deleted.
void clearIndexCache();
// Sets the object store's metadata to a previous version.
//
// The reverting process includes reverting the metadata for the IDBIndex
// instances that are still tracked by the store. It does not revert the
// IDBIndex metadata for indexes that were deleted in this transaction.
//
// Used when a versionchange transaction is aborted.
void revertMetadata(RefPtr<IDBObjectStoreMetadata> previousMetadata);
// This relies on the changes made by revertMetadata().
void revertDeletedIndexMetadata(IDBIndex& deletedIndex);
// Used by IDBIndex::setName:
bool containsIndex(const String& name) const {
return findIndexId(name) != IDBIndexMetadata::InvalidId;
}
void renameIndex(int64_t indexId, const String& newName);
WebIDBDatabase* backendDB() const;
private:
using IDBIndexMap = HeapHashMap<String, Member<IDBIndex>>;
IDBObjectStore(RefPtr<IDBObjectStoreMetadata>, IDBTransaction*);
IDBIndex* createIndex(ScriptState*,
const String& name,
const IDBKeyPath&,
const IDBIndexParameters&,
ExceptionState&);
IDBRequest* put(ScriptState*,
WebIDBPutMode,
IDBAny* source,
const ScriptValue&,
const ScriptValue& key,
ExceptionState&);
int64_t findIndexId(const String& name) const;
// The IDBObjectStoreMetadata is shared with the object store map in the
// database's metadata.
RefPtr<IDBObjectStoreMetadata> m_metadata;
Member<IDBTransaction> m_transaction;
bool m_deleted = false;
// Caches the IDBIndex instances returned by the index() method.
//
// The spec requires that an object store's index() returns the same
// IDBIndex instance for a specific index, so this cache is necessary
// for correctness.
//
// index() throws for completed/aborted transactions, so this is not used
// after a transaction is finished, and can be cleared.
IDBIndexMap m_indexMap;
#if DCHECK_IS_ON()
bool m_clearIndexCacheCalled = false;
#endif // DCHECK_IS_ON()
};
} // namespace blink
#endif // IDBObjectStore_h
| [
"enrico.weigelt@gr13.net"
] | enrico.weigelt@gr13.net |
7c0a47c58557bf835656e847d7cdd1675d6af798 | 08bfc8a1f8e44adc624d1f1c6250a3d9635f99de | /SDKs/Alembic/lib/Alembic/AbcGeom/IPoints.cpp | c3e19e7dc108d0189d95cdcd9d99e32be1ba36d9 | [] | no_license | Personwithhat/CE_SDKs | cd998a2181fcbc9e3de8c58c7cc7b2156ca21d02 | 7afbd2f7767c9c5e95912a1af42b37c24d57f0d4 | refs/heads/master | 2020-04-09T22:14:56.917176 | 2019-07-04T00:19:11 | 2019-07-04T00:19:11 | 160,623,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 129 | cpp | version https://git-lfs.github.com/spec/v1
oid sha256:b52dcf21a1c903d8567d41a3d6df4fc3f33b550c68db3bc6180a23d35764b86f
size 3207
| [
"personwithhats2@Gmail.com"
] | personwithhats2@Gmail.com |
129c5d9901b909b03cbd86c884e32d68245b3f22 | 1faa2601f5c5d05a8dfa851c06a0fc07317386e5 | /cvmfs/fuse_main.cc | e23dc323acf7f4b84eaa9bea5317fab3820901d0 | [] | permissive | cvmfs/cvmfs | 216aecc8921ac7fcd5cec5a8baf37870cdc42d0f | bb69086badd32d8f9566ed5dcedff1fd1b0ccc5e | refs/heads/devel | 2023-08-24T09:17:29.248662 | 2023-08-15T09:08:27 | 2023-08-15T09:08:27 | 3,784,908 | 231 | 118 | BSD-3-Clause | 2023-09-13T10:50:09 | 2012-03-21T09:10:41 | C++ | UTF-8 | C++ | false | false | 4,361 | cc | /**
* This file is part of the CernVM File System.
*
* The Fuse module entry point. Dynamically selects either the libfuse3
* cvmfs fuse module or the libfuse2 one, depending on the availability and on
* the mount options.
*
*/
#include <dlfcn.h>
#include <unistd.h>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include "fuse_main.h"
#include "util/logging.h"
#include "util/platform.h"
#include "util/smalloc.h"
#include "util/string.h"
using namespace stub; // NOLINT
int main(int argc, char **argv) {
// Getopt option parsing modifies globals and the argv vector
int opterr_save = opterr;
int optc = argc;
assert(optc > 0);
char **optv = reinterpret_cast<char **>(smalloc(optc * sizeof(char *)));
for (int i = 0; i < optc; ++i) {
optv[i] = strdup(argv[i]);
}
bool debug = false;
unsigned enforce_libfuse = 0;
int c;
opterr = 0;
while ((c = getopt(optc, optv, "do:")) != -1) {
switch (c) {
case 'd':
debug = true;
break;
case 'o':
std::vector<std::string> mount_options = SplitString(optarg, ',');
for (unsigned i = 0; i < mount_options.size(); ++i) {
if (mount_options[i] == "debug") {
debug = true;
}
if (HasPrefix(mount_options[i], "libfuse=", false /*ign_case*/)) {
std::vector<std::string> t = SplitString(mount_options[i], '=');
enforce_libfuse = String2Uint64(t[1]);
if (debug) {
LogCvmfs(kLogCvmfs, kLogDebug | kLogStdout,
"Debug: enforcing libfuse version %u", enforce_libfuse);
}
}
}
break;
}
}
opterr = opterr_save;
optind = 1;
for (int i = 0; i < optc; ++i) {
free(optv[i]);
}
free(optv);
std::string libname_fuse2 = platform_libname("cvmfs_fuse_stub");
std::string libname_fuse3 = platform_libname("cvmfs_fuse3_stub");
std::string error_messages;
if (enforce_libfuse > 0) {
if ((enforce_libfuse < 2) || (enforce_libfuse > 3)) {
LogCvmfs(kLogCvmfs, kLogStderr | kLogSyslogErr,
"Error: invalid libfuse version '%u', valid values are 2 or 3.",
enforce_libfuse);
return 1;
}
}
std::string local_lib_path = "./";
if (getenv("CVMFS_LIBRARY_PATH") != NULL) {
local_lib_path = getenv("CVMFS_LIBRARY_PATH");
if (!local_lib_path.empty() && (*local_lib_path.rbegin() != '/'))
local_lib_path.push_back('/');
}
// Try loading libfuse3 module, else fallback to version 2
std::vector<std::string> library_paths;
if ((enforce_libfuse == 0) || (enforce_libfuse == 3)) {
library_paths.push_back(local_lib_path + libname_fuse3);
library_paths.push_back("/usr/lib/" + libname_fuse3);
library_paths.push_back("/usr/lib64/" + libname_fuse3);
#ifdef __APPLE__
library_paths.push_back("/usr/local/lib/" + libname_fuse3);
#endif
}
if ((enforce_libfuse == 0) || (enforce_libfuse == 2)) {
library_paths.push_back(local_lib_path + libname_fuse2);
library_paths.push_back("/usr/lib/" + libname_fuse2);
library_paths.push_back("/usr/lib64/" + libname_fuse2);
#ifdef __APPLE__
library_paths.push_back("/usr/local/lib/" + libname_fuse2);
#endif
}
void *library_handle;
std::vector<std::string>::const_iterator i = library_paths.begin();
std::vector<std::string>::const_iterator iend = library_paths.end();
for (; i != iend; ++i) {
library_handle = dlopen(i->c_str(), RTLD_NOW | RTLD_LOCAL);
if (library_handle != NULL) {
if (debug) {
LogCvmfs(kLogCvmfs, kLogDebug | kLogStdout, "Debug: using library %s",
i->c_str());
}
break;
}
error_messages += std::string(dlerror()) + "\n";
}
if (!library_handle) {
LogCvmfs(kLogCvmfs, kLogStderr | kLogSyslogErr,
"Error: failed to load cvmfs library, tried: '%s'\n%s",
JoinStrings(library_paths, "' '").c_str(), error_messages.c_str());
return 1;
}
CvmfsStubExports **exports_ptr = reinterpret_cast<CvmfsStubExports **>(
dlsym(library_handle, "g_cvmfs_stub_exports"));
if (exports_ptr == NULL) {
LogCvmfs(kLogCvmfs, kLogStderr | kLogSyslogErr,
"Error: symbol g_cvmfs_stub_exports not found");
return 1;
}
return (*exports_ptr)->fn_main(argc, argv);
}
| [
"jblomer@cern.ch"
] | jblomer@cern.ch |
25edb2800bf5da670598d659e678d630dc70fd3f | 4a52a2065e958e576fdb1a2528ff8ee970bb0429 | /interrupt/interrupt.ino | 98852aaaaa0706e87000a91995b4705abb8d303d | [] | no_license | harshitherobotist/Arduino-Codes | c3fb28a60c3daac7c21786ee6102a7a4a6811f93 | aedd803603fc50a05a2e5526738e8b41929e0093 | refs/heads/main | 2023-03-30T11:28:57.328110 | 2021-04-05T06:25:10 | 2021-04-05T06:25:10 | 354,739,911 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,249 | ino | int sensor=2;
int sensor1=3;
int pulse,pulse1 =0;
unsigned long start_time, end_time=0;
float rpm,rpm1;
int ml_1=8;
int ml_2=9;
int mr_1=10;
int mr_2=11;
int enl=5;
int enr=6;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
attachInterrupt(digitalPinToInterrupt(sensor),counter,CHANGE);
attachInterrupt(digitalPinToInterrupt(sensor1),counter1,CHANGE);
pinMode(2,INPUT_PULLUP);
pinMode(3,INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
start_time=millis();
if(start_time - end_time > 1000)
{
detachInterrupt(sensor);
detachInterrupt(sensor1);
end_time = start_time;
rpm=(pulse*60)/40;
rpm1=(pulse1*60)/40;
Serial.print(rpm);
Serial.print(" ");
Serial.println(rpm1);
pulse1=0;
pulse=0;
//start_time=millis();
attachInterrupt(digitalPinToInterrupt(sensor),counter,CHANGE);
attachInterrupt(digitalPinToInterrupt(sensor1),counter1,CHANGE);
}
digitalWrite(9,HIGH);
digitalWrite(10,HIGH);
analogWrite(5,255);
analogWrite(6,255);
}
void counter()
{
pulse++;
}
void counter1()
{
pulse1++;
}
| [
"noreply@github.com"
] | noreply@github.com |
af26fdb3593fc002ca9f5f7db44d3762cfcdaace | c301c81f7560125e130a9eb67f5231b3d08a9d67 | /lc/lc/2021_target/companies/amazon/lc_127_word_ladder.cpp | 4d205814c518649a4eb2652532f7b213cf6edd09 | [] | no_license | vikashkumarjha/missionpeace | f55f593b52754c9681e6c32d46337e5e4b2d5f8b | 7d5db52486c55b48fe761e0616d550439584f199 | refs/heads/master | 2021-07-11T07:34:08.789819 | 2021-07-06T04:25:18 | 2021-07-06T04:25:18 | 241,745,271 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,148 | cpp | /*
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
Only one letter can be changed at a time.
Each transformed word must exist in the word list.
Note:
Return 0 if there is no such transformation sequence.
All words have the same length.
All words contain only lowercase alphabetic characters.
You may assume no duplicates in the word list.
You may assume beginWord and endWord are non-empty and are not the same.
Example 1:
Input:
beginWord = "hit",
endWord = "cog",
wordList = ["hot","dot","dog","lot","log","cog"]
Output: 5
*/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
unordered_set<string> dict(begin(wordList), end(wordList));
queue<string> q;
q.push(beginWord);
vector<string> path;
int dist = 0;
while ( !q.empty()) {
int qsize = q.size();
++dist;
while ( qsize--) {
auto w = q.front(); q.pop();
if ( w == endWord) return dist;
dict.erase(w);
for ( int i = 0; i < w.size(); i++) {
auto ch = w[i];
for ( int k = 0; k < 26; k++) {
w[i] = 'a' + k;
if ( dict.count(w)) {
q.push(w);
}
}
w[i] = ch;
}
}
}
return 0;
}
};
int main()
{
Solution sol;
vector<string> wordList = {"hot", "dot", "dog", "lot", "log", "cog"};
int res = sol.ladderLength("hit", "cog", wordList);
cout << "\n The value of the result:" << res;
return 0;
} | [
"vjha2100@gmail.com"
] | vjha2100@gmail.com |
f528d2119d78bdf87c50e730d6d1ad5b88bf3eeb | c35c231a05f24f22c5aae7ef94e1ded6dcfd848c | /codeforces/739/C.cpp | 9b5948c247d2357ac7ee2ae60619bab3db91c77a | [] | no_license | irvifa/online-judges | 081bed8db248c4c0d5a096fb2a196a119778788c | c128a03b711f256f8888ed3d2e526889dce90ca2 | refs/heads/master | 2021-03-12T02:39:44.868187 | 2020-03-11T13:46:07 | 2020-03-11T13:46:07 | 246,582,524 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 899 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MAX = 1000000;
int a[MAX], b[MAX], c[MAX], d[MAX];
int completed(int available_money, int k) {
int l, r, m;
l = 0, r = k;
while (l < r) {
m = (l + r + 1) / 2;
if (d[m] <= available_money) l = m;
else r = m-1;
}
return c[l];
}
int n, m, k;
int x, s;
int i, available_money;
ll ans;
int main() {
scanf("%d %d %d",&n,&m,&k);
scanf("%d %d",&x,&s);
a[0] = x;
b[0] = 0;
c[0] = 0;
d[0] = 0;
for (i = 1; i <= m; i++) scanf("%d",&a[i]);
for (i = 1; i <= m; i++) scanf("%d",&b[i]);
for (i = 1; i <= k; i++) scanf("%d",&c[i]);
for (i = 1; i <= k; i++) scanf("%d",&d[i]);
ans = 1LL * n * x;
for (i = 0; i <= m; i++) {
available_money = s - b[i];
if (available_money < 0) continue;
ans = min(ans, 1LL * (n - completed(available_money, k)) * a[i]);
}
cout << ans << endl;
return 0;
}
| [
"irvi.fa@gmail.com"
] | irvi.fa@gmail.com |
c864e0a86439e279e74e959f6eaf28bd2d680c3f | 20a59a738c1d8521dc95c380190b48d7bc3bb0bb | /layouts/aknlayout2/generated/Vga4_touch_akn_app/aknlayoutscalable_abrw_pvp4_apps_vga4_prt_tch_normal.h | b69552b09b22941eaf6d1bff52ce2df810bd369a | [] | no_license | SymbianSource/oss.FCL.sf.mw.uiresources | 376c0cf0bccf470008ae066aeae1e3538f9701c6 | b78660bec78835802edd6575b96897d4aba58376 | refs/heads/master | 2021-01-13T13:17:08.423030 | 2010-10-19T08:42:43 | 2010-10-19T08:42:43 | 72,681,263 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,311 | h | /*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
// This header file contains the customisation implementation identity for AknLayoutScalable_Abrw_pvp4_apps_vga4_prt_tch_Normal
// This file may be manually modified.
#ifndef AKNLAYOUTSCALABLE_ABRW_PVP4_APPS_VGA4_PRT_TCH_NORMAL_H
#define AKNLAYOUTSCALABLE_ABRW_PVP4_APPS_VGA4_PRT_TCH_NORMAL_H
#include "aknlayoutscalable_apps.cdl.custom.h"
#include "aknlayoutscalable_abrw_pvp4_apps_vga4_prt_tch_normal.hrh"
namespace AknLayoutScalable_Abrw_pvp4_apps_vga4_prt_tch_Normal
{
const TInt KCdlInstanceId = _CDL_AknLayoutScalable_Abrw_pvp4_apps_vga4_prt_tch_Normal_KCdlInstanceId;
using AknLayoutScalable_Apps::KCdlInterface;
using AknLayoutScalable_Apps::KCdlInterfaceUidValue;
GLREF_D const AknLayoutScalable_Apps::SCdlImpl KCdlImpl;
} // end of namespace AknLayoutScalable_Abrw_pvp4_apps_vga4_prt_tch_Normal
#endif // AKNLAYOUTSCALABLE_ABRW_PVP4_APPS_VGA4_PRT_TCH_NORMAL_H
| [
"kirill.dremov@nokia.com"
] | kirill.dremov@nokia.com |
3c4d7957afcd49d4e62a021cbfdc8d26f14d7f49 | 0225a1fb4e8bfd022a992a751c9ae60722f9ca0d | /base/base_tests/assert_test.cpp | 0df32cc5df82616abeb395e7e60ad90a86d0b263 | [
"Apache-2.0"
] | permissive | organicmaps/organicmaps | fb2d86ea12abf5aab09cd8b7c55d5d5b98f264a1 | 76016d6ce0be42bfb6ed967868b9bd7d16b79882 | refs/heads/master | 2023-08-16T13:58:16.223655 | 2023-08-15T20:16:15 | 2023-08-15T20:16:15 | 324,829,379 | 6,981 | 782 | Apache-2.0 | 2023-09-14T21:30:12 | 2020-12-27T19:02:26 | C++ | UTF-8 | C++ | false | false | 722 | cpp | #include "testing/testing.hpp"
#include "base/base.hpp"
#include "base/exception.hpp"
#include "base/logging.hpp"
UNIT_TEST(Assert_Smoke)
{
int x = 5;
// to avoid warning in release
#ifdef RELEASE
UNUSED_VALUE(x);
#endif
ASSERT_EQUAL ( x, 5, () );
ASSERT_NOT_EQUAL ( x, 6, () );
//ASSERT_EQUAL ( x, 666, ("Skip this to continue test") );
}
UNIT_TEST(Check_Smoke)
{
int x = 5;
CHECK_EQUAL ( x, 5, () );
CHECK_NOT_EQUAL ( x, 6, () );
//CHECK_EQUAL ( x, 666, ("Skip this to continue test") );
}
UNIT_TEST(Exception_Formatting)
{
try
{
MYTHROW(RootException, ("String1", "String2", "String3"));
}
catch (RootException const & e)
{
LOG(LINFO, ("Exception string: ", e.what()));
}
}
| [
"alex@maps.me"
] | alex@maps.me |
f263ae238ce53c6a8ade837ee3c6afef3d1c29ad | eecc622f4981130a780051f64dab5ebbbd780c5b | /SDKs/Ogre/include/OGRE/MeshLodGenerator/OgreSmallVector.h | bd990734c8757cb994737bc9afd821a4b9458abe | [
"MIT"
] | permissive | antiHiXY/GameEnginePractice-2021 | 99f057a0aafbd8055a7bf014694eee063ec68168 | 88999905db28cd4250004c7e5fbd55eed5169f80 | refs/heads/main | 2023-08-24T17:25:55.976981 | 2021-09-29T14:17:49 | 2021-09-29T14:17:49 | 408,962,428 | 0 | 0 | MIT | 2021-09-21T20:18:10 | 2021-09-21T20:18:10 | null | UTF-8 | C++ | false | false | 32,479 | h | //===- llvm/ADT/SmallVector.h - 'Normally small' vectors --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License.
// ==============================================================================
// LLVM Release License
// ==============================================================================
// University of Illinois/NCSA
// Open Source License
//
// Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
// All rights reserved.
//
// Developed by:
//
// LLVM Team
//
// University of Illinois at Urbana-Champaign
//
// http://llvm.org
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal with
// 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:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimers.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimers in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the names of the LLVM Team, University of Illinois at
// Urbana-Champaign, nor the names of its contributors may be used to
// endorse or promote products derived from this Software without specific
// prior written permission.
//
// 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
// CONTRIBUTORS 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 WITH THE
// SOFTWARE.
//
//===----------------------------------------------------------------------===//
//
// This file defines the SmallVector class.
//
//===----------------------------------------------------------------------===//
#ifndef __SmallVector_H
#define __SmallVector_H
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <memory>
#ifdef _MSC_VER
namespace std
{
#if _MSC_VER <= 1310
// Work around flawed VC++ implementation of std::uninitialized_copy. Define
// additional overloads so that elements with pointer types are recognized as
// scalars and not objects, causing bizarre type conversion errors.
template<class T1, class T2>
inline _Scalar_ptr_iterator_tag _Ptr_cat(T1 **, T2 **)
{
_Scalar_ptr_iterator_tag _Cat;
return _Cat;
}
template<class T1, class T2>
inline _Scalar_ptr_iterator_tag _Ptr_cat(T1* const *, T2 **)
{
_Scalar_ptr_iterator_tag _Cat;
return _Cat;
}
#else
// FIXME: It is not clear if the problem is fixed in VS 2005. What is clear
// is that the above hack won't work if it wasn't fixed.
#endif
}
#endif
namespace Ogre
{
// some type traits
template <typename T> struct isPodLike
{
static const bool value = false;
};
template <> struct isPodLike<bool>
{
static const bool value = true;
};
template <> struct isPodLike<char>
{
static const bool value = true;
};
template <> struct isPodLike<signed char>
{
static const bool value = true;
};
template <> struct isPodLike<unsigned char>
{
static const bool value = true;
};
template <> struct isPodLike<int>
{
static const bool value = true;
};
template <> struct isPodLike<unsigned>
{
static const bool value = true;
};
template <> struct isPodLike<short>
{
static const bool value = true;
};
template <> struct isPodLike<unsigned short>
{
static const bool value = true;
};
template <> struct isPodLike<long>
{
static const bool value = true;
};
template <> struct isPodLike<unsigned long>
{
static const bool value = true;
};
template <> struct isPodLike<float>
{
static const bool value = true;
};
template <> struct isPodLike<double>
{
static const bool value = true;
};
template <typename T> struct isPodLike<T*>
{
static const bool value = true;
};
template<typename T, typename U>
struct isPodLike<std::pair<T, U> >
{
static const bool value = isPodLike<T>::value & isPodLike<U>::value;
};
/// SmallVectorBase - This is all the non-templated stuff common to all
/// SmallVectors.
class SmallVectorBase
{
protected:
void *BeginX, *EndX, *CapacityX;
// Allocate raw space for N elements of type T. If T has a ctor or dtor, we
// don't want it to be automatically run, so we need to represent the space as
// something else. An array of char would work great, but might not be
// aligned sufficiently. Instead we use some number of union instances for
// the space, which guarantee maximal alignment.
union U
{
double D;
long double LD;
long long L;
void *P;
} FirstEl;
// Space after 'FirstEl' is clobbered, do not add any instance vars after it.
protected:
SmallVectorBase(size_t Size)
: BeginX(&FirstEl), EndX(&FirstEl), CapacityX((char*)&FirstEl+Size) {}
/// isSmall - Return true if this is a smallvector which has not had dynamic
/// memory allocated for it.
bool isSmall() const
{
return BeginX == static_cast<const void*>(&FirstEl);
}
/// size_in_bytes - This returns size()*sizeof(T).
size_t size_in_bytes() const
{
return size_t((char*)EndX - (char*)BeginX);
}
/// capacity_in_bytes - This returns capacity()*sizeof(T).
size_t capacity_in_bytes() const
{
return size_t((char*)CapacityX - (char*)BeginX);
}
/// grow_pod - This is an implementation of the grow() method which only works
/// on POD-like data types and is out of line to reduce code duplication.
void grow_pod(size_t MinSizeInBytes, size_t TSize);
public:
bool empty() const
{
return BeginX == EndX;
}
};
template <typename T>
class SmallVectorTemplateCommon : public SmallVectorBase
{
protected:
void setEnd(T *P)
{
this->EndX = P;
}
public:
SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(Size) {}
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T value_type;
typedef T *iterator;
typedef const T *const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef T &reference;
typedef const T &const_reference;
typedef T *pointer;
typedef const T *const_pointer;
// forward iterator creation methods.
iterator begin()
{
return (iterator)this->BeginX;
}
const_iterator begin() const
{
return (const_iterator)this->BeginX;
}
iterator end()
{
return (iterator)this->EndX;
}
const_iterator end() const
{
return (const_iterator)this->EndX;
}
protected:
iterator capacity_ptr()
{
return (iterator)this->CapacityX;
}
const_iterator capacity_ptr() const
{
return (const_iterator)this->CapacityX;
}
public:
// reverse iterator creation methods.
reverse_iterator rbegin()
{
return reverse_iterator(end());
}
const_reverse_iterator rbegin() const
{
return const_reverse_iterator(end());
}
reverse_iterator rend()
{
return reverse_iterator(begin());
}
const_reverse_iterator rend() const
{
return const_reverse_iterator(begin());
}
size_type size() const
{
return end()-begin();
}
size_type max_size() const
{
return size_type(-1) / sizeof(T);
}
/// capacity - Return the total number of elements in the currently allocated
/// buffer.
size_t capacity() const
{
return capacity_ptr() - begin();
}
/// data - Return a pointer to the vector's buffer, even if empty().
pointer data()
{
return pointer(begin());
}
/// data - Return a pointer to the vector's buffer, even if empty().
const_pointer data() const
{
return const_pointer(begin());
}
reference operator[](unsigned idx)
{
assert(begin() + idx < end());
return begin()[idx];
}
const_reference operator[](unsigned idx) const
{
assert(begin() + idx < end());
return begin()[idx];
}
reference front()
{
return begin()[0];
}
const_reference front() const
{
return begin()[0];
}
reference back()
{
return end()[-1];
}
const_reference back() const
{
return end()[-1];
}
};
/// SmallVectorTemplateBase<isPodLike = false> - This is where we put method
/// implementations that are designed to work with non-POD-like T's.
template <typename T, bool isPodLike>
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T>
{
public:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
static void destroy_range(T *S, T *E)
{
while (S != E)
{
--E;
E->~T();
}
}
/// uninitialized_copy - Copy the range [I, E) onto the uninitialized memory
/// starting with "Dest", constructing elements into it as needed.
template<typename It1, typename It2>
static void uninitialized_copy(It1 I, It1 E, It2 Dest)
{
std::uninitialized_copy(I, E, Dest);
}
/// grow - double the size of the allocated memory, guaranteeing space for at
/// least one more element or MinSize if specified.
void grow(size_t MinSize = 0);
};
// Define this out-of-line to dissuade the C++ compiler from inlining it.
template <typename T, bool isPodLike>
void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize)
{
size_t CurCapacity = this->capacity();
size_t CurSize = this->size();
size_t NewCapacity = 2*CurCapacity + 1; // Always grow, even from zero.
if (NewCapacity < MinSize)
NewCapacity = MinSize;
T *NewElts = static_cast<T*>(malloc(NewCapacity*sizeof(T)));
// Copy the elements over.
this->uninitialized_copy(this->begin(), this->end(), NewElts);
// Destroy the original elements.
destroy_range(this->begin(), this->end());
// If this wasn't grown from the inline copy, deallocate the old space.
if (!this->isSmall())
free(this->begin());
this->setEnd(NewElts+CurSize);
this->BeginX = NewElts;
this->CapacityX = this->begin()+NewCapacity;
}
/// SmallVectorTemplateBase<isPodLike = true> - This is where we put method
/// implementations that are designed to work with POD-like T's.
template <typename T>
class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T>
{
public:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
// No need to do a destroy loop for POD's.
static void destroy_range(T *, T *) {}
/// uninitialized_copy - Copy the range [I, E) onto the uninitialized memory
/// starting with "Dest", constructing elements into it as needed.
template<typename It1, typename It2>
static void uninitialized_copy(It1 I, It1 E, It2 Dest)
{
// Arbitrary iterator types; just use the basic implementation.
std::uninitialized_copy(I, E, Dest);
}
/// uninitialized_copy - Copy the range [I, E) onto the uninitialized memory
/// starting with "Dest", constructing elements into it as needed.
template<typename T1, typename T2>
static void uninitialized_copy(T1 *I, T1 *E, T2 *Dest)
{
// Use memcpy for PODs iterated by pointers (which includes SmallVector
// iterators): std::uninitialized_copy optimizes to memmove, but we can
// use memcpy here.
memcpy(Dest, I, (E-I)*sizeof(T));
}
/// grow - double the size of the allocated memory, guaranteeing space for at
/// least one more element or MinSize if specified.
void grow(size_t MinSize = 0)
{
this->grow_pod(MinSize*sizeof(T), sizeof(T));
}
};
/// SmallVectorImpl - This class consists of common code factored out of the
/// SmallVector class to reduce code duplication based on the SmallVector 'N'
/// template parameter.
template <typename T>
class SmallVectorImpl : public SmallVectorTemplateBase<T, isPodLike<T>::value>
{
typedef SmallVectorTemplateBase<T, isPodLike<T>::value > SuperClass;
SmallVectorImpl(const SmallVectorImpl&); // DISABLED.
public:
typedef typename SuperClass::iterator iterator;
typedef typename SuperClass::size_type size_type;
// Default ctor - Initialize to empty.
explicit SmallVectorImpl(unsigned N)
: SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T))
{
}
~SmallVectorImpl()
{
// Destroy the constructed elements in the vector.
this->destroy_range(this->begin(), this->end());
// If this wasn't grown from the inline copy, deallocate the old space.
if (!this->isSmall())
free(this->begin());
}
void clear()
{
this->destroy_range(this->begin(), this->end());
this->EndX = this->BeginX;
}
void resize(unsigned N)
{
if (N < this->size())
{
this->destroy_range(this->begin()+N, this->end());
this->setEnd(this->begin()+N);
}
else if (N > this->size())
{
if (this->capacity() < N)
this->grow(N);
this->construct_range(this->end(), this->begin()+N, T());
this->setEnd(this->begin()+N);
}
}
void resize(unsigned N, const T &NV)
{
if (N < this->size())
{
this->destroy_range(this->begin()+N, this->end());
this->setEnd(this->begin()+N);
}
else if (N > this->size())
{
if (this->capacity() < N)
this->grow(N);
construct_range(this->end(), this->begin()+N, NV);
this->setEnd(this->begin()+N);
}
}
void reserve(unsigned N)
{
if (this->capacity() < N)
this->grow(N);
}
void push_back(const T &Elt)
{
if (this->EndX < this->CapacityX)
{
Retry:
new (this->end()) T(Elt);
this->setEnd(this->end()+1);
return;
}
this->grow();
goto Retry;
}
void pop_back()
{
this->setEnd(this->end()-1);
this->end()->~T();
}
T pop_back_val()
{
T Result = this->back();
pop_back();
return Result;
}
void swap(SmallVectorImpl &RHS);
/// append - Add the specified range to the end of the SmallVector.
///
template<typename in_iter>
void append(in_iter in_start, in_iter in_end)
{
size_type NumInputs = std::distance(in_start, in_end);
// Grow allocated space if needed.
if (NumInputs > size_type(this->capacity_ptr()-this->end()))
this->grow(this->size()+NumInputs);
// Copy the new elements over.
// TODO: NEED To compile time dispatch on whether in_iter is a random access
// iterator to use the fast uninitialized_copy.
std::uninitialized_copy(in_start, in_end, this->end());
this->setEnd(this->end() + NumInputs);
}
/// append - Add the specified range to the end of the SmallVector.
///
void append(size_type NumInputs, const T &Elt)
{
// Grow allocated space if needed.
if (NumInputs > size_type(this->capacity_ptr()-this->end()))
this->grow(this->size()+NumInputs);
// Copy the new elements over.
std::uninitialized_fill_n(this->end(), NumInputs, Elt);
this->setEnd(this->end() + NumInputs);
}
void assign(unsigned NumElts, const T &Elt)
{
clear();
if (this->capacity() < NumElts)
this->grow(NumElts);
this->setEnd(this->begin()+NumElts);
construct_range(this->begin(), this->end(), Elt);
}
iterator erase(iterator I)
{
iterator N = I;
// Shift all elts down one.
std::copy(I+1, this->end(), I);
// Drop the last elt.
pop_back();
return(N);
}
iterator erase(iterator S, iterator E)
{
iterator N = S;
// Shift all elts down.
iterator I = std::copy(E, this->end(), S);
// Drop the last elts.
this->destroy_range(I, this->end());
this->setEnd(I);
return(N);
}
iterator insert(iterator I, const T &Elt)
{
if (I == this->end()) // Important special case for empty vector.
{
push_back(Elt);
return this->end()-1;
}
if (this->EndX < this->CapacityX)
{
Retry:
new (this->end()) T(this->back());
this->setEnd(this->end()+1);
// Push everything else over.
std::copy_backward(I, this->end()-1, this->end());
*I = Elt;
return I;
}
size_t EltNo = I-this->begin();
this->grow();
I = this->begin()+EltNo;
goto Retry;
}
iterator insert(iterator I, size_type NumToInsert, const T &Elt)
{
if (I == this->end()) // Important special case for empty vector.
{
append(NumToInsert, Elt);
return this->end()-1;
}
// Convert iterator to elt# to avoid invalidating iterator when we reserve()
size_t InsertElt = I - this->begin();
// Ensure there is enough space.
reserve(static_cast<unsigned>(this->size() + NumToInsert));
// Uninvalidate the iterator.
I = this->begin()+InsertElt;
// If there are more elements between the insertion point and the end of the
// range than there are being inserted, we can use a simple approach to
// insertion. Since we already reserved space, we know that this won't
// reallocate the vector.
if (size_t(this->end()-I) >= NumToInsert)
{
T *OldEnd = this->end();
append(this->end()-NumToInsert, this->end());
// Copy the existing elements that get replaced.
std::copy_backward(I, OldEnd-NumToInsert, OldEnd);
std::fill_n(I, NumToInsert, Elt);
return I;
}
// Otherwise, we're inserting more elements than exist already, and we're
// not inserting at the end.
// Copy over the elements that we're about to overwrite.
T *OldEnd = this->end();
this->setEnd(this->end() + NumToInsert);
size_t NumOverwritten = OldEnd-I;
this->uninitialized_copy(I, OldEnd, this->end()-NumOverwritten);
// Replace the overwritten part.
std::fill_n(I, NumOverwritten, Elt);
// Insert the non-overwritten middle part.
std::uninitialized_fill_n(OldEnd, NumToInsert-NumOverwritten, Elt);
return I;
}
template<typename ItTy>
iterator insert(iterator I, ItTy From, ItTy To)
{
if (I == this->end()) // Important special case for empty vector.
{
append(From, To);
return this->end()-1;
}
size_t NumToInsert = std::distance(From, To);
// Convert iterator to elt# to avoid invalidating iterator when we reserve()
size_t InsertElt = I - this->begin();
// Ensure there is enough space.
reserve(static_cast<unsigned>(this->size() + NumToInsert));
// Uninvalidate the iterator.
I = this->begin()+InsertElt;
// If there are more elements between the insertion point and the end of the
// range than there are being inserted, we can use a simple approach to
// insertion. Since we already reserved space, we know that this won't
// reallocate the vector.
if (size_t(this->end()-I) >= NumToInsert)
{
T *OldEnd = this->end();
append(this->end()-NumToInsert, this->end());
// Copy the existing elements that get replaced.
std::copy_backward(I, OldEnd-NumToInsert, OldEnd);
std::copy(From, To, I);
return I;
}
// Otherwise, we're inserting more elements than exist already, and we're
// not inserting at the end.
// Copy over the elements that we're about to overwrite.
T *OldEnd = this->end();
this->setEnd(this->end() + NumToInsert);
size_t NumOverwritten = OldEnd-I;
this->uninitialized_copy(I, OldEnd, this->end()-NumOverwritten);
// Replace the overwritten part.
for (; NumOverwritten > 0; --NumOverwritten)
{
*I = *From;
++I;
++From;
}
// Insert the non-overwritten middle part.
this->uninitialized_copy(From, To, OldEnd);
return I;
}
const SmallVectorImpl
&operator=(const SmallVectorImpl &RHS);
bool operator==(const SmallVectorImpl &RHS) const
{
if (this->size() != RHS.size()) return false;
return std::equal(this->begin(), this->end(), RHS.begin());
}
bool operator!=(const SmallVectorImpl &RHS) const
{
return !(*this == RHS);
}
bool operator<(const SmallVectorImpl &RHS) const
{
return std::lexicographical_compare(this->begin(), this->end(),
RHS.begin(), RHS.end());
}
/// set_size - Set the array size to \arg N, which the current array must have
/// enough capacity for.
///
/// This does not construct or destroy any elements in the vector.
///
/// Clients can use this in conjunction with capacity() to write past the end
/// of the buffer when they know that more elements are available, and only
/// update the size later. This avoids the cost of value initializing elements
/// which will only be overwritten.
void set_size(unsigned N)
{
assert(N <= this->capacity());
this->setEnd(this->begin() + N);
}
private:
static void construct_range(T *S, T *E, const T &Elt)
{
for (; S != E; ++S)
new (S) T(Elt);
}
};
template <typename T>
void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS)
{
if (this == &RHS) return;
// We can only avoid copying elements if neither vector is small.
if (!this->isSmall() && !RHS.isSmall())
{
std::swap(this->BeginX, RHS.BeginX);
std::swap(this->EndX, RHS.EndX);
std::swap(this->CapacityX, RHS.CapacityX);
return;
}
if (RHS.size() > this->capacity())
this->grow(RHS.size());
if (this->size() > RHS.capacity())
RHS.grow(this->size());
// Swap the shared elements.
size_t NumShared = this->size();
if (NumShared > RHS.size()) NumShared = RHS.size();
for (unsigned i = 0; i != static_cast<unsigned>(NumShared); ++i)
std::swap((*this)[i], RHS[i]);
// Copy over the extra elts.
if (this->size() > RHS.size())
{
size_t EltDiff = this->size() - RHS.size();
this->uninitialized_copy(this->begin()+NumShared, this->end(), RHS.end());
RHS.setEnd(RHS.end()+EltDiff);
this->destroy_range(this->begin()+NumShared, this->end());
this->setEnd(this->begin()+NumShared);
}
else if (RHS.size() > this->size())
{
size_t EltDiff = RHS.size() - this->size();
this->uninitialized_copy(RHS.begin()+NumShared, RHS.end(), this->end());
this->setEnd(this->end() + EltDiff);
this->destroy_range(RHS.begin()+NumShared, RHS.end());
RHS.setEnd(RHS.begin()+NumShared);
}
}
template <typename T>
const SmallVectorImpl<T> &SmallVectorImpl<T>::
operator=(const SmallVectorImpl<T> &RHS)
{
// Avoid self-assignment.
if (this == &RHS) return *this;
// If we already have sufficient space, assign the common elements, then
// destroy any excess.
size_t RHSSize = RHS.size();
size_t CurSize = this->size();
if (CurSize >= RHSSize)
{
// Assign common elements.
iterator NewEnd;
if (RHSSize)
NewEnd = std::copy(RHS.begin(), RHS.begin()+RHSSize, this->begin());
else
NewEnd = this->begin();
// Destroy excess elements.
this->destroy_range(NewEnd, this->end());
// Trim.
this->setEnd(NewEnd);
return *this;
}
// If we have to grow to have enough elements, destroy the current elements.
// This allows us to avoid copying them during the grow.
if (this->capacity() < RHSSize)
{
// Destroy current elements.
this->destroy_range(this->begin(), this->end());
this->setEnd(this->begin());
CurSize = 0;
this->grow(RHSSize);
}
else if (CurSize)
{
// Otherwise, use assignment for the already-constructed elements.
std::copy(RHS.begin(), RHS.begin()+CurSize, this->begin());
}
// Copy construct the new elements in place.
this->uninitialized_copy(RHS.begin()+CurSize, RHS.end(),
this->begin()+CurSize);
// Set end.
this->setEnd(this->begin()+RHSSize);
return *this;
}
/// SmallVector - This is a 'vector' (really, a variable-sized array), optimized
/// for the case when the array is small. It contains some number of elements
/// in-place, which allows it to avoid heap allocation when the actual number of
/// elements is below that threshold. This allows normal "small" cases to be
/// fast without losing generality for large inputs.
///
/// Note that this does not attempt to be exception safe.
///
template <typename T, unsigned N>
class SmallVector : public SmallVectorImpl<T>
{
/// InlineElts - These are 'N-1' elements that are stored inline in the body
/// of the vector. The extra '1' element is stored in SmallVectorImpl.
typedef typename SmallVectorImpl<T>::U U;
enum
{
// MinUs - The number of U's require to cover N T's.
MinUs = (static_cast<unsigned int>(sizeof(T))*N +
static_cast<unsigned int>(sizeof(U)) - 1) /
static_cast<unsigned int>(sizeof(U)),
// NumInlineEltsElts - The number of elements actually in this array. There
// is already one in the parent class, and we have to round up to avoid
// having a zero-element array.
NumInlineEltsElts = MinUs > 1 ? (MinUs - 1) : 1,
// NumTsAvailable - The number of T's we actually have space for, which may
// be more than N due to rounding.
NumTsAvailable = (NumInlineEltsElts+1)*static_cast<unsigned int>(sizeof(U))/
static_cast<unsigned int>(sizeof(T))
};
U InlineElts[NumInlineEltsElts];
public:
SmallVector() : SmallVectorImpl<T>(NumTsAvailable)
{
}
explicit SmallVector(unsigned Size, const T &Value = T())
: SmallVectorImpl<T>(NumTsAvailable)
{
this->reserve(Size);
while (Size--)
this->push_back(Value);
}
template<typename ItTy>
SmallVector(ItTy S, ItTy E) : SmallVectorImpl<T>(NumTsAvailable)
{
this->append(S, E);
}
SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(NumTsAvailable)
{
if (!RHS.empty())
SmallVectorImpl<T>::operator=(RHS);
}
const SmallVector &operator=(const SmallVector &RHS)
{
SmallVectorImpl<T>::operator=(RHS);
return *this;
}
};
/// Specialize SmallVector at N=0. This specialization guarantees
/// that it can be instantiated at an incomplete T if none of its
/// members are required.
template <typename T>
class SmallVector<T,0> : public SmallVectorImpl<T>
{
public:
SmallVector() : SmallVectorImpl<T>(0) {}
explicit SmallVector(unsigned Size, const T &Value = T())
: SmallVectorImpl<T>(0)
{
this->reserve(Size);
while (Size--)
this->push_back(Value);
}
template<typename ItTy>
SmallVector(ItTy S, ItTy E) : SmallVectorImpl<T>(0)
{
this->append(S, E);
}
SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(0)
{
SmallVectorImpl<T>::operator=(RHS);
}
SmallVector &operator=(const SmallVectorImpl<T> &RHS)
{
return SmallVectorImpl<T>::operator=(RHS);
}
};
} // End Ogre namespace
namespace std
{
/// Implement std::swap in terms of SmallVector swap.
template<typename T>
inline void
swap(Ogre::SmallVectorImpl<T> &LHS, Ogre::SmallVectorImpl<T> &RHS)
{
LHS.swap(RHS);
}
/// Implement std::swap in terms of SmallVector swap.
template<typename T, unsigned N>
inline void
swap(Ogre::SmallVector<T, N> &LHS, Ogre::SmallVector<T, N> &RHS)
{
LHS.swap(RHS);
}
}
#endif
| [
"a.lesovoy@corp.mail.ru"
] | a.lesovoy@corp.mail.ru |
a048712926a4a775041cb6345df08789901a40f1 | cec3c68ce1620f61671bedc1643bdb041b511e56 | /source/System/Input.h | 12f0d61a1b43872753c8d0a189d6885d7005f79f | [] | no_license | 2dev2fun/SimpleEngine | e9a0d88946b83ec9ecacf2c51171ee7c452cc73a | 91db7b72b8c38d559994e4b91c9d4003bbdf8a31 | refs/heads/master | 2022-06-11T16:44:56.498386 | 2020-05-09T15:54:10 | 2020-05-09T15:54:10 | 256,160,965 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 464 | h | // Copyright (C) 2020 Maxim, 2dev2fun@gmail.com. All rights reserved.
#pragma once
#include "Engine.h"
#include "Window.h"
#include <memory>
#include <vector>
namespace engine {
class InputSystem {
public:
InputSystem(Game* game);
void update();
void attachCommand(std::shared_ptr<Command> command);
void detachCommand(std::shared_ptr<Command> command);
private:
Game* mGame;
std::vector<std::shared_ptr<Command>> mCommands;
};
} // namespace engine
| [
"2dev2fun@gmail.com"
] | 2dev2fun@gmail.com |
8ed6797c7b264948f0ff960e075206c3fd13f8fb | f9bad3ca093095da33b16ba3166cea0f837a0451 | /src/app/generator/semanticmodel/robotbinding.h | 8e8e47592c860966b930751c19ee69155de2b483 | [] | no_license | alexreinking/CodeGenerator | 1c4532eaa4f652d2e55a8f808bd54e5a68fb2d4a | 8c6b89bbf4ac0eef7a635b03d24cae4286edf7ca | refs/heads/master | 2021-03-12T23:56:31.003900 | 2013-02-23T00:56:50 | 2013-02-23T00:56:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 916 | h | #ifndef ROBOTBINDING_H
#define ROBOTBINDING_H
#include "robotobject.h"
class RobotBinding : public RobotObject
{
public:
RobotBinding(const QString &sender, const QString &receiver, bool foreignCode = false)
: sender(sender), receiver(receiver), foreignCode(foreignCode) {}
int getType() const { return BindingObject; }
bool isDefault() const { return false; }
QString getName() const { return ""; }
QString getSender() const { return sender; }
QString getReceiver() const { return receiver; }
bool getForeignCode() const { return foreignCode; }
void setSender(const QString &sender) { this->sender = sender; }
void setReceiver(const QString &receiver) { this->receiver = receiver; }
void setForeignCode(bool foreignCode) { this->foreignCode = foreignCode; }
private:
QString sender;
QString receiver;
bool foreignCode;
};
#endif // ROBOTBINDING_H
| [
"alexander.reinking@yale.edu"
] | alexander.reinking@yale.edu |
80359bc7541e65a913169148ffd8956f2872f0d1 | 07c72bdda0319c841bfaca0ae4324c4cfefd7999 | /Xavier_commit/hls/main_module/solution1/.autopilot/db/comparateur.scpp.1.cpp.line_post.CXX | 5ba2a990de14ef92acfcaaaff9873099261f23d4 | [] | no_license | cdumonde/Projet_avance_SE | 17ed1a3f149120d467b4af355f96b03658823c61 | a56c923f26de15d5aa9b38251141a4beb51b0f25 | refs/heads/master | 2021-09-12T23:23:44.117708 | 2018-01-31T11:32:36 | 2018-01-31T11:32:36 | 107,664,786 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 146,127 | cxx | #pragma line 1 "src/modules/comparateur.cpp" ::: 0
#pragma line 1 "src/modules/comparateur.cpp" 1 ::: 1
#pragma line 1 "<built-in>" 1 ::: 2
#pragma line 1 "<built-in>" 3 ::: 3
#pragma line 152 "<built-in>" 3 ::: 4
#pragma line 1 "<command line>" 1 ::: 5
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\etc/autopilot_ssdm_op.h" 1 ::: 13
#pragma line 156 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\etc/autopilot_ssdm_op.h" ::: 14
#pragma line 156 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\etc/autopilot_ssdm_op.h" ::: 15
#pragma line 9 "<command line>" 2 ::: 145
#pragma line 1 "<built-in>" 2 ::: 146
#pragma line 1 "src/modules/comparateur.cpp" 2 ::: 147
#pragma line 1 "src/modules/comparateur.h" 1 ::: 148
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc\\systemc.h" 1 ::: 152
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 1 ::: 153
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 1 3 ::: 168
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 3 ::: 169
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 3 ::: 170
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++config.h" 1 3 ::: 172
#pragma line 275 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++config.h" 3 ::: 173
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/os_defines.h" 1 3 ::: 174
#pragma line 276 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++config.h" 2 3 ::: 175
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/cpu_defines.h" 1 3 ::: 178
#pragma line 279 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++config.h" 2 3 ::: 179
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 2 3 ::: 180
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 1 3 ::: 181
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 182
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 183
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 1 3 ::: 185
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 3 ::: 186
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 3 ::: 187
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 1 3 ::: 189
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 3 ::: 190
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 3 ::: 191
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stringfwd.h" 1 3 ::: 194
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stringfwd.h" 3 ::: 195
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stringfwd.h" 3 ::: 196
#pragma line 82 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stringfwd.h" 3 ::: 226
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 2 3 ::: 228
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 1 3 ::: 229
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 230
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 231
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 1 3 ::: 233
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 234
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 235
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 238
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 239
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 240
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 243
#pragma line 31 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 3 4 ::: 244
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 250
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 2 3 ::: 261
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 1 3 ::: 264
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 273
#pragma line 10 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 274
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include/_mingw_mac.h" 1 3 ::: 275
#pragma line 10 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 2 3 ::: 276
#pragma line 277 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 277
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\vadefs.h" 1 3 ::: 278
#pragma line 13 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\vadefs.h" 3 ::: 279
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 280
#pragma line 674 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 281
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include/sdks/_mingw_directx.h" 1 3 ::: 282
#pragma line 674 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 2 3 ::: 283
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include/sdks/_mingw_ddk.h" 1 3 ::: 285
#pragma line 675 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 2 3 ::: 286
#pragma line 13 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\vadefs.h" 2 3 ::: 287
#pragma line 99 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\vadefs.h" 3 ::: 307
#pragma line 277 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 2 3 ::: 312
#pragma line 370 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 316
#pragma line 380 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 318
#pragma line 392 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 320
#pragma line 405 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 322
#pragma line 418 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 324
#pragma line 436 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 326
#pragma line 456 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 329
#pragma line 607 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 3 ::: 349
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 2 3 ::: 411
#pragma line 27 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 418
#pragma line 66 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 436
#pragma line 164 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 477
#pragma line 178 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 479
#pragma line 193 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 481
#pragma line 217 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 483
#pragma line 360 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 587
#pragma line 412 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 618
#pragma line 493 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 690
#pragma line 507 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 695
#pragma line 540 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 717
#pragma line 621 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 789
#pragma line 669 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 818
#pragma line 816 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 956
#pragma line 876 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 3 ::: 982
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/wchar_s.h" 1 3 ::: 989
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 1 3 ::: 998
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/wchar_s.h" 2 3 ::: 999
#pragma line 881 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wchar.h" 2 3 ::: 1000
#pragma line 47 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 2 3 ::: 1001
#pragma line 64 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 1002
#pragma line 138 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 1008
#pragma line 257 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 1120
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 2 3 ::: 1134
#pragma line 69 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 1135
#pragma line 89 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 1137
#pragma line 110 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 1147
#pragma line 132 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 1162
#pragma line 238 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/postypes.h" 3 ::: 1261
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 2 3 ::: 1263
#pragma line 73 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iosfwd" 3 ::: 1266
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 1353
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 1 3 ::: 1354
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 3 ::: 1355
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 3 ::: 1356
#pragma line 60 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 3 ::: 1366
#pragma line 117 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 3 ::: 1412
#pragma line 140 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception" 3 ::: 1419
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 1427
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 1 3 ::: 1428
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 3 ::: 1429
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 3 ::: 1430
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 1 3 ::: 1432
#pragma line 61 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 1433
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 1434
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 1435
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 1436
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 1439
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 1440
#pragma line 62 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 1441
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/functexcept.h" 1 3 ::: 1442
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/functexcept.h" 3 ::: 1443
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\exception_defines.h" 1 3 ::: 1444
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/functexcept.h" 2 3 ::: 1445
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 1507
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 1 3 ::: 1508
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 3 ::: 1509
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 3 ::: 1510
#pragma line 68 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 3 ::: 1511
#pragma line 193 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 3 ::: 1619
#pragma line 416 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cpp_type_traits.h" 3 ::: 1830
#pragma line 64 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 1860
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/type_traits.h" 1 3 ::: 1861
#pragma line 32 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/type_traits.h" 3 ::: 1862
#pragma line 32 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/type_traits.h" 3 ::: 1863
#pragma line 65 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 2034
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/numeric_traits.h" 1 3 ::: 2035
#pragma line 32 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/numeric_traits.h" 3 ::: 2036
#pragma line 32 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/numeric_traits.h" 3 ::: 2037
#pragma line 51 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/numeric_traits.h" 3 ::: 2043
#pragma line 96 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/numeric_traits.h" 3 ::: 2068
#pragma line 66 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 2101
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 1 3 ::: 2102
#pragma line 60 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 3 ::: 2103
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 1 3 ::: 2104
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 3 ::: 2105
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 2106
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 2107
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 2108
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 2111
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 2112
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 2 3 ::: 2113
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/concept_check.h" 1 3 ::: 2114
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/concept_check.h" 3 ::: 2115
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/concept_check.h" 3 ::: 2116
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 2 3 ::: 2117
#pragma line 95 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 3 ::: 2118
#pragma line 104 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/move.h" 3 ::: 2120
#pragma line 61 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 2 3 ::: 2144
#pragma line 113 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 3 ::: 2173
#pragma line 149 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 3 ::: 2178
#pragma line 211 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 3 ::: 2217
#pragma line 257 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_pair.h" 3 ::: 2222
#pragma line 67 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 2224
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 1 3 ::: 2225
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 3 ::: 2226
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 3 ::: 2227
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 2230
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 2231
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 2232
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 2235
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 2236
#pragma line 66 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 2 3 ::: 2237
#pragma line 84 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 3 ::: 2240
#pragma line 111 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 3 ::: 2256
#pragma line 135 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_types.h" 3 ::: 2272
#pragma line 68 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 2317
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_funcs.h" 1 3 ::: 2318
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_funcs.h" 3 ::: 2319
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_funcs.h" 3 ::: 2320
#pragma line 108 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_funcs.h" 3 ::: 2353
#pragma line 166 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator_base_funcs.h" 3 ::: 2399
#pragma line 69 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 2410
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 1 3 ::: 2411
#pragma line 68 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2412
#pragma line 94 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2414
#pragma line 281 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2591
#pragma line 393 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2691
#pragma line 420 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2706
#pragma line 443 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2713
#pragma line 469 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2728
#pragma line 484 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2733
#pragma line 510 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2747
#pragma line 533 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2754
#pragma line 559 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2769
#pragma line 578 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2774
#pragma line 621 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2793
#pragma line 647 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2801
#pragma line 673 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2816
#pragma line 694 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2830
#pragma line 792 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_iterator.h" 3 ::: 2919
#pragma line 70 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 3024
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\debug/debug.h" 1 3 ::: 3026
#pragma line 47 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\debug/debug.h" 3 ::: 3027
#pragma line 72 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 2 3 ::: 3040
#pragma line 115 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3073
#pragma line 134 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3082
#pragma line 156 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3092
#pragma line 184 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3109
#pragma line 207 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3121
#pragma line 230 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3133
#pragma line 251 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3143
#pragma line 339 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3216
#pragma line 377 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3234
#pragma line 462 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3302
#pragma line 514 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3317
#pragma line 542 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3330
#pragma line 572 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3344
#pragma line 631 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3385
#pragma line 689 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3402
#pragma line 733 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3434
#pragma line 791 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3477
#pragma line 952 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3627
#pragma line 1028 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3691
#pragma line 1060 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3708
#pragma line 1091 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3724
#pragma line 1125 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3745
#pragma line 1165 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3772
#pragma line 1202 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_algobase.h" 3 ::: 3793
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 2 3 ::: 3814
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 1 3 ::: 3816
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 3817
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 3 ::: 3818
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 3821
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 3822
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 3823
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 3826
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 3827
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwchar" 2 3 ::: 3828
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 2 3 ::: 3829
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 3 ::: 3839
#pragma line 88 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 3 ::: 3848
#pragma line 229 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/char_traits.h" 3 ::: 3976
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 4122
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 1 3 ::: 4123
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 3 ::: 4124
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 3 ::: 4125
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++locale.h" 1 3 ::: 4128
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++locale.h" 3 ::: 4129
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++locale.h" 3 ::: 4130
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\clocale" 1 3 ::: 4132
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\clocale" 3 ::: 4133
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\clocale" 3 ::: 4134
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\locale.h" 1 3 ::: 4137
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 4146
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\locale.h" 2 3 ::: 4147
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\locale.h" 3 ::: 4154
#pragma line 75 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\locale.h" 3 ::: 4175
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\clocale" 2 3 ::: 4196
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++locale.h" 2 3 ::: 4212
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 4213
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 4214
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 4215
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 4218
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 4219
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++locale.h" 2 3 ::: 4220
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 2 3 ::: 4267
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 1 3 ::: 4269
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 3 ::: 4270
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 3 ::: 4271
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 1 3 ::: 4274
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 4283
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 2 3 ::: 4284
#pragma line 72 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 3 ::: 4289
#pragma line 100 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 3 ::: 4300
#pragma line 193 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 3 ::: 4338
#pragma line 275 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\ctype.h" 3 ::: 4340
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 2 3 ::: 4342
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 3 ::: 4343
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 2 3 ::: 4361
#pragma line 54 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/localefwd.h" 3 ::: 4364
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 4498
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 1 3 ::: 4499
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 4500
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 4501
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/atomicity.h" 1 3 ::: 4503
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/atomicity.h" 3 ::: 4504
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr.h" 1 3 ::: 4505
#pragma line 30 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr.h" 3 ::: 4506
#pragma line 162 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr.h" 3 ::: 4508
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 1 3 ::: 4509
#pragma line 70 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 3 ::: 4510
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\errno.h" 1 3 ::: 4511
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 4520
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\errno.h" 2 3 ::: 4521
#pragma line 74 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\errno.h" 3 ::: 4535
#pragma line 71 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 2 3 ::: 4537
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 4539
#pragma line 73 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 2 3 ::: 4540
#pragma line 340 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 3 ::: 4541
#pragma line 374 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 3 ::: 4563
#pragma line 401 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 3 ::: 4566
#pragma line 767 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr-default.h" 3 ::: 4704
#pragma line 163 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/gthr.h" 2 3 ::: 4706
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/atomicity.h" 2 3 ::: 4715
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/atomic_word.h" 1 3 ::: 4716
#pragma line 32 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/atomic_word.h" 3 ::: 4717
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/atomicity.h" 2 3 ::: 4719
#pragma line 61 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/atomicity.h" 3 ::: 4735
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 2 3 ::: 4777
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 1 3 ::: 4779
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 4780
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 4781
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 1 3 ::: 4784
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 3 ::: 4785
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 3 ::: 4786
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 1 3 ::: 4791
#pragma line 48 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 3 ::: 4792
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++allocator.h" 1 3 ::: 4793
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++allocator.h" 3 ::: 4794
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/new_allocator.h" 1 3 ::: 4795
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/new_allocator.h" 3 ::: 4796
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\new" 1 3 ::: 4797
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\new" 3 ::: 4798
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\new" 3 ::: 4799
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 4801
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 4802
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 4803
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 4806
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 4807
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\new" 2 3 ::: 4808
#pragma line 92 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\new" 3 ::: 4848
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/new_allocator.h" 2 3 ::: 4869
#pragma line 50 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/new_allocator.h" 3 ::: 4877
#pragma line 114 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ext/new_allocator.h" 3 ::: 4934
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++allocator.h" 2 3 ::: 4950
#pragma line 49 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 2 3 ::: 4951
#pragma line 59 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 3 ::: 4954
#pragma line 85 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 3 ::: 4973
#pragma line 204 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/allocator.h" 3 ::: 5067
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 2 3 ::: 5069
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream_insert.h" 1 3 ::: 5072
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream_insert.h" 3 ::: 5073
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream_insert.h" 3 ::: 5074
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" 1 3 ::: 5077
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" 3 ::: 5078
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" 3 ::: 5079
#pragma line 46 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" ::: 5095
#pragma line 51 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" ::: 5103
#pragma line 52 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" ::: 5106
#pragma line 53 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cxxabi-forced.h" ::: 5110
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream_insert.h" 2 3 ::: 5116
#pragma line 46 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 2 3 ::: 5206
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 1 3 ::: 5210
#pragma line 60 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5211
#pragma line 99 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5213
#pragma line 134 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5235
#pragma line 198 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5288
#pragma line 262 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5341
#pragma line 345 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5394
#pragma line 416 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5441
#pragma line 523 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 3 ::: 5530
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\backward/binders.h" 1 3 ::: 5721
#pragma line 60 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\backward/binders.h" 3 ::: 5722
#pragma line 97 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\backward/binders.h" 3 ::: 5724
#pragma line 713 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/stl_function.h" 2 3 ::: 5796
#pragma line 50 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 2 3 ::: 5797
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 1 3 ::: 5800
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 5801
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 5802
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\initializer_list" 1 3 ::: 5806
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\initializer_list" 3 ::: 5807
#pragma line 33 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\initializer_list" 3 ::: 5808
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 2 3 ::: 5809
#pragma line 103 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 5812
#pragma line 140 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 5836
#pragma line 165 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 5848
#pragma line 468 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6142
#pragma line 516 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6158
#pragma line 549 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6184
#pragma line 589 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6191
#pragma line 695 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6261
#pragma line 724 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6280
#pragma line 737 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6283
#pragma line 757 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6287
#pragma line 778 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6291
#pragma line 807 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6309
#pragma line 824 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6316
#pragma line 845 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6327
#pragma line 864 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6335
#pragma line 920 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6375
#pragma line 935 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6378
#pragma line 967 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6402
#pragma line 989 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6405
#pragma line 1045 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6432
#pragma line 1061 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6438
#pragma line 1073 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6441
#pragma line 1089 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6448
#pragma line 1101 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6452
#pragma line 1129 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6457
#pragma line 1144 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6461
#pragma line 1175 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6466
#pragma line 1197 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6470
#pragma line 1220 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6477
#pragma line 1238 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6480
#pragma line 1261 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6487
#pragma line 1278 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6492
#pragma line 1302 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6502
#pragma line 1318 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6510
#pragma line 1338 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6521
#pragma line 1357 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6524
#pragma line 1379 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6528
#pragma line 1403 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6535
#pragma line 1422 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6539
#pragma line 1445 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6546
#pragma line 1463 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6551
#pragma line 1481 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6555
#pragma line 1502 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6563
#pragma line 1523 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6570
#pragma line 1545 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6578
#pragma line 1620 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6634
#pragma line 1701 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6704
#pragma line 1711 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6707
#pragma line 1721 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6710
#pragma line 1753 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6731
#pragma line 1766 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6734
#pragma line 1780 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6738
#pragma line 1797 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6745
#pragma line 1810 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6748
#pragma line 1825 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6752
#pragma line 1838 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6755
#pragma line 1855 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6762
#pragma line 1868 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6765
#pragma line 1883 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6769
#pragma line 1896 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6772
#pragma line 1915 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6779
#pragma line 1929 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6783
#pragma line 1944 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6787
#pragma line 1957 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6790
#pragma line 1976 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6797
#pragma line 1990 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6801
#pragma line 2005 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6805
#pragma line 2019 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6809
#pragma line 2036 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6816
#pragma line 2049 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6819
#pragma line 2065 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6823
#pragma line 2078 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6827
#pragma line 2095 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6834
#pragma line 2110 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6837
#pragma line 2128 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6842
#pragma line 2158 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6855
#pragma line 2182 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6858
#pragma line 2200 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6862
#pragma line 2223 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6865
#pragma line 2248 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6868
#pragma line 2260 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6873
#pragma line 2331 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6937
#pragma line 2377 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 6976
#pragma line 2414 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7006
#pragma line 2451 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7036
#pragma line 2488 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7066
#pragma line 2525 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7096
#pragma line 2562 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7126
#pragma line 2579 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7132
#pragma line 2597 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7141
#pragma line 2620 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7151
#pragma line 2638 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.h" 3 ::: 7156
#pragma line 53 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 2 3 ::: 7176
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.tcc" 1 3 ::: 7179
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.tcc" 3 ::: 7180
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.tcc" 3 ::: 7181
#pragma line 239 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.tcc" 3 ::: 7370
#pragma line 576 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_string.tcc" 3 ::: 7684
#pragma line 56 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\string" 2 3 ::: 8273
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 2 3 ::: 8274
#pragma line 61 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8278
#pragma line 97 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8304
#pragma line 116 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8314
#pragma line 125 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8316
#pragma line 135 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8318
#pragma line 150 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8321
#pragma line 163 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8323
#pragma line 175 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8325
#pragma line 189 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8331
#pragma line 204 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8334
#pragma line 223 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8346
#pragma line 251 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8359
#pragma line 267 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8364
#pragma line 302 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8389
#pragma line 336 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8411
#pragma line 367 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8434
#pragma line 431 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8486
#pragma line 574 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8617
#pragma line 591 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8621
#pragma line 608 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8625
#pragma line 635 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8645
#pragma line 649 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8650
#pragma line 666 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8655
#pragma line 685 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8660
#pragma line 699 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8664
#pragma line 728 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8681
#pragma line 744 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8685
#pragma line 757 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 3 ::: 8688
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.tcc" 1 3 ::: 8747
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.tcc" 3 ::: 8748
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.tcc" 3 ::: 8749
#pragma line 815 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_classes.h" 2 3 ::: 8982
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 2 3 ::: 8983
#pragma line 53 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 8984
#pragma line 206 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9127
#pragma line 262 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9157
#pragma line 337 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9220
#pragma line 368 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9237
#pragma line 400 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9259
#pragma line 426 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9278
#pragma line 443 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9285
#pragma line 455 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9287
#pragma line 559 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9384
#pragma line 575 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9392
#pragma line 592 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9400
#pragma line 618 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9419
#pragma line 669 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9459
#pragma line 681 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9462
#pragma line 692 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9465
#pragma line 703 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9469
#pragma line 722 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9473
#pragma line 738 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9476
#pragma line 759 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9484
#pragma line 776 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ios_base.h" 3 ::: 9492
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 9688
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 1 3 ::: 9689
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9690
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9691
#pragma line 113 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9706
#pragma line 179 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9765
#pragma line 203 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9781
#pragma line 220 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9790
#pragma line 233 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9794
#pragma line 260 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9811
#pragma line 274 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9818
#pragma line 292 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9828
#pragma line 314 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9842
#pragma line 333 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9853
#pragma line 348 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9857
#pragma line 373 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9873
#pragma line 400 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9887
#pragma line 426 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9902
#pragma line 440 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9908
#pragma line 458 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9914
#pragma line 474 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9923
#pragma line 485 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9926
#pragma line 505 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9934
#pragma line 521 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9943
#pragma line 531 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9946
#pragma line 552 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9953
#pragma line 567 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9957
#pragma line 578 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9961
#pragma line 590 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9966
#pragma line 603 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9971
#pragma line 625 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9974
#pragma line 641 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9977
#pragma line 663 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9980
#pragma line 676 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9984
#pragma line 700 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 9998
#pragma line 718 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 10002
#pragma line 744 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 10005
#pragma line 759 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 3 ::: 10013
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf.tcc" 1 3 ::: 10054
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf.tcc" 3 ::: 10055
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf.tcc" 3 ::: 10056
#pragma line 799 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\streambuf" 2 3 ::: 10191
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 10192
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 1 3 ::: 10193
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 10194
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 10195
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 1 3 ::: 10199
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10200
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10201
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwctype" 1 3 ::: 10203
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwctype" 3 ::: 10204
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwctype" 3 ::: 10205
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wctype.h" 1 3 ::: 10210
#pragma line 13 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wctype.h" 3 ::: 10211
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 10212
#pragma line 13 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wctype.h" 2 3 ::: 10213
#pragma line 166 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\wctype.h" 3 ::: 10220
#pragma line 46 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwctype" 2 3 ::: 10231
#pragma line 75 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cwctype" 3 ::: 10232
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 10261
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 1 3 ::: 10262
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 3 ::: 10263
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cctype" 3 ::: 10264
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 10265
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/ctype_base.h" 1 3 ::: 10266
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/ctype_base.h" 3 ::: 10267
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 10293
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf_iterator.h" 1 3 ::: 10300
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf_iterator.h" 3 ::: 10301
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf_iterator.h" 3 ::: 10302
#pragma line 48 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/streambuf_iterator.h" 3 ::: 10308
#pragma line 50 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 10658
#pragma line 63 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10661
#pragma line 141 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10726
#pragma line 159 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10734
#pragma line 176 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10738
#pragma line 192 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10742
#pragma line 208 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10746
#pragma line 222 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10750
#pragma line 237 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10754
#pragma line 251 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10758
#pragma line 266 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10762
#pragma line 283 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10766
#pragma line 302 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10770
#pragma line 321 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10774
#pragma line 343 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10778
#pragma line 368 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10790
#pragma line 387 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10793
#pragma line 406 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10797
#pragma line 425 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10801
#pragma line 443 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10805
#pragma line 460 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10808
#pragma line 476 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10811
#pragma line 493 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10814
#pragma line 512 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10817
#pragma line 533 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10820
#pragma line 555 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10824
#pragma line 579 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10827
#pragma line 602 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10832
#pragma line 671 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10892
#pragma line 708 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10919
#pragma line 721 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10922
#pragma line 734 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10926
#pragma line 749 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10929
#pragma line 763 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10932
#pragma line 777 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10935
#pragma line 792 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10938
#pragma line 809 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10942
#pragma line 825 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10946
#pragma line 842 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10950
#pragma line 862 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10954
#pragma line 889 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10963
#pragma line 920 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10976
#pragma line 953 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 10987
#pragma line 1002 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11023
#pragma line 1019 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11026
#pragma line 1035 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11029
#pragma line 1052 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11032
#pragma line 1072 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11035
#pragma line 1095 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11039
#pragma line 1121 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11046
#pragma line 1147 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11050
#pragma line 1172 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11063
#pragma line 1205 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11089
#pragma line 1216 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11092
#pragma line 1240 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11103
#pragma line 1259 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11106
#pragma line 1277 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11109
#pragma line 1295 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11112
#pragma line 1312 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11116
#pragma line 1329 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11119
#pragma line 1345 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11122
#pragma line 1362 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11125
#pragma line 1382 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11128
#pragma line 1404 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11131
#pragma line 1427 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11134
#pragma line 1453 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11137
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/ctype_inline.h" 1 3 ::: 11194
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/ctype_inline.h" 3 ::: 11195
#pragma line 1509 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 11232
#pragma line 1634 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11343
#pragma line 1671 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11371
#pragma line 1685 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11376
#pragma line 1699 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11381
#pragma line 1712 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11385
#pragma line 1743 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11389
#pragma line 1756 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11393
#pragma line 1769 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11397
#pragma line 1786 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11406
#pragma line 1798 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11410
#pragma line 1811 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11414
#pragma line 1824 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11418
#pragma line 1837 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11422
#pragma line 1907 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11477
#pragma line 1928 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11491
#pragma line 1954 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11494
#pragma line 1990 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11499
#pragma line 2049 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11530
#pragma line 2091 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11545
#pragma line 2162 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11601
#pragma line 2227 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11659
#pragma line 2245 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11664
#pragma line 2266 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11678
#pragma line 2284 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11681
#pragma line 2326 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11685
#pragma line 2389 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11704
#pragma line 2414 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11713
#pragma line 2462 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11747
#pragma line 2520 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 3 ::: 11797
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 1 3 ::: 11879
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 11880
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 11881
#pragma line 135 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 11973
#pragma line 729 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 12550
#pragma line 965 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 12776
#pragma line 1026 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 12817
#pragma line 1151 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 12934
#pragma line 1188 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.tcc" 3 ::: 12962
#pragma line 2601 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/locale_facets.h" 2 3 ::: 13133
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 2 3 ::: 13134
#pragma line 60 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13147
#pragma line 125 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13204
#pragma line 136 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13208
#pragma line 189 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13254
#pragma line 210 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13268
#pragma line 245 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13272
#pragma line 283 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13300
#pragma line 295 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13304
#pragma line 335 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13322
#pragma line 349 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13325
#pragma line 378 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13345
#pragma line 398 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13353
#pragma line 418 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13356
#pragma line 437 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 3 ::: 13360
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.tcc" 1 3 ::: 13395
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.tcc" 3 ::: 13396
#pragma line 34 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.tcc" 3 ::: 13397
#pragma line 144 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.tcc" 3 ::: 13495
#pragma line 471 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/basic_ios.h" 2 3 ::: 13537
#pragma line 45 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ios" 2 3 ::: 13538
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 2 3 ::: 13539
#pragma line 53 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13543
#pragma line 80 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13562
#pragma line 106 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13578
#pragma line 163 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13607
#pragma line 248 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13671
#pragma line 281 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13674
#pragma line 309 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13686
#pragma line 322 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13689
#pragma line 333 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13692
#pragma line 344 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13695
#pragma line 356 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13698
#pragma line 375 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13710
#pragma line 394 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13719
#pragma line 404 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13722
#pragma line 425 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13733
#pragma line 446 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13737
#pragma line 488 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13764
#pragma line 538 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13804
#pragma line 582 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 3 ::: 13830
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream.tcc" 1 3 ::: 13835
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream.tcc" 3 ::: 13836
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/ostream.tcc" 3 ::: 13837
#pragma line 586 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\ostream" 2 3 ::: 14204
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 2 3 ::: 14205
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 1 3 ::: 14206
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14207
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14208
#pragma line 53 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14214
#pragma line 89 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14243
#pragma line 118 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14261
#pragma line 165 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14279
#pragma line 237 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14331
#pragma line 247 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14334
#pragma line 279 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14338
#pragma line 293 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14341
#pragma line 320 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14344
#pragma line 331 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14347
#pragma line 354 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14351
#pragma line 364 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14354
#pragma line 393 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14358
#pragma line 404 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14361
#pragma line 428 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14365
#pragma line 445 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14374
#pragma line 463 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14377
#pragma line 482 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14380
#pragma line 498 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14383
#pragma line 513 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14386
#pragma line 531 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14389
#pragma line 545 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14392
#pragma line 560 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14395
#pragma line 576 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14398
#pragma line 631 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14444
#pragma line 667 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14458
#pragma line 680 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14461
#pragma line 697 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14465
#pragma line 739 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14479
#pragma line 767 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14498
#pragma line 828 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14538
#pragma line 850 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 3 ::: 14542
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/istream.tcc" 1 3 ::: 14547
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/istream.tcc" 3 ::: 14548
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/istream.tcc" 3 ::: 14549
#pragma line 512 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/istream.tcc" 3 ::: 15015
#pragma line 854 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\istream" 2 3 ::: 15574
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 2 3 ::: 15575
#pragma line 58 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\iostream" 3 ::: 15578
#pragma line 15 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 15596
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 1 3 ::: 15611
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 15620
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 2 3 ::: 15621
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 3 ::: 15626
#pragma line 172 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 3 ::: 15702
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/string_s.h" 1 3 ::: 15707
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 1 3 ::: 15716
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/string_s.h" 2 3 ::: 15717
#pragma line 175 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\string.h" 2 3 ::: 15718
#pragma line 29 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 15719
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 1 3 ::: 15720
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 15729
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 2 3 ::: 15730
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw_print_push.h" 1 3 ::: 15733
#pragma line 11 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 2 3 ::: 15734
#pragma line 101 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 3 ::: 15741
#pragma line 120 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 3 ::: 15743
#pragma line 157 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 3 ::: 15745
#pragma line 312 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 3 ::: 15891
#pragma line 475 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 3 ::: 15899
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/stdio_s.h" 1 3 ::: 15935
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 1 3 ::: 15944
#pragma line 9 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\sec_api/stdio_s.h" 2 3 ::: 15945
#pragma line 509 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 2 3 ::: 15946
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw_print_pop.h" 1 3 ::: 15949
#pragma line 511 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\stdio.h" 2 3 ::: 15950
#pragma line 30 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 15951
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 1 3 ::: 15953
#pragma line 10 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 15954
#pragma line 10 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 15955
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 ::: 15958
#pragma line 12 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 2 3 ::: 15959
#pragma line 75 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 15965
#pragma line 91 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 15971
#pragma line 135 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16005
#pragma line 162 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16024
#pragma line 189 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16042
#pragma line 219 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16065
#pragma line 264 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16068
#pragma line 299 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16071
#pragma line 335 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16075
#pragma line 376 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16079
#pragma line 404 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16083
#pragma line 553 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16201
#pragma line 583 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16222
#pragma line 595 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16224
#pragma line 739 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16290
#pragma line 788 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16332
#pragma line 871 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16368
#pragma line 893 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\math.h" 3 ::: 16380
#pragma line 31 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 16387
#pragma line 31 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" ::: 16389
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\etc/autopilot_enum.h" 1 ::: 16391
#pragma line 58 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\etc/autopilot_enum.h" ::: 16392
#pragma line 32 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 16465
#pragma line 50 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" ::: 16466
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" 1 ::: 16467
#pragma line 57 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 16468
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" 1 ::: 16474
#pragma line 73 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 16475
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\limits.h" 1 3 4 ::: 16476
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\limits.h" 3 4 ::: 16477
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\limits.h" 1 3 4 ::: 16478
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\_mingw.h" 1 3 4 ::: 16484
#pragma line 6 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\\limits.h" 2 3 4 ::: 16485
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\limits.h" 2 3 4 ::: 16486
#pragma line 74 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" 2 ::: 16487
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/hls_half.h" 1 ::: 16488
#pragma line 32 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/hls_half.h" ::: 16489
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 1 3 ::: 16490
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 3 ::: 16491
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 3 ::: 16492
#pragma line 76 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 3 ::: 16493
#pragma line 497 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 3 ::: 16897
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cmath.tcc" 1 3 ::: 17016
#pragma line 35 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/cmath.tcc" 3 ::: 17017
#pragma line 615 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cmath" 2 3 ::: 17037
#pragma line 33 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/hls_half.h" 2 ::: 17038
#pragma line 3274 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/hls_half.h" ::: 17061
#pragma line 75 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" 2 ::: 17133
#pragma line 111 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 17134
#pragma line 147 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 17137
#pragma line 158 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 17139
#pragma line 184 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 17141
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/etc/autopilot_dt.def" 1 ::: 17142
#pragma line 185 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" 2 ::: 19205
#pragma line 603 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 19206
#pragma line 646 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 19208
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/etc/autopilot_ssdm_bits.h" 1 ::: 19209
#pragma line 647 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" 2 ::: 19210
#pragma line 882 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 19437
#pragma line 924 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 19466
#pragma line 1622 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20157
#pragma line 1741 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20264
#pragma line 1878 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20390
#pragma line 2099 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20596
#pragma line 2162 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20651
#pragma line 2383 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 20861
#pragma line 2564 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21035
#pragma line 2683 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21143
#pragma line 2820 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21269
#pragma line 3046 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21479
#pragma line 3109 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21534
#pragma line 3330 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21744
#pragma line 3354 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21759
#pragma line 3423 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21797
#pragma line 3458 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21810
#pragma line 3483 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21815
#pragma line 3517 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 21840
#pragma line 3553 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22038
#pragma line 3589 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22188
#pragma line 3629 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22314
#pragma line 3683 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22344
#pragma line 3739 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22399
#pragma line 3793 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22438
#pragma line 3853 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22743
#pragma line 3878 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22869
#pragma line 3903 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 22995
#pragma line 3948 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 23006
#pragma line 4103 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 23017
#pragma line 4129 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_int_syn.h" ::: 23167
#pragma line 62 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" 2 ::: 23178
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" 1 ::: 23179
#pragma line 87 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 23180
#pragma line 1330 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 24362
#pragma line 1406 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 24425
#pragma line 1424 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 24431
#pragma line 1959 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 24950
#pragma line 2232 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 25214
#pragma line 2350 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 25271
#pragma line 2400 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 25721
#pragma line 2485 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 25796
#pragma line 2525 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot\\ap_fixed_syn.h" ::: 26090
#pragma line 63 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" 2 ::: 26115
#pragma line 224 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26265
#pragma line 249 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26283
#pragma line 364 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26386
#pragma line 389 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26404
#pragma line 490 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26494
#pragma line 515 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26512
#pragma line 627 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26612
#pragma line 652 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26630
#pragma line 752 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26718
#pragma line 777 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26736
#pragma line 846 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26793
#pragma line 869 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26809
#pragma line 975 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26903
#pragma line 1000 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_dt.h" ::: 26921
#pragma line 51 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 27010
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" 1 ::: 27011
#pragma line 60 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27012
#pragma line 98 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27021
#pragma line 125 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27039
#pragma line 211 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27131
#pragma line 799 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27632
#pragma line 833 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_core.h" ::: 27652
#pragma line 52 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 27686
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_extras.h" 1 ::: 27688
#pragma line 60 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_extras.h" ::: 27689
#pragma line 164 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_extras.h" ::: 27786
#pragma line 186 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_sc_extras.h" ::: 27813
#pragma line 54 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 2 ::: 27867
#pragma line 191 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" ::: 27868
#pragma line 293 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" ::: 27872
#pragma line 2 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc\\systemc.h" 2 ::: 27875
#pragma line 5 "src/modules/comparateur.h" 2 ::: 27876
#pragma line 1 "src/modules/constant.h" 1 ::: 27877
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc\\systemc.h" 1 ::: 27881
#pragma line 1 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc/ap_systemc.h" 1 ::: 27882
#pragma line 2 "C:/Xilinx/Vivado/2017.3/common/technology/autopilot/ap_sysc\\systemc.h" 2 ::: 27884
#pragma line 5 "src/modules/constant.h" 2 ::: 27885
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 1 3 ::: 27887
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 27888
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 27889
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 1 3 ::: 27893
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27894
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27895
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" ::: 27897
#pragma line 65 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27912
#pragma line 113 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27923
#pragma line 152 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27933
#pragma line 193 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27938
#pragma line 234 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 27972
#pragma line 273 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/codecvt.h" 3 ::: 28002
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 2 3 ::: 28232
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 1 3 ::: 28233
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28234
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28235
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 28238
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28239
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28240
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 28243
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 28244
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 2 3 ::: 28245
#pragma line 92 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28246
#pragma line 92 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" ::: 28247
#pragma line 149 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28296
#pragma line 149 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" ::: 28297
#pragma line 166 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28299
#pragma line 175 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" ::: 28309
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 2 3 ::: 28319
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/basic_file.h" 1 3 ::: 28320
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/basic_file.h" 3 ::: 28321
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/basic_file.h" 3 ::: 28322
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++io.h" 1 3 ::: 28325
#pragma line 36 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++io.h" 3 ::: 28326
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 1 3 ::: 28327
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28328
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 3 ::: 28329
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 28332
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28333
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28334
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 28337
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 28338
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstdio" 2 3 ::: 28339
#pragma line 37 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++io.h" 2 3 ::: 28340
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 1 3 ::: 28341
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28342
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 3 ::: 28343
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin/../lib/clang/3.1/include\\stddef.h" 1 3 4 ::: 28346
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\cstddef" 2 3 ::: 28347
#pragma line 38 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++io.h" 2 3 ::: 28348
#pragma line 40 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/c++io.h" ::: 28351
#pragma line 41 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/basic_file.h" 2 3 ::: 28360
#pragma line 43 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2/x86_64-w64-mingw32\\bits/basic_file.h" ::: 28363
#pragma line 44 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 2 3 ::: 28427
#pragma line 48 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" ::: 28432
#pragma line 65 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28434
#pragma line 127 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28489
#pragma line 263 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28586
#pragma line 290 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28589
#pragma line 322 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28614
#pragma line 342 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28622
#pragma line 385 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28653
#pragma line 413 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28671
#pragma line 440 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28691
#pragma line 453 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28694
#pragma line 485 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28702
#pragma line 495 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28705
#pragma line 524 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28723
#pragma line 562 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28734
#pragma line 581 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28742
#pragma line 608 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28762
#pragma line 622 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28765
#pragma line 656 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28774
#pragma line 666 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28777
#pragma line 695 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28795
#pragma line 735 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28807
#pragma line 754 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28815
#pragma line 782 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28836
#pragma line 794 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28840
#pragma line 825 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28849
#pragma line 835 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28852
#pragma line 864 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28870
#pragma line 904 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 3 ::: 28882
#pragma line 1 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/fstream.tcc" 1 3 ::: 28895
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/fstream.tcc" 3 ::: 28896
#pragma line 39 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/fstream.tcc" 3 ::: 28897
#pragma line 42 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/fstream.tcc" ::: 28901
#pragma line 672 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\bits/fstream.tcc" 3 ::: 29524
#pragma line 916 "C:/Xilinx/Vivado/2017.3/win64/tools/clang/bin\\..\\lib\\clang\\3.1/../../../include/c++/4.5.2\\fstream" 2 3 ::: 29777
#pragma line 7 "src/modules/constant.h" 2 ::: 29778
#pragma line 6 "src/modules/comparateur.h" 2 ::: 29779
#pragma line 7 "src/modules/comparateur.h" ::: 29781
#pragma line 27 "src/modules/comparateur.h" ::: 29816
#pragma line 2 "src/modules/comparateur.cpp" 2 ::: 29822
#pragma line 3 "src/modules/comparateur.cpp" ::: 29824
#pragma line 5 "src/modules/comparateur.cpp" ::: 29841
| [
"Xavier@MacBook-Pro-de-xavier.local"
] | Xavier@MacBook-Pro-de-xavier.local |
c6d1b51d55dba099ecb2ecba5ed52cdb099e7614 | 357e944448290ddeb6c23e5d1354edb8943cd087 | /area/area.cpp | b5a8366f35808be02391b0ae3f885fccc9ab533d | [] | no_license | aruj900/C- | a6b43fa478f064fd06e47a9e56aa600ff071c824 | 445003beee6d7a19cdc8bee0bd20d6f2ccc3c1ca | refs/heads/main | 2023-03-08T22:17:07.933040 | 2021-02-27T12:40:47 | 2021-02-27T12:40:47 | 315,115,379 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 324 | cpp | #include <iostream>
#include <cmath>
using namespace std;
/* const double PI = 3.14; */
int main(){
double radius, area;
cout<<"Please enter the radius of the circle"<<endl;
cin>>radius;
area = M_PI * (radius*radius);
cout<<"Area of circle with radius "<<radius<<" is equal to "<<area;
return 0;
}
| [
"arujmahajan@Arujs-MacBook-Pro.local"
] | arujmahajan@Arujs-MacBook-Pro.local |
a121ca47bfcc0f87b9e9955934d46e736774a4a1 | 2bc227439d76c91bf421eeb3e4277b50d45f3439 | /oclErrorCodes.cpp | b174ac2ee2e810344de985f7ebf3f9351186e21f | [] | no_license | alare/sdaccel | d0d744efc972df64cb28b15cf3f5f0b31351dd37 | 089c43dd46fb68bf11c181bf61c12d1cd62b0c3a | refs/heads/master | 2020-12-03T11:23:59.856840 | 2016-09-17T14:45:54 | 2016-09-17T14:45:54 | 66,237,040 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,600 | cpp | #include <map>
#include <string>
#include <CL/cl.h>
#define TO_STRING(x) #x
static const std::pair<cl_int, std::string> map_pairs[] = {
std::make_pair(CL_SUCCESS, TO_STRING(CL_SUCCESS)),
std::make_pair(CL_DEVICE_NOT_FOUND, TO_STRING(CL_DEVICE_NOT_FOUND)),
std::make_pair(CL_DEVICE_NOT_AVAILABLE, TO_STRING(CL_DEVICE_NOT_AVAILABLE)),
std::make_pair(CL_COMPILER_NOT_AVAILABLE, TO_STRING(CL_COMPILER_NOT_AVAILABLE)),
std::make_pair(CL_MEM_OBJECT_ALLOCATION_FAILURE, TO_STRING(CL_MEM_OBJECT_ALLOCATION_FAILURE)),
std::make_pair(CL_OUT_OF_RESOURCES, TO_STRING(CL_OUT_OF_RESOURCES)),
std::make_pair(CL_OUT_OF_HOST_MEMORY, TO_STRING(CL_OUT_OF_HOST_MEMORY)),
std::make_pair(CL_PROFILING_INFO_NOT_AVAILABLE, TO_STRING(CL_PROFILING_INFO_NOT_AVAILABLE)),
std::make_pair(CL_MEM_COPY_OVERLAP, TO_STRING(CL_MEM_COPY_OVERLAP)),
std::make_pair(CL_IMAGE_FORMAT_MISMATCH, TO_STRING(CL_IMAGE_FORMAT_MISMATCH)),
std::make_pair(CL_IMAGE_FORMAT_NOT_SUPPORTED, TO_STRING(CL_IMAGE_FORMAT_NOT_SUPPORTED)),
std::make_pair(CL_BUILD_PROGRAM_FAILURE, TO_STRING(CL_BUILD_PROGRAM_FAILURE)),
std::make_pair(CL_MAP_FAILURE, TO_STRING(CL_MAP_FAILURE)),
std::make_pair(CL_MISALIGNED_SUB_BUFFER_OFFSET, TO_STRING(CL_MISALIGNED_SUB_BUFFER_OFFSET)),
std::make_pair(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, TO_STRING(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_W)),
std::make_pair(CL_INVALID_VALUE, TO_STRING(CL_INVALID_VALUE)),
std::make_pair(CL_INVALID_DEVICE_TYPE, TO_STRING(CL_INVALID_DEVICE_TYPE)),
std::make_pair(CL_INVALID_PLATFORM, TO_STRING(CL_INVALID_PLATFORM)),
std::make_pair(CL_INVALID_DEVICE, TO_STRING(CL_INVALID_DEVICE)),
std::make_pair(CL_INVALID_CONTEXT, TO_STRING(CL_INVALID_CONTEXT)),
std::make_pair(CL_INVALID_QUEUE_PROPERTIES, TO_STRING(CL_INVALID_QUEUE_PROPERTIES)),
std::make_pair(CL_INVALID_COMMAND_QUEUE, TO_STRING(CL_INVALID_COMMAND_QUEUE)),
std::make_pair(CL_INVALID_HOST_PTR, TO_STRING(CL_INVALID_HOST_PTR)),
std::make_pair(CL_INVALID_MEM_OBJECT, TO_STRING(CL_INVALID_MEM_OBJECT)),
std::make_pair(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, TO_STRING(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR)),
std::make_pair(CL_INVALID_IMAGE_SIZE, TO_STRING(CL_INVALID_IMAGE_SIZE)),
std::make_pair(CL_INVALID_SAMPLER, TO_STRING(CL_INVALID_SAMPLER)),
std::make_pair(CL_INVALID_BINARY, TO_STRING(CL_INVALID_BINARY)),
std::make_pair(CL_INVALID_BUILD_OPTIONS, TO_STRING(CL_INVALID_BUILD_OPTIONS)),
std::make_pair(CL_INVALID_PROGRAM, TO_STRING(CL_INVALID_PROGRAM)),
std::make_pair(CL_INVALID_PROGRAM_EXECUTABLE, TO_STRING(CL_INVALID_PROGRAM_EXECUTABLE)),
std::make_pair(CL_INVALID_KERNEL_NAME, TO_STRING(CL_INVALID_KERNEL_NAME)),
std::make_pair(CL_INVALID_KERNEL_DEFINITION, TO_STRING(CL_INVALID_KERNEL_DEFINITION)),
std::make_pair(CL_INVALID_KERNEL, TO_STRING(CL_INVALID_KERNEL)),
std::make_pair(CL_INVALID_ARG_INDEX, TO_STRING(CL_INVALID_ARG_INDEX)),
std::make_pair(CL_INVALID_ARG_VALUE, TO_STRING(CL_INVALID_ARG_VALUE)),
std::make_pair(CL_INVALID_ARG_SIZE, TO_STRING(CL_INVALID_ARG_SIZE)),
std::make_pair(CL_INVALID_KERNEL_ARGS, TO_STRING(CL_INVALID_KERNEL_ARGS)),
std::make_pair(CL_INVALID_WORK_DIMENSION, TO_STRING(CL_INVALID_WORK_DIMENSION)),
std::make_pair(CL_INVALID_WORK_GROUP_SIZE, TO_STRING(CL_INVALID_WORK_GROUP_SIZE)),
std::make_pair(CL_INVALID_WORK_ITEM_SIZE, TO_STRING(CL_INVALID_WORK_ITEM_SIZE)),
std::make_pair(CL_INVALID_GLOBAL_OFFSET, TO_STRING(CL_INVALID_GLOBAL_OFFSET)),
std::make_pair(CL_INVALID_EVENT_WAIT_LIST, TO_STRING(CL_INVALID_EVENT_WAIT_LIST)),
std::make_pair(CL_INVALID_EVENT, TO_STRING(CL_INVALID_EVENT)),
std::make_pair(CL_INVALID_OPERATION, TO_STRING(CL_INVALID_OPERATION)),
std::make_pair(CL_INVALID_GL_OBJECT, TO_STRING(CL_INVALID_GL_OBJECT)),
std::make_pair(CL_INVALID_BUFFER_SIZE, TO_STRING(CL_INVALID_BUFFER_SIZE)),
std::make_pair(CL_INVALID_MIP_LEVEL, TO_STRING(CL_INVALID_MIP_LEVEL)),
std::make_pair(CL_INVALID_GLOBAL_WORK_SIZE, TO_STRING(CL_INVALID_GLOBAL_WORK_SIZE)),
std::make_pair(CL_INVALID_PROPERTY, TO_STRING(CL_INVALID_PROPERTY))};
static const std::map<cl_int, std::string> oclErrorCodes(map_pairs, map_pairs + sizeof(map_pairs) / sizeof(map_pairs[0]));
const char *oclErrorCode(cl_int code)
{
std::map<cl_int, std::string>::const_iterator iter = oclErrorCodes.find(code);
if (iter == oclErrorCodes.end())
return "UNKNOWN ERROR";
else
return iter->second.c_str();
}
// XSIP watermark, do not delete 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689
| [
"uchen@cn.ibm.com"
] | uchen@cn.ibm.com |
f5229cc337170ef422e04d5a38b311e0d9f8064b | a3d72d39f72cf11fe2ff124901cb319cb2f0c34a | /Source/Device/GfxGraphicsCommandList.inl | a4ac86f00c41f42c4a97ce7853b69d92f3e86ccb | [] | no_license | takasuke-ando/GfxLib_D3D12 | c8018d17fa752b6f7a5279804a506a9d279d1ba1 | c6fd400ed8634c80736b3d53e0a15d4745ebefef | refs/heads/master | 2021-05-24T04:49:39.981780 | 2020-09-01T00:16:37 | 2020-09-01T00:16:37 | 54,645,405 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,270 | inl | #ifndef __INLUCDE_GFXGRAPHICSCOMMANDLIST_INL__
#define __INLUCDE_GFXGRAPHICSCOMMANDLIST_INL__
namespace GfxLib
{
inline void GraphicsCommandList::SetPrimitiveTopologyType(D3D12_PRIMITIVE_TOPOLOGY_TYPE topology) {
if (m_PipelineState.PrimitiveTopologyType != topology) {
m_bPipelineDirty = true;
m_PipelineState.PrimitiveTopologyType = topology;
}
}
inline void GraphicsCommandList::IASetIndexBuffer(
const D3D12_INDEX_BUFFER_VIEW *pView)
{
GetD3DCommandList()->IASetIndexBuffer(pView);
}
inline void GraphicsCommandList::IASetVertexBuffers(
UINT StartSlot,
UINT NumViews,
const D3D12_VERTEX_BUFFER_VIEW *pViews)
{
GetD3DCommandList()->IASetVertexBuffers(StartSlot, NumViews, pViews);
}
inline void GraphicsCommandList::IASetPrimitiveTopology(
D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology)
{
GetD3DCommandList()->IASetPrimitiveTopology(PrimitiveTopology);
}
inline void GraphicsCommandList::SetGraphicsRootDescriptorTable(
uint32_t RootParameterIndex,
const DescriptorBuffer &descBuffer)
{
m_pCmdList->SetGraphicsRootDescriptorTable(RootParameterIndex, descBuffer.GetGPUDescriptorHandle());
}
}
#endif // !__INLUCDE_GFXGRAPHICSCOMMANDLIST_INL__
| [
"an_chan99@yahoo.co.jp"
] | an_chan99@yahoo.co.jp |
078eac60c1c8f183509f66a2742193768f521fca | bd1fea86d862456a2ec9f56d57f8948456d55ee6 | /000/074/793/CWE124_Buffer_Underwrite__new_char_loop_44.cpp | b660e46499b349900c27b745f3c91d916dd02539 | [] | no_license | CU-0xff/juliet-cpp | d62b8485104d8a9160f29213368324c946f38274 | d8586a217bc94cbcfeeec5d39b12d02e9c6045a2 | refs/heads/master | 2021-03-07T15:44:19.446957 | 2020-03-10T12:45:40 | 2020-03-10T12:45:40 | 246,275,244 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,726 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE124_Buffer_Underwrite__new_char_loop_44.cpp
Label Definition File: CWE124_Buffer_Underwrite__new.label.xml
Template File: sources-sink-44.tmpl.cpp
*/
/*
* @description
* CWE: 124 Buffer Underwrite
* BadSource: Set data pointer to before the allocated memory buffer
* GoodSource: Set data pointer to the allocated memory buffer
* Sinks: loop
* BadSink : Copy string to data using a loop
* Flow Variant: 44 Data/control flow: data passed as an argument from one function to a function in the same source file called via a function pointer
*
* */
#include "std_testcase.h"
#include <wchar.h>
namespace CWE124_Buffer_Underwrite__new_char_loop_44
{
#ifndef OMITBAD
static void badSink(char * data)
{
{
size_t i;
char source[100];
memset(source, 'C', 100-1); /* fill with 'C's */
source[100-1] = '\0'; /* null terminate */
/* POTENTIAL FLAW: Possibly copying data to memory before the destination buffer */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
/* Ensure the destination buffer is null terminated */
data[100-1] = '\0';
printLine(data);
/* INCIDENTAL CWE-401: Memory Leak - data may not point to location
* returned by new [] so can't safely call delete [] on it */
}
}
void bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = badSink;
data = NULL;
{
char * dataBuffer = new char[100];
memset(dataBuffer, 'A', 100-1);
dataBuffer[100-1] = '\0';
/* FLAW: Set data pointer to before the allocated memory buffer */
data = dataBuffer - 8;
}
/* use the function pointer */
funcPtr(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
static void goodG2BSink(char * data)
{
{
size_t i;
char source[100];
memset(source, 'C', 100-1); /* fill with 'C's */
source[100-1] = '\0'; /* null terminate */
/* POTENTIAL FLAW: Possibly copying data to memory before the destination buffer */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
/* Ensure the destination buffer is null terminated */
data[100-1] = '\0';
printLine(data);
/* INCIDENTAL CWE-401: Memory Leak - data may not point to location
* returned by new [] so can't safely call delete [] on it */
}
}
static void goodG2B()
{
char * data;
void (*funcPtr) (char *) = goodG2BSink;
data = NULL;
{
char * dataBuffer = new char[100];
memset(dataBuffer, 'A', 100-1);
dataBuffer[100-1] = '\0';
/* FIX: Set data pointer to the allocated memory buffer */
data = dataBuffer;
}
funcPtr(data);
}
void good()
{
goodG2B();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE124_Buffer_Underwrite__new_char_loop_44; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"frank@fischer.com.mt"
] | frank@fischer.com.mt |
be894af3bce25074a31f4c551e2c07ea51fecdec | 93f328e10b5b02ac0cdb4afdf1a84db83bcadfa5 | /viking/sort/trees.cpp | 10cadf110656106a43cda76729a08ce3c3fbdc35 | [] | no_license | missingjs/mustard | 184eba4e9abe698716a3f540b7518c5da73055e9 | ad4cf820a6bdfa8535c07dbdfdaf57f0e3caed96 | refs/heads/master | 2022-02-27T12:34:32.393355 | 2016-08-21T16:00:21 | 2016-08-21T16:00:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 363 | cpp | // @mission: 实现树形选择排序
#include "trees.def.h"
#include "common/array.h"
using namespace mustard;
int main()
{
int n = 0;
int * arr = array::read<int>(n);
int len = 0;
_ts * t = build_complete_tree(arr, n, len);
tree_select_output(t, len, arr, n);
array::print(arr, n);
delete[] arr;
delete[] t;
return 0;
}
| [
"venux021@outlook.com"
] | venux021@outlook.com |
36c2a46fc2b2bef9f81fb131612f04cb38380510 | addedb059a79bca6128e5afbb954f45736c9cd53 | /MossbauerLab.Sm2201.ExtSaveUtility/src/configs/schedulerConfig.h | 6b3dc66bf159a796582addda4cb4b4528db0e3df | [
"Apache-2.0"
] | permissive | MossbauerLab/Sm2201Autosave | 962922b01b84cd88997020ec54cc36aa1536deff | 8d5e2f8438887fa5636bde48678209ae43a4720d | refs/heads/master | 2022-12-24T18:39:00.125882 | 2022-12-19T08:51:30 | 2022-12-19T08:51:30 | 211,931,958 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,604 | h | #ifndef SM2201_SPECTRUM_SAVER_SRC_CONFIG_SCHEDULER_CONFIG_H
#define SM2201_SPECTRUM_SAVER_SRC_CONFIG_SCHEDULER_CONFIG_H
#pragma warning(disable:4786)
#pragma comment(linker, "/IGNORE:4786")
#include <string>
#include "propertyReader.h"
namespace MossbauerLab
{
namespace Sm2201
{
namespace Config
{
class SchedulerConfig
{
public:
SchedulerConfig(const std::string& schedulerConfigFile);
~SchedulerConfig();
void reload();
inline bool getState() const {return _state;}
inline bool isChannelOneUsing() const {return _useChannelOne;}
inline bool isChannelTwoUsing() const {return _useChannelTwo;}
inline long getChannelOnePeriod() const {return _channelOnePeriod;}
inline long getChannelTwoPeriod() const {return _channelTwoPeriod;}
inline const std::string& getOutputDir() const {return _outputDir;}
inline const std::string& getArchiveDir() const {return _archiveDir;}
inline long getKeySendTimeout() const {return _keySendTimeout;}
private:
MossbauerLab::Utils::Config::PropertyReader* reader;
bool _state;
bool _useChannelOne;
bool _useChannelTwo;
long _channelOnePeriod;
long _channelTwoPeriod;
std::string _outputDir;
std::string _archiveDir;
long _keySendTimeout;
};
}
}
}
#endif | [
"um.nix.user@gmail.com"
] | um.nix.user@gmail.com |
249a50317f879cce702d47aa1b91278364fd16dc | 3b1d3e85f0ef77f5dafdd3b6e3414f2defdbbc48 | /crypto_break/crypto.cpp | 180547571bfb0172e421532aea4d582b5bf57cb1 | [] | no_license | ilovepi/crypto_break | 32d5c73339dc3f89a3fd68db090255a49bc0fff0 | 001d72c8d74fdccf92fc026adf338e325d21b7cb | refs/heads/master | 2016-09-02T05:17:45.915183 | 2015-10-22T06:25:03 | 2015-10-22T06:25:03 | 26,564,651 | 0 | 0 | null | 2014-11-22T01:09:07 | 2014-11-13T01:27:33 | C++ | UTF-8 | C++ | false | false | 6,851 | cpp | #include "crypto.hpp"
crypto::crypto()
{
top_alpha = "etaoinshr";
std::ifstream infile("dictionary.txt");
std::string word;
while (getline(infile, word))
dict.insert(std::make_pair(word, word.size()*word.size()));
infile.close();
}
crypto::~crypto(){}
char crypto::incr(char c)
{ return (char)('a' + ((c-'a'+1) % 26)); }
std::string crypto::str_inc(const std::string& input)
{
std::string str;
std::transform(input.begin(), input.end(), std::back_inserter(str), incr);
return str;
}
std::vector<std::string> crypto::shift(const std::string& str)
{
std::vector<std::string> str_vec;
auto temp = str;
for (int i = 0; i < 26; ++i)
{
temp = str_inc(temp);
str_vec.push_back(temp);
}
return str_vec;
}
bool crypto::comp_map_key(map_key x, map_key y)
{ return x.second < y.second; }
void crypto::merge(scores &ret, std::vector<map_key> &other)
{
assert(std::is_heap(other.begin(), other.end()));
auto it = ret.find(other.front().first);// look for the top item from other in ret
if (it == ret.end())
ret.insert(other.front());// if its not there, add it to ret
else//otherwise look for it in ret, and only choose the larger of the 2( shouldn't be necessary, but ...)
ret[other.front().first] = std::max(other.front().second, ret[other.front().first]);
std::pop_heap(other.begin(), other.end(), comp_map_key);// reduce the size of the heap
other.pop_back();// remove the item from the vector
}
crypto::scores crypto::top(scores &sub, scores &whole, size_t n)
{
scores ret;
//make 2 heaps out of whole and sub
std::vector<std::pair<std::string, int>> whole_que, sub_que;
for (auto it = whole.begin(); it != whole.end(); it++)
whole_que.push_back(*it);
std::make_heap(whole_que.begin(), whole_que.end(), comp_map_key);
for (auto it = sub.begin(); it != sub.end(); it++)
sub_que.push_back(*it);
std::make_heap(sub_que.begin(), sub_que.end(), comp_map_key);
// while they're both not empty and ret isn't full take the top items from each heap
while (ret.size() < n && !whole_que.empty() && !sub_que.empty())
{
if (comp_map_key(whole_que.front(), sub_que.front()))
merge(ret, whole_que);
else
merge(ret, sub_que);
}
// if sub runs out first, take the rest of the items from whole
while (ret.size() < n && !whole_que.empty())
merge(ret, whole_que);
//if whole ran out, take the rest of the items from sub
while (ret.size() < n && !sub_que.empty())
merge(ret, sub_que);
return ret;//return the new master list
}
std::vector<int> crypto::get_freq(const std::string& str)
{
std::vector<int> freq(26, 0);
for (int i = 0; i < str.size(); ++i)
++freq[str[i] - 'a'];
return freq;
}
crypto::scores crypto::freq_list(const std::string &s)
{
scores freq;
std::string str = "a";
for (int i = 0; i < 26; ++i, ++str[0])
freq.insert(std::make_pair(str,0));
for (int i = 0; i < s.size(); ++i)
++freq[s.substr(i,1)];
return freq;
}
int crypto::get_scores(const std::string& str)
{
std::map<std::string, size_t> memo;
return get_scores(str, memo, 0);
}
/* This needs multi threading !!!!!*/
int crypto::get_scores(const std::string& str, std::map<std::string, size_t> &memo, size_t pos)
{
//recursive base case check
if (pos >= str.size())
return 0;
int ret= 0; // return value
int temp = 0; // temp value for calc
int m = 1; // window size
std::string window = str.substr(pos, m);
// look for the current string in the memo, if its there just use its value, if not calculate it
//lock hash
auto it = memo.find(str.substr(pos, str.size())); //<-- not thread safe
bool in_hash = (it != memo.end()); //<-- not thread safe
if (!in_hash) //<-- not thread safe
{
//unlock memo
while (m <= (str.size() - pos))
{
//look up the substring in the dictionary
if (dict.find(window) != dict.end())
{
//if we find them, give them a score and look at the rest of the string for more words
temp = (m*m + get_scores(str, memo, pos + m));
if (ret < temp)
ret = temp;
}
++m;//increase the window size
window = str.substr(pos, m);//update window to be the proper substring
}
//insert the new score and substring pair into the memo if its not there or update it with the high score
//lock memo
it = memo.find(str.substr(pos, str.size())); //<-- not thread safe
if (it == memo.end() || (it->second < ret))
memo.insert(std::make_pair(str.substr(pos, str.size()), ret)); //<-- not thread safe. need a mutex
//unlock memo
}
else
{
ret = it->second;
//unlock memo
}
return std::max(ret, get_scores(str, memo, pos+1));
}
void crypto::columnar_decryption(std::string cipher)
{
static int count = 0; //static count for printing, not really useful in general
std::ofstream file("perms.txt", std::ofstream::app); //open the file to append to
scores ord, writer; // 2 vectors of scores writer is the master list, ord is the temp list
// attack all key lengths up to 10 (should probably avoid a magic number and make max_key_len a parameter)
for (int columns = 1; columns <= 10; columns++)
{
//create a vector of the indexes based on the key length
std::vector<size_t> indexes;
for (int i = 0; i < columns; ++i)
indexes.push_back(i);
//number of columns for all rows(integer division is ok here)
int rows = cipher.size() / columns;
//number of columns that will be in the final row (if it exists)
int extra = cipher.size() % columns;
// the columns of the message
std::vector<std::string> pqr(indexes.size());
//decrypt the columnar transposition for each permutation of column orderings
while (std::next_permutation(indexes.begin(), indexes.end()))
{
int start = 0;
int end;
for (int i = 0; i < columns; ++i)
{
end = rows + (extra > indexes[i]);
pqr[indexes[i]] = cipher.substr(start, end);
start += end;
}
std::string word;
for (int i = 0; i < rows + (extra > 0); ++i)
{
auto offset = i*columns;
for (int j = 0; j < columns; ++j)
{
auto index = j + offset;
if (index < cipher.size())
word += pqr[j][i];
}
}
auto score = get_scores(word);// get the score for the decrypted message
if (ord.find(word) != ord.end())
ord[word] = std::max(ord[word], score);//only keep the max scores
else
ord[word] = score;//add a new score if we don't have it yet
} // end while
writer = top(ord, writer, 1000);//only keep the top 1000 scores for the future
}
// order the list by score instead of string so we need to use a multimap
auto ret = flip_map(writer);
//write the scores to a file
for (auto it = ret.begin(); it != ret.end(); ++it)
file << it->first << " " << it->second << std::endl;
file.close();
++count;
printf("Finished %d \n", count);
}
| [
"pk1574@gmail.com"
] | pk1574@gmail.com |
c1d7999866ad7e014095ebb58f6ae9437876de8c | 6cacd8000af1f4d477d242dbf57743f54bec3706 | /Semestr_1/Kyrsova/SpaceBattleConsole/Menu.h | a17cd031e4f928c59fd7b57bea0d7721e0fee880 | [] | no_license | MaZeSA/CPP-OOP | 21f2d4ab8489ecb2739aa9c3afacddc1f51d1e14 | 1090eaa709aa86c0d2c69f7aab80c3e905d34c34 | refs/heads/master | 2023-06-25T09:57:12.349864 | 2021-07-23T18:01:18 | 2021-07-23T18:01:18 | 315,003,580 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,727 | h | #pragma once
#include "Fild.h"
#include <iostream>
#include <thread>
class Menu : public Fild
{
public:
class ListMenu
{
public:
ListMenu(int y_, int x_)
{
this->x = x_;
this->y = y_;
}
void PrintMenu(Menu* menu_)
{
for (int i = 0; i < 3; i++)
{
setCursorPosition(this->x, this->y + i);
std::cout << menu[i];
}
++(*this);
--(*this);
WaitUser(menu_);
}
void WaitUser(Menu* menu_)
{
while (true)
{
this_thread::sleep_for(std::chrono::milliseconds(40));
if (GetAsyncKeyState(38) == -32767)
--(*this);
if (GetAsyncKeyState(40) == -32767)
++(*this);
if (GetAsyncKeyState(VK_RETURN) == -32767)
{
if (this->GetSelect() == 0)
menu_->StartGame();
else if (this->GetSelect() == 1)
menu_->Settings();
else if (this->GetSelect() == 2)
exit(0);
}
}
}
void SelectMenu(FG_COLORS color, char c_)
{
setCursorPosition(this->x - 1, this->y + this->selectItem);
setTextColour(color);
cout << c_ << menu[this->selectItem];
}
int GetSelect()
{
return this->selectItem;
}
int* operator++()
{
if (this->selectItem == 2) return &selectItem;
SelectMenu(defColor, ' ');
this->selectItem++;
SelectMenu(selColor, '*');
return &selectItem;
}
int* operator--()
{
if (this->selectItem == 0) return &selectItem;
SelectMenu(defColor, ' ');
this->selectItem--;
SelectMenu(selColor, '*');
return &selectItem;
}
private:
string menu[3] = {" Start Game"," Controls"," Exit" };
FG_COLORS defColor = FG_COLORS::FG_LIGHTGRAY;
FG_COLORS selColor = FG_COLORS::FG_YELLOW;
int selectItem = 0;
int x = 0, y = 0;
};
Menu(int x_, int y_, int retreat_) : Fild(x_, y_, retreat_) {};
void PrintLogo();
void MazesaPrint();
void Present();
void SpaseBatlePrint(int y_);
void RunBullet();
void StartGame();
void Settings();
void PrintFinal(int);
private:
std::string MaZeSa[5] =
{
" ii ii i iiiiii iiiiii iiii i ",
" iii iii i i ii i i i i ",
" ii i i ii i i ii iiiiii iiii i i ",
" ii i ii iiiiiii ii i i iiiiiii ",
" ii ii ii ii iiiiii iiiiii iiiii ii ii"
};
std::string SpaseBatle[10] =
{
" IIIII IIIII I IIIII IIIIII IIIII I IIIIIIII II IIIIII ",
" II II I I I II II II I I I II II II ",
" IIII IIIII I I IIII IIIIII IIIII I I II II IIIIII ",
" II II IIIIIII II II II I IIIIIII II II II ",
" IIIII II II II IIIII IIIIII IIIII II II II IIIIII IIIIII "
};
};
| [
"lostfilmclient@gmail.com"
] | lostfilmclient@gmail.com |
b1b2c603a5939180ff1859ba4cf4035c47df017f | 6c0e8a23af93c38dc9d62b43fb3b96d952a85c21 | /hello/prome.cpp | 170b7554c5f5a22eb06ba9e934845427d8ceb2c8 | [] | no_license | Bernini0/Codes | 9072be1f3a1213d1dc582c233ebcedf991b62f2b | 377ec182232d8cfe23baffa4ea4c43ebef5f10bf | refs/heads/main | 2023-07-06T13:10:49.072244 | 2021-08-11T17:30:03 | 2021-08-11T17:30:03 | 393,320,827 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,725 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[168]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997};
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
int n = a*b*c;
n = sqrt(n);
int arr1[1000000];
memset(arr1,0,sizeof(arr1));
int l = 0;
int ans =0, cnt =1,d=1;
for (int i = 1; i <= a; i++)
{
for (int j = 1; j <= b; j++)
{
for (int k = 1; k <= c; k++)
{
arr1[l] = a*b*c;
l++;
}
}
}
for (int j = 0; j < 1000000; j++)
{
if(arr1[j]==0){
break;
}
else
{
d=1,cnt =1;
for (int i = 0; i < 168 && arr1[j]>=1;i++)
{
cnt =1;
if(arr1[j]==1)break;
while(arr1[j]%arr[i]==0){
arr1[j] = arr1[j]/arr[i];
cnt++;
}
printf("%d\n");
d *=cnt;
}
ans +=d;
}
}
printf("%d",ans);
} | [
"tasnimbinanwar2605@gmail.com"
] | tasnimbinanwar2605@gmail.com |
ef3f3b8aeaf2e291b6ac5ee5ec37668631c8bf17 | 44be718d2e94b50a343b40b86a902bccd0975086 | /include/Missile.hpp | 7e9ade990af36c0fc1c058ace3dccb6cfec913cd | [] | no_license | hackora/vr-space-shooter | 0974abb81d246ec30d7e6734f2c587b306ffca15 | a6d846188f16791c1234245c3265aa45f77976f2 | refs/heads/master | 2020-03-20T11:57:52.745952 | 2017-06-05T14:08:37 | 2017-06-05T14:08:37 | 137,416,990 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 584 | hpp | #pragma once
//#include <windows.h>
//#include <GL/gl.h>
#include <GL/glew.h>
//#include <GL/glu.h>
#include "Weapon.hpp"
#include <iostream>
class Missile : public Weapon
{
public:
Missile();
~Missile();
void fire();
float getSurroundingSphere();
void setSurroundingSphere();
void collided(bool withTerrain){alive_ = false;}
protected:
void privateInit();
void privateRender();
void privateUpdate(double dt);
private:
float cooldown = 0;
float speed_= 50.0f;
float life_;
float radius_;
std::vector< glm::vec3 > vertexArray_;
}; | [
"gbo013@post.uit.no"
] | gbo013@post.uit.no |
c7e328817f9751f494b30353f47f4ccc663ea4de | c3b5f7b284326fe016661c497eb92b89f31c63ec | /src/FizzBuzz.h | 30fcf3925e003a7f5b42012c8a66ccd4dcd04307 | [] | no_license | haru01/cppunit-sample | 5750053ead993d70f271ed29c6cc4b2205a9e289 | e8585555a41968019ef80d5753b81a83ba3fd606 | refs/heads/master | 2020-05-18T00:22:38.991413 | 2012-07-30T01:02:22 | 2012-07-30T01:02:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 175 | h | #ifndef FIZZBUZZ_H
#define FIZZBUZZ_H
#include <string>
class FizzBuzz {
private:
int num;
public:
FizzBuzz(int num);
~FizzBuzz();
std::string value();
};
#endif
| [
"eiji.ienaga@gmail.com"
] | eiji.ienaga@gmail.com |
e25a58d07d3339d5be0128dbf558b90e40c5eb74 | 297952a5412cf123a642c3fc6814039800129f0b | /BunnySimulation.h | 4d86ef69909b059ab41ae1b46a5737457481c8b7 | [] | no_license | NotAMorningSpartan/BunnySimulation | 89891c2c5498af044339219ea318364a88ec2106 | 54df6bd7212b9b86fbd817797bb5c80b11a1a356 | refs/heads/main | 2023-03-27T00:38:28.651953 | 2021-03-18T09:18:49 | 2021-03-18T09:18:49 | 346,923,836 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,498 | h | //Tyler Kness-Miller
//BunnySimulation.h
#include "Bunny.h"
#include <vector>
#include <fstream>
class Simulation{
private:
int getRandomNumber(int lower, int upper){
//return 1 + ( rand() % ( 100 - 1 + 1 ) );
//return rand() % 100;
random_device generator;
mt19937 mt(generator());
uniform_int_distribution<int> dist(lower, upper);
return dist(mt);
}
public:
vector<Bunny> males;
vector<Bunny> females;
vector<Bunny> genderXs;
vector<Bunny> mutants;
vector<Bunny*> bunnies;
ofstream outfile;
/// Creates a bunny and adds to vector. Bunny is created with all random attributes.
void bunnyBorn(){
Bunny bunny = Bunny();
if(bunny.getMutant()){
cout << "Mutant Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Mutant Bunny " << bunny.getName() << " was born!" << endl;
mutants.push_back(bunny);
}
else if(bunny.getGender() == "male"){
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
males.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
else if(bunny.getGender() == "female"){
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
females.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
else{
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
genderXs.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
}
/// Creates a bunny and adds to vector. Bunny is created using color of mother and father.
/// \param colorM The color of the mother.
/// \param colorF The color of the father.
void bunnyBorn(string colorM, string colorF){
Bunny bunny = Bunny(colorM, colorF);
if(bunny.getMutant()){
cout << "Mutant Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Mutant Bunny " << bunny.getName() << " was born!" << endl;
mutants.push_back(bunny);
}
else if(bunny.getGender() == "male"){
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
males.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
else if(bunny.getGender() == "female"){
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
females.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
else{
cout << "Bunny " << bunny.getName() << " was born!" << endl;
outfile << "Bunny " << bunny.getName() << " was born!" << endl;
genderXs.push_back(bunny);
Bunny *bunny_pointer = &bunny;
bunnies.push_back(bunny_pointer);
}
}
/// Starts the vector of bunnies by filling it with 10 new ones.
void startVector(){
for(int i = 0; i < 10; i++){
bunnyBorn();
}
}
/// Adds a year of age to all bunny vectors and handles deletion when necessary.
void addAge(){
bunnies = vector<Bunny*>();
for(int i = 0; i < males.size(); i++){
//cout << "Bunny Age: " << males[i].getAge() << endl;
bool notDead = males[i].addAgeCheck();
if(!notDead){
cout << "Bunny " << males[i].getName() << " has died!" << endl;
outfile << "Bunny " << males[i].getName() << " has died!" << endl;
males.erase(males.begin() + i);
i = -1;
}
else{
bunnies.push_back(&males[i]);
}
}
for(int i = 0; i < females.size(); i++){
//cout << "Bunny Age: " << females[i].getAge() << endl;
bool notDead = females[i].addAgeCheck();
if(!notDead){
cout << "Bunny " << females[i].getName() << " has died!" << endl;
outfile << "Bunny " << females[i].getName() << " has died!" << endl;
females.erase(females.begin() + i);
i = -1;
}
else{
bunnies.push_back(&females[i]);
}
}
for(int i = 0; i < genderXs.size(); i++){
//cout << "Bunny Age: " << genderXs[i].getAge() << endl;
bool notDead = genderXs[i].addAgeCheck();
if(!notDead){
cout << "Bunny " << genderXs[i].getName() << " has died!" << endl;
outfile << "Bunny " << genderXs[i].getName() << " has died!" << endl;
genderXs.erase(genderXs.begin() + i);
i = -1;
}
else{
bunnies.push_back(&genderXs[i]);
}
}
for(int i = 0; i < mutants.size(); i++){
//cout << "Bunny Age: " << mutants[i].getAge() << endl;
bool notDead = mutants[i].addAgeCheck();
if(!notDead){
cout << "Mutant Bunny " << mutants[i].getName() << " has died!" << endl;
outfile << "Mutant Bunny " << mutants[i].getName() << " has died!" << endl;
mutants.erase(mutants.begin() + i);
i = -1;
}
}
}
void breeding(){
vector<Bunny> breedingMales;
vector<Bunny> breedingFemales;
vector<Bunny> breedingGenderX;
for(int i = 0; i < males.size(); i++){
//Get all bunnies that are at the appropriate age.
if(males[i].getAge() > 1 && males[i].getAge() < 9 && !males[i].getMutant()){
breedingMales.push_back(males[i]);
}
}
for(int i = 0; i < females.size(); i++){
if(females[i].getAge() > 1 && females[i].getAge() < 9 && !females[i].getMutant()){
breedingFemales.push_back(females[i]);
}
}
for(int i = 0; i < genderXs.size(); i++){
if(genderXs[i].getAge() > 1 && genderXs[i].getAge() < 9 && !genderXs[i].getMutant()){
breedingGenderX.push_back(genderXs[i]);
}
}
//Find max amount of bunnies in one list, to facilitate pairs.
int pairs = max(max(breedingMales.size(), breedingFemales.size()), breedingGenderX.size());
//facilitate breeding. After each one has breeded, remove them.
for(int i = 0; i < pairs; i++){
//breeding between males and females/genderXs
if(!breedingMales.empty()){
if(!breedingFemales.empty()){
bunnyBorn(breedingMales[0].getColor(), breedingFemales[0].getColor());
breedingMales.erase(breedingMales.begin());
breedingFemales.erase(breedingFemales.begin());
}
else if(!breedingGenderX.empty()){
if(getRandomNumber(1,100) > 50){
bunnyBorn(breedingMales[0].getColor(), breedingGenderX[0].getColor());
breedingMales.erase(breedingMales.begin());
breedingGenderX.erase(breedingGenderX.begin());
}
else{
breedingMales.erase(breedingMales.begin());
breedingGenderX.erase(breedingGenderX.begin());
}
}
}
//Breeding between females and males/genderXs
if(!breedingFemales.empty()){
if(!breedingMales.empty()){
bunnyBorn(breedingMales[0].getColor(), breedingFemales[0].getColor());
breedingMales.erase(breedingMales.begin());
breedingFemales.erase(breedingFemales.begin());
}
else if(!breedingGenderX.empty()){
if(getRandomNumber(1,100) > 50){
bunnyBorn(breedingGenderX[0].getColor(), breedingFemales[0].getColor());
breedingGenderX.erase(breedingGenderX.begin());
breedingFemales.erase(breedingFemales.begin());
}
else{
breedingFemales.erase(breedingFemales.begin());
breedingGenderX.erase(breedingGenderX.begin());
}
}
}
//edge case. no need to keep looking if no females and males are left to breed.
if(breedingMales.empty() && breedingFemales.empty()){
i = pairs;
}
}
//cout << "Bunnies breeding: " << to_string(breedingMales.size()) << " " << to_string(breedingFemales.size()) << " " << to_string(breedingGenderX.size()) << endl;
}
/// Take all bunnies that are mutants and move them out of standard vectors and into the mutant vectors.
void moveMutants(){
bunnies.clear();
for(int i = 0; i < males.size(); i++){
if(males[i].getMutant()){
Bunny bunny = males[i];
mutants.push_back(bunny);
males.erase(males.begin() + i);
i = 0;
}
else{
bunnies.push_back(&males[i]);
}
}
for(int i = 0; i < females.size(); i++){
if(females[i].getMutant()){
Bunny bunny = females[i];
mutants.push_back(bunny);
females.erase(females.begin() + i);
i = 0;
}
else{
bunnies.push_back(&females[i]);
}
}
for(int i = 0; i < genderXs.size(); i++){
if(genderXs[i].getMutant()){
Bunny bunny = genderXs[i];
mutants.push_back(bunny);
genderXs.erase(genderXs.begin() + i);
i = 0;
}
else{
bunnies.push_back(&genderXs[i]);
}
}
}
/// Using the count of current mutants, transform bunnies into new mutants.
void createMutants(){
for(int i = 0; i < mutants.size(); i++){
if(i == bunnies.size()){
//If it reaches this point, it means there is no more mutants left to convert.
return;
}
bunnies[i]->transformMutant();
}
moveMutants();
}
void runSimulation(){
outfile = ofstream("output.txt");
cout << "Initial Setup: " << endl;
outfile << "Initial Setup: " << endl;
startVector();
int turncount = 0;
bool endCondition = true;
while(endCondition){
cout << "Start of Turn " << to_string(turncount) << endl;
outfile << "Start of Turn " << to_string(turncount) << endl;
addAge();
if(males.size() == 0 && females.size() == 0 && genderXs.size() == 0 && mutants.size() == 0){
endCondition = false;
}
//breeding logic
breeding();
//mutant logic
createMutants();
//End of turn, display results.
cout << "Turn " << to_string(turncount) << ": Males: " << to_string(males.size()) << ", Females: "
<< to_string(females.size()) << ", GenderX's: " + to_string(genderXs.size()) + ", Mutants: "
<< to_string(mutants.size()) << ", Total Bunnies: " << to_string(bunnies.size() + mutants.size()) << endl;
turncount++;
outfile << "Turn " << to_string(turncount) << ": Males: " << to_string(males.size()) << ", Females: "
<< to_string(females.size()) << ", GenderX's: " + to_string(genderXs.size()) + ", Mutants: "
<< to_string(mutants.size()) << ", Total Bunnies: " << to_string(bunnies.size() + mutants.size()) << endl;
turncount++;
}
outfile.close();
}
Simulation()= default;
}; | [
"tylerkm75@gmail.com"
] | tylerkm75@gmail.com |
18a66f90a91b1c3bd0275c369b687e1613fd047a | bc802b219fc1934098b8e854f36b9cb687b24428 | /codewars/rotate-for-a-max/rotate-for-a-max_jihed.cpp | 4399e36603be41e2e03b4b78ac64cafeb77c4ab6 | [] | no_license | coding-katas/all-solutions | cee7a6f40e292b2619e2b8cf09b69c1f5541f35b | 28bbe3023222dacd0856563a3b7098e7a9cea593 | refs/heads/master | 2020-04-21T03:09:18.788656 | 2019-02-05T16:45:17 | 2019-02-05T16:45:17 | 169,275,872 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 648 | cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class MaxRotate
{
public:
static long long maxRot(long long n)
{
string str = to_string(n);
vector<long long> vct;
vct.push_back(n);
for (int j = 0; j < str.size() ; j++)
{
for (int i = j; i < str.size() - 1; i++)
{
auto f = [](char &x, char &y) {
char aux = x;
x = y;
y = aux;
};
f(str[i], str[i + 1]);
}
vct.push_back(stoll(str));
}
return *max_element(vct.begin(), vct.end());
}
};
int main()
{
}
| [
"anis.tajouri@gmail.com"
] | anis.tajouri@gmail.com |
926525921d3b4b340f46c849124a9b34a2ee58e9 | e9a9b956b21c35eed56fc032345b3e7416c78475 | /Segment Tree/Xenia and Bit Operations.cpp | d7c0b2576b9fd7dfc4dfae74500a83f1c57990c1 | [] | no_license | VinayKatare/Algorithms-Implementation | 7323b182e0c88452f6e5bfcbfb8f997970f02cdd | ea3129d571fc34dfd9c5f3236dde20b382fc8309 | refs/heads/master | 2020-04-17T14:18:07.537146 | 2019-10-25T08:42:03 | 2019-10-25T08:42:03 | 166,580,223 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,413 | cpp | //https://codeforces.com/contest/339/problem/D
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define all(a) a.begin(), a.end()
#define pb push_back
#define ll long long
#define index(a) order_of_key(a)
#define value(a) find_by_order(a)
#define count_1 __builtin_popcount
#define mod(x, m) ((((x) % (m)) + (m)) % (m))
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
int a[1000000], tr[1000000], n, pos;
void build(int d, int id = 1, int l = 1, int r = n) {
// cout<<pos<<" ";
if (pos < l || pos>r)return;
if (l == r) {
tr[id] = a[l];
return;
}
int mid = (l + r) / 2;
build(d ^ 1, 2 * id, l, mid);
build(d ^ 1, 2 * id + 1, mid + 1, r);
if (!(d & 1))
tr[id] = tr[2 * id] ^ tr[2 * id + 1];
else
tr[id] = tr[2 * id] | tr[2 * id + 1];
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout << setprecision(12);
int m, needl, needr, x;
cin >> n >> m;
int sign = n % 2;
n = 1 << n;
for (int i = 1; i <= n; i++) { cin >> a[i]; pos = i; build(sign); }
//cout<<endl; for(int i=1;i<2*n;i++)cout<<tr[i]<<" ";cout<<endl;
int idx;
while (m--) {
cin >> pos >> x;
a[pos] = x;
build(sign);
// for(int i=1;i<2*n;i++)cout<<tr[i]<<" ";cout<<endl;
cout << tr[1] << endl;
}
return 0;
} | [
"vinaykatare1234@gmail.com"
] | vinaykatare1234@gmail.com |
6fa28d9c9e83cdd2042a5ba1d42079be8e67b57e | 209571af270257a5b8338622f3a1db75124b0315 | /test usb/old_stuff/devicefinder1.cpp | cb84c0170934b198ceb2142288837acd5a4b1ed5 | [] | no_license | DarioSardi/ProgettoRobotica2018 | 2907d88bbfa2f3e01b80e3bf640f2d6ccab13174 | 703f7a001024c3f2db94ac0211fb73cc26ea3208 | refs/heads/master | 2020-03-31T21:15:51.577388 | 2019-01-13T18:40:44 | 2019-01-13T18:40:44 | 152,573,751 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 711 | cpp | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <malloc.h>
#include <iostream>
#include <string.h>
#define BUF_SIZE 1024
char addr[30]="";
int search(void)
{
FILE *f;
char* buf;
f=popen("./finder.o | grep Arduino | awk '{print $1;}' ", "r");
if (f==NULL) {
perror("1 - Error");
return errno;
}
buf=(char*)malloc(BUF_SIZE);
if (buf==NULL) {
perror("2 - Error");
pclose(f);
return errno;
}
while(fgets(buf,BUF_SIZE,f)!=NULL) {
//printf("arduino found at: %s",buf);
strcpy(addr,buf); //copia l'ultimo risultato
}
pclose(f);
free(buf);
return 0;
}
char* getArduino(){
search();
return addr;
}
| [
"dario.sardi@mail.polimi.it"
] | dario.sardi@mail.polimi.it |
bcff5f4fbb7cdcd2880382bfb9584cc276a5f07e | dddc171e9cb1bf0b1bb36cb8c099b1033e0d68cf | /Combat.cpp | 00a8786d200960c897d4e6ee4f1cf04089adb85f | [] | no_license | IVIara/PokeSim | efbd47abe85699b43bf886b1ac2ca3f13b167b10 | e36245d26edad25ccca02eec3d939c8ca1e82292 | refs/heads/master | 2020-04-02T12:54:47.403835 | 2018-10-27T16:25:06 | 2018-10-27T16:25:06 | 154,457,950 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 6,323 | cpp | #include "Combat.h"
#include "Pokemon.h"
#include <iostream>
#include <string>
using namespace std;
double elements[18][18] =
{
/*NORMAL*/ {1,1,1,1,1,0.5,1,0,0.5,1,1,1,1,1,1,1,1,1},
/*COMBAT*/ {2,1,0.5,0.5,1,2,0.5,0,2,1,1,1,1,0.5,2,1,2,0.5},
/*VOL*/ {1,2,1,1,1,0.5,2,1,0.5,1,1,2,0.5,1,1,1,1,1},
/*POISON*/ {1,1,1,0.5,0.5,0.5,1,0.5,0,1,1,2,1,1,1,1,1,2},
/*SOL*/ {1,1,0,2,1,2,0.5,1,2,2,1,0.5,2,1,1,1,1,1},
/*ROCHE*/ {1,0.5,2,1,0.5,1,2,1,0.5,2,1,1,1,1,2,1,1,1},
/*INSECT*/ {1,0.5,0.5,0.5,1,1,1,0.5,0.5,0.5,1,2,1,2,1,1,2,0.5},
/*SPECTRE*/ {0,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,0.5,1},
/*ACIER*/ {1,1,1,1,1,2,1,1,0.5,0.5,0.5,1,0.5,1,2,1,1,2},
/*FEU*/ {1,1,1,1,1,0.5,2,1,2,0.5,0.5,2,1,1,2,0.5,1,1},
/*EAU*/ {1,1,1,1,2,2,1,1,1,2,0.5,0.5,1,1,1,0.5,1,1},
/*PLANTE*/ {1,1,0.5,0.5,2,2,0.5,1,0.5,0.5,2,0.5,1,1,1,0.5,1,1},
/*ELECTR*/ {1,1,2,1,0,1,1,1,1,1,2,0.5,0.5,1,1,0.5,1,1},
/*PSY*/ {1,2,1,2,1,1,1,1,0.5,1,1,1,1,0.5,1,1,0,1},
/*GLACE*/ {1,1,2,1,2,1,1,1,0.5,0.5,0.5,2,1,1,0.5,2,1,1},
/*DRAGON*/ {1,1,1,1,1,1,1,1,0.5,1,1,1,1,1,1,2,1,0},
/*TENEBRE*/ {1,0.5,1,1,1,1,1,2,1,1,1,1,1,2,1,1,0.5,0.5},
/*FEE*/ {1,2,1,0.5,1,1,1,1,0.5,0.5,1,1,1,1,1,2,2,1}
};
Combat::Combat(Dresseur a,Dresseur b) : m_att(a), m_def(b)
{
}
void Combat::affiche()
{
int vieATT(0);
int vieDEF(0);
//int Jexp(0);
while(m_att.getPokemon(0).getPV()>0 && m_def.getPokemon(0).getPV()>0)
{
for(int i=0; i<((120-(int)m_def.getPokemon(0).getName().size())/9)+1; i++)
{
cout << '\t';
}
cout << m_def.getPokemon(0).getName() << endl;
for(int i=0; i<13; i++)
{
cout << '\t';
}
vieDEF= ((m_def.getPokemon(0).getPV()/m_def.getPokemon(0).getMaxPV())*10);
cout << "pv : ";
for(int i=0; i<vieDEF; i++)
{
cout << "=";
}
for(int i=0; i<-(vieDEF-10); i++)
{
cout << "-";
}
cout << endl;
cout << m_att.getPokemon(0).getName() << endl;
vieATT= ((m_att.getPokemon(0).getPV()/m_att.getPokemon(0).getMaxPV())*10);
for(int i=0; i<vieATT; i++)
{
cout << "=";
}
for(int i=0; i<-(vieATT-10); i++)
{
cout << "-";
}
cout << endl;
cout << "pv :" << m_att.getPokemon(0).getPV() << "/" << m_att.getPokemon(0).getMaxPV() << endl;
// Jexp = m_att.getPokemon(0).getExp()*10/m_att.getPokemon(0).getNextLevelExpReq();
// for(int i=0;i<Jexp; i++)
// {
// cout << "=";
// }
// for(int i=0;i<-Jexp+10;i++)
// {
// cout << "-";
// }
// cout << endl;
int choix(0);
cout << "Attaque | Objets" << endl;
do
{
cin >> choix;
}
while(choix>2 || choix<1);
if(choix==2)
{
if (!m_att.objets())
{
attaque();
}
}
else
{
attaque();
}
turn();
cout << endl << "------------------------------------------------------------------------------------------------------------------" << endl << endl;
}
fin();
}
void Combat::attaque()
{
int choix(0);
do
{
for(int i=0; i<4; i++)
{
if(i<m_att.getPokemon(0).getNbCT())
{
cout << m_att.getPokemon(0).getCT(i).getNom() << "(" << m_att.getPokemon(0).getCT(i).getPP() << ")" <<'\t' ;
}
else
{
cout << "vide" << '\t';
}
}
cout << endl;
cin >> choix;
}
while(choix<1 || choix > m_att.getPokemon(0).getNbCT());
if (m_att.getPokemon(0).getCT(choix-1).getPP()>0)
{
m_att.getPokemon(0).usePP(choix-1);
int dmg(1);
double stab(1);
double ele = elements[m_att.getPokemon(0).getCT(choix-1).getType().Getm_nbtype()][m_def.getPokemon(0).getType().Getm_nbtype()];
int pow = m_att.getPokemon(0).getCT(choix-1).getPower();
if(m_att.getPokemon(0).getType().Getm_nbtype() == m_att.getPokemon(0).getCT(choix-1).getType().Getm_nbtype())
{
stab = 1.5;
}
dmg = (((((2*m_att.getPokemon(0).getNiveau())/5)*pow*m_att.getPokemon(0).getAtt()/m_def.getPokemon(0).getDef())/50)+2)*stab*ele;
m_def.getPokemon(0).recevoirDegat(dmg);
cout << m_att.getPokemon(0).getName() << " utilise " << m_att.getPokemon(0).getCT(choix-1).getNom() << "!" << endl;
if(ele>1)
{
cout << "C'est super efficace !" << endl;
}
else if (ele==0)
{
cout << m_def.getPokemon(0).getName() << " n'est pas affecté !" << endl;
}
else if (ele<1)
{
cout << "Ce n'est pas tres efficace..." << endl;
}
}
else
{
cout << "Pas assez de PP" << endl;
}
}
void Combat::turn()
{
Dresseur c;
c = m_att;
m_att = m_def;
m_def = c;
}
void Combat::fin()
{
if(m_att.getPokemon(0).estVivant())
{
cout << endl<< endl<<endl;
cout << m_def.getPokemon(0).getName() << " est K.O !" << endl;
cout << m_att.getName() << " a vaincu " << m_def.getName() << endl;
cout << m_att.getPokemon(0).getName() << " gagne " << m_def.getPokemon(0).getExpOnKill()*m_def.getPokemon(0).getNiveau()/7 << "exp !" << endl;
m_att.getPokemon(0).gainExp(m_def.getPokemon(0).getExpOnKill()*m_def.getPokemon(0).getNiveau()/7);
}
else
{
cout << endl<< endl<<endl;
cout << m_att.getPokemon(0).getName() << " est K.O !" << endl;
cout << m_def.getName() << " a vaincu " << m_att.getName() << endl;
cout << m_def.getPokemon(0).getName() << " gagne " << m_att.getPokemon(0).getExpOnKill()*m_att.getPokemon(0).getNiveau()/7 << "exp !" << endl;
m_def.getPokemon(0).gainExp(m_att.getPokemon(0).getExpOnKill()*m_att.getPokemon(0).getNiveau()/7);
}
//m_att.savePokemon();
}
| [
"t.perriau@gmail.com"
] | t.perriau@gmail.com |
120a96463402db47995dc66f75fb4f1003b6575e | 41ad38f6a5686339877f47b88273469c1cf1b04a | /GraphicsDisplay.hpp | 5eee2ce5fb7d0022514c920c05feb6ee564c14b3 | [] | no_license | sayakura/42__System_Monitor | 8ff94d8a72ff413fabaa25904b34dd5e83666d32 | 2d716d4a359ce98128ac262dcb6f80dc7c7f3c96 | refs/heads/master | 2020-05-22T12:46:58.250450 | 2019-05-13T05:01:34 | 2019-05-13T05:01:34 | 186,348,202 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,695 | hpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* GraphicsDisplay.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpeck <dpeck@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/11 14:09:43 by dpeck #+# #+# */
/* Updated: 2019/05/12 20:08:58 by dpeck ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GRAPHICSDISPLAY_HPP
#define GRAPHICSDISPLAY_HPP
#define WINWIDTH 600
#include "SDL.h"
#include "SDL_ttf.h"
#include "IMonitorModule.hpp"
#include "IMonitorDisplay.hpp"
#include <deque>
#include <vector>
#include <string>
#include <unistd.h>
class IMonitorModule;
class GraphicsDisplay : public IMonitorDisplay {
private:
SDL_Window *_window;
SDL_Renderer *_renderer;
static TTF_Font *_font;
std::vector<IMonitorModule *> _modules;
std::vector<int> _heightSlots;
bool _quit;
GraphicsDisplay();
public:
GraphicsDisplay(std::vector<IMonitorModule *>);
~GraphicsDisplay();
GraphicsDisplay(GraphicsDisplay const &);
GraphicsDisplay const & operator=(GraphicsDisplay const &);
void render();
static void drawRect(SDL_Rect r, SDL_Renderer* renderer, SDL_Color color);
static void drawBorderedRect(SDL_Rect r, SDL_Renderer* renderer, SDL_Color border, SDL_Color inner);
static void drawBlockText(const char *message, SDL_Rect r, int mWidth, SDL_Renderer* renderer, SDL_Color border, SDL_Color inner, SDL_Color text);
static void drawText(const char *message, SDL_Rect r, int mWidth, SDL_Renderer* renderer, SDL_Color text);
static void drawLine(int x1, int y1, int x2, int y2, SDL_Renderer* renderer, SDL_Color lineColor);
//graphs are drawn with rectangle of cur module, a deque of values, and an offset madeup of current Y position plus header Y
static void drawHistogram(SDL_Rect module, SDL_Renderer * renderer, std::deque<double> randNums, int offset, SDL_Color barColor);
static void drawLineGraph(SDL_Rect module, SDL_Renderer * renderer, std::deque<double> randNums, int offset);
void getHeightSlots(std::vector<IMonitorModule *>);
void pollEvents();
SDL_Renderer * getRenderer();
};
#endif | [
"linra.kura@gmail.com"
] | linra.kura@gmail.com |
395aff8a444d82a5f67aff59b6893eb0833973b9 | 46c1208ac02448288f907a264eff5d82c92009e3 | /src/src/CARTDecisionTree.cpp | 8ddf5515d13c2c8696a8d99959932525b273de2e | [] | no_license | chensh236/AdaboostHandWrittenDightDetectAndRecognition | 3296d256360b07f021cdce6806a51b4bd47594d4 | 6cb5aaf027384486b0b17b4ca9d13632378d6395 | refs/heads/master | 2020-04-11T07:42:16.147560 | 2015-07-03T03:00:03 | 2015-07-03T03:00:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,848 | cpp | //
// DesionTree.cpp
// RandomForest
//
// Created by wc on 15/6/10.
// Copyright (c) 2015年 wc. All rights reserved.
//
#include "CARTDecisionTree.h"
CARTDecisionTree* CARTDecisionTree::instance = nullptr;
CARTDecisionTree* CARTDecisionTree::getInstance() {
if (instance == nullptr)
instance = new CARTDecisionTree();
return instance;
}
CARTDecisionTree::CARTDecisionTree() {
inequalList.clear();
inequalList.push_back(true);
inequalList.push_back(false);
}
CARTDecisionTree::~CARTDecisionTree() {}
Row CARTDecisionTree::getClassifyLabel(TreeMat &mat, int featureIndex,
ElementType &threshold, bool inequal) {
Row returnLabel(mat.size(), 1);
for (int i = 0; i < mat.size(); ++i) {
if (inequal) {
if (mat[i][featureIndex] <= threshold) {
returnLabel[i] = -1;
}
} else {
if (mat[i][featureIndex] > threshold) {
returnLabel[i] = -1;
}
}
}
return returnLabel;
}
TreeNode CARTDecisionTree::getBestTree(TreeMat &mat, ErrorWeight &D,
Row &bestPredictLabel, double &minErrorRate) {
assert(mat.size() > 0);
TreeNode treeReturn = nullptr;
minErrorRate = HUGE_VAL;
int featureSize = (int)mat[0].size() - 1;
for (int i = 0; i < featureSize; ++i) {
double errorRateTemp = HUGE_VAL;
Row predictLabel;
TreeNode TreeTemp = getMinErrorTreeOfOneFeature(mat, D, i, errorRateTemp, predictLabel);
if (minErrorRate > errorRateTemp) {
minErrorRate = errorRateTemp;
bestPredictLabel = predictLabel;
if (treeReturn != nullptr) {
delete treeReturn;
}
treeReturn = TreeTemp;
} else {
delete TreeTemp;
}
}
return treeReturn;
}
TreeNode CARTDecisionTree::getMinErrorTreeOfOneFeature(TreeMat &mat,
ErrorWeight &D, int featureIndex,
double &errorRate, Row &predictLabel) {
assert(mat.size() > 0);
predictLabel.clear();
ElementType min;
ElementType max;
TreeNode newTree = new Node();
getMinFeatureValue(mat, featureIndex, min, max);
ElementType stepSize = (max - min) / NUMSTEP;
for (int i = -1; i < NUMSTEP + 1; ++i) {
for (auto inequal : inequalList) {
ElementType threshod = min + (double)i * stepSize;
Row predictResult = getClassifyLabel(mat, featureIndex, threshod, inequal);
double errorRatetemp = getWeightErrorrate(mat, predictResult, D);
if (errorRate > errorRatetemp) {
errorRate = errorRatetemp;
predictLabel = predictResult;
newTree->_threshod = i;
newTree->_inequal = inequal;
newTree->_featureIndex = featureIndex;
}
}
}
return newTree;
}
double CARTDecisionTree::getWeightErrorrate(TreeMat &mat, Row &predictLabel, ErrorWeight &D) {
assert(mat.size() > 0);
double weightErrorRate = 0.0;
int labelIndex = (int)mat[0].size() - 1;
for(int i = 0; i < mat.size(); ++i) {
if (mat[i][labelIndex] != predictLabel[i]) {
weightErrorRate += D[i];
}
}
return weightErrorRate;
}
void CARTDecisionTree::getMinFeatureValue(TreeMat &mat, int featureIndex,
ElementType &min, ElementType &max) {
min = HUGE_VAL;
max = -HUGE_VAL;
for (auto row : mat) {
if (row[featureIndex] < min)
min = row[featureIndex];
if (row[featureIndex] > max)
max = row[featureIndex];
}
}
| [
"xiezhw3@gmail.com"
] | xiezhw3@gmail.com |
ec4d14ae9e79c77e4cf37b9de3e7c0fc4765150a | ebcbea283a4a430b818e2386b95b577c3f582dfb | /libcef_dll/ctocpp/v8array_buffer_release_callback_ctocpp.h | c4a9bc6c157eff88d183d70096901dea2ba7b7cd | [
"BSD-3-Clause"
] | permissive | avaer/cef | 18b5188abb9fd4db8a90553e8215fe5003a5d169 | 1057523680062f0f1f5f6df7c16dde151f9a2770 | refs/heads/master | 2020-04-03T13:37:54.041882 | 2018-11-17T21:58:26 | 2018-11-17T21:58:26 | 155,291,081 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,522 | h | // Copyright (c) 2018 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=6c5b7fe181699426e51ca11b6216a1ec56e36032$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
#pragma once
#if !defined(BUILDING_CEF_SHARED)
#error This file can be included DLL-side only
#endif
#include "include/capi/cef_v8_capi.h"
#include "include/cef_v8.h"
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefV8ArrayBufferReleaseCallbackCToCpp
: public CefCToCppRefCounted<CefV8ArrayBufferReleaseCallbackCToCpp,
CefV8ArrayBufferReleaseCallback,
cef_v8array_buffer_release_callback_t> {
public:
CefV8ArrayBufferReleaseCallbackCToCpp();
// CefV8ArrayBufferReleaseCallback methods.
void ReleaseBuffer(void* buffer) override;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_V8ARRAY_BUFFER_RELEASE_CALLBACK_CTOCPP_H_
| [
"magreenblatt@gmail.com"
] | magreenblatt@gmail.com |
72a3f264a788bfa9378ff1ce555cc612976f7aea | 5cfc497450d2054b7041559db5acddbd1e4d67e4 | /src/adapter_gb28181.cpp | fb713fd7a45bd0be8c5df133569768cd7299cfd5 | [
"MIT"
] | permissive | charygao/mdfactory | 2e0f97fb1ca3cc1498bce64238ae61c73a7e1888 | 3dbfa2e6acd5390d2ea60a95b04bc63f0b98837e | refs/heads/master | 2022-02-28T04:20:25.250330 | 2019-09-11T06:19:17 | 2019-09-11T06:19:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 20,331 | cpp | #include "adapter_gb28181.h"
#include "utility_tool.h"
#include "error_code.h"
#include <boost/format.hpp>
#define LINE_END "\r\n"
#define STATUS_REGISTER_1 "REGISTER@1"
#define STATUS_REGISTER_3 "REGISTER@3"
#define ALGORITHM_MD5 "MD5"
#define ACTION_REGISTER "REGISTER"
#define ACTION_OK "OK"
#define ACTION_UNAUTHORIZED "Unauthorized"
#define PARAM_TAG "tag"
#define PARAM_VIA "Via"
#define PARAM_VIA_POINT "Via@point"
#define PARAM_VIA_VERSION "Via@version"
#define PARAM_VIA_ADDRESS "Via@address"
#define PARAM_FROM "From"
#define PARAM_FROM_SIP "From@sip"
#define PARAM_FROM_TAG "From@tag"
#define PARAM_TO "To"
#define PARAM_TO_SIP "To@sip"
#define PARAM_TO_TAG "To@tag"
#define PARAM_VIA_ADDRESS "Via@address"
#define PARAM_WWW_AUTHENTICATE "WWW-Authenticate"
#define PARAM_CSEQ "CSeq"
#define PARAM_CSEQ_INDEX "CSeq@index"
#define PARAM_CSEQ_ACTION "CSeq@action"
#define PARAM_AUTHENTICATE "Authorization"
#define PARAM_AUTHENTICATE_USERNAME "Authorization@username"
#define PARAM_AUTHENTICATE_REALM "Authorization@realm"
#define PARAM_AUTHENTICATE_NONCE "Authorization@nonce"
#define PARAM_AUTHENTICATE_URI "Authorization@uri"
#define PARAM_AUTHENTICATE_RESPONSE "Authorization@response"
#define PARAM_AUTHENTICATE_ALGORITHM "Authorization@algorithm"
#define PARAM_DATE "Date"
#define PARAM_CALL_ID "Call-ID"
#define PARAM_CONTACT "Contact"
#define PARAM_MAX_FORWARDS "Max-Forwards"
#define PARAM_EXPIRES "Expires"
#define PARAM_CONTENT_LENGTH "Content-Length"
adapter_gb28181::~adapter_gb28181(){
}
void adapter_gb28181::on_read(frame_ptr& p_frame, std::size_t& count, point_type& point, socket_ptr& p_socket, context_ptr& p_context){
info_param_ptr p_param = std::make_shared<info_param>();
p_param->p_frame = std::make_shared<frame_ptr::element_type>(p_frame->begin(), p_frame->begin() + static_cast<int64_t>(count));
if(ES_SUCCESS != decode(p_param, p_param->p_frame)){
return;
}
info_net_proxy_ptr p_proxy;
auto iter = m_proxys.find(p_param->address);
if(m_proxys.end() == iter){
p_proxy = std::make_shared<info_net_proxy>();
p_proxy->p_context = p_context;
p_proxy->p_socket = p_socket;
p_proxy->point = point;
m_proxys.insert(std::make_pair(p_param->address, p_proxy));
}else{
p_proxy = iter->second;
if(p_proxy->point != point){
LOG_WARN("源端端点改变; SIP地址"<<p_param->address<<"; 旧端点:"<<p_proxy->point.address().to_string()<<"; 新端点:"<<point.address().to_string());
p_proxy->point = point;
}
}
p_proxy->params.push_back(p_param);
do_work(p_proxy);
}
int adapter_gb28181::do_work(info_net_proxy_ptr p_info){
while(!p_info->params.empty()){
auto p_param = *p_info->params.begin();
p_info->params.erase(p_info->params.begin());
if(ACTION_REGISTER == p_param->action && "1" == p_param->params[PARAM_CSEQ_INDEX]){
p_info->status = STATUS_REGISTER_1;
std::stringstream tmp_stream;
tmp_stream<<p_param->version<<" "<<401<<" "<<ACTION_UNAUTHORIZED<<LINE_END;
// 回应的To@sip优先Contact,然后From@sip
auto iter = p_param->params.find(PARAM_CONTACT);
if (p_param->params.end() == iter) {
tmp_stream<<"To: <"<< iter->second<<">"<<LINE_END;
}else{
tmp_stream<<"To: <"<< p_param->params[PARAM_FROM_SIP]<<">"<<LINE_END;
}
// 回应的From@sip为请求的To@sip; From@tag为请求的From@tag
tmp_stream<<"From: <"<< p_param->params[PARAM_TO_SIP]<<">";
iter = p_param->params.find(PARAM_FROM_TAG);
if (p_param->params.end() != iter) {
tmp_stream<<";tag="<<iter->second<<LINE_END;
}else{
tmp_stream<<LINE_END;
}
tmp_stream<<"Via: "<<p_param->params[PARAM_VIA_VERSION];
// Via@address需要设置成本地IP和端口
// 直接取socket的本地地址,可能会取到0.0.0.0,所以这里还是取请求的Via中的地址
auto address = p_info->p_socket->local_endpoint().address().to_string();
if("0.0.0.0" == address || "127.0.0.1" == address){
tmp_stream<<" "<<p_param->params[PARAM_VIA_POINT];
}else{
tmp_stream<<" "<<(boost::format("%s:%d") % p_info->p_socket->local_endpoint().address().to_string() % p_info->p_socket->local_endpoint().port()).str();
}
// rport增加端口
if(p_param->params.end() != p_param->params.find("Via@rport")){
tmp_stream<<";rport="<<p_info->p_socket->local_endpoint().port();
}
// branch
iter = p_param->params.find("Via@branch");
if(p_param->params.end() != iter){
tmp_stream<<";branch="<<iter->second;
}
// 增加received,取远端端点
tmp_stream<<";received="<<(boost::format("%s:%d") % p_info->p_socket->local_endpoint().address().to_string() % p_info->p_socket->local_endpoint().port()).str()<<LINE_END;
// WWW-Authenticate realm取项目编号,nonce取随机数
tmp_stream<<"WWW-Authenticate: "<< (boost::format("Digest realm=\"%s\", nonce=\"%s\"")
% m_realm % random_str()).str()<<LINE_END;
tmp_stream<<"CSeq: "<<p_param->params[PARAM_CSEQ_INDEX]<<" "<<p_param->params[PARAM_CSEQ_ACTION]<<LINE_END;
tmp_stream<<"Call-ID: "<<p_param->params[PARAM_CALL_ID]<<LINE_END;
tmp_stream<<"Max-Forwards: 70"<<LINE_END;
tmp_stream<<"Expires: 3600"<<LINE_END;
tmp_stream<<LINE_END;
send_frame(tmp_stream.str(), p_info);
}else if(ACTION_REGISTER == p_param->action && "2" == p_param->params[PARAM_CSEQ_INDEX] && STATUS_REGISTER_1 == p_info->status){
p_info->status = STATUS_REGISTER_3;
auto p_response = std::make_shared<info_param>();
std::stringstream tmp_stream;
tmp_stream<<p_param->version<<" "<<200<<" "<<ACTION_OK<<LINE_END;
// 回应的To@sip优先Contact,然后From@sip
auto iter = p_param->params.find(PARAM_CONTACT);
if (p_param->params.end() == iter) {
tmp_stream<<"To: <"<< iter->second<<">"<<LINE_END;
}else{
tmp_stream<<"To: <"<< p_param->params[PARAM_FROM_SIP]<<">"<<LINE_END;
}
// 回应的From@sip为请求的To@sip; From@tag为请求的From@tag
tmp_stream<<"From: <"<< p_param->params[PARAM_TO_SIP]<<">";
iter = p_param->params.find(PARAM_FROM_TAG);
if (p_param->params.end() != iter) {
tmp_stream<<";tag="<<iter->second<<LINE_END;
}else{
tmp_stream<<LINE_END;
}
tmp_stream<<"Via: "<<p_param->params[PARAM_VIA_VERSION];
// Via@address需要设置成本地IP和端口
// 直接取socket的本地地址,可能会取到0.0.0.0,所以这里还是取请求的Via中的地址
auto address = p_info->p_socket->local_endpoint().address().to_string();
if("0.0.0.0" == address || "127.0.0.1" == address){
tmp_stream<<" "<<p_param->params[PARAM_VIA_POINT];
}else{
tmp_stream<<" "<<(boost::format("%s:%d") % p_info->p_socket->local_endpoint().address().to_string() % p_info->p_socket->local_endpoint().port()).str();
}
// rport增加端口
if(p_param->params.end() != p_param->params.find("Via@rport")){
tmp_stream<<";rport="<<p_info->p_socket->local_endpoint().port();
}
// branch
iter = p_param->params.find("Via@branch");
if(p_param->params.end() != iter){
tmp_stream<<";branch="<<iter->second;
}
// 增加received,取远端端点
tmp_stream<<";received="<<(boost::format("%s:%d") % p_info->p_socket->local_endpoint().address().to_string() % p_info->p_socket->local_endpoint().port()).str()<<LINE_END;
// WWW-Authenticate realm取项目编号,nonce取随机数
tmp_stream<<"WWW-Authenticate: "<< (boost::format("Digest realm=\"%s\", nonce=\"%s\"")
% m_realm % random_str()).str()<<LINE_END;
p_response->params[PARAM_DATE] = ptime_to_param_date(boost::posix_time::second_clock::local_time());
tmp_stream<<"CSeq: "<<p_param->params[PARAM_CSEQ_INDEX]<<" "<<p_param->params[PARAM_CSEQ_ACTION]<<LINE_END;
tmp_stream<<"Call-ID: "<<p_param->params[PARAM_CALL_ID]<<LINE_END;
tmp_stream<<"Max-Forwards: 70"<<LINE_END;
tmp_stream<<"Expires: 3600"<<LINE_END;
tmp_stream<<LINE_END;
send_frame(tmp_stream.str(), p_info);
}
}
return 0;
}
int adapter_gb28181::send_frame(frame_ptr p_frame, info_net_proxy_ptr p_info){
LOG_INFO("发送数据:"<<frame_to_str(p_frame));
p_info->p_socket->async_send_to(boost::asio::buffer(*p_frame, p_frame->size()), p_info->point, [p_frame](const boost::system::error_code& e, const std::size_t& ){
if(e){
LOG_ERROR("发送数据时发生错误:"<<e.message());
}
});
return ES_SUCCESS;
}
int adapter_gb28181::send_frame(const std::string& data, info_net_proxy_ptr p_info){
LOG_INFO("发送数据:"<<data);
auto p_data = std::make_shared<std::string>(data);
p_info->p_socket->async_send_to(boost::asio::buffer(p_data->c_str(), p_data->size()), p_info->point, [p_data](const boost::system::error_code& e, const std::size_t& ){
if(e){
LOG_ERROR("发送数据时发生错误:"<<e.message());
}
});
return ES_SUCCESS;
}
std::string adapter_gb28181::ptime_to_param_date(const boost::posix_time::ptime& time){
if(time.is_not_a_date_time()){
return "";
}
try
{
return boost::posix_time::to_simple_string(time);
}
catch(const std::exception&)
{
}
return "";
}
int adapter_gb28181::decode(info_param_ptr &p_param, frame_ptr &p_frame)
{
if (!p_param)
{
p_param = std::make_shared<info_param>();
}
const char *p_data = reinterpret_cast<const char *>(p_frame->data());
auto p_start = p_data;
auto p_end = p_start + p_frame->size();
bool flag_cmd_init = false;
auto p_line_start = p_start, p_line_end = p_end, p_param_start = p_start, p_param_end = p_end;
while (true)
{
if (!find_line(&p_line_start, &p_line_end, &p_start, p_end))
{
break;
}
if (p_line_start == p_line_end)
{
continue;
}
if (!flag_cmd_init)
{
flag_cmd_init = true;
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到SIP协议动作:" << frame_to_str(p_frame));
return false;
}
p_param->action = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到SIP协议地址:" << frame_to_str(p_frame));
return false;
}
p_param->address = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到SIP协议版本:" << frame_to_str(p_frame));
return false;
}
p_param->version = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
}
else
{
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ':'))
{
LOG_ERROR("找不到键值对分隔符:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
remove_char(&p_line_start, &p_line_end, ' ');
std::string name(p_param_start, p_param_end);
if (PARAM_VIA == name)
{
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到参数[Via@version]:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
p_param->params[PARAM_VIA_VERSION] = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
p_param->params[PARAM_VIA_ADDRESS] = std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start));
// 尝试解析出端点
if(find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ';')){
p_param->params[PARAM_VIA_POINT] = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
}
decode_kv(p_param->params, "Via@", &p_line_start, p_line_end, ';');
}else if (PARAM_FROM == name)
{
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ';'))
{
LOG_ERROR("找不到参数[From@sip]:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
remove_char(&p_param_start, &p_param_end, '<');
remove_char(&p_param_start, &p_param_end, '>');
p_param->params.insert(std::make_pair(PARAM_FROM_SIP, std::string(p_param_start, p_param_end)));
decode_kv(p_param->params, "From@", &p_line_start, p_line_end, ';');
}
else if (PARAM_TO == name)
{
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ';'))
{
LOG_ERROR("找不到参数[To@sip]:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
remove_char(&p_param_start, &p_param_end, '<');
remove_char(&p_param_start, &p_param_end, '>');
p_param->params.insert(std::make_pair(PARAM_TO_SIP, std::string(p_param_start, p_param_end)));
decode_kv(p_param->params, "To@", &p_line_start, p_line_end, ';');
}else if (PARAM_CSEQ == name)
{
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到参数[CSeq@index]:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
remove_char(&p_param_start, &p_param_end, ' ');
p_param->params[PARAM_CSEQ_INDEX] = std::string(p_param_start, p_param_end);
remove_char(&p_line_start, &p_line_end, ' ');
p_param->params[PARAM_CSEQ_ACTION] = std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start));
}else if (PARAM_AUTHENTICATE == name)
{
// 先去掉 Diges
if (!find_param(&p_param_start, &p_param_end, &p_line_start, p_line_end, ' '))
{
LOG_ERROR("找不到参数[Authorization@Diges]:" << std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start)));
return false;
}
decode_kv(p_param->params, "Authorization@", &p_line_start, p_line_end, ' ');
}else if (PARAM_CONTACT == name)
{
remove_char(&p_line_start, &p_line_end, '<');
remove_char(&p_line_start, &p_line_end, '>');
p_param->params[name] = std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start));
}else{
p_param->params[name] = std::string(p_line_start, static_cast<std::size_t>(p_line_end - p_line_start));
}
}
}
return ES_SUCCESS;
}
bool adapter_gb28181::find_line(const char **pp_line_start, const char **pp_line_end, const char **pp_start, const char *p_end)
{
if (nullptr == pp_line_start || nullptr == pp_line_end || nullptr == pp_start || nullptr == p_end)
{
return false;
}
*pp_line_start = *pp_start;
for (auto p = *pp_line_start; p < p_end; ++p)
{
if ('\n' == *p)
{
if (p > *pp_line_start && '\r' == *(p - 1))
{
*pp_line_end = p - 1;
}
else
{
*pp_line_end = p;
}
*pp_start = p + 1;
return true;
}
}
if (*pp_start < p_end)
{
*pp_line_start = *pp_start;
*pp_line_end = p_end;
if ('\n' == *(*pp_line_end - 1))
{
--(*pp_line_end);
}
if (*pp_line_start < *pp_line_end && '\r' == *(*pp_line_end - 1))
{
--(*pp_line_end);
}
return true;
}
return false;
}
bool adapter_gb28181::find_param(const char **pp_param_start, const char **pp_param_end, const char **pp_start, const char *p_end, const char s)
{
if (nullptr == pp_param_start || nullptr == pp_param_end || nullptr == pp_start || nullptr == p_end)
{
return false;
}
*pp_param_start = *pp_start;
for (auto p = *pp_param_start; p < p_end; ++p)
{
if (*p == s)
{
*pp_param_end = p;
*pp_start = p + 1;
return true;
}
}
if (*pp_start < p_end)
{
*pp_param_start = *pp_start;
*pp_param_end = p_end;
*pp_start = p_end;
return true;
}
return false;
}
bool adapter_gb28181::remove_char(const char **pp_start, const char **pp_end, const char s)
{
if (nullptr == pp_start || nullptr == pp_end)
{
return false;
}
if (*pp_start == *pp_end)
{
return true;
}
for (auto p = *pp_start; p < *pp_end; ++p)
{
if (s != *p)
{
*pp_start = p;
break;
}
}
for (auto p = *pp_end - 1; p >= *pp_start; --p)
{
if (s != *p)
{
*pp_end = p + 1;
break;
}
}
return true;
}
bool adapter_gb28181::remove_rn(const char **pp_start, const char **pp_end)
{
if (nullptr == pp_start || nullptr == pp_end)
{
return false;
}
if (*pp_start == *pp_end)
{
return true;
}
for (auto p = *(pp_end - 1); p >= *pp_start; --p)
{
if ('\n' != *p && '\r' != *p)
{
*pp_end = p + 1;
break;
}
}
return true;
}
bool adapter_gb28181::decode_kv(std::map<std::string, std::string> &kv, const std::string &tag, const char **pp_line_start, const char *p_line_end, const char s)
{
const char* p_param_start = nullptr, *p_param_end = nullptr, *p_kv_start = nullptr, *p_kv_end = nullptr;
while (true)
{
if (!find_param(&p_param_start, &p_param_end, pp_line_start, p_line_end, s))
{
break;
}
if (!find_param(&p_kv_start, &p_kv_end, &p_param_start, p_param_end, '='))
{
remove_char(&p_kv_start, &p_kv_end, ' ');
kv[tag + std::string(p_kv_start, static_cast<std::size_t>(p_kv_end - p_kv_start))] = std::string();
}else{
remove_char(&p_kv_start, &p_kv_end, ' ');
remove_char(&p_param_start, &p_param_end, ' ');
remove_char(&p_param_start, &p_param_end, '\"');
kv[tag + std::string(p_kv_start, static_cast<std::size_t>(p_kv_end - p_kv_start))] = std::string(p_param_start, static_cast<std::size_t>(p_param_end - p_param_start));
}
}
return true;
}
std::string adapter_gb28181::random_str(){
return "654321";
}
| [
"comhaqs@126.com"
] | comhaqs@126.com |
62b8c33e780d838e918ccb63dfc1053f4f578b4e | e4b1522920cc6deea23e3c5a0cde8fe2ad2c8531 | /2020-09-14/06-maxim3.cc | 20a4778411e248ea3d251f8192c0289a843e7f68 | [] | no_license | jordi-petit/ap1-codis-2020-2021 | 95ba1775d11c18fc3a2b18b7fd1e17a5eff31f89 | 014e1d7bc4fe34b7dd8702ef91f557387e22ee24 | refs/heads/master | 2023-08-14T04:19:05.287684 | 2021-09-20T07:39:49 | 2021-09-20T07:39:49 | 294,364,301 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 406 | cc | // Programa que llegeix tres nombres i escriu el seu màxim
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
int m;
if (a >= b) {
if (a >= c) {
m = a;
} else {
m = c;
}
} else {
if (b >= c) {
m = b;
} else {
m = c;
}
}
cout << m << endl;
}
| [
"jpetit@cs.upc.edu"
] | jpetit@cs.upc.edu |
eb530d427d247cbed236550b6102a69be41dab8f | a45e034d557f3c7ec631a693b1141fe02a07d0dc | /cpp/margin_metric.hpp | 278f0c0578989ddb74711d5a514928a264d2bc5e | [
"MIT"
] | permissive | GaoSida/Neural-SampleRank | 7ef785de60835cfb324873ce9aef37f5c960ec38 | 8b4a7a40cc34bff608f19d3f7eb64bda76669c5b | refs/heads/main | 2023-01-13T03:42:20.263862 | 2020-11-16T07:48:51 | 2020-11-16T07:48:51 | 301,271,776 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,070 | hpp | // Mirror nsr.graph.margin_metric
#include "factor_graph.hpp"
#include <vector>
#include <unordered_set>
class MarginMetric {
public:
std::vector<int> ground_truth;
MarginMetric(std::vector<int>& ground_truth) {
this->ground_truth = ground_truth;
}
virtual float compute_metric(std::vector<int>& label_sample,
std::unordered_set<int>& ground_truth_diff_set) = 0;
virtual float incremental_compute_metric(std::vector<LabelNode*>& sample,
float prev_metric, std::vector<int>& prev_sample,
std::vector<int>& diff_indicies,
std::unordered_set<int>& ground_truth_diff_set) = 0;
};
class NegHammingDistance : public MarginMetric {
public:
NegHammingDistance(std::vector<int>& ground_truth) :
MarginMetric(ground_truth) {}
float compute_metric(std::vector<int>& label_sample,
std::unordered_set<int>& ground_truth_diff_set) {
float metric = 0;
ground_truth_diff_set.clear();
for (int i = 0; i < label_sample.size(); i++) {
// Padded ground truth has label value 1 (PyTorch convention)
if (ground_truth[i] != label_sample[i] && ground_truth[i] != 1) {
metric -= 1.0;
ground_truth_diff_set.insert(i);
}
}
return metric;
}
/* In addition to the Python interface, maintain each sample's diff compared
with ground truth.
*/
float incremental_compute_metric(std::vector<LabelNode*>& sample,
float prev_metric, std::vector<int>& prev_sample,
std::vector<int>& diff_indicies,
std::unordered_set<int>& ground_truth_diff_set) {
float current_metric = prev_metric;
for (int i : diff_indicies) {
bool prev_correct = (prev_sample[i] == ground_truth[i]);
bool current_correct = (sample[i]->current_value == ground_truth[i]);
if (prev_correct != current_correct) {
if (prev_correct) {
current_metric -= 1;
ground_truth_diff_set.insert(i);
}
else {
current_metric += 1;
ground_truth_diff_set.erase(i);
}
}
}
return current_metric;
}
};
| [
"sidag@alumni.cmu.edu"
] | sidag@alumni.cmu.edu |
b93e120b255075662e98d981b3b725e93f024ec1 | 2dd206685636ce3428e9d3b63ad6d82af2c85612 | /Server/Server.hpp | ea3b0e43c0cd3db0f62063ee89f013982bf1c6c7 | [] | no_license | BurnBirdX7/Messenger | e4b3f809447cb87a807445c00af78643e1aa480a | c8351b2611301a496e52a569d616779dde9157eb | refs/heads/master | 2023-01-29T12:59:10.669354 | 2020-12-16T15:49:02 | 2020-12-16T15:49:02 | 314,810,547 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,544 | hpp | #ifndef ASIOAPPLICATION_SERVER_HPP
#define ASIOAPPLICATION_SERVER_HPP
#include <memory>
#include <map>
#include <set>
#include <functional>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <Network.hpp>
#include "Context.hpp"
class Connection;
class Server
: public std::enable_shared_from_this<Server>
{
public:
explicit Server(Context& context);
void start();
// TODO: Connection authorization
private:
using tcp = boost::asio::ip::tcp;
using Socket = tcp::socket;
using Acceptor = tcp::acceptor;
using Message = Commons::Network::Message;
using ConnectionPtr = std::shared_ptr<Connection>;
using userid_t = int;
using sessionid_t = int;
using sessionhash_t = std::string;
private:
void onAccept(const boost::system::error_code& ec, Socket s); // meet requirements of MoveAcceptHandler
friend Connection;
sessionid_t authorizeConnection(const ConnectionPtr& connection,
const std::string& login,
const std::string& password);
sessionid_t authorizeConnection(const ConnectionPtr& connection,
sessionid_t sessionId,
sessionhash_t sessionHash);
private:
sessionid_t makeSessionId();
private:
Context& mContext;
Acceptor mAcceptor;
std::map<sessionid_t, ConnectionPtr> mConnections;
std::map<sessionid_t, ConnectionPtr> mAuthorizedConnections;
};
#endif //ASIOAPPLICATION_SERVER_HPP
| [
"artemiy.lazarevx7@gmail.com"
] | artemiy.lazarevx7@gmail.com |
ba2cf19bc8e4292bdb79ae2ed9ca475b0fff9d96 | 3fb39751cdf6bb5c5229c4408cda110e2ae547c1 | /src/TextEditor.cpp | 55cc8196fce9bea5767259e849a7bdef0e705c10 | [] | no_license | josephzizys/CM | 7308704f9d33f81938f7aeff31b64fb3d217db24 | 8f8e9a0550e76debfc47fb0f90772a05ca06805b | refs/heads/master | 2020-05-20T11:40:06.824661 | 2011-06-15T11:47:29 | 2011-06-15T11:47:29 | 2,552,460 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 48,128 | cpp | /*=======================================================================*
Copyright (c) 2008 Rick Taube.
This program is free software; you can redistribute it and/or modify
it under the terms of the Lisp Lesser Gnu Public License. The text
of this agreement is available at http://www.cliki.net/LLGPL
*=======================================================================*/
#include "Enumerations.h"
#include "TextEditor.h"
#include "Preferences.h"
#include "Commands.h"
#include "Console.h"
#include "Syntax.h"
#include "Help.h"
#include "Alerts.h"
/*=======================================================================*
TextEditorWindow
*=======================================================================*/
TextEditorWindow::TextEditorWindow (File file, String text, int synt,
String title)
: DocumentWindow (String::empty, Colours::white,
DocumentWindow::allButtons, true)
{
isfms = false;
Preferences* prefs=Preferences::getInstance();
setMenuBar(this);
int size=0;
if (file.existsAsFile())
{
String ext=file.getFileExtension();
String lsp=T(".lisp.lsp.scm.cm.clm.cmn.ins");
String sal=T(".sal");
String sal2=T(".sal2");
String fms=T(".fms");
if (synt==TextIDs::Empty)
if (sal.contains(ext))
synt=TextIDs::Sal;
else if (sal2.contains(ext))
synt=TextIDs::Sal2;
else if (lsp.contains(ext))
synt=TextIDs::Lisp;
else if (fms.contains(ext)) {
isfms = true; synt=TextIDs::Fomus;
} else
synt=TextIDs::Text;
size=(int)file.getSize();
text=file.loadFileAsString();
}
else
{
file=File::nonexistent;
size=text.length();
}
if (synt==TextIDs::Empty)
synt=prefs->getIntProp(T("EditorSyntax"), TextIDs::Lisp);
TextBuffer* buf=new TextBuffer(synt);
setTextBuffer(buf);
setApplicationCommandManagerToWatch(buf->manager);
setResizable(true, true);
// set buffer to standard 74 column width. + 10 adds space for
// scrollers to avoid linewrap when scoller appears :/
centreWithSize(buf->getFont().getStringWidth(T("M"))*74+10, 400);
setUsingNativeTitleBar(true);
setDropShadowEnabled(true);
setWantsKeyboardFocus(false); // Buffer has it.
buf->setFile(file);
buf->setText(text);
if (title.isEmpty())
buf->updateWindowTitle();
else
setName(title);
// flag may have been set by loading editor.
buf->clearFlag(EditFlags::NeedsSave);
// arrrrg give up on large buffers since text coloring in juce editors is so slow
if (size>20000)
{
Console::getInstance()->printWarning(T("Cowardly refusing to colorize large buffer for ") + getName().quoted() + T(".\n"));
buf->setFlag(EditFlags::HiliteOff);
}
setVisible(true);
buf->colorizeAll();
}
TextEditorWindow::~TextEditorWindow ()
{
setMenuBar(0);
}
void TextEditorWindow::closeButtonPressed ()
{
if (!getTextBuffer()->testFlag(EditFlags::NeedsSave))
{
delete this;
return;
}
int x=Alerts::showYesNoCancelBox(AlertWindow::QuestionIcon,
T("Close"),
T("Save changes before closing?"),
#ifdef WINDOWS
T("Yes"),
T("No"),
T("Cancel"));
#else
T("Save"),
T("Just Close"),
T("Cancel"));
#endif
if (x==0)
return;
if (x==2 || getTextBuffer()->saveFile())
delete this;
}
TextBuffer* TextEditorWindow::getTextBuffer()
{
// return buffer;
return ((EditorComponent*)getContentComponent())->getBuffer();
}
void TextEditorWindow::setTextBuffer(TextBuffer* buf)
{
// setContentComponent(buf);
// buffer=buf;
setContentComponent( new EditorComponent(buf) );
}
/*=======================================================================*
Triggers
*=======================================================================*/
Trigger* TextEditorWindow::getTrigger()
{
return ((EditorComponent*)getContentComponent())->getTrigger();
}
bool TextEditorWindow::hasTrigger()
{
return (getTrigger()!=NULL);
}
void TextEditorWindow::addTrigger(int typ)
{
if (!getTrigger())
{
Trigger* trig=new Trigger(typ);
((EditorComponent*)getContentComponent())->setTrigger(trig);
}
}
void TextEditorWindow::removeTrigger()
{
if (getTrigger())
((EditorComponent*)getContentComponent())->removeTrigger();
}
void TextEditorWindow::loadTrigger()
{
std::cout << "loadTrigger!\n";
}
void TextEditorWindow::saveTrigger()
{
std::cout << "saveTrigger!\n";
}
void TextEditorWindow::importTrigger()
{
TextBuffer* buf=getTextBuffer();
String str=(buf->isRegion()) ? buf->getRegion() : buf->getLineAtPoint();
int a=str.indexOf(T("<trigger"));
int b=str.lastIndexOf(T("/>"));
if (a>=0 && a<b)
{
XmlDocument doc (str.substring(a,b));
XmlElement* xml=doc.getDocumentElement();
int type=TriggerIDs::fromString(xml->getStringAttribute(T("type")));
if (xml->hasTagName(T("trigger")) && type>TriggerIDs::Empty)
{
Trigger* trig=new Trigger(type);
trig->initFromXml(xml);
((EditorComponent*)getContentComponent())->setTrigger(trig);
// clear the region if successful so that we don't start
// triggering just the left over selection
buf->clearRegion();
}
else
Console::getInstance()->printError(T("Buffer region does not contain a valid '<trigger .../>' XML description.\n"));
}
else
Console::getInstance()->printError(T("Buffer region does not contain a '<trigger .../>' XML description.\n"));
}
void TextEditorWindow::exportTrigger()
{
if (hasTrigger())
{
TextBuffer* buf=getTextBuffer();
String str=T("\n; ");
str<<getTrigger()->toXml() << T("\n");
buf->insertTextAtCursor(str);
buf->colorizeAfterChange(CommandIDs::EditorPaste);
buf->setFlag(EditFlags::NeedsSave);
}
}
void TextEditorWindow::configureTrigger()
{
std::cout << "configureTrigger!\n";
}
/*=======================================================================*
TextBuffer
*=======================================================================*/
TextBuffer::TextBuffer(int texttype)
: file (File::nonexistent),
flags (0),
prev (0),
thisid (0),
matchpos (-1)
{
// set syntax right away since commands manager needs this
// information for adding commands
isfms = (texttype == TextIDs::Fomus);
setSyntax(texttype);
Preferences* prefs=Preferences::getInstance();
manager=new ApplicationCommandManager();
setFont(Font(Font::getDefaultMonospacedFontName(),
(float)prefs->getIntProp(T("EditorFontSize"), 16),
Font::plain));
if (prefs->getBoolProp("EditorEmacsMode", false))
setFlag(EditFlags::EmacsMode);
addKeyListener(manager->getKeyMappings());
addKeyListener(CommandManager::getInstance()->getKeyMappings());
manager->registerAllCommandsForTarget(this);
setWantsKeyboardFocus(true);
setMultiLine(true);
setReturnKeyStartsNewLine(true);
setCaretPosition(0);
setVisible(true);
// add callback for registering changes.
//addListener(&listener);
}
TextBuffer::~TextBuffer()
{
delete manager;
}
/*=======================================================================*
File Menu Support
*=======================================================================*/
bool TextBuffer::saveFile()
{
if (testFlag(EditFlags::NeedsSave))
if (file.existsAsFile())
{
file.replaceWithText(getText());
clearFlag(EditFlags::NeedsSave);
Preferences::getInstance()->recentlyOpened.addFile(file);
return true;
}
else
return saveFileAs(file);
return false;
}
bool TextBuffer::saveFileAs(File defaultfile)
{
if (defaultfile==File::nonexistent)
if (file.existsAsFile())
defaultfile=file.getParentDirectory();
else
defaultfile=File::getCurrentWorkingDirectory();
FileChooser choose (T("Save File As"), defaultfile, T("*.*"), true);
if (choose.browseForFileToSave(true))
{
File sav=choose.getResult();
sav.replaceWithText(getText());
file=sav;
clearFlag(EditFlags::NeedsSave);
updateWindowTitle();
Preferences::getInstance()->recentlyOpened.addFile(sav);
return true;
}
else
return false;
}
bool TextBuffer::revertFile()
{
bool doit=false;
if (testFlag(EditFlags::NeedsSave) && file.existsAsFile())
doit=Alerts::showOkCancelBox(AlertWindow::QuestionIcon,
T("Revert File"),
T("Revert to last saved version?"),
#ifdef WINDOWS
T("Revert"),
T("Cancel"));
#else
T("Revert"),
T("Don't Revert"));
#endif
if (doit)
{
setText(file.loadFileAsString());
clearFlag(EditFlags::NeedsSave);
colorizeAll();
return true;
}
else
return false;
}
/**
void TextBuffer::showDirectory()
{
Console::getInstance()->
printOutput(T("Current directory: ") +
File::getCurrentWorkingDirectory().
getFullPathName().quoted() +
T("\n"));
}
void TextBuffer::setDirectory()
{
FileChooser choose (T("Change Directory"),
File::getCurrentWorkingDirectory(),
String::empty,
true);
if (choose.browseForDirectory())
{
choose.getResult().setAsCurrentWorkingDirectory();
showDirectory();
}
}
**/
void TextBuffer::loadFile()
{
File dir;
if (file.existsAsFile())
dir=file.getParentDirectory();
else
dir=File::getCurrentWorkingDirectory();
FileChooser choose (T("Load File"), dir, String::empty, true);
if (!choose.browseForFileToOpen())
return;
File load=choose.getResult();
if (load.hasFileExtension(T(".sal")))
SalSyntax::getInstance()->eval(load.loadFileAsString());
if (load.hasFileExtension(T(".sal2")))
Sal2Syntax::getInstance()->eval(load.loadFileAsString());
else
LispSyntax::getInstance()->eval(T("(load ") +
load.getFullPathName().quoted() +
T(")"));
}
void TextBuffer::updateWindowTitle()
{
String title;
if (file==File::nonexistent)
{
title=T("Untitled");
title << T(" (") << TextIDs::toString(textid) << T(")");
}
else
title = file.getFileName();
getTopLevelComponent()->setName(title);
}
/*=======================================================================*
Edit Menu Support
*=======================================================================*/
void TextBuffer::selectAll()
{
setHighlightedRegion(0,BUFMAX);
}
void TextBuffer::paste()
{
String clip=SystemClipboard::getTextFromClipboard();
if (clip.containsChar('\r'))
{
#ifdef MACOSX
clip=clip.replaceCharacter('\r', '\n');
#else
String temp=String::empty;
for (int i=0; i<clip.length(); i++)
if (clip[i] != '\r' )
temp << clip[i];
clip=temp;
#endif
}
insertTextAtCursor(clip);
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::cut()
{
if (getHighlightedRegionLength()>0)
{
copy();
keyPressed(KeyPress(KeyPress::deleteKey));
}
setFlag(EditFlags::NeedsSave);
}
/*=======================================================================*
Options Menu Support
*=======================================================================*/
int TextBuffer::getFontSize()
{
return (int)getFont().getHeight();
}
void TextBuffer::setFontSize(int size)
{
Font font=getFont();
font.setHeight((float)size);
applyFontToAllText(font);
colorizeAll();
}
void TextBuffer::setSyntax(int synt)
{
textid=synt;
switch (textid)
{
case TextIDs::Lisp:
syntax=LispSyntax::getInstance();
break;
case TextIDs::Sal:
syntax=SalSyntax::getInstance();
break;
case TextIDs::Sal2:
syntax=Sal2Syntax::getInstance();
break;
#ifdef WITH_FOMUS
case TextIDs::Fomus:
if (fomus_exists) syntax=FomusSyntax::getInstance(); else syntax=TextSyntax::getInstance();
break;
#endif
default:
syntax=TextSyntax::getInstance();
break;
}
}
/*=======================================================================*
KeyPresses
*=======================================================================*/
// this method shouldnt be necessary but a juce change listener bug
// stops the Return callback from happening. i will try
// implementing these as commands in the TextBuffer command table
// but for now im just taking the old code...
bool TextBuffer::keyPressed (const KeyPress& key)
{
//std::cout << "keyPressed: " << key.getTextDescription().toUTF8() << T("\n");
if (isMatching())
stopMatching();
TextEditor::keyPressed(key);
juce_wchar chr=key.getTextCharacter();
CommandID com=CommandIDs::EditorTextChanged;
if (key.getKeyCode()==KeyPress::returnKey)
com=CommandIDs::EditorNewline;
else if (key.getKeyCode()==KeyPress::backspaceKey)
com=CommandIDs::EditorBackspace;
else if (!testFlag(EditFlags::MatchingOff) &&
(chr==')' || ((textid==TextIDs::Sal) && chr=='}') || ((textid==TextIDs::Sal2) && chr=='}')))
matchParens();
colorizeAfterChange(com);
setFlag(EditFlags::NeedsSave);
return true;
}
/*=======================================================================*
Mouse and Cursor
*=======================================================================*/
void TextBuffer::mouseDoubleClick (const MouseEvent &e)
{
// make double click select exprs
int a, b;
String it=getTextSubstring(point(),point()+1);
switch (it[0])
{
case '(' :
case '{' :
case '"' :
a=point();
forwardExpr();
b=point();
if (b>a)
setHighlightedRegion(a, b-a);
break;
case ')' :
case '}' :
b=incPoint(1);
backwardExpr();
a=point();
if (a<b)
setHighlightedRegion(a, b-a);
break;
default:
TextEditor::mouseDoubleClick(e);
break;
}
}
void TextBuffer::matchParens()
{
//std::cout << "matchParens()\n";
int b=point();
backwardExpr(); // find start of expr
int a=point();
if (a<b)
startMatching(a,b);
}
bool TextBuffer::isMatching()
{
// true if we are matching right now
return (matchpos > -1);
}
void TextBuffer::startMatching(int pos1, int pos2)
{
setPoint(pos1);
setColour(TextEditor::caretColourId, Colours::red);
matchpos=pos2;
startTimer(1000);
}
void TextBuffer::timerCallback()
{
stopMatching();
}
void TextBuffer::stopMatching()
{
if (matchpos != -1)
{
setPoint(matchpos);
setColour(TextEditor::caretColourId, Colours::black);
matchpos=-1;
if (isTimerRunning())
stopTimer();
}
}
/*=======================================================================*
Eval Menu Support
*=======================================================================*/
void TextBuffer::eval(bool macroexpand)
{
bool region=(getHighlightedRegionLength() > 0);
String text;
if (isfms)
text = getText();
else if (region)
text=getHighlightedText();
else
text=backwardTopLevelText();
if (isSyntax(TextIDs::Lisp) && !region)
{
// parse out backward sexpr if not region
int typ, loc, end=text.length();
typ = scan_sexpr(syntax->syntab, text, end-1, -1,
SCAN_CODE, &loc, NULL);
if (typ>SCAN_EMPTY)
text=text.substring(loc+1,end);
}
syntax->eval(text, region, macroexpand);
// std::cout << "text='" << text.toUTF8() << "'\n";
}
/*=======================================================================*
Syntactic Indentation
*=======================================================================*/
void TextBuffer::syntacticIndent()
{
int bol, eol, col, pos, len;
String txt;
bol=gotoBOL();
if (bol==bufferMin())
col=0;
else
{
txt=backwardTopLevelText();
len=txt.length();
pos=len-1; // search start
// add current line to end of string (after search start)
eol=gotoEOL();
if (eol > bol)
{
txt += getTextSubstring(bol,eol);
len += (eol-bol);
}
col=syntax->getIndent( txt, -1, len, pos);
}
//std::cout << "indent to column: " << col << "\n";
if (indentToColumn(col))
setFlag(EditFlags::NeedsSave);
}
bool TextBuffer::indentToColumn(int col)
{
// reindent current line so that there are col white spaces before
// the first non-white char in line
int bol=pointBOL();
int top=bol+currentIndent(); // current pos of first non-white or eol
int loc=bol+col; // goal pos for indentation
setCaretVisible(false);
setScrollToShowCursor(false);
if (loc < top)
{
//std::cout << "deleting " << top-loc << " spaces.\n";
setPoint(bol);
setHighlightedRegion(bol, (top-loc));
insertTextAtCursor(String::empty);
}
else if (loc > top)
{
setPoint(bol);
String pad=String::empty;
for (int i=top; i<loc; i++)
pad << T(" ");
//std::cout << "inserting " << pad.length() << " spaces.\n";
insertTextAtCursor(pad);
}
setPoint(loc);
setCaretVisible(true);
setScrollToShowCursor(true);
return (loc!=top);
}
int TextBuffer::currentIndent()
{
int bol=pointBOL();
int eol=pointEOL();
String txt=getTextSubstring(bol,eol);
return skip_chars(txt, T(" \t"), 0, txt.length());
}
/*=======================================================================*
Syntax Highlighting
Syntax highlighting is slow and hideous because text can only be
colorized when it is inserted into the texteditor! so to implement
syntax highlighting you have to delete and reinsert any word you
want colored. this is not only painfully slow for large files it
makes the texteditor's underlying undo/redo facility useless since
its filled with 'edits' that are only there because of
highlighting.
*=======================================================================*/
void TextBuffer::colorizeAll()
{
if (testFlag(EditFlags::HiliteOff) ||
!syntax->highlighting())
return;
else
colorize(bufferMin(), bufferMax(), false);
}
void TextBuffer::colorizeAfterChange(CommandID cmd)
{
if (testFlag(EditFlags::HiliteOff) ||
!syntax->highlighting())
return;
int loc=0, bot=0, top=0;
switch (cmd)
{
case CommandIDs::EditorBackspace:
case CommandIDs::EditorTextChanged:
case CommandIDs::EditorDelete:
case CommandIDs::EmacsKillChar:
case CommandIDs::EmacsKillLine:
case CommandIDs::EmacsKillWord:
case CommandIDs::EmacsKillWhite:
case CommandIDs::EmacsKillExpr:
case CommandIDs::EmacsYank:
case CommandIDs::EditorIndent:
case CommandIDs::EmacsUppercase:
case CommandIDs::EmacsLowercase:
case CommandIDs::EmacsCapitalize:
// colorize current line
bot=pointBOL();
top=pointEOL();
break;
case CommandIDs::EditorNewline:
// include previous line in recolor
loc=point();
bot=pointBOL();
top=pointEOL();
if (moveLine(-1))
{
bot=point();
setPoint(loc);
}
break;
case CommandIDs::EditorPaste:
// point is after pasted material. colorize from bol before
// previous point to eol AFTER pasted
loc=point();
top=pointEOL();
bot=loc-SystemClipboard::getTextFromClipboard().length();
setPoint(bot);
bot=pointBOL();
setPoint(loc);
break;
case CommandIDs::EmacsOpenLine:
// include new line in recolor
loc=point();
bot=pointBOL();
top=pointEOL();
if ( moveLine(1) )
{
top=pointEOL();
setPoint(loc);
}
break;
default:
return;
}
if (bot!=top)
{
// std::cout << "ColorizeAfterChange: "
// << CommandIDs::toString(cmd).toUTF8() << "\n";
colorize(bot, top, true);
}
}
void TextBuffer::colorize (int from, int to, bool force)
{
// JUCE LACAUNEA: (1) recoloring should only happen in the visible
// region of buffer but i dont see anyway to get this information
// from the viewpoint. (2) In order to recolor I have to delete and
// add the text back into the buffer
// this is needed because coloring changes the text buffer and we
// dont want the editor's change callback to call the colorizer for
// these changes.
// setFlag(EditFlags::Coloring);
String text = getTextSubstring(from, to);
int len = text.length();
int here = point(), pos = 0, start, end;
String expr;
scanresult typ;
HiliteID hilite;
Colour color, normal=syntax->hilites[HiliteIDs::None];
static KeyPress dkey = KeyPress(KeyPress::deleteKey);
// offset is the starting position of text string in buffer.
setCaretVisible(false);
setScrollToShowCursor(false);
//printf("hiliting %d to %d...\n", from, to);
while (pos < len)
{
typ=parse_sexpr(syntax->syntab, text, -1, len, 1,
SCAN_COLOR, &pos, &start, &end);
hilite=HiliteIDs::None;
if (typ>0)
{
if (typ==SCAN_TOKEN)
{
hilite=syntax->getHilite(text, start, end);
}
else if (typ==SCAN_COMMENT)
{
hilite=HiliteIDs::Comment;
}
else if (typ==SCAN_STRING)
{
hilite=HiliteIDs::String;
}
if ((hilite>HiliteIDs::None) || force)
{
// this is REALLY GROSS!
expr=text.substring(start,end);
color=syntax->hilites[hilite];
setPoint(from+start);
setHighlightedRegion(from+start, end-start);
TextEditor::keyPressed(dkey);
setColour(TextEditor::textColourId, color);
insertTextAtCursor(expr);
setColour(TextEditor::textColourId, normal);
/**
color=syntax->hilites[hilite];
setColour(TextEditor::textColourId, color);
TextEditor::repaintText(from+start, end-start);
setColour(TextEditor::textColourId, normal);
**/
}
}
}
setPoint(here);
setCaretVisible(true);
setScrollToShowCursor(true);
// clearFlag(EditFlags::Coloring);
}
String TextBuffer::forwardTopLevelText()
{
// return all the text starting at point() up to, but not including,
// the next top-level line that begins after at least one non-white
// line has been encountered. in other words, a toplevel line that
// is preceded only by whitespace will not stop the forward
// exclusive search (else return text would just be whitespace.)
setCaretVisible(false);
setScrollToShowCursor(false);
String line, text = String::empty;
int here=point();
int pos=here;
int eol=pointEOL();
bool nonw=false; // non-white line flag
for (int i=0; ; i++)
{
if (eol > pos)
{
line = getTextSubstring(pos, eol);
if (syntax->isWhiteBetween(line, 0, line.length()))
text += line;
else if (i == 0)
{
// collect first line no matter what
text += line;
nonw=true;
}
else if (nonw && syntax->isTopLevel(line))
break;
else
{
text += line;
nonw=true;
}
}
text += T("\n");
if (moveLine(1))
{
pos=point();
eol=pointEOL();
}
else
{
break;
}
}
setPoint(here);
setCaretVisible(true);
setScrollToShowCursor(true);
return text;
}
String TextBuffer::backwardTopLevelText()
{
// return all the text from point() back to the start of the nearest
// top-level form before it
setCaretVisible(false);
setScrollToShowCursor(false);
String line, text = String::empty;
int here=point();
int pos=here;
int bol=pointBOL();
for (int i=0; ; i++)
{
line = getTextSubstring(bol, pos);
if ( i == 0 )
text=line;
else
text = line + T("\n") + text;
if ( syntax->isTopLevel(line) || ! moveLine(-1) )
break;
else {
bol=point();
pos=pointEOL();
}
}
setPoint(here);
setCaretVisible(true);
setScrollToShowCursor(true);
return text;
}
/*=======================================================================*
Symbol Help
*=======================================================================*/
void TextBuffer::lookupHelpAtPoint()
{
bool region=(getHighlightedRegionLength() > 0);
String text;
String helppath;
switch (textid)
{
case TextIDs::Sal:
helppath=T("Sal:CM");
break;
case TextIDs::Sal2:
helppath=T("Sal:CM");
break;
case TextIDs::Lisp:
helppath=T("CM");
break;
default:
return;
}
#ifdef WITH_SNDLIB
helppath<<T(":SndLib");
#endif
helppath<<T(":Scheme");
if (region)
text=getHighlightedText();
else
{
int pos=point();
int bol=pointBOL();
text=getTextSubstring(bol, pointEOL() );
int len=text.length();
int beg=skip_syntax(syntax->syntab, text, T("w_"), pos-bol-1, -1);
int end=skip_syntax(syntax->syntab, text, T("w_"), pos-bol, len);
if (beg+1==end)
return;
text=text.substring(beg+1,end);
}
Help::getInstance()->symbolHelp(text, helppath);
}
/*=======================================================================*
Emacs Point Info Functions
*=======================================================================*/
int TextBuffer::point()
{
return getCaretPosition();
}
int TextBuffer::setPoint(int p)
{
setCaretPosition(p);
return getCaretPosition();
}
int TextBuffer::incPoint(int i)
{
return setPoint(point() + i);
}
bool TextBuffer::isBOB()
{
return (point()==bufferMin());
}
bool TextBuffer::isEOB()
{
return (point()==bufferMax());
}
bool TextBuffer::isBOL()
{
if (isBOB())
return true;
return (point()==pointBOL());
}
bool TextBuffer::isEOL()
{
if (isEOB())
return true;
return (point()==pointEOL());
}
int TextBuffer::pointBOL()
{
int here = getCaretPosition();
setCaretVisible(false);
int there=gotoBOL();
setCaretPosition(here);
setCaretVisible(true);
return there;
}
int TextBuffer::pointEOL()
{
int here = getCaretPosition();
setCaretVisible(false);
int there=gotoEOL();
setCaretPosition(here);
setCaretVisible(true);
return there;
}
int TextBuffer::pointColumn()
{
return point()-pointBOL();
}
int TextBuffer::pointLineLength()
{
return pointEOL()-pointBOL();
}
int TextBuffer::bufferMin()
{
return 0;
}
int TextBuffer::bufferMax()
{
// really stupid but its much faster than getText().length() !
int cp1 = getCaretPosition();
setCaretVisible(false);
setCaretPosition(BUFMAX);
int cp2=getCaretPosition();
setCaretPosition(cp1);
setCaretVisible(true);
return cp2;
}
/*=======================================================================*
Region Support
*=======================================================================*/
bool TextBuffer::isRegion()
{
return (getHighlightedRegionLength() > 0);
}
String TextBuffer::getRegion()
{
if (isRegion())
return getHighlightedText();
else
return String::empty;
}
String TextBuffer::getLineAtPoint()
{
int b=pointBOL();
int e=pointEOL();
if (e>b)
return getTextSubstring(b,e);
else
return String::empty;
}
void TextBuffer::clearRegion()
{
setHighlightedRegion(getCaretPosition(),0);
}
/*=======================================================================*
Emacs Cursor Motion Functions
*=======================================================================*/
int TextBuffer::gotoBOB()
{
return setPoint(0);
}
int TextBuffer::gotoEOB()
{
return setPoint(BUFMAX);
}
int TextBuffer::gotoBOL()
{
int pos=findCharBackward('\n');
if (pos<0)
return gotoBOB();
else
return setPoint(pos);
}
int TextBuffer::gotoEOL()
{
int pos=findCharForward('\n');
if (pos<0)
return gotoEOB();
else
return setPoint(pos);
}
void TextBuffer::forwardPage()
{
TextEditor::keyPressed(KeyPress(KeyPress::pageDownKey));
}
void TextBuffer::backwardPage()
{
TextEditor::keyPressed(KeyPress(KeyPress::pageUpKey));
}
void TextBuffer::forwardChar()
{
TextEditor::keyPressed(KeyPress(KeyPress::rightKey));
}
void TextBuffer::backwardChar()
{
TextEditor::keyPressed(KeyPress(KeyPress::leftKey));
}
void TextBuffer::forwardLine()
{
// Emacs C-n motion with goal column
static int goal=0;
int col;
if (prev != CommandIDs::EmacsLineForward)
goal=pointColumn();
moveLine(1); // cursor now on bol
col=pointColumn();
if (col<goal)
if (pointLineLength()>=goal)
incPoint(goal-col);
else
gotoEOL();
}
void TextBuffer::backwardLine()
{
// Emacs C-p motion including goal column
static int goal=0;
int col;
if (prev != CommandIDs::EmacsLineBackward)
goal=pointColumn();
moveLine(-1);
col=pointColumn();
if (col<goal)
if (pointLineLength()>=goal)
incPoint(goal-col);
else
gotoEOL();
}
void TextBuffer::forwardWord()
{
// Emacs M-f word motion. process buffer line by line scanning for
// next word.
String str;
int pos, eol, len, loc;
pos = point();
eol = pointEOL();
while (true)
{
len=eol-pos;
if (len > 0)
{
str = getTextSubstring(pos, eol);
// skip over white space
loc = skip_syntax(syntax->syntab, str, T("^w_"), 0, len);
if (loc < len)
{
loc = skip_syntax(syntax->syntab, str, T("w_"), loc, len);
setPoint(pos+loc);
return;
}
}
if (moveLine(1))
{
pos=point();
eol=pointEOL();
}
else
break;
}
setPoint(eol);
}
void TextBuffer::backwardWord()
{
// Emacs M-b word motion. search line by line scanning for next
// word.
String str;
int pos, bol, len, loc;
pos = point(); // pos is EXCLUSIVE upper bound
bol = pointBOL();
while (true)
{
len=pos-bol;
if (len > 0)
{
str = getTextSubstring(bol,pos);
loc = skip_syntax(syntax->syntab, str, T("^w_"), len-1, -1);
if (loc > -1)
{
loc = skip_syntax(syntax->syntab, str, T("w_"), loc, -1);
// loc is now -1 or on nonword
setPoint(bol+loc+1);
return;
}
}
if (moveLine(-1))
{
bol=point();
pos=pointEOL();
}
else
break;
}
setPoint(bol);
}
void TextBuffer::forwardExpr()
{
if (isSyntax(TextIDs::Sal) || isSyntax(TextIDs::Sal2))
{
String text = forwardTopLevelText();
int typ, loc, pos=point(), end=text.length();
typ=scan_sexpr(syntax->syntab,text,0,end,SCAN_CODE,&loc,NULL);
if (typ == SCAN_UNLEVEL)
PlatformUtilities::beep();
else if (typ == SCAN_UNMATCHED)
PlatformUtilities::beep();
else
setPoint(pos+loc);
}
else if (isSyntax(TextIDs::Lisp) )
{
String text;
int end, typ, loc;
int top=-1;
int pos=point();
gotoEOL();
while (true)
{
text=getTextSubstring(pos, point());
end=text.length();
typ=scan_sexpr(syntax->syntab,text,0,end,SCAN_CODE,&loc,NULL);
if ((typ==SCAN_LIST) || (typ==SCAN_TOKEN) || (typ==SCAN_STRING))
{
top=pos+loc;
break;
}
if (!moveLine(1))
break;
}
if (top>-1)
{
//std::cout << "parsed='" << getTextSubstring(pos,top).toUTF8()
//<< "'\n";
setPoint(top);
}
else
{
PlatformUtilities::beep();
setPoint(pos);
}
}
else
PlatformUtilities::beep();
}
void TextBuffer::backwardExpr()
{
if (isSyntax(TextIDs::Sal) || isSyntax(TextIDs::Sal2) )
{
String text = backwardTopLevelText();
int typ, loc, pos=point(), end=text.length();
typ=scan_sexpr(syntax->syntab, text, end-1, -1,SCAN_CODE, &loc, NULL);
if (typ == SCAN_UNLEVEL)
PlatformUtilities::beep();
else if (typ == SCAN_UNMATCHED)
PlatformUtilities::beep();
else
setPoint(pos-end+loc+1);
}
else if (isSyntax(TextIDs::Lisp) )
{
String text;
int end, typ, loc;
int beg=-1;
int pos=point();
gotoBOL();
while (true)
{
text=getTextSubstring(point(), pos);
end=text.length();
typ=scan_sexpr(syntax->syntab,text,end-1,-1,SCAN_CODE, &loc,NULL);
if ((typ==SCAN_LIST) || (typ==SCAN_TOKEN) || (typ==SCAN_STRING))
{
beg=pos-end+loc+1;
break;
}
if (!moveLine(-1))
break;
}
if (beg>-1)
{
//std::cout << "parsed='" << getTextSubstring(beg,pos).toUTF8()
// << "'\n";
setPoint(beg);
}
else
{
PlatformUtilities::beep();
setPoint(pos);
}
}
else
PlatformUtilities::beep();
}
bool TextBuffer::moveLine(int n)
{
// the main function for moving and accessing line text. move N
// lines forward or backward and position point at BOL. returns
// true if line actually moved, else false, which allows calling
// code to stop line iteration without bounds checking.
int old = gotoBOL();
// warning: this code assumes setting point out of bounds is legal
if (n<0)
{
for (int i=n; i<0; i++)
{
incPoint(-1);
gotoBOL();
}
}
else if (n>0)
{
for (int i=0; i<n; i++)
{
gotoEOL();
incPoint(1);
}
}
return !(pointBOL()==old);
}
/*=======================================================================*
Search Functions
*=======================================================================*/
int TextBuffer::findCharForward(char c)
{
int pos=point();
int len;
int loc=-1;
String str;
// Warning: this only works because its not an error to pass
// getTextSubstring an index that is out of range.
str = getTextSubstring(pos, pos+CHUNKSIZE);
len = str.length();
while (1)
{
if (len==0)
break;
for (int i=0; i<len; i++)
if (str[i]==c)
{
loc=pos+i;
break;
}
if (loc>-1)
break;
pos += len;
str = getTextSubstring(pos, pos+CHUNKSIZE);
len = str.length();
}
return loc;
}
int TextBuffer::findCharBackward(char c)
{
int pos=point();
int len;
int loc=-1;
String str;
// Warning: this only works because its not an error to pass
// getTextSubstring an index that is out of range.
str = getTextSubstring(pos-CHUNKSIZE, pos);
len = str.length();
while (1)
{
if (len==0)
break;
for (int i=len-1; i>-1; i--)
if (str[i] == c)
{
loc=pos-(len-i)+1;
break;
}
if (loc>-1)
break;
pos -= len;
str = getTextSubstring(pos-CHUNKSIZE, pos);
len = str.length();
}
return loc;
}
/*=======================================================================*
Find and Replace
*=======================================================================*/
bool TextBuffer::replaceAll(String str, String rep)
{
int n=0;
while (findNext(str, false))
{
n++;
replace(rep);
}
return (n>0);
}
bool TextBuffer::replace(String rep)
{
if (!(getHighlightedRegionLength()>0))
return false;
insertTextAtCursor(rep);
setFlag(EditFlags::NeedsSave);
return true;
}
bool TextBuffer::replaceAndFind(String str, String rep)
{
if (replace(rep))
return findNext(str);
return false;
}
bool TextBuffer::findPrevious(String str, bool wrap)
{
int pos=getCaretPosition()-getHighlightedRegionLength();
int wid=str.length();
int tot=size();
int got=-1;
while (true)
{
if (pos<=wid) // not enough chars to make a match
{
if (wrap)
{
wrap=false;
pos=tot;
}
else
break;
}
int top=pos-100;
if (top<0) top=0;
String tmp=getTextSubstring(top, pos);
int len=tmp.length();
got=tmp.lastIndexOf(str);
if (got>-1)
{
pos -= (len-got);
break;
}
// next search position must overlapping current end
pos=top+wid;
}
if (got>-1)
{
setHighlightedRegion(pos,wid);
return true;
}
return false;
}
bool TextBuffer::findNext(String str, bool wrap)
{
// start looking at current cursor position (if region exists caret
// position is end of region)
int pos=getCaretPosition();
int wid=str.length();
int tot=size();
int got=-1;
// bool wrap=true;
while (true)
{
if (pos>tot-wid) // not enough chars to make a match
{
if (wrap)
{
wrap=false;
pos=0;
}
else
break;
}
String tmp=getTextSubstring(pos, pos+100);
got=tmp.indexOf(str);
if (got>-1)
{
pos += got;
break;
}
int len=tmp.length();
// next search position must overlapping current end
pos=pos+len-wid+1;
}
if (got>-1)
{
setHighlightedRegion(pos,wid);
return true;
}
return false;
}
/*=======================================================================*
Emacs Edit Functions
*=======================================================================*/
void TextBuffer::killChar()
{
TextEditor::keyPressed(KeyPress(KeyPress::deleteKey));
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::killWord()
{
int from=point();
forwardWord();
int to=point();
if (to > from)
{
String text=getTextSubstring(from,to);
deleteRegion(from, to);
updateClipboardWithKill(text, CommandIDs::EmacsKillWord);
setFlag(EditFlags::NeedsSave);
}
}
void TextBuffer::killExpr()
{
int from=point();
forwardExpr();
int to=point();
if (to > from)
{
String text=getTextSubstring(from,to);
deleteRegion(from, to);
updateClipboardWithKill(text, CommandIDs::EmacsKillExpr);
setFlag(EditFlags::NeedsSave);
}
}
void TextBuffer::killLine()
{
// Emacs C-k line killing from point forward. kills to EOL+1 if line
// contains only white space after point
int from=point();
int to=pointEOL();
String text=getTextSubstring(from,to);
if ( text == String::empty || text.containsOnly(T(" \t")) )
{
text += T("\n");
to++;
}
deleteRegion(from, to);
updateClipboardWithKill(text, CommandIDs::EmacsKillLine);
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::killRegion()
{
copy();
keyPressed(KeyPress(KeyPress::deleteKey));
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::killWhite()
{
// search buffer for next non-white char and delete up to that
// position
String white=T(" \t\n");
int from=point();
int to;
while (true)
{
bool go=true;
to=point();
String line=getTextSubstring(to,pointEOL());
for (int i=0; i<line.length() && go; i++)
if (white.containsChar(line[i]))
to++;
else
go=false;
if (!go)
break;
else if (!moveLine(1)) // point now at next bol
break;
}
deleteRegion(from,to);
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::openLine()
{
// C-o new line does not change point
int here=point();
insertTextAtCursor(T("\n"));
setPoint(here);
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::changeCase(int flag)
{
// change case of word at point. 0=lower,1=upper,2=capitalize
int beg=point();
forwardWord();
int end=point();
String text=getTextSubstring(beg, end);
if (text==String::empty)
return;
deleteRegion(beg,end);
if (flag==0)
insertTextAtCursor(text.toLowerCase());
else if (flag==1)
insertTextAtCursor(text.toUpperCase());
else if (flag==2)
{
int len=text.length();
// get first alphachar
int loc=skip_syntax(syntax->syntab, text, T("^w"), 0, len);
insertTextAtCursor(text.substring(0,loc));
if (loc<len)
{
insertTextAtCursor(text.substring(loc,loc+1).toUpperCase());
insertTextAtCursor(text.substring(loc+1,len));
}
}
beg=point();
//colorizeAfterChange(CommandIDs::EditorIndent); // recolorize whole line for now..
setPoint(beg);
setFlag(EditFlags::NeedsSave);
}
void TextBuffer::updateClipboardWithKill(String kill, CommandID cmd)
{
// repeating kill commands ADDS kills to clipboard.
if (prev==cmd)
kill = SystemClipboard::getTextFromClipboard() + kill;
SystemClipboard::copyTextToClipboard(kill);
}
void TextBuffer::deleteRegion(int from, int to)
{
// delete chars between from and to (exclusive), do not update
// clipboard
if (to>from)
{
setHighlightedRegion(from, to-from);
insertTextAtCursor(String::empty);
}
}
/*=======================================================================*
Focus Changing
*=======================================================================*/
void TextBuffer::focusGained(Component::FocusChangeType cause)
{
// When an editor window is selected is becomes the "focus" editor
// and it only loses this focus when another editor window is
// selected, i.e. the editing focus is maintained even when the
// window itself is not the active window
TopLevelWindow* w=NULL;
// clear any other editing window of the focus
for (int i=0; i<TopLevelWindow::getNumTopLevelWindows(); i++)
{
w=TopLevelWindow::getTopLevelWindow(i);
if (w->getComponentPropertyBool(T("FocusEditor"), false))
w->setComponentProperty(T("FocusEditor"), false);
}
// select this one
getTopLevelComponent()->setComponentProperty(T("FocusEditor"), true);
}
// void TextBuffer::focusLost(Component::FocusChangeType cause) {}
TextEditorWindow* TextEditorWindow::getFocusTextEditor()
{
for (int i=0; i<TopLevelWindow::getNumTopLevelWindows(); i++)
{
TopLevelWindow* w=TopLevelWindow::getTopLevelWindow(i);
if ( w->getComponentPropertyBool(T("FocusEditor"), false))
{
return (TextEditorWindow*)w;
}
}
return (TextEditorWindow*)NULL;
}
/*=======================================================================*
Find and Replace Window
*=======================================================================*/
class FindAndReplaceDialog : public Component,
public ButtonListener
{
public:
FindAndReplaceDialog ();
~FindAndReplaceDialog();
void resized();
void buttonClicked (Button* buttonThatWasClicked);
private:
Label* label1;
TextEditor* textEditor1;
Label* label2;
TextEditor* textEditor2;
TextButton* textButton1;
TextButton* textButton2;
TextButton* textButton3;
TextButton* textButton4;
TextButton* textButton5;
};
class FindAndReplaceWindow : public DocumentWindow
{
public:
void closeButtonPressed() {delete this;}
FindAndReplaceWindow(FindAndReplaceDialog* comp) :
DocumentWindow(T("Find & Replace"),
Colour(0xffe5e5e5),
DocumentWindow::closeButton,
true)
{
comp->setVisible(true);
centreWithSize(comp->getWidth(),comp->getHeight());
setContentComponent(comp);
setResizable(false, false);
setUsingNativeTitleBar(true);
setDropShadowEnabled(true);
setVisible(true);
}
~FindAndReplaceWindow()
{
// dont have to delete content component
}
};
FindAndReplaceDialog::FindAndReplaceDialog ()
: label1 (0),
textEditor1 (0),
label2 (0),
textEditor2 (0),
textButton1 (0),
textButton2 (0),
textButton3 (0),
textButton4 (0),
textButton5 (0)
{
addAndMakeVisible (label1 = new Label (String::empty, T("Find:")));
label1->setFont (Font (15.0000f, Font::plain));
label1->setJustificationType (Justification::centredRight);
label1->setEditable (false, false, false);
label1->setColour (TextEditor::textColourId, Colours::black);
label1->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (textEditor1 = new TextEditor (String::empty));
textEditor1->setMultiLine (false);
textEditor1->setReturnKeyStartsNewLine (false);
textEditor1->setReadOnly (false);
textEditor1->setScrollbarsShown (true);
textEditor1->setCaretVisible (true);
textEditor1->setPopupMenuEnabled (true);
textEditor1->setText (String::empty);
textEditor1->setWantsKeyboardFocus(true);
addAndMakeVisible (label2 = new Label (String::empty, T("Replace:")));
label2->setFont (Font (15.0000f, Font::plain));
label2->setJustificationType (Justification::centredRight);
label2->setEditable (false, false, false);
label2->setColour (TextEditor::textColourId, Colours::black);
label2->setColour (TextEditor::backgroundColourId, Colour (0x0));
addAndMakeVisible (textEditor2 = new TextEditor (String::empty));
textEditor2->setMultiLine (false);
textEditor2->setReturnKeyStartsNewLine (false);
textEditor2->setReadOnly (false);
textEditor2->setScrollbarsShown (true);
textEditor2->setCaretVisible (true);
textEditor2->setPopupMenuEnabled (true);
textEditor2->setText (String::empty);
addAndMakeVisible (textButton1 = new TextButton (String::empty));
textButton1->setButtonText (T("Replace All"));
textButton1->setConnectedEdges (Button::ConnectedOnRight);
textButton1->addButtonListener (this);
addAndMakeVisible (textButton2 = new TextButton (String::empty));
textButton2->setButtonText (T("Replace"));
textButton2->setConnectedEdges (Button::ConnectedOnLeft |
Button::ConnectedOnRight);
textButton2->addButtonListener (this);
addAndMakeVisible (textButton3 = new TextButton (String::empty));
textButton3->setButtonText (T("Replace & Find"));
textButton3->setConnectedEdges (Button::ConnectedOnLeft |
Button::ConnectedOnRight);
textButton3->addButtonListener (this);
addAndMakeVisible (textButton4 = new TextButton (String::empty));
textButton4->setButtonText (T("Previous"));
textButton4->setConnectedEdges (Button::ConnectedOnLeft |
Button::ConnectedOnRight);
textButton4->addButtonListener (this);
addAndMakeVisible (textButton5 = new TextButton (String::empty));
textButton5->setButtonText (T("Next"));
textButton5->setConnectedEdges (Button::ConnectedOnLeft);
textButton5->addButtonListener (this);
setSize (414, 104);
}
FindAndReplaceDialog::~FindAndReplaceDialog()
{
deleteAndZero (label1);
deleteAndZero (textEditor1);
deleteAndZero (label2);
deleteAndZero (textEditor2);
deleteAndZero (textButton1);
deleteAndZero (textButton2);
deleteAndZero (textButton3);
deleteAndZero (textButton4);
deleteAndZero (textButton5);
}
void FindAndReplaceDialog::resized()
{
label1->setBounds (8, 8, 56, 24);
textEditor1->setBounds (72, 8, 336, 24);
label2->setBounds (8, 40, 56, 24);
textEditor2->setBounds (72, 40, 336, 24);
textButton1->setBounds (8, 72, 80, 24);
textButton2->setBounds (88, 72, 80, 24);
textButton3->setBounds (168, 72, 96, 24);
textButton4->setBounds (264, 72, 64, 24);
textButton5->setBounds (328, 72, 80, 24);
}
void FindAndReplaceDialog::buttonClicked (Button* buttonThatWasClicked)
{
TextEditorWindow* win=TextEditorWindow::getFocusTextEditor();
if (!win) // no editor open
{
PlatformUtilities::beep();
return;
}
TextBuffer* buf=win->getTextBuffer();
// no find string
String str=textEditor1->getText();
if (str.isEmpty())
{
PlatformUtilities::beep();
textEditor1->grabKeyboardFocus();
return;
}
if (buttonThatWasClicked == textButton1) // Replace All
{
if (!buf->replaceAll(str, textEditor2->getText()))
PlatformUtilities::beep();
}
else if (buttonThatWasClicked == textButton2) // Replace
{
if (!buf->replace(textEditor2->getText()))
PlatformUtilities::beep();
}
else if (buttonThatWasClicked == textButton3) // Find & Replace
{
if (!buf->replaceAndFind(str, textEditor2->getText()))
PlatformUtilities::beep();
}
else if (buttonThatWasClicked == textButton4) // Previous
{
if (!buf->findPrevious(str))
PlatformUtilities::beep();
}
else if (buttonThatWasClicked == textButton5) // Next
{
if (!buf->findNext(str))
PlatformUtilities::beep();
}
}
void TextEditorWindow::openFindAndReplaceDialog()
{
const String title=T("Find & Replace");
for (int i=0; i<getNumTopLevelWindows(); i++)
{
TopLevelWindow* w=TopLevelWindow::getTopLevelWindow(i);
if (w && w->getName() == title)
{
w->grabKeyboardFocus();
w->toFront(true);
return;
}
}
FindAndReplaceDialog* d=new FindAndReplaceDialog();
FindAndReplaceWindow* w=new FindAndReplaceWindow(d);
// d->setVisible(true);
// w->setContentComponent(d, true, true);
// w->centreWithSize(d->getWidth(), d->getHeight());
// w->setUsingNativeTitleBar(true);
// w->setDropShadowEnabled(true);
// w->setVisible(true);
d->grabKeyboardFocus();
}
| [
"taube@d60aafaf-7936-0410-ba4d-d307febf7868"
] | taube@d60aafaf-7936-0410-ba4d-d307febf7868 |
cc727549b3dad8a8296b09359f9c8643f556f519 | 5bcdfa3c4a561b36150656a9adf398fb5def70a9 | /distributive/android-arm64-v8a/tensorflow/core/framework/tensor_slice.pb.cc | 9e59d3a0beb87cfc51d18cbde3b2ba3028807373 | [
"Apache-2.0"
] | permissive | avlbanuba/tensorflow_pack | 30bf5b7ef0a0db68ea3828569f1cba4cf5571ef4 | 4612b6817c21f576a16acb6a986e3a6cb95c269a | refs/heads/master | 2021-08-08T00:10:15.361471 | 2017-11-09T07:15:09 | 2017-11-09T07:15:09 | 109,989,169 | 1 | 0 | null | 2017-11-08T14:51:37 | 2017-11-08T14:51:37 | null | UTF-8 | C++ | false | true | 31,812 | cc | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/framework/tensor_slice.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "tensorflow/core/framework/tensor_slice.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace tensorflow {
class TensorSliceProto_ExtentDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<TensorSliceProto_Extent>
_instance;
::google::protobuf::int64 length_;
} _TensorSliceProto_Extent_default_instance_;
class TensorSliceProtoDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<TensorSliceProto>
_instance;
} _TensorSliceProto_default_instance_;
namespace protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto {
namespace {
::google::protobuf::Metadata file_level_metadata[2];
} // namespace
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField
const TableStruct::entries[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},
};
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField
const TableStruct::aux[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
::google::protobuf::internal::AuxillaryParseTableField(),
};
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const
TableStruct::schema[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ NULL, NULL, 0, -1, -1, -1, -1, NULL, false },
{ NULL, NULL, 0, -1, -1, -1, -1, NULL, false },
};
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto_Extent, _internal_metadata_),
~0u, // no _extensions_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto_Extent, _oneof_case_[0]),
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto_Extent, start_),
offsetof(TensorSliceProto_ExtentDefaultTypeInternal, length_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto_Extent, has_length_),
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TensorSliceProto, extent_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(TensorSliceProto_Extent)},
{ 8, -1, sizeof(TensorSliceProto)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&_TensorSliceProto_Extent_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&_TensorSliceProto_default_instance_),
};
namespace {
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
AssignDescriptors(
"tensorflow/core/framework/tensor_slice.proto", schemas, file_default_instances, TableStruct::offsets, factory,
file_level_metadata, NULL, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
}
} // namespace
void TableStruct::InitDefaultsImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::internal::InitProtobufDefaults();
_TensorSliceProto_Extent_default_instance_._instance.DefaultConstruct();
::google::protobuf::internal::OnShutdownDestroyMessage(
&_TensorSliceProto_Extent_default_instance_);_TensorSliceProto_default_instance_._instance.DefaultConstruct();
::google::protobuf::internal::OnShutdownDestroyMessage(
&_TensorSliceProto_default_instance_);_TensorSliceProto_Extent_default_instance_.length_ = GOOGLE_LONGLONG(0);
}
void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n,tensorflow/core/framework/tensor_slice"
".proto\022\ntensorflow\"\200\001\n\020TensorSliceProto\022"
"3\n\006extent\030\001 \003(\0132#.tensorflow.TensorSlice"
"Proto.Extent\0327\n\006Extent\022\r\n\005start\030\001 \001(\003\022\020\n"
"\006length\030\002 \001(\003H\000B\014\n\nhas_lengthB2\n\030org.ten"
"sorflow.frameworkB\021TensorSliceProtosP\001\370\001"
"\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 249);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"tensorflow/core/framework/tensor_slice.proto", &protobuf_RegisterTypes);
}
} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto
// ===================================================================
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorSliceProto_Extent::kStartFieldNumber;
const int TensorSliceProto_Extent::kLengthFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
TensorSliceProto_Extent::TensorSliceProto_Extent()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.TensorSliceProto.Extent)
}
TensorSliceProto_Extent::TensorSliceProto_Extent(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena) {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.TensorSliceProto.Extent)
}
TensorSliceProto_Extent::TensorSliceProto_Extent(const TensorSliceProto_Extent& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
start_ = from.start_;
clear_has_has_length();
switch (from.has_length_case()) {
case kLength: {
set_length(from.length());
break;
}
case HAS_LENGTH_NOT_SET: {
break;
}
}
// @@protoc_insertion_point(copy_constructor:tensorflow.TensorSliceProto.Extent)
}
void TensorSliceProto_Extent::SharedCtor() {
start_ = GOOGLE_LONGLONG(0);
clear_has_has_length();
_cached_size_ = 0;
}
TensorSliceProto_Extent::~TensorSliceProto_Extent() {
// @@protoc_insertion_point(destructor:tensorflow.TensorSliceProto.Extent)
SharedDtor();
}
void TensorSliceProto_Extent::SharedDtor() {
::google::protobuf::Arena* arena = GetArenaNoVirtual();
GOOGLE_DCHECK(arena == NULL);
if (arena != NULL) {
return;
}
if (has_has_length()) {
clear_has_length();
}
}
void TensorSliceProto_Extent::ArenaDtor(void* object) {
TensorSliceProto_Extent* _this = reinterpret_cast< TensorSliceProto_Extent* >(object);
(void)_this;
}
void TensorSliceProto_Extent::RegisterArenaDtor(::google::protobuf::Arena* arena) {
}
void TensorSliceProto_Extent::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* TensorSliceProto_Extent::descriptor() {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const TensorSliceProto_Extent& TensorSliceProto_Extent::default_instance() {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
return *internal_default_instance();
}
TensorSliceProto_Extent* TensorSliceProto_Extent::New(::google::protobuf::Arena* arena) const {
return ::google::protobuf::Arena::CreateMessage<TensorSliceProto_Extent>(arena);
}
void TensorSliceProto_Extent::clear_has_length() {
// @@protoc_insertion_point(one_of_clear_start:tensorflow.TensorSliceProto.Extent)
switch (has_length_case()) {
case kLength: {
// No need to clear
break;
}
case HAS_LENGTH_NOT_SET: {
break;
}
}
_oneof_case_[0] = HAS_LENGTH_NOT_SET;
}
void TensorSliceProto_Extent::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.TensorSliceProto.Extent)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
start_ = GOOGLE_LONGLONG(0);
clear_has_length();
_internal_metadata_.Clear();
}
bool TensorSliceProto_Extent::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.TensorSliceProto.Extent)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// int64 start = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &start_)));
} else {
goto handle_unusual;
}
break;
}
// int64 length = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
clear_has_length();
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &has_length_.length_)));
set_has_length();
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.TensorSliceProto.Extent)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.TensorSliceProto.Extent)
return false;
#undef DO_
}
void TensorSliceProto_Extent::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.TensorSliceProto.Extent)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int64 start = 1;
if (this->start() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->start(), output);
}
// int64 length = 2;
if (has_length()) {
::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->length(), output);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.TensorSliceProto.Extent)
}
::google::protobuf::uint8* TensorSliceProto_Extent::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorSliceProto.Extent)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// int64 start = 1;
if (this->start() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->start(), target);
}
// int64 length = 2;
if (has_length()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->length(), target);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorSliceProto.Extent)
return target;
}
size_t TensorSliceProto_Extent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorSliceProto.Extent)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// int64 start = 1;
if (this->start() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->start());
}
switch (has_length_case()) {
// int64 length = 2;
case kLength: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->length());
break;
}
case HAS_LENGTH_NOT_SET: {
break;
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void TensorSliceProto_Extent::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorSliceProto.Extent)
GOOGLE_DCHECK_NE(&from, this);
const TensorSliceProto_Extent* source =
::google::protobuf::internal::DynamicCastToGenerated<const TensorSliceProto_Extent>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorSliceProto.Extent)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorSliceProto.Extent)
MergeFrom(*source);
}
}
void TensorSliceProto_Extent::MergeFrom(const TensorSliceProto_Extent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorSliceProto.Extent)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.start() != 0) {
set_start(from.start());
}
switch (from.has_length_case()) {
case kLength: {
set_length(from.length());
break;
}
case HAS_LENGTH_NOT_SET: {
break;
}
}
}
void TensorSliceProto_Extent::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorSliceProto.Extent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TensorSliceProto_Extent::CopyFrom(const TensorSliceProto_Extent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorSliceProto.Extent)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool TensorSliceProto_Extent::IsInitialized() const {
return true;
}
void TensorSliceProto_Extent::Swap(TensorSliceProto_Extent* other) {
if (other == this) return;
if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
InternalSwap(other);
} else {
TensorSliceProto_Extent* temp = New(GetArenaNoVirtual());
temp->MergeFrom(*other);
other->CopyFrom(*this);
InternalSwap(temp);
if (GetArenaNoVirtual() == NULL) {
delete temp;
}
}
}
void TensorSliceProto_Extent::UnsafeArenaSwap(TensorSliceProto_Extent* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void TensorSliceProto_Extent::InternalSwap(TensorSliceProto_Extent* other) {
using std::swap;
swap(start_, other->start_);
swap(has_length_, other->has_length_);
swap(_oneof_case_[0], other->_oneof_case_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata TensorSliceProto_Extent::GetMetadata() const {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages];
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
// TensorSliceProto_Extent
// int64 start = 1;
void TensorSliceProto_Extent::clear_start() {
start_ = GOOGLE_LONGLONG(0);
}
::google::protobuf::int64 TensorSliceProto_Extent::start() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorSliceProto.Extent.start)
return start_;
}
void TensorSliceProto_Extent::set_start(::google::protobuf::int64 value) {
start_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorSliceProto.Extent.start)
}
// int64 length = 2;
bool TensorSliceProto_Extent::has_length() const {
return has_length_case() == kLength;
}
void TensorSliceProto_Extent::set_has_length() {
_oneof_case_[0] = kLength;
}
void TensorSliceProto_Extent::clear_length() {
if (has_length()) {
has_length_.length_ = GOOGLE_LONGLONG(0);
clear_has_has_length();
}
}
::google::protobuf::int64 TensorSliceProto_Extent::length() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorSliceProto.Extent.length)
if (has_length()) {
return has_length_.length_;
}
return GOOGLE_LONGLONG(0);
}
void TensorSliceProto_Extent::set_length(::google::protobuf::int64 value) {
if (!has_length()) {
clear_has_length();
set_has_length();
}
has_length_.length_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorSliceProto.Extent.length)
}
bool TensorSliceProto_Extent::has_has_length() const {
return has_length_case() != HAS_LENGTH_NOT_SET;
}
void TensorSliceProto_Extent::clear_has_has_length() {
_oneof_case_[0] = HAS_LENGTH_NOT_SET;
}
TensorSliceProto_Extent::HasLengthCase TensorSliceProto_Extent::has_length_case() const {
return TensorSliceProto_Extent::HasLengthCase(_oneof_case_[0]);
}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// ===================================================================
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int TensorSliceProto::kExtentFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
TensorSliceProto::TensorSliceProto()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.TensorSliceProto)
}
TensorSliceProto::TensorSliceProto(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
_internal_metadata_(arena),
extent_(arena) {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.TensorSliceProto)
}
TensorSliceProto::TensorSliceProto(const TensorSliceProto& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
extent_(from.extent_),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:tensorflow.TensorSliceProto)
}
void TensorSliceProto::SharedCtor() {
_cached_size_ = 0;
}
TensorSliceProto::~TensorSliceProto() {
// @@protoc_insertion_point(destructor:tensorflow.TensorSliceProto)
SharedDtor();
}
void TensorSliceProto::SharedDtor() {
::google::protobuf::Arena* arena = GetArenaNoVirtual();
GOOGLE_DCHECK(arena == NULL);
if (arena != NULL) {
return;
}
}
void TensorSliceProto::ArenaDtor(void* object) {
TensorSliceProto* _this = reinterpret_cast< TensorSliceProto* >(object);
(void)_this;
}
void TensorSliceProto::RegisterArenaDtor(::google::protobuf::Arena* arena) {
}
void TensorSliceProto::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* TensorSliceProto::descriptor() {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const TensorSliceProto& TensorSliceProto::default_instance() {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::InitDefaults();
return *internal_default_instance();
}
TensorSliceProto* TensorSliceProto::New(::google::protobuf::Arena* arena) const {
return ::google::protobuf::Arena::CreateMessage<TensorSliceProto>(arena);
}
void TensorSliceProto::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.TensorSliceProto)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
extent_.Clear();
_internal_metadata_.Clear();
}
bool TensorSliceProto::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.TensorSliceProto)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated .tensorflow.TensorSliceProto.Extent extent = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_extent()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.TensorSliceProto)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.TensorSliceProto)
return false;
#undef DO_
}
void TensorSliceProto::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.TensorSliceProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.TensorSliceProto.Extent extent = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->extent_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->extent(static_cast<int>(i)), output);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.TensorSliceProto)
}
::google::protobuf::uint8* TensorSliceProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorSliceProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.TensorSliceProto.Extent extent = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->extent_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
1, this->extent(static_cast<int>(i)), deterministic, target);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorSliceProto)
return target;
}
size_t TensorSliceProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorSliceProto)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// repeated .tensorflow.TensorSliceProto.Extent extent = 1;
{
unsigned int count = static_cast<unsigned int>(this->extent_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->extent(static_cast<int>(i)));
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void TensorSliceProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorSliceProto)
GOOGLE_DCHECK_NE(&from, this);
const TensorSliceProto* source =
::google::protobuf::internal::DynamicCastToGenerated<const TensorSliceProto>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorSliceProto)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorSliceProto)
MergeFrom(*source);
}
}
void TensorSliceProto::MergeFrom(const TensorSliceProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorSliceProto)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
extent_.MergeFrom(from.extent_);
}
void TensorSliceProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorSliceProto)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TensorSliceProto::CopyFrom(const TensorSliceProto& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorSliceProto)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool TensorSliceProto::IsInitialized() const {
return true;
}
void TensorSliceProto::Swap(TensorSliceProto* other) {
if (other == this) return;
if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
InternalSwap(other);
} else {
TensorSliceProto* temp = New(GetArenaNoVirtual());
temp->MergeFrom(*other);
other->CopyFrom(*this);
InternalSwap(temp);
if (GetArenaNoVirtual() == NULL) {
delete temp;
}
}
}
void TensorSliceProto::UnsafeArenaSwap(TensorSliceProto* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
InternalSwap(other);
}
void TensorSliceProto::InternalSwap(TensorSliceProto* other) {
using std::swap;
extent_.InternalSwap(&other->extent_);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata TensorSliceProto::GetMetadata() const {
protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_tensorflow_2fcore_2fframework_2ftensor_5fslice_2eproto::file_level_metadata[kIndexInFileMessages];
}
#if PROTOBUF_INLINE_NOT_IN_HEADERS
// TensorSliceProto
// repeated .tensorflow.TensorSliceProto.Extent extent = 1;
int TensorSliceProto::extent_size() const {
return extent_.size();
}
void TensorSliceProto::clear_extent() {
extent_.Clear();
}
const ::tensorflow::TensorSliceProto_Extent& TensorSliceProto::extent(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorSliceProto.extent)
return extent_.Get(index);
}
::tensorflow::TensorSliceProto_Extent* TensorSliceProto::mutable_extent(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.TensorSliceProto.extent)
return extent_.Mutable(index);
}
::tensorflow::TensorSliceProto_Extent* TensorSliceProto::add_extent() {
// @@protoc_insertion_point(field_add:tensorflow.TensorSliceProto.extent)
return extent_.Add();
}
::google::protobuf::RepeatedPtrField< ::tensorflow::TensorSliceProto_Extent >*
TensorSliceProto::mutable_extent() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorSliceProto.extent)
return &extent_;
}
const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorSliceProto_Extent >&
TensorSliceProto::extent() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorSliceProto.extent)
return extent_;
}
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
// @@protoc_insertion_point(global_scope)
| [
"anton.lechenko@banuba.com"
] | anton.lechenko@banuba.com |
4089224199ad8e190ccc80202d330b7acc27714e | 5a5bde743ddbcfa28dbd71dbd8fe1835010763df | /include/lm/parallelcontext.h | 27b57604674e19284128f9b121a0d7d846641c90 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | lightmetrica/lightmetrica-v3 | fb85230c92dac12e754ca570cd54d45b5b6e457c | 70601dbef13a513df032911d47f790791671a8e0 | refs/heads/master | 2021-10-29T08:13:40.140577 | 2021-10-22T10:50:39 | 2021-10-22T10:50:39 | 189,633,321 | 105 | 14 | NOASSERTION | 2021-10-20T14:34:34 | 2019-05-31T17:27:55 | C++ | UTF-8 | C++ | false | false | 884 | h | /*
Lightmetrica - Copyright (c) 2019 Hisanari Otsu
Distributed under MIT license. See LICENSE file for details.
*/
#pragma once
#include "parallel.h"
#include "component.h"
LM_NAMESPACE_BEGIN(LM_NAMESPACE)
LM_NAMESPACE_BEGIN(parallel)
/*!
\addtogroup parallel
@{
*/
/*!
\brief Parallel context.
\rst
You may implement this interface to implement user-specific parallel subsystem.
Each virtual function corresponds to API call with a free function
inside ``parallel`` namespace.
\endrst
*/
class ParallelContext : public Component {
public:
virtual int num_threads() const = 0;
virtual bool main_thread() const = 0;
virtual void foreach(long long numSamples, const ParallelProcessFunc& processFunc, const ProgressUpdateFunc& progressFunc) const = 0;
};
/*!
@}
*/
LM_NAMESPACE_END(parallel)
LM_NAMESPACE_END(LM_NAMESPACE)
| [
"hi2p.perim@gmail.com"
] | hi2p.perim@gmail.com |
5589aa01f6692df2f5b10f4067a38b3d39a9dbaf | ace28e29eaa4ff031fdf7aa4d29bb5d85b46eaa3 | /Visual Mercutio/zSOAP/PSS_SoapPublisher_MessengerInfo.h | 5480f478fc31fe31eaea76f9ff47d6bcea3d83cb | [
"MIT"
] | permissive | emtee40/Visual-Mercutio | 675ff3d130783247b97d4b0c8760f931fbba68b3 | f079730005b6ce93d5e184bb7c0893ccced3e3ab | refs/heads/master | 2023-07-16T20:30:29.954088 | 2021-08-16T19:19:57 | 2021-08-16T19:19:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,843 | h | /****************************************************************************
* ==> PSS_SoapPublisher_MessengerInfo -------------------------------------*
****************************************************************************
* Description : SOAP protocol to publish the Messenger info *
* Developer : Processsoft *
****************************************************************************/
#ifndef PSS_SoapPublisher_MessengerInfoH
#define PSS_SoapPublisher_MessengerInfoH
// change the definition of AFX_EXT... to make it import
#undef AFX_EXT_CLASS
#undef AFX_EXT_API
#undef AFX_EXT_DATA
#define AFX_EXT_CLASS AFX_CLASS_IMPORT
#define AFX_EXT_API AFX_API_IMPORT
#define AFX_EXT_DATA AFX_DATA_IMPORT
#ifdef _ZSOAPEXPORT
// put the values back to make AFX_EXT_CLASS export again
#undef AFX_EXT_CLASS
#undef AFX_EXT_API
#undef AFX_EXT_DATA
#define AFX_EXT_CLASS AFX_CLASS_EXPORT
#define AFX_EXT_API AFX_API_EXPORT
#define AFX_EXT_DATA AFX_DATA_EXPORT
#endif
/**
* SOAP protocol to publish the Messenger info
*@author Dominique Aigroz, Jean-Milost Reymond
*/
class AFX_EXT_CLASS PSS_SoapPublisher_MessengerInfo
{
public:
PSS_SoapPublisher_MessengerInfo();
virtual ~PSS_SoapPublisher_MessengerInfo();
/**
* Gets the server version
*@return server version
*/
virtual int GetVersion();
/**
* Gets the language
*@return the language
*/
virtual std::string GetLanguage();
/**
* Authenticate on server (administrator only)
*@param login - login name
*@param password - password
*@return
*/
virtual int Authenticate(const std::string& login, const std::string& password);
};
#endif
| [
"jean_milost@hotmail.com"
] | jean_milost@hotmail.com |
5ba0ab492f95a5ec0de0683a93d51e61319e5c7c | 0db79524979d11c3bf0a4856c124295b6acce314 | /COM/fancySerial.ino | 006b1514bf730114f0ad7a7d6d96a308f6edcd89 | [] | no_license | muh005/Micromouse | cfb3dbb96e3c3a5b903fe569a675b6d4fd596db8 | c9fa440cb33f2837395a7da7fb815e852b16bf1c | refs/heads/master | 2021-05-07T04:16:22.502834 | 2018-03-28T23:45:44 | 2018-03-28T23:45:44 | 111,260,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,977 | ino | void setup() {
// put your setup code here, to run once:
//pin 19 rx
//pin 18 tx
Serial.begin(9600);
//Serial1.begin(9600);
}
const int sendSize = 100;
char tosend[sendSize];
int Status = 0;
void clearAll(char * arg, int sz){
// Setting all chars in the string to null
for(int i = 0; i < sz; i++) {
arg[i] = char(0);
}
}
void fillCharWithDouble(double val, char * arg, int sz) {
clearAll(arg, sz);
//char tmp[100];
dtostrf(val, 40, 20, arg);
// snprintf(arg, sz, "Yo: %s", tmp);
arg[sz-1] = char(0);
}
void sendData(char * arg, int sz) {
// while(!Serial.available()) {
// Looping over chars
for(int i = 0; i < sz; i++) {
// If see null, then stop printing
if(arg[i] == char(0)) {
break;
}
// Print one char at a time
Serial.print(arg[i]);
}
// Leave a line at end
Serial.println();
// Delay
delay(100);
// }
}
void clearData(char * arg) {
// Clearing all data in arg
arg[0] = char(0);
/*for(int i = 0; i < sz; i++) {
arg[i] = char(0);
}*/
}
void readAndSerial() {
// put your main code here, to run repeatedly:
if(Status == 0){
int i = 0;
Status = 1;
while(Serial.available()) {
tosend[i++] = char(Serial.read());
}
tosend[i] = char(0);
}
if(Status == 1) {
sendData(tosend, strlen(tosend));
clearData(tosend);
Status = 0;
}
}
void sendDoubles() {
double startTime = millis();
double ar[] = {42, 13, 9, 0, 7, 1, 99, 53, 43, 250};
for(int i = 0 ; i < 10 ; i++){
// Order - time, data
// Sending time from start
fillCharWithDouble(millis()-startTime, tosend, sendSize);
sendData(tosend, sendSize);
// Sending data
fillCharWithDouble(ar[i], tosend, sendSize);
sendData(tosend, sendSize);
}
}
void loop() {
// while(!Serial.available()) {
sendDoubles();
// }
// Stopping after 1 iteration
while(1){}
}
| [
"muh005@ucsd.edu"
] | muh005@ucsd.edu |
dc74af23a5f1acb82ff19d214a7e1a0e7dbd1570 | 9494ac09c78d7b6cb17e1b30bad80d7b60da7d96 | /p1074ReversingLinkedList.cpp | 6074be1c758221d5b6be5a39d2fcd68ec1209c67 | [
"MIT"
] | permissive | yangyueren/PAT | 24547ea71c2a1e05326e99d9813dbd972c1aea1d | 950d820ec9174c5e2d74adafeb2abde4acdc635f | refs/heads/master | 2020-09-12T07:42:19.826678 | 2019-11-18T03:45:44 | 2019-11-18T03:45:44 | 222,358,172 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,110 | cpp | //
// Created by yryang on 2019/9/18.
//
#include "stdio.h"
#include "stdlib.h"
#include "vector"
#include "set"
#include "string"
#include "string.h"
#include "map"
#include "algorithm"
#include "iostream"
using namespace std;
struct node{
int add;
int val;
int next;
}nodes[100005];
int inihead;
int N;
int K;
vector<node> result;
int main(){
cin >> inihead >> N >> K;
for (int i = 0; i < N; ++i) {
int add;
int key;
int next;
cin >> add >> key >> next;
nodes[add].val = key;
nodes[add].next = next;
nodes[add].add = add;
}
int head = inihead;
while (head != -1){
result.push_back(nodes[head]);
head = nodes[head].next;
}
N = result.size();
for (int i = 0; i < N/K; ++i) {
reverse(result.begin()+i*K, result.begin()+i*K+K);
}
for (int i = 0; i < result.size() - 1; ++i) {
node a = result[i];
node b = result[i+1];
printf("%05d %d %05d\n", a.add, a.val, b.add);
}
printf("%05d %d -1\n", result[N-1].add, result[N-1].val);
return 0;
} | [
"to_wx@outlook.com"
] | to_wx@outlook.com |
859413bfeb9f18ff3b7e264189cec1da8f129a0e | a57dc909766d9486abbc76d8c7f41e592950511d | /ServerSocket_demo/ServerSocket/ServerSocketDlg.cpp | b2e9cb53af777be3929a626642d3e326d9ac8bc1 | [] | no_license | gigihpc/Socket-and-Serial-C | ade688f7a876f32791448caaf7b3d569a82b16ba | f599a07dcbbf142be62f1a700b692afb01fd1648 | refs/heads/master | 2021-07-14T19:23:20.865481 | 2017-10-17T02:57:09 | 2017-10-17T02:57:09 | 107,209,557 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,754 | cpp | // ServerSocketDlg.cpp : implementation file
//
#include "stdafx.h"
#include <atlconv.h>
#include "ServerSocket.h"
#include "ServerSocketDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const int SOCK_TCP = 0;
const int SOCK_UDP = 1;
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CServerSocketDlg dialog
CServerSocketDlg::CServerSocketDlg(CWnd* pParent /*=NULL*/)
: CDialog(CServerSocketDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CServerSocketDlg)
m_strPort = _T("2000");
m_nSockType = SOCK_TCP; // default TCP
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CServerSocketDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CServerSocketDlg)
DDX_Control(pDX, IDC_TXT_MESSAGE, m_ctlMessage);
DDX_Control(pDX, IDC_MESSAGE_LIST, m_ctlMsgList);
DDX_Control(pDX, IDC_SVR_PORTINC, m_ctlPortInc);
DDX_Text(pDX, IDC_SVR_PORT, m_strPort);
DDX_Radio(pDX, IDC_TCP, m_nSockType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CServerSocketDlg, CDialog)
//{{AFX_MSG_MAP(CServerSocketDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BTN_START, OnBtnStart)
ON_BN_CLICKED(IDC_BTN_STOP, OnBtnStop)
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_BTN_SEND, OnBtnSend)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_UPDATE_CONNECTION, OnUpdateConnection)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CServerSocketDlg message handlers
BOOL CServerSocketDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
{
int nVirtKey = (int) pMsg->wParam;
if (nVirtKey == VK_ESCAPE)
return TRUE;
if (nVirtKey == VK_RETURN && (GetFocus()->m_hWnd == m_ctlMessage.m_hWnd))
{
if (m_pCurServer->IsOpen())
OnBtnSend();
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
///////////////////////////////////////////////////////////////////////////////
// PickNextAvailable : this is useful only for TCP socket
void CServerSocketDlg::PickNextAvailable()
{
m_pCurServer = NULL;
for(int i=0; i<MAX_CONNECTION; i++)
{
if (!m_SocketManager[i].IsOpen())
{
m_pCurServer = &m_SocketManager[i];
break;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// StartServer : Start the server
bool CServerSocketDlg::StartServer()
{
bool bSuccess = false;
if (m_pCurServer != NULL)
{
if (m_nSockType == SOCK_TCP)
{
// no smart addressing - we use connection oriented
m_pCurServer->SetSmartAddressing( false );
bSuccess = m_pCurServer->CreateSocket( m_strPort, AF_INET, SOCK_STREAM, 0); // TCP
}
else
{
m_pCurServer->SetSmartAddressing( true );
bSuccess = m_pCurServer->CreateSocket( m_strPort, AF_INET, SOCK_DGRAM, SO_BROADCAST); // UDP
}
if (bSuccess && m_pCurServer->WatchComm())
{
GetDlgItem(IDC_BTN_SEND)->EnableWindow( TRUE );
GetDlgItem(IDC_BTN_STOP)->EnableWindow( TRUE );
NextDlgCtrl();
GetDlgItem(IDC_BTN_START)->EnableWindow( FALSE );
GetDlgItem(IDC_TCP)->EnableWindow( FALSE );
GetDlgItem(IDC_UDP)->EnableWindow( FALSE );
CString strServer, strAddr;
m_pCurServer->GetLocalName( strServer.GetBuffer(256), 256);
strServer.ReleaseBuffer();
m_pCurServer->GetLocalAddress( strAddr.GetBuffer(256), 256);
strAddr.ReleaseBuffer();
CString strMsg = _T("Server: ") + strServer;
strMsg += _T(", @Address: ") + strAddr;
strMsg += _T(" is running on port ") + m_strPort + CString("\r\n");
m_pCurServer->AppendMessage( strMsg );
}
}
return bSuccess;
}
BOOL CServerSocketDlg::OnInitDialog()
{
ASSERT( GetDlgItem(IDC_BTN_SEND) != NULL );
ASSERT( GetDlgItem(IDC_BTN_START) != NULL );
ASSERT( GetDlgItem(IDC_BTN_STOP) != NULL );
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_ctlPortInc.SetRange32( 2000, 4500);
GetDlgItem(IDC_BTN_SEND)->EnableWindow( FALSE );
GetDlgItem(IDC_BTN_STOP)->EnableWindow( FALSE );
for(int i=0; i<MAX_CONNECTION; i++)
{
m_SocketManager[i].SetMessageWindow( &m_ctlMsgList );
m_SocketManager[i].SetServerState( true ); // run as server
}
PickNextAvailable();
return TRUE; // return TRUE unless you set the focus to a control
}
void CServerSocketDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CServerSocketDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
///////////////////////////////////////////////////////////////////////////////
// OnUpdateConnection
// This message is sent by server manager to indicate connection status
LRESULT CServerSocketDlg::OnUpdateConnection(WPARAM wParam, LPARAM lParam)
{
UINT uEvent = (UINT) wParam;
CSocketManager* pManager = reinterpret_cast<CSocketManager*>( lParam );
// We need to do this only for TCP socket
if (m_nSockType != SOCK_TCP)
return 0L;
if ( pManager != NULL)
{
// Server socket is now connected, we need to pick a new one
if (uEvent == EVT_CONSUCCESS)
{
PickNextAvailable();
StartServer();
}
else if (uEvent == EVT_CONFAILURE || uEvent == EVT_CONDROP)
{
pManager->StopComm();
if (m_pCurServer == NULL)
{
PickNextAvailable();
StartServer();
}
}
}
return 1L;
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CServerSocketDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CServerSocketDlg::OnBtnStart()
{
UpdateData();
StartServer();
}
void CServerSocketDlg::OnBtnStop()
{
// Disconnect all clients
for(int i=0; i<MAX_CONNECTION; i++)
m_SocketManager[i].StopComm();
if (!m_pCurServer->IsOpen())
{
GetDlgItem(IDC_BTN_START)->EnableWindow( TRUE );
PrevDlgCtrl();
GetDlgItem(IDC_BTN_STOP)->EnableWindow( FALSE );
GetDlgItem(IDC_TCP)->EnableWindow( TRUE );
GetDlgItem(IDC_UDP)->EnableWindow( TRUE );
}
}
void CServerSocketDlg::OnBtnSend()
{
CString strText;
m_ctlMessage.GetWindowText( strText );
int nLen = strText.GetLength();
stMessageProxy msgProxy;
if (nLen > 0)
{
USES_CONVERSION;
strText += _T("\r\n");
nLen = strText.GetLength();
if (m_nSockType == SOCK_UDP)
{
// send broadcast...
msgProxy.address.CreateFrom(_T("255.255.255.255"), m_strPort);
memcpy(msgProxy.byData, T2CA(strText), nLen);
nLen += msgProxy.address.Size();
}
else
{
nLen = __min(sizeof(msgProxy.byData)-1, nLen+1);
memcpy(msgProxy.byData, T2CA(strText), nLen);
}
// Send data to peer...
if (m_nSockType == SOCK_UDP)
m_pCurServer->WriteComm((const LPBYTE)&msgProxy, nLen, INFINITE);
else
{
// Send to all clients
for(int i=0; i<MAX_CONNECTION; i++)
{
if (m_SocketManager[i].IsOpen() && m_pCurServer != &m_SocketManager[i])
m_SocketManager[i].WriteComm(msgProxy.byData, nLen, INFINITE);
}
}
}
}
void CServerSocketDlg::OnDestroy()
{
for(int i=0; i<MAX_CONNECTION; i++)
m_SocketManager[i].StopComm();
CDialog::OnDestroy();
}
| [
"gigih.math.its@gmail.com"
] | gigih.math.its@gmail.com |
ca65df884094c57f0f3a218cb32606557b54f7ef | 5376fcdff458e85c49299274185b724ae2438b69 | /src/agora_edu_sdk/base/facilities/tools/audio_utils.h | 5d1b4692ac706c91384ab910a9d3c1701d4b0002 | [] | no_license | pengdu/AgoraDualTeacher | aabf9aae7a1a42a1f64ecfeae56fbcf61bed8319 | 4da68749f638a843053a57d199450c798dd3f286 | refs/heads/master | 2023-07-31T14:25:52.797376 | 2021-09-22T09:51:49 | 2021-09-22T09:51:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 642 | h | // Agora RTC/MEDIA SDK
//
// Created by Qingyou Pan in 2020-03.
// Copyright (c) 2020 Agora.io. All rights reserved.
//
#pragma once
namespace webrtc {
class AudioFrame;
}
namespace agora {
namespace rtc {
enum class AudioFormatErrorCode {
ERR_OK,
ERR_CHANNEL,
ERR_BYTES_PER_SAMPLE,
ERR_SAMPLES_PER_CHANNEL,
ERR_SAMPLE_RATE
};
AudioFormatErrorCode audio_format_checker(const int samples_per_channel, const int bytes_per_sample,
const int number_of_channels, const int sample_rate);
void reset_audio_frame(webrtc::AudioFrame* audio_frame);
} // namespace rtc
} // namespace agora
| [
"wangqixin@agora.io"
] | wangqixin@agora.io |
45d5ad4cc246164da02b85cc51a8acc7fd8e4a91 | 267a3c3b43bf8e0042391c322c7930cb83a5903c | /dziedziczenie3_kontenery_Bold/Containers.cpp | ddb1656fae2beebffa50e95d1a71f8a039d520f5 | [] | no_license | pierwiastekzminusjeden/cpp_lab_4sem | 096d2b2b9a0624d7e762260ad83925b531594d7f | ad0d388f7cb6463ded4c63e5a3ceca782577e307 | refs/heads/master | 2021-03-30T17:50:13.479514 | 2018-07-11T18:40:45 | 2018-07-11T18:40:45 | 122,998,380 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 45 | cpp | #include <iostream>
#include "Containers.h"
| [
"krystian.molenda@gmail.com"
] | krystian.molenda@gmail.com |
c8111236d062930b5e61856f0a3747a673c9cf63 | 4c25432a6d82aaebd82fd48e927317b15a6bf6ab | /data/dataset_2017/dataset_2017_8_formatted/Thanabhat/3264486_5633382285312000_Thanabhat.cpp | 5095464bfeffa3cc6d7421623d9f84183213d56d | [] | no_license | wzj1988tv/code-imitator | dca9fb7c2e7559007e5dbadbbc0d0f2deeb52933 | 07a461d43e5c440931b6519c8a3f62e771da2fc2 | refs/heads/master | 2020-12-09T05:33:21.473300 | 2020-01-09T15:29:24 | 2020-01-09T15:29:24 | 231,937,335 | 1 | 0 | null | 2020-01-05T15:28:38 | 2020-01-05T15:28:37 | null | UTF-8 | C++ | false | false | 708 | cpp | #include <iostream>
using namespace std;
int solve(int cc) {
string str;
cin >> str;
int p = 0;
while (p < str.length() - 1) {
if (str[p] > str[p + 1]) {
break;
}
p++;
}
if (p == str.length() - 1) {
cout << "Case #" << cc << ": " << str << endl;
return 1;
}
while (p > 0 && str[p - 1] == str[p]) {
p--;
}
str[p] = str[p] - 1;
for (int i = p + 1; i < str.length(); i++) {
str[i] = '9';
}
if (str[0] == '0') {
str.erase(str.begin());
}
cout << "Case #" << cc << ": " << str << endl;
return 1;
}
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
solve(i + 1);
}
return 0;
}
| [
"e.quiring@tu-bs.de"
] | e.quiring@tu-bs.de |
2115d4d1d5dff5afd0a6975d6562a4652eff50c5 | 4ab228f82d57e24c15dff1d6363e386ab7827cc4 | /src/c++/main/scmp.cpp | 90d31f8a932e76bf54a21cee07f0e13fc5a0f561 | [
"BSD-3-Clause",
"Python-2.0",
"MIT",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | LuisFdF/hap.py | 24101431ba0e69e6fd075c46992df0bae09a5c32 | d51d111e494b561b37c66299daf5a6c65a8d2ca9 | refs/heads/master | 2021-01-23T04:39:06.652035 | 2017-03-03T15:12:24 | 2017-03-03T15:12:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,005 | cpp | // -*- mode: c++; indent-tabs-mode: nil; -*-
//
// Copyright (c) 2010-2015 Illumina, Inc.
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/**
* Somatic / by allele comparison -- checks if we see the same alleles (ignoring genotypes).
*
* \file scmp.cpp
* \author Peter Krusche
* \email pkrusche@illumina.com
*
*/
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include "Version.hh"
#include "Variant.hh"
#include "helpers/StringUtil.hh"
#include <string>
#include <vector>
#include <fstream>
#include <map>
#include <memory>
#include <queue>
#include <mutex>
#include <future>
#include <htslib/synced_bcf_reader.h>
#include <helpers/BCFHelpers.hh>
#include <htslib/vcf.h>
#include "Error.hh"
#include "helpers/Timing.hh"
#include "BlockAlleleCompare.hh"
using namespace variant;
/* #define DEBUG_SCMP_THREADING */
int main(int argc, char* argv[]) {
namespace po = boost::program_options;
namespace bf = boost::filesystem;
try
{
std::string input_vcf;
std::string output_vcf;
std::string ref;
std::string only_regions;
std::string qq_field = "QUAL";
// limits
std::string chr;
int64_t start = -1;
int64_t end = -1;
int64_t rlimit = -1;
int64_t message = -1;
bool apply_filters = false;
int threads = 1;
int blocksize = 20000;
int min_var_distance = 100000;
try
{
// Declare the supported options.
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("version", "Show version")
("input-file", po::value<std::string>(), "Input VCF file. Must have exactly two samples, the first "
"sample will be used as truth, the second one as query. This can be obtained using bcftools: "
"bcftools merge truth.vcf.gz query.vcf.gz --force-samples")
("output-file,o", po::value<std::string>(), "The output file name (VCF / BCF / VCF.gz).")
("reference,r", po::value<std::string>(), "The reference fasta file (needed only for VCF output).")
("location,l", po::value<std::string>(), "Start location.")
("qq-field,qq", po::value<std::string>(), "QQ field name -- this can be QUAL, an INFO or FORMAT field name")
("only,O", po::value< std::string >(), "Bed file of locations (equivalent to -R in bcftools)")
("limit-records", po::value<int64_t>(), "Maximum umber of records to process")
("message-every", po::value<int64_t>(), "Print a message every N records.")
("apply-filters,f", po::value<bool>(), "Apply filtering in VCF.")
("threads", po::value<int>(), "Number of threads to use.")
("blocksize", po::value<int>(), "Number of variants per block.")
("min-var-distance", po::value<int>(), "Minimum distance between variants allowed to end up "
"in separate blocks")
;
po::positional_options_description popts;
popts.add("input-file", 1);
po::options_description cmdline_options;
cmdline_options
.add(desc)
;
po::variables_map vm;
po::store(po::command_line_parser(argc, argv).
options(cmdline_options).positional(popts).run(), vm);
po::notify(vm);
if (vm.count("version"))
{
std::cout << "scmp version " << HAPLOTYPES_VERSION << "\n";
return 0;
}
if (vm.count("help"))
{
std::cout << desc << "\n";
return 1;
}
if (vm.count("input-file"))
{
input_vcf = vm["input-file"].as< std::string >();
}
else
{
error("Input file is required.");
}
if (vm.count("output-file"))
{
output_vcf = vm["output-file"].as< std::string >();
}
else
{
error("Output file name is required.");
}
if (vm.count("reference"))
{
ref = vm["reference"].as< std::string >();
}
else
{
error("To write an output VCF, you need to specify a reference file, too.");
}
if (vm.count("location"))
{
stringutil::parsePos(vm["location"].as< std::string >(), chr, start, end);
}
if (vm.count("qq-field"))
{
qq_field = vm["qq-field"].as< std::string >();
}
if (vm.count("only"))
{
only_regions = vm["only"].as< std::string >();
}
if (vm.count("limit-records"))
{
rlimit = vm["limit-records"].as< int64_t >();
}
if (vm.count("message-every"))
{
message = vm["message-every"].as< int64_t >();
}
if (vm.count("apply-filters"))
{
apply_filters = vm["apply-filters"].as< bool >();
}
if (vm.count("threads"))
{
threads = vm["threads"].as< int >();
}
if (vm.count("blocksize"))
{
blocksize = vm["blocksize"].as< int >();
}
if (vm.count("min-var-distance"))
{
min_var_distance = vm["min-var-distance"].as< int >();
}
}
catch (po::error & e)
{
std::cerr << e.what() << "\n";
return 1;
}
FastaFile ref_fasta(ref.c_str());
bcf_srs_t * reader = bcf_sr_init();
reader->collapse = COLLAPSE_NONE;
if(!chr.empty() || !only_regions.empty())
{
reader->require_index = 1;
reader->streaming = 0;
}
else
{
reader->require_index = 0;
reader->streaming = 1;
}
if(!only_regions.empty()) {
int result = bcf_sr_set_regions(reader, only_regions.c_str(), 1);
if(result < 0)
{
error("Failed to set regions string %s.", only_regions.c_str());
}
}
if (!bcf_sr_add_reader(reader, input_vcf.c_str()))
{
error("Failed to open or file not indexed: %s\n", input_vcf.c_str());
}
if(!chr.empty())
{
int success = 0;
if(start < 0)
{
success = bcf_sr_seek(reader, chr.c_str(), 0);
}
else
{
success = bcf_sr_seek(reader, chr.c_str(), start);
#ifdef DEBUG_SCMP
std::cerr << "starting at " << chr << ":" << start << "\n";
#endif
}
if(success <= -2)
{
error("Cannot seek to %s:%i", chr.c_str(), start);
}
}
auto hdr = bcfhelpers::ph(bcf_hdr_dup(reader->readers[0].header));
BlockAlleleCompare::updateHeader(hdr.get());
// rename the samples in the output header
bcfhelpers::p_bcf_hdr output_header(bcfhelpers::ph(bcf_hdr_init("w")));
{
int len = 0;
char * hdr_text = bcf_hdr_fmt_text(hdr.get(), 0, &len);
if(!hdr_text)
{
error("Failed to process input VCF header.");
}
std::vector<std::string> split_header;
stringutil::split(std::string(hdr_text, (unsigned long) len), split_header, "\n");
free(hdr_text);
for(std::string hl : split_header)
{
bcf_hdr_append(output_header.get(), hl.c_str());
}
bcf_hdr_add_sample(output_header.get(), "TRUTH");
bcf_hdr_add_sample(output_header.get(), "QUERY");
bcf_hdr_sync(output_header.get());
}
htsFile * writer = nullptr;
const char * mode = "wu";
if(stringutil::endsWith(output_vcf, ".vcf.gz"))
{
mode = "wz";
}
else if(stringutil::endsWith(output_vcf, ".bcf"))
{
mode = "wb";
}
if(!output_vcf.empty() && output_vcf[0] == '-')
{
writer = hts_open("-", mode);
}
else
{
writer = hts_open(output_vcf.c_str(), mode);
}
bcf_hdr_write(writer, output_header.get());
/** local function to count variants in all samples */
int64_t rcount = 0;
std::string current_chr = "";
int vars_in_block = 0;
/*
* we keep a list of jobs as futures which get processed by a pool of
* workers
*/
std::queue<std::unique_ptr<BlockAlleleCompare> > blocks;
std::mutex blocks_mutex;
/*
* once a worker completes a comparison, the result goes into the list of
* processed blocks.
*/
std::list<std::unique_ptr<BlockAlleleCompare>> processed_blocks;
std::mutex processed_blocks_mutex;
/**
* gets set to true by main thread
*/
bool all_blocks_added = false;
std::vector<std::thread> workers;
auto worker = [&blocks,
&blocks_mutex,
&processed_blocks,
&processed_blocks_mutex,
&all_blocks_added]
{
bool work_left = true;
while(work_left)
{
std::unique_ptr<BlockAlleleCompare> current_block;
#ifdef DEBUG_SCMP_THREADING
std::cerr << "Worker " << std::thread::id() << " waiting." << std::endl;
#endif
{
std::lock_guard<std::mutex> lk(blocks_mutex);
/* std::unique_lock<std::mutex> lk(blocks_mutex); */
/* lk.wait([&blocks]() { !blocks.empty(); }); */
if (!blocks.empty())
{
current_block = std::move(blocks.front());
blocks.pop();
}
}
if(current_block)
{
#ifdef DEBUG_SCMP_THREADING
std::cerr << "Worker " << std::thread::id() << " has a job." << std::endl;
#endif
current_block->run();
#ifdef DEBUG_SCMP_THREADING
std::cerr << "Worker " << std::thread::id() << " finished a job." << std::endl;
#endif
{
std::lock_guard<std::mutex> lock(processed_blocks_mutex);
processed_blocks.emplace_back(std::move(current_block));
#ifdef DEBUG_SCMP_THREADING
std::cerr << "Worker " << std::thread::id() << " done." << std::endl;
#endif
}
}
work_left = !all_blocks_added || !blocks.empty();
}
};
for(int j = 0; j < std::max(1, threads); ++j)
{
workers.emplace_back(worker);
}
std::unique_ptr<BlockAlleleCompare> p_bac(new BlockAlleleCompare(hdr, ref_fasta, qq_field));
int nl = 1;
int previous_pos = -1;
auto t0 = CPUClock::now();
while(nl)
{
nl = bcf_sr_next_line(reader);
if (nl <= 0)
{
break;
}
if(!bcf_sr_has_line(reader, 0))
{
continue;
}
bcf1_t *line = reader->readers[0].buffer[0];
if(rlimit != -1)
{
if(rcount >= rlimit)
{
break;
}
}
const std::string vchr = bcfhelpers::getChrom(hdr.get(), line);
if(end != -1 && ((!current_chr.empty() && vchr != current_chr) || line->pos > end))
{
break;
}
if(!current_chr.empty() && vchr != current_chr)
{
// reset bs on chr switch
previous_pos = -1;
if(vars_in_block > 0)
{
// make sure we create a new block
vars_in_block = blocksize + 1;
}
}
current_chr = vchr;
if(apply_filters)
{
bcf_unpack(line, BCF_UN_FLT);
bool fail = false;
for(int j = 0; j < line->d.n_flt; ++j)
{
std::string filter = "PASS";
int k = line->d.flt[j];
if(k >= 0)
{
filter = bcf_hdr_int2id(hdr.get(), BCF_DT_ID, line->d.flt[j]);
}
if(filter != "PASS")
{
fail = true;
break;
}
}
// skip failing
if(fail)
{
continue;
}
}
const int dist_to_previous = (previous_pos < 0) ? std::numeric_limits<int>::max() : line->pos - previous_pos;
previous_pos = line->pos;
if(vars_in_block > blocksize || dist_to_previous > min_var_distance)
{
{
std::lock_guard<std::mutex> lock(blocks_mutex);
blocks.emplace(std::move(p_bac));
}
p_bac = std::move(std::unique_ptr<BlockAlleleCompare>(new BlockAlleleCompare(hdr, ref_fasta, qq_field)));
vars_in_block = 0;
previous_pos = -1;
}
p_bac->add(line);
++vars_in_block;
if (message > 0 && (rcount % message) == 0)
{
auto t1 = CPUClock::now();
typedef std::chrono::duration<double, typename CPUClock::period> Cycle;
std::cout << stringutil::formatPos(vchr.c_str(), line->pos) << " cycles/record: " <<
(Cycle(t1 - t0).count() / rcount) << "\n";
}
// count variants here
++rcount;
}
{
std::lock_guard<std::mutex> lock(blocks_mutex);
blocks.emplace(std::move(p_bac));
all_blocks_added = true;
}
if(message > 0)
{
std::cout << "All records read. Waiting for workers to complete" << std::endl;
}
for(auto & t : workers)
{
t.join();
}
// make sure we write in the correct order
processed_blocks.sort([](std::unique_ptr<BlockAlleleCompare> const & b1,
std::unique_ptr<BlockAlleleCompare> const & b2) {
return *b1 < *b2;
});
for(auto & result : processed_blocks)
{
result->output(writer);
}
hts_close(writer);
bcf_sr_destroy(reader);
}
catch(std::runtime_error & e)
{
std::cerr << e.what() << std::endl;
return 1;
}
catch(std::logic_error & e)
{
std::cerr << e.what() << std::endl;
return 1;
}
return 0;
}
| [
"pkrusche@illumina.com"
] | pkrusche@illumina.com |
2d127d42c775bfbe89d6fde25098652da12938f8 | 02b715831737eb94df84910677f6917aa04fa312 | /EIN-SOF/P R O E K T I/PROEKTI C++/Proekt 3/piramida.h | d676633b677ffb5c2a388bb46819e6ff4f426b39 | [] | no_license | DoozyX/EIN-SOF | 05b433e178fbda6fb63e0d61387684158913de1d | 5de0bd42906f9878557d489b617824fe80c4b23b | refs/heads/master | 2021-01-01T18:25:14.240394 | 2017-11-18T12:54:16 | 2017-11-18T12:54:16 | 98,330,930 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 313 | h | //programa piramida.h so osnova kvadrat
//class piramida
#ifndef PIRAMIDA_H
#define PIRAMIDA_H
#include "troDimenzionalni.h"
class Piramida:public TroDimenzionalni{
public:
Piramida(double=1,double=1);
virtual double presmetajPlostina();
virtual double presmetajVolumen();
virtual void print();
};
#endif | [
"slobodan.kletnikov@gmail.com"
] | slobodan.kletnikov@gmail.com |
f95e75adbd011541bc594acb2037bbcf26621435 | 94303aaf3384184608723be26121f1ea76fa75cf | /IcrXXXX/IcrXXXXDlg.h | 6803e8849ea14ff3c4565fe7a7ad895fcf225fc3 | [] | no_license | insys-projects/ICR | d8cb40e36764f10346b862c24188aab5757d07e1 | ef2357a8b41aba3ecf41a3b0d4afed5ece5ad3f4 | refs/heads/master | 2021-08-15T21:49:55.375551 | 2020-08-24T15:35:19 | 2020-08-24T15:35:19 | 215,523,343 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 911 | h | #ifndef ICRXXXXDLG_H
#define ICRXXXXDLG_H
#include <QtGui/QMainWindow>
#include "ui_IcrXXXXDlg.h"
class IcrXXXXDlg : public QDialog, public Ui::IcrXXXXDlgClass
{
Q_OBJECT
QList<TIcrParam *> m_lpIcrParams;
QList<TGroup *> m_lpGroup;
QMultiMap<QString, ParamTreeItem *> m_mpGroupItems;
public:
IcrXXXXDlg(const IcrParamList &lIcrParams, QList<TGroup *> &lpGroup, QWidget *parent = 0, Qt::WFlags flags = 0);
~IcrXXXXDlg();
IcrParamList GetIcrParams();
QList<TGroup *> GetGroups();
private:
void FillTree();
void SetIcrParams(const IcrParamList &lIcrParams);
protected:
virtual void showEvent(QShowEvent * pEvent);
private slots:
// Щелчок правой кнопкой
void slotItemRightClicked();
// Изменить цвет группы
void slotColorGroup();
// Изменить шрифт
void slotFontChange();
};
#endif // ICRXXXXDLG_H
| [
"Kozlov@a8a5cdc4-a91d-e646-800f-a4054892b1cc"
] | Kozlov@a8a5cdc4-a91d-e646-800f-a4054892b1cc |
f9287ceffdd4f3e7b9b08775c732f2fb8ad43f22 | 47ecf4d055ae867105d8b63c5ddaf7b5a31fe2a4 | /src/Dice.hpp | 39b3b1e9d075c0a28e3b8b9ac8ac8f7db88c2dc4 | [] | no_license | Mokon/simulator | 1566c724ced701d73e31e86dbfc055961281b46e | 504c7602cddc154793e01bbc863affdb154873db | refs/heads/master | 2021-01-23T06:54:26.645081 | 2017-04-01T12:25:51 | 2017-04-01T12:25:51 | 86,407,553 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 693 | hpp | /* Copyright (C) 2017 David 'Mokon' Bond, All Rights Reserved */
#pragma once
#include <random>
#include <queue>
class Dice final
{
public:
Dice(unsigned int sides = 6, unsigned int start = 1);
~Dice() = default;
Dice(const Dice&) = delete;
Dice& operator=(const Dice&) = delete;
Dice(Dice&&) = delete;
Dice& operator=(Dice&&) = delete;
unsigned int roll() const;
std::priority_queue<unsigned int> roll(unsigned long times) const;
private:
std::random_device randomDevice;
mutable std::mt19937 generator;
mutable std::uniform_int_distribution<unsigned int> distribution;
};
| [
"dbond@128technology.com"
] | dbond@128technology.com |
ca00aea57ea0a09d867726733ce180ac98f48adb | 613648e67a71f02bc0806b9a27ae99fced735f7f | /Laporan 8 String/uji coba gets.cpp | d04fe34eb58be048dc8e3b59246bf608591ce2b7 | [] | no_license | Dwirinas/Pemrograman-Terstruktur | c85c5379032b4f5fa39af985c551ef15eba11189 | 401f83aba45884c14105d9144687549dd3b2fdf8 | refs/heads/master | 2020-09-10T05:45:34.837773 | 2019-11-14T10:09:04 | 2019-11-14T10:09:04 | 221,663,527 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 240 | cpp | #include <stdio.h>
#define MAKS 5
main(){
char kar = 'A';
char nama[MAKS];
printf("Karakternya = %c\n", kar);
printf("Masukkan nama Anda : ");
gets(nama);
printf("\nNama Anda = %s\n", nama);
printf("Karakternya = %c\n", kar);
}
| [
"Risinasa9b@gmail.com"
] | Risinasa9b@gmail.com |
a4794f52e99d698050bccd1e49588ae5e515ee94 | e5cd80fd89480cbc27a177b9608ec93359cca5f8 | /672.cpp | 07caad7963df1c2d034639b114122854b9577e0d | [] | no_license | higsyuhing/leetcode_middle | c5db8dd2e64f1b0a879b54dbd140117a8616c973 | 405c4fabd82ed1188d89851b4df35b28c5cb0fa6 | refs/heads/master | 2023-01-28T20:40:52.865658 | 2023-01-12T06:15:28 | 2023-01-12T06:15:28 | 139,873,993 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 351 | cpp | class Solution {
public:
int flipLights(int n, int m) {
// first 3 generates 4 state, the last one has 2 states..
n = (n > 3) ? 3 : n;
if (m == 0) return 1;
if (m == 1) return n == 1 ? 2 : n == 2 ? 3 : 4;
if (m == 2) return n == 1 ? 2 : n == 2 ? 4 : 7;
return n == 1 ? 2 : n == 2 ? 4 : 8;
}
};
| [
"noreply@github.com"
] | noreply@github.com |
843390bb822f5a19dbbf43b5ba31545e90771ada | 0f051d3cfb4d06ad795624f84e711ddaa348e6a8 | /mazeTraverse (1).ino | 395d713dc6a338b6a3f6a4671c7c9d43942387c3 | [] | no_license | Zinc-Gao/Group10_codes | c681829aa339bf7192c8d7568742743e51b5d707 | f918640a5108d1fe0db67e0ee7b9b17bb1bff6f6 | refs/heads/main | 2023-01-18T21:32:53.541907 | 2020-11-20T12:16:33 | 2020-11-20T12:16:33 | 314,544,400 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,351 | ino | // Bluetooth initialisation
#include <SoftwareSerial.h> //Software Serial Port
#define RxD 7
#define TxD 6
#define ConnStatus A1
#define DEBUG_ENABLED 1
int shieldPairNumber = 17;
String slaveNameCmd = "\r\n+STNA=Slave";\
SoftwareSerial blueToothSerial(RxD,TxD);
// Servo initialisation
#include <Servo.h> // Include servo library
Servo servoLeft; // Declare left and right servos
Servo servoRight;
String path = "";
void setup() // Built-in initialization block
{
pinMode(10, INPUT); pinMode(9, OUTPUT); // Left IR LED & Receiver
pinMode(3, INPUT); pinMode(2, OUTPUT); // Right IR LED & Receiver
pinMode(5, INPUT); pinMode(4, OUTPUT); // Front IR LED & Receiver
servoLeft.attach(13); // Attach left signal to pin 13
servoRight.attach(12); // Attach right signal to pin 12
Serial.begin(9600);
blueToothSerial.begin(38400); // Set Bluetooth module to default baud rate 38400
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
pinMode(ConnStatus, INPUT);
Serial.println("Checking Slave-Master connection status.");
if (digitalRead(ConnStatus)==1) {
Serial.println("Already connected to Master - remove USB cable if reboot of Master Bluetooth required.");
}
else {
Serial.println("Not connected to Master.");
setupBlueToothConnection(); // Set up the local (slave) Bluetooth module
delay(1000); // Wait one second and flush the serial buffers
Serial.flush();
blueToothSerial.flush();
}
}
void loop() {
int irLeft = irDetect(9, 10, 38000); // Check for object on left
int irRight = irDetect(2, 3, 40000); // Check for object on right
int irFront = irDetect(4, 5, 27000); // Check for object in front
// // print (Left, right, front)
// Serial.print("("); Serial.print(irLeft); Serial.print(", ");
// Serial.print(irRight); Serial.print(", ");
// Serial.print(irFront); Serial.println(")");
// *************** Bluetooth *******************
// Check if there's any data sent from the remote Bluetooth shield
if (blueToothSerial.available()) {
char recvChar = blueToothSerial.read();
Serial.println(recvChar);
if (recvChar == 'f') {
moveTowards("front");
}
else if (recvChar == 'l') {
moveTowards("left");
}
else if (recvChar == 'r') {
moveTowards("right");
}
else if (recvChar == 'b') {
moveTowards("back");
}
}
// both left and right sides see the maze wall -> move foward
if ((irLeft == 0) && (irRight == 0) && (irFront == 1)) {
moveTowards("front");
}
// dead end -> pick up ball and trace back to start
else if ((irLeft == 0) && (irRight == 0) && (irFront == 0)) {
// sent data from the local serial terminal
String str = "find the ball";
for (int i = 0; i < sizeof(str) - 1; i++) {
blueToothSerial.print(str[i]);
}
blueToothSerial.print('\n');
// Wait for 500 ms -> for picking up ball?
toMove(0, 0, 500);
// move backwards towards start
int pathLength = sizeof(path) - 2;
for (int i = pathLength; i >= 0; i--) {
String direction = reverseOf(path[i]);
moveTowards(direction);
}
// stop servo signal
servoLeft.detach();
servoRight.detach();
}
// front and left side sees the maze wall -> turn right
else if ((irLeft == 0) && (irRight == 1) && (irFront == 0)) {
moveTowards("right");
moveTowards("front");
}
// front and right side sees the maze wall -> turn left
else if ((irLeft == 1) && (irRight == 0) && (irFront == 0)) {
moveTowards("left");
moveTowards("front");
}
// only left side sees the maze wall -> choose right or front
else if ((irLeft == 0) && (irRight == 1) && (irFront == 1)) {
int choice = random(2); // choose from 0 or 1
// turn right if 0
if (choice == 0) {
moveTowards("right");
moveTowards("front");
}
// move forward if 1
if (choice == 1) {
// move forward for 3000 ms (a block's distance)
for (int i = 0; i < 6; i++) {
moveTowards("front");
}
}
}
// only right side sees the maze wall -> choose right or front
else if ((irLeft == 1) && (irRight == 0) && (irFront == 1)) {
int choice = random(2); // choose from 0 or 1
// turn left if 0
if (choice == 0) {
moveTowards("left");
moveTowards("front");
}
// move forward if 1
else if (choice == 1) {
// move forward for 3000 ms (a block's distance)
for (int i = 0; i < 6; i++) {
moveTowards("front");
}
}
}
// only front side sees the maze wall -> choose right or front
else if ((irLeft == 1) && (irRight == 0) && (irFront == 1)){
int choice = random(2); // choose from 0 or 1
if (choice == 0) { // turn left if 0
moveTowards("left");
moveTowards("front");
}
else if (choice == 1) { // turn right if 1
moveTowards("right");
moveTowards("front");
}
}
// no obstacle at any direction -> choose front, left or right
else {
int choice = random(3); // choose from 0 to 2
if (choice == 0) { // turn left if 0
moveTowards("left");
moveTowards("front");
}
else if (choice == 1) { // turn right if 1
moveTowards("right");
moveTowards("front");
}
else if (choice == 2) { // move forward if 2
for (int i = 0; i < 6; i++) {
moveTowards("front");
}
}
}
delay(100);
}
int irDetect(int irLedPin, int irReceiverPin, long frequency)
{
tone(irLedPin, frequency, 8); // turn on IR LED for 1 ms
delay(1);
int ir = digitalRead(irReceiverPin); // 1 if no detect, 0 detect
delay(1); // Down time before recheck
return ir;
}
// Backward Linear Stop Linear Forward
// -200 -100 0 100 200
void toMove(int speedLeft, int speedRight, int duration) {
// left wheel clockwise, right wheel anti-clockwise
servoLeft.writeMicroseconds(1500 + speedLeft); // Set Left servo speed
servoRight.writeMicroseconds(1500 - speedRight); // Set right servo speed
delay(duration); // keep moving according to duration
}
void moveTowards(String direction) {
if (direction.equals("front")) {
toMove(-200, -200, 500);
path += "f";
}
else if (direction.equals("left")) {
toMove(-200, 200, 775);
path += "l";
}
else if (direction.equals("right")) {
toMove(200, -200, 775);
path += "r";
}
else if (direction.equals("back")) {
toMove(200, 200, 20);
path += "b";
}
}
String reverseOf(char direction) {
if (direction == 'f') {
return "back";
}
if (direction == 'l') {
return "right";
}
if (direction == 'r') {
return "left";
}
if (direction == 'b') {
return "front";
}
}
void setupBlueToothConnection()
{
Serial.println("Setting up the local (slave) Bluetooth module.");
slaveNameCmd += shieldPairNumber;
slaveNameCmd += "\r\n";
blueToothSerial.print("\r\n+STWMOD=0\r\n"); // Set the Bluetooth to work in slave mode
blueToothSerial.print(slaveNameCmd); // Set the Bluetooth name using slaveNameCmd
blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit paired device to connect me
blueToothSerial.flush();
delay(2000); // This delay is required
blueToothSerial.print("\r\n+INQ=1\r\n"); // Make the slave Bluetooth inquirable
blueToothSerial.flush();
delay(2000); // This delay is required
Serial.println("The slave bluetooth is inquirable!");
}
| [
"noreply@github.com"
] | noreply@github.com |
92932d185778651e235498b73c8422eeee65efe7 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/cpp-qt5-qhttpengine-server/generated/server/src/models/OAIComDayCqDamCoreImplServletHealthCheckServletProperties.cpp | 060b8788874b23f6f6ca610abd3d2d091c3045b0 | [
"MIT",
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | C++ | false | false | 3,661 | cpp | /**
* Adobe Experience Manager OSGI config (AEM) API
* Swagger AEM OSGI is an OpenAPI specification for Adobe Experience Manager (AEM) OSGI Configurations API
*
* OpenAPI spec version: 1.0.0-pre.0
* Contact: opensource@shinesolutions.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "OAIComDayCqDamCoreImplServletHealthCheckServletProperties.h"
#include "OAIHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace OpenAPI {
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::OAIComDayCqDamCoreImplServletHealthCheckServletProperties(QString json) {
this->fromJson(json);
}
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::OAIComDayCqDamCoreImplServletHealthCheckServletProperties() {
this->init();
}
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::~OAIComDayCqDamCoreImplServletHealthCheckServletProperties() {
}
void
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::init() {
m_cq_dam_sync_workflow_id_isSet = false;
m_cq_dam_sync_folder_types_isSet = false;
}
void
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::fromJson(QString jsonString) {
QByteArray array (jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::fromJsonObject(QJsonObject json) {
::OpenAPI::fromJsonValue(cq_dam_sync_workflow_id, json[QString("cq.dam.sync.workflow.id")]);
::OpenAPI::fromJsonValue(cq_dam_sync_folder_types, json[QString("cq.dam.sync.folder.types")]);
}
QString
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::asJson () const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::asJsonObject() const {
QJsonObject obj;
if(cq_dam_sync_workflow_id.isSet()){
obj.insert(QString("cq.dam.sync.workflow.id"), ::OpenAPI::toJsonValue(cq_dam_sync_workflow_id));
}
if(cq_dam_sync_folder_types.isSet()){
obj.insert(QString("cq.dam.sync.folder.types"), ::OpenAPI::toJsonValue(cq_dam_sync_folder_types));
}
return obj;
}
OAIConfigNodePropertyString
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::getCqDamSyncWorkflowId() const {
return cq_dam_sync_workflow_id;
}
void
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::setCqDamSyncWorkflowId(const OAIConfigNodePropertyString &cq_dam_sync_workflow_id) {
this->cq_dam_sync_workflow_id = cq_dam_sync_workflow_id;
this->m_cq_dam_sync_workflow_id_isSet = true;
}
OAIConfigNodePropertyArray
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::getCqDamSyncFolderTypes() const {
return cq_dam_sync_folder_types;
}
void
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::setCqDamSyncFolderTypes(const OAIConfigNodePropertyArray &cq_dam_sync_folder_types) {
this->cq_dam_sync_folder_types = cq_dam_sync_folder_types;
this->m_cq_dam_sync_folder_types_isSet = true;
}
bool
OAIComDayCqDamCoreImplServletHealthCheckServletProperties::isSet() const {
bool isObjectUpdated = false;
do{
if(cq_dam_sync_workflow_id.isSet()){ isObjectUpdated = true; break;}
if(cq_dam_sync_folder_types.isSet()){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
eaf4af38475be8ea4de671e46e289f8eb6ed0104 | 1434a4b11d60368b67d3e7341cb052e6d96ce3fc | /assign3/src/SceneObject.cpp | bb25888b964913ccc299bc86cd5c5461440c89b3 | [] | no_license | iainnash/yetanother-raytracer | 3d94da0d72a86fa1cca02f1850559955cc095379 | 068c13c9e60d1c6dedb26e1b1145405d7ccf02df | refs/heads/master | 2021-01-18T13:18:56.563694 | 2018-03-07T06:57:22 | 2018-03-07T06:57:22 | 47,189,451 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 162 | cpp | //
// SceneObject.cpp
// assign3
//
// Created by Iain Nash on 11/28/15.
// Copyright © 2015 Iain Nash. All rights reserved.
//
#include "SceneObject.hpp"
| [
"iain@codejoust.com"
] | iain@codejoust.com |
0b129b2d869eccaf30b3c41d050e274f6904081c | 97ca456c57dd3e5e4e05c8ec23f61efb744431c7 | /.bak/SbrXXX05.h | a0dbe21562d9f8a9cfc1c49b4da3b7bc18315478 | [] | no_license | kwokhung/testESP32 | 870b807749b7ff3b77dbb91d6e4bb61f675b9953 | 0005d5b8e131b86cda8d29c1be6325d58b86d3ab | refs/heads/master | 2020-12-30T11:02:32.516155 | 2019-03-18T04:56:37 | 2019-03-18T04:56:37 | 98,839,362 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,185 | h | #ifndef SbrXXX05_h
#define SbrXXX05_h
#include <Kalman.h>
#include "SbrBase.h"
#define RESTRICT_PITCH // Comment out to restrict roll to ±90deg instead - please read: http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf
#define IMUAddress 0x68
#define I2C_TIMEOUT 1000
class SbrXXX05 : public SbrBase<SbrXXX05>
{
public:
friend class SbrBase;
uint8_t mpuWrite(uint8_t registerAddress, uint8_t data, bool sendStop);
uint8_t mpuWrite(uint8_t registerAddress, uint8_t *data, uint8_t length, bool sendStop);
uint8_t mpuRead(uint8_t registerAddress, uint8_t *data, uint8_t nbytes);
private:
SbrXXX05(std::string name)
: SbrBase(name)
{
}
void setup() override;
void loop() override;
Kalman kalmanX; // Create the Kalman instances
Kalman kalmanY;
/* IMU Data */
double accX, accY, accZ;
double gyroX, gyroY, gyroZ;
int16_t tempRaw;
double gyroXangle, gyroYangle; // Angle calculate using the gyro only
double compAngleX, compAngleY; // Calculated angle using a complementary filter
double kalAngleX, kalAngleY; // Calculated angle using a Kalman filter
uint32_t timer;
uint8_t i2cData[14]; // Buffer for I2C data
};
#endif | [
"chu_kwokhung@yahoo.com.hk"
] | chu_kwokhung@yahoo.com.hk |
dd88d9c91fd171bd0c105ecc3f7386a7bef8b76c | bd5673632d9d65808d81e1e6f45ccd1899b4267a | /src/Ludum/Common.cpp | 16bd372948503d3973cfa8f1d2c8b3a7112986d9 | [] | no_license | gingerBill/LD-30 | 6b2676f5cb5ca45979bd5347cfb462ad2ef06b01 | 875dcc17cb4b87af08b22de0d5a7a8d3fb0e22cd | refs/heads/master | 2020-07-03T16:52:55.938626 | 2016-11-19T23:29:58 | 2016-11-19T23:29:58 | 74,241,619 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,428 | cpp | #include <Ludum/Common.hpp>
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#endif
namespace gb
{
std::string resourcePath()
{
#ifdef __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
char path[PATH_MAX];
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
{
// error!
}
CFRelease(resourcesURL);
return std::string(path) + "/";
#elif
return "";
#endif
}
bool getFileContents(const std::string& filename, std::vector<char>& buffer)
{
std::ifstream file(filename.c_str(), std::ios_base::binary);
if (file)
{
file.seekg(0, std::ios_base::end);
std::streamsize size = file.tellg();
if (size > 0)
{
file.seekg(0, std::ios_base::beg);
buffer.resize(static_cast<std::size_t>(size));
file.read(&buffer[0], size);
}
buffer.push_back('\0');
return true;
}
else
{
return false;
}
}
glm::vec4 getTextureCoords(int positionNumber, int width, int height)
{
// hex
// 0 1 2 3 .. F
// 10 11 12 13 .. 1F
// ..
// F0 F1 F2 F3 .. FF
// 16 x 16 tiles in texture
glm::vec4 uv(0, 0, 0, 0);
uv[0] = (positionNumber % 16) / 16.0f;
uv[1] = 1.0f - (positionNumber / 16) / 16.0f;
uv[2] = uv[0] + width*(1.0f / 16.0f);
uv[3] = uv[1] - height*(1.0f / 16.0f);
return glm::vec4(uv[0], uv[3], uv[2], uv[1]);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
a4ae3532e9165bf6a28ad0963a1a8d9380a24030 | b39d3a37f92ba59160e1be9894eea5ce3dad5b6a | /Sum of squares of first 'n' numbers.cpp | d7556dd8aa8d0228537568982e50b61ee1112252 | [] | no_license | AryanshMahato/cpp-Important-Projects | e8ee7a51f740f010ad0860f3b7932c5f98647386 | 0ea6e53b47043e363e54bb36db84be9eeabc81d4 | refs/heads/master | 2020-05-07T14:47:38.738320 | 2019-06-01T14:01:31 | 2019-06-01T14:01:31 | 180,609,353 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 240 | cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n, sum, a;
cout<<"Enter the number of power: ";
cin>>n;
a=0;
while(a<=n)
{
sum=pow(2,a)+sum;
a++;
}
cout<<sum;
return 0;
}
| [
"aryanshmahato@gmail.com"
] | aryanshmahato@gmail.com |
3928eb77c278b8d8ecd694d8572f0fac20abe7b8 | 606d9876af16153b24a79714b9a8b078633c991b | /3rdparty/mylib/TextureUtil.h | 9aecbb9448b3604ab504fb9a090cd095913dcb03 | [] | no_license | cntlb/Opengl-linux | 7c4355f10d33271019c263477a022c8c4c6e2369 | 2743388939846d2b4c9a082a55ef6f5c466ff280 | refs/heads/master | 2021-01-25T13:25:23.840707 | 2018-03-14T11:01:18 | 2018-03-14T11:01:18 | 123,571,974 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,534 | h | //
// Created by jmu on 18-3-9.
//
#ifndef INC_2_4_TEXTURE_TEXTURE_H
#define INC_2_4_TEXTURE_TEXTURE_H
#include "common.h"
#define LOG_TAG "TextureUtil.h"
class TextureUtil{
public:
static GLuint load(const char* path, void (*texParamFunc)()=TextureUtil::texFunc){
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
int w,h,channels;
std::string pathName = std::string("../res/")+std::string(path);
stbi_uc* image = stbi_load(pathName.c_str(), &w, &h, &channels, 0);
GLint format;
if(channels == 1){
format = GL_RED;
}else if(channels == 3){
format = GL_RGB;
}else if(channels == 4){
format = GL_RGBA;
}
if(image){
glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, format, GL_UNSIGNED_BYTE, image);
glGenerateMipmap(GL_TEXTURE_2D);
texParamFunc();
stbi_image_free(image);
}else{
LOGE("load texture error! file: %s", pathName.c_str());
stbi_image_free(image);
}
return texture;
}
private:
static void texFunc(){
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
};
#endif //INC_2_4_TEXTURE_TEXTURE_H
| [
"tanglinbing@4399inc.com"
] | tanglinbing@4399inc.com |
c165744a256746d0b13e866584d781e16bc4796d | 55fc0e953ddd07963d290ed56ab25ff3646fe111 | /StiGame/events/TableClickEventArgs.h | 6d1ec525f85e79d47c97e5c2dfa0e904cf0c67cc | [
"MIT"
] | permissive | jordsti/stigame | 71588674640a01fd37336238126fb4500f104f42 | 6ac0ae737667b1c77da3ef5007f5c4a3a080045a | refs/heads/master | 2020-05-20T12:54:58.985367 | 2015-06-10T20:55:41 | 2015-06-10T20:55:41 | 22,086,407 | 12 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 715 | h | #ifndef TABLECLICKEVENTARGS_H
#define TABLECLICKEVENTARGS_H
namespace StiGame
{
namespace Gui
{
class Table;
class TableRow;
class TableCell;
class TableClickEventArgs
{
public:
TableClickEventArgs(int m_rowIndex, int m_columnIndex);
TableClickEventArgs(Table *m_table, TableRow *m_row, TableCell *m_cell, int m_rowIndex, int m_columnIndex);
virtual ~TableClickEventArgs();
TableRow* getRow(void);
Table* getTable(void);
TableCell* getCell(void);
int getRowIndex(void);
int getColumnIndex(void);
bool isHeaderClicked(void);
private:
TableRow *row;
TableCell *cell;
Table *table;
int rowIndex;
int columnIndex;
};
}
}
#endif // TABLECLICKEVENTARGS_H
| [
"jord52@gmail.com"
] | jord52@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.