blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 247 | content_id stringlengths 40 40 | detected_licenses listlengths 0 57 | license_type stringclasses 2 values | repo_name stringlengths 4 111 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 58 | visit_date timestamp[ns]date 2015-07-25 18:16:41 2023-09-06 10:45:08 | revision_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | committer_date timestamp[ns]date 1970-01-14 14:03:36 2023-09-06 06:22:19 | github_id int64 3.89k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 25 values | gha_event_created_at timestamp[ns]date 2012-06-07 00:51:45 2023-09-14 21:58:52 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-08-24 19:49:39 ⌀ | gha_language stringclasses 159 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 10.5M | extension stringclasses 111 values | filename stringlengths 1 195 | text stringlengths 7 10.5M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
54342cd17bfdfd052879a16d6481b8d7f9313a95 | d96d3e1e437c08150b304af24c4f2b935034ed05 | /NewtonRaphson/programa.cpp | 4656f46a4513d8fea9537f2512cdd377d13f487e | [
"MIT"
] | permissive | albertosaurio/CDD | 9d3d2cc882335cd601e619207999a54f23b3373a | 6cdf0e46e9f04cb11b95ad6e8c914f1430647e45 | refs/heads/master | 2020-07-13T12:30:06.659477 | 2019-08-30T04:24:36 | 2019-08-30T04:24:36 | 205,083,501 | 0 | 0 | null | 2019-08-29T04:56:28 | 2019-08-29T04:56:27 | null | UTF-8 | C++ | false | false | 4,245 | cpp | programa.cpp |
// correr con "g++ -std=c++11 programa.cpp -o programa && ./programa"
// cout << "String Coef Number: " << coefNumber << endl;
// cout << "string Exp Number: " << expNumber << endl;
// cout << "Current ARGV: " << argv[i][j] << endl;
// cout << "Exponent state: " << exponent << endl << endl;
#include <bits/stdc++.h>
// creates a ld shorcut for long double
typedef long double ld;
// define maximum and minimum values values to Newton Raphson iterarions
#define N 100
#define MAX_ERROR 10e-10 // if error is less than 10^10 stop
#define MAX_ITERATOR 20 // I don't want to exceed a maximum of 20 itirations
using namespace std;
// GLOBAL VARIABLES
string coefNumber = "",
expNumber = "0";
vector< pair< ld, ld > > polynomium(N, pair<ld, ld>(0,0)); // first = coef and second = exp
int pIndex = 0;
/*
Functions:
String to Long Double
Power Calculator
Function evaluation
Derivattive Function Evaluation
*/
void derivateCalc(){ ///las deribadas de un polinomio son muy simples, solo la del ex
int exp_aux[pIndex],coef_aux[pIndex], auxiliar=0, contador=0;
for(contador=0;contador<=pIndex;contador++)
{
if(polynomium[contador].second>=1)
{
exp_aux[contador] = polynomium[contador].second;
coef_aux[contador] = polynomium[contador].first;
if (exp_aux[contador]>=1)
{ auxiliar=coef_aux[contador] * exp_aux[contador];
coef_aux[contador]= auxiliar;
exp_aux[contador] = exp_aux[contador] - 1;
}
}
}
cout<<"la derivada es ";
int i=0;
for(i=0;i<contador;i++)
{
cout<< coef_aux[i]<<"x**" << exp_aux[i] << " + ";// solo es una prueba para ver si funciona hasta ahora
}
cout << endl << endl;// se debe llamar a la funcion que divide la funcion con su derivada
}
void stringToLongDouble( int argc, char** argv){
cout << endl << endl;
bool exponent = false;
int j = 0;
if(!argv[1][0]){ // null case
coefNumber = "0";
expNumber = "0";
}
for(int i = 1; i < argc; ++i){ // if inputs more " " polynomial strings
while(argv[i][j]){ // travels through " " input
// cout << "String Coef Number: " << coefNumber << endl;
// cout << "string Exp Number: " << expNumber << endl;
// cout << "Current ARGV: " << argv[i][j] << endl;
// cout << "Exponent state: " << exponent << endl << endl;
if(argv[i][j] == 'x' || argv[i][j] == 'X'){ // checks for coef and exp changes
exponent = true;
polynomium[pIndex].first = stold(coefNumber); // adds coef to pair
coefNumber = ""; // reset string
if(argv[i][j + 1] != '*')
expNumber = "1";
}
if(exponent){ // while exponent == true
if(argv[i][j] != '*' && argv[i][j] != 'x' && argv[i][j] != 'X'){
expNumber += argv[i][j];
}
if(argv[i][j] == '-' || argv[i][j] == '+'){
exponent = false;
polynomium[pIndex].second = stold(expNumber);
pIndex++;
coefNumber += argv[i][j];
expNumber = "0";
}
}
else{
if(argv[i][j] == '-' ){ // if it finds a - multiply by -1
polynomium[pIndex].first = -1;
exponent = false;
}
else{
polynomium[pIndex].first = 1;
exponent = false;
}
if(argv[i][j] != ' ') // handles stold error with blank space
coefNumber += argv[i][j];
}
j++;
}
exponent = false;
if(pIndex >= 1){
polynomium[pIndex].first = stold(coefNumber); // last number of "input"
polynomium[pIndex].second = stold(expNumber); // last number of "input"
}
j = 0;
}
}
void powerCalc(){
}
void functionCalc(){
}
void NewtonRaphson(){
}
int main(int argc, char** argv){
ios_base::sync_with_stdio(false);
stringToLongDouble(argc, argv);
polynomium.resize(pIndex + 1);
for(int i = 0; i < polynomium.size(); i++){
cout << " Polinomio "<< i + 1 << " :" << endl
<< "\tcoef : " << polynomium[i].first << endl
<< "\texp : " << polynomium[i].second << endl;
}
return 0;
}
|
b6b4e2e713f9ec39f056386356bd44204497320c | e075255b75a1c30a44c138360d7af5bdb959938f | /src/tools/qt-gui/src/newkeycommand.cpp | db71521a4a01e152136ed2329b05a861c2abbda8 | [
"BSD-3-Clause",
"DOC"
] | permissive | 0003088/qt-gui-test | 785243cb1c9303ee5fdb0a6b4d7b7137858c2e62 | 0ceaa19e5d4b50b110047c0b73eb4f79164f4532 | refs/heads/master | 2021-01-04T02:41:54.117830 | 2016-12-15T21:57:04 | 2016-12-15T21:57:04 | 76,114,845 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,497 | cpp | newkeycommand.cpp | /**
* @file
*
* @brief
*
* @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org)
*/
#include "newkeycommand.hpp"
#include <kdb.hpp>
NewKeyCommand::NewKeyCommand (TreeModel *model, const QModelIndex &parent, DataContainer * data, bool isBelow, QUndoCommand * parentCommand)
: QUndoCommand (parentCommand)
, m_model(model)
, m_parentNode (qvariant_cast<TreeItemPtr>(model->data(parent, TreeModel::ItemRole)))
, m_newNode (nullptr)
, m_path(model->pathFromIndex(parent))
{
// TreeViewModel * parentModel = m_parentNode->getChildren ();
Q_ASSERT(m_model == parent.model());
kdb::Key newKey = m_model->createNewKey (m_parentNode->name() + "/" + data->newName (), data->newValue (), data->newMetadata ());
QStringList newNameSplit = m_model->getSplittedKeyname (newKey);
kdb::Key parentKey = m_parentNode->key();
if (!parentKey) parentKey = kdb::Key (m_parentNode->name ().toStdString (), KEY_END);
QStringList parentNameSplit = m_model->getSplittedKeyname (parentKey);
// check if the new key is directly below the parent
QSet<QString> diff = newNameSplit.toSet ().subtract (parentNameSplit.toSet ());
if (diff.count () > 1 || isBelow)
setText ("newBranch");
else
setText ("newKey");
QString name = cutListAtIndex (newNameSplit, parentNameSplit.count ()).first ();
m_model->sink(m_parentNode, newNameSplit, newKey.dup ());
m_newNode = m_parentNode->getChildByName (name);
QModelIndexList newIndex = m_model->match(parent, TreeModel::NameRole,
QVariant::fromValue(m_parentNode->name() + "/" + name),-1,Qt::MatchExactly | Qt::MatchRecursive);
Q_ASSERT(newIndex.count() == 1);
Q_ASSERT(newIndex.at(0).isValid());
m_row = newIndex.at(0).row();
model->removeRow(m_row,newIndex.at(0).parent());//TODO
// parentModel->removeRow (m_parentNode->getChildIndexByName (m_name));
}
void NewKeyCommand::undo ()
{
QModelIndex index = m_model->pathToIndex(m_path);
if (index.isValid())
{
// remove new node
m_model->removeRow (m_row,index);
}
}
void NewKeyCommand::redo ()
{
QModelIndex index = m_model->pathToIndex(m_path);
if (index.isValid())
{
QList<TreeItemPtr> items;
Q_ASSERT(m_newNode);
items.append(m_newNode);
m_model->setItemsToInsert(items);
m_model->insertRows(m_row, items.count(), index);
// // m_model->refreshArrayNumbers();
// // m_model->refresh();
}
}
QStringList NewKeyCommand::cutListAtIndex (QStringList & list, int index)
{
for (int i = 0; i < index; i++)
list.removeFirst ();
return list;
}
|
07e82df6461b42be84dcbf168c4a41385921b3ca | ad9328bca8a855510fd04e382379c61f655bf69f | /Project1/Project1/ResourceManager.h | 280823a150f7752dee9439ee9954b768921bac2c | [] | no_license | kooa77/trp2DtileGame_v2 | 1e25eddc0371f783afd49bdc8c6aaae8f0470e6f | 5371156e5eb63cb26ad66671e4a889a8a49d0e1e | refs/heads/master | 2021-05-05T14:09:47.913282 | 2018-02-13T02:16:37 | 2018-02-13T02:16:37 | 118,422,653 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 666 | h | ResourceManager.h | #pragma once
#include <d3dx9.h>
#include <string>
#include <map>
#include <vector>
class Texture;
class ResourceManager
{
// Singleton
private:
static ResourceManager* _instance;
public:
static ResourceManager* GetInstance();
private:
ResourceManager();
~ResourceManager();
// Texture
private:
std::map<std::wstring, Texture*> _textureMap;
public:
//Texture* FindTexture(std::wstring fileName, LPDIRECT3DDEVICE9 device3d);
Texture* FindTexture(std::wstring fileName);
void RemoveAllTexture();
// Script
private:
std::map<std::wstring, std::vector<std::string>> _scriptMap;
public:
std::vector<std::string> FindScript(std::wstring fileName);
};
|
f39f182b1975df3ac16226737b454bcbc119c4cc | 75ee79b8abdd9512f6357a814e1cde5b537012f7 | /Shooterman/Common/Messages/MouseMessage.h | b3e25a6d8509b7e55b75c6f8d614c0f6f0db3359 | [] | no_license | BlindAnguis/Shooterman | 418aa8624719bd0ffa99cfdf29439b0303fb7cc0 | 166cab7df5a05fd4b506c6acf3f9748bcb4d0996 | refs/heads/master | 2020-04-21T17:35:51.915001 | 2020-01-31T15:42:53 | 2020-01-31T15:42:53 | 169,740,884 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 336 | h | MouseMessage.h | #pragma once
#include "Message.h"
#include "../MessageId.h"
class MouseMessage : Message {
public:
MouseMessage();
MouseMessage(sf::Packet packet);
MouseMessage(sf::Vector2i position);
~MouseMessage();
sf::Packet pack();
void unpack(sf::Packet packet);
sf::Vector2i getPosition();
private:
sf::Vector2i mPosition;
}; |
8a835d4bba5c8643b35dcb4bf2c04a095cc1efbe | e90671c6b1cb69eaf57bd0ab4bbd1bd92ba9aea9 | /android/vendored/sdk48/@shopify/react-native-skia/cpp/rnskia/dom/base/JsiDomDrawingNode.h | 62174ab6b732950413ab0668557a2bca27bd7e2d | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | expo/expo | 72fc802e3b6806789225bdd856031a8d150dd6f5 | 40f087fc0c0ab22270cfef2673bced44af170c34 | refs/heads/main | 2023-08-17T01:38:28.442098 | 2023-08-16T21:43:11 | 2023-08-16T21:43:11 | 65,750,241 | 23,742 | 5,421 | MIT | 2023-09-14T21:37:37 | 2016-08-15T17:14:25 | TypeScript | UTF-8 | C++ | false | false | 1,137 | h | JsiDomDrawingNode.h | #pragma once
#include "JsiDomRenderNode.h"
#include "JsiPaintNode.h"
#include <memory>
namespace RNSkia {
class JsiDomDrawingNode : public JsiDomRenderNode {
public:
JsiDomDrawingNode(std::shared_ptr<RNSkPlatformContext> context,
const char *type)
: JsiDomRenderNode(context, type) {}
protected:
void defineProperties(NodePropsContainer *container) override {
JsiDomRenderNode::defineProperties(container);
container->defineProperty<PaintProp>();
}
/**
Override to implement drawing.
*/
virtual void draw(DrawingContext *context) = 0;
void renderNode(DrawingContext *context) override {
#if SKIA_DOM_DEBUG
printDebugInfo("Begin Draw", 1);
#endif
#if SKIA_DOM_DEBUG
printDebugInfo(context->getDebugDescription(), 2);
#endif
draw(context);
// Draw once more for each child paint node
for (auto &child : getChildren()) {
auto ptr = std::dynamic_pointer_cast<JsiPaintNode>(child);
if (ptr != nullptr) {
draw(ptr->getDrawingContext());
}
}
#if SKIA_DOM_DEBUG
printDebugInfo("End Draw", 1);
#endif
}
};
} // namespace RNSkia
|
89f68a671a999b1e660c22a9bf2a24d2a9513bbf | 8fe9d2824b1150c05e10b0db69a271dd5627da39 | /src/datastatehelper.hpp | 863c3f37e3241422cf1126d2c61120c36e7c9b86 | [] | no_license | Senspark/publisher-helper | f8a8f439bf4e2556442e50136e86f9e82f3fff3e | 23ce2b7a6d34a10afb0b4c9186ab250e74025eb2 | refs/heads/master | 2021-05-16T17:58:03.181631 | 2018-05-23T09:51:48 | 2018-05-23T09:51:48 | 103,126,564 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 966 | hpp | datastatehelper.hpp | #ifndef DATASTATEHELPER_HPP
#define DATASTATEHELPER_HPP
#include <QModelIndex>
#include <QStack>
#include <QVariant>
#include <QVector>
class MonoState {
public:
QModelIndex index;
QVariant oldValue;
QVariant newValue;
int role;
MonoState();
explicit MonoState(const QModelIndex& index, const QVariant& oldValue,
const QVariant& newValue, int role);
};
class DataStateHelper {
public:
DataStateHelper();
void pushGroup();
void popGroup();
void setEnabled(bool enabled);
void saveState(const QModelIndex& index, const QVariant& oldValue,
const QVariant& newValue, int role);
bool canUndo() const;
bool canRedo() const;
QVector<MonoState> undo();
QVector<MonoState> redo();
private:
bool enabled_;
bool pushedGroup_;
QStack<QVector<MonoState>> stateGroups_;
QStack<QVector<MonoState>> undoneStateGroups_;
};
#endif // DATASTATEHELPER_HPP
|
24025b556a978bd7366b23064c9bcc486020291d | e281c2427308c8cc93eb35a73a89f4fd70a0e486 | /backend/src/core/Entity.h | f2f207f75cf4bbb2e719a231c1d0d89e789d266f | [
"BSD-3-Clause",
"MIT"
] | permissive | MaxVanRaden/Gaffney-Orthotics-Capstone-Project | 7f9a4977ecc258b6b067de61758089df227766c2 | e953158931c9707e983a0a3a786c173c7f0db5f4 | refs/heads/main | 2023-05-13T07:54:12.005754 | 2021-06-05T05:31:43 | 2021-06-05T05:31:43 | 332,948,245 | 6 | 0 | NOASSERTION | 2021-06-05T05:28:17 | 2021-01-26T02:32:55 | C++ | UTF-8 | C++ | false | false | 1,566 | h | Entity.h | #ifndef GAFFNEY_ORTHOTICS_CAPSTONE_PROJECT_ENTITY_H
#define GAFFNEY_ORTHOTICS_CAPSTONE_PROJECT_ENTITY_H
#include "backend/src/engine/maths.h"
#include "backend/src/engine/texture.h"
#include "backend/src/engine/shaders.h"
#include "backend/src/engine/render.h"
//#define MAX_REVERT_COUNT 50
class Entity {
public:
Entity();
explicit Entity(std::string file);
~Entity();
void load(std::string file, int fileformat);
bool is_mouse_over(vec3 o, vec3 d);
float place_line(vec3 o, vec3 d);
void draw(StaticShader& shader);
void draw_overlay(StaticShader& shader);
void draw_vertices(BillboardShader& shader, Mesh* billboard, Texture circle, mat4 view, vec3 campos);
void draw_vertices(PickingShader& shader, Mesh* billboard, Texture circle, mat4 view, vec3 campos);
void set_position(vec3 pos);
void set_rotation(vec3 rotate);
void set_scale(vec3 scale);
void scale_entity(float factor);
void select(int xIn, int yIn, int x2, int y2, mat4 view, mat4 projection, Rect viewport);
void select_vertices_in_cross_section(float top, float bot);
Model& get_current();
void reset_head(Model& change);
//void set_vertex_ID_selected(int ID);
void reset_selected_vertices();
private:
void add_vertex_if_unique(Mesh& mesh, int i);
Model current; //current model
Model start; //the model before any changes were made
// Model previous[MAX_REVERT_COUNT]; //an array of the last MAX_REVERT_COUNT number of changes (for undoing)
};
#endif //GAFFNEY_ORTHOTICS_CAPSTONE_PROJECT_ENTITY_H
|
a7b5463732d74c37fd999db2f935bb316c8a3164 | 6ee124a530bad4b65a6e10c3bcfcd5ee282e868d | /December3/part1.cpp | 46019ac6a67a339c928352cc6057fc161a35c82d | [
"MIT"
] | permissive | ritikrajdev/advent-of-code | f97e273d98a70fe2ef9c0d222dbe1727b1e9a3e9 | b7c5d4397f66779fa5d90b5851ccc9d4549fcaf9 | refs/heads/main | 2023-01-27T22:12:55.752163 | 2020-12-07T19:36:02 | 2020-12-07T19:36:02 | 317,453,173 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 481 | cpp | part1.cpp | #include <fstream>
#include <iostream>
#include <string>
int main()
{
std::ifstream inputFile("input.txt");
std::string line;
int rightPosition = 0, treeCounter = 0;
while (std::getline(inputFile, line))
{
const int lineLength = line.length();
const char characterAtDesiredPosition = line[(rightPosition % lineLength)];
if (characterAtDesiredPosition == '#')
{
treeCounter++;
}
rightPosition += 3;
}
std::cout << treeCounter << std::endl;
return 0;
}
|
9038098ac304f02edf0a20599ca851bee51ad168 | 572c9859d07746ea3b109c7675dd68ee5b0f0f31 | /src/researchUI/tests/notepad.cpp | 33604825154b5b1d3acb8fd8d5fddb62d269c6ea | [
"MIT"
] | permissive | filami/vidf | ce13f447142406bb80d55657b732122c16c2a65c | f93498e7e29fb39e6624e6e13450d0f5dc37abb0 | refs/heads/master | 2021-01-18T23:12:56.508550 | 2020-01-29T22:16:50 | 2020-01-29T22:16:50 | 42,007,421 | 0 | 0 | null | 2016-10-25T18:43:08 | 2015-09-06T15:23:58 | C++ | UTF-8 | C++ | false | false | 2,177 | cpp | notepad.cpp | #include "pch.h"
#include "notepad.h"
#include "yasli/Enum.h"
#include "yasli/STL.h"
void Entry::serialize(yasli::Archive& ar)
{
ar(name, "name", "Name");
ar(age, "age", "Age");
ar(position, "position", "Position");
}
void Document::serialize(yasli::Archive& ar)
{
ar(entries, "entries", "Entries");
}
YASLI_ENUM_BEGIN(Position, "Position")
YASLI_ENUM(ENGINEER, "engineer", "Engineer")
YASLI_ENUM(MANAGER, "manager", "Manager")
YASLI_ENUM_END()
Notepad::Notepad()
{
openAction = new QAction(tr("&Load"), this);
saveAction = new QAction(tr("&Save"), this);
exitAction = new QAction(tr("E&xit"), this);
connect(openAction, SIGNAL(triggered()), this, SLOT(open()));
connect(saveAction, SIGNAL(triggered()), this, SLOT(save()));
connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(openAction);
fileMenu->addAction(saveAction);
fileMenu->addSeparator();
fileMenu->addAction(exitAction);
textEdit = new QTextEdit;
propertyTree = new QPropertyTree();
propertyTree->setUndoEnabled(true, false);
propertyTree->attach(yasli::Serializer(document));
propertyTree->expandAll();
setCentralWidget(propertyTree);
setWindowTitle(tr("Notepad"));
}
void Notepad::open()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
tr("Text Files (*.txt);;C++ Files (*.cpp *.h)"));
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this, tr("Error"), tr("Could not open file"));
return;
}
QTextStream in(&file);
textEdit->setText(in.readAll());
file.close();
}
}
void Notepad::save()
{
QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "",
tr("Text Files (*.txt);;C++ Files (*.cpp *.h)"));
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) {
// error message
}
else {
QTextStream stream(&file);
stream << textEdit->toPlainText();
stream.flush();
file.close();
}
}
}
int NotepadTest(int argc, char** argv)
{
QApplication app{ argc, argv };
Notepad notepad;
notepad.show();
return app.exec();
}
|
5c5bd61f56474b6f1ad58a521f317e06b103d655 | 3acff1e415ebeb32512681b77736b5416f524f71 | /Week 9 task 1 and 2/noppa.cpp | b9f98d683ce0983c188aa194adebee182488b7e9 | [] | no_license | SSyrah/Class-training | 95ca71445a6171093f8d973e96ad7b360ba07cc5 | 173fc6e321522f03912e6afec01164c7c3be8992 | refs/heads/master | 2023-04-14T17:50:46.962131 | 2021-04-26T15:03:15 | 2021-04-26T15:03:15 | 355,418,195 | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 2,045 | cpp | noppa.cpp | #include "noppa.h"
noppa::noppa() : noppa1(0), noppaLkm(1), arpakuutio()
{
std::cout << "oletus-rakentaja aktivoitu:" << noppa1 << std::endl;
}
noppa::noppa(int noppaLkm) : noppa1(0), noppaLkm(noppaLkm), arpakuutio()
{
std::cout << "Parametrinen rakentaja aktivoitu" << std::endl;
if (noppaLkm <= MAX_NOPPIEN_LUKU) {
noppaLkm = noppaLkm;
}
else {
std::cout << "Liian suuri tai pieni noppien lukumaaara." << std::endl;
setNoppienLkm();
}
}
void noppa::setNoppienLkm()
{
bool test = false;
do {
test = false;
std::cout << "Kuinka montaa noppaa haluat kayttaa (1-5)?: ";
std::cin >> noppaLkm;
if (std::cin.fail() || noppaLkm < 1 || noppaLkm > 5) {
test = true;
std::cout << "syotit liian suuren/pienen arvon tai kirjaimia, syota uudelleen." << std::endl;
std::cin.clear();
std::cin.ignore(20, '\n');
}
else {}
} while (test);
}
int noppa::getNoppienLkm() const
{
return noppaLkm;
}
void noppa::heitaNoppaa()
{
// pieni testikokeilun tynkää saada rand-funkiosta enemmän satunnainen. kokeilin alustaa noppa1 systeemin kellonajan mikrosekunneista ennen rand-funktiota.
// noppa1 = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
// std::cout << "Systeemin kellonajan mikrosekunnit ajon aikana:\t" << noppa1 << std::endl;
srand(time(nullptr));
noppa1 = rand() % 6 + 1;
for (int i = 0; i < noppaLkm; i++) {
arpakuutio[i] = rand() % 6 + 1;
}
}
int noppa::getViimeisinLukema() const
{
return noppa1;
}
void noppa::kerroViimeisenHeitonLukema()
{
// std::cout << "Viimeisimmän nopan heiton lukema oli:\t" << noppa1 << std::endl;
std::cout << "Noppien lukemat olivat seuraavat:" << std::endl;
for (int i = 0; i < noppaLkm; i++) {
std::cout << "Noppa " << i + 1 << " : " << arpakuutio[i] << std::endl;
}
std::cout << "Viimeisen heiton yhteislukema oli: ";
for (int i = 0; i < (noppaLkm - 1); i++) {
arpakuutio[0] += arpakuutio[i + 1];
}
std::cout << arpakuutio[0] << ". Heitossa kaytettiin " << noppaLkm << " noppaa." << std::endl<<std::endl;
}
|
338e0f4460c9fc20911586d31c2b072b7ff741b0 | 10628747bc5b24614955c69f74419ae2afd925ae | /SonicProject/stdafx.h | 048ba0644fca8b7f5d5b044183e7c4877c842c1d | [] | no_license | snrkgotdj/Sonic_Project | 136fb7d96bc545650fd7b2c8235382aa13f85995 | 031f5c1ad55bdeaf09cb3d7c8cd406bf52f3cfb8 | refs/heads/master | 2020-04-08T14:05:04.015559 | 2018-11-28T00:57:24 | 2018-11-28T00:57:24 | 159,421,287 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,027 | h | stdafx.h | // stdafx.h : 자주 사용하지만 자주 변경되지는 않는
// 표준 시스템 포함 파일 또는 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _AFXDLL
#include <afxdlgs.h>
// C 런타임 헤더 파일입니다.
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#define _USE_MATH_DEFINES
#include <cmath>
// TODO: 프로그램에 필요한 추가 헤더는 여기에서 참조합니다.
#include "define.h"
#include <list>
#include <vector>
#include <map>
#include <WinGdi.h>
#include <assert.h>
#include <random>
using namespace std;
// sound mgr 용도 - 헤더 순서 중요
#include <mmsystem.h>
#include <dsound.h>
#include <dinput.h>
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "dsound.lib")
#pragma comment(lib, "Msimg32.lib")
//video
#include <Vfw.h>
#pragma comment(lib, "vfw32.lib")
|
40ffcad14d60abab8452d9ff7b9a9cc7469d8851 | 65835ff10b352b64ad7d2e3a176c3d3961491d68 | /src/bluetooth/BluetoothListener.h | ee1afb15b1c8c1cfc8da29a427189424960dea70 | [
"BSD-3-Clause"
] | permissive | jalowiczor/gateway | e86a389aad39f7f0672c1e7261b5c1d017338033 | 612a08d6154e8768dfd30f1e1f00de1bfcad090f | refs/heads/master | 2020-03-22T21:58:38.971896 | 2018-03-29T14:46:22 | 2018-03-29T14:46:22 | 140,725,706 | 0 | 0 | BSD-3-Clause | 2018-07-12T14:38:41 | 2018-07-12T14:38:40 | null | UTF-8 | C++ | false | false | 319 | h | BluetoothListener.h | #ifndef BEEEON_BLUETOOTH_LISTENER_H
#define BEEEON_BLUETOOTH_LISTENER_H
#include <Poco/SharedPtr.h>
namespace BeeeOn {
class HciInfo;
class BluetoothListener {
public:
typedef Poco::SharedPtr<BluetoothListener> Ptr;
virtual ~BluetoothListener();
virtual void onHciStats(const HciInfo &info) = 0;
};
}
#endif
|
ff5d56222f1256cc0180b3fb9c514e8cfc16bcb6 | f3acd4152dbed79e8e90fc3a766a93a2a64d70b7 | /troll.cc | fe4e0bd20a8d5b157662840a1b03a2d1df901881 | [] | no_license | w329li/cc3k | 0bf3f821f617eddaa1061da8e57b50fa0692a62c | 87bda10368b90babec1f7adac252826c202dae77 | refs/heads/master | 2021-07-05T16:42:34.024185 | 2017-09-24T22:48:22 | 2017-09-24T22:48:22 | 104,681,222 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 148 | cc | troll.cc | #include <iostream>
#include <string>
#include "troll.h"
using namespace std;
Troll::Troll():
Player(120,25,15,"Troll") {}
Troll::~Troll() {}
|
6785a3249c0425560eb7ec8d92db719c61456acb | 3894c1c0a265dfa91e114ff4df12236454efdb2c | /LeetCode/iter1/c++/633.sum-of-square-numbers.cpp | fde10a819723919a1a8fbb8563408b49537a60e1 | [] | no_license | jonathenzc/Algorithm | d770802337a8f4f36b94e42722d4d1954b45f408 | f6b3d1a3f987dd3f38aa38c6de4b37caef0880bc | refs/heads/master | 2020-04-04T00:16:38.780515 | 2020-03-12T16:10:43 | 2020-03-12T16:10:43 | 33,028,640 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 933 | cpp | 633.sum-of-square-numbers.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <queue>
#include <stack>
using namespace std;
class Solution {
public:
bool judgeSquareSum(int c) {
int upperBound = sqrt(c);
unordered_set<int> set;
for (int i = 0; i <= upperBound; i++) {
int iSquare = i*i;
set.insert(iSquare);
if (set.count(c-iSquare) > 0) {
return true;
}
}
return false;
}
};
int main()
{
Solution solution;
cout << (solution.judgeSquareSum(2) ? "true\n" : "false\n");
cout << (solution.judgeSquareSum(4) ? "true\n" : "false\n");
cout << (solution.judgeSquareSum(5) ? "true\n" : "false\n");
cout << (solution.judgeSquareSum(9) ? "true\n" : "false\n");
cout << (solution.judgeSquareSum(147) ? "true\n" : "false\n");
cout << (solution.judgeSquareSum(2147482647) ? "true\n" : "false\n");
return 0;
} |
af2d01fa40a27c93ba8fc259de89277fc43c55d6 | 7f67919b5f5e087e8a26eacd8d5d1c1f94224cc6 | /src/backends/cl/workloads/ClPreluWorkload.hpp | abc77708b918dbb08a4b5e6d679fb52060cd8782 | [
"BSD-3-Clause",
"CC0-1.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ARM-software/armnn | 11f0b169291ade6a08cbef1e87b32000aeed4767 | 49f609d9e633f52fcdc98e6e06178e618597e87d | refs/heads/branches/armnn_23_05 | 2023-09-04T07:02:43.218253 | 2023-05-15T10:24:43 | 2023-05-15T16:08:53 | 124,536,178 | 1,053 | 329 | MIT | 2023-05-22T23:28:55 | 2018-03-09T12:11:48 | C++ | UTF-8 | C++ | false | false | 821 | hpp | ClPreluWorkload.hpp | //
// Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include "ClBaseWorkload.hpp"
#include <arm_compute/runtime/CL/functions/CLPReluLayer.h>
namespace armnn
{
arm_compute::Status ClPreluWorkloadValidate(const TensorInfo& input,
const TensorInfo& alpha,
const TensorInfo& output);
class ClPreluWorkload : public ClBaseWorkload<PreluQueueDescriptor>
{
public:
ClPreluWorkload(const PreluQueueDescriptor& descriptor,
const WorkloadInfo& info,
const arm_compute::CLCompileContext& clCompileContext);
void Execute() const override;
private:
mutable arm_compute::CLPReluLayer m_PreluLayer;
};
} //namespace armnn
|
fc6fc905c8d3a311b2daa997061ee248a24fe43b | 78d31f7946dac510ef230316d1a174275b06b4c6 | /Lobelia/Common/Utility/ResourceBank/ResourceBank.inl | 741663637e344690652d08bbe496a9210dacf7b3 | [] | no_license | LobeliaSnow/LobeliaEngine | 10b25746b3d02fdb9c26286e15124f7fd7b764ba | 8121e83998da656a047cc14eb6bd029ae8c2d63d | refs/heads/master | 2021-05-02T17:27:55.403882 | 2018-07-29T17:40:53 | 2018-07-29T17:40:53 | 120,646,038 | 1 | 0 | null | null | null | null | IBM852 | C++ | false | false | 1,508 | inl | ResourceBank.inl | namespace Lobelia {
template<class T, class Key> __forceinline ResourceBank<T, Key>::ResourceBank()noexcept = default;
template<class T, class Key> __forceinline ResourceBank<T, Key>::~ResourceBank()noexcept = default;
template<class T, class Key> template<class U, class... Args> __forceinline T* ResourceBank<T, Key>::Factory(Key key, Args&&... args) {
try {
if (IsExist(key)) return resource[key].get();
resource[key] = std::make_shared<U>(std::forward<Args>(args)...);
return resource[key].get();
}
catch (...) {
throw;
}
}
template<class T, class Key> __forceinline void ResourceBank<T, Key>::Register(Key key, std::shared_ptr<T> p)noexcept { if (!IsExist(key)) resource[key].swap(p); }
template<class T, class Key> __forceinline bool ResourceBank<T, Key>::IsExist(Key key) noexcept { return ((resource.find(key) != resource.end()) && (resource[key].use_count() != 0)); }
template<class T, class Key> __forceinline void ResourceBank<T, Key>::Clear() noexcept { resource.clear(); }
template<class T, class Key> __forceinline T* ResourceBank<T, Key>::Get(Key key) noexcept { return resource[key].get(); }
template<class T, class Key> __forceinline std::map<Key, std::shared_ptr<T>>& ResourceBank<T, Key>::Get()noexcept { return resource; }
template<class T, class Key> __forceinline void ResourceBank<T, Key>::Erase(Key key)noexcept { resource.erase(key); }
//staticĽ¤Éö
template<class T, class Key> std::map<Key, std::shared_ptr<T>> ResourceBank<T, Key>::resource;
} |
09be90ff5a5818599916f3b555ceff6b0776b00c | 8f3df24b317f9ebf87501e135b46c978f2e61fc9 | /code/szen/src/Game/Components/Animation.cpp | 566293215c00b044d0474612b60f7a4338187442 | [
"BSD-3-Clause"
] | permissive | Sonaza/scyori | 3cac16527094babf1919311630728b8c017adb82 | a894a9c7bd45a68ea1b6ff14877cdbe47ddd39cf | refs/heads/master | 2021-01-17T16:48:07.266567 | 2019-07-19T06:57:30 | 2019-07-19T06:57:30 | 9,025,008 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,400 | cpp | Animation.cpp | #include <szen/Game/Components/Animation.hpp>
#include <szen/Game/Components/Renderer.hpp>
using namespace sz;
////////////////////////////////////////////////////
Animation::Animation(sf::Vector2u framesize) :
m_frameID (0),
m_framesPerRow (0),
m_framesize (framesize),
m_playState (Stopped),
p_renderer (NULL)
{
m_componentOrder = 15;
}
////////////////////////////////////////////////////
Animation::~Animation()
{
}
////////////////////////////////////////////////////
AnimationSequence::AnimationSequence() :
start (0),
end (0),
frametime (0),
looping (false)
{
}
////////////////////////////////////////////////////
AnimationSequence::AnimationSequence(int32 start, int32 end, int32 frametime) :
start (start),
end (end),
frametime (frametime),
looping (false)
{
}
////////////////////////////////////////////////////
void Animation::attached()
{
p_renderer = m_entity->getComponent<Renderer>();
if(!p_renderer)
{
szerr << "Animation component depends on renderer component." << ErrorStream::error;
}
if(p_renderer->getTextureSize().x % m_framesize.x == 0)
{
m_framesPerRow = p_renderer->getTextureSize().x / m_framesize.x;
p_renderer->setTextureRect(sf::IntRect(0, 0, m_framesize.x, m_framesize.y));
//p_renderer->m_sprite->setTextureRect(sf::IntRect(0, 0, m_framesize.x, m_framesize.y));
//p_renderer->m_sprite->setOrigin(m_framesize.x / 2.f, m_framesize.y / 2.f);
}
}
////////////////////////////////////////////////////
void Animation::parsePrefab(json::Value& val)
{
if(val.isMember("sequences") && !val["sequences"].empty())
{
json::Value sequences = val["sequences"];
for(json::Value::iterator it = sequences.begin(); it != sequences.end(); ++it)
{
if(!(*it).isMember("start") || !(*it).isMember("end") || !(*it).isMember("fps"))
{
szerr << "Animation sequence definition must have start and end frame and fps value." << ErrorStream::error;
continue;
}
sf::Uint32 start = (*it)["start"].asUInt();
sf::Uint32 end = (*it)["end"].asUInt();
sf::Uint32 fps = (*it)["fps"].asUInt();
bool looping = (*it).get("looping", 0).asBool();
std::string next = (*it).get("next", "").asString();
defineAnimation(it.memberName(), start, end, fps, looping, next);
}
}
if(val.isMember("autoplay"))
{
if(val["autoplay"].isString())
{
play(val["autoplay"].asString());
}
}
}
////////////////////////////////////////////////////
float Animation::getCurrentFPS()
{
return m_currentSequence.frametime > 0 ? 1000.f / (float)m_currentSequence.frametime : 0.f;
}
////////////////////////////////////////////////////
bool Animation::isPlaying()
{
return m_playState == Playing;
}
////////////////////////////////////////////////////
bool Animation::isPaused()
{
return m_playState == Paused;
}
////////////////////////////////////////////////////
bool Animation::isStopped()
{
return m_playState == Stopped;
}
////////////////////////////////////////////////////
void Animation::setCurrentFrame(int32 frame)
{
m_frameID = frame;
updateRegion();
}
////////////////////////////////////////////////////
int32 Animation::getCurrentFrame()
{
return m_frameID;
}
////////////////////////////////////////////////////
void Animation::update()
{
if(m_playState == Playing)
{
// Advance frames if it's the time
if(m_frametimer.getElapsedTime().asMilliseconds() >= m_currentSequence.frametime)
{
m_frameID += 1;
// Check if animation has reached the end
if(m_frameID > m_currentSequence.end)
{
// Check for looping
if(m_currentSequence.looping)
{
m_frameID = m_currentSequence.start;
}
else
{
// No looping but is there a next animation?
if(!m_currentSequence.nextAnimation.empty())
{
play(m_currentSequence.nextAnimation);
}
else
{
m_frameID = m_currentSequence.end;
// Okay, animation can be stopped
m_playState = Stopped;
}
}
}
m_frametimer.restart();
}
}
updateRegion();
}
////////////////////////////////////////////////////
void Animation::updateRegion()
{
// Calculate texture region offsets
sf::Vector2i grid(
m_frameID % m_framesPerRow,
(int)(m_frameID / static_cast<float>(m_framesPerRow))
);
sf::IntRect region(
grid.x * m_framesize.x, grid.y * m_framesize.y,
m_framesize.x, m_framesize.y
);
p_renderer->setTextureRect(region);
}
////////////////////////////////////////////////////
void Animation::play()
{
if(m_playState == Stopped)
{
m_frameID = m_currentSequence.start;
m_frametimer.restart();
}
else if(m_playState == Paused)
{
m_frametimer.resume();
}
m_playState = Playing;
}
////////////////////////////////////////////////////
void Animation::play(int32 start, int32 end, int32 fps)
{
assert(fps != 0);
m_playState = Playing;
m_frameID = start;
// Update current sequence
// We don't care if we lose a bit of precision by not doing float division
m_currentSequence = AnimationSequence(start, end, 1000 / fps);
m_frametimer.restart();
m_animationTag.clear();
}
////////////////////////////////////////////////////
void Animation::play(const std::string &sequence)
{
assert(!sequence.empty());
assert(!m_animations.empty());
SequenceList::iterator anim = m_animations.find(sequence);
if(anim != m_animations.end())
{
m_playState = Playing;
m_currentSequence = anim->second;
m_frameID = m_currentSequence.start;
m_frametimer.restart();
m_animationTag = sequence;
}
else
{
szerr << "Playing undefined animation: " << sequence << ErrorStream::error;
}
}
////////////////////////////////////////////////////
void Animation::pause()
{
m_playState = Paused;
m_frametimer.pause();
}
////////////////////////////////////////////////////
void Animation::stop()
{
m_playState = Stopped;
}
////////////////////////////////////////////////////
void Animation::defineAnimation(const std::string &tag, int32 start, int32 end, int32 fps, bool looping, const std::string &nextAnimation)
{
AnimationSequence animation;
animation.start = start;
animation.end = end;
animation.frametime = 1000 / fps;
animation.looping = looping;
animation.nextAnimation = nextAnimation;
m_animations.insert(std::make_pair(tag, animation));
}
////////////////////////////////////////////////////
std::string Animation::getAnimationTag()
{
return !isStopped() ? m_animationTag : "";
} |
d512799a74fc7c0b16a2eee1cb685cffe713afe1 | cc256899289f47aeab6c12a2ff22d0f22c07f164 | /src/subsys/factories/ClimberFactory.cpp | 64f40ad1f048579c33440580280be84ea5940de8 | [
"MIT"
] | permissive | Team302/2017Steamworks | 2bb1fa1ee5cd63b12b5523e1ec5424e348965e0b | 757a5332c47dd007482e30ee067852d13582ba39 | refs/heads/master | 2020-03-28T00:17:11.641666 | 2018-09-13T03:57:44 | 2018-09-13T03:57:44 | 147,391,522 | 0 | 0 | MIT | 2018-09-13T03:57:45 | 2018-09-04T18:35:13 | C++ | UTF-8 | C++ | false | false | 2,592 | cpp | ClimberFactory.cpp | /*
* ClimberFactory.cpp
*
* Created on: Jan 12, 2017
* Author: Tumtu
*/
//Team 302 includes
#include <subsys/factories/ClimberFactory.h> // This Class
#include <RobotDefn.h>
#include <subsys/CompBot/CompBotClimber.h>
#include <subsys/interfaces/IClimber.h>
#include <subsys/SWBot/SWBotClimber.h>
#include <subsys/EightyBot/EightyClimber.h>
#include <SmartDashboard/SmartDashboard.h>
namespace Team302
{
ClimberFactory* ClimberFactory::m_instance = nullptr;//Init the instance to nullptr
//----------------------------------------------------------------------------------
// Method: GetInstance
// Description: If there isn't an instance of desired ClimberFactory class, create it.
// Otherwise, hand out the single instance.
// Returns: ClimberFactory* Climber factory
//----------------------------------------------------------------------------------
ClimberFactory* ClimberFactory::GetInstance()
{
if (ClimberFactory::m_instance == nullptr)
{
ClimberFactory::m_instance = new ClimberFactory();
}
return ClimberFactory::m_instance;
}
//--------------------------------------------------------------------
// Method: ClimberFactory <<constructor>>
// Description: This method creates and initializes the objects
//--------------------------------------------------------------------
ClimberFactory::ClimberFactory() : m_climber(nullptr) //Constructor
{
}
//--------------------------------------------------------------------
// Method: ~ClimberFactory <<destructor>>
// Description: This method cleans up when the object gets deleted
//--------------------------------------------------------------------
ClimberFactory::~ClimberFactory() //Destructor
{
ClimberFactory::m_instance = nullptr;
}
//----------------------------------------------------------------------------------
// Method: GetIClimber
// Description: If there isn't an instance of desired IClimber class, create it.
// Otherwise, hand out the single instance.
// Returns: IClimber* Climber class
//----------------------------------------------------------------------------------
IClimber* ClimberFactory::GetIClimber()
{
if (m_climber == nullptr)
{
switch (ROBOT_CONFIGURATION)
{
case SOFTWARE_BOT:
m_climber = new SWBotClimber();
break;
case COMP_BOT:
m_climber = new CompBotClimber();
break;
case EIGHTY_BOT:
m_climber = new EightyClimber();
break;
default:
SmartDashboard::PutString( "Climber Factory ", "Failed " );
break;
}
}
return m_climber;
}
} /* namespace Team302 */
|
eaea82720a3f2521ecc9fb935e712a37faf4ea45 | 22efccb00473119295dc665039f1ff7500f1991b | /src/momentum_equation/not_used/fold_momentum_matrix.cpp | 701b7a2f1147b140f6a88c1ec6a65cfb0b98f23c | [] | no_license | chennipman/MCLS | 7fc62b6920901a2cbb3eb60e6863bb743e87ebca | ae7e89e707cce7b525621d580ea7375c617ca5a8 | refs/heads/master | 2021-01-10T18:51:45.993314 | 2014-08-29T18:07:28 | 2014-08-29T18:07:28 | 16,737,066 | 1 | 0 | null | 2014-08-05T12:49:52 | 2014-02-11T16:27:17 | C++ | UTF-8 | C++ | false | false | 1,098 | cpp | fold_momentum_matrix.cpp |
/********************************************************************************/
/* Function to include the boundary conditions into the momentum equation */
/* conditions */
/* */
/* Programmer : Duncan van der Heul */
/* Date : 10-03-2013 */
/* Update : */
/********************************************************************************/
/* Notes */
/* In the current implementation the generation of the matrix, right-hand-side */
/* and the application of the boundary conditions is completely separated. */
/* In the current function the matrix is build WITHOUT considering the */
/* boundary conditions. Next the boundary conditions are considered in a */
/* separate 'matrix folding' function that eliminates all known values and */
/* discards any reference to virtual values. */
/********************************************************************************/
/* boundary condition type */
/* Loop over the six faces */
/* determine the |
2232bd56d8c7ba1f1a33a6066bbffe27c13ca395 | e50647617df5e997ee56859602677655b24b51a7 | /snake/snake/snake.ino | 289cb4466d78bae1ceebbcb7a7fc294819935883 | [] | no_license | ryandeng32/arduino_projects | 412a5cd87c10de0e5e5e555e39775d95c8150fc3 | 5398b0caa74b14b0bf80100c57969d213c4808e6 | refs/heads/master | 2020-06-25T07:32:06.885556 | 2019-07-28T10:46:31 | 2019-07-28T10:46:31 | 199,246,568 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,562 | ino | snake.ino | #include <LCD5110_Graph.h>
LCD5110 myGLCD(2, 3, 4, 5, 6);
int snakeX = 20;
int snakeY = 20;
int buttonLeft = 12;
int buttonRight = 9;
int buttonUp = 11;
int buttonDown = 10;
int buttonLeftState = 0;
int buttonRightState = 0;
int buttonUpState = 0;
int buttonDownState = 0;
int dir = 1;// 1: up, 2: down, 3: left, 4: right
int snakeLen = 1;
int snakeWidth = 3;
int snakeXArray[50];
int snakeYArray[50];
int foodX, foodY;
void setup() {
// put your setup code here, to run once:
myGLCD.InitLCD();
pinMode(buttonLeft, INPUT);
pinMode(buttonRight, INPUT);
pinMode(buttonUp, INPUT);
pinMode(buttonDown, INPUT);
Serial.begin(9600);
snakeXArray[0] = snakeX;
snakeYArray[0] = snakeY;
generateFood();
}
void generateFood(){
foodX = random(1,83);
foodY = random(1,47);
}
void displaySnake() {
for (int i = 0; i < snakeLen; i++)
{
myGLCD.drawRect(snakeXArray[i], snakeYArray[i], snakeXArray[i] + snakeWidth - 1, snakeYArray[i]+snakeWidth - 1);
}
}
void eatFood() {
if (abs(snakeX - foodX) <= 1 && abs(snakeY - foodY) <= 1){
snakeLen += 1;
generateFood();
}
}
int moveUp(int obj, int unit) {
obj -= unit;
return obj;
}
int moveDown(int obj,int unit) {
obj += unit;
return obj;
}
int moveLeft(int obj, int unit) {
obj -= unit;
return obj;
}
int moveRight(int obj, int unit) {
obj += unit;
return obj;
}
void loop() {
// put your main code here, to run repeatedly:
myGLCD.clrScr();
displaySnake();
buttonLeftState = digitalRead(buttonLeft);
buttonRightState = digitalRead(buttonRight);
buttonUpState = digitalRead(buttonUp);
buttonDownState = digitalRead(buttonDown);
if (buttonLeftState == HIGH) {
dir = 3;
}
else if (buttonRightState == HIGH) {
dir = 4;
}
else if (buttonUpState == HIGH) {
dir = 1;
}
else if (buttonDownState == HIGH) {
dir = 2;
}
switch (dir) {
case 1:
snakeY = moveUp(snakeY, snakeWidth - 1);
break;
case 2:
snakeY = moveDown(snakeY, snakeWidth - 1);
break;
case 3:
snakeX = moveLeft(snakeX, snakeWidth - 1);
break;
case 4:
snakeX = moveRight(snakeX, snakeWidth - 1);
break;
}
for (int i = 49; i > 0; i--)
{
snakeXArray[i] = snakeXArray[i-1];
snakeYArray[i] = snakeYArray[i-1];
}
snakeXArray[0] = snakeX;
snakeYArray[0] = snakeY;
eatFood();
myGLCD.drawCircle(foodX, foodY, 1);
delay(90);
myGLCD.update();
}
|
b529c6f549bc553542eb498be456b9df205af4db | aa5bde78ca59672ec5f7953100a511f14dc23716 | /xdbd-sql-parser/sql_tables_part.cpp | d0006a688286bdd8e620c66c825d7675be70c3ab | [] | no_license | miranvodnik/xdbd | 5dbb530a7db3b8575cbe87e37bbe90e2a7b5bced | ae4ab6bb53b11c307951c6b9c67bbfa59cb42c5c | refs/heads/main | 2023-04-03T18:51:18.963054 | 2021-04-18T14:36:21 | 2021-04-18T14:36:21 | 358,135,606 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,217 | cpp | sql_tables_part.cpp | #include "SqlCompilerCallbacks.h"
#include "sql_tables_part.h"
sql_tables_part::sql_tables_part (sql_tables* c_sql_tables) : SqlSyntax (1, sql_tables_part_Context)
{
_init ();
m_sql_tables = c_sql_tables;
}
sql_tables_part::~sql_tables_part ()
{
delete m_sql_tables;
_init ();
}
void sql_tables_part::_init ()
{
m_sql_tables = 0;
}
void sql_tables_part::Traverse (void* parseCtx)
{
unsigned int kind = this->kind();
((SqlCompilerCallbacks*)parseCtx)->Invoke_sql_tables_part_Callback (TraversalPrologueCallbackReason, kind, this);
((SqlCompilerCallbacks*)parseCtx)->push(this);
switch (kind)
{
case g_sql_tables_part_1:
m_sql_tables->Traverse (parseCtx);
break;
}
((SqlCompilerCallbacks*)parseCtx)->pop();
((SqlCompilerCallbacks*)parseCtx)->Invoke_sql_tables_part_Callback (TraversalEpilogueCallbackReason, kind, this);
}
extern "C"
{
void* sql_tables_part_1 (void* parseCtx, void* c_sql_tables)
{
sql_tables_part* p_sql_tables_part = new sql_tables_part ((sql_tables*)c_sql_tables);
((sql_tables*)c_sql_tables)->parent (p_sql_tables_part);
((SqlCompilerCallbacks*) parseCtx)->Invoke_sql_tables_part_Callback (DefaultCallbackReason, 1, p_sql_tables_part);
return p_sql_tables_part;
}
}
|
1eb2918506d43c488904ce12209b30f5ca0e72e3 | faf43bedc11c31f76a474f1463e3a4d39b867f3b | /Paradigmas/equationUva11565.cpp | 6aafdf91493fd83a5353506de243415b42affbaf | [] | no_license | AlexandreCordaJunior/URI | 4638582e90c2c123ed69966068f4d8362d12ef2b | be2cf7427d2cbdda162ffb3321da7fa88d1841b4 | refs/heads/master | 2020-09-27T14:37:02.784218 | 2020-03-08T01:08:34 | 2020-03-08T01:08:34 | 226,538,786 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 457 | cpp | equationUva11565.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
bool sol = false;
for(int x = -100; x <= 100; x++){
for(int y = -100; y <= 100; y++){
for(int z = -100; z <= 100; z++){
if(x != y && x != z && y != z){
if(x + y + z == a && x * y * z == b && (x * x) + (y * y) + (z * z) == c){
if(!sol){
printf("%d %d %d\n", x, y, z);
sol = true;
}
}
}
}
}
}
} |
d37adaa984d01a92e648901ad9166c00c1898af1 | 777713d22368076710db7a008b791625b79bddae | /Hrbust_OJ/1928.cpp | 748013ab0cf14501ba8ac4a64a64fb048b5d6804 | [] | no_license | jelech/To_Be_ACMer | bcf468a5245b67f0d3d3604d2e867388fb21a5ee | 626d289ff76b013f2cb84bc2d5290c8d76182214 | refs/heads/master | 2021-04-06T00:28:24.653734 | 2019-10-14T12:00:52 | 2019-10-14T12:00:52 | 124,747,546 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | cpp | 1928.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main(int argc, char const *argv[])
{
// int a[51] = {0};
int n;
while(cin >> n)
{
int hst = 0;
for (int i = 1; i <= n; ++i)
{
for (int j = 1; j <= n; ++j)
{
for (int k = 1; k <= n; ++k)
{
if ((i+j+k)>hst && ((i+j)%2 ==0 && (j+k)%3 ==0 && (i+j+k)%5 == 0))
{
hst = i+j+k;
}
}
}
}
if(hst){
printf("%d\n", hst);
continue;
}
printf("Impossible\n");
}
return 0;
} |
603dd2e15c605f39ddbcc1f4885be3078a342f2e | d4a6eaa42b550136245801c37dfd97c264ac627a | /43/A/main.cpp | e8b745138befa296a78ec945deb82c9bae49e571 | [] | no_license | dburl/Codeforces | fb6f901949403a3289fa888729a0bf110780a1c4 | d18c1c667a0d3efacf70cc47f9bbad4d588561c3 | refs/heads/master | 2021-04-29T11:16:14.333654 | 2017-03-10T22:26:05 | 2017-03-10T22:26:05 | 77,853,332 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 389 | cpp | main.cpp | #include <iostream>
#include <map>
using namespace std;
int main(){
int n=0;
cin>>n;
map<string,int> m;
for (int i=0;i<n;++i){
string tmp;
cin>>tmp;
if(!(m.insert(make_pair(tmp,1)).second)){
m[tmp]+=1;
}
}
//
if (m.size()>1 && m.begin()->second < (++m.begin())->second){
cout<<(++m.begin())->first<<endl;
} else {
cout<<m.begin()->first<<endl;
}
return 0;
}
|
29ccaf4a95e857c2fc48ace4ef9c978a4f838244 | 88d9d32203be63b9585d6158ac828590c8bb0000 | /PreCalPhi.cpp | 5a1fd000b8bcbe51f2d897783bef5c0e69b3d64d | [] | no_license | dyrroth-11/CP-Templates | f8f34332ffba6666680816ae0e2511558dc8a1e5 | 6e53cbcae52ce3dd08c6276054d7efd9860ca40c | refs/heads/master | 2022-12-04T11:18:36.240241 | 2020-08-19T15:14:17 | 2020-08-19T15:14:17 | 283,750,500 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 384 | cpp | PreCalPhi.cpp | long long phi[MAX], result[MAX];
void computeTotient()
{
phi[1] = 1;
for (int i=2; i<MAX; i++)
{
if (!phi[i])
{
phi[i] = i-1;
for (int j = (i<<1); j<MAX; j+=i)
{
if (!phi[j])
phi[j] = j;
phi[j] = (phi[j]/i)*(i-1);
}
}
}
} |
0899e932cab8af598d0e991cbf0f40fc56c248e8 | def993d87717cd42a9090a17d9c1df5648e924ce | /src/IECorePython/CompoundParameterBinding.cpp | 2088e60f8b5f19bb2fc62357e12d65843b3ee653 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | ImageEngine/cortex | 688388296aad2b36dd0bfb7da7b25dcbdc7bd856 | 6eec66f5dccfd50dda247b04453bce65abc595eb | refs/heads/main | 2023-09-05T07:01:13.679207 | 2023-08-17T23:14:41 | 2023-08-17T23:14:41 | 10,654,465 | 439 | 104 | NOASSERTION | 2023-09-14T11:30:41 | 2013-06-12T23:12:28 | C++ | UTF-8 | C++ | false | false | 6,794 | cpp | CompoundParameterBinding.cpp | //////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of Image Engine Design nor the names of any
// other contributors to this software 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.
//
//////////////////////////////////////////////////////////////////////////
#include "boost/python.hpp"
#include "IECorePython/CompoundParameterBinding.h"
#include "IECorePython/ParameterBinding.h"
#include "IECore/CompoundObject.h"
#include "IECore/CompoundParameter.h"
#include "boost/python/suite/indexing/container_utils.hpp"
using namespace boost;
using namespace boost::python;
using namespace IECore;
using namespace IECorePython;
namespace
{
class CompoundParameterWrapper : public ParameterWrapper< CompoundParameter >
{
public:
IE_CORE_DECLAREMEMBERPTR( CompoundParameterWrapper );
CompoundParameterWrapper( PyObject *wrapperSelf, const std::string &name = "", const std::string &description = "", const list &members = list(), CompoundObjectPtr userData = nullptr, bool adoptChildPresets = true )
: ParameterWrapper< CompoundParameter >( wrapperSelf, name, description, userData, adoptChildPresets )
{
addParametersFromMembers( members );
}
protected:
void addParametersFromMembers( const object &members )
{
for( int i=0; i<members.attr("__len__")(); i++ )
{
object o = members[i];
Parameter &p = extract<Parameter &>( o );
this->addParameter( &p );
}
}
};
static unsigned int compoundParameterLen( const CompoundParameter &o )
{
return o.parameters().size();
}
static ParameterPtr compoundParameterGetItem( CompoundParameter &o, const char *n )
{
const CompoundParameter::ParameterMap &p = o.parameters();
CompoundParameter::ParameterMap::const_iterator it = p.find( n );
if( it!=p.end() )
{
return it->second;
}
throw Exception( std::string("Bad index: ") + n );
}
static bool compoundParameterContains( const CompoundParameter &o, const std::string &n )
{
const CompoundParameter::ParameterMap &map = o.parameters();
return map.find( n ) != map.end();
}
static boost::python::list compoundParameterKeys( const CompoundParameter &o )
{
boost::python::list result;
CompoundParameter::ParameterVector::const_iterator it;
for( it = o.orderedParameters().begin(); it!=o.orderedParameters().end(); it++ )
{
result.append( (*it)->name() );
}
return result;
}
static boost::python::list compoundParameterValues( const CompoundParameter &o )
{
boost::python::list result;
CompoundParameter::ParameterVector::const_iterator it;
for( it = o.orderedParameters().begin(); it!=o.orderedParameters().end(); it++ )
{
result.append( *it );
}
return result;
}
static boost::python::list compoundParameterItems( const CompoundParameter &o )
{
boost::python::list result;
CompoundParameter::ParameterVector::const_iterator it;
for( it = o.orderedParameters().begin(); it!=o.orderedParameters().end(); it++ )
{
result.append( boost::python::make_tuple( (*it)->name(), *it ) );
}
return result;
}
static void compoundParameterAddParameters( CompoundParameter &o, const boost::python::list &p )
{
int listLen = boost::python::len(p);
for( int i=0; i<listLen; i++ )
{
object m = p[i];
Parameter &extractedP = extract<Parameter &>( m );
o.addParameter( &extractedP );
}
}
static ParameterPtr parameter( CompoundParameter &o, const char *name )
{
return o.parameter<Parameter>( name );
}
static boost::python::list parameterPath( CompoundParameter &o, ConstParameterPtr child )
{
std::vector<std::string> p;
o.parameterPath( child.get(), p );
boost::python::list result;
for( std::vector<std::string>::const_iterator it=p.begin(); it!=p.end(); it++ )
{
result.append( *it );
}
return result;
}
} // namespace
namespace IECorePython
{
void bindCompoundParameter()
{
using boost::python::arg ;
ParameterClass<CompoundParameter, CompoundParameterWrapper>()
.def(
init< const std::string &, const std::string &, boost::python::optional<const list &, CompoundObjectPtr, bool > >
(
(
arg( "name" ) = std::string(""),
arg( "description" ) = std::string(""),
arg( "members" ) = list(),
arg( "userData" ) = CompoundObject::Ptr( nullptr ),
arg( "adoptChildPresets" ) = true
)
)
)
.def( "__len__", &compoundParameterLen )
.def( "__getitem__", &compoundParameterGetItem )
.def( "__delitem__", (void (CompoundParameter::*)(const std::string&)) &CompoundParameter::removeParameter )
.def( "__contains__", &compoundParameterContains )
.def( "keys", &compoundParameterKeys )
.def( "values", &compoundParameterValues )
.def( "items", &compoundParameterItems )
.def( "has_key", &compoundParameterContains )
.def( "addParameter", &CompoundParameter::addParameter )
.def( "addParameters", &compoundParameterAddParameters )
.def( "insertParameter", &CompoundParameter::insertParameter )
.def( "removeParameter", (void (CompoundParameter::*)(ParameterPtr)) &CompoundParameter::removeParameter )
.def( "removeParameter", (void (CompoundParameter::*)(const std::string&)) &CompoundParameter::removeParameter )
.def( "clearParameters", &CompoundParameter::clearParameters )
.def( "parameter", ¶meter )
.def( "parameterPath", ¶meterPath )
;
}
} // namespace IECorePython
|
5a13217f9ad215f8fa8306b5f09a69f058ade942 | 627cf1386b14c096d7e242c0918ebecc5df35920 | /ellipse.cpp | a1a2c82ec77af4d97450d9b7194e46944df4360b | [] | no_license | JiaweiLing/CGLab | 62885aab93a4123bca2e2bd0ca5664004841ac28 | 6395a508dfd1a1fe36b39d3825a4b73484bb9499 | refs/heads/master | 2020-03-09T10:05:36.213737 | 2018-06-25T13:30:01 | 2018-06-25T13:30:01 | 128,728,325 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,226 | cpp | ellipse.cpp | #include<cmath>
#include<cstdio>
#include "ellipse.h"
ellipse :: ellipse()
{
}
void ellipse :: FillPolygon(QPainter &painter)
{
}
void EllipsePlot(int xc, int yc, int x, int y, QPainter &painter)
{
painter.drawPoint(xc + x, yc + y);
painter.drawPoint(xc - x, yc + y);
painter.drawPoint(xc + x, yc - y);
painter.drawPoint(xc - x, yc - y);
}
void ellipse :: paint(QPainter &painter)
{
//设置画笔
painter.setPen(QColor(160, 160, 160));
painter.drawRect(start.x() - 2, start.y() - 2, 4, 4);
painter.drawRect(end.x() - 2, end.y() - 2, 4, 4);
//设置初始点
int x0 = start.x(), y0 = start.y();
int x1 = end.x(), y1 = end.y();
//计算椭圆中心以及半长轴和半短轴
int xc = (x0 + x1) / 2, yc = (y0 + y1) / 2;
int a = abs(x0 - x1) / 2, b = abs(y0 - y1) / 2;
int x = 0, y = b;
//EllipsePlot以(xc, yc)绘制四分椭圆
//EllipsePlot()利用三个对称性, 完成四个对称点的绘制
EllipsePlot(xc, yc, x, y, painter);
//计算区域1决策参数初值p1
double p1 = b * b - a * a * b + a * a / 4;
//循环
while (2 * b * b * x < 2 * a * a * y)
{
if (p1 < 0)
//若p1 < 0, 重新计算决策参数, 选择像素(x, y)
p1 = p1 + 2 * b * b * x + b * b;
else
{
//若p1 > 0, 重新计算决策参数, 选择像素(x, y - 1)
p1 = p1 + 2 * b * b * x - 2 * a * a * y + b * b;
y--;
}
x++;
//绘制四分圆
EllipsePlot(xc, yc, x, y, painter);
}
//double p2 = b * b * (x + 0.5) * (x + 0.5) + a * a * (y - 1) * (y - 1) - a * a * b * b;
//计算区域2决策参数初值p2
double p2 = 2 * (b * (x + 0.5) + a * (y - 1) - a * b);
//循环直至纵坐标为0
while (y != 0)
{
if (p2 < 0)
{
//若p2 < 0, 重新计算决策参数, 选择像素(x + 1, y)
p2 = p2 + 2 * b * b * x - 2 * a * a * y + a * a;
x++;
}
else
//若p2 > 0, 重新计算决策参数, 选择像素(x, y)
p2 = p2 - 2 * a * a * y + a * a;
y--;
//绘制四分圆
EllipsePlot(xc, yc, x, y, painter);
}
}
|
ae206e64b20b0cac9c2d2c3ee2985ba69e32d89e | 2e5e8b544848b26025ec25226385a44981aacc77 | /杂题与数学题/uva11715(数学题).cpp | 677a738028e0392883409de28494cbf0c37491f5 | [] | no_license | sadkangaroo/OI-2011-2012 | 1c5fba91d7495ffbe7f17393cd82cda2d528a701 | 3d1e77737e688bb58b5c98137cec4ac6b178b173 | refs/heads/master | 2021-01-02T08:47:51.176018 | 2013-06-12T03:41:42 | 2013-06-12T03:41:42 | 10,635,741 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 820 | cpp | uva11715(数学题).cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int o, cnt;
double a, b, c, tmp;
int main() {
cnt = 0;
while (scanf("%d", &o) && o) {
scanf("%lf%lf%lf", &a, &b, &c);
printf("Case %d: ", ++cnt);
switch (o) {
case 1 : printf("%.3lf %.3lf\n", (a + b) / 2 * c, (b - a) / c); break;
case 2 : printf("%.3lf %.3lf\n", (b * b - a * a) / 2 / c, (b - a) / c); break;
case 3 : tmp = sqrt(2 * b * c + a * a);
printf("%.3lf %.3lf\n", tmp, (tmp - a) / b); break;
case 4 : tmp = sqrt(a * a - 2 * b * c);
printf("%.3lf %.3lf\n", tmp, (a - tmp) / b); break;
}
}
return 0;
}
|
085d958d4054f485f7b78b7a93287281a74deb5b | 319109a80f11c2d3fdae10cf5d0f40ba088b16a4 | /CSC1180/t.cpp | 7801d0703aaba2660830dafe4fe3486c34ebdbb5 | [] | no_license | frazierde12/Sample-C-Code-for-Classes | 8e5911061ac66b10cbfa7ac28bc75129e8f8062a | 2770248d3e006dbfb8f0e3ab87e86a160c3f18fe | refs/heads/master | 2023-03-26T14:59:06.522285 | 2021-03-17T12:46:54 | 2021-03-17T12:46:54 | 348,702,241 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 272 | cpp | t.cpp | #include <iostream>
using namespace std;
template <typename T>
T addIT(T value1, T value2);
int main()
{
cout << addIT(2,3) << endl;
cout << addIT(2.5,3.7) << endl;
return 0;
}
template <typename T>
T addIT(T value1, T value2)
{
return value1 + value2;
}
|
56349e26824a7f2e58cd8c2f39560806874a3807 | e80018a14a349136e4d29b9e8ebb1a2b0eadd952 | /1.KAKAO/KAKAO 2021/3.합승택시요금(dijkstra).cpp | 88424ce6d5a710f73f1a79e25d06894ac19c3868 | [] | no_license | HenryNoh/Coding-Test | 9a857df974dcce54488083d531365ecde93b14ec | a65e09fa611f2b1db18cb5950e5e2ce84f998bdc | refs/heads/master | 2023-04-26T09:40:00.599140 | 2021-05-13T05:07:41 | 2021-05-13T05:07:41 | 347,883,090 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,797 | cpp | 3.합승택시요금(dijkstra).cpp | //12:40
//1:10
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<vector<int>> money;
vector<vector<int>> d;
vector<bool> v;
int gsi(int n, int s)
{
int min = 30000000;
int index = 0;
for (int i = 0; i < n; i++)
{
if (d[s][i] < min && !v[i])
{
min = d[s][i];
index = i;
}
}
return index;
}
void dijkstra(int n, int s)
{
for (int i = 0; i <= n; i++)
d[s][i] = money[s][i];
v[s] = true;
for (int i = 0; i <= n - 2; i++)
{
int c = gsi(n, s);
v[c] = true;
for (int j = 0; j <= n; j++)
{
if (!v[j])
{
if (d[s][c] + money[c][j] < d[s][j])
d[s][j] = d[s][c] + money[c][j];
}
}
}
}
int solution(int n, int s, int a, int b, vector<vector<int>> fares)
{
int answer = 0;
money = vector<vector<int>>(n + 2, vector<int>(n + 2, 30000000));
d = vector<vector<int>>(n + 2, vector<int>(n + 2, 0));
for (int i = 0; i < fares.size(); i++)
{
money[fares[i][0]][fares[i][1]] = fares[i][2];
money[fares[i][1]][fares[i][0]] = fares[i][2];
}
for (int i = 1; i <= n; i++)
{
v = vector<bool>(n + 2, false);
dijkstra(n, i);
}
for (int i = 1; i <= n; i++)
d[i][i] = 0;
vector<int> result(n + 1, 0);
for (int i = 1; i <= n; i++)
result[i] = d[i][s] + d[i][a] + d[i][b];
sort(result.begin(), result.end());
return result[1];
}
int main()
{
int n = 6, s = 4, a = 2, b = 6;
vector<vector<int>> fares = {{4, 1, 10}, {3, 5, 24}, {5, 6, 2}, {3, 1, 41}, {5, 1, 24}, {4, 6, 50}, {2, 4, 66}, {2, 3, 22}, {1, 6, 25}};
solution(n, s, a, b, fares);
} |
dd4675cdb8d0898cb35b03bdf0d4a278b624cb26 | 52d58615a974fd015245ae3f93f6ba94f784e3eb | /GM3/Point3d.h | 11b66fa705791ead8e7507dc9cff3fd0df3bf9a8 | [] | no_license | KawaSwitch/KawaGM | 9e89aede87729d2fe8796724afe802e7c3b77924 | 34237dd213a97363a834ef5dd469134372dfedd4 | refs/heads/master | 2020-03-23T13:38:39.001821 | 2018-11-10T13:50:36 | 2018-11-10T13:50:36 | 141,629,257 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,007 | h | Point3d.h | #pragma once
// 3次元座標の1点
class Point3d
{
public:
double X, Y, Z;
// Vector3d互換
explicit operator Vector3d() { return Vector3d(X, Y, Z); }
Point3d(double x, double y, double z)
{
X = x;
Y = y;
Z = z;
}
Point3d(const Vector3d &v)
{
X = v.X;
Y = v.Y;
Z = v.Z;
}
};
// 曲線上の座標
class Point3dC : public Point3d
{
public:
double param; // パラメータ
Point3dC(double x, double y, double z, double t) : Point3d(x, y, z) { param = t; }
Point3dC(const Vector3d &v, double t) : Point3d(v) { param = t; }
};
// 曲面上の座標
class Point3dS : public Point3d
{
public:
double paramU, paramV; // パラメータ
Point3dS(double x, double y, double z, double u, double v) : Point3d(x, y, z)
{
paramU = u;
paramV = v;
}
Point3dS(const Vector3d &vec, double u, double v) : Point3d(vec)
{
paramU = u;
paramV = v;
}
};
|
b56a9ce454a683bc0c13aa02bf49c53dccb1fdbe | a725f75e7d70539f7b3e8cacac48a8c39c90b68f | /Event.cpp | c29f80137db3ff993a52666ed16f425b68866c47 | [] | no_license | simonwulf/StarClone64 | f9b1bd805980028f4e4f5248d25d4c34654c71c5 | 75db2d03e4a36af0a5def87c81a526ffcb940f1e | refs/heads/master | 2016-09-05T10:24:49.699552 | 2014-01-19T17:44:48 | 2014-01-19T17:44:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 68 | cpp | Event.cpp | #include "Event.h"
Event::Event(Type type) {
this->type = type;
} |
c1dae5c28fb9c8dd10f84a504f392c9d535b4649 | de731a38511e0f345babfeaab5735d8920061f2c | /软件包/软件包/adj_list_undir_network.h | f75c774490f8e3fe51b762bf22381ab69d22c34e | [] | no_license | chris3will/Learn_the_data_structure_in_a_stupid_way | 4f63a70c0e5077f89f110b182d6032bd58a58c1c | 558c7194f1be1ff0212f0ea922a5682908bebf9a | refs/heads/master | 2020-04-10T01:11:15.056752 | 2018-12-12T02:51:42 | 2018-12-12T02:51:42 | 160,708,507 | 2 | 0 | null | null | null | null | GB18030 | C++ | false | false | 18,157 | h | adj_list_undir_network.h | #ifndef __ADJ_LIST_GRAPH_H__
#define __ADJ_LIST_GRAPH_H__
#include "lk_list.h" // 线性链表类模板
#include "adj_list_network_edge.h" // 邻接表无向网边数据类模板
#include "adj_list_network_vex_node.h" // 邻接表无向网顶点结点类模板
// 无向网的邻接表类模板
template <class ElemType, class WeightType>
class AdjListUndirNetwork
{
protected:
// 邻接表的数据成员:
int vexNum, edgeNum; // 顶点个数和边数
AdjListNetWorkVexNode<ElemType, WeightType> *vexTable; // 顶点表
mutable StatusCode *tag; // 指向标志数组的指针
WeightType infinity; // 无穷大
// 辅助函数模板L
void DestroyHelp(); // 销毁无向网,释放无向网点用的空间
int IndexHelp(const LinkList<AdjListNetworkEdge<WeightType> > *la, int v) const;
//定位顶点v在邻接链表中的位置
public:
// 抽象数据类型方法声明及重载编译系统默认方法声明:
AdjListUndirNetwork(ElemType es[], int vertexNum = DEFAULT_SIZE,
WeightType infinit = (WeightType)DEFAULT_INFINITY);
// 构造顶点数据为es[],顶点个数为vertexNum,infinit表示无穷大,边数为0的无向网
AdjListUndirNetwork(int vertexNum = DEFAULT_SIZE,
WeightType infinit = (WeightType)DEFAULT_INFINITY);
// 构造顶点个数为vertexNum,infinit表示无穷大,边数为0的无向网
~AdjListUndirNetwork(); // 析构函数模板
StatusCode GetElem(int v, ElemType &e) const;// 求顶点的元素
StatusCode SetElem(int v, const ElemType &e);// 设置顶点的元素值
WeightType GetInfinity() const; // 返回无穷大
int GetVexNum() const; // 返回顶点个数
int GetEdgeNum() const; // 返回边数个数
int FirstAdjVex(int v) const; // 返回顶点v的第一个邻接点
int NextAdjVex(int v1, int v2) const; // 返回顶点v1的相对于v2的下一个邻接点
void InsertEdge(int v1, int v2, WeightType w); // 插入顶点为v1和v2,权为w的边
void DeleteEdge(int v1, int v2); // 删除顶点为v1和v2的边
WeightType GetWeight(int v1, int v2) const; // 返回顶点为v1和v2的边的权值
void SetWeight(int v1, int v2, WeightType w);// 设置顶点为v1和v2的边的权值
StatusCode GetTag(int v) const; // 返回顶点v的标志
void SetTag(int v, StatusCode val) const; // 设置顶点v的标志为val
AdjListUndirNetwork(const AdjListUndirNetwork<ElemType, WeightType> ©); // 复制构造函数模板
AdjListUndirNetwork<ElemType, WeightType> &operator
=(const AdjListUndirNetwork<ElemType, WeightType> ©); // 重载赋值运算符
};
#ifndef _MSC_VER // 表示非VC
// 非VC需要在函数模板声明时写上参数缺省值
template <class ElemType, class WeightType>
void Display(const AdjListUndirNetwork<ElemType, WeightType> &net, bool showVexElem = true); // 显示邻接矩阵无向网
#else // 表示VC
// VC不必在函数模板声明时写上参数缺省值
template <class ElemType, class WeightType>
void Display(const AdjListUndirNetwork<ElemType, WeightType> &net, bool showVexElem); // 显示邻接矩阵无向网
#endif
// 无向网的邻接表类模板的实现部分
template <class ElemType, class WeightType>
AdjListUndirNetwork<ElemType, WeightType>::AdjListUndirNetwork(ElemType es[], int vertexNum, WeightType infinit)
// 操作结果:构造顶点数据为es[],顶点个数为vertexNum,infinit表示无穷大,边数为0的无向网
{
if (vertexNum < 0) throw Error("顶点个数不能为负!");// 抛出异常
infinity = infinit; // 无穷大
vexNum = vertexNum; // 顶点数为vertexNum
edgeNum = 0; // 边数为0
tag = new StatusCode[vexNum]; // 生成标志数组
int curPos; // 临时变量
for (curPos = 0; curPos < vexNum; curPos++)
{ // 初始化标志数组
tag[curPos] = UNVISITED;
}
vexTable = new AdjListNetWorkVexNode<ElemType, WeightType>[vexNum];// 生成邻接表
for (curPos = 0; curPos < vexNum; curPos++)
{ // 初始化顶点数据
vexTable[curPos].data = es[curPos];
}
}
template <class ElemType, class WeightType>
AdjListUndirNetwork<ElemType, WeightType>::AdjListUndirNetwork(int vertexNum, WeightType infinit)
// 操作结果:构造顶点个数为vertexNum,infinit表示无穷大,边数为0的无向网
{
if (vertexNum < 0) throw Error("顶点个数不能为负!");// 抛出异常
infinity = infinit; // 无穷大
vexNum = vertexNum; // 顶点数为vertexNum
edgeNum = 0; // 边数为0
tag = new StatusCode[vexNum]; // 生成标志数组
int curPos; // 临时变量
for (curPos = 0; curPos < vexNum; curPos++)
{ // 初始化标志数组
tag[curPos] = UNVISITED;
}
vexTable = new AdjListNetWorkVexNode<ElemType, WeightType>[vexNum];// 生成邻接表
}
template <class ElemType, class WeightType>
void AdjListUndirNetwork<ElemType, WeightType>::DestroyHelp()
// 操作结果:销毁无向网,释放无向网点用的空间
{
delete []tag; // 释放标志
for (int iPos = 0; iPos < vexNum; iPos++)
{ // 释放链表
if (vexTable[iPos].adjLink != NULL)
delete vexTable[iPos].adjLink;
}
delete []vexTable; // 释放邻接表
}
template <class ElemType, class WeightType>
AdjListUndirNetwork<ElemType, WeightType>::~AdjListUndirNetwork()
// 操作结果:释放邻接表无向网所占用空间
{
DestroyHelp();
}
template <class ElemType, class WeightType>
StatusCode AdjListUndirNetwork<ElemType, WeightType>::GetElem(int v, ElemType &e) const
// 操作结果:求顶点v的元素, v的取值范围为0 ≤ v < vexNum, v合法时返回
// SUCCESS, 否则返回RANGE_ERROR
{
if (v < 0 || v >= vexNum)
{ // v范围错
return NOT_PRESENT; // 元素不存在
}
else
{ // v合法
e = vexTable[v].data; // 将顶点v的元素值赋给e
return ENTRY_FOUND; // 元素存在
}
}
template <class ElemType, class WeightType>
StatusCode AdjListUndirNetwork<ElemType, WeightType>::SetElem(int v, const ElemType &e)
// 操作结果:设置顶点的元素值v的取值范围为0 ≤ v < vexNum, v合法时返回
// SUCCESS, 否则返回RANGE_ERROR
{
if (v < 0 || v >= vexNum)
{ // v范围错
return RANGE_ERROR; // 位置错
}
else
{ // v合法
vexTable[v].data = e; // 顶点元素
return SUCCESS; // 成功
}
}
template <class ElemType, class WeightType>
WeightType AdjListUndirNetwork<ElemType, WeightType>::GetInfinity() const
// 操作结果:返回无穷大
{
return infinity;
}
template <class ElemType, class WeightType>
int AdjListUndirNetwork<ElemType, WeightType>::GetVexNum() const
// 操作结果:返回顶点个数
{
return vexNum;
}
template <class ElemType, class WeightType>
int AdjListUndirNetwork<ElemType, WeightType>::GetEdgeNum() const
// 操作结果:返回边数个数
{
return edgeNum;
}
template <class ElemType, class WeightType>
int AdjListUndirNetwork<ElemType, WeightType>::FirstAdjVex(int v) const
// 操作结果:返回顶点v的第一个邻接点
{
if (v < 0 || v >= vexNum) throw Error("v不合法!");// 抛出异常
if (vexTable[v].adjLink == NULL)
{ // 空邻接链表,无邻接点
return -1;
}
else
{ // 空邻接链表,存在邻接点
AdjListNetworkEdge<WeightType> tmpEdgeNode;
vexTable[v].adjLink->GetElem(1, tmpEdgeNode);
return tmpEdgeNode.adjVex;
}
}
template <class ElemType, class WeightType>
int AdjListUndirNetwork<ElemType, WeightType>::IndexHelp(const LinkList<AdjListNetworkEdge<WeightType> > *la, int v) const
// 操作结果:定位顶点v在邻接链表中的位置
{
AdjListNetworkEdge<WeightType> tmpEdgeNode;
int curPos;
curPos = la->GetCurPosition();
la->GetElem(curPos, tmpEdgeNode); // 取得邻接点信息
if (tmpEdgeNode.adjVex == v) return curPos; // v为线性链表的当前位置处
curPos = 1;
for (curPos = 1; curPos <= la->Length(); curPos++)
{ // 循环定定
la->GetElem(curPos, tmpEdgeNode); // 取得边信息
if (tmpEdgeNode.adjVex == v) break; // 定位成功
}
return curPos; // curPos = la.Length() + 1 表定失败
}
template <class ElemType, class WeightType>
int AdjListUndirNetwork<ElemType, WeightType>::NextAdjVex(int v1, int v2) const
// 操作结果:返回顶点v1的相对于v2的下一个邻接点
{
if (v1 < 0 || v1 >= vexNum) throw Error("v1不合法!"); // 抛出异常
if (v2 < 0 || v2 >= vexNum) throw Error("v2不合法!"); // 抛出异常
if (v1 == v2) throw Error("v1不能等于v2!"); // 抛出异常
if (vexTable[v1].adjLink == NULL) return -1; // 邻接链表vexTable[v1].adjLink,不存在,返回-1
AdjListNetworkEdge<WeightType> tmpEdgeNode;
int curPos = IndexHelp(vexTable[v1].adjLink, v2); // 取出v2在邻接链表中的位置
if (curPos < vexTable[v1].adjLink->Length())
{ // 存在下1个邻接点
vexTable[v1].adjLink->GetElem(curPos + 1, tmpEdgeNode);// 取出后继
return tmpEdgeNode.adjVex;
}
else
{ // 不存在下一个邻接点
return -1;
}
}
template <class ElemType, class WeightType>
void AdjListUndirNetwork<ElemType, WeightType>::InsertEdge(int v1, int v2, WeightType w)
// 操作结果:插入顶点为v1和v2,权为w的边
{
if (v1 < 0 || v1 >= vexNum) throw Error("v1不合法!"); // 抛出异常
if (v2 < 0 || v2 >= vexNum) throw Error("v2不合法!"); // 抛出异常
if (v1 == v2) throw Error("v1不能等于v2!"); // 抛出异常
if (w == infinity) throw Error("w不能为无空大!"); // 抛出异常
AdjListNetworkEdge<WeightType> tmpEdgeNode;
// 插入<v1, v2>
if (vexTable[v1].adjLink == NULL)
{ // 空链表
vexTable[v1].adjLink = new LinkList<AdjListNetworkEdge<WeightType> >;
}
int curPos = IndexHelp(vexTable[v1].adjLink, v2); // 取出v2在邻接链表中的位置
if (curPos <= vexTable[v1].adjLink->Length())
{ // 存在边<v1, v2>
vexTable[v1].adjLink->GetElem(curPos, tmpEdgeNode); // 取出边
tmpEdgeNode.weight = w; // 设设置权值
vexTable[v1].adjLink->SetElem(curPos, tmpEdgeNode); // 设置边
}
else
{ // 不存在边<v1, v2>
tmpEdgeNode.adjVex = v2; tmpEdgeNode.weight = w; // 定义边
vexTable[v1].adjLink->Insert(curPos, tmpEdgeNode); // 插入<v1, v2>
edgeNum++; // 边数自增1
}
// 插入<v2, v1>
if (vexTable[v2].adjLink == NULL)
{ // 空链表
vexTable[v2].adjLink = new LinkList<AdjListNetworkEdge<WeightType> >;
}
curPos = IndexHelp(vexTable[v2].adjLink, v1); // 取出v1在邻接链表中的位置
if (curPos <= vexTable[v2].adjLink->Length())
{ // 存在边<v2, v1>
vexTable[v2].adjLink->GetElem(curPos, tmpEdgeNode); // 取出边
tmpEdgeNode.weight = w; // 设设置权值
vexTable[v2].adjLink->SetElem(curPos, tmpEdgeNode); // 设置边
}
else
{ // 不存在边<v1, v2>
tmpEdgeNode.adjVex = v1; tmpEdgeNode.weight = w; // 定义边
vexTable[v2].adjLink->Insert(curPos, tmpEdgeNode); // 插入<v2, v1>
}
}
template <class ElemType, class WeightType>
void AdjListUndirNetwork<ElemType, WeightType>::DeleteEdge(int v1, int v2)
// 操作结果:删除顶点为v1和v2的边
{
if (v1 < 0 || v1 >= vexNum) throw Error("v1不合法!"); // 抛出异常
if (v2 < 0 || v2 >= vexNum) throw Error("v2不合法!"); // 抛出异常
if (v1 == v2) throw Error("v1不能等于v2!"); // 抛出异常
AdjListNetworkEdge<WeightType> tmpEdgeNode;
int curPos = IndexHelp(vexTable[v1].adjLink, v2); // 取出v2在邻接链表中的位置
if (curPos <= vexTable[v1].adjLink->Length())
{ // 存在边<v1, v2>
vexTable[v1].adjLink->Delete(curPos, tmpEdgeNode); // 删除<v1, v2>
edgeNum--; // 边数自减1
}
curPos = IndexHelp(vexTable[v2].adjLink, v1); // 取出v1在邻接链表中的位置
if (curPos <= vexTable[v2].adjLink->Length())
{ // 存在边<v2, v1>
vexTable[v2].adjLink->Delete(curPos, tmpEdgeNode); // 删除<v2, v1>
}
}
template <class ElemType, class WeightType>
WeightType AdjListUndirNetwork<ElemType, WeightType>::GetWeight(int v1, int v2) const
// 操作结果:返回顶点为v1和v2的边的权值
{
if (v1 < 0 || v1 >= vexNum) throw Error("v1不合法!"); // 抛出异常
if (v2 < 0 || v2 >= vexNum) throw Error("v2不合法!"); // 抛出异常
AdjListNetworkEdge<WeightType> tmpEdgeNode;
int curPos = IndexHelp(vexTable[v1].adjLink, v2); // 取出v2在邻接链表中的位置
if (curPos <= vexTable[v1].adjLink->Length())
{ // 存在边<v1, v2>
vexTable[v1].adjLink->GetElem(curPos, tmpEdgeNode); // 取出边
return tmpEdgeNode.weight; // 返回权值
}
else
{ // 不存在边<v1, v2>
return infinity; // 权值为infinity表示边不存在
}
}
template <class ElemType, class WeightType>
void AdjListUndirNetwork<ElemType, WeightType>::SetWeight(int v1, int v2, WeightType w)
// 操作结果:设置顶点为v1和v2的边的权值
{
if (v1 < 0 || v1 >= vexNum) throw Error("v1不合法!"); // 抛出异常
if (v2 < 0 || v2 >= vexNum) throw Error("v2不合法!"); // 抛出异常
if (v1 == v2) throw Error("v1不能等于v2!"); // 抛出异常
if (w == infinity) throw Error("w不能为无空大!"); // 抛出异常
AdjListNetworkEdge<WeightType> tmpEdgeNode;
int curPos = IndexHelp(vexTable[v1].adjLink, v2); // 取出v2在邻接链表中的位置
if (curPos <= vexTable[v1].adjLink->Length())
{ // 存在边<v1, v2>
vexTable[v1].adjLink->GetElem(curPos, tmpEdgeNode); // 取出边
tmpEdgeNode.weight = w; // 修改<v1, v2>权值
vexTable[v1].adjLink->SetElem(curPos, tmpEdgeNode); // 设置边
}
curPos = IndexHelp(vexTable[v2].adjLink, v1); // 取出v1在邻接链表中的位置
if (curPos <= vexTable[v2].adjLink->Length())
{ // 存在边<v2, v1>
vexTable[v2].adjLink->GetElem(curPos, tmpEdgeNode); // 取出边
tmpEdgeNode.weight = w; // 修改<v2, v1>权值
vexTable[v2].adjLink->SetElem(curPos, tmpEdgeNode); // 设置边
}
}
template <class ElemType, class WeightType>
StatusCode AdjListUndirNetwork<ElemType, WeightType>::GetTag(int v) const
// 操作结果:返回顶点v的标志
{
if (v < 0 || v >= vexNum) throw Error("v不合法!"); // 抛出异常
return tag[v];
}
template <class ElemType, class WeightType>
void AdjListUndirNetwork<ElemType, WeightType>::SetTag(int v, StatusCode val) const
// 操作结果:设置顶点v的标志为val
{
if (v < 0 || v >= vexNum) throw Error("v不合法!"); // 抛出异常
tag[v] = val;
}
template <class ElemType, class WeightType>
AdjListUndirNetwork<ElemType, WeightType>::AdjListUndirNetwork(const AdjListUndirNetwork<ElemType, WeightType> ©)
// 操作结果:由无向网的邻接矩阵copy构造新无向网的邻接矩阵copy——复制构造函数模板
{
int curPos; // 临时变量
infinity =copy.infinity; // 复制无穷大
vexNum = copy.vexNum; // 复制顶点数
edgeNum = copy.edgeNum; // 复制边数
tag = new StatusCode[vexNum]; // 生成标志数组
for (curPos = 0; curPos < vexNum; curPos++)
{ // 复制标志数组
tag[curPos] = copy.tag[curPos];
}
vexTable = new AdjListNetWorkVexNode<ElemType, WeightType>[vexNum];// 生成邻接表
for (curPos = 0; curPos < vexNum; curPos++)
{ // 复制邻接链表
vexTable[curPos].data = copy.vexTable[curPos].data; // 复制顶点数据
vexTable[curPos].adjLink = new LinkList<AdjListNetworkEdge<WeightType> >(*copy.vexTable[curPos].adjLink);
}
}
template <class ElemType, class WeightType>
AdjListUndirNetwork<ElemType, WeightType> &AdjListUndirNetwork<ElemType, WeightType>::operator =(const AdjListUndirNetwork<ElemType, WeightType> ©)
// 操作结果:将无向网的邻接矩阵copy赋值给当前无向网的邻接矩阵——重载赋值运算符
{
if (© != this)
{
DestroyHelp(); // 释放当前无向网占用空间
int curPos; // 临时变量
infinity =copy.infinity; // 复制无穷大
vexNum = copy.vexNum; // 复制顶点数
edgeNum = copy.edgeNum; // 复制边数
tag = new StatusCode[vexNum]; // 生成标志数组
for (curPos = 0; curPos < vexNum; curPos++)
{ // 复制标志数组
tag[curPos] = copy.tag[curPos];
}
vexTable = new AdjListNetWorkVexNode<ElemType, WeightType>[vexNum];// 生成邻接表
for (curPos = 0; curPos < vexNum; curPos++)
{ // 复制邻接链表
vexTable[curPos].data = copy.vexTable[curPos].data; // 复制顶点数据
vexTable[curPos].adjLink = new LinkList<AdjListNetworkEdge<WeightType> >(*copy.vexTable[curPos].adjLink);
}
}
return *this;
}
#ifndef _MSC_VER // 表示非VC
// 非VC不能在函数模板定义时写上参数缺省值
template <class ElemType, class WeightType>
void Display(const AdjListUndirNetwork<ElemType, WeightType> &net, bool showVexElem)
// 操作结果: 显示邻接矩阵无向网
{
for (int v = 0; v < net.GetVexNum(); v++)
{ // 显示第v个邻接链表
cout << endl << v << " "; // 显示顶点号
if (showVexElem)
{ // 显示顶点元素
ElemType e; // 数据元素
net.GetElem(v, e); // 取出元素值
cout << e << " "; // 显示顶点元素
}
for (int u = net.FirstAdjVex(v); u != -1; u = net.NextAdjVex(v, u))
{ // 显示第v个邻接链表的一个结点(表示一个邻接点)
cout << "-->(" << u << "," << net.GetWeight(v, u) << ")";
}
cout << endl;
}
}
#else // 表示VC
// VC可以在函数模板定义时写上参数缺省值
template <class ElemType, class WeightType>
void Display(const AdjListUndirNetwork<ElemType, WeightType> &net, bool showVexElem = true)
// 操作结果: 显示邻接矩阵无向网
{
for (int v = 0; v < net.GetVexNum(); v++)
{ // 显示第v个邻接链表
cout << endl << v << " "; // 显示顶点号
if (showVexElem)
{ // 显示顶点元素
ElemType e; // 数据元素
net.GetElem(v, e); // 取出元素值
cout << e << " "; // 显示顶点元素
}
for (int u = net.FirstAdjVex(v); u != -1; u = net.NextAdjVex(v, u))
{ // 显示第v个邻接链表的一个结点(表示一个邻接点)
cout << "-->(" << u << "," << net.GetWeight(v, u) << ")";
}
cout << endl;
}
}
#endif
#endif
|
0abe371e6ca4e5bb9bb827c7988a8c7a8152199e | 049c07a55fc50c8b8c59538f0b7387cd2584ba51 | /rev/solution.cpp | a21fb6b647fec4097ae158886cbd6c6e36920b75 | [] | no_license | ahmed-bhs/hackfest2017 | c04ad31e93703e771c0b4275812f9ee70edde4a6 | 4644101f4e7d5bf9e0dadef56fdd3a615dc5f115 | refs/heads/master | 2021-06-16T05:38:33.428124 | 2017-04-23T23:28:27 | 2017-04-23T23:28:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,386 | cpp | solution.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF (int)(1e9+7)
#define PI acos(-1)
#define F first
#define S second
#define _QWORD unsigned long long
ll powf(ll a,ll b){
// return powl(a,b) ;
if(b == 0)return 1LL ;
else if(b&1){
return powf(a,b/2)*powf(a,b/2)*a ;
}else{
return powf(a,b/2)*powf(a,b/2) ;
}
}
ll tick4(ll a,ll b){
return a/b;
}
ll tick3(ll a,ll b){
return a-b;
}
ll tick5(ll a,ll b){
return powf(b,a) ;
/// here i replaced powl with a fast exponensiation function powf
}
ll tick6(ll a,ll b){
return a+b;
}
ll tick7(ll a,ll b){
return a*b;
}
int main()
{
freopen("out.out","w",stdout) ;
ll v4 = 0 ; // [sp+0h] [bp-30h]@0
ll v5 = 0 ; // [sp+8h] [bp-28h]@0
ll v6 = 0 ; // [sp+10h] [bp-20h]@0
ll v7 = 0 ; // [sp+18h] [bp-18h]@0
ll v8 = 0 ; // [sp+20h] [bp-10h]@1
ll i; // [sp+28h] [bp-8h]@1
printf(
"This is your ticket to travel to Canda !\n"
"All what you have to do is to wait until the flag is displayed !\n"
"Trust me !");
v8 = 0LL;
for ( i = 0LL; i <= 1193046; ++i )
{
v7 = tick4(i, 41LL);
v6 = tick5(v7, 3LL);
v5 = tick6(v6, v8);
v4 = tick7(v5, i);
v8 = v4%18364757930599072000LL ;
// printf("iteration : %d\n",i);
}
printf("Thank you for your patience ! Here is the flag: hackfest{%u}\n", v8);
return 0;
}
|
1de10248f5a7437cea1e6978bde7e929f9a0d946 | 80c585608b7bb36ef5653aec866819e0eb919cfa | /src/Evernote API/Evernote/EDAM/NoteStore/SyncState (NoteStore).cpp | 5968bf6a1691c5501a095f036ba90adedf4a5b33 | [] | no_license | ARLM-Attic/peoples-note | 109bb9539c612054d6ff2a4db3bdce84bad189c4 | 1e7354c66a9e2b6ccb8b9ee9c31314bfa4af482d | refs/heads/master | 2020-12-30T16:14:51.727240 | 2013-07-07T09:56:03 | 2013-07-07T09:56:03 | 90,967,267 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,035 | cpp | SyncState (NoteStore).cpp | /**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
#include "../NoteStore.h"
#include <fstream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <windows.h>
#include <Thrift/Thrift.h>
#include <Thrift/Protocol.h>
#include <Thrift/Transport.h>
#include <Evernote/EDAM/UserStore.h>
#include <Evernote/EDAM/Type.h>
#include <Evernote/EDAM/Error.h>
#include <Evernote/EDAM/Limits.h>
using namespace Evernote::EDAM::NoteStore;
SyncState::SyncState()
{
::ZeroMemory(&__isset, sizeof(Isset));
}
void SyncState::Read(Thrift::Protocol::TProtocol & iprot)
{
Thrift::Protocol::TStruct struc;
iprot.ReadStructBegin(struc);
for (;;)
{
Thrift::Protocol::TField field;
iprot.ReadFieldBegin(field);
if (field.GetType() == Thrift::Protocol::TypeStop)
break;
switch (field.GetID())
{
case 1:
if (field.GetType() == Thrift::Protocol::TypeI64)
{
this->currentTime = iprot.ReadI64();
}
else
{
Thrift::Protocol::TProtocolUtil::Skip(iprot, field.GetType());
}
break;
case 2:
if (field.GetType() == Thrift::Protocol::TypeI64)
{
this->fullSyncBefore = iprot.ReadI64();
}
else
{
Thrift::Protocol::TProtocolUtil::Skip(iprot, field.GetType());
}
break;
case 3:
if (field.GetType() == Thrift::Protocol::TypeI32)
{
this->updateCount = iprot.ReadI32();
}
else
{
Thrift::Protocol::TProtocolUtil::Skip(iprot, field.GetType());
}
break;
case 4:
if (field.GetType() == Thrift::Protocol::TypeI64)
{
this->uploaded = iprot.ReadI64();
this->__isset.uploaded = true;
}
else
{
Thrift::Protocol::TProtocolUtil::Skip(iprot, field.GetType());
}
break;
default:
Thrift::Protocol::TProtocolUtil::Skip(iprot, field.GetType());
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
void SyncState::Write(Thrift::Protocol::TProtocol & oprot)
{
Thrift::Protocol::TStruct struc;
struc.SetName(L"SyncState");
oprot.WriteStructBegin(struc);
{
Thrift::Protocol::TField field;
field.SetName(L"currentTime");
field.SetType(Thrift::Protocol::TypeI64);
field.SetID(1);
oprot.WriteFieldBegin(field);
oprot.WriteI64(this->currentTime);
oprot.WriteFieldEnd();
}
{
Thrift::Protocol::TField field;
field.SetName(L"fullSyncBefore");
field.SetType(Thrift::Protocol::TypeI64);
field.SetID(2);
oprot.WriteFieldBegin(field);
oprot.WriteI64(this->fullSyncBefore);
oprot.WriteFieldEnd();
}
{
Thrift::Protocol::TField field;
field.SetName(L"updateCount");
field.SetType(Thrift::Protocol::TypeI32);
field.SetID(3);
oprot.WriteFieldBegin(field);
oprot.WriteI32(this->updateCount);
oprot.WriteFieldEnd();
}
if (__isset.uploaded)
{
Thrift::Protocol::TField field;
field.SetName(L"uploaded");
field.SetType(Thrift::Protocol::TypeI64);
field.SetID(4);
oprot.WriteFieldBegin(field);
oprot.WriteI64(this->uploaded);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
|
390dbb45139c06b59a810b731232903eaa8001a8 | 4352b5c9e6719d762e6a80e7a7799630d819bca3 | /tutorials/oldd/box/9.9e-05/U | f8ba4310b48d7c1a291e342f3f297281aa5c70c5 | [] | no_license | dashqua/epicProject | d6214b57c545110d08ad053e68bc095f1d4dc725 | 54afca50a61c20c541ef43e3d96408ef72f0bcbc | refs/heads/master | 2022-02-28T17:20:20.291864 | 2019-10-28T13:33:16 | 2019-10-28T13:33:16 | 184,294,390 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 82,507 | U | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "9.9e-05";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
2370
(
(1.6455 0.19433 -2.05736e-05)
(0.834635 0.50842 -1.93981e-05)
(0.00527419 0.904079 6.32247e-05)
(0.777176 0.233707 2.24713e-05)
(0.42717 -0.0630003 -3.22946e-05)
(1.31624 -0.280163 2.61384e-05)
(0.380873 0.438554 3.82467e-05)
(0.749003 0.254514 2.47236e-05)
(0.845074 0.169906 2.23537e-05)
(0.841241 0.158929 2.30538e-05)
(0.75622 0.234281 6.68711e-06)
(0.870454 0.150903 2.75186e-05)
(0.917848 0.240691 -6.18992e-06)
(0.708754 0.334846 2.35743e-05)
(0.564288 0.485533 8.65777e-06)
(0.810073 0.231536 5.45553e-06)
(0.810064 0.221725 8.96379e-06)
(0.699541 0.198627 6.28145e-06)
(0.610192 0.412056 1.7597e-05)
(0.950203 0.337467 -3.09145e-05)
(0.834488 0.18581 2.68731e-05)
(0.807665 0.233533 4.33861e-06)
(0.358807 0.539665 3.90006e-05)
(0.814306 0.162183 -5.41042e-06)
(0.779063 0.107303 3.39933e-06)
(0.863341 0.167047 1.52317e-05)
(1.03833 -0.0642121 2.85241e-05)
(1.01309 0.451335 -1.83985e-05)
(0.908469 0.130371 1.01189e-06)
(0.814535 0.143431 -3.79859e-06)
(0.636584 0.475255 -6.08271e-06)
(0.938236 0.186906 1.34335e-05)
(1.00952 0.125656 6.96821e-06)
(0.607962 0.936794 2.5726e-05)
(0.852058 0.16928 2.5678e-05)
(0.451437 0.58652 3.18161e-05)
(0.784647 0.245126 1.6288e-05)
(0.749216 0.151778 -2.03954e-05)
(0.825191 0.254456 -1.47008e-05)
(1.11543 -0.0810433 3.20497e-05)
(0.867792 0.127278 2.48471e-05)
(1.22528 -0.0265842 1.90292e-05)
(0.888061 0.0622499 2.0427e-05)
(0.747374 0.250653 1.56399e-05)
(0.608915 0.466673 3.38864e-05)
(0.622913 0.335836 1.88513e-05)
(1.13514 -0.0568915 3.1253e-05)
(0.621625 0.416784 1.90625e-05)
(0.908085 0.0808835 9.73074e-06)
(-0.0714211 1.09936 6.07568e-05)
(1.16057 0.603664 -2.32407e-05)
(0.857718 0.133711 3.80235e-05)
(1.28187 -0.324324 4.75803e-05)
(0.691298 -0.00822197 -1.79857e-05)
(1.17584 -0.173558 3.56909e-05)
(0.48141 0.643383 3.88557e-05)
(0.762473 0.233252 3.06504e-05)
(0.558531 0.511231 3.30122e-05)
(1.04849 -0.0676658 2.58823e-05)
(0.782728 0.242292 2.04227e-05)
(0.817087 0.198381 2.1493e-05)
(0.511905 0.535454 3.40968e-05)
(0.803387 0.226604 1.50968e-05)
(1.08267 -0.0671221 2.62853e-05)
(0.644759 0.0234604 -2.70935e-05)
(0.699683 0.104751 -2.1157e-05)
(1.05052 0.369724 -2.85987e-05)
(0.787122 0.197483 -1.71048e-05)
(1.15317 -0.0569203 3.54357e-05)
(0.809285 0.233439 -1.71769e-05)
(0.504631 0.457263 2.78427e-05)
(1.00654 -0.101272 2.50121e-05)
(0.578279 0.503183 3.0043e-05)
(1.10019 -0.0596266 3.0259e-05)
(0.56758 -0.142972 -2.98415e-05)
(0.813486 0.233166 -1.63636e-05)
(0.540479 -0.019917 -2.31413e-05)
(1.09223 0.481571 -2.45054e-05)
(0.779647 0.195062 -1.94594e-05)
(0.414824 0.550768 3.61627e-05)
(1.16109 -0.0737842 3.15965e-05)
(0.774885 0.248467 2.78515e-05)
(0.823229 0.206707 2.88623e-05)
(0.289868 -0.384371 -4.63627e-05)
(0.81056 0.211012 1.53416e-05)
(0.679464 0.422397 1.76399e-05)
(0.997287 0.013664 3.32172e-05)
(1.09542 0.51581 -3.02307e-05)
(0.544297 0.444886 2.1884e-05)
(0.894185 0.363701 -2.2087e-05)
(0.635782 0.0550232 -1.87015e-05)
(0.533321 0.587761 3.22591e-05)
(0.739709 0.249326 1.95735e-05)
(1.13276 0.720708 -3.63392e-05)
(0.509385 0.410258 2.8335e-05)
(0.714104 0.270863 1.79194e-05)
(0.954779 0.0890169 1.74189e-05)
(0.982122 0.402467 -2.13356e-05)
(0.618448 0.408957 2.36412e-05)
(0.894139 0.348865 -1.58344e-05)
(0.558269 -0.0660318 -3.56913e-05)
(0.917822 0.376613 -1.90821e-05)
(1.01626 0.544778 -3.05782e-05)
(0.873639 0.15535 2.16967e-05)
(1.13154 -0.147031 3.56805e-05)
(0.990966 0.0214902 2.62599e-05)
(0.857139 0.156261 1.52985e-05)
(1.01684 -0.0744914 2.57118e-05)
(1.06153 -0.168747 3.02492e-05)
(0.586279 0.411246 2.64854e-05)
(0.814034 0.19836 1.48719e-05)
(1.04992 -0.0134594 2.51039e-05)
(0.605952 0.404284 2.86634e-05)
(0.663596 0.114729 -1.6783e-05)
(1.01277 0.388374 -2.93479e-05)
(0.883543 0.0924643 1.51064e-05)
(0.769971 0.253527 2.75031e-05)
(0.655988 0.0474936 -1.89988e-05)
(0.665146 0.299386 1.61012e-05)
(1.00424 0.497293 -3.03489e-05)
(0.983363 0.0701463 1.98619e-05)
(0.621023 0.29078 1.49586e-05)
(0.571614 0.379695 2.37544e-05)
(0.446894 -0.0221435 -2.84131e-05)
(1.12361 -0.237504 2.35164e-05)
(0.625029 0.382884 2.4066e-05)
(0.895819 0.0258988 1.41639e-05)
(0.778863 0.223659 1.50697e-05)
(0.662901 0.0820269 -1.79733e-05)
(0.939349 0.330354 -1.76173e-05)
(1.02119 0.4313 -2.11487e-05)
(0.379517 -0.0565778 -3.7166e-05)
(0.588682 -0.0103946 -1.94629e-05)
(0.876617 0.271822 -1.4202e-05)
(0.437458 0.455231 3.38937e-05)
(1.51061 0.649566 -4.107e-05)
(0.837434 0.263004 -1.96539e-05)
(1.04801 0.0560322 2.46681e-05)
(0.557397 -0.00545812 -3.19827e-05)
(0.675971 0.436043 2.00947e-05)
(0.906643 0.306715 -1.60472e-05)
(0.57796 -0.0165553 -2.23892e-05)
(0.798864 0.215655 -9.31884e-06)
(0.734356 0.101176 -1.60405e-05)
(0.815211 0.234425 -2.0741e-05)
(0.845282 0.181435 2.78858e-05)
(0.672006 0.0935586 -1.75931e-05)
(1.08044 0.509766 -2.01359e-05)
(0.996002 0.396995 -1.63423e-05)
(0.746689 0.146323 -1.83855e-05)
(1.06103 0.223156 3.12969e-05)
(0.693057 0.00843994 -2.07956e-05)
(0.678559 0.365145 2.09121e-05)
(0.639538 0.0246796 -1.66811e-05)
(1.00405 0.355456 -2.21129e-05)
(0.958652 0.0552018 2.18051e-05)
(0.524476 0.366606 7.47916e-05)
(0.753415 0.349678 1.24764e-05)
(0.738606 0.37678 7.45026e-06)
(0.861904 0.445723 1.67372e-05)
(-0.590247 0.721951 -4.43406e-07)
(1.27869 0.159395 3.24084e-05)
(0.688323 0.346748 1.66376e-05)
(0.320333 0.0890248 -2.88794e-05)
(0.452963 -0.045246 -2.69418e-05)
(0.996023 0.426084 -2.07577e-05)
(0.772366 0.178507 -2.05596e-05)
(0.794286 0.204377 -1.72083e-05)
(0.412757 0.127013 -2.76191e-05)
(0.763102 0.196472 -1.39842e-05)
(0.845561 0.18315 1.33537e-05)
(0.895027 0.334809 -1.73213e-05)
(0.717996 -0.0541398 -1.62789e-05)
(0.771995 0.168551 -1.28316e-05)
(0.951577 0.31904 -9.02009e-06)
(0.980816 0.396215 -1.73427e-05)
(0.725066 0.289826 5.01236e-05)
(0.785793 0.200713 9.33656e-06)
(0.766101 0.231624 -3.77523e-06)
(0.726592 0.131645 -5.15881e-05)
(0.788309 0.229534 2.9328e-05)
(0.791823 0.204822 5.00482e-06)
(0.993748 0.0529788 3.96421e-05)
(0.783768 0.214602 -2.28081e-06)
(0.785446 0.195313 -3.02039e-05)
(0.705328 0.191647 9.58822e-06)
(0.89984 0.124028 -6.70146e-06)
(0.635545 0.0351643 -4.06881e-05)
(0.757191 0.275018 2.05166e-05)
(0.5999 0.411008 -9.59546e-06)
(0.781196 0.182253 2.57579e-06)
(0.795179 0.240665 -3.87604e-06)
(0.662127 0.0659848 -2.89887e-05)
(0.783859 0.29127 -6.22518e-06)
(0.668309 0.180288 2.28442e-05)
(0.74314 0.150158 -2.19035e-05)
(1.30162 -0.252814 2.93272e-05)
(0.953135 0.375151 6.85225e-06)
(1.05972 0.00916037 -5.0208e-06)
(-0.316556 1.15915 7.1614e-05)
(0.492886 -0.103246 -3.6044e-05)
(0.851465 0.759851 2.39607e-05)
(0.563989 0.392939 -4.64492e-06)
(0.756207 0.363786 -6.92041e-06)
(1.37295 0.857849 -3.16822e-05)
(0.799797 0.277521 2.06523e-05)
(1.07014 0.572922 1.6135e-05)
(0.660691 0.453778 -9.67413e-06)
(0.771392 0.212885 -4.65912e-06)
(1.45741 0.796582 -3.11852e-05)
(0.493792 0.149671 3.11504e-05)
(1.76053 1.21294 -6.89606e-05)
(0.895975 0.29832 -2.73788e-05)
(0.696147 0.439654 -7.12981e-06)
(0.501802 -0.0715861 -4.6416e-05)
(0.423206 0.234455 -3.19601e-05)
(0.821522 0.197804 -2.22991e-05)
(0.7814 0.215421 2.16104e-05)
(0.934429 -0.0193743 1.26451e-05)
(0.854694 0.405612 2.51708e-05)
(0.798227 0.196464 1.86916e-05)
(0.780099 0.212404 -2.79798e-05)
(0.691124 0.12411 -2.87219e-05)
(0.788448 0.216569 -2.09294e-05)
(0.782442 0.313063 3.22321e-05)
(0.75894 0.205831 1.99875e-05)
(0.867464 0.255193 -2.1039e-05)
(0.739437 0.20694 1.78125e-05)
(0.954069 -0.0871132 -1.72736e-05)
(0.82517 0.273289 -1.7439e-05)
(1.01126 0.270398 2.7324e-05)
(1.09696 0.31898 -3.05532e-06)
(1.39404 0.864364 -3.88318e-05)
(0.787409 0.151983 -2.85097e-06)
(0.83578 0.214721 -3.24157e-05)
(0.658983 0.355662 4.4779e-05)
(0.75003 0.253909 4.36781e-06)
(0.804476 0.116565 3.03524e-06)
(0.808437 0.107558 -6.96586e-07)
(0.785348 0.206688 3.09447e-05)
(0.856049 0.261164 -3.96468e-06)
(0.922561 0.329292 -4.13338e-05)
(0.785781 0.226502 -1.06125e-06)
(0.718056 0.19336 -9.11742e-07)
(0.799904 0.236193 -8.70156e-07)
(0.774468 0.217801 -7.00477e-07)
(0.71793 0.435807 5.8831e-07)
(0.920928 0.21273 -4.09148e-07)
(0.701397 0.208546 -2.5331e-07)
(0.99582 -0.0902413 -2.49305e-06)
(0.829619 0.277834 2.44256e-06)
(0.776345 0.222478 1.03475e-06)
(1.2748 0.24925 -2.26889e-06)
(0.971558 0.375379 -1.45969e-07)
(0.794568 0.226398 6.67391e-08)
(0.804553 0.19701 1.52315e-05)
(0.776009 0.228237 2.50563e-05)
(0.904862 0.333407 -6.14796e-05)
(0.720588 0.133611 -4.1326e-05)
(2.38312 1.80121 -5.11264e-05)
(-0.296126 -1.06938 -4.61112e-05)
(0.789747 0.209258 -4.50948e-05)
(0.80914 0.245789 -4.14114e-05)
(2.21479 1.54339 -6.81319e-05)
(0.717166 0.136073 -3.53049e-05)
(1.78612 1.22573 -4.84677e-05)
(0.723011 0.135992 -4.92558e-05)
(-0.255373 -0.906241 -5.76832e-05)
(0.788688 0.20489 -4.69812e-05)
(0.370694 -0.209754 -4.09556e-05)
(1.77001 1.20053 -4.39707e-05)
(0.651669 0.0605219 -4.47854e-05)
(0.641776 0.0526241 -3.68038e-05)
(-0.0875869 -0.564667 -5.47802e-05)
(-0.00890802 -0.557519 -5.17163e-05)
(0.462496 -0.102046 -3.6089e-05)
(0.781827 0.279395 -3.87989e-07)
(0.957231 0.41051 -4.27093e-07)
(0.827093 0.129034 1.19895e-06)
(0.798792 0.261809 -3.92227e-06)
(0.769547 0.124714 -2.37763e-06)
(0.68468 -0.0146694 -2.98714e-06)
(0.83964 0.243386 -2.51975e-06)
(0.718436 0.126638 -2.90001e-05)
(0.577737 -0.0842226 -4.41709e-05)
(0.54887 0.28381 5.64023e-07)
(0.932127 0.183527 1.268e-07)
(0.798875 0.247143 -2.78832e-06)
(0.805061 0.205029 -3.17558e-06)
(0.936928 0.574197 -1.92634e-06)
(1.45779 -0.797534 -5.50739e-07)
(0.80521 0.249063 -2.35539e-06)
(0.333162 0.0136184 1.27427e-06)
(0.178276 0.741165 1.75797e-06)
(0.794328 0.249607 -2.9141e-06)
(0.787896 0.261933 -3.05813e-06)
(0.803668 0.237396 -2.32249e-06)
(0.829339 0.246458 -2.46898e-06)
(1.59413 -0.485666 1.70866e-06)
(1.26728 0.358347 -1.90964e-06)
(0.81139 0.236862 1.19897e-06)
(1.43736 -0.348249 1.29141e-06)
(-0.0604934 0.0312223 -1.33467e-06)
(0.813713 0.241099 -1.53861e-06)
(0.797702 0.2388 -2.99688e-06)
(0.591455 -0.102693 -3.95597e-05)
(-0.0199591 -0.00180929 9.46667e-08)
(0.209569 -0.116893 -3.84895e-05)
(0.117178 0.190241 1.27476e-06)
(0.879839 0.297704 -2.76716e-05)
(0.548167 0.232613 2.04015e-07)
(0.869236 0.254302 -2.32948e-06)
(0.797615 0.268906 1.36744e-06)
(0.800554 0.059237 -1.59986e-06)
(1.01529 0.471926 -2.23436e-06)
(0.826135 0.159946 -2.75858e-06)
(0.785768 0.239783 1.36252e-05)
(0.93743 0.188676 1.26138e-06)
(0.502343 0.492249 4.16556e-05)
(1.29287 0.604306 -4.2091e-05)
(0.299201 -0.198107 -4.86493e-05)
(0.757132 0.230596 3.58829e-07)
(0.76082 0.167906 -2.26122e-05)
(0.376284 -0.232429 -3.78125e-05)
(0.221478 -0.389197 -4.2438e-05)
(0.830769 0.204349 2.41694e-07)
(0.794214 0.144254 2.47845e-06)
(1.00606 -0.0157116 2.7433e-05)
(0.523907 0.494805 3.19434e-05)
(0.671787 0.0855794 -2.34079e-05)
(1.07749 0.319371 -2.11071e-06)
(0.787542 0.199565 8.93158e-07)
(0.599165 0.0321487 -3.40627e-05)
(0.805054 0.132328 -1.18252e-06)
(0.785167 0.16685 -1.20478e-06)
(0.64315 0.287168 -1.566e-06)
(0.81014 0.275508 -2.46255e-06)
(0.637618 0.140419 1.54551e-06)
(0.748558 0.232726 1.02648e-05)
(0.963136 0.0658006 -2.13003e-05)
(0.684275 0.101727 -2.51824e-05)
(0.952467 0.450646 -8.47078e-07)
(1.39163 0.818255 -4.00101e-05)
(0.857135 0.284175 -1.84884e-06)
(0.752818 0.0610092 -2.15275e-07)
(1.05273 0.405012 2.67753e-05)
(0.524099 0.251463 6.09391e-08)
(0.972132 0.372893 2.26676e-05)
(0.609495 0.374935 1.26198e-06)
(0.850311 0.253524 3.33926e-05)
(0.954839 0.181847 1.91437e-05)
(0.807344 0.526598 -1.16692e-06)
(0.81367 0.48385 -3.38188e-06)
(0.896678 0.228645 1.2064e-06)
(0.767367 0.169109 -7.35509e-06)
(0.80463 0.192098 1.00972e-05)
(0.832187 0.0861179 1.06893e-05)
(0.835773 0.233141 -2.52782e-07)
(0.726173 0.283046 8.47615e-06)
(1.03017 0.0476251 3.18636e-05)
(0.497525 0.504227 3.23652e-05)
(0.805036 0.25195 4.95237e-07)
(0.6554 0.321076 7.69304e-06)
(1.0033 0.178946 -2.03711e-06)
(0.835545 0.080793 2.26826e-05)
(0.608408 0.191438 -4.91385e-07)
(0.970924 0.352618 -2.79249e-05)
(0.98796 0.0206435 2.44138e-05)
(0.803951 0.152866 1.21948e-05)
(0.909554 0.185201 1.94186e-06)
(0.883412 0.149271 -4.73703e-07)
(0.792809 0.225662 7.07965e-06)
(1.01096 -0.130328 1.951e-06)
(0.7996 0.224598 -1.65178e-07)
(0.840134 0.343769 7.06732e-07)
(0.849008 0.253524 1.78412e-05)
(0.528763 -0.0745444 -2.98882e-05)
(0.760291 0.152538 7.14633e-06)
(0.379032 -0.300915 3.4738e-05)
(0.746563 0.120856 4.12514e-05)
(0.825543 0.181986 4.3474e-05)
(1.13107 0.181882 2.31471e-05)
(0.764122 0.25627 2.98429e-05)
(0.769865 0.318905 2.0132e-05)
(0.663813 0.177756 -6.33657e-07)
(0.858328 0.059295 -2.31035e-06)
(0.855269 0.169712 -9.86367e-07)
(0.760894 0.315901 -1.68579e-06)
(0.523629 -0.0461029 -2.7624e-05)
(0.70074 0.17961 -9.30114e-06)
(0.635183 -0.18183 1.15377e-05)
(0.825268 0.306389 -1.62738e-05)
(0.855094 0.278688 -1.19413e-06)
(0.791964 0.267932 -1.71119e-06)
(0.839342 0.206942 -2.28572e-06)
(0.868645 0.264388 1.88123e-05)
(0.738521 0.129015 -2.41653e-06)
(1.2103 0.611546 -2.81175e-05)
(0.747467 0.243685 9.71693e-06)
(1.14993 -0.793359 2.79165e-05)
(0.771564 0.15617 9.14011e-06)
(0.697924 0.0975898 2.08605e-05)
(0.683056 0.218269 3.75326e-05)
(0.785783 0.219491 1.77978e-05)
(0.834312 0.236296 2.93883e-05)
(1.49019 -0.142038 3.35508e-05)
(0.97299 1.13905 3.18613e-05)
(0.781236 0.279724 2.9802e-05)
(0.780506 0.235898 3.21539e-05)
(0.0902535 -0.51648 4.39062e-05)
(0.800339 0.302689 3.26902e-05)
(0.769827 0.236701 2.89439e-05)
(0.812 0.188435 -1.77369e-05)
(0.748099 0.259103 2.54744e-05)
(0.0435474 -0.59848 4.42702e-05)
(0.826503 0.245471 2.51729e-05)
(0.778897 0.320334 5.67806e-06)
(0.740464 0.192086 7.36821e-06)
(0.939435 0.200531 1.33652e-05)
(0.974588 0.0520426 -2.7238e-05)
(0.757424 0.193047 -5.47746e-06)
(0.647689 -0.177523 3.19719e-05)
(1.05298 -0.205408 3.60005e-05)
(0.701487 0.117674 -1.99408e-05)
(0.806484 0.23488 8.86028e-06)
(0.835276 0.484839 2.21832e-05)
(0.681635 0.344129 1.43944e-05)
(0.73487 0.260385 1.60642e-05)
(0.76782 0.25148 -1.70651e-06)
(0.792591 0.251579 8.82137e-06)
(1.12831 0.58284 3.67011e-05)
(0.840706 0.239607 1.90894e-05)
(0.838742 0.213179 1.65073e-05)
(0.839494 0.223865 3.27792e-05)
(0.851331 0.102166 1.44227e-05)
(0.809402 0.217221 3.03418e-05)
(0.927299 0.203001 -2.17989e-05)
(0.805188 0.255581 1.17199e-05)
(1.15196 0.175776 3.30024e-05)
(0.483764 -0.131903 -4.03849e-05)
(0.751477 0.229598 -7.32771e-06)
(0.794718 0.360585 3.01863e-05)
(0.535807 0.295831 1.12267e-06)
(0.803668 0.204586 6.73028e-06)
(1.2367 0.594472 3.40099e-05)
(0.817631 0.227298 -5.50082e-07)
(0.770483 0.184756 -2.06476e-07)
(0.934231 0.0587597 2.027e-05)
(1.02667 0.196855 1.16982e-05)
(0.661211 0.0694617 -2.36346e-05)
(0.803755 0.156604 6.69708e-06)
(0.599247 0.0200913 -3.93746e-05)
(0.807476 0.24331 -6.44743e-06)
(0.792651 0.31359 -2.09846e-07)
(1.17664 0.292832 -1.2282e-06)
(0.989335 0.151639 2.59014e-05)
(0.847887 0.339455 -3.15544e-05)
(0.797851 0.19608 3.00713e-05)
(1.31444 0.751781 3.50668e-05)
(0.821225 0.201463 1.01357e-05)
(0.664082 -0.059381 9.59854e-06)
(0.795964 0.223604 1.01864e-05)
(0.786098 0.484624 4.03587e-06)
(0.749296 0.143471 1.96486e-05)
(0.763795 0.350606 5.11837e-06)
(1.12501 0.192537 2.67739e-05)
(1.61783 1.03185 -2.97133e-05)
(0.87067 0.119334 -1.77613e-05)
(0.7896 0.132409 5.21744e-08)
(0.879436 0.276767 -1.33033e-05)
(0.660012 0.257288 1.74755e-05)
(0.71694 0.0308522 2.03833e-05)
(0.834437 0.183658 1.69492e-05)
(1.26373 0.694152 3.80407e-05)
(1.25869 0.425756 2.62842e-05)
(0.904506 0.189858 1.28293e-05)
(0.787802 0.00682934 1.43845e-05)
(0.859808 0.235831 -8.57551e-06)
(0.76454 0.222739 -1.51218e-06)
(0.786575 0.339577 -1.33621e-05)
(0.779272 0.20085 -6.79434e-06)
(0.635339 0.0817981 -2.27661e-05)
(0.390585 0.659236 4.68011e-05)
(0.801061 -0.172724 1.08675e-05)
(0.780239 0.183742 1.95091e-05)
(0.711096 0.228887 -1.37631e-06)
(0.83316 0.228165 -1.64734e-05)
(0.778477 0.124651 9.47333e-06)
(0.633946 0.208567 -7.90247e-08)
(0.872975 0.217492 2.72523e-06)
(0.746118 0.274836 3.25519e-05)
(0.805256 0.235553 9.52519e-06)
(1.02182 0.119934 1.40507e-05)
(0.671117 0.252878 1.87511e-05)
(0.691091 -0.169218 2.74145e-05)
(0.699669 0.360775 3.57022e-05)
(1.08753 0.500282 -2.89982e-05)
(0.487787 -0.0346329 2.82327e-05)
(0.603575 0.257957 1.09492e-05)
(0.7315 0.307242 6.78815e-06)
(0.774456 0.216314 -2.00479e-05)
(0.628216 0.427086 2.45581e-05)
(0.944163 0.276586 2.30232e-05)
(0.636556 0.192561 -9.63379e-07)
(0.944048 0.389401 -4.01509e-07)
(0.663009 0.259674 -4.20256e-07)
(0.396085 -0.156248 -3.49807e-05)
(0.66216 0.241264 -1.46051e-07)
(0.808703 0.305932 -2.34637e-06)
(0.678562 0.166199 -2.33434e-06)
(0.877044 0.198383 -2.11496e-06)
(0.810101 0.451541 2.43526e-05)
(0.660149 0.448567 2.50757e-05)
(0.920104 0.223578 1.33267e-05)
(0.714444 0.322778 -1.59321e-05)
(0.912965 0.23818 -1.8305e-06)
(0.731432 0.285597 -4.1611e-06)
(0.742857 0.180552 1.76073e-05)
(0.746833 0.338424 5.53339e-06)
(0.803253 0.151144 5.91953e-06)
(0.575695 0.289247 1.18662e-05)
(0.960237 -0.297914 -1.68103e-05)
(0.913694 0.0248519 1.45532e-05)
(0.923334 0.299252 2.60879e-05)
(0.771461 0.290531 7.24472e-06)
(0.695432 0.249425 2.07339e-05)
(1.1174 -0.0468457 3.18491e-05)
(0.767502 0.205867 -7.81359e-07)
(0.971725 0.104951 2.02727e-05)
(0.840475 -0.0690188 2.90598e-05)
(0.734994 0.228578 -1.08018e-05)
(0.799715 0.0151464 2.64495e-05)
(0.745135 0.267109 2.64084e-05)
(0.655491 0.217275 2.51626e-05)
(0.850086 0.187717 7.44388e-06)
(0.89769 0.291652 -1.24021e-05)
(0.858399 0.18954 -2.81988e-06)
(0.908587 0.0889814 -1.6072e-05)
(1.03357 0.302196 -1.10725e-05)
(0.869403 0.0189393 1.29613e-05)
(0.981221 0.416811 2.33984e-05)
(0.74564 0.225808 9.85992e-07)
(0.904511 0.330777 -1.16428e-05)
(0.900735 0.137099 9.912e-06)
(0.823308 0.0477265 -2.04938e-06)
(0.808617 0.0875636 -3.78657e-05)
(0.788412 0.12965 7.81463e-06)
(0.799483 0.210623 4.12856e-06)
(0.84691 0.405722 4.82035e-06)
(0.939816 0.31241 1.92291e-05)
(0.794216 0.291492 -7.40534e-06)
(0.730844 0.204511 -2.943e-06)
(0.759841 0.270476 -2.40973e-05)
(0.730984 0.281365 2.61641e-05)
(0.631841 0.49615 1.19545e-05)
(0.3864 -0.04291 2.62994e-05)
(0.776222 0.220468 5.4511e-06)
(0.788289 0.134286 1.1087e-05)
(1.19786 0.714565 -2.94701e-05)
(0.811787 0.379402 2.50743e-05)
(0.715124 0.30656 5.80281e-06)
(0.745643 0.0165959 1.10024e-05)
(0.724134 0.606029 1.01164e-05)
(0.871693 0.208246 -6.5838e-06)
(0.71628 0.232406 1.188e-06)
(1.21325 -0.266624 4.70782e-05)
(0.837649 0.057224 2.41361e-05)
(0.698912 0.407465 2.32825e-05)
(1.0029 -0.142167 3.00845e-05)
(0.595554 0.00464834 -2.78218e-05)
(0.788571 0.259367 -8.53092e-06)
(0.73634 0.28985 -1.29238e-05)
(0.689822 0.213169 -2.15557e-05)
(0.893929 0.357603 -1.21425e-05)
(0.884532 0.119674 2.83564e-05)
(0.828952 0.164108 1.02268e-05)
(0.950296 0.21811 -2.9854e-06)
(0.863564 0.199211 3.07781e-05)
(0.888862 0.317549 -1.33362e-05)
(0.843819 0.328571 -1.68506e-05)
(0.816527 0.230537 7.33675e-06)
(0.625464 0.321499 -2.03649e-06)
(0.820552 0.196665 1.76183e-05)
(0.851506 0.152354 1.04424e-06)
(0.833202 0.161518 4.48621e-07)
(1.13952 0.515446 2.66034e-05)
(0.595637 0.134759 -1.77211e-05)
(0.962989 0.027492 3.12759e-05)
(0.838143 0.333046 -8.78757e-06)
(0.808055 0.382671 -9.48334e-06)
(0.809936 0.258967 7.24486e-06)
(1.20138 0.219711 -2.5155e-05)
(0.818599 0.233785 -2.14304e-05)
(0.817457 0.153013 -5.94929e-08)
(0.8835 0.186937 2.69106e-05)
(0.829366 0.231083 1.49848e-05)
(0.820337 0.222577 1.5358e-05)
(0.833705 0.216712 -2.09479e-05)
(0.703761 0.308243 1.90148e-05)
(0.894238 0.302978 -8.79087e-06)
(0.797031 0.225361 1.02187e-05)
(1.23144 0.59942 -3.68696e-05)
(0.511415 -0.0337454 -3.8518e-05)
(0.722176 0.199987 -9.06146e-06)
(0.726512 0.171417 -1.22048e-05)
(0.776449 0.247853 -8.47846e-06)
(0.768258 0.181049 1.74719e-05)
(0.855565 0.266801 -8.91834e-06)
(0.797534 0.309234 1.5892e-05)
(0.879877 0.325899 1.82234e-05)
(0.844965 0.265694 2.45764e-06)
(0.696638 0.187486 2.06315e-05)
(0.848458 0.0871146 1.12936e-05)
(1.01445 0.0187072 2.35764e-05)
(0.583608 0.425446 2.47874e-05)
(0.776957 0.161373 6.95974e-06)
(1.07282 0.282704 -2.44695e-06)
(0.858916 0.0511497 -2.26067e-06)
(1.03065 0.239669 -2.17587e-06)
(0.917245 0.509713 -2.42462e-05)
(0.788612 0.190319 -1.15359e-06)
(0.782371 0.275558 1.49426e-05)
(0.562941 0.21107 -3.76001e-06)
(0.782563 0.107662 7.88136e-06)
(0.858362 0.108095 2.02581e-05)
(0.901835 0.217393 9.89089e-06)
(0.193883 -0.328527 -3.8986e-05)
(0.952334 0.400339 -2.18929e-05)
(0.859878 0.212522 2.57722e-05)
(0.810512 0.205631 2.08682e-05)
(1.02709 0.208766 -1.30095e-05)
(0.62879 0.191717 -2.02503e-05)
(0.802336 0.220122 5.55267e-06)
(0.890693 -0.0859205 -1.07382e-05)
(0.851253 0.141225 -2.35003e-05)
(0.800421 0.237775 8.17273e-06)
(1.06952 -0.179601 -3.34626e-05)
(0.917775 0.0801449 2.4664e-06)
(0.772448 0.258428 -1.93118e-06)
(0.794521 0.152977 -8.10055e-06)
(0.848981 0.219297 8.98265e-06)
(0.74086 0.540337 3.76325e-05)
(0.29936 0.112684 -1.64262e-07)
(0.88778 0.232855 1.29393e-06)
(0.862875 0.408217 -2.53067e-05)
(0.618021 0.132472 -2.47046e-05)
(0.781543 0.155226 -2.62536e-06)
(1.24468 -0.217024 3.63097e-05)
(0.897457 0.1629 1.50691e-06)
(0.798109 0.288483 -2.34569e-06)
(0.766298 0.232595 2.41826e-05)
(0.789493 0.129164 1.07661e-06)
(0.654798 0.107767 -1.98792e-05)
(0.777113 0.245211 -1.80525e-06)
(0.565909 0.387108 -2.65221e-06)
(0.921364 0.0920139 -1.58222e-05)
(0.791371 0.156521 3.87786e-07)
(0.830327 0.139877 -2.04459e-05)
(0.52251 0.112295 -2.53161e-05)
(0.973746 0.0527095 -2.04798e-05)
(0.600672 0.251222 -1.87791e-08)
(0.457378 0.568812 3.13054e-05)
(0.403396 -0.0395247 -3.21198e-05)
(0.739778 0.229039 1.3117e-05)
(0.685764 0.420305 2.60037e-06)
(0.09175 0.956369 4.73985e-05)
(1.01875 0.0928243 2.93289e-07)
(1.00087 0.324861 -2.12539e-05)
(1.2847 -0.254563 3.30907e-05)
(0.784818 0.234051 -8.454e-06)
(0.810758 0.238655 9.96735e-06)
(0.839881 0.220471 2.18136e-05)
(0.752301 0.129052 -7.86881e-07)
(0.785983 0.216149 -5.85072e-06)
(0.729433 0.366468 1.22429e-06)
(0.859536 0.255937 2.10024e-05)
(0.823792 0.28321 5.56215e-07)
(0.830758 0.241271 -2.25372e-05)
(0.781462 0.201509 1.53089e-05)
(0.772542 0.169711 2.15329e-05)
(0.841517 0.232369 -1.22643e-06)
(0.826481 0.237004 -7.09925e-07)
(0.814401 0.21261 1.65834e-06)
(0.701032 0.112928 -3.2702e-05)
(0.809446 0.24708 7.65053e-06)
(0.81957 0.209645 2.03255e-05)
(0.801265 0.242791 1.44006e-06)
(0.596499 -0.103285 -2.23899e-05)
(0.808931 0.206652 2.16265e-05)
(0.788905 0.225189 -8.14924e-06)
(0.817143 0.242734 -1.96746e-05)
(0.84669 0.170439 2.89736e-05)
(1.28848 -0.278595 3.95624e-05)
(0.602454 0.403833 2.38898e-05)
(0.759776 0.038713 -3.00502e-05)
(0.987874 -0.38808 2.78556e-05)
(0.833089 0.0706446 -1.04415e-05)
(0.730773 0.330563 1.09008e-05)
(0.867376 -0.0271971 7.55912e-07)
(0.652789 0.332668 -8.14526e-08)
(1.02854 0.34877 -2.34264e-05)
(0.809857 0.255675 -1.17135e-06)
(0.530675 0.407077 -2.18169e-05)
(0.804756 0.221372 1.05136e-06)
(0.772354 0.220962 -8.296e-06)
(0.800223 0.192594 1.25737e-05)
(0.967793 -0.00959656 2.44503e-05)
(0.790547 0.236554 -2.05178e-06)
(0.761101 0.376747 -1.12356e-05)
(0.797779 0.320974 -7.01125e-07)
(0.62078 0.349091 1.23488e-05)
(0.804287 0.203119 2.22606e-05)
(0.883138 0.39192 -1.18866e-05)
(0.778896 0.22917 2.2141e-05)
(0.7866 0.204149 2.28926e-05)
(1.05325 0.533479 2.60266e-05)
(0.587842 0.269035 -2.68727e-05)
(0.848771 0.274458 -3.44748e-05)
(0.876191 0.145074 1.34006e-06)
(0.830227 0.248683 -3.19738e-05)
(0.798276 0.24588 -1.95867e-06)
(0.879388 0.441866 -2.74299e-05)
(0.79378 0.235623 1.02838e-05)
(0.874287 0.0586328 2.5745e-05)
(0.827384 0.257509 -3.28329e-05)
(0.80076 0.21792 -1.06946e-05)
(0.799829 0.239393 -2.2268e-06)
(0.393193 -0.159919 -3.55349e-05)
(0.962699 0.0685545 8.56557e-07)
(0.730291 0.137929 -7.08218e-06)
(0.807118 0.383804 -8.36973e-07)
(0.945835 0.377244 2.16383e-05)
(0.81307 0.276622 -7.91432e-06)
(0.752582 0.0767244 -1.07361e-05)
(0.733963 0.213614 -1.98256e-05)
(0.773177 0.329273 -2.49094e-07)
(0.8447 0.204134 -8.32564e-06)
(0.409182 0.570604 2.97214e-05)
(0.905985 0.0643659 1.94352e-05)
(0.644454 0.199533 -3.31979e-05)
(0.645722 0.59566 2.02154e-05)
(0.720296 0.169992 -1.1047e-05)
(0.661685 -0.0605237 -1.53923e-05)
(0.802208 0.234242 -2.74504e-05)
(0.941792 0.0604744 1.91753e-05)
(0.900485 0.0244914 1.67006e-05)
(0.887535 0.31535 1.43409e-05)
(1.18019 0.547139 -3.34099e-05)
(0.759248 0.262715 2.36037e-05)
(0.795617 0.192976 -2.8278e-06)
(0.584464 0.208405 -3.8983e-10)
(0.949027 0.0215102 2.13304e-05)
(0.799907 0.0722658 -1.11793e-05)
(1.02038 0.493105 2.31061e-05)
(0.900351 0.426025 -1.50285e-05)
(0.814744 0.299428 4.09954e-06)
(0.801316 0.233266 -2.03326e-05)
(0.833549 0.174736 -2.08038e-05)
(0.793256 0.257138 -2.81936e-05)
(0.932149 0.322413 1.65331e-05)
(0.759706 0.1506 1.65285e-05)
(0.787023 0.228696 1.37268e-06)
(0.696855 0.102552 -3.17985e-05)
(0.751157 0.19587 1.47779e-06)
(0.969111 0.383093 2.10789e-05)
(0.859603 0.175083 -2.19473e-05)
(0.796748 0.258845 7.41543e-06)
(0.921547 0.0335802 2.43181e-05)
(0.791907 0.299258 -3.72038e-07)
(0.910944 0.0292376 -6.85044e-07)
(0.773658 0.0543838 -2.86607e-06)
(0.808511 0.114091 -2.23562e-06)
(0.898192 0.270631 -9.87878e-06)
(0.959982 0.023652 2.84733e-05)
(0.846328 0.258929 -7.41404e-06)
(0.759647 0.222289 8.41998e-06)
(0.518026 0.278668 6.93604e-08)
(1.00523 0.212311 -2.81769e-05)
(0.977371 -0.00608173 2.83152e-05)
(0.574543 0.00866594 -2.86368e-05)
(0.750825 0.170563 7.27272e-06)
(1.14387 0.187074 2.17948e-05)
(0.778628 0.213725 1.87945e-05)
(0.713375 0.299734 3.44302e-05)
(0.811099 0.320092 -1.16914e-05)
(0.760523 0.219225 -2.66007e-08)
(0.861516 0.240133 -6.96392e-06)
(0.78714 0.282109 -1.00585e-06)
(0.858893 0.224462 -2.35888e-05)
(0.824849 0.33218 -6.9524e-07)
(0.616894 0.000734699 -2.82479e-05)
(0.815239 0.343593 -1.33895e-05)
(0.438577 -0.117008 -3.19045e-05)
(0.841833 0.252473 3.36349e-06)
(0.620999 0.0233231 -2.2116e-05)
(0.91528 0.20814 2.25537e-05)
(0.513744 0.458892 -2.21855e-05)
(0.883053 0.325223 7.81927e-07)
(0.970304 0.343426 -1.13866e-05)
(0.687858 0.533159 -1.37462e-05)
(0.316814 0.261075 1.65621e-06)
(0.655916 0.271956 -1.85816e-05)
(1.22643 0.322023 -3.15165e-05)
(0.772574 0.198145 1.80803e-05)
(0.756965 0.196328 -2.05871e-05)
(0.934367 0.279779 1.06153e-06)
(0.881997 0.274329 2.84706e-06)
(0.574029 0.348412 2.20615e-05)
(0.83174 0.0805031 -2.16672e-05)
(0.773161 0.14979 1.77171e-06)
(0.794869 0.235071 -1.47046e-06)
(0.937735 0.113041 1.92328e-05)
(0.731799 0.291819 -1.07914e-06)
(0.734763 0.360804 -2.30411e-05)
(1.11841 0.348841 -1.27122e-05)
(0.791638 0.151396 2.89528e-06)
(0.868779 0.42916 1.94185e-06)
(0.916626 0.35148 1.16667e-06)
(0.746316 0.110367 2.18994e-06)
(0.791785 0.228784 -1.93685e-05)
(0.579452 0.240351 -2.32461e-05)
(0.745408 0.172316 -1.99543e-05)
(0.686126 0.146489 2.04685e-05)
(0.683383 0.174771 -1.71867e-05)
(1.25125 -0.0691792 -3.1238e-05)
(1.12612 -0.0740625 -3.31028e-05)
(0.531458 0.0750931 -2.15111e-05)
(0.468129 0.593532 3.0328e-05)
(0.824724 0.375507 -2.58113e-07)
(0.845086 0.202362 -1.93981e-05)
(0.806107 0.208084 1.52361e-05)
(0.744364 0.239865 1.0029e-05)
(0.835774 0.240416 -7.42067e-07)
(0.988971 0.0203912 1.7275e-05)
(0.760148 0.302638 1.46952e-05)
(0.997893 0.0419035 2.77439e-05)
(0.847419 0.345959 -2.77348e-06)
(0.463355 0.537949 3.50016e-05)
(0.790129 0.215058 -6.61331e-06)
(0.821405 0.220509 -6.76461e-06)
(0.965537 0.178701 -2.38161e-06)
(0.76991 0.35837 2.18447e-05)
(0.992127 0.225802 2.58988e-05)
(0.611285 -0.274176 2.11339e-05)
(0.711471 0.171569 1.29122e-06)
(0.813826 0.20736 -2.31381e-05)
(0.835603 -0.0984619 -2.77417e-05)
(1.26319 0.159609 -2.81568e-05)
(0.700231 0.326159 1.12425e-05)
(1.0844 -0.0678523 -2.98427e-05)
(0.791396 0.20921 -2.32941e-05)
(1.02818 0.551523 -2.99555e-05)
(0.824921 -0.17904 -1.43522e-05)
(0.906698 0.298916 2.63556e-06)
(0.673299 0.356689 2.61493e-05)
(0.824479 0.240887 -2.43435e-06)
(0.771198 0.301799 1.02553e-06)
(0.704865 0.0665529 -2.35526e-05)
(0.766332 0.413138 -1.16306e-05)
(0.663859 0.311403 2.30312e-05)
(0.814114 0.191451 1.22638e-05)
(0.478947 -0.115149 3.62408e-05)
(0.922657 0.337665 -1.08076e-05)
(0.754194 0.113485 2.389e-05)
(1.03882 0.499219 -1.18419e-07)
(0.631012 0.157866 -4.58431e-06)
(0.845719 0.179879 2.02917e-05)
(0.765288 0.0643928 8.01542e-07)
(0.783039 0.0727524 3.16442e-05)
(0.99613 0.226418 1.30208e-06)
(0.800074 0.282766 -7.1947e-06)
(0.676524 0.471948 -1.78319e-05)
(0.719679 0.222379 5.08631e-06)
(0.74359 0.460409 1.89312e-06)
(0.695586 0.116771 -3.16452e-05)
(0.83222 0.245065 -1.16119e-05)
(1.00564 0.044818 -2.30963e-05)
(1.28758 -0.234704 3.47195e-05)
(0.768022 0.284244 1.27074e-06)
(0.973117 0.249859 -3.20819e-05)
(0.827576 0.306595 -2.85621e-07)
(0.600441 0.19887 -3.30571e-05)
(0.83367 0.244923 2.03268e-06)
(0.754943 0.151324 -1.09835e-05)
(0.773532 0.261824 -2.1227e-05)
(0.529858 -0.0343017 -2.44246e-05)
(0.552705 0.260754 1.39007e-06)
(0.511513 0.0137888 -2.88537e-05)
(0.979198 0.34478 -2.29991e-06)
(0.691076 0.342666 3.13344e-05)
(0.778834 0.271427 2.11755e-05)
(0.618719 0.188296 -2.05482e-06)
(0.882519 0.132305 -1.56865e-06)
(0.779088 0.213233 4.53641e-08)
(0.796478 0.108836 -2.87163e-05)
(0.786329 0.279588 -1.78673e-08)
(0.746362 0.223794 -2.10583e-05)
(0.822232 0.134718 -1.52455e-06)
(0.629724 0.042059 -2.64532e-05)
(0.833758 -0.0942377 2.6636e-05)
(1.26956 0.455151 -2.68988e-05)
(0.739993 0.219013 -7.13549e-06)
(0.792354 0.263299 -2.07182e-05)
(0.80572 0.244424 -3.12391e-05)
(0.960644 0.0215615 2.25479e-05)
(0.754802 0.21417 2.13974e-06)
(0.669548 0.531865 -2.68519e-05)
(0.918273 0.234651 -2.23153e-06)
(0.622759 0.181667 2.43951e-05)
(0.639622 0.0736577 -2.93825e-05)
(0.842186 0.259704 1.31244e-05)
(0.541496 0.182428 -2.40667e-06)
(0.696893 0.329392 2.52358e-05)
(0.918942 0.153362 -1.5941e-06)
(0.73397 0.252082 3.56832e-06)
(0.758728 0.0170586 2.89629e-06)
(0.733952 0.23262 1.24729e-06)
(0.615447 0.220233 -3.24594e-07)
(1.06957 -0.0607612 1.54103e-05)
(0.726881 0.294211 2.90558e-05)
(0.806273 0.270771 -2.00617e-05)
(0.756686 0.314004 2.82837e-05)
(0.780947 0.104968 1.41044e-06)
(1.1419 0.524055 2.69456e-05)
(0.496168 -0.1104 -3.35533e-05)
(0.829471 0.185048 5.58367e-06)
(0.690881 0.219229 -2.18734e-06)
(0.734126 0.395461 1.01456e-06)
(0.972697 0.364124 2.1728e-05)
(0.758045 0.288181 7.37729e-06)
(0.783065 0.33896 1.38914e-06)
(0.517789 0.492558 2.96665e-05)
(1.10743 -0.0473994 1.65257e-05)
(0.853948 0.22582 -1.26694e-05)
(0.651647 0.164992 -2.92694e-05)
(0.643049 0.215655 -2.68249e-05)
(0.552652 0.129467 -2.99592e-05)
(0.65316 0.314426 -8.10743e-06)
(0.877629 0.14446 1.36133e-05)
(0.632539 0.288675 1.60795e-05)
(0.81591 0.233883 -3.01096e-05)
(0.864413 0.251934 -2.46541e-05)
(0.788709 0.229493 -8.149e-06)
(0.60976 0.237692 -2.62589e-05)
(0.754796 0.220644 3.07213e-07)
(0.951885 0.383063 -2.6493e-05)
(0.803437 0.528161 -2.8381e-05)
(0.792163 0.0875503 -1.2903e-06)
(0.742243 0.207814 2.35372e-06)
(0.834742 0.323301 2.76068e-06)
(0.815347 0.22468 2.42305e-06)
(0.734472 0.157616 -1.73952e-05)
(0.734439 0.107131 -1.4566e-05)
(0.923916 0.0956434 -1.45285e-05)
(0.788872 0.234998 2.27802e-07)
(0.790604 0.250265 -1.72593e-05)
(0.858127 0.0631163 -4.35602e-07)
(0.766145 0.237679 -2.12588e-06)
(0.85456 -0.0310803 -1.89916e-05)
(0.962807 0.0458932 2.26278e-05)
(0.975751 0.36546 2.20847e-05)
(0.781766 0.237966 1.08933e-06)
(1.18569 0.134254 1.12285e-06)
(0.470193 0.349772 1.74781e-06)
(0.810791 0.217395 -1.51057e-05)
(0.809659 0.225493 -1.50726e-05)
(0.804891 0.227176 -2.39625e-05)
(0.525956 0.111956 -2.63018e-05)
(1.14282 0.182919 1.74661e-06)
(0.835802 0.045785 -2.24789e-05)
(1.445 0.913339 -5.07595e-05)
(0.417796 -0.18151 -5.02768e-05)
(0.906587 0.315587 -3.45805e-05)
(0.583369 0.200947 -1.42638e-05)
(0.965141 0.0372134 -2.19419e-05)
(1.00222 0.36181 -2.70295e-05)
(0.824473 0.260692 -7.01536e-06)
(0.814622 0.202316 8.81711e-06)
(0.801317 0.22701 -8.59503e-06)
(0.607489 0.190729 2.56772e-05)
(0.792601 0.336041 1.12054e-05)
(0.607509 0.21211 1.05516e-07)
(0.65266 0.192403 -1.17498e-06)
(0.818498 0.265316 1.88739e-06)
(0.616378 0.368832 2.21369e-05)
(1.02483 0.261603 1.37701e-06)
(0.776875 0.139208 1.76991e-06)
(1.43262 0.179622 -2.6757e-05)
(0.879475 0.206178 2.60891e-06)
(0.792779 0.194759 2.56406e-06)
(0.928784 0.433868 -2.18163e-05)
(0.813965 0.33271 -1.90991e-05)
(0.721411 0.210539 8.44763e-06)
(1.03656 0.208793 1.82171e-06)
(0.824971 0.163357 1.74946e-05)
(0.822137 0.19486 7.57517e-06)
(0.798906 0.432792 -1.01848e-05)
(0.779971 0.135922 5.10418e-06)
(0.697477 0.169173 -2.5067e-05)
(0.871077 0.248597 1.17392e-05)
(0.804143 0.261904 -9.31749e-06)
(0.894686 0.221424 1.58618e-05)
(0.576051 -0.042431 -2.26526e-05)
(0.362997 -0.193519 -3.94737e-05)
(0.892081 0.299333 -2.51919e-05)
(0.693115 0.397081 1.25903e-06)
(0.764522 0.165553 -2.66652e-06)
(0.820491 0.228267 -5.49982e-06)
(1.40952 -0.354105 -3.83172e-05)
(0.976802 0.126326 2.2591e-05)
(0.572726 0.451728 4.38514e-05)
(0.804685 0.350033 -8.48331e-07)
(0.797371 0.208894 2.83774e-05)
(0.779464 0.311776 4.69566e-07)
(0.905059 0.162151 9.11238e-06)
(0.796509 0.211879 2.12034e-06)
(0.351581 0.641791 3.78631e-05)
(0.977138 0.405592 -2.34725e-05)
(0.681761 0.188715 3.06692e-05)
(0.768643 0.216028 -1.72374e-05)
(0.746089 0.379539 2.83369e-05)
(0.948441 0.170355 -9.63138e-07)
(0.664834 0.203329 1.39323e-07)
(0.818803 0.229806 -2.14934e-05)
(0.718572 0.201914 2.51409e-06)
(0.598341 0.0256875 -2.03798e-05)
(0.510555 0.47651 2.49618e-05)
(0.826792 0.447539 -8.88482e-06)
(0.892708 0.296071 -2.79657e-05)
(0.664848 0.0488271 1.22731e-06)
(0.952182 0.0662971 2.47304e-07)
(0.925941 0.218281 1.96457e-05)
(0.752283 0.197558 -3.67569e-07)
(0.811536 0.2423 1.82188e-06)
(0.843278 0.197434 1.32681e-05)
(0.418017 0.54177 -2.70818e-05)
(0.817626 0.365538 -2.86835e-06)
(0.478989 -0.101105 -3.27254e-05)
(0.770156 0.317079 -1.05508e-05)
(0.958592 -0.0502934 -1.81574e-05)
(0.793962 -0.0305498 3.39153e-05)
(0.690533 0.333761 2.824e-05)
(0.792616 0.166908 2.39028e-05)
(0.772614 0.283846 1.9416e-05)
(0.828784 0.286659 -2.02298e-06)
(0.80425 0.293043 2.00218e-05)
(0.576362 0.0065067 -3.12975e-05)
(1.62396 -0.418166 -3.4973e-05)
(0.705 -1.21415 -4.40655e-05)
(0.701403 1.21922 -4.08337e-05)
(0.78945 0.261558 -1.69458e-05)
(1.0909 -0.231972 -1.43899e-05)
(0.707081 0.22449 -3.07474e-05)
(0.779686 0.274966 -1.13622e-05)
(0.835439 0.260993 -2.93057e-05)
(0.90936 0.0678214 -1.33455e-05)
(0.25209 -0.689547 -3.68733e-05)
(0.825033 0.0385309 -2.3511e-05)
(0.838953 0.308002 -1.30299e-05)
(0.799699 0.283289 -1.37854e-05)
(0.0386632 0.677227 -3.78648e-05)
(0.803182 0.247937 1.53605e-06)
(0.80808 0.239302 -1.86566e-05)
(0.784263 -0.054033 1.20969e-06)
(0.775946 0.312327 2.53973e-05)
(0.796763 0.280807 1.33754e-06)
(0.769614 0.21336 -1.82986e-05)
(0.817217 0.18987 -1.91327e-05)
(0.78909 0.272898 1.51171e-05)
(0.786102 0.258676 -2.00261e-05)
(-0.152208 0.159045 -2.9426e-05)
(0.758925 0.104713 1.86964e-05)
(-0.013193 0.0483833 -4.62296e-05)
(0.0810999 -0.301278 -4.65772e-05)
(0.772751 0.230727 -2.03576e-05)
(0.863426 0.272108 -1.94231e-05)
(0.787717 0.159511 1.73272e-05)
(0.742911 0.0176697 1.97473e-06)
(0.783882 0.196532 -1.75763e-05)
(0.81524 0.234501 -1.7613e-05)
(0.805137 0.292918 -1.0954e-05)
(0.81038 0.171482 -5.27165e-07)
(0.826473 0.645482 -2.71015e-05)
(0.815613 0.0377121 5.41678e-07)
(0.532447 -0.142559 -2.68845e-05)
(0.953798 0.444067 -2.27161e-05)
(0.877979 0.264163 -1.30851e-05)
(0.699691 0.267054 1.07513e-05)
(0.792206 0.229412 -1.70834e-05)
(0.789824 0.23594 -1.64449e-05)
(0.746656 -0.0461401 -1.11944e-05)
(0.742956 0.404966 -1.24829e-05)
(0.771569 0.225887 1.50832e-06)
(0.724853 0.0586588 -2.69372e-05)
(1.02275 0.371891 -1.55761e-06)
(0.641863 0.217745 3.26749e-07)
(0.853953 0.233316 -1.49894e-05)
(0.658229 -0.0391496 2.80021e-06)
(0.913363 0.298931 1.36113e-05)
(0.997793 0.40092 -2.4586e-05)
(0.671592 0.130457 -1.29699e-05)
(0.824456 -0.00230886 -3.02645e-05)
(0.766491 1.04709 -4.97432e-05)
(0.782363 0.140604 -2.39491e-05)
(0.70875 0.511347 -2.17846e-08)
(0.817066 0.123612 -1.13615e-06)
(0.807556 0.313704 -4.32533e-05)
(0.490595 0.16408 1.78671e-07)
(0.31423 0.704854 4.1016e-05)
(0.688979 0.315908 3.3067e-05)
(0.787897 0.211022 1.43331e-06)
(0.439032 0.212755 -6.76303e-08)
(1.01814 0.218327 9.64023e-06)
(1.01895 0.572507 1.99326e-07)
(0.418605 0.630298 3.46207e-05)
(0.386253 0.722448 4.68407e-05)
(1.11478 -0.135652 2.61879e-05)
(0.820647 0.124104 -3.44233e-05)
(0.701755 0.0698132 1.98617e-06)
(0.877519 0.379663 -2.45963e-05)
(0.794826 0.241485 1.57639e-06)
(1.28265 -0.027139 1.478e-06)
(0.600061 0.422426 -4.66561e-05)
(0.444237 -0.214239 -3.80929e-05)
(0.742972 0.159204 -1.81919e-06)
(0.439803 0.56201 3.36817e-05)
(0.726805 0.157554 -1.41084e-05)
(0.274842 0.194847 6.58567e-08)
(0.80974 0.228176 2.23774e-06)
(0.810914 0.274072 -1.59982e-05)
(0.711201 0.273443 -1.98365e-06)
(0.902971 0.294713 -1.37054e-06)
(0.390092 0.62953 3.70026e-05)
(1.23106 -0.142858 2.02819e-05)
(0.569332 0.418986 2.38533e-05)
(0.715514 0.195066 -1.65505e-05)
(1.01238 0.263913 -2.69811e-05)
(0.786964 0.199841 -2.86187e-06)
(0.942616 0.0858143 1.24452e-05)
(0.664232 0.338922 2.77926e-05)
(0.49971 0.19739 -1.22031e-05)
(0.753711 0.108453 -1.74432e-05)
(0.476526 -0.136209 -3.1983e-05)
(0.810506 0.353021 2.00417e-05)
(0.747307 0.215581 1.01978e-06)
(1.24175 -0.261438 3.69189e-05)
(0.603794 0.225306 -2.57624e-05)
(0.830496 0.209234 1.63851e-06)
(0.95979 0.0386645 6.15095e-07)
(0.807953 0.145364 -2.3991e-05)
(0.966611 0.385267 -2.34006e-05)
(1.07858 -0.125001 -1.86071e-05)
(0.840909 0.388053 -5.2689e-07)
(0.764887 0.212004 -7.36736e-06)
(0.729508 0.226664 -1.80949e-06)
(0.466439 0.544698 3.14627e-05)
(0.915923 0.208208 2.1727e-06)
(0.967689 -0.194807 1.54841e-06)
(0.975525 0.242884 -2.58311e-05)
(0.791389 0.349702 -2.54192e-06)
(0.764186 0.218042 -2.45957e-07)
(0.851848 0.181377 9.76739e-06)
(0.811144 0.162393 -6.40804e-06)
(0.37778 -0.00726759 -3.5693e-05)
(0.831662 0.0345379 2.78881e-05)
(0.65029 0.237168 2.66475e-07)
(0.497708 -0.0782009 -3.41272e-05)
(0.638583 -0.236592 -2.24623e-05)
(0.822876 0.233883 -1.09179e-06)
(0.788373 0.205511 4.61769e-06)
(0.597793 0.187638 1.22836e-06)
(0.723849 0.324502 2.1922e-05)
(0.563182 0.0856204 -2.55016e-05)
(0.699518 0.0528938 2.21847e-05)
(0.974632 0.515987 -2.74325e-05)
(0.755592 0.209573 4.30741e-08)
(0.562134 0.473921 2.1687e-05)
(0.850234 0.240518 1.91733e-05)
(0.797169 0.192033 -3.48347e-05)
(0.91494 0.349415 -2.56003e-05)
(0.910159 0.369273 3.89104e-06)
(0.841973 0.176804 2.86137e-05)
(0.521535 0.441162 1.89181e-06)
(0.814421 0.0696861 1.5919e-06)
(0.750523 0.21695 -1.31342e-05)
(0.800681 0.316961 -1.09853e-05)
(1.02333 0.411485 -2.28855e-05)
(0.958911 0.247881 -6.76115e-07)
(0.795853 0.0525349 9.15279e-07)
(0.63069 0.00385671 -5.83548e-07)
(0.806767 0.212606 2.12274e-05)
(0.38243 0.670333 3.87906e-05)
(0.80977 0.21917 2.44487e-06)
(0.870673 0.181257 -1.97244e-06)
(0.820034 0.128559 1.04344e-06)
(1.10849 0.498381 -4.59801e-05)
(0.759996 0.180128 -9.24535e-06)
(0.338762 -0.207252 -4.01775e-05)
(0.963958 0.242415 -7.26345e-06)
(0.682475 0.15231 -1.97262e-05)
(0.876508 0.162533 1.48445e-05)
(0.484845 -0.0978437 -3.31256e-05)
(0.829847 0.218282 -2.09346e-06)
(0.909556 0.221531 2.34297e-06)
(0.776031 0.193701 -1.99912e-05)
(0.825616 0.282745 -2.2551e-05)
(0.814642 0.227408 -2.07226e-05)
(0.848321 0.384811 -1.22985e-05)
(0.458735 -0.11577 -2.37819e-05)
(0.829375 0.333463 -3.44336e-05)
(0.594379 0.404181 3.52759e-05)
(0.804652 0.188396 -1.65575e-06)
(0.817761 0.227403 1.56857e-06)
(0.887107 0.368628 -1.76305e-05)
(0.792521 0.238603 1.22547e-05)
(0.734528 0.268359 3.17942e-05)
(0.352769 0.831627 4.2125e-05)
(0.764326 0.0320044 1.09061e-05)
(0.842347 0.566264 -2.57151e-05)
(0.834771 0.34865 -2.26678e-06)
(0.995494 0.594226 -3.45816e-05)
(0.847667 0.248818 -2.38162e-06)
(0.792857 0.266638 3.10126e-06)
(0.803701 0.215046 2.17331e-05)
(0.166683 0.843945 4.87966e-05)
(0.671423 0.281587 -1.98895e-06)
(0.772526 0.237285 1.6855e-06)
(0.827399 0.250651 -1.65689e-05)
(0.441643 0.511095 3.27522e-05)
(0.637105 0.208162 7.79326e-08)
(0.913542 0.176479 2.17992e-05)
(0.584444 -0.000109419 2.61376e-05)
(0.788784 0.230727 3.31332e-05)
(0.220906 0.71573 4.44719e-05)
(0.830841 0.12843 2.06312e-06)
(0.792997 0.213537 -7.21408e-06)
(0.761132 0.218739 1.58419e-06)
(1.10658 -0.0491919 3.49499e-05)
(0.725732 0.0565161 -2.62813e-05)
(0.764918 0.23516 1.21443e-06)
(0.775028 0.132024 -2.4722e-05)
(0.934756 0.273124 -2.82915e-05)
(0.92946 0.264111 -1.4473e-05)
(0.762013 0.22114 -1.8396e-06)
(0.909484 0.289865 -1.23249e-06)
(0.854102 0.360623 7.98403e-07)
(0.78573 0.212062 -5.73363e-06)
(0.904301 0.273807 1.30965e-06)
(0.811005 0.217731 1.71698e-05)
(0.820268 0.0524145 2.00962e-06)
(0.882127 0.341683 -2.93768e-05)
(0.680604 0.309404 2.6988e-05)
(0.831846 0.198951 1.48059e-06)
(0.524576 -0.0678608 -3.1144e-05)
(0.812839 0.228114 -3.26316e-05)
(0.813931 0.246661 -6.63706e-06)
(0.491783 -0.0826631 -2.9656e-05)
(0.852807 0.210397 1.17256e-06)
(1.58597 -0.543159 3.95798e-05)
(0.823176 0.0568721 2.02287e-06)
(0.71172 0.0615429 -2.53888e-05)
(0.8495 0.31302 -1.60488e-06)
(0.799952 0.216084 1.26332e-06)
(0.868111 0.370702 -3.08254e-06)
(0.920172 0.0940255 -1.24912e-05)
(0.837879 0.204925 -1.96506e-05)
(1.00615 -0.0130349 1.99235e-05)
(0.431077 0.626744 4.03096e-05)
(1.36731 -0.304652 -3.91809e-05)
(0.903861 0.29526 8.21356e-07)
(1.04831 0.388343 -2.53637e-05)
(0.603318 0.214769 1.55429e-06)
(0.820432 0.135072 2.93896e-05)
(0.769814 0.173806 1.16383e-06)
(0.727572 0.175585 -2.02854e-05)
(0.337419 0.521521 -2.39704e-05)
(0.91869 0.0536486 2.32748e-05)
(0.793512 0.0791838 1.09525e-05)
(0.930886 0.0209382 9.51377e-07)
(1.10619 0.039642 -2.63619e-05)
(0.827013 0.261496 -1.29673e-05)
(1.53854 -0.0367483 4.91278e-07)
(0.777861 0.0469688 1.09392e-05)
(0.943889 0.265133 3.1476e-06)
(0.707939 0.214654 1.51744e-06)
(1.02985 0.12323 1.90357e-05)
(1.08544 -0.146709 -1.91055e-06)
(0.782079 0.307785 1.10429e-07)
(0.92895 0.225068 3.25442e-06)
(0.80095 0.223929 1.40836e-06)
(1.08723 0.45344 -3.88996e-05)
(0.826099 0.219844 1.5554e-05)
(0.914505 0.320349 -1.05825e-05)
(0.589156 0.464416 1.05914e-06)
(0.800725 0.428421 1.99283e-06)
(0.795145 0.232438 1.379e-06)
(1.5665 -0.531496 4.12828e-05)
(0.598867 0.385037 -1.3475e-05)
(0.799498 0.165366 2.36666e-05)
(0.759527 0.141909 2.17703e-06)
(0.804321 0.221117 2.29928e-05)
(0.654827 1.04818 3.3369e-07)
(0.333259 0.244856 -1.16747e-06)
(0.27837 -0.610852 -3.9509e-06)
(1.61267 0.593702 4.96767e-07)
(0.87044 0.118824 3.82208e-06)
(0.813746 0.244756 2.72069e-06)
(0.825112 0.0285839 -8.15282e-07)
(1.11403 -0.215417 8.18323e-07)
(0.776138 0.233502 1.98827e-06)
(1.03659 -0.00759746 3.38107e-05)
(0.786212 0.211025 1.16695e-06)
(0.718749 0.208601 1.62311e-06)
(0.725754 0.234876 3.67208e-07)
(0.397101 0.574436 3.62506e-05)
(0.79568 0.233535 6.30066e-07)
(1.41238 0.129754 4.99705e-07)
(1.23926 0.100946 3.03574e-06)
(1.01234 0.449361 -3.26115e-05)
(0.527275 -0.0603804 -2.37198e-05)
(1.24632 0.225287 1.95995e-05)
(0.651146 0.430599 3.45238e-06)
(0.753195 0.158539 -7.0611e-07)
(0.697034 1.24843 2.86398e-06)
(1.18769 0.595236 4.58955e-06)
(0.804843 0.212788 -2.57952e-05)
(0.805695 0.230377 7.37821e-06)
(0.741319 0.364856 1.49922e-05)
(0.818278 0.384063 5.72511e-06)
(0.496509 -0.137997 -3.38589e-05)
(0.963104 0.373823 -2.06468e-05)
(0.955624 0.0626115 2.23816e-05)
(0.859224 0.17651 7.12796e-06)
(0.776739 0.228971 4.40998e-05)
(0.353422 -0.368635 3.9869e-06)
(1.04783 -0.111219 3.82254e-05)
(0.794671 0.532322 1.20364e-06)
(1.2143 -0.207363 4.11328e-05)
(0.428336 0.205903 7.37748e-07)
(0.69323 0.246673 1.47013e-06)
(1.1606 0.547512 -3.88014e-05)
(0.805599 0.168718 2.56502e-06)
(1.07589 0.470833 1.6914e-06)
(0.805949 0.505212 -9.35223e-07)
(0.802766 0.234199 1.55024e-06)
(0.891706 0.119787 2.55418e-05)
(0.854445 0.21695 2.46456e-06)
(0.834223 0.204628 -3.47628e-05)
(0.929566 0.00358619 2.67474e-06)
(0.999447 0.690417 -2.70639e-05)
(0.805161 0.133473 -1.90302e-06)
(0.46367 0.264956 2.37309e-06)
(0.994603 0.152702 1.70638e-06)
(0.789923 0.199905 1.46229e-06)
(0.848251 0.155589 7.12876e-07)
(0.816716 0.229301 1.22641e-05)
(1.1683 -0.123666 3.80007e-05)
(1.06779 0.493194 -2.72877e-05)
(0.969899 0.03498 2.63998e-05)
(0.568585 0.42841 1.8985e-05)
(0.81329 0.237517 2.92096e-06)
(1.03257 0.189633 -2.26735e-07)
(0.405236 0.541544 3.62915e-05)
(0.864078 0.204197 1.66705e-06)
(0.874083 0.0359162 1.55743e-06)
(0.815496 -0.539333 -2.90108e-05)
(0.814141 0.198364 1.36513e-06)
(0.67415 -0.0830212 2.65077e-06)
(0.709033 -0.0639034 3.53416e-06)
(0.816462 0.249635 2.67301e-06)
(0.97094 0.502322 -3.01009e-05)
(0.829131 0.705953 -4.12176e-07)
(0.763521 0.335322 -1.47181e-05)
(0.5257 0.263048 1.5019e-06)
(0.767916 0.240892 2.49636e-05)
(0.692293 0.27423 1.996e-06)
(0.983097 0.982207 -3.59363e-05)
(0.820489 0.193158 2.36411e-05)
(0.317927 0.734035 2.8632e-05)
(0.868232 0.429259 -2.07381e-06)
(0.59007 0.234716 6.90097e-07)
(0.885701 -0.251743 2.64779e-06)
(0.811433 0.254363 -8.45093e-06)
(0.775942 0.195783 2.63627e-06)
(0.654896 0.285592 2.14084e-06)
(0.701953 0.21204 1.96699e-05)
(0.958782 -0.152533 -1.46955e-06)
(0.825792 0.217313 2.46981e-06)
(1.6002 -0.52182 4.08782e-05)
(0.809219 0.256179 -3.23777e-05)
(0.768266 0.171308 -2.31071e-05)
(0.726459 0.279147 -1.35541e-05)
(1.005 0.393973 -2.34409e-05)
(0.911363 0.240309 -1.25473e-05)
(0.897895 0.101636 3.51934e-05)
(0.928522 0.0513941 1.97918e-05)
(1.07475 0.510815 -4.50899e-05)
(1.5166 -0.282809 -3.54991e-05)
(0.899793 0.27749 -1.71674e-05)
(0.828997 0.434435 -2.24381e-05)
(0.858354 0.145195 2.56436e-05)
(1.22322 0.618884 -3.25634e-05)
(-0.692141 1.59774 6.25855e-05)
(-0.489907 1.42339 5.82911e-05)
(0.893792 0.130676 4.43703e-05)
(2.11561 -1.06627 5.56252e-05)
(0.943249 0.0857777 5.02021e-05)
(0.734632 0.260738 2.78405e-05)
(1.74759 -0.788394 4.21042e-05)
(0.8135 0.198144 2.97653e-05)
(0.755281 0.238423 2.73465e-05)
(0.850276 0.219643 8.29199e-06)
(-0.267148 1.48935 6.62883e-05)
(0.808815 0.133574 1.99246e-06)
(0.782002 0.248203 -6.74728e-06)
(2.36737 -1.4011 6.89145e-05)
(0.837215 0.199883 9.81967e-06)
(0.680216 0.328377 5.69167e-05)
(0.837498 0.120834 -1.8626e-06)
(0.886305 0.033637 1.58691e-05)
(1.49869 -0.443941 3.80696e-05)
(0.84854 0.158558 3.30473e-07)
(0.84352 0.229683 -2.18307e-05)
(0.883728 0.129334 -3.0852e-06)
(0.0621714 0.920793 4.97486e-05)
(0.834155 0.20918 5.26935e-07)
(0.621548 0.420814 3.84485e-05)
(0.86494 0.00995336 1.73707e-06)
(0.675649 0.0532057 -2.93867e-05)
(1.32705 -0.286507 3.20382e-05)
(0.913439 0.255249 -2.31871e-06)
(0.680889 0.168152 6.23575e-07)
(0.846939 0.217673 1.60178e-06)
(1.15735 -0.0978273 1.9338e-05)
(1.42734 0.116916 3.24102e-07)
(0.325014 0.685905 4.23253e-05)
(0.758918 0.200784 2.30463e-06)
(0.673491 0.324257 2.29276e-06)
(0.549896 0.0658183 -3.53211e-05)
(0.327588 0.674218 3.98639e-05)
(1.1212 0.177155 5.83414e-07)
(0.924743 0.89997 1.20172e-06)
(0.569623 -0.249629 -4.6209e-05)
(0.72953 0.267909 2.91268e-05)
(0.868471 0.127394 3.1577e-05)
(1.58972 -0.5677 3.55099e-05)
(-0.0154272 1.03251 4.16467e-05)
(0.747594 0.275477 5.16944e-05)
(0.8594 0.244782 7.98861e-07)
(0.214769 0.810492 4.9814e-05)
(1.12742 0.331524 3.35583e-06)
(0.82193 0.204547 4.73426e-05)
(-0.394781 1.28914 6.53559e-05)
(0.82047 0.203265 2.72964e-06)
(-0.234844 1.26357 5.82027e-05)
(-0.191182 0.57852 2.82647e-06)
(0.382125 0.0430598 -3.18725e-06)
(0.747188 0.443822 9.30973e-06)
(0.830973 0.177872 2.35273e-05)
(1.51787 -0.385975 3.47967e-05)
(0.504797 -0.0739029 6.77258e-06)
(0.781575 0.204744 6.24007e-06)
(0.549004 -0.139484 6.70502e-06)
(1.26302 -0.212064 2.80521e-05)
(0.789772 0.161285 6.68218e-06)
(1.01461 -0.421438 -2.09593e-05)
(0.87337 0.12774 2.57405e-05)
(0.854269 -0.160939 -3.43234e-05)
(0.814906 0.17135 -1.60871e-05)
(1.18839 0.101717 -1.83904e-06)
(0.909136 0.177474 -1.67619e-05)
(0.824624 0.258514 4.62077e-06)
(0.799986 0.269763 6.75707e-06)
(0.506835 -0.0546802 -1.96043e-05)
(1.00895 0.137425 -1.51164e-05)
(0.775508 0.316301 6.48275e-06)
(0.874934 0.200134 -1.84536e-05)
(0.910978 0.073827 2.95262e-05)
(0.453299 0.159173 1.65034e-05)
(0.794899 0.351688 2.69615e-05)
(1.0088 -0.0312541 2.44775e-05)
(1.33097 -0.258145 4.82401e-05)
(0.439814 -0.225407 -2.57693e-05)
(0.624683 0.438961 -4.86481e-06)
(0.679505 0.247872 -7.35404e-06)
(0.807362 0.321381 1.91783e-05)
(0.966422 0.347243 -4.04586e-05)
(0.864991 0.223535 2.52057e-05)
(0.828277 0.22277 1.40217e-05)
(0.80396 0.189373 -2.53707e-06)
(1.06375 0.565652 -3.9593e-05)
(0.82523 0.191795 -6.00986e-06)
(0.859058 0.284837 -3.74427e-05)
(0.925202 0.179939 -6.88731e-06)
(0.835158 0.239687 -1.88356e-05)
(0.857778 0.232671 -2.93753e-05)
(0.808749 0.221114 -1.79125e-05)
(0.756969 0.0941593 2.36137e-06)
(0.760615 0.155635 4.69287e-06)
(0.890163 0.103773 1.15472e-05)
(0.487139 0.418242 1.02885e-05)
(0.846922 0.188063 -5.45946e-06)
(0.834566 0.23851 -3.18761e-06)
(0.500725 0.220613 -6.00072e-06)
(0.791935 0.205042 6.36644e-06)
(1.31809 0.172577 8.48404e-06)
(0.771034 -0.0277387 3.81666e-06)
(0.843924 0.0703957 -2.43357e-06)
(0.901833 -0.0438548 -2.39662e-06)
(1.38898 0.157289 7.42655e-06)
(0.700261 0.0808925 7.92449e-06)
(0.77222 0.198175 4.32977e-06)
(2.34412 0.0655003 -8.61601e-06)
(0.845832 0.233843 5.20622e-06)
(0.709519 -0.0384495 4.37452e-06)
(0.902376 0.0795319 -1.09156e-05)
(0.792679 0.211785 -5.33366e-06)
(0.849175 0.224785 5.73891e-06)
(1.44547 0.260469 -7.30363e-06)
(0.819574 0.240493 5.24597e-06)
(1.06612 0.212775 8.96763e-06)
(0.89815 0.171942 8.08967e-06)
(0.791121 0.522771 -4.18799e-06)
(0.752945 -0.122281 4.81055e-06)
(0.803139 0.0655215 -7.75378e-06)
(0.623478 0.165088 9.61256e-06)
(0.804314 0.202456 -7.97515e-06)
(0.802041 0.12032 -5.92525e-06)
(0.795457 0.599956 -5.11103e-06)
(0.738524 0.198224 -7.85332e-06)
(0.717308 0.0656523 6.54768e-06)
(0.62622 0.24698 -3.10053e-06)
(0.806659 0.119578 -4.36277e-06)
(0.842149 0.252412 1.41276e-05)
(0.587293 0.225598 4.86446e-06)
(0.801165 0.307601 3.96851e-06)
(0.815697 0.369961 -1.03346e-05)
(0.894799 0.411494 1.36483e-05)
(0.449917 0.162251 3.8956e-06)
(0.713456 0.282858 -8.21803e-06)
(0.839425 0.202087 -7.30903e-06)
(1.08878 0.246103 -5.0525e-06)
(0.397054 0.223173 6.497e-06)
(0.809554 0.39491 6.46513e-06)
(0.777518 0.208555 8.05953e-06)
(0.432605 0.20189 -7.0703e-06)
(0.771795 0.24676 -5.37093e-06)
(0.776899 1.10269 7.88616e-06)
(0.705196 0.413707 -5.25813e-06)
(0.771786 0.4748 2.64241e-06)
(1.26659 0.15437 5.27333e-06)
(1.1495 0.030435 -9.01482e-06)
(-0.0473997 0.592204 -1.64735e-05)
(0.783754 0.165386 5.92839e-06)
(0.769328 0.213068 -4.28803e-06)
(0.645089 0.542993 -1.05156e-05)
(0.811723 0.196687 -7.11362e-06)
(0.723558 0.452627 6.023e-06)
(0.824888 0.226237 3.91505e-06)
(0.807837 0.168958 -8.39055e-06)
(0.430551 0.352446 -7.66709e-06)
(0.834355 0.166785 5.46334e-06)
(0.822221 0.376527 4.38376e-06)
(0.76784 0.22925 -9.2979e-06)
(0.772022 0.22936 5.18218e-06)
(1.04626 0.586142 8.39986e-06)
(0.98541 0.546792 -6.85663e-06)
(-0.642095 0.59177 -1.5422e-05)
(0.386537 0.392659 9.05363e-06)
(0.666627 0.684956 6.51909e-06)
(0.638664 0.589858 -1.15415e-05)
(1.04306 -0.257891 -1.32497e-05)
(0.840773 0.143274 -1.34812e-05)
(0.947301 -0.304893 7.73004e-06)
(0.844187 0.169228 8.44238e-06)
(0.335419 0.113429 1.25195e-05)
(0.833494 0.233716 8.56645e-06)
(0.700976 0.103896 -7.20825e-06)
(1.00951 -0.0166527 8.27779e-06)
(0.926846 0.491488 -1.39359e-05)
(0.792203 0.18329 7.49063e-06)
(0.750736 0.241402 6.36457e-06)
(0.90832 0.255806 8.27915e-06)
(0.778485 0.279755 1.51801e-05)
(0.794968 0.140266 -1.35319e-05)
(0.80242 0.261523 1.14105e-05)
(0.792755 0.134008 1.15757e-05)
(0.820361 0.101691 -9.92164e-06)
(0.811152 0.0860135 9.45891e-06)
(0.843967 0.214132 -1.6998e-05)
(0.827936 0.1741 -8.06104e-06)
(1.17746 0.149381 -8.67348e-06)
(0.82564 0.303956 5.33712e-06)
(0.636239 0.18808 9.89359e-06)
(0.734084 0.247862 -1.77321e-05)
(0.554866 0.183006 1.82624e-05)
(1.01917 -0.150366 1.01505e-05)
(0.349962 0.0516498 -1.15092e-05)
(0.814829 0.280657 1.20336e-05)
(0.832188 0.220185 -8.10128e-06)
(0.796942 0.135052 5.97032e-06)
(0.833527 0.261055 -6.05284e-06)
(0.829668 0.319751 1.26601e-05)
(0.824981 0.219282 7.51171e-06)
(0.866109 -0.0124705 -6.35297e-06)
(0.67885 0.188917 6.95191e-06)
(0.86156 0.299952 1.11267e-05)
(0.883017 0.082811 -6.31952e-06)
(0.767553 0.25702 5.81048e-06)
(0.35457 0.352547 -4.51011e-06)
(1.01126 0.0571536 7.61122e-06)
(0.754582 0.220793 1.14283e-05)
(0.329949 -0.0575838 1.50049e-05)
(1.34519 -0.00222666 -9.09409e-06)
(0.835274 0.210172 -5.99722e-06)
(0.670735 0.329825 9.02443e-06)
(0.818875 0.250598 6.76883e-06)
(0.736926 0.719626 -6.17296e-06)
(0.746347 0.205331 9.70726e-06)
(0.748076 0.149917 -1.41289e-05)
(0.809857 0.108423 -7.2895e-06)
(0.86202 -0.0151534 -7.79381e-06)
(0.878464 0.235828 1.51501e-05)
(0.36783 0.224681 1.12408e-05)
(0.818158 0.234098 5.37223e-06)
(1.0435 0.104529 -9.11723e-06)
(0.768766 0.368555 -4.2854e-06)
(0.850055 -0.330439 9.97281e-06)
(0.750733 0.127543 -5.40626e-06)
(0.792294 0.578414 1.33518e-05)
(0.762131 0.253655 -7.56301e-06)
(0.525674 0.170728 5.59811e-06)
(0.543008 0.174 1.19182e-05)
(0.898497 0.461796 6.64356e-06)
(1.1239 0.298202 8.98418e-06)
(1.10592 0.272849 5.28372e-06)
(1.38637 0.33489 1.16001e-05)
(0.30473 0.36442 -1.16889e-05)
(0.614411 0.245518 -1.06682e-05)
(0.736022 0.226689 -7.23435e-06)
(0.783805 0.211525 7.73013e-06)
(0.110677 0.135105 1.03089e-05)
(1.07232 0.195774 -1.07976e-05)
(1.06412 0.316053 7.09321e-06)
(0.751756 0.486531 -5.31286e-06)
(0.793682 0.450978 -7.92572e-06)
(0.916627 0.82055 8.28993e-06)
(0.86463 0.531967 7.33255e-06)
(0.826779 -0.213208 9.21404e-06)
(0.789709 0.310919 -1.10995e-05)
(0.752643 0.754341 -1.00233e-05)
(0.775336 -0.278171 -8.83931e-06)
(0.59388 0.290045 -5.28354e-06)
(0.82549 0.246912 5.52971e-06)
(0.763885 -0.0724433 9.56001e-06)
(0.74285 0.291855 -5.90512e-06)
(0.770182 0.212405 6.97959e-06)
(1.06113 0.173362 -4.91633e-06)
(0.972229 0.159183 -6.54395e-06)
(0.105777 0.156032 1.08875e-05)
(1.05892 0.16123 -8.57768e-06)
(1.18853 0.134097 -8.22081e-06)
(0.64521 0.226614 -6.46878e-06)
(0.734377 1.2089 -1.19703e-05)
(0.815638 -0.364002 1.0964e-05)
(0.551115 0.113287 1.18075e-05)
(0.771273 0.120519 6.61753e-06)
(1.62473 0.74127 2.14917e-05)
(0.82764 0.135994 1.07482e-05)
(0.762742 0.320052 -9.74986e-06)
(0.867215 0.28546 1.03595e-05)
(0.647559 0.00497839 1.63037e-05)
(1.7579 0.45158 1.35153e-05)
(0.866194 0.242237 1.60072e-05)
(1.04972 -0.286864 -1.08413e-05)
(1.67641 0.81018 2.09753e-05)
(0.8462 0.302977 1.47806e-05)
(0.606858 -0.328477 1.57425e-05)
(0.920668 -0.00121766 1.82685e-05)
(0.702308 0.409436 -2.87775e-06)
(0.639285 0.469128 -5.71495e-06)
(0.601211 0.186566 9.10852e-06)
(0.80229 0.105373 5.51763e-06)
(0.690046 0.618781 4.2756e-06)
(0.725129 0.22454 1.39622e-06)
(0.81303 0.236151 3.40641e-06)
(0.854319 0.130554 1.23729e-05)
(0.727921 0.170539 1.5829e-06)
(1.10213 0.0468637 3.34669e-06)
(0.80916 0.141222 -5.85758e-06)
(0.475106 0.121837 4.98291e-06)
(0.785128 0.23267 1.90641e-06)
(0.779657 0.194732 3.2248e-06)
(0.857119 0.0331926 -2.22964e-06)
(0.757825 0.208129 -2.73128e-06)
(0.733525 0.141172 -4.00127e-06)
(0.93139 0.20718 -2.29482e-05)
(0.745395 0.160205 -1.25512e-05)
(0.0206497 0.515873 2.53094e-05)
(0.622334 0.559616 -1.455e-05)
(1.63756 0.545486 -1.06061e-05)
(0.598828 0.307967 -1.81583e-05)
(0.764794 0.250028 -1.31191e-05)
(0.830281 0.255587 -6.51343e-06)
(0.713823 0.118867 1.02134e-05)
(0.749978 0.244957 7.95664e-06)
(0.788057 0.218231 -1.09956e-05)
(0.891954 0.280744 -1.46388e-05)
(0.806859 0.217275 1.0228e-05)
(0.886825 0.0254522 1.31488e-05)
(0.758546 0.193323 -1.90173e-05)
(0.772948 0.230645 1.5673e-05)
(0.871932 0.252245 -4.84673e-06)
(0.692468 0.509346 -1.86208e-05)
(0.592072 0.198571 -1.43384e-05)
(0.862994 0.244367 -5.77808e-06)
(1.64592 0.126182 -6.9811e-06)
(0.672306 0.238885 9.9308e-06)
(0.631213 0.493878 -1.55631e-05)
(1.34695 0.346472 -8.62387e-06)
(0.597039 0.238175 1.98984e-05)
(0.740972 0.225809 5.57188e-06)
(0.791654 0.298208 6.78691e-06)
(0.476468 0.734209 -2.1379e-05)
(0.76851 0.264601 -1.09305e-05)
(0.341494 0.589237 -1.26465e-05)
(0.856774 0.806508 2.81828e-06)
(0.749878 0.443642 -1.20039e-05)
(1.02165 0.253011 -4.14936e-06)
(0.754893 0.180903 5.68995e-06)
(0.679479 0.124319 -1.0544e-05)
(0.775949 0.263496 -8.26286e-06)
(0.924656 -0.151284 -9.49886e-06)
(0.696244 0.160773 6.42798e-06)
(0.836167 0.193658 -2.1537e-06)
(0.872344 0.628189 1.07793e-05)
(0.802355 0.198807 8.06619e-06)
(0.823047 0.262885 3.86653e-06)
(0.707951 0.181235 -7.54196e-06)
(0.682814 0.176919 1.35489e-05)
(0.791796 0.233148 -3.37612e-06)
(0.812905 0.21521 9.47429e-06)
(0.25084 0.33028 -1.00729e-05)
(0.802183 0.225185 -1.05129e-05)
(0.75079 0.259047 -6.69731e-06)
(0.798046 0.249932 1.28325e-06)
(0.447847 0.164897 -5.36883e-06)
(0.765005 0.186381 1.82441e-05)
(0.797122 0.136451 -1.66596e-05)
(0.771896 0.058489 1.87296e-06)
(0.632384 0.376429 1.17975e-05)
(0.928759 0.170365 1.31431e-06)
(0.809852 0.183751 8.0764e-07)
(1.27229 0.638071 -2.6084e-06)
(0.86652 0.249885 -1.71156e-06)
(0.874324 0.352115 -5.10488e-06)
(0.856282 0.381145 -2.71886e-06)
(1.00034 -0.0868224 6.85143e-07)
(0.823951 0.219031 -1.87051e-06)
(0.756594 0.255982 -7.6087e-06)
(1.00785 0.234149 -8.33478e-06)
(0.747895 0.201117 4.41308e-06)
(0.795791 0.127832 7.10107e-06)
(0.938518 0.268477 1.10065e-05)
(0.727118 -0.19083 3.33026e-06)
(0.904684 0.237414 -6.37771e-06)
(0.904298 0.0443437 -5.50819e-06)
(1.19791 0.154224 -1.79799e-06)
(0.825884 0.169475 -6.00414e-06)
(0.765878 0.461105 -3.74244e-06)
(0.912405 0.210849 -9.45566e-06)
(0.294106 0.0894284 5.64404e-06)
(0.698041 0.826261 -7.12346e-06)
(0.870056 0.859884 7.42394e-06)
(0.88361 -0.0228714 -3.47789e-06)
(0.756924 0.239003 -6.58663e-06)
(0.721916 0.194503 8.51353e-06)
(0.891433 0.243734 -5.97757e-06)
(0.7008 0.340391 1.32804e-06)
(-0.0860299 0.346747 -5.95298e-06)
(0.628377 0.239911 9.68554e-06)
(0.89681 0.41468 -8.67445e-06)
(0.796567 0.219705 5.19316e-06)
(1.05901 0.142349 -6.2064e-06)
(0.447098 0.149962 5.64364e-06)
(0.790845 0.377876 3.93634e-06)
(0.830982 0.230279 -2.71373e-06)
(1.01104 0.172831 -3.11259e-06)
(0.81271 0.225046 1.35159e-05)
(0.71525 0.668283 -3.35781e-06)
(0.997104 0.387856 8.59694e-06)
(0.839833 0.301345 -2.12651e-06)
(0.733332 0.231093 -4.12468e-06)
(0.840829 0.221598 -3.87215e-06)
(0.789062 0.328424 -3.8792e-06)
(0.841284 0.191328 -6.66661e-06)
(0.798329 0.143786 6.68957e-06)
(0.706538 0.239077 6.58666e-06)
(0.669392 0.0819306 1.09989e-05)
(0.715434 0.236002 -2.9016e-06)
(0.406167 0.191459 4.88582e-06)
(0.68555 0.166797 2.9901e-06)
(0.89009 0.470277 -9.25803e-06)
(0.755025 0.208446 -5.49914e-06)
(0.703139 0.188652 6.41928e-06)
(0.809076 0.142292 5.4251e-06)
(0.805546 0.22665 1.3129e-06)
(0.914366 0.221868 1.9932e-06)
(0.791622 0.222346 -8.35506e-06)
(1.20948 0.17233 -3.02556e-06)
(1.23895 0.338736 -1.07909e-05)
(0.678847 0.633798 -6.03371e-06)
(0.744304 0.200083 5.19257e-06)
(0.769199 0.0732799 9.52985e-06)
(0.977413 0.281599 -8.58225e-06)
(0.804108 0.31281 7.54955e-06)
(0.745531 0.0815009 1.07755e-05)
(0.646426 0.193212 3.76728e-06)
(0.781319 0.270501 5.18274e-06)
(0.843855 0.315397 -4.61387e-06)
(0.791288 -0.0335086 4.0767e-06)
(1.03226 0.129636 -5.76198e-06)
(0.775265 0.202654 4.962e-06)
(1.12063 0.241122 7.3078e-06)
(0.775892 -0.154127 8.97213e-06)
(1.10565 -0.139363 -3.41863e-06)
(0.875726 0.203886 6.49491e-06)
(0.79109 0.245854 -4.02437e-06)
(0.723169 0.57122 -3.12076e-06)
(0.383017 0.165431 5.53612e-06)
(1.10215 -0.715057 -8.26712e-06)
(0.65514 0.0675695 3.34028e-06)
(0.986998 0.155575 7.77963e-06)
(0.823372 0.182515 -9.49062e-06)
(0.880785 0.63702 6.11305e-06)
(0.748923 0.0266219 3.49397e-06)
(0.602266 0.110817 -6.78305e-06)
(0.788896 0.0431456 8.29374e-06)
(0.759851 0.306283 -9.23134e-06)
(1.26636 0.0218627 -4.02115e-06)
(0.870333 0.478855 -1.00875e-05)
(0.89809 0.214055 -9.65781e-06)
(1.13451 0.155392 -2.13827e-06)
(0.809082 0.204559 -7.73425e-06)
(0.799655 0.363108 5.7909e-06)
(0.802533 0.337634 -3.31789e-06)
(1.04449 0.269581 5.08944e-06)
(0.763145 0.21016 6.46829e-06)
(0.800209 -0.0215142 4.46762e-06)
(0.828377 0.203393 7.53597e-06)
(0.853513 0.296406 -5.12276e-06)
(0.811426 0.123151 4.33065e-06)
(0.772117 0.183924 6.57397e-06)
(0.815524 0.232424 -3.47452e-06)
(0.829409 0.206786 -5.21994e-06)
(0.772749 0.221946 -6.08594e-06)
(0.893867 0.237488 2.5672e-06)
(0.724393 0.472853 -6.36248e-06)
(0.618842 0.115349 4.85621e-06)
(0.891997 0.293128 7.03726e-06)
(0.853234 0.187577 -4.26182e-06)
(0.82444 0.0711934 8.32458e-06)
(0.998731 0.125478 -3.72909e-06)
(0.764592 0.181775 -3.7216e-06)
(0.726965 0.125292 1.77401e-06)
(1.29884 0.0928832 -6.69477e-06)
(0.692592 0.857948 -7.57535e-06)
(0.705216 0.138267 8.76532e-06)
(0.874264 0.489685 1.19458e-05)
(0.792814 0.534032 -5.78913e-06)
(0.469127 -0.39667 8.11949e-06)
(0.784598 0.257047 4.1479e-06)
(1.25303 0.136342 1.00463e-05)
(1.26777 0.105326 -5.0761e-06)
(0.7822 0.179372 3.58653e-06)
(0.779697 0.158822 6.08923e-06)
(0.798661 0.691953 -5.31218e-06)
(0.765554 -0.0462379 -8.70673e-06)
(0.748822 0.169636 9.28932e-06)
(0.611482 0.163792 4.00562e-06)
(0.973409 0.148581 -1.03406e-05)
(0.790982 0.207285 8.24345e-06)
(0.883311 0.186366 -6.57608e-06)
(0.709301 0.153582 1.01441e-05)
(0.835252 0.226538 6.54868e-06)
(0.517109 -0.142881 7.3832e-06)
(0.761913 -0.1276 3.75635e-06)
(0.698537 -0.131815 -9.624e-06)
(0.877685 0.222879 4.85483e-06)
(0.767929 0.21501 -6.2187e-06)
(0.606171 -0.130517 -2.60839e-06)
(1.01848 0.194288 8.81735e-06)
(0.844705 0.465027 -4.56585e-06)
(0.737496 -0.196789 2.16769e-05)
(1.58521 1.01757 -6.42253e-05)
(0.839569 -0.192297 -1.48031e-05)
(0.974968 0.176898 1.2897e-05)
(0.774466 -0.0939126 -5.61155e-06)
(0.583995 0.240924 -7.16095e-06)
(0.535806 -0.0932868 -4.03989e-05)
(1.28052 0.170303 -5.01269e-06)
(0.977696 0.340319 1.07771e-05)
(1.50319 0.642051 -3.50113e-05)
(0.983901 0.506012 -7.40761e-06)
(0.845761 0.222996 -8.07966e-06)
(0.811752 0.31843 4.23542e-06)
(0.740253 0.215049 4.16414e-06)
(0.732696 0.291107 2.48785e-05)
(0.568204 0.173716 5.87422e-06)
(0.755565 0.100681 -2.12078e-06)
(0.889808 0.209906 -4.91723e-06)
(0.62376 -0.00856087 -1.80926e-05)
(0.805167 0.108325 -4.90081e-06)
(0.881018 0.224516 8.19393e-06)
(0.846443 0.272057 -2.63061e-05)
(0.781426 0.234264 -6.52082e-06)
(0.758059 0.219326 1.00671e-05)
(0.80363 0.325999 -2.91399e-06)
(0.883511 0.209423 -5.05468e-06)
(0.882865 0.304185 -2.84281e-05)
(0.591497 0.15508 -4.70821e-06)
(0.75239 0.00237335 9.87872e-06)
(0.482816 -0.0612781 -3.14807e-05)
(0.842168 0.361962 -7.02678e-06)
(0.979591 0.201918 1.47954e-05)
(0.79426 0.00385015 -5.54049e-06)
(0.364368 0.264631 -7.51518e-06)
(0.368094 -0.242561 -4.50095e-05)
(0.935549 -0.203622 -8.7156e-06)
(1.49626 0.235267 1.46971e-05)
(1.29824 0.752524 -4.85862e-05)
(0.579911 0.245732 -1.09028e-05)
(1.28079 0.208506 -8.20018e-06)
(0.907733 0.0537713 5.61628e-06)
(1.28946 0.170838 4.05781e-06)
(1.23173 -0.238149 2.60797e-05)
(0.827138 0.210403 -7.93141e-06)
(0.797445 0.178628 1.17046e-05)
(0.848351 0.249449 -3.69362e-05)
(0.803071 0.269982 -6.72341e-06)
(0.760406 0.197755 1.55622e-05)
(0.807018 0.241028 -4.62167e-06)
(0.92453 0.205342 -7.63605e-06)
(0.88839 0.288754 -4.22194e-05)
(0.735736 0.638182 -6.29362e-06)
(0.802511 1.87026 1.76199e-05)
(1.69184 1.05047 -5.90722e-05)
(0.993774 -0.162691 -1.35519e-05)
(0.520226 0.193876 3.66675e-05)
(0.694558 0.356175 -2.85047e-05)
(0.640736 0.386587 -1.14494e-05)
(0.38391 0.120135 -1.40188e-05)
(0.360512 0.316702 -5.51575e-06)
(0.880396 0.195949 1.77262e-05)
(0.743985 0.195617 8.93079e-06)
(0.815314 0.0779252 1.75042e-05)
(0.814967 0.274229 6.60064e-06)
(1.12924 0.353128 2.02608e-05)
(0.848196 0.6421 7.46349e-06)
(0.718673 0.0378215 2.52377e-05)
(0.615295 0.17222 8.92812e-06)
(0.710871 0.384991 -8.52091e-06)
(0.863747 0.244302 1.77453e-06)
(0.583722 0.284306 -2.232e-05)
(0.826942 0.233765 -2.04228e-05)
(0.764696 0.269057 -9.51616e-06)
(0.814721 0.223221 1.14464e-06)
(0.691621 0.238554 -2.43566e-05)
(0.812934 0.218576 -2.28956e-05)
(0.728166 0.446723 -1.08499e-05)
(0.900319 0.0509995 1.23418e-06)
(0.680235 0.745251 -2.65984e-05)
(0.772389 0.116923 -2.68653e-05)
(0.809754 0.22726 -8.53261e-06)
(0.803543 0.218717 1.40524e-06)
(0.798578 0.192732 -2.23656e-05)
(0.795103 0.196525 -2.06418e-05)
(0.62438 0.00491072 3.42693e-05)
(0.709761 0.203523 3.00878e-05)
(0.634963 0.164075 1.28959e-05)
(0.748853 0.245543 -4.86211e-06)
(0.725429 0.234487 -2.44829e-05)
(0.807957 0.223022 -2.13426e-05)
(0.738138 0.321736 -9.0663e-06)
(0.822049 0.22721 3.52151e-06)
(1.09625 0.341581 2.40089e-05)
(0.74648 0.340319 2.28469e-05)
(1.10642 -0.0660057 2.69017e-06)
(0.663986 0.196294 -9.80693e-06)
(0.875631 0.436773 1.27544e-05)
(0.868841 0.216298 6.48721e-06)
(0.715238 0.663066 -3.81209e-05)
(0.787151 0.203433 -3.47928e-05)
(0.82563 0.493638 -1.48949e-05)
(0.858408 0.133375 5.55662e-06)
(0.774889 0.218112 1.24304e-05)
(0.823823 0.237515 -5.14388e-06)
(0.744976 0.198764 3.3742e-05)
(0.805275 0.20711 2.87599e-05)
(0.592485 0.207496 2.20121e-05)
(0.792603 0.271319 2.38114e-05)
(0.57831 0.241242 1.03498e-05)
(0.788722 0.371267 7.76036e-07)
(0.773329 0.199604 1.75603e-05)
(0.806354 0.206833 2.25447e-05)
(0.737497 0.262038 1.99348e-06)
(0.797672 0.222143 -1.39354e-05)
(0.778435 0.219483 1.98873e-05)
(0.815888 0.219723 8.7736e-06)
(0.759703 0.185829 8.04744e-06)
(0.654035 -0.258937 -8.64447e-06)
(0.27843 -0.264507 -2.68163e-05)
(1.55576 0.205483 -9.90765e-06)
(1.00665 0.192272 -6.29479e-06)
(0.78199 0.368483 -5.54235e-06)
(0.614182 0.207581 5.35712e-06)
(0.788188 0.357874 4.76298e-06)
(0.651883 0.330095 1.98465e-05)
(0.965609 0.251671 3.02839e-06)
(0.919828 0.0799853 2.00971e-05)
(0.70371 0.307261 1.40019e-05)
(0.830037 0.23443 5.42938e-06)
(0.933918 0.0929368 1.60911e-05)
(0.826004 0.0786162 4.72646e-06)
(0.918483 0.229716 5.33739e-06)
(0.826816 0.121689 -3.66144e-06)
(1.03263 0.549534 5.48283e-07)
(0.824736 0.301853 -2.62189e-05)
(0.886633 0.160549 -7.12877e-07)
(0.797719 0.224051 -2.56729e-05)
(0.995108 0.22833 1.44193e-05)
(0.789305 0.233298 -6.90288e-06)
(1.10227 0.231885 -8.52754e-06)
(1.15888 0.493248 -3.23851e-05)
(0.882958 -0.280779 -7.01165e-06)
(0.46364 -0.109587 -3.5777e-05)
(0.773267 0.369018 8.92413e-06)
(0.418911 0.329932 -1.09757e-05)
(0.270775 0.264938 1.35549e-05)
(0.873542 0.652312 1.81177e-06)
(0.970833 -0.0372681 2.52746e-06)
(0.853694 0.238049 -1.06436e-05)
(0.765193 0.175502 -8.82801e-06)
(0.855672 0.220609 -7.60089e-06)
(0.9363 0.305604 -2.04255e-05)
(0.884383 0.327643 -7.82808e-06)
(0.962978 0.250331 -5.33961e-06)
(0.821534 0.372881 4.79072e-06)
(0.997378 0.237298 -8.6533e-06)
(1.09705 0.579284 -3.56606e-05)
(0.756852 0.0309295 -9.82615e-06)
(0.455165 -0.0775073 -3.71028e-05)
(0.732711 -0.194233 9.21748e-06)
(0.460314 0.236519 -1.04736e-05)
(0.860514 0.222977 -4.06992e-06)
(0.784791 0.202694 -1.73278e-05)
(0.784596 0.504025 -4.12126e-06)
(0.797885 0.264924 -2.03121e-05)
(0.817281 0.322529 1.13849e-06)
(0.782021 0.21241 -8.78556e-06)
(0.790435 0.189768 7.02727e-06)
(0.79535 0.2196 -4.47141e-06)
(0.812464 0.2759 -7.80825e-06)
(0.839472 0.2409 -2.45742e-05)
(0.76138 0.222646 -8.95148e-06)
(0.786395 0.204579 -4.49672e-06)
(0.692293 0.547492 -1.08267e-05)
(0.564738 0.462211 9.74552e-07)
(0.680964 0.217558 4.90038e-06)
(0.730751 0.211694 2.6779e-05)
(0.354269 -0.0287174 -3.94276e-05)
(0.126112 0.484644 -8.47407e-06)
(1.16891 0.744121 -4.37429e-05)
(0.655711 1.44105 -8.6094e-06)
(1.08853 0.17109 -9.86068e-06)
(0.624923 -0.0358294 1.50362e-05)
(0.781827 0.604726 -6.41024e-06)
(0.874304 0.278397 4.56125e-06)
(0.932772 0.411234 -1.99845e-05)
(0.946587 0.254508 -6.20315e-06)
(0.688694 0.093181 -1.65269e-05)
(0.783937 0.251713 -6.64185e-06)
(0.804855 0.271748 -4.7809e-06)
(0.813321 0.23044 4.1548e-06)
(0.780582 0.196526 6.26664e-06)
(0.775701 0.225066 1.83362e-05)
(0.818643 0.214332 6.61837e-06)
(0.812089 0.230399 1.26481e-05)
(0.830484 0.215175 4.98471e-06)
(0.88624 0.122889 1.19754e-05)
(0.825121 0.257985 5.70668e-06)
(0.718373 0.31608 1.3546e-05)
(0.553879 0.234563 -2.8076e-06)
(0.786 0.296423 4.87411e-06)
(0.658768 0.574398 1.17115e-05)
(0.937508 0.322247 -3.64247e-06)
(0.850336 0.115408 -1.18533e-05)
(0.930412 0.410528 -3.62153e-05)
(0.606062 0.176516 -1.16019e-05)
(0.525484 0.0990801 -1.22992e-05)
(0.556692 0.238065 -4.42419e-06)
(0.649428 0.0844837 -1.88441e-05)
(0.876752 0.164954 -7.27502e-06)
(1.03188 0.353708 -2.08341e-05)
(0.878207 0.643885 5.34921e-06)
(1.18014 0.248062 -6.10534e-06)
(0.814542 -0.164888 7.4559e-06)
(0.420178 0.305878 -1.0625e-05)
(0.876135 0.324455 -9.14338e-06)
(0.595258 0.0324808 -2.97712e-05)
(1.17557 0.186061 -5.28016e-06)
(1.08708 0.515432 -3.03138e-05)
(0.901572 0.175676 -7.50937e-06)
(1.30164 0.279482 9.96826e-06)
(0.799608 0.105714 7.69801e-06)
(1.04891 0.0526285 3.0571e-05)
(0.578552 0.19914 6.07771e-06)
(0.617907 0.458462 3.10824e-05)
(0.704698 0.214036 -4.93731e-06)
(0.74388 0.20668 -2.75452e-05)
(0.714417 0.0411594 1.16268e-05)
(0.600643 0.0202727 -3.10205e-07)
(0.813864 0.402237 5.74426e-06)
(0.867038 0.227652 -5.14166e-06)
(0.73426 0.284583 1.85098e-05)
(0.659115 0.209317 4.36184e-06)
(0.837552 0.157027 1.59262e-05)
(0.790435 0.227148 6.70048e-06)
(0.879683 0.274593 -2.55808e-05)
(0.898286 0.223877 -6.56643e-06)
(0.746943 0.160164 -2.23333e-05)
(0.835802 0.213744 -4.66244e-06)
(0.696388 0.218623 -5.89708e-06)
(0.786809 0.243142 5.8902e-06)
(0.829003 0.175936 -4.3631e-06)
(0.777595 0.174068 -1.4448e-05)
(0.752485 0.463436 -2.35568e-06)
(0.866317 0.243193 -1.47536e-05)
(0.753203 0.287574 1.18277e-06)
(0.800683 0.190553 -6.07316e-06)
(0.835893 0.384152 2.82e-06)
(0.704791 0.307559 1.92075e-05)
(0.967401 0.237965 3.80428e-06)
(0.895626 0.099903 2.01574e-05)
(0.738474 0.195563 -5.77501e-06)
(0.775662 0.0146354 5.79142e-06)
(0.867593 0.47565 8.7854e-06)
(0.676771 0.239432 -9.39025e-06)
(0.568712 0.470888 3.49435e-05)
(0.410975 0.230076 8.52461e-06)
(1.0312 -0.0051799 3.10646e-05)
(0.75809 0.089198 7.47829e-06)
(0.797834 0.258577 -4.966e-06)
(0.774474 0.210644 7.90546e-06)
(0.785748 0.239842 5.34517e-06)
(0.77017 0.227667 1.93212e-05)
(0.815164 0.215427 3.27847e-06)
(0.814216 0.200288 2.10931e-05)
(0.90286 0.184297 4.91226e-06)
(0.869687 0.136247 2.07818e-05)
(0.900797 -0.0693113 -9.02553e-06)
(1.00841 -0.00465568 7.29872e-07)
(0.545274 0.221634 -4.0289e-06)
(0.650354 0.101075 -1.69404e-05)
(0.859867 0.116387 -5.92078e-06)
(0.967758 0.325293 -1.71083e-05)
(0.842361 0.673147 4.29233e-06)
(0.873626 0.249839 -5.30547e-06)
(0.781483 0.476601 -9.08581e-06)
(1.08641 0.28609 4.10708e-06)
(0.927793 0.413858 -2.14113e-05)
(0.750579 0.279657 -7.8112e-06)
(0.648178 0.0782808 -2.04084e-05)
(0.738332 0.265071 -8.10115e-06)
(0.843687 0.213325 -3.31337e-06)
(0.821392 0.246678 -2.0737e-05)
(0.815012 0.230898 -4.02296e-06)
(0.791977 0.199141 -1.83103e-05)
(0.792846 0.217038 5.8327e-06)
(0.783386 0.217498 -4.38543e-06)
(0.631187 -0.00196122 -2.61632e-05)
(0.923251 0.251918 -7.56744e-06)
(1.0997 0.452194 -2.90515e-05)
(0.827925 0.820476 -6.71113e-06)
(1.38871 0.147183 -7.67311e-06)
(0.847582 0.0157911 8.4903e-06)
(0.796957 0.363254 -5.80481e-06)
(1.06178 0.416942 -2.59067e-05)
(0.456435 0.227016 -5.7605e-06)
(0.594777 -0.0827202 -2.92116e-05)
(0.982199 0.12241 7.66699e-06)
(0.894127 -0.365689 -7.93459e-06)
(0.776352 0.10957 -2.36753e-06)
(0.665542 0.162539 7.01167e-06)
(0.641677 -0.0128569 -2.02176e-05)
(0.822575 0.140617 -5.6724e-06)
(0.965572 0.284024 -7.2359e-06)
(0.824985 0.564059 -5.05944e-06)
(0.82636 0.202066 -5.08835e-06)
(0.808884 0.21187 -1.55634e-05)
(0.800266 0.213309 -3.66226e-06)
(0.798979 0.217822 -1.62958e-05)
(0.7935 0.218819 4.48081e-06)
(0.792864 0.271981 -5.12859e-06)
(0.784261 0.144919 6.23156e-06)
(0.606269 0.344058 2.03869e-05)
(1.1646 0.217916 4.54145e-06)
(0.96082 0.0639005 1.93747e-05)
(0.740292 0.224675 -5.77394e-06)
(0.769189 0.0576202 5.6184e-06)
(0.691748 0.230574 -2.91681e-06)
(0.796301 0.230687 -4.03619e-05)
(0.80245 0.115282 1.44864e-05)
(0.854385 0.26031 -3.31659e-07)
(0.8559 0.11006 -9.5013e-06)
(1.15003 0.492936 -3.18823e-05)
(0.148875 0.224083 -7.22977e-06)
(0.479067 -0.121473 -3.64326e-05)
(0.915271 0.199569 1.00437e-05)
(0.908131 -0.137973 -9.3471e-06)
(0.799422 0.280221 -3.38761e-06)
(0.81937 0.219935 4.26964e-06)
(0.834077 0.259689 -1.62306e-05)
(0.800203 0.233602 -7.54456e-06)
(0.790732 0.190783 -2.91887e-06)
(0.78738 0.186975 -9.71243e-06)
(0.840294 0.353598 -8.67957e-06)
(0.608542 0.015861 -2.28833e-05)
(1.18417 0.297892 -8.39993e-06)
(1.09009 0.516529 -2.81752e-05)
(0.869172 0.226453 6.79506e-06)
(0.769372 0.468103 -9.1208e-06)
(0.900338 0.688599 1.11652e-05)
(0.169759 0.36911 -9.49461e-06)
(0.529896 0.639225 3.83906e-05)
(0.922996 0.303198 1.1908e-05)
(1.19788 -0.119842 3.8295e-05)
(0.764686 -0.262347 7.73977e-06)
(0.820995 0.129878 -6.98332e-06)
(0.831953 0.248903 -2.02897e-05)
(0.833244 0.197608 -7.66887e-06)
(0.768075 0.162208 -2.03821e-05)
(0.70766 0.194112 3.90683e-06)
(0.784885 0.179489 -7.30449e-06)
(0.782647 0.228977 -1.10636e-05)
(0.790417 0.233329 5.14168e-07)
(0.789141 0.262039 1.26267e-06)
(0.794529 0.228161 2.39026e-05)
(1.14287 0.574999 -3.71576e-05)
(1.22143 0.113434 -5.70401e-06)
(0.377608 -0.0919517 -3.80653e-05)
(0.872573 -0.28155 -7.08983e-06)
(-0.132887 0.360496 -1.2035e-05)
(0.669517 0.456563 9.52432e-06)
(1.0653 0.338987 1.26075e-05)
(0.968877 0.375906 -4.45488e-06)
(0.837092 0.32344 -1.00766e-05)
(0.874057 0.287064 -2.17195e-05)
(0.772817 0.183151 5.81003e-06)
(0.948795 0.105682 2.34902e-05)
(0.554611 0.203519 5.18605e-06)
(0.683855 0.351292 2.46859e-05)
(0.890483 0.235183 -6.95284e-06)
(0.867985 0.458686 7.39497e-06)
(0.902993 0.250066 -1.309e-05)
(0.880038 0.257771 2.39051e-06)
(1.00814 0.163241 9.35145e-06)
(0.969571 0.0519036 3.70411e-05)
(0.856584 0.414896 8.67262e-06)
(0.757341 0.287076 1.25065e-05)
(0.824203 0.0860012 -3.56313e-06)
(0.902343 0.212487 8.60687e-06)
(0.857758 0.278908 -2.55521e-05)
(0.796071 0.257565 -8.77526e-06)
(0.777548 0.190843 -9.41456e-06)
(0.809311 0.204408 -8.50595e-06)
(0.988215 0.202873 -3.20339e-06)
(0.902234 0.29076 -1.48703e-05)
(0.7967 0.249765 -5.4453e-06)
(0.684283 0.125802 -1.59135e-05)
(0.75846 0.0660459 3.99471e-06)
(0.678238 0.230401 -5.91235e-06)
(0.697917 0.672651 -4.31621e-06)
(1.22633 0.562935 -2.83104e-05)
(0.214839 0.297256 -5.05414e-06)
(0.514261 -0.197139 -3.09385e-05)
(1.02329 0.137679 8.69526e-06)
(0.987374 -0.471458 -7.64625e-06)
(0.460725 0.164663 4.76079e-06)
(0.583328 0.366377 2.18887e-05)
(0.731803 -0.122861 4.95537e-06)
(0.992966 0.0112556 2.31333e-05)
(0.804295 0.32483 -7.62392e-06)
(1.13274 0.24982 5.99889e-06)
(0.889786 0.216377 2.45199e-06)
(0.997529 0.214853 -5.45665e-06)
(0.972856 0.0143435 1.70423e-05)
(0.796701 0.143296 5.05536e-06)
(0.68665 0.295348 7.92179e-06)
(0.777052 0.392155 6.00177e-06)
(1.10084 -0.00635563 1.69322e-05)
(1.29637 0.155374 5.43894e-06)
(0.536316 0.415171 1.82791e-05)
(0.782368 0.0943706 6.31957e-06)
(0.518521 0.283943 5.56817e-06)
(0.763596 0.806282 -4.30799e-06)
(0.793423 0.291172 -1.12659e-05)
(0.904115 0.13644 3.9197e-06)
(0.849399 0.103294 8.43494e-06)
(1.06949 -0.0413339 3.44047e-05)
(0.675731 0.252865 1.11573e-05)
(0.666808 0.466576 1.31168e-05)
(0.882474 0.248589 4.38969e-06)
(0.953199 0.0934508 1.21148e-05)
(0.869394 0.259735 5.25079e-06)
(0.706773 0.39612 1.4701e-05)
(0.627142 0.302941 -2.83446e-06)
(0.843066 0.508812 5.7236e-06)
(1.27168 -0.21385 3.75753e-05)
(0.548948 0.0559854 1.18286e-05)
(0.223692 0.769325 4.38797e-05)
(0.81715 1.41029 8.99516e-06)
(-0.0788393 0.122804 1.22398e-05)
(0.792901 -0.109725 -1.04595e-05)
(0.892205 -0.0993934 7.94981e-06)
(0.450602 0.538806 3.78316e-05)
(1.56928 0.260894 6.72047e-06)
(1.15659 -0.0910264 3.18642e-05)
(0.680443 0.26536 -9.1765e-06)
(0.730746 -0.0458873 9.33416e-06)
(0.797931 0.302997 -4.47422e-06)
(0.814083 0.234962 7.79923e-06)
(0.827936 0.262286 -2.45754e-05)
(0.795684 0.239664 -9.45097e-06)
(0.783576 0.19982 -5.1737e-06)
(0.807732 0.207344 -8.23641e-06)
(0.784895 0.279187 4.20459e-06)
(0.754664 0.23161 -8.57749e-06)
(0.81451 0.203719 -8.52277e-06)
(0.786956 0.202061 -2.1962e-05)
(0.784729 0.226257 -9.37132e-06)
(0.811729 0.227491 -2.17611e-05)
(0.846846 -0.279833 -6.18496e-06)
(0.91722 0.168922 8.27138e-06)
(0.857427 0.287584 1.05801e-05)
(1.02115 0.0257317 2.83197e-05)
(0.583423 0.256655 9.97896e-06)
(0.599533 0.357893 2.74031e-05)
(0.80567 -0.181867 7.21018e-06)
(1.02489 0.120031 -4.97641e-06)
(0.94849 -0.0284972 2.18456e-05)
(0.964316 0.100839 6.73751e-06)
(0.633625 0.302127 2.00603e-05)
(0.795765 0.0699209 5.73306e-06)
(0.832266 -0.0048655 -5.92443e-06)
(1.24286 0.255142 8.89807e-06)
(0.698839 0.343441 8.30858e-06)
(1.04475 0.0350239 2.6636e-05)
(0.11687 0.295226 7.15571e-06)
(0.402395 0.5179 2.85472e-05)
(0.817326 0.0212417 -7.75575e-06)
(0.363445 0.153982 7.59299e-06)
(0.582556 -0.0634688 -2.93691e-05)
(0.980197 0.299481 -8.5313e-06)
(1.10572 0.581269 -3.12406e-05)
(0.810834 1.15528 -6.06678e-06)
(0.861937 0.727184 1.07335e-05)
(0.623614 0.355444 -8.51478e-06)
(0.740559 0.321681 3.8523e-05)
(0.758704 0.268768 2.02407e-05)
)
;
boundaryField
{
emptyPatches_empt
{
type empty;
}
top_cyc
{
type freestreamVelocity;
freestreamValue uniform (0.8944 0.4472 0);
value nonuniform List<vector>
40
(
(0.837197 0.236875 1.93079e-06)
(0.839969 0.232142 -4.41073e-07)
(0.814304 0.240317 -1.52531e-06)
(0.837158 0.245466 -7.57619e-07)
(0.857701 0.218726 1.41438e-05)
(0.807115 0.255418 4.65123e-06)
(0.799427 0.23755 2.65007e-05)
(0.814449 0.257776 5.94907e-06)
(0.835665 0.258903 4.3395e-06)
(0.800209 0.250042 1.27544e-05)
(0.840577 0.221552 -2.37582e-05)
(0.866813 0.251571 -1.50252e-05)
(0.829705 0.25662 -5.24705e-06)
(0.827144 0.243308 6.90213e-07)
(0.853347 0.250291 -1.31002e-05)
(0.802831 0.242184 -5.07069e-07)
(0.811344 0.195185 -1.85394e-05)
(0.882033 0.208269 1.58307e-05)
(0.839854 0.235651 -1.41979e-06)
(0.815743 0.254247 1.14945e-06)
(0.80474 0.233792 1.52775e-05)
(0.832266 0.232499 -1.82213e-05)
(0.820712 0.246749 3.28689e-06)
(0.840366 0.262359 -4.15885e-06)
(0.846931 0.243806 6.66049e-07)
(0.807048 0.249474 1.40999e-06)
(0.879268 0.23981 2.41389e-06)
(0.829119 0.246053 7.43447e-06)
(0.847713 0.229332 -6.2563e-06)
(0.84222 0.220808 5.92886e-06)
(0.851685 0.248081 6.87702e-06)
(0.83609 0.230806 3.49294e-06)
(0.796844 0.259299 -8.21747e-06)
(0.83189 0.247516 -1.07053e-05)
(0.818228 0.205502 1.16459e-06)
(0.837855 0.232463 -3.10552e-06)
(0.845034 0.216699 1.09261e-05)
(0.835928 0.236128 9.21215e-06)
(0.847522 0.244552 -4.45968e-06)
(0.850469 0.22115 -2.22992e-06)
)
;
}
bottom_cyc
{
type freestreamVelocity;
freestreamValue uniform (0.8944 0.4472 0);
value nonuniform List<vector>
40
(
(0.861337 0.35597 -8.81029e-07)
(0.824724 0.293752 -9.92427e-07)
(0.639122 0.335994 -3.56804e-07)
(0.642819 0.323657 2.6047e-08)
(0.69284 0.154613 1.3586e-05)
(0.882499 0.319221 -7.62238e-07)
(0.798374 0.214177 4.27411e-06)
(1.06537 -0.382847 1.86787e-05)
(0.815987 0.274731 3.26789e-06)
(0.858879 0.21128 4.13579e-06)
(0.763786 0.292423 9.06905e-06)
(0.922921 0.124416 -7.28223e-06)
(0.893053 0.253404 -3.90349e-06)
(0.964497 0.196305 -1.33944e-05)
(0.902115 0.326056 8.14017e-07)
(0.726858 0.353012 -4.62503e-08)
(0.935971 0.328727 9.80508e-08)
(0.938492 0.0531944 1.31396e-05)
(0.85516 0.319539 -9.3144e-07)
(0.981538 0.251184 -1.2448e-05)
(0.867707 0.206609 -5.51386e-06)
(0.753643 0.256674 1.22785e-05)
(1.1357 0.0718408 -1.79491e-05)
(0.821336 0.320403 3.90638e-07)
(0.976393 0.163797 -6.00458e-06)
(1.03981 0.269543 5.53564e-07)
(1.108 0.107615 -1.76966e-05)
(1.14558 0.258485 1.91573e-07)
(0.969293 0.214371 -7.48989e-07)
(0.919231 0.215896 -5.66773e-07)
(0.897025 0.32619 -3.59263e-06)
(0.903496 0.291926 6.32587e-06)
(0.905855 0.37287 -7.10664e-06)
(0.698697 0.462581 5.6688e-06)
(0.824047 0.332991 3.43902e-06)
(0.823663 0.238085 -3.47576e-06)
(0.834273 0.200419 8.30675e-06)
(0.873056 0.198259 -5.76247e-06)
(0.910829 0.187351 -3.47981e-06)
(0.893594 0.246608 2.91747e-06)
)
;
}
inlet_cyc
{
type cyclicAMI;
value nonuniform List<vector>
30
(
(0.827559 0.391041 1.47923e-05)
(0.300885 0.509049 -1.23897e-05)
(0.828239 0.224323 -9.46283e-06)
(0.785364 0.243918 8.92892e-06)
(0.831447 0.28395 1.49761e-06)
(0.737718 0.386279 8.39347e-06)
(0.779844 0.235518 -1.26844e-05)
(0.920739 0.179571 1.8263e-06)
(0.88862 0.210013 1.06817e-06)
(0.714852 0.27097 1.2678e-05)
(0.886821 0.158117 2.14059e-05)
(0.760083 0.271339 6.54565e-06)
(0.747631 0.35902 -6.75467e-06)
(0.784759 0.228855 -9.06555e-06)
(0.799817 0.233666 -1.83125e-06)
(0.812309 0.26732 3.2636e-06)
(0.865211 0.231503 4.07686e-06)
(0.828209 0.198965 -2.28447e-06)
(0.897547 0.0457406 7.42991e-06)
(0.741943 0.398068 -4.09657e-06)
(0.762007 0.322462 7.29217e-07)
(0.841083 0.19953 4.73858e-06)
(0.919957 0.2646 9.94648e-06)
(0.862594 0.191971 8.54929e-06)
(0.76332 0.230219 -7.93389e-06)
(0.767172 0.213477 -2.48589e-06)
(0.944052 0.27734 -1.71697e-06)
(0.862684 0.226594 -1.22145e-06)
(1.01072 0.257846 -5.81118e-06)
(0.832423 0.185873 1.07622e-05)
)
;
}
outlet_cyc
{
type cyclicAMI;
value nonuniform List<vector>
30
(
(0.789127 0.220502 8.46039e-06)
(0.824477 0.24774 -8.99431e-06)
(1.01072 0.257846 -5.81118e-06)
(0.751772 0.373811 6.27587e-06)
(0.755942 0.256549 -6.48488e-06)
(0.922154 0.112219 1.26183e-05)
(0.868983 0.200483 7.46382e-06)
(0.856295 0.218082 -1.35982e-07)
(0.796269 0.251472 -5.77024e-06)
(0.923615 0.282831 8.10996e-06)
(0.940394 0.259109 1.19547e-07)
(0.783392 0.217712 -8.74539e-06)
(0.896132 0.113092 -3.36213e-06)
(0.886821 0.158117 2.14059e-05)
(0.828209 0.198965 -2.28447e-06)
(0.832423 0.185873 1.07622e-05)
(0.840604 0.247976 -3.15467e-06)
(0.913226 0.19354 8.29969e-06)
(0.827559 0.391041 1.47923e-05)
(0.812309 0.26732 3.2636e-06)
(0.300885 0.509049 -1.23897e-05)
(0.660704 0.251121 1.56667e-05)
(0.741943 0.398068 -4.09657e-06)
(0.808031 0.255179 -4.44134e-06)
(0.710522 0.267787 -6.51657e-06)
(0.81997 0.175908 -3.90321e-06)
(0.865037 0.228044 1.08218e-05)
(0.840646 0.459501 -6.74643e-06)
(0.714852 0.27097 1.2678e-05)
(0.784759 0.228855 -9.06555e-06)
)
;
}
}
// ************************************************************************* //
| |
53fd87cc304053f8f2be7604544b799b755632f4 | 19fde8ce837204bc8ab1a2d34445a7326d95b153 | /Invite/2016_hust/F/A.cpp | eb0fb5098c2dfcd8be555bd3c060d3d52a8f4c6b | [] | no_license | JS00000/acmCode | aad59f1fdd66bb3b4b2208c8c5be0f26b7169405 | eda5dbcef4a66618fc27e79184a2ae93618ee6b1 | refs/heads/master | 2021-05-24T04:27:11.966469 | 2021-03-01T08:55:35 | 2021-03-01T08:55:35 | 55,392,212 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,496 | cpp | A.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#define maxn 100005
#define LL long long
#define eps 1e-8
using namespace std;
int kase = 0;
LL tree[maxn * 4], n, m;
bool flag[maxn * 4];
void Insert(int root, int ll, int rr, int k, LL x)
{
if (ll == rr)
{
tree[root] = x;
return;
}
int mid = ((ll + rr) >> 1);
int lc = (root << 1);
int rc = lc + 1;
if (k <= mid)
Insert(lc, ll, mid, k, x);
else Insert(rc, mid + 1, rr, k, x);
tree[root] = max(tree[lc], tree[rc]);
}
void update(int root, int ll, int rr, int left, int right, LL k)
{
if (flag[root]) return;
if (ll == rr)
{
tree[root] = tree[root] / k;
if (tree[root] == 0) flag[root] = true;
return;
}
int mid = ((ll + rr) >> 1);
int lc = (root << 1);
int rc = lc + 1;
if (left <= mid) update(lc, ll, mid, left, right, k);
if (mid + 1 <= right) update(rc, mid + 1, rr, left, right, k);
if (flag[lc] && flag[rc]) flag[root] = true;
tree[root] = max(tree[lc], tree[rc]);
}
LL query(int root, int ll, int rr, int left, int right)
{
if (left <= ll && rr <= right)
{
return(tree[root]);
}
int mid = ((ll + rr) >> 1);
int lc = (root << 1);
int rc = lc + 1;
LL ret = 0;
if (left <= mid) ret = max(ret, query(lc, ll, mid, left, right));
if (mid + 1 <= right) ret = max(ret, query(rc, mid + 1, rr, left, right));
return ret;
}
int main()
{
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
while (scanf("%d", &n) != EOF)
{
// printf("Case #%d:\n", ++kase);
int i, op, l, r;
memset(tree, 0, sizeof(tree));
memset(flag, 0, sizeof(flag));
for (i = 1; i <= n; i++)
{
LL x;
scanf("%lld", &x);
Insert(1, 1, n, i, x);
}
scanf("%d", &m);
for (i = 1; i <= m; i++)
{
scanf("%d", &op);
if (op == 1)
{
LL k;
scanf("%d%d%lld", &l, &r, &k);
if (k != 1) update(1, 1, n, l, r, k);
}else
{
scanf("%d%d", &l, &r);
printf("%lld\n", query(1, 1, n, l, r));
}
}
// printf("\n");
}
fclose(stdin);
fclose(stdout);
return 0;
}
|
62d9f6aa0855f13d2369e7d22b5f85ff218d67fd | f0386bb084cc9da15331fcacf4f7676fca67ba8b | /assignment2/AtomicTest.cpp | 2f90915257ec9e71a106905ef5cc3fa32f000ee6 | [] | no_license | xuetianw/DistributedSystem | 6125d8eb846afb47df7c04e24caddc6de9af4c9c | 169d5d69f9b941bc8ad838f9f576acc8cdf71eb6 | refs/heads/master | 2023-01-07T21:53:54.753885 | 2020-11-08T13:08:56 | 2020-11-08T13:08:56 | 300,460,991 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,539 | cpp | AtomicTest.cpp | //
// Created by fred on 2020-10-15.
//
//#include <atomic>
//template<typename T>
//struct node
//{
// T data;
// node* next;
// node(const T& data) : data(data), next(nullptr) {}
//};
//
//template<typename T>
//class stack
//{
// std::atomic<node<T>*> head;
//public:
// void push(const T& data)
// {
// node<T>* new_node = new node<T>(data);
//
// // put the current value of head into new_node->next
// new_node->next = head.load(std::memory_order_relaxed);
//
// // now make new_node the new head, but if the head
// // is no longer what's stored in new_node->next
// // (some other thread must have inserted a node just now)
// // then put that new head into new_node->next and try again
// while(!head.compare_exchange_weak(new_node->next, new_node,
// std::memory_order_release,
// std::memory_order_relaxed))
// ; // the body of the loop is empty
//
//// Note: the above use is not thread-safe in at least
//// GCC prior to 4.8.3 (bug 60272), clang prior to 2014-05-05 (bug 18899)
//// MSVC prior to 2014-03-17 (bug 819819). The following is a workaround:
//// node<T>* old_head = head.load(std::memory_order_relaxed);
//// do {
//// new_node->next = old_head;
//// } while(!head.compare_exchange_weak(old_head, new_node,
//// std::memory_order_release,
//// std::memory_order_relaxed));
// }
//};
//int main()
//{
// stack<int> s;
// s.push(1);
// s.push(2);
// s.push(3);
//}
//#include <string>
//#include <thread>
//#include <vector>
//#include <iostream>
//#include <atomic>
//#include <chrono>
//
//// meaning of cnt:
//// 5: there are no active readers or writers.
//// 1...4: there are 4...1 readers active, The writer is blocked
//// 0: temporary value between fetch_sub and fetch_add in reader lock
//// -1: there is a writer active. The readers are blocked.
//const int N = 5; // four concurrent readers are allowed
//std::atomic<int> cnt(N);
//
//std::vector<int> data;
//
//void reader(int id)
//{
// for(;;)
// {
// // lock
// while(std::atomic_fetch_sub(&cnt, 1) <= 0)
// std::atomic_fetch_add(&cnt, 1);
// // read
// if(!data.empty())
// std::cout << ( "reader " + std::to_string(id)
// + " sees " + std::to_string(*data.rbegin()) + '\n');
// if(data.size() == 25)
// break;
// // unlock
// std::atomic_fetch_add(&cnt, 1);
// // pause
// std::this_thread::sleep_for(std::chrono::milliseconds(1));
// }
//}
//
//void writer()
//{
// for(int n = 0; n < 25; ++n)
// {
// // lock
// while(std::atomic_fetch_sub(&cnt, N+1) != N)
// std::atomic_fetch_add(&cnt, N+1);
// // write
// data.push_back(n);
// std::cout << "writer pushed back " << n << '\n';
// // unlock
// std::atomic_fetch_add(&cnt, N+1);
// // pause
// std::this_thread::sleep_for(std::chrono::milliseconds(1));
// }
//}
//
//int main()
//{
// std::vector<std::thread> v;
// for (int n = 0; n < N; ++n) {
// v.emplace_back(reader, n);
// }
// v.emplace_back(writer);
// for (auto& t : v) {
// t.join();
// }
//}
//#include <atomic>
//template<typename T>
//struct node
//{
// T data;
// node* next;
// node(const T& data) : data(data), next(nullptr) {}
//};
//
//template<typename T>
//class stack
//{
// std::atomic<node<T>*> head;
//public:
// void push(const T& data)
// {
// node<T>* new_node = new node<T>(data);
//
// // put the current value of head into new_node->next
// new_node->next = head.load(std::memory_order_relaxed);
//
// // now make new_node the new head, but if the head
// // is no longer what's stored in new_node->next
// // (some other thread must have inserted a node just now)
// // then put that new head into new_node->next and try again
// while(!head.compare_exchange_weak(new_node->next, new_node,
// std::memory_order_release,
// std::memory_order_relaxed))
// ; // the body of the loop is empty
//
//// Note: the above use is not thread-safe in at least
//// GCC prior to 4.8.3 (bug 60272), clang prior to 2014-05-05 (bug 18899)
//// MSVC prior to 2014-03-17 (bug 819819). The following is a workaround:
//// node<T>* old_head = head.load(std::memory_order_relaxed);
//// do {
//// new_node->next = old_head;
//// } while(!head.compare_exchange_weak(old_head, new_node,
//// std::memory_order_release,
//// std::memory_order_relaxed));
// }
//};
//int main()
//{
// stack<int> s;
// s.push(1);
// s.push(2);
// s.push(3);
//}
#include <atomic>
//template<typename T>
class stack {
std::atomic<float> head;
public:
void add(const float data)
{
// node<T>* new_node = new node<T>(data);
// put the current value of head into new_node->next
// new_node->next = head.load(std::memory_order_relaxed);
// now make new_node the new head, but if the head
// is no longer what's stored in new_node->next
// (some other thread must have inserted a node just now)
// then put that new head into new_node->next and try again
float temp = head;
while(!head.compare_exchange_weak(temp, temp + data,
std::memory_order_release,
std::memory_order_relaxed))
; // the body of the loop is empty
// Note: the above use is not thread-safe in at least
// GCC prior to 4.8.3 (bug 60272), clang prior to 2014-05-05 (bug 18899)
// MSVC prior to 2014-03-17 (bug 819819). The following is a workaround:
// node<T>* old_head = head.load(std::memory_order_relaxed);
// do {
// new_node->next = old_head;
// } while(!head.compare_exchange_weak(old_head, new_node,
// std::memory_order_release,
// std::memory_order_relaxed));
}
};
int main()
{
// stack<int> s;
// s.push(1);
// s.push(2);
// s.push(3);
} |
61f145cc89dd7ef99a70b229f937013449b0e710 | 6d4b5957dccbd94ebeac2a75fe2e47a38adc0db2 | /libs/libtorc-baseui/opengl/uiopenglframebuffers.h | 8d620c7c8c302bacbf48720c3ef7464608d07f0f | [] | no_license | gwsu/torc | b681d1cd86fb7be4d0b0574e71c3f492f736f533 | 1c56be71abffb770033084dd44aa2d3031671a5f | refs/heads/master | 2021-01-18T19:32:11.908377 | 2014-02-25T12:41:27 | 2014-02-25T12:41:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,308 | h | uiopenglframebuffers.h | #ifndef UIOPENGLFRAMEBUFFERS_H
#define UIOPENGLFRAMEBUFFERS_H
// Qt
#include <QVector>
// Torc
#include "torcbaseuiexport.h"
#include "uiopengldefs.h"
#include "uiopengltextures.h"
#include "uiopenglview.h"
class GLTexture;
class TORC_BASEUI_PUBLIC UIOpenGLFramebuffers : public UIOpenGLView, public UIOpenGLTextures
{
public:
UIOpenGLFramebuffers();
virtual ~UIOpenGLFramebuffers();
void BindFramebuffer (uint FrameBuffer);
void ClearFramebuffer (void);
bool CreateFrameBuffer (uint &FrameBuffer, uint Texture);
void DeleteFrameBuffer (uint FrameBuffer);
protected:
bool InitialiseFramebuffers (const QString &Extensions, GLType Type);
void DeleteFrameBuffers (void);
protected:
bool m_usingFramebuffers;
uint m_activeFramebuffer;
QVector<GLuint> m_framebuffers;
TORC_GLGENFRAMEBUFFERSPROC m_glGenFramebuffers;
TORC_GLBINDFRAMEBUFFERPROC m_glBindFramebuffer;
TORC_GLFRAMEBUFFERTEXTURE2DPROC m_glFramebufferTexture2D;
TORC_GLCHECKFRAMEBUFFERSTATUSPROC m_glCheckFramebufferStatus;
TORC_GLDELETEFRAMEBUFFERSPROC m_glDeleteFramebuffers;
};
#endif // UIOPENGLFRAMEBUFFERS_H
|
9ef86fbe5e55c8cbeba27f22b15aa096c09ca0b9 | 2248e62ab73c5b36e31ab5306eec47252ed3671b | /Chapter 3/3_8.cpp | 6c0d02dca14dea53c55307970ddc34ad187aeb7c | [] | no_license | ShadowHu/CppPrimer5th | 845c9e9478ea4133adbae1b14e508db8d8420163 | 849263129dadea6743b759a79175a105cabc415c | refs/heads/master | 2021-01-01T05:24:23.295908 | 2017-05-11T09:22:49 | 2017-05-11T09:22:49 | 57,224,274 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 658 | cpp | 3_8.cpp | /*************************************************************************
> File Name: 3_8.cpp
> Author:
> Mail:
> Created Time: 2014年08月14日 星期四 21时04分42秒
************************************************************************/
#include<iostream>
using namespace std;
int main(){
string s = "hello world";
decltype(s.size()) i = 0;
/* while(i < s.size()){
auto &change = s[i];
if(!isspace(change))
change = 'X';
++i;
}
*/
for(i = 0;i<s.size();i++){
auto &change = s[i];
if(!isspace(change))
change = 'X';
}
cout<<s<<endl;
return 0;
}
|
657d177ff9625633af9aeadc506039d2c7c1ad4e | ded682a97d00b85055471a5f27240f67d1ba2373 | /Main/src/Search.cpp | c76f1f3c9b36339e266929c7260a85c410b0f76b | [
"MIT"
] | permissive | Drewol/unnamed-sdvx-clone | c9b838da0054019fb9f4c07cb608c05455c9cd4e | 7895040479b560c98df19ad86424b2ce169afd82 | refs/heads/develop | 2023-08-11T15:22:23.316076 | 2023-08-02T17:31:35 | 2023-08-02T17:31:35 | 66,410,244 | 726 | 149 | MIT | 2023-08-02T17:31:36 | 2016-08-23T23:10:52 | C++ | UTF-8 | C++ | false | false | 1,111 | cpp | Search.cpp | #include "stdafx.h"
#include "Search.hpp"
String SearchParser::Parse(const String& input, const Vector<SearchKey> keys)
{
String raw = input;
SearchKey key = { "" , nullptr };
char last = '\0';
for (size_t i = 0; i < raw.length(); i++)
{
const String& keyName = key.first;
if (last != '\0' && last != ' ') {
last = raw[i];
continue;
}
for (const SearchKey& ikey : keys)
{
if (raw[i] == ikey.first[0])
{
key = ikey;
break;
}
}
if (!keyName.empty())
{
bool found = false;
for (size_t j=i; j < raw.length(); j++)
{
if (raw[j] == ':' || raw[j] == '=')
{
j++;
// We have a match, so record until space
size_t end = raw.find(' ', j);
if (end == String::npos)
end = raw.length();
*key.second = raw.substr(j, end - j);
raw.erase(i, end - i);
// Restart from updated index
found = true;
i--;
break;
}
if (j-i >= keyName.length() || raw[j] != keyName[j - i])
break;
}
if (found) // don't update last if we changed the string
continue;
}
last = raw[i];
}
return raw;
}
|
6386b6beaaff457aec3f2b89f1c6499a44aaf764 | 4351a81d4a4fae778711643cb9644534e595920d | /C++/Project Euler/e61.cpp | c2bd93054541711cbe975542837e09b48ed03cd3 | [] | no_license | nsmith0310/Programming-Challenges | ba1281127d6fa295310347a9110a0f8998cd89ce | 7aabed082826f8df555bf6e97046ee077becf759 | refs/heads/main | 2023-08-13T14:47:10.490254 | 2021-10-13T04:35:57 | 2021-10-13T04:35:57 | 416,565,430 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,529 | cpp | e61.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
int main(){
int lim = 100000;
vector<string> master;
map<string,int> mp;
for (int i=1;i<lim;i++){
string tmp = to_string(i*(i+1)/2);
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=0;
}
else{
break;
}
}
for (int i=1;i<lim;i++){
string tmp = to_string(i*i);
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=1;
}
else{
break;
}
}
for (int i=1;i<lim;i++){
string tmp = to_string(i*(3*i-1)/2);
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=2;
}
else{
break;
}
}
for (int i=1;i<lim;i++){
string tmp = to_string(i*(2*i-1));
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=3;
}
else{
break;
}
}
for (int i=1;i<lim;i++){
string tmp = to_string(i*(5*i-3)/2);
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=4;
}
else{
break;
}
}
for (int i=1;i<lim;i++){
string tmp = to_string(i*(3*i-2));
int lth = tmp.length();
if (lth<4){
continue;
}
else if (lth==4){
master.push_back(tmp);
mp[tmp]=5;
}
else{
break;
}
}
vector<vector<string>> current;
for (int i=0;i<master.size();i++){
vector<string> app = {master[i]};
current.push_back(app);
}
int ct = 1;
while (ct<7){
vector<vector<string>> tmp;
//cout<<current.size()<<"\n";
for (int i = 0;i<current.size();i++){
for (int j=0;j<master.size();j++){
for (int k=0;k<ct;k++){
if (current[i][k]==master[j]||mp[current[i][k]]==mp[master[j]]){
break;
}
else{
char a = current[i][k][2];
char b = master[j][0];
char c = current[i][k][3];
char d = master[j][1];
if (a==b&&c==d){
vector<string> chain = current[i];
chain.push_back(master[j]);
tmp.push_back(chain);
}
}
}
}
}
ct+=1;
current = tmp;
}
for (int i=0;i<current.size();i++){
char a = current[i][5][2];
char b = current[i][0][0];
char c = current[i][5][3];
char d = current[i][0][1];
if (a==b&&c==d){
int total = 0;
for (int j=0;j<6;j++){
total+=stoi(current[i][j]);
}
cout<<total;
return 0;
}
}
return 0;
}
|
69eb501169ac4a3a54f7f7a5783825423180f881 | ff0cc7e931d038a9bd9a56665b20cd8dab071959 | /src/Modules/wxMitk/libmodules/wxMitkRendering/src/wxMitkRenderingManager.cxx | c15c5a23171fec1c7276d81b9bd58c88dcf96857 | [] | no_license | jakubsadura/Swiezy | 6ebf1637057c4dbb8fda5bfd3f57ef7eec92279b | bd32b7815b5c0206582916b62935ff49008ee371 | refs/heads/master | 2016-09-11T00:39:59.005668 | 2011-05-22T19:38:33 | 2011-05-22T19:38:33 | 1,784,754 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,363 | cxx | wxMitkRenderingManager.cxx | /*
* Copyright (c) 2009,
* Computational Image and Simulation Technologies in Biomedicine (CISTIB),
* Universitat Pompeu Fabra (UPF), Barcelona, Spain. All rights reserved.
* See license.txt file for details.
*/
#include "wxMitkRenderingManager.h"
#include "wxMitkRenderingRequestEvent.h"
#include "wxMitkAbortEventFilter.h"
#include "wxID.h"
using namespace mitk;
#define ID_wxMitkRenderingManager_TIMER wxID( "ID_wxMitkRenderingManager_TIMER" )
DEFINE_EVENT_TYPE(wxEVT_RESTART_TIMER)
BEGIN_EVENT_TABLE(wxMitkRenderingManager, wxEvtHandler)
EVT_TIMER (ID_wxMitkRenderingManager_TIMER, wxMitkRenderingManager::OnTimer)
EVT_COMMAND (wxID_ANY, wxEVT_RESTART_TIMER, wxMitkRenderingManager::OnRestartTimer )
END_EVENT_TABLE()
//!
wxMitkRenderingManager::wxMitkRenderingManager() : wxEvtHandler(), RenderingManager()
{
m_Timer.SetOwner(this, ID_wxMitkRenderingManager_TIMER);
}
//!
wxMitkRenderingManager::~wxMitkRenderingManager()
{
}
//!
void wxMitkRenderingManager::RestartTimer()
{
wxCommandEvent event( wxEVT_RESTART_TIMER, wxID_ANY );
event.SetEventObject(this);
AddPendingEvent(event);
}
//!
void wxMitkRenderingManager::StopTimer()
{
m_Timer.Stop();
}
/**
Receives the time elapsed events from wxWidgets timer and calls the Update callback of the
RenderingManager, triggering the update to all registered renderwindows
*/
void wxMitkRenderingManager::OnTimer(wxTimerEvent& event)
{
wxMitkRenderingRequestEvent renderingEvent;
this->AddPendingEvent( renderingEvent );
}
void mitk::wxMitkRenderingManager::GenerateRenderingRequestEvent()
{
RestartTimer();
}
bool mitk::wxMitkRenderingManager::ProcessEvent(wxEvent& event)
{
if ( event.GetEventType() == wxEVT_RENDERING_REQUEST )
{
// Directly process all pending rendering requests
this->UpdateCallback();
return true;
}
else
{
return wxEvtHandler::ProcessEvent( event );
}
return false;
}
void mitk::wxMitkRenderingManager::DoFinishAbortRendering()
{
wxMitkAbortEventFilter::GetInstance()->IssueQueuedEvents();
}
void mitk::wxMitkRenderingManager::DoMonitorRendering()
{
wxMitkAbortEventFilter::GetInstance()->ProcessEvents();
}
void mitk::wxMitkRenderingManager::OnRestartTimer( wxCommandEvent& evt )
{
RestartTimerInternal( );
}
void mitk::wxMitkRenderingManager::RestartTimerInternal( void )
{
// 5 milliseconds
m_Timer.Start( 100, wxTIMER_ONE_SHOT);
}
|
be64cf086b888c12c5d083a4c87349fe116d8c79 | bf1d5617e91b97c663394fb04f8ed38c4a05cb40 | /Number of Digits.CPP | 970660fe312d72ffe245ddda5e1616c607bad7b0 | [] | no_license | devanshpahuja/codingninjasDSA | 3d16d4bc3405a07012e8c11aa1909fe6dcc1df06 | c1cab36eac2c2463174590ac0483d4f679dbeaa4 | refs/heads/main | 2022-12-30T01:51:41.598046 | 2020-10-19T12:50:08 | 2020-10-19T12:50:08 | 305,376,420 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 280 | cpp | Number of Digits.CPP | /*int count(int n){
if(n == 0){
return 1;
}
int smallAns = count(n / 10);
return smallAns + 1;
}
*/
int count(int n){
if(n == 0){
return 0; //change this line's return to 0
}
int smallAns = count(n / 10);
return smallAns + 1;
}
|
509e5687e78e9b32f51b65b79d55fcfcc5f80bd5 | 02f474baf7931867b0e2675ef69f5059e68d9483 | /src/Application/include/component/Experience.hpp | d63dba23957e9e214c9d62b8a6be01088ab66263 | [
"ISC",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Mathieu-Lala/game_project | 646e69904bb4bd8e564a56bf2e14e635b47ed366 | 896e865249911e8360b8f100bebecc9f8c817269 | refs/heads/develop | 2023-02-01T02:00:05.043259 | 2020-12-19T09:01:10 | 2020-12-19T09:01:10 | 293,030,007 | 5 | 0 | ISC | 2020-12-16T02:28:56 | 2020-09-05T07:54:34 | C++ | UTF-8 | C++ | false | false | 118 | hpp | Experience.hpp | #pragma once
#include <cstdint>
namespace game {
struct Experience {
std::uint32_t xp;
};
} // namespace game
|
978361c7b59bc0a8f7d9817168aab36ea03ffc80 | fc9ccd3b38650b2710c730a1ad9c32b6d9e5cc7b | /SPOJ/GSCANDY.cpp | b06ea9425312b7204af226d194e674ec1d283af9 | [] | no_license | surya3214/coding | 7643642b197f1f83733e00c381b89086ea801c84 | 28a0d5b188bda75c1d44b5a036af87e0d468081e | refs/heads/master | 2021-06-03T08:40:53.182286 | 2020-08-05T18:25:24 | 2020-08-05T18:25:31 | 110,145,839 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,826 | cpp | GSCANDY.cpp | // AC 0.00 F yeah!
#include <bits/stdc++.h>
#define BUFFER 5
#define BUFF(x) x + BUFFER
#define N_MAX 1000
// #pragma GCC optimize "O4"
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
int n, t_time;
int candy[BUFF(N_MAX)];
struct C {
int idx;
int val;
} sorted_candy[BUFF(N_MAX)];
int t_next[BUFF(N_MAX)];
int cnt[BUFF(N_MAX)];
struct {
int time;
int val;
} dp[BUFF(N_MAX)][BUFF(N_MAX)];
void sanitizeDP(int l, int r) {
if (dp[l][r].time != t_time) {
dp[l][r].val = -1;
dp[l][r].time = t_time;
}
}
int compute(int l, int r) {
if (l == r) return 1;
else if (l > r) return 0;
sanitizeDP(l, r);
if (dp[l][r].val != -1)
return dp[l][r].val;
int ret = 0;
int idx = l;
int seen = 1;
while (t_next[idx] != -1) {
ret = max(ret, cnt[seen] + compute(idx + 1, r));
idx = t_next[idx];
++seen;
}
ret = max(ret, cnt[seen] + compute(idx + 1, r));
return dp[l][r].val = ret;
}
bool m_comparator(C a, C b) {
if (a.val != b.val)
return a.val < b.val;
return a.idx < b.idx;
}
void reset() { ++t_time; }
void program() {
int tcase;
scanf("%d", &tcase);
for (int t = 1; t <= tcase; ++t) {
reset();
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
scanf("%d", &candy[i]);
sorted_candy[i].val = candy[i];
sorted_candy[i].idx = i;
}
sort(sorted_candy + 1, sorted_candy + 1 + n, m_comparator);
sorted_candy[n + 1].val = -1;
for (int i = 1; i <= n; ++i) {
if (sorted_candy[i + 1].val == sorted_candy[i].val)
t_next[sorted_candy[i].idx] = sorted_candy[i + 1].idx;
else t_next[sorted_candy[i].idx] = -1;
}
printf("%d\n", compute(1, n));
}
}
void ready() {
for (int i = 1; i <= N_MAX; ++i)
cnt[i] = i + cnt[i - 1];
}
int main() {
ready();
program();
return 0;
} |
278339bed82343ea42eae394e180aa20d8cb0c41 | fc48798bf10d008f2f10dea234c30425d423f1fd | /DHCPserver/DHCPServer/SocketServer.h | 3cb077a963733b4d739bbe869d0b65956bf3603a | [] | no_license | shicaiwei123/DHCP-Server | ffb4034a7437edfe27b96ba6ed8837965628dacc | 228f9a94a996db24fb0bc6be6603dc1424efc1d3 | refs/heads/master | 2021-05-16T00:28:55.895866 | 2017-10-28T03:21:02 | 2017-10-28T03:21:02 | 107,005,103 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 234 | h | SocketServer.h | #pragma once
#include "SocketBasic.h"
//#include <Winsock2.h>
//#include<stdio.h>
class socketServer : public socketBasic
{
public:
socketServer();
int socketBind(int port);
int socketListen(int listenNum);
//int socketRecv();
}; |
a639e77c58909c56fb7ccd65bacc5d86729c80ad | 8c422474eb080365f3d167dc1531de5c7cd7c241 | /Ray_tracer/reflective_shader.cpp | 627bf08a243993f960577dce318abbe0f9f29373 | [] | no_license | Maxine100/CS130 | 1d8241dcc11d59867da6c442aed8a89e8fda3061 | 8b164aca79bfa2a16901099ab2edfb00e97ba3f4 | refs/heads/master | 2023-03-29T06:50:39.605687 | 2021-04-06T18:51:20 | 2021-04-06T18:51:20 | 347,242,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 640 | cpp | reflective_shader.cpp | #include "reflective_shader.h"
#include "ray.h"
#include "render_world.h"
vec3 Reflective_Shader::
Shade_Surface(const Ray& ray,const vec3& intersection_point,
const vec3& normal,int recursion_depth) const
{
vec3 color;
TODO; // determine the color
Ray reflected_ray;
reflected_ray.endpoint = intersection_point;
reflected_ray.direction = (ray.direction - normal * 2 * dot(ray.direction, normal)).normalized();
color = shader->Shade_Surface(ray, intersection_point, normal, recursion_depth);
color = (1 - reflectivity) * color + reflectivity * shader->world.Cast_Ray(reflected_ray, recursion_depth);
return color;
}
|
3605e1b784363ada42f3278fff207f18c7d7b357 | 4dbaea97b6b6ba4f94f8996b60734888b163f69a | /POJ & HDU/exgcd乘法逆元_A_Boring_Question.cpp | 39f8e91f9e0fd26cd904be7737f9c190f5bfa79d | [] | no_license | Ph0en1xGSeek/ACM | 099954dedfccd6e87767acb5d39780d04932fc63 | b6730843ab0455ac72b857c0dff1094df0ae40f5 | refs/heads/master | 2022-10-25T09:15:41.614817 | 2022-10-04T12:17:11 | 2022-10-04T12:17:11 | 63,936,497 | 2 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,023 | cpp | exgcd乘法逆元_A_Boring_Question.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MOD=1000000007;
long long multi(long long a,long long b)
{
long long ret=1;
while(b>0)
{
if(b&1)
ret=a*ret%MOD;
a=a*a%MOD;
b/=2;
}
return ret;
}
long long exgcd(long long a,long long b,long long &x,long long &y)
{
if(b==0)
{
x=1;
y=0;
return a;
}
long long ret=exgcd(b,a%b,x,y);
long long tmp=x;
x=y;
y=tmp-a/b*y;
return ret;
}
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
long long n,m;
scanf("%I64d%I64d",&n,&m);
long long x1=multi(m,(n+1))-1;
long long x2=m-1;///x1/x2等比数列和 但要求逆元
long long x,y;
exgcd(x2,MOD,x,y);
long long x3=(x%MOD+MOD)%MOD;///乘法逆元
long long ans=(x1*x3)%MOD;
cout<<ans<<endl;
}
return 0;
}
|
5a78674bd36ea19a19e7b46f1210ac2352d8333e | 391eda9326c5ae9fee1b3edb7272a0cfcdbc1851 | /simulate_keyboard.cpp | 5845fa26305b94f5f1534defda828a84a6bff944 | [
"Apache-2.0"
] | permissive | xk19yahoo/SimulateKeyboard | 98d7875217f3db6733c36cdaf9bdd8c9a3cfbb2b | 0d164d219690a33a3ac67b76f6f34302d6ea7f2b | refs/heads/master | 2020-05-18T09:41:29.204180 | 2015-05-14T05:53:41 | 2015-05-14T05:53:41 | 35,593,068 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 798 | cpp | simulate_keyboard.cpp | //C++ 模拟键盘输入
#define WINVER 0x0500
#include <windows.h>
#pragma comment(lib,"User32.lib")
#pragma comment(lib,"ws2_32.lib")
int main()
{
// This structure will be used to create the keyboard
// input event.
INPUT ip;
// Pause for 5 seconds.
Sleep(5000);
// Set up a generic keyboard event.
ip.type = INPUT_KEYBOARD;
ip.ki.wScan = 0; // hardware scan code for key
ip.ki.time = 0;
ip.ki.dwExtraInfo = 0;
// Press the "A" key
ip.ki.wVk = 0x41; // virtual-key code for the "a" key
ip.ki.dwFlags = 0; // 0 for key press
SendInput(1, &ip, sizeof(INPUT));
// Release the "A" key
ip.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
SendInput(1, &ip, sizeof(INPUT));
// Exit normally
return 0;
}
|
7864f587d681bc3aed208814c899051646c174b0 | fc4b07490c42de86e97351c8b1ddceecaff3877e | /include/urdf2robcogen/Urdf2RobCoGen.hpp | 505961a8bdae1a0b1592b2ca06ccaf0b4ff51bf8 | [
"BSD-3-Clause"
] | permissive | mcamurri/urdf2robcogen | f35251423e088f5c9c69d5f1d476e7c272d3c8a1 | fbf7aa1dbe4612021c76c2c96c3085bd8a89f920 | refs/heads/master | 2021-07-12T17:12:03.660814 | 2019-10-07T16:03:51 | 2019-10-07T16:03:51 | 222,954,537 | 1 | 0 | BSD-3-Clause | 2019-11-20T14:21:48 | 2019-11-20T14:21:48 | null | UTF-8 | C++ | false | false | 698 | hpp | Urdf2RobCoGen.hpp | //
// Created by rgrandia on 24.09.19.
//
#include <string>
#include <tinyxml.h>
#include <urdf/model.h>
/**
* Creates a kindsl and dtdsl file based on the provided urdf.
*
* If the root link is called "world", a fixed based system is generated, otherwise a floating base system is generated.
*
* The following conversions are applied to comply with the RobCoGen conventions
* - links that are attached with 'fixed' joints are converted to frames on the first moveable parent link
* - moveable joints are reoriented to move along their z-axis
*
*/
void urdf2RobCoGen(const std::string& robotName, urdf::Model urdf, TiXmlDocument urdfXml, const std::string& outputFolder, bool verbose);
|
14c19b32cf1be3218afbc5e42c92980789da941a | 805206825d15f30177fd64b7967bb7d7283d5212 | /数据结构/-1_分治法/插入排序.cpp | b18f00f9b41791fa044f1ab83df06820ba9bbfb7 | [] | no_license | Benshakalaka/DataStructure | 71cdfb7a0543b358e4d40c73e97e3b09fe11158b | 40e699e91eb8d5c5adbc60d1ed0fc5a3e07d5bed | refs/heads/master | 2020-07-08T12:00:32.195392 | 2016-11-18T13:47:06 | 2016-11-18T13:47:10 | 74,025,323 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 378 | cpp | 插入排序.cpp | #include <stdio.h>
void insert(int *a,int len)
{
int i,j,k,temp;
for(i=0;i<len-1;i++)
{
temp = a[i+1];
for(j=0;j<=i;j++)
{
if(temp<a[j])
{
for(k=i+1;k>j;k--)
a[k]=a[k-1];
a[j] = temp;
temp = a[i+1];
}
}
}
}
int main()
{
int a[6] = {7,4,1,9,3,6};
insert(a,6);
for(int i=0;i<6;i++)
printf("%d%c",a[i],((i+1)%6==0)?'\n':' ');
return 0;
} |
3f7254c4c81888d56929dbd345427dec2edb105c | 1027ef7d98c2ce62bae908ae41f748bec64e7940 | /src/Omega_h_confined.cpp | 0550d06e8639790157831b700f6f1118b2badf28 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | gahansen/omega_h | fb114ec66e8bf9610466907ac86d8c104c067322 | dc235450cf15b2b9549fabe8472269e7f8618cae | refs/heads/master | 2023-05-25T01:44:44.508388 | 2022-09-28T19:45:05 | 2022-09-28T19:45:05 | 151,169,286 | 2 | 0 | NOASSERTION | 2018-10-01T22:30:05 | 2018-10-01T22:30:05 | null | UTF-8 | C++ | false | false | 10,126 | cpp | Omega_h_confined.cpp | #include "Omega_h_confined.hpp"
#include "Omega_h_for.hpp"
#include "Omega_h_mark.hpp"
#include "Omega_h_mesh.hpp"
#include "Omega_h_shape.hpp"
#include "Omega_h_simplex.hpp"
/* Code to find classification-enforced constraints on
* element size and shape.
* For example, two geometric boundaries may be so close
* as to force a mesh edge to be much smaller than desired,
* similarly a sharp angle may be so acute that elements
* contained by it are forced to be low-quality
*/
namespace Omega_h {
Bytes find_bridge_edges(Mesh* mesh) {
auto verts2class_dim = mesh->get_array<I8>(VERT, "class_dim");
auto edges2class_dim = mesh->get_array<I8>(EDGE, "class_dim");
auto edges_are_bridges_w = Write<I8>(mesh->nedges());
auto edges2verts = mesh->ask_verts_of(EDGE);
auto f = OMEGA_H_LAMBDA(LO edge) {
auto eev2v = gather_verts<2>(edges2verts, edge);
auto edim = edges2class_dim[edge];
edges_are_bridges_w[edge] = ((edim != verts2class_dim[eev2v[0]]) &&
(edim != verts2class_dim[eev2v[1]]));
};
parallel_for(mesh->nedges(), f, "find_bridge_edges");
return edges_are_bridges_w;
}
template <Int dim>
Reals get_edge_pad_dists(Mesh* mesh, Read<I8> edges_are_bridges) {
auto coords = mesh->coords();
auto edges2verts = mesh->ask_verts_of(EDGE);
auto out = Write<Real>(mesh->nedges(), -1.0);
auto f = OMEGA_H_LAMBDA(LO edge) {
if (!edges_are_bridges[edge]) return;
auto eev2v = gather_verts<2>(edges2verts, edge);
auto eev2x = gather_vectors<2, dim>(coords, eev2v);
auto h = norm(eev2x[1] - eev2x[0]);
out[edge] = h;
};
parallel_for(mesh->nedges(), f);
return out;
}
template <Int dim>
Reals get_tri_pad_dists(Mesh* mesh, Read<I8> edges_are_bridges) {
auto coords = mesh->coords();
auto tris2verts = mesh->ask_verts_of(FACE);
auto tris2edges = mesh->ask_down(FACE, EDGE).ab2b;
auto out = Write<Real>(mesh->nfaces(), -1.0);
auto f = OMEGA_H_LAMBDA(LO tri) {
auto ttv2v = gather_verts<3>(tris2verts, tri);
auto ttv2x = gather_vectors<3, dim>(coords, ttv2v);
auto tte2e = gather_down<3>(tris2edges, tri);
auto tte2b = gather_values<3>(edges_are_bridges, tte2e);
for (Int ttv = 0; ttv < 3; ++ttv) {
if (!(tte2b[(ttv + 0) % 3] && tte2b[(ttv + 2) % 3])) continue;
auto o = ttv2x[ttv];
auto a = ttv2x[(ttv + 1) % 3];
auto b = ttv2x[(ttv + 2) % 3];
auto oa = a - o;
auto ab = b - a;
auto nabsq = norm_squared(ab);
auto proj = ab * ((ab * oa) / nabsq);
auto d = oa - proj;
auto lambda = ((ab * d) - (ab * oa)) / nabsq;
if (!((0 <= lambda) && (lambda <= 1.0))) continue;
auto h = norm(d);
out[tri] = h;
}
};
parallel_for(mesh->nfaces(), f);
return out;
}
Reals get_tet_pad_dists(Mesh* mesh, Read<I8> edges_are_bridges) {
auto coords = mesh->coords();
auto tets2verts = mesh->ask_verts_of(REGION);
auto tets2edges = mesh->ask_down(REGION, EDGE).ab2b;
auto out = Write<Real>(mesh->nregions(), -1.0);
auto f = OMEGA_H_LAMBDA(LO tet) {
auto ttv2v = gather_verts<4>(tets2verts, tet);
auto ttv2x = gather_vectors<4, 3>(coords, ttv2v);
auto tte2e = gather_down<6>(tets2edges, tet);
auto tte2b = gather_values<6>(edges_are_bridges, tte2e);
auto nb = reduce(tte2b, plus<I8>());
if (nb == 0) return;
if (nb == 4) {
for (Int tte = 0; tte < 3; ++tte) {
if (tte2b[tte]) continue;
auto opp = simplex_opposite_template(REGION, EDGE, tte);
if (tte2b[opp]) continue;
// at this point we have edge-edge nearness
auto a = ttv2x[simplex_down_template(REGION, EDGE, tte, 0)];
auto b = ttv2x[simplex_down_template(REGION, EDGE, tte, 1)];
auto c = ttv2x[simplex_down_template(REGION, EDGE, opp, 0)];
auto d = ttv2x[simplex_down_template(REGION, EDGE, opp, 1)];
auto ab = b - a;
auto cd = d - c;
auto n = normalize(cross(ab, cd));
auto h = (a - c) * n;
// project onto the normal plane
a = a - (n * (n * a));
b = b - (n * (n * b));
c = c - (n * (n * c));
d = d - (n * (n * d));
if (!((get_triangle_normal(a, b, c) * get_triangle_normal(a, b, d)) <
0 &&
(get_triangle_normal(c, d, a) * get_triangle_normal(c, d, b)) <
0)) {
break;
}
out[tet] = h;
return; // edge-edge implies no plane-vertex
}
}
Real h = ArithTraits<Real>::max(); // multiple vertex-planes may occur
for (Int ttv = 0; ttv < 4; ++ttv) {
Few<Int, 3> vve2tte;
Few<Int, 3> vve2wd;
for (Int vve = 0; vve < 3; ++vve) {
vve2tte[vve] = simplex_up_template(REGION, VERT, ttv, vve).up;
vve2wd[vve] = simplex_up_template(REGION, VERT, ttv, vve).which_down;
}
Few<I8, 3> vve2b;
for (Int vve = 0; vve < 3; ++vve) vve2b[vve] = tte2b[vve2tte[vve]];
if (reduce(vve2b, plus<I8>()) != 3) continue;
// at this point, we have vertex-plane nearness
auto o = ttv2x[ttv];
Few<Int, 3> vve2ttv;
for (Int vve = 0; vve < 3; ++vve) {
vve2ttv[vve] =
simplex_down_template(REGION, EDGE, vve2tte[vve], 1 - vve2wd[vve]);
}
Few<Vector<3>, 3> vve2x;
for (Int vve = 0; vve < 3; ++vve) vve2x[vve] = ttv2x[vve2ttv[vve]];
auto a = vve2x[0];
auto b = vve2x[1];
auto c = vve2x[2];
auto ab = b - a;
auto ac = c - a;
auto n = normalize(cross(ab, ac));
auto oa = a - o;
auto od = n * (n * oa);
// parametric coords for triangle in 3d space
auto xi = barycentric_from_global<3,2>(od, vve2x);
if (!is_barycentric_inside(xi)) continue;
auto this_h = norm(od);
h = min2(h, this_h);
}
if (h == ArithTraits<Real>::max()) h = -1.0;
out[tet] = h;
};
parallel_for(mesh->nregions(), f);
return out;
}
Reals get_pad_dists(Mesh* mesh, Int pad_dim, Read<I8> edges_are_bridges) {
if (pad_dim == EDGE) {
if (mesh->dim() == 3) {
return get_edge_pad_dists<3>(mesh, edges_are_bridges);
} else if (mesh->dim() == 2) {
return get_edge_pad_dists<2>(mesh, edges_are_bridges);
} else if (mesh->dim() == 1) {
return get_edge_pad_dists<1>(mesh, edges_are_bridges);
}
} else if (pad_dim == FACE) {
if (mesh->dim() == 3) {
return get_tri_pad_dists<3>(mesh, edges_are_bridges);
} else if (mesh->dim() == 2) {
return get_tri_pad_dists<2>(mesh, edges_are_bridges);
}
} else if (pad_dim == REGION) {
return get_tet_pad_dists(mesh, edges_are_bridges);
}
OMEGA_H_NORETURN(Reals());
}
template <Int dim>
Reals get_pinched_tri_angles_dim(Mesh* mesh) {
auto verts2class_dim = mesh->get_array<I8>(VERT, "class_dim");
auto edges2class_dim = mesh->get_array<I8>(EDGE, "class_dim");
auto tris2edges = mesh->ask_down(FACE, EDGE).ab2b;
auto tris2verts = mesh->ask_down(FACE, VERT).ab2b;
auto coords = mesh->coords();
auto tri_angles_w = Write<Real>(mesh->nfaces());
auto f = OMEGA_H_LAMBDA(LO tri) {
auto ttv2v = gather_down<3>(tris2verts, tri);
auto tte2e = gather_down<3>(tris2edges, tri);
auto ttv2dim = gather_values(verts2class_dim, ttv2v);
auto tte2dim = gather_values(edges2class_dim, tte2e);
auto ttv2x = gather_vectors<3, dim>(coords, ttv2v);
Real tri_angle = -1.0;
for (Int i = 0; i < 3; ++i) {
if (ttv2dim[i] != 0) continue;
if (tte2dim[(i + 0) % 3] != 1) continue;
if (tte2dim[(i + 2) % 3] != 1) continue;
auto d0 = ttv2x[(i + 1) % 3] - ttv2x[i];
auto d1 = ttv2x[(i + 2) % 3] - ttv2x[i];
auto cos_a = normalize(d0) * normalize(d1);
auto angle = std::acos(cos_a);
if (tri_angle == -1.0 || angle < tri_angle) {
tri_angle = angle;
}
}
tri_angles_w[tri] = tri_angle;
};
parallel_for(mesh->nfaces(), f, "get_pinched_tri_angles");
return tri_angles_w;
}
Reals get_pinched_tet_angles(Mesh* mesh) {
auto edges2class_dim = mesh->get_array<I8>(EDGE, "class_dim");
auto tris2class_dim = mesh->get_array<I8>(FACE, "class_dim");
auto tets2edges = mesh->ask_down(REGION, EDGE).ab2b;
auto tets2tris = mesh->ask_down(REGION, FACE).ab2b;
auto edges2verts = mesh->ask_down(EDGE, VERT).ab2b;
auto coords = mesh->coords();
auto tet_angles_w = Write<Real>(mesh->nregions());
auto f = OMEGA_H_LAMBDA(LO tet) {
auto kke2e = gather_down<6>(tets2edges, tet);
auto kkt2t = gather_down<4>(tets2tris, tet);
auto kke2dim = gather_values(edges2class_dim, kke2e);
auto kkt2dim = gather_values(tris2class_dim, kkt2t);
Real tet_angle = -1.0;
for (Int kke = 0; kke < 6; ++kke) {
if (kke2dim[kke] != 1) continue;
auto ket0 = simplex_up_template(3, 1, kke, 0).up;
auto ket1 = simplex_up_template(3, 1, kke, 1).up;
if (kkt2dim[ket0] != 2) continue;
if (kkt2dim[ket1] != 2) continue;
auto e0 = kke2e[kke];
auto e0v2v = gather_down<2>(edges2verts, e0);
auto e0v2x = gather_vectors<2, 3>(coords, e0v2v);
auto tangent = e0v2x[1] - e0v2x[0];
auto kke_opp = simplex_opposite_template(3, 1, kke);
auto e1 = kke2e[kke_opp];
auto e1v2v = gather_down<2>(edges2verts, e1);
auto e1v2x = gather_vectors<2, 3>(coords, e1v2v);
auto l0 = e1v2x[0] - e0v2x[0];
auto l1 = e1v2x[1] - e0v2x[0];
auto d0 = reject(l0, tangent);
auto d1 = reject(l1, tangent);
auto cos_a = normalize(d0) * normalize(d1);
auto angle = std::acos(cos_a);
if (tet_angle == -1.0 || angle < tet_angle) {
tet_angle = angle;
}
}
tet_angles_w[tet] = tet_angle;
};
parallel_for(mesh->nregions(), f, "get_pinched_tet_angles");
return tet_angles_w;
}
Reals get_pinched_angles(Mesh* mesh, Int pinched_dim) {
if (pinched_dim == FACE) {
if (mesh->dim() == 3) {
return get_pinched_tri_angles_dim<3>(mesh);
} else if (mesh->dim() == 2) {
return get_pinched_tri_angles_dim<2>(mesh);
}
} else if (pinched_dim == REGION) {
return get_pinched_tet_angles(mesh);
}
OMEGA_H_NORETURN(Reals());
}
} // end namespace Omega_h
|
71804547ae4b1d0db08bfdaa6e249daf9e9c13f2 | d212de37a2b11dea7dedf0f77e61db45edc5fced | /acm/topcoder/BoardPainting.cpp | b411d3d1d5bdb66ed7b911f768491b709ca81acf | [] | no_license | code6/playground | 089435464982d725c0edbfa8cdf8f5c1b067f140 | cc139d7691ca65e9b1fd353409521ec60fcb6718 | refs/heads/master | 2021-01-18T16:30:04.745814 | 2017-07-09T11:27:46 | 2017-07-09T11:27:46 | 6,527,533 | 1 | 6 | null | 2016-10-09T07:19:34 | 2012-11-04T04:59:47 | C++ | UTF-8 | C++ | false | false | 6,130 | cpp | BoardPainting.cpp | // BEGIN CUT HERE
/*
// PROBLEM STATEMENT
// There is a white rectangular board divided into a grid of unit square cells.
Fox Ciel wants to paint some of the cells black, so that the board looks as described by the vector <string> target.
More precisely: for each i, j, the cell in row i, column j of the board (0-based indices) should be painted black if target[i][j] is '#', and it should remain white if target[i][j] is '.'.
Fox Ciel paints in steps.
In each step, she selects a group of white cells and paints all of them black.
She is only allowed to select a contiguous sequence of white cells in a single row or in a single column.
Return the minimal number of steps needed to color the board.
DEFINITION
Class:BoardPainting
Method:minimalSteps
Parameters:vector <string>
Returns:int
Method signature:int minimalSteps(vector <string> target)
CONSTRAINTS
-n will be between 1 and 50, inclusive.
-m will be between 1 and 50, inclusive.
-target will contains exactly n elements.
-Each element in target will contains exactly m characters.
-Each character in target will be '#' or '.'.
EXAMPLES
0)
{"#####"}
Returns: 1
Fox Ciel can select the entire row of the board and paint it all black in a single step.
1)
{"#####",
".....",
"#####",
".....",
"#####"}
Returns: 3
In each turn, Ciel selects and colors one of the rows that should be black.
2)
{"..#..",
"..#..",
"#####",
"..#..",
"..#.."}
Returns: 3
Note that each sequence of cells selected by Ciel has to be a contiguous sequence of white cells. It is not allowed to select a black cell. Therefore the best solution has three steps. One possibility: first she selects row 2, then the first two cells in column 2, and finally the last two cells in column 2.
3)
{"#####",
"..#..",
"#####",
"..#..",
"#####"}
Returns: 5
4)
{".#.#.",
"#####",
".#.#.",
"#####",
".#.#."}
Returns: 8
5)
{".##.####.####.#########.##..",
"##.#.####################.##",
".##.###.##.###.###.###.###..",
"#..###..#########..###.##.##",
"####..#######.#.#####.######",
"##.######.#..#.#############",
"##.######.###########.######",
"#######.#######.#..###.#.###",
"#####..#######.#####.#.###.#",
"#..#################.#.####.",
"##.######..#.#####.######.##",
"..#.#############.#.##....#.",
"....##..##..#.#####.#.###.##",
"##.#########...#..#.#.######",
"##.#..###########..#..####.#",
"#.####.###.########.########",
"#####.#########.##.##.######",
".##.####..###.###...######.#"}
Returns: 88
6)
{"...................."}
Returns: 0
Note that the target can be totally white.
*/
// END CUT HERE
#line 121 "BoardPainting.cpp"
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <bitset>
#include <algorithm>
using namespace std;
#define mp make_pair
class BoardPainting
{
public:
int minimalSteps(vector <string> target)
{
//$CARETPOSITION$
}
// BEGIN CUT HERE
public:
void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); if ((Case == -1) || (Case == 5)) test_case_5(); if ((Case == -1) || (Case == 6)) test_case_6(); }
private:
template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); }
void verify_case(int Case, const int &Expected, const int &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: \"" << Expected << '\"' << endl; cerr << "\tReceived: \"" << Received << '\"' << endl; } }
void test_case_0() { string Arr0[] = {"#####"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 1; verify_case(0, Arg1, minimalSteps(Arg0)); }
void test_case_1() { string Arr0[] = {"#####",
".....",
"#####",
".....",
"#####"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 3; verify_case(1, Arg1, minimalSteps(Arg0)); }
void test_case_2() { string Arr0[] = {"..#..",
"..#..",
"#####",
"..#..",
"..#.."}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 3; verify_case(2, Arg1, minimalSteps(Arg0)); }
void test_case_3() { string Arr0[] = {"#####",
"..#..",
"#####",
"..#..",
"#####"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 5; verify_case(3, Arg1, minimalSteps(Arg0)); }
void test_case_4() { string Arr0[] = {".#.#.",
"#####",
".#.#.",
"#####",
".#.#."}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 8; verify_case(4, Arg1, minimalSteps(Arg0)); }
void test_case_5() { string Arr0[] = {".##.####.####.#########.##..",
"##.#.####################.##",
".##.###.##.###.###.###.###..",
"#..###..#########..###.##.##",
"####..#######.#.#####.######",
"##.######.#..#.#############",
"##.######.###########.######",
"#######.#######.#..###.#.###",
"#####..#######.#####.#.###.#",
"#..#################.#.####.",
"##.######..#.#####.######.##",
"..#.#############.#.##....#.",
"....##..##..#.#####.#.###.##",
"##.#########...#..#.#.######",
"##.#..###########..#..####.#",
"#.####.###.########.########",
"#####.#########.##.##.######",
".##.####..###.###...######.#"}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 88; verify_case(5, Arg1, minimalSteps(Arg0)); }
void test_case_6() { string Arr0[] = {"...................."}; vector <string> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arg1 = 0; verify_case(6, Arg1, minimalSteps(Arg0)); }
// END CUT HERE
};
// BEGIN CUT HERE
int main()
{
BoardPainting ___test;
___test.run_test(-1);
}
// END CUT HERE
|
0ba7fc17bcbaba980f6756dd55d1caa60cd8fb48 | 8bf0a9e96ef62f7b8a13761e4a413f9574eb7c18 | /books/C++Programing/chapter07/09.HASComplsite/HASComposite.cpp | 8541dbf801e3ee3e87f44db80dd3db93ed3abe7d | [] | no_license | doukheeWon-gmail/cplusplusStudy | 1c0a3d1f249f2b1d3b6b73f5b7c33e93bae3e4e0 | 7b89a7ee597108a093115cd22c3ec6ef0403c07f | refs/heads/master | 2023-02-22T23:05:45.723420 | 2021-01-24T15:07:16 | 2021-01-24T15:07:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,336 | cpp | HASComposite.cpp | /**
* 상속 보단 더 자세히 여러가지 가능성을 열어둘 수 있다.
* 예를 들면, 총을 가지고 있지 않는 경찰도 표현 가능, 총을 가지고 있는 사람만 표현이 가능하던
* 상속의 문제를 해결 가능하다.
*/
#include <iostream>
#include <cstring>
using namespace std;
class Gun{
private:
int bullet;
public:
Gun(int bNum):bullet(bNum){
}
void Shot(){
cout<<"BBANG!"<<endl;
bullet--;
}
};
class Police{
private:
int handCuffs;
Gun *pistol;
public:
Police(int bNum, int bCuffs):handCuffs(bCuffs){
if(bNum > 0){
pistol = new Gun(bNum);
}else{
pistol = NULL;
}
}
void PutHandcuff(){
cout<<"SMAP!"<<endl;
handCuffs--;
}
void Shot(){
if(pistol == NULL){
cout<<"Hut BBANG!"<<endl;
}else{
pistol->Shot();
}
}
~Police(){
if(pistol != NULL){
delete pistol;
}
}
};
int main(){
Police pman1(5, 3);
pman1.Shot();
pman1.PutHandcuff();
Police pman2(0, 3);
pman2.Shot();
pman2.PutHandcuff();
return 0;
} |
517d59380c7472620d334117843f86f44d660928 | 44aa96eecc54c7f5d56a899df2dac983379556dd | /server_b03705018.cpp | d68b55ced467515496c95c4e48295300565a743d | [] | no_license | Echim2016/P2P_socket | dd37aea311429f05602273c2aa451b86df45b071 | 98d7c99ce9d084da464f614c0a804626a0971277 | refs/heads/master | 2021-01-19T16:28:17.107080 | 2017-04-14T12:40:24 | 2017-04-14T12:40:24 | 88,265,928 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,376 | cpp | server_b03705018.cpp | #include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#define MAX 500
using namespace std;
/* b03705018 Hsu Yi-Chin */
/* Some function about SSL */
void InitializeSSL() {
SSL_load_error_strings();
SSL_library_init();
OpenSSL_add_all_algorithms();
};
void DestroySSL() {
ERR_free_strings();
EVP_cleanup();
};
void ShutdownSSL(SSL * ssl) {
SSL_shutdown(ssl);
SSL_free(ssl);
};
/* Data structure of user information */
struct user {
int user_index;
string user_name;
char* user_ip;
string user_port;
int user_account;
struct user * next_user;
};
/* Data structure of online user */
class onlineList {
private:
struct user* head;
int onlineListLength;
public:
/* Constructor */
onlineList(){
head = new user;
head->user_index = -1;
head->user_name = "";
onlineListLength = 0;
}
/* Insert a new user to online list */
void insertOnlineUser (int index, string name, char* ip, string port, int account){
struct user* newUser = new user;
newUser->user_index = index;
newUser->user_name = name;
newUser->user_ip = ip;
newUser->user_port = port;
newUser->next_user = head;
newUser->user_account = account;
head=newUser;
onlineListLength++;
}
void updateUserAccount(string name, int newAccount){
struct user * temp;
int updateAccount;
//struct user * lastUser;
if (head->user_name==name)
{
updateAccount = head->user_account + newAccount;
head->user_account = updateAccount;
}
else{
temp = head->next_user;
//lastUser = head;
for (int j = 0; j < onlineListLength-1; j++)
{
if (name==temp->user_name)
{
//lastUser->next_user = temp->next_user;
updateAccount = temp->user_account + newAccount;
temp->user_account = updateAccount;
break;
}
else{
//lastUser = temp;
temp = temp->next_user;
}
}
}
}
/* Delete a given user from data structure */
void deleteOnlineUser (int index){
struct user * temp;
struct user * lastUser;
if (head->user_index==index)
{
temp = head;
head = head->next_user;
delete head;
}
else{
temp = head->next_user;
lastUser = head;
for (int j = 0; j < onlineListLength-1; j++)
{
if (index==temp->user_index)
{
lastUser->next_user = temp->next_user;
delete temp;
break;
}
else{
lastUser = temp;
temp = temp->next_user;
}
}
}
onlineListLength--;
}
/* Show the user's account balance, nubmer of online user and online list */
char* displayList (string balance) {
char userInfo[9999] ="";
char userInfoReverse[9999]="";
char* list;
struct user* temp = head;
char disNum[100]="";
strcat(disNum, "Account Balance: ");
strcat(disNum, balance.c_str());
strcat(disNum, "\n");
string numUser = to_string(onlineListLength);
strcat(disNum, "Number of users: ");
strcat(disNum, numUser.c_str());
strcat(disNum, "\n");
strcat(userInfo, disNum);
for (int m = 0; m < onlineListLength; m++)
{
char userInfo1[9999] ="";
strcat(userInfo1, (temp->user_name).c_str());
strcat(userInfo1, "#");
strcat(userInfo1, temp->user_ip);
strcat(userInfo1, "#");
strcat(userInfo1, (temp->user_port).c_str());
strcat(userInfo1, "\n");
strcat(userInfo1, userInfoReverse);
strcpy(userInfoReverse, userInfo1);
temp=temp->next_user;
}
strcat(userInfo, userInfoReverse);
list=userInfo;
return list;
}
/* Return the latest number of online users*/
int getOnlineUserNum(){
return onlineListLength;
}
/* Return the given user's port number */
string getPort(string name){
struct user * temp;
//struct user * lastUser;
if (head->user_name==name)
{
return head->user_port;
}
else{
temp = head->next_user;
//lastUser = head;
for (int j = 0; j < onlineListLength-1; j++)
{
if (name==temp->user_name)
{
//lastUser->next_user = temp->next_user;
return temp->user_port;
break;
}
else{
//lastUser = temp;
temp = temp->next_user;
}
}
}
return "NULL";
}
/* Return the given user's IP */
char* getIP (string name){
struct user * temp;
//struct user * lastUser;
if (head->user_name==name)
{
return head->user_ip;
}
else{
temp = head->next_user;
//lastUser = head;
for (int j = 0; j < onlineListLength-1; j++)
{
if (name==temp->user_name)
{
//lastUser->next_user = temp->next_user;
return temp->user_ip;
break;
}
else{
//lastUser = temp;
temp = temp->next_user;
}
}
}
return 0;
}
};
/* Data structure to store the registered user */
class userList{
private:
string userNames[MAX];
int userAccount [MAX];
int listLength;
public:
/* Constructor */
userList(){
listLength=0;
}
/* Store a new user name and new account balance */
void insertUser(string name, int account){
userNames[listLength]=name;
userAccount[listLength]=account;
listLength++;
}
/* Check whether a given user name is registered in the user list */
bool searchUser(string searchName){
bool found = false;
for (int i = 0; i < listLength; i++)
{
if (userNames[i]==searchName)
{
found = true;
break;
}
}
return found;
}
void updateUserAccount0(string tName, int newAccount){
int t = 0;
for (int i = 0; i < listLength; i++)
{
if (userNames[i] == tName)
{
t = i;
break;
}
}
userAccount[t]=newAccount+userAccount[t];
}
/* Return the number of registered users */
int getUserNum(){
return listLength;
}
/* Return a given user's account */
int getUserAccount(string tName){
int t = 0;
for (int i = 0; i < listLength; i++)
{
if (userNames[i] == tName)
{
t = i;
break;
}
}
return userAccount[t];
}
};
/* Build online user list and user list */
onlineList OL;
userList UL;
char buffer[1024];
struct sockaddr_in caddr[1000];
void * services(void *arg){
int clientID = *((int *) arg);
struct sockaddr_in clientAddr = caddr[clientID];
string logName;
string logPort;
bool login=0;
bool check=0;
/* Build SSL */
SSL_CTX *sslctx;
SSL *cSSL;
InitializeSSL();
sslctx = SSL_CTX_new( TLSv1_server_method());
SSL_CTX_set_options(sslctx, SSL_OP_SINGLE_DH_USE);
int use_cert = SSL_CTX_use_certificate_file(sslctx, "mycert.pem" , SSL_FILETYPE_PEM);
if (use_cert<=0)
{
ERR_print_errors_fp(stderr);
abort();
}
int use_prv = SSL_CTX_use_PrivateKey_file(sslctx, "mykey.pem", SSL_FILETYPE_PEM);
if (use_prv<=0)
{
ERR_print_errors_fp(stderr);
abort();
}
if (!SSL_CTX_check_private_key(sslctx))
{
fprintf(stderr,"Private key does not match the public certificate.\n");
abort();
}
cSSL = SSL_new(sslctx);
SSL_set_fd(cSSL, clientID);
int ssl_err = SSL_accept(cSSL);
if(ssl_err <= 0)
{
ShutdownSSL(cSSL);
}
SSL_write(cSSL, "Success Connection!", strlen("Success Connection!"));
while(login==0 && check==0) {
login=1;
memset(buffer, 0, 1024);
SSL_read(cSSL, buffer,1024);
string message(buffer);
/* Register */
if (strstr(buffer,"REGISTER#"))
{
string inst_1_OK = "100 OK\n";
string inst_1_NO = "210 FAIL\n";
size_t accountPos = (message.substr(9)).find("#");
string regName = message.substr(strlen("REGISTER#"),accountPos);
int nameLength = regName.length();
string regAccount = message.substr(strlen("REGISTER#")+nameLength+1);
int accountBalance = atoi(regAccount.c_str());
if (UL.searchUser(regName)==false && UL.getUserNum()<=MAX)
{
/* Insert the new user */
UL.insertUser(regName, accountBalance);
SSL_write(cSSL,inst_1_OK.c_str(), inst_1_OK.length());
cout<<message<<endl;
login=0;
}
else{
/* Failed to register */
SSL_write(cSSL,inst_1_NO.c_str(), inst_1_NO.length());
login=0;
}
}
/* Update the payer and payee's account balance */
else if (strstr(buffer,"TRANSFER#"))
{
string inst_up = "\n-----Account updated-----\n";
string inst_nup = "-----Fail to update your account-----\n";
size_t accountPos = (message.substr(9)).find("#");
string payeeName = message.substr(strlen("REGISTER#"),accountPos);
int nameLength = payeeName.length();
size_t accountPos2 = (message.substr(10+nameLength)).find("#");
string tranAccount = message.substr(strlen("REGISTER#")+nameLength+1,accountPos2);
int tranBalance = atoi(tranAccount.c_str());
int accountLength = tranAccount.length();
string payerName = message.substr(11+nameLength+accountLength);
if (UL.searchUser(payeeName)==true)
{
/* Update user's account balance */
UL.updateUserAccount0(payeeName, tranBalance);
UL.updateUserAccount0(payerName, (-1*tranBalance) );
OL.updateUserAccount(payeeName, tranBalance );
OL.updateUserAccount(payerName, (-1*tranBalance));
SSL_write(cSSL,inst_up.c_str(), inst_up.length());
cout<<message<<endl;
login=0;
}
else{
/* Failed to register */
SSL_write(cSSL,inst_nup.c_str(), inst_nup.length());
login=0;
}
}
/* Display current online list and account balance */
else if (strstr(buffer,"LIST#"))
{
string lName = message.substr(5);
char* displayList2;
int iniAccount2 = UL.getUserAccount(lName);
string tempBalance2 = to_string(iniAccount2);
displayList2 = OL.displayList(tempBalance2);
SSL_write(cSSL,displayList2,strlen(displayList2));
cout<<"List from user<"<<logName<<">"<<endl;
login=0;
}
/* Exit */
else if (strstr(buffer,"EXIT"))
{
check=0;
SSL_write(cSSL,"Bye~\n", strlen("Bye~\n"));
OL.deleteOnlineUser(clientID);
cout<<"Exit from user<"<<logName<<">"<<endl;
close(clientID);
SSL_CTX_free(sslctx);
pthread_exit(0);
}
else if (strstr(buffer, "FIND#"))
{
string inst_notf = "230 User not found\n";
string findName = message.substr(strlen("FIND#"));
if (UL.searchUser(findName)==true )
{
/* Insert the new user */
char* tIP = OL.getIP(findName);
string tPort = OL.getPort(findName);
char findReply[1024];
strcat(findReply,tIP);
strcat(findReply, "#");
strcat(findReply,tPort.c_str());
// SSL_write(cSSL,findReply, strlen(findReply));
SSL_write(cSSL,findReply, strlen(findReply));
cout<<message<<endl;
login=0;
}
else{
/* Failed to register */
SSL_write(cSSL,inst_notf.c_str(), inst_notf.length());
login=0;
}
}
/* User want to login*/
else if (message.find("#")!=string::npos)
{
/* Get the user's name and port */
char logIP[20];
char nullIP[20] ;
strcpy(nullIP, "0.0.0.0");
size_t namePos = message.find("#");
logName = message.substr(0,namePos);
logPort = message.substr(namePos+1);
string inst_2_NO = "220 AUTH_FAIL";
/* Check for unexpected IP error */
if (strcmp(inet_ntoa(clientAddr.sin_addr),nullIP))
{
strcpy(logIP, inet_ntoa(clientAddr.sin_addr));
}
else{
strcpy(logIP, "127.0.0.1");
}
if (UL.searchUser(logName)==false)
{
/* Failed to login if user is not in the user list */
SSL_write(cSSL,inst_2_NO.c_str(), inst_2_NO.length());
login=0;
}
else{
/* Login and update the online list */
int iniAccount = UL.getUserAccount(logName);
OL.insertOnlineUser(clientID, logName, logIP, logPort, iniAccount);
/* Send the latest information to client */
char* displayList;
string tempBalance = to_string(iniAccount);
displayList = OL.displayList(tempBalance);
SSL_write(cSSL,displayList,strlen(displayList));
cout<<message<<endl;
while(check==0){
check=1;
/* Get the user's next instruction */
memset(buffer, 0, 1024);
SSL_read(cSSL, buffer, 1024);
string message2 (buffer);
if (message2=="List")
{
/* Display the latest online list */
iniAccount = UL.getUserAccount(logName);
tempBalance = to_string(iniAccount);
displayList = OL.displayList(tempBalance);
SSL_write(cSSL,displayList,strlen(displayList));
login=0;
check=0;
cout<<message2<<" from user<"<<logName<<">"<<endl;
}
if (message2=="Exit")
{
/* Exit and lose the thread */
check=0;
SSL_write(cSSL,"Bye~\n", strlen("Bye~\n"));
OL.deleteOnlineUser(clientID);
cout<<message2<<" from user<"<<logName<<">"<<endl;
break;
}
if (message2=="Back")
{
/* Back to homepage */
check=0;
login=0;
break;
}
}
}
}
/* Prevent unpredictable crashed */
if (check==1||login==1)
{
cout<<"User <"<<logName<<"> has dropped out\n";
OL.deleteOnlineUser(clientID);
close(clientID);
pthread_exit(0);
}
}
close(clientID);
SSL_CTX_free(sslctx);
pthread_exit(0);
}
int main(int argc, char* argv[]){
int port_Num = atoi(argv[1]);
pthread_t threads[MAX];
/* Error detection when there is a syntax error */
if (argc<2)
{
cout<<"Syntax error.\n";
exit(0);
}
struct sockaddr_in serverAddr, clientAddr;
/* Create the socket */
int socket_ser = socket(PF_INET, SOCK_STREAM, 0);
/* Error detection when there is a setup error */
if (socket_ser<0)
{
cout<<"Setup error.\n";
exit(0);
}
/* Set the connection using the port number and IP given by user */
serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(port_Num);
serverAddr.sin_addr.s_addr = INADDR_ANY;
memset(serverAddr.sin_zero, 0, sizeof (serverAddr));
/* Connecting */
int bindCon=bind(socket_ser,(struct sockaddr *) &serverAddr, sizeof(serverAddr));
/* Error detection when connection failed */
if (bindCon<0)
{
cout<<"Binding error.\n";
exit(0);
}
/* Start listening */
listen(socket_ser,50);
while(1){
int cli_socket = accept (socket_ser, (struct sockaddr *) &clientAddr, (socklen_t *)&(clientAddr));
if (cli_socket<0)
{
cout<<"Accepting error. \n";
exit(0);
}
/* Record the client */
caddr[cli_socket] = clientAddr;
/* Create threads for client */
pthread_create(&threads[cli_socket], 0, services, &cli_socket);
}
return 0;
}
|
7d346ae5df8db81089113629f843f84bac79091a | 0e02f4574bfa64cbf47f1fd1371292711f8db325 | /include/crossword_game_menu.h | 642fb990968dfdf2c65cb45ace567caf244b4ab1 | [] | no_license | prashant-3108/AI-for-school | 8d59697b80680f4f553085cfc7d7640b160f609e | 4a95381038a3944cff4ffb5c5baba989aff6cd47 | refs/heads/main | 2023-07-30T16:57:39.345134 | 2021-09-18T10:28:52 | 2021-09-18T10:28:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 79 | h | crossword_game_menu.h | using namespace std;
class CrosswordGameMenu
{
public:
void showMenu();
}; |
d2c7a4f5ddd16c4ea56f3ce88629c43a71c3391b | b2552f1f63a2760ffc81bde2abb1b08e2371b790 | /packmen.cpp | b491426ff03241f5d178943510ed6b09e42bfb5a | [] | no_license | andreiarnautu/Algorithmic-Problems-Part-3 | 81a1ce455beb048a9dee927c5cffd1b0a31e46a2 | 8b52be3852fac7bc37fe9ac96707f895028cb675 | refs/heads/master | 2021-07-24T12:44:03.788894 | 2021-06-06T12:06:42 | 2021-06-06T12:06:42 | 251,015,413 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,245 | cpp | packmen.cpp | /**
* Worg
*/
#include <deque>
#include <string>
#include <iostream>
int n;
std::string str;
bool get_verdict(std::deque<int>& packmen, std::deque<int>& food, const int& time) {
if (food.empty()) {
return true;
}
if (packmen.empty()) {
return false;
}
int x1, x2, y;
if (packmen.size() == 1) {
x1 = x2 = 0;
if (food.front() < packmen[0]) {
x1 = packmen[0] - food.front();
}
if (food.back() > packmen[0]) {
x2 = food.back() - packmen[0];
}
return time >= (2 * std::min(x1, x2) + std::max(x1, x2));
}
// Sa vedem cat acopera packmanul din stanga
x1 = x2 = 0;
if (food.front() < packmen[0]) {
x1 = packmen[0] - food.front();
}
y = time - 2 * x1;
if (time - x1 >= 0) {
y = std::max(y, (time - x1) / 2);
}
if (y < 0) {
return false;
} else {
while(!food.empty() && food.front() <= packmen.front() + y) {
food.pop_front();
}
}
if (food.empty()) return true;
// Acum packmanul din dreapta
x1 = x2 = 0;
if (food.back() > packmen.back()) {
x1 = food.back() - packmen.back();
}
y = time - 2 * x1;
if (time - x1 >= 0) {
y = std::max(y, (time - x1) / 2);
}
if (y < 0) {
return false;
} else {
while (!food.empty() && food.back() >= packmen.back() - y) {
food.pop_back();
}
}
packmen.pop_front(); packmen.pop_back();
return get_verdict(packmen, food, time);
}
bool check(const int time) {
std::deque<int> packmen;
std::deque<int> food;
for (int i = 0; i < n; i++) {
if (str[i] == '*') {
food.push_back(i);
} else if (str[i] == 'P') {
packmen.push_back(i);
}
}
return get_verdict(packmen, food, time);
}
int main() {
std::cin >> n;
std::cin >> str;
int left = 1, right = 4 * n, answer = 4 * n;
while (left <= right) {
int mid = (left + right) / 2;
if (check(mid)) {
answer = mid; right = mid - 1;
} else {
left = mid + 1;
}
}
std::cout << answer << '\n';
return 0;
}
|
5492e7e38edbe2df44a4f16bbae28ca57b6cba2d | 7e0b9b6797c66d594e649647327f32ec722c86f8 | /alienbinder8/src/packageiteminfo.cpp | 7242f987a043a4ecc3452d4751ab215ba01775e1 | [] | no_license | topiasv/aliendalvik-control | 9a804375b31037b7a64d2cfeca50c74d3d33bea8 | 7164635b3f995ccd00ea00dd9cd5ff95c27cc67d | refs/heads/master | 2022-12-16T01:02:16.657367 | 2020-09-28T08:11:44 | 2020-09-28T08:11:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,098 | cpp | packageiteminfo.cpp | #include "packageiteminfo.h"
#include "parcel.h"
PackageItemInfo::PackageItemInfo(Parcel *parcel, const char *loggingCategoryName)
: LoggingClassWrapper(loggingCategoryName)
{
name = parcel->readString();
qCDebug(logging) << Q_FUNC_INFO << "Name:" << name;
packageName = parcel->readString();
qCDebug(logging) << Q_FUNC_INFO << "Package:" << packageName;
labelRes = parcel->readInt();
// TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source)
const int kind = parcel->readInt();
qCDebug(logging) << Q_FUNC_INFO << "kind:" << kind;
const QString string = parcel->readString();
qCDebug(logging) << Q_FUNC_INFO << "string:" << string;
icon = parcel->readInt();
qCDebug(logging) << Q_FUNC_INFO << "icon:" << icon;
logo = parcel->readInt();
qCDebug(logging) << Q_FUNC_INFO << "logo:" << logo;
parcel->readBundle(); // metaData
banner = parcel->readInt();
qCDebug(logging) << Q_FUNC_INFO << "banner:" << banner;
showUserIcon = parcel->readInt();
qCDebug(logging) << Q_FUNC_INFO << "showUserIcon:" << showUserIcon;
}
|
de2fa4da31524d23e120cd40ed7c6f4b3f7c2e74 | 4d6bf26f4d9a43082f87e177c1a2ac6c9662c288 | /Chapter 3/Example/4.cpp | 20306a7cd69bfcf8ef6cca5ebc22a76f8cfa147b | [] | no_license | Miao4382/Starting-Out-with-Cplusplus | 08d13d75fdb741be59a398b76275c5ee394840ca | dd3a1eadcf403ae57a68183987fc24fbfac0517f | refs/heads/master | 2020-05-24T23:22:49.978761 | 2019-05-20T18:40:01 | 2019-05-20T18:40:01 | 187,513,299 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 452 | cpp | 4.cpp | /*This program asks the user to enter the numerator and denominator of a fraction, and it displays
the decimal value*/
#include <iostream>
using namespace std;
int main()
{
double numerator, denominator;
double fractional;
cout << "Please input the numerator and denominator, separate by space\n";
cin >> numerator >> denominator;
fractional = numerator / denominator;
cout << "The decimal is: " << numerator/denominator << endl;
return 0;
} |
3d788ce5480caa90c6e92d29a975e61061827f85 | ece30e7058d8bd42bc13c54560228bd7add50358 | /DataCollector/mozilla/xulrunner-sdk/include/nsISynthVoiceRegistry.h | 52dd533f88e5571cd1bba81f8f22738ac1632256 | [
"Apache-2.0"
] | permissive | andrasigneczi/TravelOptimizer | b0fe4d53f6494d40ba4e8b98cc293cb5451542ee | b08805f97f0823fd28975a36db67193386aceb22 | refs/heads/master | 2022-07-22T02:07:32.619451 | 2018-12-03T13:58:21 | 2018-12-03T13:58:21 | 53,926,539 | 1 | 0 | Apache-2.0 | 2022-07-06T20:05:38 | 2016-03-15T08:16:59 | C++ | UTF-8 | C++ | false | false | 9,340 | h | nsISynthVoiceRegistry.h | /*
* DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\nsISynthVoiceRegistry.idl
*/
#ifndef __gen_nsISynthVoiceRegistry_h__
#define __gen_nsISynthVoiceRegistry_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsISpeechService; /* forward declaration */
/* starting interface: nsISynthVoiceRegistry */
#define NS_ISYNTHVOICEREGISTRY_IID_STR "53dcc868-4193-4c3c-a1d9-fe5a0a6af2fb"
#define NS_ISYNTHVOICEREGISTRY_IID \
{0x53dcc868, 0x4193, 0x4c3c, \
{ 0xa1, 0xd9, 0xfe, 0x5a, 0x0a, 0x6a, 0xf2, 0xfb }}
class NS_NO_VTABLE nsISynthVoiceRegistry : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISYNTHVOICEREGISTRY_IID)
/* void addVoice (in nsISpeechService aService, in DOMString aUri, in DOMString aName, in DOMString aLang, in boolean aLocalService); */
NS_IMETHOD AddVoice(nsISpeechService *aService, const nsAString & aUri, const nsAString & aName, const nsAString & aLang, bool aLocalService) = 0;
/* void removeVoice (in nsISpeechService aService, in DOMString aUri); */
NS_IMETHOD RemoveVoice(nsISpeechService *aService, const nsAString & aUri) = 0;
/* void setDefaultVoice (in DOMString aUri, in boolean aIsDefault); */
NS_IMETHOD SetDefaultVoice(const nsAString & aUri, bool aIsDefault) = 0;
/* readonly attribute uint32_t voiceCount; */
NS_IMETHOD GetVoiceCount(uint32_t *aVoiceCount) = 0;
/* AString getVoice (in uint32_t aIndex); */
NS_IMETHOD GetVoice(uint32_t aIndex, nsAString & _retval) = 0;
/* bool isDefaultVoice (in DOMString aUri); */
NS_IMETHOD IsDefaultVoice(const nsAString & aUri, bool *_retval) = 0;
/* bool isLocalVoice (in DOMString aUri); */
NS_IMETHOD IsLocalVoice(const nsAString & aUri, bool *_retval) = 0;
/* AString getVoiceLang (in DOMString aUri); */
NS_IMETHOD GetVoiceLang(const nsAString & aUri, nsAString & _retval) = 0;
/* AString getVoiceName (in DOMString aUri); */
NS_IMETHOD GetVoiceName(const nsAString & aUri, nsAString & _retval) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsISynthVoiceRegistry, NS_ISYNTHVOICEREGISTRY_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISYNTHVOICEREGISTRY \
NS_IMETHOD AddVoice(nsISpeechService *aService, const nsAString & aUri, const nsAString & aName, const nsAString & aLang, bool aLocalService) override; \
NS_IMETHOD RemoveVoice(nsISpeechService *aService, const nsAString & aUri) override; \
NS_IMETHOD SetDefaultVoice(const nsAString & aUri, bool aIsDefault) override; \
NS_IMETHOD GetVoiceCount(uint32_t *aVoiceCount) override; \
NS_IMETHOD GetVoice(uint32_t aIndex, nsAString & _retval) override; \
NS_IMETHOD IsDefaultVoice(const nsAString & aUri, bool *_retval) override; \
NS_IMETHOD IsLocalVoice(const nsAString & aUri, bool *_retval) override; \
NS_IMETHOD GetVoiceLang(const nsAString & aUri, nsAString & _retval) override; \
NS_IMETHOD GetVoiceName(const nsAString & aUri, nsAString & _retval) override;
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISYNTHVOICEREGISTRY(_to) \
NS_IMETHOD AddVoice(nsISpeechService *aService, const nsAString & aUri, const nsAString & aName, const nsAString & aLang, bool aLocalService) override { return _to AddVoice(aService, aUri, aName, aLang, aLocalService); } \
NS_IMETHOD RemoveVoice(nsISpeechService *aService, const nsAString & aUri) override { return _to RemoveVoice(aService, aUri); } \
NS_IMETHOD SetDefaultVoice(const nsAString & aUri, bool aIsDefault) override { return _to SetDefaultVoice(aUri, aIsDefault); } \
NS_IMETHOD GetVoiceCount(uint32_t *aVoiceCount) override { return _to GetVoiceCount(aVoiceCount); } \
NS_IMETHOD GetVoice(uint32_t aIndex, nsAString & _retval) override { return _to GetVoice(aIndex, _retval); } \
NS_IMETHOD IsDefaultVoice(const nsAString & aUri, bool *_retval) override { return _to IsDefaultVoice(aUri, _retval); } \
NS_IMETHOD IsLocalVoice(const nsAString & aUri, bool *_retval) override { return _to IsLocalVoice(aUri, _retval); } \
NS_IMETHOD GetVoiceLang(const nsAString & aUri, nsAString & _retval) override { return _to GetVoiceLang(aUri, _retval); } \
NS_IMETHOD GetVoiceName(const nsAString & aUri, nsAString & _retval) override { return _to GetVoiceName(aUri, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISYNTHVOICEREGISTRY(_to) \
NS_IMETHOD AddVoice(nsISpeechService *aService, const nsAString & aUri, const nsAString & aName, const nsAString & aLang, bool aLocalService) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddVoice(aService, aUri, aName, aLang, aLocalService); } \
NS_IMETHOD RemoveVoice(nsISpeechService *aService, const nsAString & aUri) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveVoice(aService, aUri); } \
NS_IMETHOD SetDefaultVoice(const nsAString & aUri, bool aIsDefault) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultVoice(aUri, aIsDefault); } \
NS_IMETHOD GetVoiceCount(uint32_t *aVoiceCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVoiceCount(aVoiceCount); } \
NS_IMETHOD GetVoice(uint32_t aIndex, nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVoice(aIndex, _retval); } \
NS_IMETHOD IsDefaultVoice(const nsAString & aUri, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsDefaultVoice(aUri, _retval); } \
NS_IMETHOD IsLocalVoice(const nsAString & aUri, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsLocalVoice(aUri, _retval); } \
NS_IMETHOD GetVoiceLang(const nsAString & aUri, nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVoiceLang(aUri, _retval); } \
NS_IMETHOD GetVoiceName(const nsAString & aUri, nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVoiceName(aUri, _retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsSynthVoiceRegistry : public nsISynthVoiceRegistry
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISYNTHVOICEREGISTRY
nsSynthVoiceRegistry();
private:
~nsSynthVoiceRegistry();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS(nsSynthVoiceRegistry, nsISynthVoiceRegistry)
nsSynthVoiceRegistry::nsSynthVoiceRegistry()
{
/* member initializers and constructor code */
}
nsSynthVoiceRegistry::~nsSynthVoiceRegistry()
{
/* destructor code */
}
/* void addVoice (in nsISpeechService aService, in DOMString aUri, in DOMString aName, in DOMString aLang, in boolean aLocalService); */
NS_IMETHODIMP nsSynthVoiceRegistry::AddVoice(nsISpeechService *aService, const nsAString & aUri, const nsAString & aName, const nsAString & aLang, bool aLocalService)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void removeVoice (in nsISpeechService aService, in DOMString aUri); */
NS_IMETHODIMP nsSynthVoiceRegistry::RemoveVoice(nsISpeechService *aService, const nsAString & aUri)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void setDefaultVoice (in DOMString aUri, in boolean aIsDefault); */
NS_IMETHODIMP nsSynthVoiceRegistry::SetDefaultVoice(const nsAString & aUri, bool aIsDefault)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute uint32_t voiceCount; */
NS_IMETHODIMP nsSynthVoiceRegistry::GetVoiceCount(uint32_t *aVoiceCount)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* AString getVoice (in uint32_t aIndex); */
NS_IMETHODIMP nsSynthVoiceRegistry::GetVoice(uint32_t aIndex, nsAString & _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* bool isDefaultVoice (in DOMString aUri); */
NS_IMETHODIMP nsSynthVoiceRegistry::IsDefaultVoice(const nsAString & aUri, bool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* bool isLocalVoice (in DOMString aUri); */
NS_IMETHODIMP nsSynthVoiceRegistry::IsLocalVoice(const nsAString & aUri, bool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* AString getVoiceLang (in DOMString aUri); */
NS_IMETHODIMP nsSynthVoiceRegistry::GetVoiceLang(const nsAString & aUri, nsAString & _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* AString getVoiceName (in DOMString aUri); */
NS_IMETHODIMP nsSynthVoiceRegistry::GetVoiceName(const nsAString & aUri, nsAString & _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#define NS_SYNTHVOICEREGISTRY_CID \
{ /* {7090524d-5574-4492-a77f-d8d558ced59d} */ \
0x7090524d, \
0x5574, \
0x4492, \
{ 0xa7, 0x7f, 0xd8, 0xd5, 0x58, 0xce, 0xd5, 0x9d } \
}
#define NS_SYNTHVOICEREGISTRY_CONTRACTID \
"@mozilla.org/synth-voice-registry;1"
#define NS_SYNTHVOICEREGISTRY_CLASSNAME \
"Speech Synthesis Voice Registry"
#endif /* __gen_nsISynthVoiceRegistry_h__ */
|
62866f09861c83b46b9fee024cd435343fae678d | 9574b31ac860c3c02db778c21b44c59112de2bd7 | /_PBRRenderer/SpicesRenderer/SpicesRenderer/Source/OpenGL/Shader/ShaderAssemblageInfo_OpenGL.cpp | b66f53aee50bd815eb6d0ea9a048be0fa4a03f9d | [] | no_license | json-jcc/graphics_samples | 2da33ac8a462d12f712b9d78c7ee9e958e1194a9 | ae5e1edf90370cd2b6d50e10aee4db21ca576a14 | refs/heads/main | 2023-04-03T12:53:41.496236 | 2021-04-09T02:50:11 | 2021-04-09T02:50:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 41 | cpp | ShaderAssemblageInfo_OpenGL.cpp | #include "ShaderAssemblageInfo_OpenGL.h"
|
ccd5253090aee0e8b134cc17eafefea4e924d5ce | 8e9b7e24dd10c0994fda0f74a7f94c8264ea07e2 | /FactoryMethod2/windows/Dialog.h | 885fe48a09a97a2cdef72e6f4fe7dba8add8bcb8 | [] | no_license | akhtyamovpavel/PatternsExample | 763ffc2be32ffb8a86d3ee521f0bf0701ac059f2 | 465f944daf6909066c9f3b6b402e73484e07dd09 | refs/heads/master | 2021-04-26T23:06:09.185411 | 2018-03-26T10:27:53 | 2018-03-26T10:27:53 | 123,931,722 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 228 | h | Dialog.h | //
// Created by Pavel Akhtyamov on 05/03/2018.
//
#pragma once
#include <memory>
#include "../buttons/IButton.h"
class Dialog {
public:
void RenderWindow();
virtual std::unique_ptr<IButton> CreateButton() const = 0;
};
|
ec324dfd05473275b056e151b21c5b2fde170590 | 08c4c72067a82b4663b9a8a0a4b20b188eb89f2f | /src/string_chemifier.cpp | 2a6815c6db737b00e63d034d7504c245bb80fe7f | [] | no_license | ArchieGertsman/Algorithms | 099e3c62be03c416eb8c2c65944610d5159507aa | 2c49e153be725aea4cd991f64cb21f478d1f3886 | refs/heads/master | 2021-05-10T10:24:29.629256 | 2018-05-30T22:03:28 | 2018-05-30T22:03:28 | 118,382,173 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,558 | cpp | string_chemifier.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <string>
#include <locale>
#include <vector>
#include <sstream>
#include <algorithm>
std::set<std::string> elems;
const auto MAX_SYM_LEN = 2;
std::vector<std::string> split(const std::string &s, char delim) {
std::stringstream ss(s);
std::string item;
std::vector<std::string> tokens;
while (std::getline(ss, item, delim)) {
tokens.push_back(item);
}
return tokens;
}
std::string chemifySym(std::string sym) {
std::locale loc;
sym[0] = std::toupper(sym[0], loc);
if (sym.length() > 1) {
sym[1] = std::tolower(sym[1], loc);
}
return sym;
}
std::string chemifyWord(const std::string &str) {
for (auto sym_len = MAX_SYM_LEN; sym_len > 0; --sym_len) {
if (sym_len > str.length()) continue;
std::string sym = chemifySym(str.substr(0, sym_len));
if (elems.find(sym) != elems.end()) {
if (str.length() == sym_len) {
return sym;
}
std::string rest = chemifyWord(str.substr(sym_len));
if (!rest.empty()) {
return sym + rest;
}
}
}
return "";
}
std::string chemify(const std::string &str) {
auto toks = split(str, ' ');
std::string ret = "";
std::for_each(toks.begin(), toks.end(), [&](const std::string &str) {
std::string word = chemifyWord(str);
ret += (!word.empty() ? word : str) + ' ';
});
return ret;
}
int main() {
std::ifstream stream("elements.txt");
std::string line;
while (std::getline(stream, line)) {
elems.insert(line);
}
stream.close();
std::cout << chemify("obtain money") << '\n'; // output: OBTaIn MoNeY
}
|
12a197b85bed6a82407898edde79006992f95516 | 07d8596560ea476d6c01ea528f4bf1541a5d7d4b | /IntersectionOfTwoArraysTwo.cpp | d8a04ce560f5a87fb68cca1561439c6192f724bb | [] | no_license | VibhorKanojia/LeetCode | af58b3ef73a58282f743f3909b8ae5e7f22758d2 | b1a027509222dc5ddd760552c49ef9bec705c6f0 | refs/heads/master | 2018-12-19T10:54:36.467985 | 2018-11-04T22:21:35 | 2018-11-04T22:21:35 | 117,844,583 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 780 | cpp | IntersectionOfTwoArraysTwo.cpp | class Solution {
public:
vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
vector<int> solution;
unordered_map<int, int> mapper;
unordered_map<int, int>::iterator it;
for (int i = 0 ; i < nums1.size() ; i++){
it = mapper.find(nums1[i]);
if (it == mapper.end()){
mapper.insert(pair<int,int>(nums1[i],1));
}
else{
(it->second)++;
}
}
for (int i = 0; i < nums2.size(); i++){
it = mapper.find(nums2[i]);
if (it != mapper.end() && it->second > 0){
solution.push_back(it->first);
(it->second)--;
}
}
return solution;
}
};
|
48b71d766330fb3cb7c709a1640033302efffc79 | 873002d555745752657e3e25839f6653e73966a2 | /model/PollResponseResource.h | 7bce8f5752df874f45942cd18ff6544ff3745269 | [] | no_license | knetikmedia/knetikcloud-cpprest-client | e7e739e382c02479b0a9aed8160d857414bd2fbf | 14afb57d62de064fb8b7a68823043cc0150465d6 | refs/heads/master | 2021-01-23T06:35:44.076177 | 2018-03-14T16:02:35 | 2018-03-14T16:02:35 | 86,382,044 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,626 | h | PollResponseResource.h | /**
* Knetik Platform API Documentation latest
* This is the spec for the Knetik API. Use this in conjunction with the documentation found at https://knetikcloud.com.
*
* OpenAPI spec version: latest
* Contact: support@knetik.com
*
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* PollResponseResource.h
*
*
*/
#ifndef PollResponseResource_H_
#define PollResponseResource_H_
#include "ModelBase.h"
#include <cpprest/details/basic_types.h>
#include "SimpleUserResource.h"
namespace com {
namespace knetikcloud {
namespace client {
namespace model {
/// <summary>
///
/// </summary>
class PollResponseResource
: public ModelBase
{
public:
PollResponseResource();
virtual ~PollResponseResource();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(web::json::value& json) override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// PollResponseResource members
/// <summary>
/// The answer to the poll
/// </summary>
utility::string_t getAnswer() const;
void setAnswer(utility::string_t value);
/// <summary>
/// The date the poll was answered, in seconds since unix epoc
/// </summary>
int64_t getAnsweredDate() const;
bool answeredDateIsSet() const;
void unsetAnswered_date();
void setAnsweredDate(int64_t value);
/// <summary>
/// The id of the poll response
/// </summary>
utility::string_t getId() const;
bool idIsSet() const;
void unsetId();
void setId(utility::string_t value);
/// <summary>
/// The id of the poll
/// </summary>
utility::string_t getPollId() const;
void setPollId(utility::string_t value);
/// <summary>
/// The user
/// </summary>
std::shared_ptr<SimpleUserResource> getUser() const;
void setUser(std::shared_ptr<SimpleUserResource> value);
protected:
utility::string_t m_Answer;
int64_t m_Answered_date;
bool m_Answered_dateIsSet;
utility::string_t m_Id;
bool m_IdIsSet;
utility::string_t m_Poll_id;
std::shared_ptr<SimpleUserResource> m_User;
};
}
}
}
}
#endif /* PollResponseResource_H_ */
|
e1e6d00a900df761d860e95194a3b6637beeb002 | 0a381bcc118ad2d18fea78b3bef44951c1737b51 | /GeneralisedSoftBody/GeneralisedSoftBody/Edge.h | 59023dab4ae46c1669842107cacf935de3486766 | [] | no_license | HarryJamesDavies/GeneralisedSoftBodies | 0b694a86a791f7b0ff2eedc65ec24fd1193c6e18 | c5da618fc0b5b1c9ff09874f1f689b10b22ecf6c | refs/heads/main | 2023-08-04T02:56:51.650342 | 2021-09-12T18:20:25 | 2021-09-12T18:20:25 | 405,718,606 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 774 | h | Edge.h | //=================================================================
// Container for two vertices and identifiers of the neighbouring triangles
//=================================================================
#ifndef _EDGE_H_
#define _EDGE_H_
class Triangle;
struct Vertex;
class Edge
{
public:
Edge();
Edge(int _index, Vertex* _vertex1, Vertex* _vertex2, Triangle* _triangle);
~Edge();
int m_index;
Vertex* m_vertex1;
Vertex* m_vertex2;
//Indices of vertices within the triangle
int m_localVertex1Index;
int m_localVertex2Index;
//Index of triangle adjacent to the edge and shared edge within the triangle
int m_neighbouringTriangleIndex = -1;
int m_sharedEdgeIndex = -1;
//Triangle the edge belongs to
Triangle* m_triangle;
private:
};
#endif;
|
7ebeb87960d1d48f71e6b1d5c0ce34b06473565e | 3a3211781702ba573e1e1b4127cdd39b55c5b66a | /Tree.cpp | 3f45f28df64dfcba9ea03fb3d9bb2cb786b6c20b | [] | no_license | lamc8684/McIntire_CSCI2270_FinalProject | d77cbc7cb0a2c416c44671c18bf70201337e1105 | 690d952a78c47ba588d4da191a2f09249df1bda6 | refs/heads/master | 2020-06-09T01:31:33.363920 | 2015-04-29T23:11:47 | 2015-04-29T23:11:47 | 34,069,148 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,202 | cpp | Tree.cpp | #include "Tree.h"
#include <iostream>
#include <cstdlib>
#include <vector>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stdio.h>
using namespace std;
/*
Function Prototype:
Tree::Tree(int)
Function Description:
This function initializes the Tree that we are going to use to calculates the probabilities. Initializes all important variables, and calls the buildTree function.
Example:
Tree *DadTree;
DadTree=new Tree(number);
Precondition:
There is no required precondition, because you just initialize the Tree
Post condition:
A new Tree object with the variable name of your choice will be made. size of the Tree is determinated, counters are set to 0, and we make a Tree with the number of layers equal to the size of the Tree.
*/
Tree::Tree(int sze)
{
root->parent=NULL;
sizer=sze;
counters=0;
tracker=root;
Tree::buildTree(root, 0);
}
void Tree::buildTree(Node *x, int current){
if(current<sizer){
Node *newHead=new Node;
newHead->head=true;
Node *newTail=new Node;
newTail->head=false;
x->left=newHead;
x->right=newTail;
newHead->parent=x;
newHead->left=NULL;
newHead->right=NULL;
newTail->parent=x;
newTail->left=NULL;
newTail->right=NULL;
current++;
buildTree(newHead, current);
buildTree(newTail, current);
}
else{
return;
}
}
void Tree::reset(){
tracker=root;
flipCounter = 0;
numOfHeads = 0;
numOfTails = 0;
}
//needs to be fixed
void Tree::printTree(Node* node, int indent=0){
if(node != NULL) {
cout<< node->head << " \n";
if(node->left) printTree(node->left, indent+4);
if(node->right) printTree(node->right, indent+4);
/*if (indent) {
std::cout << std::setw(indent) << ' ';
}*/
}
}
void Tree::flipcoin(){
//0 is Tails and 1 is Heads
//random number generator indicates heads or tails
int flip=rand() % 2;
if (flip==1){ //heads
if(tracker->right!=NULL){
cout<<"Heads"<<endl;
tracker=tracker->left;
numOfHeads++;
prevFlipWasHeads = true;
}
else{ //at the leaf
cout<<"No more available flips"<<endl;
return;
}
}
else{ //tails
if(tracker->left!=NULL){
cout<<"Tails"<<endl;
tracker=tracker->right;
numOfTails++;
prevFlipWasHeads = false;
}
else{ //at the leaf
cout<<"No more available flips"<<endl;
return;
}
}
flipCounter++;
}
void Tree::initializeAllPoss(){
//helper function for allPossibilities
//new pointer so we don't lose track of the tracker pointer position
Node *x=tracker;
counters=0;
Probabilities=allPossibilities(x);
if(counters==1)
counters=0;
}
int Tree::allPossibilities(Node *x){
//count the leaves of the subtree recursively
if(x->right!=NULL)
allPossibilities(x->right);
if(x->left!=NULL)
allPossibilities(x->left);
//count all leaves
else if(x->left==NULL&&x->right==NULL)
counters++;
return counters;
}
void Tree::printPastFlips(){
if(flipCounter==0){
cout<<"You haven't flipped a coin yet."<<endl;
return;
}
Node *x=tracker;
queue <string> Outcomes;
cout<<" ";
while(x!=root){
if(x->head==true)
cout<<"Head <- ";
else
cout<<"Tail <- ";
x=x->parent;
}
cout<<endl;
}
void Tree::undoFlip(){
if(tracker->parent != NULL){
tracker=tracker->parent;
//tracker->head = NULL;
cout<<"Flip has been undone!"<<endl;
}
else{
cout<<"You haven't flipped a coin yet."<<endl;
return;
}
if(prevFlipWasHeads)
numOfHeads--;
else
numOfTails--;
flipCounter--;
}
void Tree::countFlips(){
cout<<"You have flipped "<<flipCounter<<" times."<<endl;
cout<<numOfHeads<<" were heads, "<<numOfTails<<" were tails."<<endl;
//2
//cout<<"wut"<<endl;
}
Tree::~Tree()
{
}
void Tree::forceFlip(bool isHeads){
if (isHeads){ //heads
if(tracker->left!=NULL){
tracker=tracker->left;
numOfHeads++;
prevFlipWasHeads = true;
}
else //at the leaf
cout<<"No more available flips"<<endl;
}
else{ //tails
if(tracker->right!=NULL){
tracker=tracker->right;
numOfTails++;
prevFlipWasHeads = false;
}
else //at the leaf
cout<<"No more available flips"<<endl;
}
flipCounter++;
}
void Tree::probability(int head, int tail){
int actualHeads = head - numOfHeads;
int actualTails = tail - numOfTails;
//Node *x=tracker;
int h=Tree::height();
cout<<"Height: "<<h<<endl;
if((actualHeads+actualTails)!=h){
cout<<"0% probability"<<endl;
return;
}
Tree::initializeAllPoss();
//cout<<"Prob: "<<Probabilities<<endl;
vector <int> P=Tree::Paschal(h);
double paths=P[P.size()-actualHeads];
//cout<<"Path: "<<paths<<endl;
double prob=(paths/Probabilities);
cout<<(prob*100)<<" % chance of getting "<<
actualHeads<<" more heads and "<<actualTails<<" more tails."<<endl;
}
int Tree::height(){
counters=1;
if(tracker->right!=NULL)
counter=tracker->right;
else
return 0;
while(counter->right!=NULL){
counters++;
counter=counter->right;
}
return counters;
}
vector <int> Tree::Paschal(int height){
vector <int> P;
for (int i = 0; i < height; i++)
{
int val = 1;
for (int k = 0; k <= i; k++)
{
P.push_back(val);
val = val * (i - k) / (k + 1);
}
}
for(int i =0;i<P.size();i++){
//cout<<P[i];
//cout<<endl;
}
return P;
}
void Tree::DeleteAll(Node *node){
if(node->left!=NULL)
DeleteAll(node->left);
if(node->right!=NULL)
DeleteAll(node->right);
delete node;
}
void Tree::compareProbabilities(double chanceR){
if (chanceR > 100){
cout<<"Nothing is that certain, young one."<<endl;
return;
}
double chances[10];
double bowling300 = (1.0/11500.0)*100;
chances[0] = bowling300;
double holeInOne = (1/5000.0)*100;
chances[1] = holeInOne;
double beingAstronaut = (1/13200000.0)*100;
chances[2] = beingAstronaut;
double murder = (1/2.0)*100;
chances[3] = murder;
double celebrityM = (1/3.0)*100;
chances[4] = celebrityM;
double hemmorrhoids = (1/25.0)*100;
chances[5] = hemmorrhoids;
double marriage = (1/1.3)*100;
chances[6] = marriage;
double victim = (1/20.0)*100;
chances[7] = victim;
double presHarvard = (1/3.58)*100;
chances[8] = presHarvard;
double beingAsian = (2.0/3.0)*100;
chances[9] = beingAsian;
double closestChance = 100;
int chanceNum;
string chanceMsg = "That is approximately the same chance of ";
for(int i = 0; i<10;i++){
double tempChance = fabs(chanceR-chances[i]);
if(tempChance<closestChance){
closestChance = tempChance;
chanceNum = i;
}
}
switch(chanceNum){
case 0:
cout<<chanceMsg<<"bowling a perfect 300 game."<<endl;
break;
case 1:
cout<<chanceMsg<<"getting a hole in one."<<endl;
break;
case 2:
cout<<chanceMsg<<"being an astronaut."<<endl;
break;
case 3:
cout<<chanceMsg<<"getting away with murder."<<endl;
break;
case 4:
cout<<chanceMsg<<"a celebrity marriage lasting forever."<<endl;
break;
case 5:
cout<<chanceMsg<<"getting a hemorrhoid."<<endl;
case 6:
cout<<chanceMsg<<"a marriage lasting at least 15 years."<<endl;
break;
case 7:
cout<<chanceMsg<<"being a victim of a serious crime."<<endl;
break;
case 8:
cout<<chanceMsg<<"a president having gone to Harvard."<<endl;
break;
case 9:
cout<<chanceMsg<<"being born Asian."<<endl;
break;
}
}
|
4dd612059fdb0776b9efeef33871f2982eee0900 | b7ee9ac14d6981e18fa1b19214366878a4884a42 | /Projects/Skylicht/Engine/Source/Graphics2D/CGUIExporter.cpp | 42e12ab1f38c84ec779016bea973bae7d37bc8cf | [
"MIT"
] | permissive | skylicht-lab/skylicht-engine | 89d51b4240ca6ed5a7f15b413df5711288580e9e | ff0e875581840efd15503cdfa49f112b6adade98 | refs/heads/master | 2023-09-01T02:23:45.865965 | 2023-08-29T08:21:41 | 2023-08-29T08:21:41 | 220,988,542 | 492 | 46 | MIT | 2023-06-05T10:18:45 | 2019-11-11T13:34:56 | C++ | UTF-8 | C++ | false | false | 2,412 | cpp | CGUIExporter.cpp | /*
!@
MIT License
Copyright (c) 2019 Skylicht Technology CO., LTD
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file is part of the "Skylicht Engine".
https://github.com/skylicht-lab/skylicht-engine
!#
*/
#include "pch.h"
#include "CGUIExporter.h"
namespace Skylicht
{
bool CGUIExporter::save(const char* file, CCanvas* canvas)
{
io::IXMLWriter* writeFile = getIrrlichtDevice()->getFileSystem()->createXMLWriter(file);
if (writeFile == NULL)
return false;
writeFile->writeComment(L"File generated by function CGUIExporter::save");
writeFile->writeLineBreak();
CGUIElement* root = canvas->getRootElement();
CObjectSerializable* object = root->createSerializable();
if (root->getChilds().size())
{
CObjectSerializable* childs = new CObjectSerializable("Childs");
object->addProperty(childs);
object->autoRelease(childs);
addChild(root, childs);
}
object->save(writeFile);
writeFile->drop();
return true;
}
void CGUIExporter::addChild(CGUIElement* parent, CObjectSerializable* parents)
{
std::vector<CGUIElement*>& childs = parent->getChilds();
for (CGUIElement* element : childs)
{
CObjectSerializable* object = element->createSerializable();
if (element->getChilds().size() > 0)
{
CObjectSerializable* childs = new CObjectSerializable("Childs");
object->addProperty(childs);
object->autoRelease(childs);
addChild(element, childs);
}
}
}
} |
34f775403586e20ac22986289895c93ef988c54f | 59773363f2ddc32944bdec43b2726b9255a67f7b | /seospider/include/header_decoration_widget.h | 2090736b87be15c3b4dfc16d3eb5c569054b9eda | [] | no_license | andrascii/RiveSolutions_SEO_Spider | 44ed25765562b520550574519d9ea9eab58a0d12 | 2dc9a51f80525e113eff461f54d64be74c61593a | refs/heads/master | 2022-12-27T17:04:02.618392 | 2020-10-14T10:17:54 | 2020-10-14T10:17:54 | 167,695,020 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 777 | h | header_decoration_widget.h | #pragma once
namespace SeoSpider
{
class CollapseHeaderButton;
class HeaderDecorationWidget : public QFrame
{
Q_OBJECT
public:
HeaderDecorationWidget(QWidget* parent = nullptr);
void addWidgetToHeader(QWidget* widget, Qt::AlignmentFlag align = Qt::AlignLeft, bool last = false) const;
void addContentWidget(QWidget* widget);
private slots:
void onAnimationFinished();
void onCollapseButtonClicked();
private:
QFrame* m_titleFrame;
QHBoxLayout* m_titleLayout;
QVBoxLayout* m_layout;
QWidget* m_contentWidget;
QHBoxLayout* m_contentLayout;
CollapseHeaderButton* m_collapseButton;
QParallelAnimationGroup* m_collapseAnimation;
bool m_animationFinished;
bool m_titleFrameCollapsed;
QVector<QWidget*> m_hiddenWidgets;
};
}
|
1fe948264f0ff25e2ca79384fcecad62bc4b0b57 | 82fba7822cce0376e242019679ef9bdae7231ad3 | /ABACUS/source/src_lcao/unkOverlap_lcao.cpp | d074b23b03dc8da307535d4b5f69bd15efbffcc4 | [] | no_license | abacus-ustc/abacus-GPU | 968bf7f7f91b3922ff43ff332438fbeacc748fd1 | d326fe411c8cdd718ac101693645da3bc17b4a19 | refs/heads/master | 2023-04-15T08:07:00.917906 | 2021-04-09T16:50:34 | 2021-04-09T16:50:34 | 346,221,292 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 21,797 | cpp | unkOverlap_lcao.cpp | #include "unkOverlap_lcao.h"
#include "../src_lcao/lcao_nnr.h"
#include "ctime"
#include "src_global/scalapack_connector.h"
unkOverlap_lcao::unkOverlap_lcao()
{
allocate_flag = false;
/*
const int kpoints_number = kv.nkstot;
lcao_wfc_global = new complex<double>**[kpoints_number];
for(int ik = 0; ik < kpoints_number; ik++)
{
lcao_wfc_global[ik] = new complex<double>*[NBANDS];
for(int ib = 0; ib < NBANDS; ib++)
{
lcao_wfc_global[ik][ib] = new complex<double>[NLOCAL];
ZEROS(lcao_wfc_global[ik][ib], NLOCAL);
}
}
cal_tag = new int*[NLOCAL];
for(int iw = 0; iw < NLOCAL; iw++)
{
cal_tag[iw] = new int[NLOCAL];
ZEROS(cal_tag[iw],NLOCAL);
}
*/
//ofs_running << "this is unkOverlap_lcao()" << endl;
}
unkOverlap_lcao::~unkOverlap_lcao()
{
if(allocate_flag)
{
for(int ik = 0; ik < kv.nkstot; ik++)
{
for(int ib = 0; ib < NBANDS; ib++)
{
delete lcao_wfc_global[ik][ib];
}
delete lcao_wfc_global[ik];
}
delete lcao_wfc_global;
for(int iw = 0; iw < NLOCAL; iw++)
{
delete cal_tag[iw];
}
delete cal_tag;
}
//ofs_running << "this is ~unkOverlap_lcao()" << endl;
}
void unkOverlap_lcao::init()
{
//cout << "unkOverlap_lcao::init start" << endl;
int Lmax_used, Lmax;
MOT.allocate(
ORB.get_ntype(),// number of atom types
ORB.get_lmax(),// max L used to calculate overlap
ORB.get_kmesh(), // kpoints, for integration in k space
ORB.get_Rmax(),// max value of radial table
ORB.get_dR(),// delta R, for making radial table
ORB.get_dk()); // delta k, for integration in k space
MOT.init_Table_Spherical_Bessel (2, 3, Lmax_used, Lmax);
Ylm::set_coefficients ();
MGT.init_Gaunt_CH( Lmax );
MGT.init_Gaunt( Lmax );
const int T = 0; //任意选择的元素类型
orb_r.set_orbital_info(
ORB.Phi[T].PhiLN(0,0).getLabel(), //atom label
T, //atom type
1, //angular momentum L
1, //number of orbitals of this L , just N
ORB.Phi[T].PhiLN(0,0).getNr(), //number of radial mesh
ORB.Phi[T].PhiLN(0,0).getRab(), //the mesh interval in radial mesh
ORB.Phi[T].PhiLN(0,0).getRadial(), // radial mesh value(a.u.)
Numerical_Orbital_Lm::Psi_Type::Psi,
ORB.Phi[T].PhiLN(0,0).getRadial(), // radial wave function
ORB.Phi[T].PhiLN(0,0).getNk(),
ORB.Phi[T].PhiLN(0,0).getDk(),
ORB.Phi[T].PhiLN(0,0).getDruniform(),
false,
true);
// 数组初始化
allocate_flag = true;
const int kpoints_number = kv.nkstot;
if(allocate_flag)
{
lcao_wfc_global = new complex<double>**[kpoints_number];
for(int ik = 0; ik < kpoints_number; ik++)
{
lcao_wfc_global[ik] = new complex<double>*[NBANDS];
for(int ib = 0; ib < NBANDS; ib++)
{
lcao_wfc_global[ik][ib] = new complex<double>[NLOCAL];
ZEROS(lcao_wfc_global[ik][ib], NLOCAL);
}
}
cal_tag = new int*[NLOCAL];
for(int iw = 0; iw < NLOCAL; iw++)
{
cal_tag[iw] = new int[NLOCAL];
ZEROS(cal_tag[iw],NLOCAL);
}
}
//获取每个cpu核的原子轨道系数
for(int ik = 0; ik < kpoints_number; ik++)
{
get_lcao_wfc_global_ik(lcao_wfc_global[ik],LOWF.WFC_K[ik]);
}
// 并行方案
int nproc,myrank;
MPI_Comm_size(MPI_COMM_WORLD,&nproc);
MPI_Comm_rank(MPI_COMM_WORLD,&myrank);
const int total_term = NLOCAL * NLOCAL;
const int remain = total_term % nproc;
int local_term = total_term / nproc;
if(myrank < remain)
{
local_term++;
}
int start;
for(int rank = 0; rank < nproc; rank++)
{
if(rank == myrank)
{
if(myrank < remain)
{
start = myrank * local_term;
}
else
{
start = myrank * local_term + remain;
}
}
}
int count = -1;
for(int iw1 = 0; iw1 < NLOCAL; iw1++)
{
for(int iw2 = 0; iw2 < NLOCAL; iw2++)
{
count++;
if(count >= start && count < (start + local_term))
{
cal_tag[iw1][iw2] = 1;
}
}
}
for(int TA = 0; TA < ucell.ntype; TA++)
{
for (int TB = 0; TB < ucell.ntype; TB++)
{
for (int LA=0; LA <= ORB.Phi[TA].getLmax() ; LA++)
{
for (int NA = 0; NA < ORB.Phi[TA].getNchi(LA); ++NA)
{
for (int LB = 0; LB <= ORB.Phi[TB].getLmax(); ++LB)
{
for (int NB = 0; NB < ORB.Phi[TB].getNchi(LB); ++NB)
{
center2_orb11[TA][TB][LA][NA][LB].insert(
make_pair(NB, Center2_Orb::Orb11(
ORB.Phi[TA].PhiLN(LA,NA),
ORB.Phi[TB].PhiLN(LB,NB),
MOT, MGT)));
}
}
}
}
}
}
for(int TA = 0; TA < ucell.ntype; TA++)
{
for (int TB = 0; TB < ucell.ntype; TB++)
{
for (int LA=0; LA <= ORB.Phi[TA].getLmax() ; LA++)
{
for (int NA = 0; NA < ORB.Phi[TA].getNchi(LA); ++NA)
{
for (int LB = 0; LB <= ORB.Phi[TB].getLmax(); ++LB)
{
for (int NB = 0; NB < ORB.Phi[TB].getNchi(LB); ++NB)
{
center2_orb21_r[TA][TB][LA][NA][LB].insert(
make_pair(NB, Center2_Orb::Orb21(
ORB.Phi[TA].PhiLN(LA,NA),
orb_r,
ORB.Phi[TB].PhiLN(LB,NB),
MOT, MGT)));
}
}
}
}
}
}
for( auto &co1 : center2_orb11 )
for( auto &co2 : co1.second )
for( auto &co3 : co2.second )
for( auto &co4 : co3.second )
for( auto &co5 : co4.second )
for( auto &co6 : co5.second )
co6.second.init_radial_table();
for( auto &co1 : center2_orb21_r )
for( auto &co2 : co1.second )
for( auto &co3 : co2.second )
for( auto &co4 : co3.second )
for( auto &co5 : co4.second )
for( auto &co6 : co5.second )
co6.second.init_radial_table();
//cout << "unkOverlap_lcao::init end" << endl;
return;
}
int unkOverlap_lcao::iw2it(int iw)
{
int ic, type;
ic = 0;
for(int it = 0; it < ucell.ntype; it++)
{
for(int ia = 0; ia < ucell.atoms[it].na; ia++)
{
for(int L = 0; L < ucell.atoms[it].nwl+1; L++)
{
for(int N = 0; N < ucell.atoms[it].l_nchi[L]; N++)
{
for(int i=0; i<(2*L+1); i++)
{
if(ic == iw)
{
type = it;
}
ic++;
}
}
}
}
}
return type;
}
int unkOverlap_lcao::iw2ia(int iw)
{
int ic, na;
ic = 0;
for(int it = 0; it < ucell.ntype; it++)
{
for(int ia = 0; ia< ucell.atoms[it].na; ia++)
{
for(int L = 0; L < ucell.atoms[it].nwl+1; L++)
{
for(int N = 0; N < ucell.atoms[it].l_nchi[L]; N++)
{
for(int i = 0; i < (2*L+1); i++)
{
if(ic == iw)
{
na = ia;
}
ic++;
}
}
}
}
}
return na;
}
int unkOverlap_lcao::iw2iL(int iw)
{
int ic, iL;
ic = 0;
for(int it = 0; it < ucell.ntype; it++)
{
for(int ia = 0; ia< ucell.atoms[it].na; ia++)
{
for(int L = 0; L < ucell.atoms[it].nwl+1; L++)
{
for(int N = 0; N < ucell.atoms[it].l_nchi[L]; N++)
{
for(int i = 0; i < (2*L+1); i++)
{
if(ic == iw)
{
iL = L;
}
ic++;
}
}
}
}
}
return iL;
}
int unkOverlap_lcao::iw2iN(int iw)
{
int ic, iN;
ic = 0;
for(int it = 0; it < ucell.ntype; it++)
{
for(int ia = 0; ia< ucell.atoms[it].na; ia++)
{
for(int L = 0; L < ucell.atoms[it].nwl+1; L++)
{
for(int N = 0; N < ucell.atoms[it].l_nchi[L]; N++)
{
for(int i = 0; i < (2*L+1); i++)
{
if(ic == iw)
{
iN = N;
}
ic++;
}
}
}
}
}
return iN;
}
int unkOverlap_lcao::iw2im(int iw)
{
int ic, im;
ic = 0;
for(int it = 0; it < ucell.ntype; it++)
{
for(int ia = 0; ia< ucell.atoms[it].na; ia++)
{
for(int L = 0; L < ucell.atoms[it].nwl+1; L++)
{
for(int N = 0; N < ucell.atoms[it].l_nchi[L]; N++)
{
for(int i = 0; i < (2*L+1); i++)
{
if(ic == iw)
{
im = i;
}
ic++;
}
}
}
}
}
return im;
}
//寻找近邻原子
void unkOverlap_lcao::cal_R_number()
{
// 原子轨道1和原子轨道2之间存在overlap的数目,或者说是R的数目,为空时说明没有overlap
orb1_orb2_R.resize(NLOCAL);
for(int iw = 0; iw < NLOCAL; iw++)
{
orb1_orb2_R[iw].resize(NLOCAL);
}
Vector3<double> tau1, tau2, dtau;
for (int T1 = 0; T1 < ucell.ntype; ++T1)
{
Atom* atom1 = &ucell.atoms[T1];
for (int I1 = 0; I1 < atom1->na; ++I1)
{
tau1 = atom1->tau[I1];
GridD.Find_atom(tau1, T1, I1);
for (int ad = 0; ad < GridD.getAdjacentNum()+1; ++ad)
{
const int T2 = GridD.getType(ad);
const int I2 = GridD.getNatom(ad);
Atom* atom2 = &ucell.atoms[T2];
const double R_direct_x = (double)GridD.getBox(ad).x;
const double R_direct_y = (double)GridD.getBox(ad).y;
const double R_direct_z = (double)GridD.getBox(ad).z;
tau2 = GridD.getAdjacentTau(ad);
dtau = tau2 - tau1;
double distance = dtau.norm() * ucell.lat0;
double rcut = ORB.Phi[T1].getRcut() + ORB.Phi[T2].getRcut();
if(distance < rcut - 1.0e-15)
{
// R_car 单位是 ucell.lat0
Vector3<double> R_car = R_direct_x * ucell.a1 +
R_direct_y * ucell.a2 +
R_direct_z * ucell.a3;
for(int iw1 = 0; iw1 < atom1->nw; iw1++)
{
int orb_index_in_NLOCAL_1 = ucell.itiaiw2iwt( T1, I1, iw1 );
for(int iw2 = 0; iw2 < atom2->nw; iw2++)
{
int orb_index_in_NLOCAL_2 = ucell.itiaiw2iwt( T2, I2, iw2 );
orb1_orb2_R[orb_index_in_NLOCAL_1][orb_index_in_NLOCAL_2].push_back(R_car);
} // end iw2
} // end iw1
}
} // end ad
} // end I1
} // end T1
return;
}
void unkOverlap_lcao::cal_orb_overlap()
{
//cout << "the cal_orb_overlap is start" << endl;
psi_psi.resize(NLOCAL);
psi_r_psi.resize(NLOCAL);
for(int iw = 0; iw < NLOCAL; iw++)
{
psi_psi[iw].resize(NLOCAL);
psi_r_psi[iw].resize(NLOCAL);
}
Vector3<double> origin_point(0.0,0.0,0.0);
for(int iw1 = 0; iw1 < NLOCAL; iw1++)
{
for(int iw2 = 0; iw2 < NLOCAL; iw2++)
{
//if ( !ParaO.in_this_processor(iw1,iw2) ) continue;
// iw1 和 iw2 永远没有overlap
if( orb1_orb2_R[iw1][iw2].empty() ) continue;
int atomType1 = iw2it(iw1); int ia1 = iw2ia(iw1); int N1 = iw2iN(iw1); int L1 = iw2iL(iw1); int m1 = iw2im(iw1);
int atomType2 = iw2it(iw2); int ia2 = iw2ia(iw2); int N2 = iw2iN(iw2); int L2 = iw2iL(iw2); int m2 = iw2im(iw2);
for(int iR = 0; iR < orb1_orb2_R[iw1][iw2].size(); iR++)
{
Vector3<double> r_distance = ( ucell.atoms[atomType2].tau[ia2] - ucell.atoms[atomType1].tau[ia1] + orb1_orb2_R[iw1][iw2][iR] ) * ucell.lat0;
psi_psi[iw1][iw2].push_back(center2_orb11[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, m2 ));
double overlap_x = -1 * sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 1, m2 ); // m = 1
double overlap_y = -1 * sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 2, m2 ); // m = -1
double overlap_z = sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 0, m2 ); // m =0
Vector3<double> overlap( overlap_x,overlap_y,overlap_z );
psi_r_psi[iw1][iw2].push_back(overlap);
}
}
}
//cout << "the cal_orb_overlap is end" << endl;
return;
}
// dk 's unit is ucell.tpiba
complex<double> unkOverlap_lcao::unkdotp_LCAO(const int ik_L, const int ik_R, const int iband_L, const int iband_R, const Vector3<double> dk)
{
//cout << "unkdotp_LCAO start" << endl;
complex<double> result(0.0,0.0);
for(int iw1 = 0; iw1 < NLOCAL; iw1++)
{
for(int iw2 = 0; iw2 < NLOCAL; iw2++)
{
//if ( !ParaO.in_this_processor(iw1,iw2) ) continue;
if( !cal_tag[iw1][iw2] )
{
//ofs_running << "the no calculate iw1 and iw2 is " << iw1 << "," << iw2 << endl;
continue;
}
//ofs_running << "the calculate iw1 and iw2 is " << iw1 << "," << iw2 << endl;
// iw1 和 iw2 永远没有overlap
if( orb1_orb2_R[iw1][iw2].empty() ) continue;
// e^i( ik_R*Rn - dk*tau1 )
Vector3<double> tau1 = ucell.atoms[ iw2it(iw1) ].tau[ iw2ia(iw1) ];
Vector3<double> tau2 = ucell.atoms[ iw2it(iw2) ].tau[ iw2ia(iw2) ];
Vector3<double> dtau = tau2 -tau1;
for(int iR = 0; iR < orb1_orb2_R[iw1][iw2].size(); iR++)
{
//*
double kRn = ( kv.kvec_c[ik_R] * orb1_orb2_R[iw1][iw2][iR] - dk * tau1 ) * TWO_PI;
complex<double> kRn_phase(cos(kRn),sin(kRn));
complex<double> orb_overlap( psi_psi[iw1][iw2][iR],(-dk * ucell.tpiba * psi_r_psi[iw1][iw2][iR]) );
result = result + conj( lcao_wfc_global[ik_L][iband_L][iw1] ) * lcao_wfc_global[ik_R][iband_R][iw2] * kRn_phase * orb_overlap;
//*/
/*
// test by jingan
// R_tem 是 iw1 和 iw2 的轨道中心的矢量
Vector3<double> R_tem = dtau + orb1_orb2_R[iw1][iw2][iR];
double kRn = ( kv.kvec_c[ik_R] * orb1_orb2_R[iw1][iw2][iR] - dk * tau1 - 0.5 * dk * R_tem ) * TWO_PI;
complex<double> kRn_phase(cos(kRn),sin(kRn));
double psi_r_psi_overlap = -dk * ucell.tpiba * psi_r_psi[iw1][iw2][iR] + 0.5 * dk * R_tem * TWO_PI * psi_psi[iw1][iw2][iR];
complex<double> orb_overlap( psi_psi[iw1][iw2][iR], psi_r_psi_overlap );
result = result + conj( lcao_wfc_global[ik_L][iband_L][iw1] ) * lcao_wfc_global[ik_R][iband_R][iw2] * kRn_phase * orb_overlap;
// test by jingan
*/
}
}
}
#ifdef __MPI
// note: the mpi uses MPI_COMMON_WORLD,so you must make the NPOOL = 1.
double in_date_real = result.real();
double in_date_imag = result.imag();
double out_date_real = 0.0;
double out_date_imag = 0.0;
MPI_Allreduce(&in_date_real , &out_date_real , 1, MPI_DOUBLE , MPI_SUM , MPI_COMM_WORLD);
MPI_Allreduce(&in_date_imag , &out_date_imag , 1, MPI_DOUBLE , MPI_SUM , MPI_COMM_WORLD);
result = complex<double>(out_date_real,out_date_imag);
#endif
return result;
}
void unkOverlap_lcao::get_lcao_wfc_global_ik(complex<double> **ctot, complex<double> **cc)
{
complex<double>* ctot_send = new complex<double>[NBANDS*NLOCAL];
MPI_Status status;
for (int i=0; i<DSIZE; i++)
{
if (DRANK==0)
{
if (i==0)
{
// get the wave functions from 'ctot',
// save them in the matrix 'c'.
for (int iw=0; iw<NLOCAL; iw++)
{
const int mu_local = GridT.trace_lo[iw];
if (mu_local >= 0)
{
for (int ib=0; ib<NBANDS; ib++)
{
//ctot[ib][iw] = cc[ib][mu_local];
ctot_send[ib*NLOCAL+iw] = cc[ib][mu_local];
}
}
}
}
else
{
int tag;
// receive lgd2
int lgd2 = 0;
tag = i * 3;
MPI_Recv(&lgd2, 1, MPI_INT, i, tag, DIAG_WORLD, &status);
if(lgd2==0)
{
}
else
{
// receive trace_lo2
tag = i * 3 + 1;
int* trace_lo2 = new int[NLOCAL];
MPI_Recv(trace_lo2, NLOCAL, MPI_INT, i, tag, DIAG_WORLD, &status);
// receive crecv
complex<double>* crecv = new complex<double>[NBANDS*lgd2];
ZEROS(crecv, NBANDS*lgd2);
tag = i * 3 + 2;
MPI_Recv(crecv,NBANDS*lgd2,mpicomplex,i,tag,DIAG_WORLD, &status);
for (int ib=0; ib<NBANDS; ib++)
{
for (int iw=0; iw<NLOCAL; iw++)
{
const int mu_local = trace_lo2[iw];
if (mu_local>=0)
{
//ctot[ib][iw] = crecv[mu_local*NBANDS+ib];
ctot_send[ib*NLOCAL+iw] = crecv[mu_local*NBANDS+ib];
}
}
}
delete[] crecv;
delete[] trace_lo2;
}
}
}// end DRANK=0
else if ( i == DRANK)
{
int tag;
// send GridT.lgd
tag = DRANK * 3;
MPI_Send(&GridT.lgd, 1, MPI_INT, 0, tag, DIAG_WORLD);
if(GridT.lgd != 0)
{
// send trace_lo
tag = DRANK * 3 + 1;
MPI_Send(GridT.trace_lo, NLOCAL, MPI_INT, 0, tag, DIAG_WORLD);
// send cc
complex<double>* csend = new complex<double>[NBANDS*GridT.lgd];
ZEROS(csend, NBANDS*GridT.lgd);
for (int ib=0; ib<NBANDS; ib++)
{
for (int mu=0; mu<GridT.lgd; mu++)
{
csend[mu*NBANDS+ib] = cc[ib][mu];
}
}
tag = DRANK * 3 + 2;
MPI_Send(csend, NBANDS*GridT.lgd, mpicomplex, 0, tag, DIAG_WORLD);
delete[] csend;
}
}// end i==DRANK
MPI_Barrier(DIAG_WORLD);
}
MPI_Bcast(ctot_send,NBANDS*NLOCAL,mpicomplex,0,DIAG_WORLD);
for(int ib = 0; ib < NBANDS; ib++)
{
for(int iw = 0; iw < NLOCAL; iw++)
{
ctot[ib][iw] = ctot_send[ib*NLOCAL+iw];
}
}
delete[] ctot_send;
return;
}
void unkOverlap_lcao::prepare_midmatrix_pblas(const int ik_L, const int ik_R, const Vector3<double> dk, complex<double> *&midmatrix)
{
//Vector3<double> dk = kv.kvec_c[ik_R] - kv.kvec_c[ik_L];
midmatrix = new complex<double>[ParaO.nloc];
ZEROS(midmatrix,ParaO.nloc);
for (int iw_row = 0; iw_row < NLOCAL; iw_row++) // global
{
for (int iw_col = 0; iw_col < NLOCAL; iw_col++) // global
{
int ir = ParaO.trace_loc_row[ iw_row ]; // local
int ic = ParaO.trace_loc_col[ iw_col ]; // local
if(ir >= 0 && ic >= 0)
{
int index = ic*ParaO.nrow+ir;
Vector3<double> tau1 = ucell.atoms[ iw2it(iw_row) ].tau[ iw2ia(iw_row) ];
for(int iR = 0; iR < orb1_orb2_R[iw_row][iw_col].size(); iR++)
{
double kRn = ( kv.kvec_c[ik_R] * orb1_orb2_R[iw_row][iw_col][iR] - dk * tau1 ) * TWO_PI;
complex<double> kRn_phase(cos(kRn),sin(kRn));
complex<double> orb_overlap( psi_psi[iw_row][iw_col][iR],(-dk * ucell.tpiba * psi_r_psi[iw_row][iw_col][iR]) );
midmatrix[index] = midmatrix[index] + kRn_phase * orb_overlap;
}
}
}
}
}
complex<double> unkOverlap_lcao::det_berryphase(const int ik_L, const int ik_R, const Vector3<double> dk, const int occ_bands)
{
const complex<double> minus = complex<double>(-1.0,0.0);
complex<double> det = complex<double>(1.0,0.0);
complex<double> *midmatrix = NULL;
complex<double> *C_matrix = new complex<double>[ParaO.nloc];
complex<double> *out_matrix = new complex<double>[ParaO.nloc];
ZEROS(C_matrix,ParaO.nloc);
ZEROS(out_matrix,ParaO.nloc);
this->prepare_midmatrix_pblas(ik_L,ik_R,dk,midmatrix);
//LOC.wfc_dm_2d.wfc_k
char transa = 'C';
char transb = 'N';
int occBands = occ_bands;
int nlocal = NLOCAL;
double alpha=1.0, beta=0.0;
int one = 1;
pzgemm_(&transa,&transb,&occBands,&nlocal,&nlocal,&alpha,
LOC.wfc_dm_2d.wfc_k[ik_L].c,&one,&one,ParaO.desc,
midmatrix,&one,&one,ParaO.desc,
&beta,
C_matrix,&one,&one,ParaO.desc);
pzgemm_(&transb,&transb,&occBands,&occBands,&nlocal,&alpha,
C_matrix,&one,&one,ParaO.desc,
LOC.wfc_dm_2d.wfc_k[ik_R].c,&one,&one,ParaO.desc,
&beta,
out_matrix,&one,&one,ParaO.desc);
//int *ipiv = new int[ ParaO.nrow+ParaO.desc[4] ];
int *ipiv = new int[ ParaO.nrow ];
int info;
pzgetrf_(&occBands,&occBands,out_matrix,&one,&one,ParaO.desc,ipiv,&info);
for(int i = 0; i < occBands; i++) // global
{
int ir = ParaO.trace_loc_row[ i ]; // local
int ic = ParaO.trace_loc_col[ i ]; // local
if(ir >= 0 && ic >= 0)
{
int index = ic*ParaO.nrow+ir;
if(ipiv[ir] != (i+1))
{
det = minus * det * out_matrix[index];
}
else
{
det = det * out_matrix[index];
}
}
}
delete[] midmatrix;
delete[] C_matrix;
delete[] out_matrix;
delete[] ipiv;
#ifdef __MPI
// note: the mpi uses MPI_COMMON_WORLD,so you must make the NPOOL = 1.
complex<double> result;
MPI_Allreduce(&det , &result , 1, MPI_DOUBLE_COMPLEX , MPI_PROD , DIAG_WORLD);
return result;
#endif
return det;
}
void unkOverlap_lcao::test()
{
this->init();
this->cal_R_number();
this->cal_orb_overlap();
for(int ik = 0; ik < kv.nkstot; ik++)
{
for(int ib = 0; ib < NBANDS; ib++)
for(int iw = 0; iw < NLOCAL; iw++)
{
ofs_running << "the global lcao wfc : ik = " << ik << " ib = " << ib << " iw = " << iw << " valuse = " << lcao_wfc_global[ik][ib][iw] << endl;
}
}
/*
for(int iw1 = 0; iw1 < NLOCAL; iw1++)
{
for(int iw2 = 0; iw2 < NLOCAL; iw2++)
{
if(!cal_tag[iw1][iw2]) continue;
ofs_running << "the cal_tag is not 0: " << iw1 << " " << iw2 << endl;
}
}
*/
/*
const int index_1 = 3;
const int index_2 = 4;
if(!orb1_orb2_R[index_1][index_2].empty())
{
for(int iR = 0; iR < orb1_orb2_R[index_1][index_2].size(); iR++)
cout << "the R is " << orb1_orb2_R[index_1][index_2][iR].x << "," << orb1_orb2_R[index_1][index_2][iR].y << "," << orb1_orb2_R[index_1][index_2][iR].z << " and overlap is " << psi_psi[index_1][index_2][iR] << endl;
}
*/
/*
Vector3<double> dk = kv.kvec_c[0] - kv.kvec_c[0];
ofs_running << "(" << 0 << "," << 0 << ") = " << abs(this->unkdotp_LCAO(0,0,0,0,dk)) << endl;
*/
/*
Vector3<double> dk = kv.kvec_c[0] - kv.kvec_c[0];
for(int ib = 0; ib < NBANDS; ib++)
for(int ib2 = 0; ib2 < NBANDS; ib2++)
ofs_running << "(" << ib2 << "," << ib << ") = " << abs(this->unkdotp_LCAO(0,0,ib2,ib,dk)) << endl;
*/
/*
double result = 0;
for(int iw = 0; iw < NLOCAL; iw++)
{
cout << "the wfc 11 is " << LOWF.WFC_K[11][13][iw] << " and the 23 is " << LOWF.WFC_K[23][13][iw] << endl;
}
*/
}
|
2dc461d4e7a0ede87cd0d4e2b5d9635f2130ae55 | 00468e19a2af654b97c34c4464e2353627cff6f1 | /belonogov/main.cpp | f5c94146b2918755a170c54e0cd4f33e7973b3f9 | [] | no_license | eugene536/KSE | 69afdad2d62f050faf3c739573bb9856a20a049d | 690ae5252f5c5257c19e9db20bd9de04297af8c9 | refs/heads/master | 2021-03-19T14:35:12.558235 | 2016-12-22T10:13:53 | 2016-12-22T10:13:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,508 | cpp | main.cpp | #include <iostream>
#include "solver_1_2.h"
using namespace std;
using namespace parts_1_2;
int main() {
parts_1_2::Solver solver;
if (1) {
//db(consts::get_K(1, 823));
//cout << solver.get("Al", "V", 823) << endl;
// cout << solver.get("Ga", "V", 950 + 273) << endl;
// cout << solver.get("Ga", "GaCl", 950 + 273) << endl;
// cout << solver.get("Ga", "GaCl2", 950 + 273) << endl;
// cout << solver.get("Ga", "GaCl3", 950 + 273) << endl;
for (int i = 350; i <= 650; i++) {
db(i);
cout << solver.get("Al", "AlCl", i + 273) << endl;
}
for (int i = 650; i <= 950; i++) {
db(i);
cout << solver.get("Ga", "GaCl", i + 273) << endl;
}
}
else {
//shared_ptr<Expression> f1 = shared_ptr<Expression>(new Addition({makeVar(1, 2, 0), makeVar(1, 2, 1), makeVar(-16, 0, -1)}));
shared_ptr<Expression> f1 = make_shared<Multiplication>(Multiplication(
make_shared < Addition > (Addition({ makeVar(1, 1, 0), makeVar(-5, 0, -1) })),
make_shared < Addition > (Addition({ makeVar(1, 1, 1), makeVar(5, 0, -1) }))));
shared_ptr<Expression> f2 = make_shared<Multiplication>(Multiplication(
make_shared < Addition > (Addition({ makeVar(1, 1, 0), makeVar(2, 0, -1) })),
make_shared < Addition > (Addition({ makeVar(1, 1, 1), makeVar(-3, 0, -1) }))));
//shared_ptr<Expression> f2 = shared_ptr<Expression>(new Addition({makeVar(1, 1, 0), makeVar(1, 1, 1), makeVar(-4, 0,-1)} ));
db(f1->value({-2, -5}));
db(f2->value({-2, -5}));
//exit(0);
auto res = newton({-1000, -1000}, {f1, f2});
for (auto x: res)
cerr << x << " ";
cerr << endl;
// shared_ptr<Expression> f = shared_ptr<Expression>(new Addition({shared_ptr<Expression>(new Variable(1, 2, 0)),
// shared_ptr<Expression>(
// new Variable(-9, 0, -1))}));
//
// db(f->value({3}));
// db(f->value({-3}));
// //exit(0);
// auto res = newton({1}, {f});
// for (auto x: res)
// cerr << x << " ";
// cerr << endl;
}
return 0;
} |
ee66d377faf3d83cc84c5b4a5d651c7afa956bb4 | 33eab256de2307c19b6a92e9f92bef94cec16aa0 | /348A.cpp | c3af8f518364a2166962ace6a7e48eab936788e5 | [] | no_license | latteprog/Codeforces | 6856357e7d51c0d4346dd1eb8fb3b45507786451 | 1873c5167cd2834eda2ba14eaeed9fdac5ee6ec2 | refs/heads/master | 2021-01-09T23:35:16.047481 | 2016-11-30T18:19:34 | 2016-11-30T18:19:34 | 73,215,513 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 539 | cpp | 348A.cpp | #include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
long long int n,i,a,mx = 0,mn = 1000000000,s,e,m,sum = 0;
scanf("%I64d",&n);
for(i = 0; i < n; i++)
{
scanf("%I64d",&a);
sum += a;
mn = min(a,mn);
mx = max(a,mx);
}
s = mx - 1;
e = mx + mn;
while(e - s > 1)
{
m = (s + e) / 2;
if((n - 1) * m >= sum)
{
e = m;
} else {
s = m;
}
}
printf("%I64d",e);
}
|
041ce64280f0e33688f0536ede327cae44df196a | b344a9459695d169ec06da08e5fbeec1a5633f55 | /Include/TransmitServer/HTTPServer/HTTPRequestHandlerFactory.h | e81b5bdee7f68ac84e1343632c55dcb43dd955e2 | [] | no_license | shuchuangtech/Shuchuang | 50bebda1dd64a8274602049d9111e170c33285fb | 202d7af9bd666667c6ac91a1903d2d862ee97b53 | refs/heads/master | 2020-12-28T17:11:44.956583 | 2016-06-06T13:51:38 | 2016-06-06T13:51:38 | 39,610,756 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 491 | h | HTTPRequestHandlerFactory.h | #ifndef __SERVER_HTTP_REQUEST_HANDLER_FACTORY_H__
#define __SERVER_HTTP_REQUEST_HANDLER_FACTORY_H__
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPServerRequest.h"
class CHTTPRequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory
{
public:
CHTTPRequestHandlerFactory();
~CHTTPRequestHandlerFactory();
Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request);
};
#endif
|
524d8b63cd0bb5eddf79bf8965394543822a5fe2 | 5888c735ac5c17601969ebe215fd8f95d0437080 | /All code of my PC/ARRY DELETE.CPP | 681ce6e00b7285cbe4ccfd77f73c55f0e41eb213 | [] | no_license | asad14053/My-Online-Judge-Solution | 8854dc2140ba7196b48eed23e48f0dcdb8aec83f | 20a72ea99fc8237ae90f3cad7624224be8ed4c6c | refs/heads/master | 2021-06-16T10:41:34.247149 | 2019-07-30T14:44:09 | 2019-07-30T14:44:09 | 40,115,430 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 315 | cpp | ARRY DELETE.CPP | #include<stdio.h>
#include<conio.h>
int main()
{
int a[23],loc,n,i;
//clrscr();
printf("\nrange:");
scanf("%d",&n);
printf("\nloc:");
scanf("%d",&loc);
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
for(i=loc+1;i<=n;i++)
{
a[i-1]=a[i];
}
n=n-1;
for(i=1;i<=n;i++)
printf("%d",a[i]);
getch();
}
|
af13226a606f3c266f4fb85bb72dd75cbc4a9163 | 5268f1f6657eb0a6eb9db0e57ebb1ace54547e98 | /AccountException.h | f3aa4be826e0499484449d8bc2596c1cf0ba9a18 | [] | no_license | DapengJin/Comprehensive_Example | 5af00809e1516911cd4a2db44c0704dc6962eff0 | d6162d822b16c648563b10f224cc867754c60c48 | refs/heads/master | 2022-08-02T15:29:05.421364 | 2020-06-03T04:19:06 | 2020-06-03T04:19:06 | 261,595,743 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 540 | h | AccountException.h | //
// Created by 45184 on 2020/6/2.
//
#ifndef COMPREHENSIVE_EXAMPLE_ACCOUNTEXCEPTION_H
#define COMPREHENSIVE_EXAMPLE_ACCOUNTEXCEPTION_H
#include <stdexcept>
#include "Account.h"
using namespace std;
class Account;
class AccountException : public runtime_error{
private:
const Account * account;
public:
AccountException(const Account * account, const string &msg)
:runtime_error(msg), account(account){ }
const Account * getAccount() const {return account;}
};
#endif //COMPREHENSIVE_EXAMPLE_ACCOUNTEXCEPTION_H
|
9d91c433bdd8b451dfe850be1f86310b3252f419 | d6f907bbdcc73c9d235792143829071c89f46a70 | /Chombo/releasedExamples/MappedMultiBlock/srcPolytropic/CubedSpherePolyIBC.cpp | 78b13e94363579609b720e451ab7ba7141e78837 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | LLNL/COGENT | 2095aa2dfda75f03b01d7d271ee01059ebaa99e0 | 955f848bcfb8811ebdf6c52c605efb3b71e5177c | refs/heads/master | 2023-08-23T19:00:32.957355 | 2023-05-06T03:05:11 | 2023-05-06T03:05:11 | 61,917,616 | 13 | 5 | null | 2023-01-20T22:18:06 | 2016-06-24T23:22:42 | C++ | UTF-8 | C++ | false | false | 11,708 | cpp | CubedSpherePolyIBC.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "CubedSpherePolyIBC.H"
#include "CubedSpherePolyIBCF_F.H"
#include "LoHiSide.H"
#include "Box.H"
#include "RampMappedIBCF_F.H"
#include "CHArray.H"
#include "BoxIterator.H"
#include "CubedSphereShellPanelCS.H"
#include "LGintegrator.H"
#include "LoHiCenter.H"
#include "SetCentersF_F.H"
#include "MOLPhysicsMappedArtViscF_F.H"
#include "PolytropicPhysicsF_F.H"
#include "UnitNormalsF_F.H"
/*******************************************************************************
*
* Class CubedSpherePolyIBC: member definitions
*
******************************************************************************/
/*--------------------------------------------------------------------*
* Definitions of static member data
*--------------------------------------------------------------------*/
bool CubedSpherePolyIBC::s_isFortranCommonSet = false;
/*--------------------------------------------------------------------*/
// Null constructor
/*--------------------------------------------------------------------*/
// Return the advection velocity at each cell center
void
CubedSpherePolyIBC::
getAdvVel(LevelData<FArrayBox>& a_advVel, Real a_time)
{
CH_TIME("CubedSphereFlowIBC::advVel");
CH_assert(m_haveCoordSys);
// For this particular IBC, a_advVel will be independent of a_time.
const DisjointBoxLayout& layout = a_advVel.disjointBoxLayout();
DataIterator dit = a_advVel.dataIterator();
for (dit.begin(); dit.ok(); ++dit)
{
const Box& baseBox = layout[dit];
// Storage for current grid
FArrayBox& velFab = a_advVel[dit];
// Box of current grid
Box uBox = velFab.box();
// removed by petermc, 9 Feb 2011
// uBox &= m_domain;
const CubedSphereShellPanelCS* coordSysBlockPtr =
dynamic_cast<const CubedSphereShellPanelCS*>(
m_coordSysPtr->getCoordSys(baseBox));
if(coordSysBlockPtr == NULL)
{
MayDay::Error("this ibc was kinda hardwired for CubedSphereShellPanelCS");
}
// Xi: mapped space coordinates
FArrayBox XiFab(uBox, SpaceDim);
coordSysBlockPtr->getCellMappedCoordinates(XiFab, uBox);
pointAdvVel(velFab, XiFab, a_time, *coordSysBlockPtr);
}
// convert point values into 4th-order cell averages
// petermc, 1 Oct 2009: This is to be done outside, if requested.
// fourthOrderAverage(a_advVel);
}
// Return the advection velocity at each point
void CubedSpherePolyIBC::pointAdvVel(FArrayBox& a_velFab,
const FArrayBox& a_xiLoc, Real a_time,
const CubedSphereShellPanelCS& coordSysBlock)
{
// rll: longitude-latitude coordinates
Box velBox = a_xiLoc.box();
FArrayBox rllFab(velBox, SpaceDim);
coordSysBlock.fabTransformEquiangularToLonLat(a_xiLoc, rllFab);
// vecRLL: vector in longitude-latitude basis
FArrayBox vecRLLFab(velBox, SpaceDim);
// Constant in time
FORT_CSPVECLONLATSOLIDBODYFLOW(CHF_FRA(vecRLLFab),
CHF_CONST_FRA(rllFab),
CHF_CONST_REAL(m_magnitude),
CHF_CONST_REAL(m_angle),
CHF_CONST_REAL(m_shift));
// Conver to velFab: vector in equiangular basis
coordSysBlock.fabVectorTransformLatLonToEquiangular(
a_xiLoc, vecRLLFab, a_velFab);
}
CubedSpherePolyIBC::CubedSpherePolyIBC()
{
}
/*--------------------------------------------------------------------*/
CubedSpherePolyIBC::
CubedSpherePolyIBC(const Real a_gamma,
const Real a_r0,
const Real a_p0,
const Real& a_radius,
const Vector<Real>& a_longitude,
const Vector<Real>& a_latitude,
const Real& a_delta,
const int a_power,
const Real& a_magnitude,
const Real& a_angle,
const Real& a_shift)
:m_gamma (a_gamma),
m_r0 (a_r0),
m_p0 (a_p0),
m_radius (a_radius),
m_longitude (a_longitude),
m_latitude (a_latitude),
m_delta (a_delta),
m_power (a_power),
m_magnitude (a_magnitude),
m_angle (a_angle),
m_shift (a_shift)
{
Real smallp;
setFortranCommon(smallp,
a_gamma);
}
/*--------------------------------------------------------------------*/
CubedSpherePolyIBC::
~CubedSpherePolyIBC()
{
}
/*--------------------------------------------------------------------*/
void
CubedSpherePolyIBC::setFortranCommon(Real& a_smallPressure,
const Real a_gamma)
{
FORT_CUBEDSPHERECOSBSETF(CHF_REAL(a_smallPressure),
CHF_CONST_REAL(a_gamma));
s_isFortranCommonSet = true;
}
/*--------------------------------------------------------------------*/
PhysMappedIBC*
CubedSpherePolyIBC::
new_physIBC()
{
CubedSpherePolyIBC*
retRamp = new CubedSpherePolyIBC(m_gamma ,
m_r0 ,
m_p0 ,
m_radius ,
m_longitude ,
m_latitude ,
m_delta ,
m_power,
m_magnitude,
m_angle,
m_shift
);
if (m_haveTime) retRamp->setTime(m_time);
if (m_haveCoordSys) retRamp->setCoordSys(m_coordSysPtr);
return static_cast<PhysMappedIBC*>(retRamp);
}
/*--------------------------------------------------------------------*/
void
CubedSpherePolyIBC::
initialize(LevelData<FArrayBox>& a_U)
{
CH_assert(m_isDefined == true);
CH_assert(m_haveCoordSys);
// const LevelData<FArrayBox>& cellAvgJ = m_coordSysPtr->getJ();
const DisjointBoxLayout& layout = a_U.disjointBoxLayout();
LevelData<FArrayBox> advectiveVelocity(layout, SpaceDim, a_U.ghostVect());
Real time = 0;
if (m_haveTime) time = m_time;
getAdvVel(advectiveVelocity, time);
DataIterator dit = layout.dataIterator();
const int nbells = m_longitude.size();
// Iterator of all grids in this level
for (dit.begin(); dit.ok(); ++dit)
{
const Box& baseBox = layout[dit];
// Storage for current grid
FArrayBox& UFab = a_U[dit];
// Box of current grid
Box uBox = UFab.box();
// removed by petermc, 9 Feb 2011
// uBox &= m_domain;
const CubedSphereShellPanelCS* coordSysBlockPtr =
dynamic_cast<const CubedSphereShellPanelCS*>(
m_coordSysPtr->getCoordSys(baseBox));
CH_assert(coordSysBlockPtr);
// For each point:
// set RealVect Xi, which is just linear,
// and then RealVect X( m_coordSysPtr->realCoord( Xi ) );
// and then Real J( m_coordSysPtr->pointwiseJ( X ) );
// Xi: mapped space coordinates
FArrayBox XiFab(uBox, SpaceDim);
coordSysBlockPtr->getCellMappedCoordinates(XiFab, uBox);
// Evaluate cosine bell
BoxIterator bit(uBox);
for (bit.begin(); bit.ok(); ++bit)
{
IntVect iv = bit();
// Get equiangular coordinates
RealVect xi;
xi[0] = XiFab(iv,0);
xi[1] = XiFab(iv,1);
RealVect lonlat;
coordSysBlockPtr->pointTransformEquiangularToLonLat(xi, lonlat);
Real dLon = lonlat[0];
Real dLat = lonlat[1];
Real dH = 0;
for (int i = 0; i < nbells; i++)
{
Real dRi =
acos(sin(m_latitude[i])*sin(dLat)
+ cos(m_latitude[i])*cos(dLat)*cos(dLon - m_longitude[i]));
if (dRi < m_radius)
{
Real cosshape = 0.5 * (1.0 + cos(M_PI * dRi / m_radius));
dH = pow(cosshape, m_power);
dH = m_delta * dH;
break;
}
}
Real rho = m_r0 + dH;
UFab(iv,URHO) = rho;
for(int idir = 0; idir < SpaceDim; idir++)
{
UFab(iv, UMOMX+idir) = rho*advectiveVelocity[dit()](iv, idir);
}
UFab(iv, UENG) = m_p0/(m_gamma -1.0);
}
//now multiply by J
FArrayBox JFab(uBox, 1);
coordSysBlockPtr->pointwiseJ(JFab, XiFab, uBox);
for (int comp = 0; comp < UFab.nComp(); comp++)
{
UFab.mult(JFab, 0, comp);
}
}
}
/*--------------------------------------------------------------------*/
void CubedSpherePolyIBC::primBC(FArrayBox& a_WGdnv,
const FArrayBox& a_Wextrap,
const FArrayBox& a_W,
const FArrayBox *const a_unitNormalBasisPtr,
const Interval& a_velIntv,
const int& a_dir,
const Side::LoHiSide& a_side,
const Real& a_time)
{
// Do nothing.
// MayDay::Error("no supposed to get to primBC");
}
/*--------------------------------------------------------------------*/
void CubedSpherePolyIBC::setBdrySlopes(FArrayBox& a_dW,
const FArrayBox& a_W,
const int& a_dir,
const Real& a_time)
{
CH_assert(s_isFortranCommonSet == true);
CH_assert(m_isDefined == true);
MayDay::Error("CubedSpherePolyIBC::setBdrySlopes: is not expected for fourth-"
"order solutions");
}
/*--------------------------------------------------------------------*/
void CubedSpherePolyIBC::artViscBC(
FArrayBox& a_NtFdir,
const CHArray<Real, SpaceDim+1, ArRangeCol>& a_Nctg,
const FArrayBox& a_U,
const FArrayBox& a_unitNormalBasis,
const FArrayBox& a_divVel,
const FArrayBox& a_csq,
const FArrayBox& a_dxFace,
const Interval& a_momIntv,
const Real a_alpha,
const Real a_beta,
const Box& a_loFaceBox,
const int a_hasLo,
const Box& a_hiFaceBox,
const int a_hasHi,
const int a_dir)
{
}
|
f83f4b28d17ab8fcdae62c9f3c3afaedb2701d82 | 13a1988494bf68298e7984c04887312778664a5d | /src/newframework/GL/program.h | 885738b2ee6d096d70d3dcd818a646342d875013 | [] | no_license | zc5872061/opengl_Renderer | 0864c81611bc7052b574327a24a68a4eb76c3a14 | 931d501ba0052f1bd1a73e0b37a0d7f38c86e89b | refs/heads/master | 2020-04-12T22:49:01.195954 | 2015-10-21T17:04:31 | 2015-10-21T17:04:31 | 41,361,175 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 478 | h | program.h | #ifndef PROGRAM_H
#define PROGRAM_H
#include <vector>
#include <GL/glew.h>
#include "shader.h"
namespace GL {
class Program {
public:
Program();
~Program();
GLuint getHandle();
GLint status();
void use();
private:
GLuint _handle;
std::vector<Shader> createShaders();
void attachShaders(std::vector<Shader> &shaderList);
void detachShaders(std::vector<Shader> &shaderList);
void logError();
};
}
#endif
|
1cfbc509a5175bc2714eaf966b373edde65a59dc | 0a611eb5db3b4d71f90dcb368444e4d8ea935f4f | /Lines_window.cpp | dd6ed0defdecf8387990a2f6b269a3c0e554a824 | [] | no_license | Laci101/prog1 | 49ad6a37def4e1bf994b04163cdbbfd01547e23b | dd7d04bca1a77c218c5a60b8cc86bfa04464a2f1 | refs/heads/master | 2023-04-10T22:49:59.387127 | 2021-04-24T12:41:12 | 2021-04-24T12:41:12 | 340,932,087 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,902 | cpp | Lines_window.cpp | #include "Lines_window.h"
Lines_window::Lines_window(Point xy, int w, int h, const string& title)
: Window{xy, w, h, title},
next_button{Point{x_max() - 150, 0}, 70, 20, "Next point",
[](Address, Address pw) { reference_to<Lines_window>(pw).next(); }},
quit_button{Point{x_max() - 70, 0}, 70, 20, "Quit",
[](Address, Address pw) { reference_to<Lines_window>(pw).quit(); }},
next_x{Point{x_max() - 310, 0}, 50, 20, "next x:"},
next_y{Point{x_max() - 210, 0}, 50, 20, "next y:"},
xy_out{Point{100, 0}, 100, 20, "current (x,y):"},
color_menu{Point{x_max() - 70, 30}, 70, 20, Menu::vertical, "color"},
color_button{Point{x_max() - 80, 30}, 80, 20, "color menu",
[](Address, Address pw) {
reference_to<Lines_window>(pw).color_pressed();
}
},
style_menu{Point{10, 30}, 70, 20, Menu::vertical, "style"},
style_button{Point{0, 30}, 80, 20, "style menu",
[](Address, Address pw) {
reference_to<Lines_window>(pw).style_pressed();
}
}
{
attach(next_button);
attach(quit_button);
attach(next_x);
attach(next_y);
attach(xy_out);
xy_out.put("no point");
color_menu.attach(new Button{Point{0, 0}, 0, 0, "red",
[](Address, Address pw) {
reference_to<Lines_window>(pw).red_pressed();
}
});
color_menu.attach(new Button{Point{0, 0}, 0, 0, "blue",
[](Address, Address pw) {
reference_to<Lines_window>(pw).blue_pressed();
}
});
color_menu.attach(new Button{Point{0, 0}, 0, 0, "black",
[](Address, Address pw) {
reference_to<Lines_window>(pw).black_pressed();
}
});
color_menu.attach(new Button{Point{0, 0}, 0, 0, "yellow",
[](Address, Address pw) {
reference_to<Lines_window>(pw).yellow_pressed();
}
});
style_menu.attach(new Button{Point{0, 0}, 0, 0, "dot",
[](Address, Address pw) {
reference_to<Lines_window>(pw).dot_pressed();
}
});
style_menu.attach(new Button{Point{0, 0}, 0, 0, "dash",
[](Address, Address pw) {
reference_to<Lines_window>(pw).dash_pressed();
}
});
style_menu.attach(new Button{Point{0, 0}, 0, 0, "solid",
[](Address, Address pw) {
reference_to<Lines_window>(pw).solid_pressed();
}
});
attach(color_menu);
attach(style_menu);
color_menu.hide();
style_menu.hide();
attach(color_button);
attach(style_button);
attach(lines);
}
void Lines_window::quit()
{
hide(); // curious FLTK idiom to delete window
}
void Lines_window::next()
{
int x = next_x.get_int();
int y = next_y.get_int();
lines.add(Point{x, y});
// update current position readout:
ostringstream ss;
ss << '(' << x << ',' << y << ')';
xy_out.put(ss.str());
redraw();
}
|
cda64d486d5944f849f23e729130e24f364d5586 | e880735a3d31663fc8b5a5d047d46dac4b8b216d | /SN-LC-MCMC/V2/LC3MCMCv2.cpp | f954b03384265c63fc3a07300d4641cf7cc567e4 | [] | no_license | Hydralisk24/Science | 8b1a301cf8646323dae4f4f87b1f7c17d2a381b2 | 7f2462699ba2a745a46a4991111fc9fbae8b6e5d | refs/heads/master | 2023-05-11T03:31:24.996362 | 2023-04-26T16:09:15 | 2023-04-26T16:09:15 | 204,718,754 | 2 | 3 | null | null | null | null | WINDOWS-1250 | C++ | false | false | 49,248 | cpp | LC3MCMCv2.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <cstring>
#include <fstream>
#include <string>
#include <sstream> // double -> string-hez kell
#include <iomanip> // set precision
#define day 86400.0 /*1 day in seconds*/
//#define xmin 0.2 /*Minimum ionization radius*/
#define Eni 3.89e10 /*Ni energy generation rate (erg/g/s)*/
#define Eco 6.8e9 /*Co energy generation rate (erg/g/s)*/
#define Ekin 2.18e8
#define Ean 3.63e8
#define c 2.99e10 /*Speed of light (cm/s)*/
#define Msol 1.989e33 /*Solar mass (g)*/
#define kgamma 0.028 /*Opacity of gamma-rays (cm^2/g)*/
#define kpoz 7.0 /*Opacity of pozitrons (cm^2/g)*/
#include "Fejlec.cpp"
using namespace std;
/*
Based on LC2.2 by Nagy Andrea
Upgrade, Marcow Chain Monte Carlo solutions by Jäger Zoltán
MCMC:
parameter file:
parametersMC.inp
comments after the values are enabled, # also
tkezd Measure time shift
tmin Time where the scatter count starts
Tion Ionization/recombination temperature (K)
Mni Initial nickel mass (M_sun), no longer used!
a Exponential density profile exponent
s Power-low density profile exponent
kappa Thomson scattering opacity (cm^2/g)
Ep Initial magnetar rotational energy (erg)
tp Characteristic time scale of magnetar spin-down (d)
Ag Gamma-leak (d^2), no longer used!
tmax Final epoch (day)
NMC Number of MC loops
tfark Time where the tail starts
tkezd: initial shift: JD of shock breakout (in the program, the shock breakout is at 0)
tmin: the fitting starts at this time. Necessery beacuse the first days may cannot be fitted (i.e. because of two component)
tfark: the start time of the tail
Tion, s, kappa: if negativ, then this is fitted, else fixed
a: constant, if a!=0 and s=0 the a used instead of s. No significant difference from s
Ep, tp: currently consant, and cannot be fitted
Mni, Ag fitting: these are independent, and subscribed well by the late light curve (after the plateu).
The of of these are also done by this program (with mcmc).
First time; if there is no NiAgBest.txt file, the niag section starts
fits the tail with Ni and Ag
Then gives the best Ni values for every Ag, or the Ni(Ag) function: NiAgBest.txt
if there is NiAgBest.txt the normal mod starts
M and Ekin gives Ag, and Ag gives Ni (from niag)
Light Curve file:
bol-gorbe.txt
no comment possible currently
format: time[day] bolometric_absolute_mag mag_err
error is necessery (if not exist, then be 1)
the program fits:
R0: progenitor radius
M: ejected mass
Ek: kinetic energy
Eth: thermal energy
(Tion, s, kappa is set to)
Marcow Chain Monte Carlo (mcmc), Metropolis–Hastings method
The fitted parameters are scattered randomly in the accaptable region
The program calculates the scatter/khi from the calculated light curve and the bolometric light curve
The algorithm gives more sample at the spots where the scatter is lower, and fewer at where it is higher
Then writes out the parameters and the scatter
The program calculates 2 scatter: one between tmin and tmax (all)
And one between tmin and tfark, and this one used at the mcmc algorithm!!!!!
Because this region described by the fitted parameters, while the tail is fitted independently
Methods:
Lsn=L+Lion+Lpoz
L is full numeritic at first: 4th grade Runge-Kutta method
Lion is semi analitic: dr=dxi*R component is numerical (calculated at L)
Lpoz is full analitic
When xi=xmin, it becomes constant, dr=dxi=0 -> Lion=0, and L becomes full analitic
(however if xmin>0.2, L has a transient phase after xi=xmin, and that needs to be calculated numerically)
In full numeric phase dt=40000s
In the numeric phase dt=20000s * fxi(xi)
fxi(xi)=1 if xi>0.4, at lower xi, better accuracy necessery, hence fxi(xi)<1
xmin should be 0.1, but 0.2 used because it don't have significant effect to the light curve, but gives numerical errors
If the scatter between tmin and tmin+50 is bigger then 0.5 mag, then xmin=0.3, this speeds up the program
mcmc:
x1 = x0 + rand, which is gauss(sigma , mu=0)
R0=tR0*pow(10.,RandomDoublegauss( Beta*sqrt(2.5*tszoras) , 0) ); // log10()
log(R0)=log(tR0)+RandomDoublegauss( Beta*sqrt(2.5*tszoras) , 0); // log10 smooth
sigma = Beta*sqrt(2.5*tszoras), function of the scatter
standard output: prints how many done
+ if the scatter is lower then a threshold (used for monitoring, if there are changing +, you doing it well)
output:
R0 [cm] M [M_sol] Ek [erg] Eth [erg] v [km/s] T0 [K] Mni [M_sol] kappa [g/cm^2] s Tion [K] scatter:all [mag] scatter:till tail [mag]
v: velocity
The output then can be plotted, to see where are the solutions
not independent:
Ek and M (and kappa)
Eth and R0
*/
double xmin=0.2; /*Minimum ionization radius*/
//double txmin=0.2; /*saved Minimum ionization radius*/
double dt=1.0; /*Time step (s)*/
double segedvalt1=0; /*Assistant vairables*/
double segedvalt2=0;
double segedvalt3=0;
double E,Mni,Ek,F,L,T0,T,Tc,Lion,Ith,IM,INi,Eth,Lsn;
double t,td,th,sigma,sigma1,p1,p2,p3,p4,p5,g,t0;
double xh,xi,dxi,Xni,Xco,dXni,dXco,logL,Z,A,Ag;
double M,v,R0,R,rho,ri,dr,Q,tni,tco,Em,Em1;
double Lpoz,Ag1;
/*
double E,Mni,Ek,F,L,T0,T,Tc,Tion,Lion,Ith,IM,INi,Eth,Lsn;
double t,td,th,tmax,sigma,sigma1,p1,p2,p3,p4,p5,g,t0;
double xh,xi,dxi,Xni,Xco,dXni,dXco,logL,a,Z,A,Ag,Ep,s;
double kappa,M,v,R0,R,rho,ri,dr,Q,tni,tco,tp,Em,Em1;
double Lpoz,Ag1;
*/
//double tmin, tkezd, tfark;
double ER0;
// MC komponent
//double NMC; // Number of MC loops
double logLh=0; // prev logL
double tprev=0; // prev t
double Tn; // measurement number
double Tnf; // measurement number till tail
double Tnx; // measurement number till tmin + 50
double Adat[500][3]; // meauserement data
double szoras; // scatter
double szorash; // scatter prev
double szorast; // scatter temp
double tszoras; // scatter save
double szoraskuszob=0.2; // scatter threshold
double szorasf; // scatter tail
// scatter = sqrt( chisquare/norma ), norma = Tn = 1/error^2
double khinegyzet; // chisquare
double khinegyzetf; // chisquare tail
double khinegyzeth; // chisquare prev
// step paramters
double dR0; /*Initial radius (cm)*/
double dM; /*Ejecta mass (M_sun)*/
double dEk; /*Initial kinetic energy (1e51 erg)*/
double dE; /*Intital thermal energy (1e51 erg)*/
double dkappa; /*Thomson scattering opacity (cm^2/g)*/
double ds; /*Power-low density profile exponent*/
double dTion; /*Ionization/recombination temperature (K)*/
double dMni; /*Initial nickel mass (M_sun) */
double dAg; /*Gamma-leak (d^2)*/
double dEp=0;
double dtp=0;
double tR0=0; // temp parameter (accepted mcmc chain holder)
double tM=0;
double tEk=0;
double tE=0;
double tkappa=0;
double ts=0;
double tTion=0;
double tMni=0;
double tAg=0;
double tER0=0;
double tEp=0;
double ttp=0;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// only for store
double tszorasf;
double tkhinegyzetf;
double tkhinegyzet;
double tv;
double tT0;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
double R0min=0; // Acceptable minimum
double Mmin=0;
double Ekmin=0;
double Emin=0;
double kappamin=0;
double smin=0;
double Tionmin=0;
double Mnimin=0;
double Agmin=0;
double ER0min=0;
double Epmin=0;
double tpmin=0;
double R0max=0; // Acceptable maximum
double Mmax=0;
double Ekmax=0;
double Emax=0;
double kappamax=0;
double smax=0;
double Tionmax=0;
double Mnimax=0;
double Agmax=0;
double ER0max=0;
double Epmax=0;
double tpmax=0;
*/
//double para=0; // parameter a for manual MNi(Ag)
//double parb=0; // parameter b
// Velocity priori (Gaussian) !!!!!!!!!!!!!!!!!!! (if 0, then unset) Hardcoded
//double vref=0; // mean, in [cm/s] e.g: 5e8
//double vrefstd=0; // error, in [cm/s] e.g: 1e8
//double Beta=0.1; // Metropolis–Hastings step parameter, default 0.1, set in parameter file
//double Delta=30000;
int niag=0; // niag mode?
//int nifit=1; // fit ni; niag mode?
// tar[] always bigger than nn! May cause problem if not!!!!! (default 1000 and 1050) !!!!!!!!!!!!!!!!!
// Do not change! This gives the resolution of the numerical Ni(Ag) function, and used there as a holder
int nn=1000;
double tar[1050][3];
// Random generator 64 bit
unsigned
rand256()
{
static unsigned const limit = RAND_MAX - RAND_MAX % 256;
unsigned result = rand();
while ( result >= limit ) {
result = rand();
}
return result % 256;
}
unsigned long long
rand64bits()
{
unsigned long long results = 0ULL;
for ( int count = 8; count > 0; -- count ) {
results = 256U * results + rand256();
}
return results;
}
double RandomDouble(double min, double max){
if(min == max) return min;
//What if the user reversed min and max?
if(min > max) {double tmp = min; min = max; max = tmp;}
double v;
// 5.4210108624275221700372640043497e-20 = pow(2,-64)
v=( 1.0*rand64bits()* 5.42101086242752217e-20 )*(max-min)+min;
return v;
}
double RandomDoublelog(double min, double max){
if(min == max) return min;
//What if the user reversed min and max?
if(min > max) {double tmp = min; min = max; max = tmp;}
double v;
v=( exp( RandomDouble(0.,log(20)) )-1 )/19 *(max-min)+min;
return v;
}
double RandomDoubleGauss(double szigma, double mu){
double v;
v= sqrt( -2.0*log( RandomDouble(0.0, 1.) ) ) * cos(2.*M_PI * RandomDouble(0., 1.) );
if(v>2) v=RandomDouble(2., 10.);
if(v<-2) v=-RandomDouble(2., 10.);
if(v*0!=0) return -1000;
return v*szigma+mu;
}
/*
// stringbol kimasolja az a es b kozott szoveget
// copy the string between a and b
string copy(string str, int a, int b){
if(a>b) return "";
string y;
int i;
for(i=a;i<=b;i++)
y=y+str[i];
return y;
}
// c++ data reading
std::ifstream f("parametersMC.inp");
double read(){
double y=-1000;
string str;
int i;
int j;
//c++ fajl beolvasas, a sort olvassa be
do{ std::getline(f, str); } while(str[0]=='#');
j=0;
while(str[j]==' ') j++;
i=j;
while(str[i]!=' ' && i<=str.length()) i++;
y = atof( copy(str,j,i-1) .c_str());
return y;
}
double read2(string str, int n){
double y=-1000;
//string str;
int i;
int j;
int k;
//c++ fajl beolvasas, a sort olvassa be
//do{ std::getline(f, str); } while(str[0]=='#');
j=0;
for(k=0;k<n;k++){
if(k!=0) j=i+2;
while(str[j]==' ') j++;
i=j;
while(str[i]!=' ' && i<=str.length()) i++;
}
y = atof( copy(str,j,i-1) .c_str());
return y;
}
void defaultdata() //Writeing default input file
{
FILE *f;
f=fopen("parametersMC.inp","wt");
fprintf(f,"%d\t[Data time shift (day)]\n",0); //Measure time shift
fprintf(f,"%d\t[Time where the fitting starts (day)]\n",0); //Time where the scatter count starts
fprintf(f,"%d\t[Ionization/recombination temperature (K)(-: fit)]\n",5500); //Ionization/recombination temperature (K)
//fprintf(f,"%lf\t[Initial nickel mass]\n",Mni); //Initial nickel mass (M_sun)
fprintf(f,"%d\t[Exponential density profile exponent]\n",0); //Exponential density profile exponent
fprintf(f,"%d\t[Power-low density profile exponent (-: fit)]\n",0); //Power-low density profile exponent
fprintf(f,"%1.1f\t[Thomson scattering opacity (cm^2/g)(-: fit)]\n",0.3); //Thomson scattering opacity (cm^2/g)
fprintf(f,"%d\t[Initial magnetar rotational energy (erg)]\n",0); //Initial magnetar rotational energy (erg)
fprintf(f,"%d\t[Characteristic time scale of magnetar spin-down (day)]\n",0); //Characteristic time scale of magnetar spin-down (d)
//fprintf(f,"%lf\t[Gamma-leak]\n",Ag); //Gamma-leak (d^2)
fprintf(f,"%d\t[Final epoch (day)]\n",300); //Final epoch (day)
fprintf(f,"%d\t[Number of MC loops]\n",300000); //Number of MC loops
fprintf(f,"%d\t[Time where the plateu ends (day)]\n\n",100); //Time where the plateu ends
fprintf(f,"%1.0e\t[MIN Initial radius (cm)]\n",2e12); //R0min
fprintf(f,"%1.0e\t[MAX Initial radius (cm)]\n",80e12); //R0max
fprintf(f,"%d\t[MIN Ejected mass (Msol)]\n",3); //Mmin
fprintf(f,"%d\t[MAX Ejected mass (Msol)]\n",60); //Mmax
fprintf(f,"%1.1f\t[MIN Kinetic energy (foe)]\n",0.1); //Ekmin
fprintf(f,"%d\t[MAX Kinetic energy (foe)]\n",30); //Ekmax
fprintf(f,"%1.1f\t[MIN Thermal energy (foe)]\n",0.1); //Emin
fprintf(f,"%d\t[MAX Thermal energy (foe)]\n",30); //Emax
fprintf(f,"%1.2f\t[MIN Thomson scattering opacity (cm^2/g)]\n",0.05); //kappamin
fprintf(f,"%1.1f\t[MAX Thomson scattering opacity (cm^2/g)]\n",0.4); //kappamax
fprintf(f,"%d\t[MIN Power-low density profile exponent]\n",0); //smin
fprintf(f,"%d\t[MAX Power-low density profile exponent]\n",3); //smax
fprintf(f,"%d\t[MIN Ionization/recombination temperature (K)]\n",0); //Tionmin
fprintf(f,"%d\t[MAX Ionization/recombination temperature (K)]\n",20000); //Tionmax
fprintf(f,"%1.0e\t[MIN Initial nickel mass (Msol)]\n",0.0005); //Mnimin
fprintf(f,"%1.0e\t[MAX Initial nickel mass (Msol)]\n",0.5); //Mnimax
fprintf(f,"%1.0e\t[MIN Gamma-leak (day^2)]\n",1e3); //Agmin
fprintf(f,"%1.0e\t[MAX Gamma-leak (day^2)]\n",1e7); //Agmax
fprintf(f,"%d\t[Expansion velocity mean priori (km/s)(0: not fit)]\n",0); //vref
fprintf(f,"%d\t[Expansion velocity sigma priori (km/s)(gauss)]\n",0); //vrefstd
fprintf(f,"%d\t[Determinate the nickel mass Ag function? (binary)]\n",1); //nifit
fprintf(f,"%1.1f\t[Metropolis–Hastings step parameter, default 0.1]\n",0.1); //Beta
fprintf(f,"%d\t[Step parameter (exponental) decay (loop number), default 30000]\n",30000); //Delta
fprintf(f,"%1.1f\t[Minimum ionisation zone (between 0.1 and 1)]\n",0.2); //txmin
fprintf(f,"%1.1f\t[Threshold for szoras, technical parameter, default 0.2]\n\n",0.2); //szoraskuszob
fprintf(f,"%d\t[Whole (W) =1 or No Tail (T) =0 used?]\n",0); //whole
fprintf(f,"%d\t[Plotting grid number]\n",80); //grid
fprintf(f,"%d\t[burn in (steps)(=Step decay suggested)]\n",30000); //burnin
fclose(f);
}
void data() //Reading input file
{
//FILE *f;
//f=fopen("parametersMC.inp","rt");
if( !f.is_open() ){printf("No parameter file! Generating a default! Exiting!\n"); defaultdata(); exit(1);}
//fscanf(f,"%lf",&tkezd); //Measure time shift
//fscanf(f,"%lf",&tmin); //Time where the scatter count starts
//fscanf(f,"%lf",&Tion); //Ionization/recombination temperature (K)
//fscanf(f,"%lf",&Mni); //Initial nickel mass (M_sun)
//fscanf(f,"%lf",&a); //Exponential density profile exponent
//fscanf(f,"%lf",&s); //Power-low density profile exponent
//fscanf(f,"%lf",&kappa); //Thomson scattering opacity (cm^2/g)
//fscanf(f,"%lf",&Ep); //Initial magnetar rotational energy (erg)
//fscanf(f,"%lf",&tp); //Characteristic time scale of magnetar spin-down (d)
//fscanf(f,"%lf",&Ag); //Gamma-leak (d^2)
//fscanf(f,"%lf",&tmax); //Final epoch (day)
//fscanf(f,"%lf",&NMC); //Number of MC loops
//fscanf(f,"%lf",&tfark); //Time where the plateu ends
tkezd=read();
tmin=read();
Tion=read();
//Mni=read();
a=read();
s=read();
kappa=read();
Ep=read();
tp=read();
//Ag=read();
tmax=read();
NMC=read();
tfark=read();
read();
R0min=read();
R0max=read();
Mmin=read();
Mmax=read();
Ekmin=read();
Ekmax=read();
Emin=read();
Emax=read();
kappamin=read();
kappamax=read();
smin=read();
smax=read();
Tionmin=read();
Tionmax=read();
Mnimin=read();
Mnimax=read();
Agmin=read();
Agmax=read();
vref=read();
vrefstd=read();
nifit=int(read());
Beta=read();
Delta=read();
txmin=read();
szoraskuszob=read();
//++++++++++++++++++++++++++++++++++++++++++++
if(s==3.0 || s==5.0){printf("Parameter error! The n = 3.0 and n = 5.0 are forbidden!\n"); exit(1);}
// Default acceptable region set if the input is wrong (between physically possible range)
if(R0min<=0 || R0max<=R0min) { R0min=2e12; R0max=80e12; }
if(Mmin<=0 || Mmax<=Mmin) { Mmin=3; Mmax=60; }
if(Ekmin<=0 || Ekmax<=Ekmin) { Ekmin=0.1; Ekmax=30; }
if(Emin<=0 || Emax<=Emin) { Emin=0.1; Emax=30; }
if(kappamin<=0 || kappamax<=kappamin){ kappamin=0.05; kappamax=0.4; }
if(smin<0 || smax<=smin) { smin=0; smax=3; }
if(Tionmin<0 || Tionmax<=Tionmin){ Tionmin=0; Tionmax=20000; }
if(Mnimin<=0 || Mnimax<=Mnimin) { Mnimin=0.0005; Mnimax=0.5; }
if(Agmin<=0 || Agmax<=Agmin) { Agmin=1e3; Agmax=1e7; }
if(Beta<=0){ Beta=0.1; }
if(Delta<=0){ Delta=0.01; }
if(txmin<0.1){ txmin=0.2; }
if(szoraskuszob<=0){ szoraskuszob=0.2; }
if(ER0min<=0 || ER0max<=ER0min) { ER0min=0.1e63; ER0max=300e63; }
if(Epmin<=0 || Epmax<=Epmin) { Epmin=0.01e51; Epmax=30e51; }
if(tpmin<=0 || tpmax<=tpmin) { tpmin=864; tpmax=100*86400; }
//para=Mni;
//parb=Ag;
// initialization
R0=40e12;
M=30;
Ek=5;
E=5;
xmin=txmin;
// Positive: fixed. Negative: MC
if(kappa<0){ dkappa=Beta*0.2; kappa=0.5*(kappamin+kappamax); }
if(s<0){ ds=Beta*1.5; s=0.5*(smin+smax); }
if(Tion<0){ dTion=Beta*10000; Tion=0.5*(Tionmin+Tionmax); }
if(Ep<0) dEp=1; else dEp=0;
if(tp<0) dtp=1; else dtp=0;
//szoraskuszob=0.2;
M=Msol*M;
Mni=Msol*Mni;
E=1e51*E;
Ek=1e51*Ek;
Ep=1e51*Ep;
tp=tp*86400.0;
Ag=Ag*pow(86400.0,2);
T0=pow(E*M_PI/(4*pow(R0,3.0)*7.57e-15),0.25);
Mmin=Msol*Mmin;
Mmax=Msol*Mmax;
Emin=1e51*Emin;
Emax=1e51*Emax;
Ekmin=1e51*Ekmin;
Ekmax=1e51*Ekmax;
Mnimin=Msol*Mnimin;
Mnimax=Msol*Mnimax;
Agmin=Agmin*pow(86400.0,2);
Agmax=Agmax*pow(86400.0,2);
vref=vref*1e5;
vrefstd=vrefstd*1e5;
//Epmin=1e51*Epmin;
//Epmax=1e51*Epmax;
//tpmin=86400*tpmin;
//tpmax=86400*tpmax;
dR0=Beta*R0;
dM=Beta*M;
dEk=Beta*Ek;
dE=Beta*E;
//fclose(f);
f.close();
}
*/
void meres() /*Reading input measurement file*/
{
int i;
int j;
int k;
int l;
FILE *f;
f=fopen("bol-gorbe.txt","rt");
if(f==NULL){printf("No measurement file!\n"); exit(1);}
double temp;
double csere[3];
i=0; Tn=0; Tnf=0; Tnx=0;
if(f!=NULL) while (!feof(f)){
// read in formats
fscanf(f,"%lf %lf %lf %lf %lf\n",&Adat[i][0],&temp,&temp,&Adat[i][1],&Adat[i][2]);
//fscanf(f,"%lf %lf %lf\n",&Adat[i][0],&Adat[i][1],&Adat[i][2]);
//converting to log erg
Adat[i][0]=Adat[i][0]-tkezd;
Adat[i][1]=-0.4*Adat[i][1]+(71.21+17.5)*0.4;
Adat[i][2]=0.4*Adat[i][2];
//printf("%f %f %f\n",Adat[i][0],Adat[i][1],Adat[i][2]);
// calculating the measurement numbers for scatter (all, befor tail, and between tmin and tmin+50 (technical))
if(Adat[i][0]>=tmin && Adat[i][0]<=tfark) Tn=Tn+1/Adat[i][2]/Adat[i][2];
if(Adat[i][0]>=tmin && Adat[i][0]<=tmax) Tnf=Tnf+1/Adat[i][2]/Adat[i][2];
if(Adat[i][0]>=tmin && Adat[i][0]<=tmin+50) Tnx=Tnx+1/Adat[i][2]/Adat[i][2];
//if(Adat[i][0]>=tmin && Adat[i][0]<=tmax) Tn=Tn+1;
//tmax here is in day, later will be in s
i++;}
// arrenge by time
for(j=0;j<i;j++){
for(k=0;k<i-1;k++)
if(Adat[k][0]>Adat[k+1][0])
for(l=0;l<3;l++){ csere[l]=Adat[k][l]; Adat[k][l]=Adat[k+1][l]; Adat[k+1][l]=csere[l]; }
}
if(Adat[0][0]<0){printf("First date is negative!\n"); exit(1);}
if(Adat[0][0]>tmax){printf("First date is out of limit!\n"); exit(1);}
fclose(f);
}
void niagread() /*Reading input Niag fitting file if exist, else fits one*/
{
int i;
int j;
int k;
int l;
double temp;
FILE *f;
f=fopen("NiAgBest.txt","r");
if(f==NULL){ niag=1; return;}
else niag=0;
i=0;
while (!feof(f)){
fscanf(f,"%lf %lf %lf",&tar[i][0],&tar[i][1],&tar[i][2]);
i++;
}
nn=i;
fclose(f);
}
// Physx ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
double psi(double x) /*Temperature profile assuming uniform density*/
{
double z;
if(x==1.0) z=0.0; else if(x>0) z=sin(M_PI*x)/(M_PI*x); else z=1.0;
return z;
}
double eta(double x, double a1) /*Exponential density profile*/
{
double z;
if(x<xmin) z=1; else z=exp(-a1*(x-xmin));
return z;
}
double theta(double x, double a2) /*Power-low density profile*/
{
double z;
if(x<xmin) z=1; else z=pow(x/xmin,-a2);
return z;
}
double temp(double T1,double y0) /*Find ionization radius*/
{
if(Tion==0) return y0;
double y,dy,zone;
double a,b;
a=xmin; b=y0;
dy=4e-6;
while(b-a>=dy)
{
y=(a+b)/2;
T=T1*pow(psi(y),0.25);
if(T==Tion) break;
if(T>Tion){ a=y; }
else{ b=y; }
}
y=(a+b)/2;
if(y<y0) zone=y+0.5*dy; else zone=y0;
return zone;
}
/*
double temp(double T1,double y0)
{
double y,dy,zone;
y=y0;
dy=1e-9;
T=T1*pow(psi(1.0),0.25);
while(y>=xmin && T<Tion)
{
T=T1*pow(psi(y),0.25);
y=y-dy;
}
if(y<y0) zone=y+0.5*dy; else zone=y0;
return zone;
}
*/
double IM_int(double b, double a1, double a2)
{
double sum=0.0,x=0.0,dx=1e-3;
while(x<b)
{
//sum=sum+(eta(x,a1)*pow(x,a2)+eta(x+dx,a1)*pow(x+dx,a2))*dx*0.5; /*Trapesoid rule*/
sum=sum+ (eta(x,a1)*pow(x,a2)+4.*eta(x+0.5*dx,a1)*pow(x+0.5*dx,a2)+eta(x+dx,a1)*pow(x+dx,a2))*dx*1./6.; /*Simpson's rule*/
x=x+dx;
}
return sum;
}
double Ith_int(double b)
{
double sum=0.0,x=0.0,dx=1e-3;
while(x<b)
{
//sum=sum+(psi(x)*x*x+psi(x+dx)*pow(x+dx,2.0))*dx*0.5;
sum=sum+ (psi(x)*x*x+4*psi(x+0.5*dx)*pow(x+0.5*dx,2.0)+psi(x+dx)*pow(x+dx,2.0))*dx*1./6.;
x=x+dx;
}
return sum;
}
double series(double x) /*Taylor-series of sin(pi*x)/(pi*x)*/
{
double z;
z=1-pow(M_PI*x,2)/6.0+pow(M_PI*x,4)/120.0-pow(M_PI*x,6)/5040.0+pow(M_PI*x,8)/362880.0;
//z=sin(M_PI*x)/(M_PI*x);
return z;
}
// F Runge-Kutta
double Frk(double t, double F, double i){
if(F<0) F=0;
double dF;
double sigma;
double xil=xi;
double g;
double dxi;
double Em;
double R;
double Tc;
if(tp==0) Em=0;
else Em=Ep/(tp*pow((1.0+t/tp),2.0));
R=R0+v*t;
sigma=R/R0;
Tc=T0*pow(F,0.25)/sigma;
if(xil>=xmin && Tc>Tion){ xil=temp(Tc,xh); }
else{ xil=xmin; }
segedvalt1=xil;
dxi=(series(xh)-series(xil))*xil/i;
segedvalt2=dxi;
//Xni es Xco analitical
Xni= exp( -t/tni );
Xco= (-exp( -t/tni ) + exp( -t/tco )) / (-tni*(1./tco-1./tni));
g=Xni+p5*Xco;
/*Runge-Kutta method*/
dF=sigma/pow(xil,3.0)*(p1*g-p2*F*xil-2.0*F*pow(xil,2.0)*dxi*tni/(sigma*dt)+p3*Em);
return dF;
}
// dinamical dt from xi (empirical)
double fxi(double x){
double y=1;
if(x==xmin) return y;
if(x<0.4) y=0.01+(x-0.1)*(x-0.1)*11.;
return y;
}
// Misc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// square
double h(double x){
return x*x;
}
// linear interpolation
double interpol(double x, double xm, double ym, double xp, double yp){
if(xp==xm) return 0;
double y;
y=ym+ (x-xm) * (yp-ym) / (xp-xm);
return y;
}
// gives back the array number, for Ni Ag, numerical
int inverztar(double x, double a, double b, double nn){
double y;
//tar[i][0]=a + i *(b-a)/double(nn);
y = (x - a) * double(nn)/(b-a);
return int(y);
}
// funcion MNi(Ag), for best fit, empirical
/*
double fMni(double x){
double y=0;
if(x>parb) return para;
if(x<parb/4.) y=pow( 10 , ( log10(para) + 0.75*log10(parb/2.2) - 0.75*log10(x)) );
else y=pow( 10 , ( log10(para) + 0.35*log10(parb) - 0.35*log10(x)) );
return y;
}
*/
// fitted values
double fMni(double x){
double y=0;
int i;
i=inverztar( log10(x) ,log10(tar[0][0]),log10(tar[nn-2][0]),nn);
if(i<0) i=0; if(i>nn-1) i=nn-1;
//y=tar[i][1];
y=interpol(x, tar[i][0], tar[i][1], tar[i+1][0], tar[i+1][1]);
return y;
}
int main()
{
srand(time(NULL));
int j=0;
int i=0;
int lep=0; // for dinamical dt
int itt=0; // measure index
int ciklus; // MC ciklus
int elso=0; // first run?
int tilt=0; // After xi is constant, this paramter is 1, and the program becomes simplier
int accept=0; // Is the mcmc step accepted?
//int skip=0;
double dF1,dF2,dF3,dF4; // for RK
double opac,opac1,f,g1;
double acc=0; // acceptance ratio helper
double accall=0;
tni=8.8*day; /*Ni decay time (s)*/
tco=111.3*day; /*Co decay time (s)*/
Z=1.0; /*Average atomic charge in ejecta*/
A=1.0; /*Average atomic mass in ejecta*/
data(); //parameter file read
if(kappa<0){ dkappa=Beta*0.2; kappa=0.5*(kappamin+kappamax); }
if(s<0){ ds=Beta*1.5; s=0.5*(smin+smax); }
if(Tion<0){ dTion=Beta*10000; Tion=0.5*(Tionmin+Tionmax); }
if(Ep<0) dEp=1; else dEp=0;
if(tp<0) dtp=1; else dtp=0;
T0=pow(E*M_PI/(4*pow(R0,3.0)*7.57e-15),0.25);
xmin=txmin;
szoraskuszob=0.2;
// Chech if there are fitted Ni(Ag) function, if not, then the program fits IF not MCMC sampled
if(nifit!=0) niagread(); else{ niag=0; printf("No Ni(Ag) function seek! Ni MCMC sampled instead!\n"); }
/*
if nifit=0 then Ni mass is sampled in the MCMC method like everything else, and no further procedure happens
if nifit=1 then Ni mass fitted seperatly, determining the best Ni Ag pairs (function)
first run niag=0 and the program make this fitting in an MCMC fit but only in the tail
This make seperate block in the code
After this niag=1 and the normal MCMC fitting takes place
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
string sor; // seged
//FILE *fki; // rand.out and rand2.out
//FILE *fki2;
//FILE *fkiS; // seged
std::ifstream IN; // seged, used only here
std::ofstream fki;
std::ofstream fki2;
//std::ofstream fkiS;
if(niag!=1){
//fkiS=fopen("rand.out","r");
IN.open("rand.out");
//fki.open("rand.out");
/* Is this the first run? check */
if(/*fkiS==NULL*/ !IN.is_open()) elso=1; else{
/* Reading the last line of the previous runs. */
IN.seekg(-2,IN.end); // Az eof es soremeles ele lepunk vissza
int i=IN.tellg(); //Innen lepunk vissza mindig egy pozicioval
char ch = ' ';
while(ch!='\n')
{
IN.seekg(--i,IN.beg); //A file elejetol szamoljuk a poziciot
ch=IN.peek(); //Megnezzuk mi van ott, de nem mozditjuk a pointer
}
IN.seekg(++i,IN.beg); //Mivel pont a sor emelesnel alt meg moge lepunk.
//string sor;
getline(IN,sor);
cout << "Continuing previous work. Is this line correct? (Enter)\n\n";
cout << sor << endl;
getchar();
elso=0;
}
//fki=fopen("rand.out","a");
fki.open("rand.out",std::ofstream::app);
//fki2=fopen("rand2.out","a");
fki2.open("rand2.out",std::ofstream::app);
}
//buffer for output
stringstream outtemp;
stringstream outtemp2;
if(niag==1){
//fki=fopen("rand-niag.out","a");
fki.open("rand-niag.out",std::ofstream::app);
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(niag==1){
//tkezd=0; tmin=150.0; tmax=400.0;
printf("\nSampling the nebular phase to determinate the Ni mass Ag function:\n300000 steps, please do not interrupt.\n");
//printf("Initial shift: "); scanf("%lf",&tkezd);
//printf("Start time: "); scanf("%lf",&tmin);
//printf("Max time: "); scanf("%lf",&tmax);
//printf("\n\n");
//printf("%f %f %f",tkezd,tmin,tmax);
//getchar(); getchar();
tmin=tfark+5;
// shift it with 5 day!!!!!
}
if(niag==1){ tilt=1; NMC=300000; tfark=tmax; }
meres(); // measurement read
//getchar();
tmax=tmax*day; /*Final epoch (s)*/
tfark=tfark*day; /*Tail epoch (s)*/
szorash=1000;
khinegyzeth=1e100;
tszoras=1;
acc=0;
accall=0;
//Mni /*Initial nickel mass (M_sun) */
//Ep /*Initial magnetar rotational energy (erg)*/
//tp /*Characteristic time scale of magnetar spin-down (d)*/
//Ag /*Gamma-leak (d^2)*/
//R0 /*Initial radius (cm)*/
//M /*Ejecta mass (M_sun)*/
//Ek /*Initial kinetic energy (1e51 erg)*/
//E /*Intital thermal energy (1e51 erg)*/
// First random value, between acceptable region (below)
ER0=0.5*ER0max*RandomDoublelog(2.*ER0min/ER0max,2.);
//R0=0.5*R0max*RandomDoublelog(2.*R0min/R0max,2.);
M=0.5*Mmax*RandomDoublelog(2.*Mmin/Mmax,2.);
Ek=0.5*Ekmax*RandomDoublelog(2.*Ekmin/Ekmax,2.);
//E=0.5*Emax*RandomDoublelog(2.*Emin/Emax,2.);
if(nifit==0) Mni=tMni=sqrt(Mnimin*Mnimax);
if(dEp!=0) Ep=0.5*Epmax*RandomDoublelog(2.*Epmin/Epmax,2.);
if(dtp!=0) tp=0.5*tpmax*RandomDoublelog(2.*tpmin/tpmax,2.);
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
if(elso==1) fprintf(fki,"# Marcow Chain Monte Carlo solutions for Supernova light curve model based on Arnett & Fu ApJ 340, 396 (1989)\n");
// multiply (and square!) the output chi with this to get the unnormalised chi square
if(elso==1) fprintf(fki,"# chi**2 norma (no tail) = %f\n",Tn/2.5/2.5);
if(elso==1) fprintf(fki,"# chi**2 norma (whole) = %f\n",Tnf/2.5/2.5);
if(elso==1) fprintf(fki,"# Start JD = %f\n",tkezd);
if(elso==1) fprintf(fki,"# First counted day = %f\n",tmin);
if(elso==1) fprintf(fki,"# Exponential density profile exponent = %f\n",a);
if(elso==1) fprintf(fki,"# Initial magnetar rotational energy (erg) = %e\n",Ep);
if(elso==1) fprintf(fki,"# Characteristic time scale of magnetar spin-down (d) = %e\n",tp);
if(elso==1) fprintf(fki,"# \n");
if(elso==1) fprintf(fki,"# ID R0 [cm] M [M_sol] Ek [erg] Eth [erg] v [km/s] T0 [K] M_Ni [M_sol] Ag [d^2] kappa [g/cm^2] s Tion [K] STD [mag], chi^2; whole and without tail\n");
if(elso==1) fprintf(fki2,"# Marcow Chain Monte Carlo solutions for Supernova light curve model which are not accapted\n");
if(elso==1) fprintf(fki2,"# Start JD = %f\n",tkezd);
if(elso==1) fprintf(fki2,"# ID R0 [cm] M [M_sol] Ek [erg] Eth [erg] v [km/s] T0 [K] M_Ni [M_sol] Ag [d^2] kappa [g/cm^2] s Tion [K] STD [mag], chi^2; whole and without tail\n");
*/
if(niag!=1){
if(elso==1) cout << "Normal MCMC fitting\n\n";
if(elso==1) fki << "# Marcow Chain Monte Carlo solutions for Supernova light curve model based on Arnett & Fu ApJ 340, 396 (1989)\n";
if(elso==1) fki << "# chi**2 norma (no tail) = "<< Tn/2.5/2.5 << endl;
if(elso==1) fki << "# chi**2 norma (whole) = " << Tnf/2.5/2.5 << endl;
if(elso==1) fki << "# Start JD = "<<tkezd <<endl;
if(elso==1) fki << "# First counted day = "<<tmin <<endl;
if(elso==1) fki << "# Time where the plateu ends (day) = "<<tfark/86400 <<endl;
if(elso==1) fki << "# Final epoch (day) = "<<tfark/86400 <<endl;
if(elso==1) fki << "# Exponential density profile exponent = "<<a <<endl;
//if(elso==1) fki << "# Initial magnetar rotational energy (erg) = "<<Ep <<endl;
//if(elso==1) fki << "# Characteristic time scale of magnetar spin-down (d) = "<<tp <<endl;
if(elso==1) fki << "# Expansion velocity mean priori (km/s) = "<< vref/1e5 <<endl;
if(elso==1) fki << "# Expansion velocity sigma priori (km/s) = "<< vrefstd/1e5 <<endl;
if(elso==1) fki << "# Nickel mass Ag function fit (0:MCMC fit): "<< nifit <<endl;
if(elso==1) fki << "# Metropolis-Hastings step parameter = "<< Beta <<endl;
if(elso==1) fki << "# Step parameter (exponental) decay = "<< Delta <<endl;
if(elso==1) fki << "# Minimum ionisation zone = "<< txmin <<endl;
if(elso==1) fki << "# \n";
if(elso==1) fki << "# ID E*R0 [erg*cm] M [M_sol] Ek [erg] Ep [erg] tp [day] v [km/s] T0 [K] M_Ni [M_sol] Ag [d^2] kappa [g/cm^2] s Tion [K] STD [mag], chi^2; whole and without tail\n";
if(elso==1) fki2 << "# Marcow Chain Monte Carlo solutions for Supernova light curve model which are not accapted\n";
if(elso==1) fki2 << "# Start JD = "<<tkezd <<endl;
if(elso==1) fki2 << "# ID E*R0 [erg*cm] M [M_sol] Ek [erg] Ep [erg] tp [day] v [km/s] T0 [K] M_Ni [M_sol] Ag [d^2] kappa [g/cm^2] s Tion [K] STD [mag], chi^2; whole and without tail\n";
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(niag!=1) if(elso==0){
tER0=read2(sor,2);
//tR0=read2(sor,2);
tM=read2(sor,3)*Msol;
tEk=read2(sor,4);
//tE=read2(sor,5);
tEp=read2(sor,5);
ttp=read2(sor,6)*86400;
tv=read2(sor,7)*1e5;
tT0=read2(sor,8);
tMni=read2(sor,9)*Msol;
tAg=read2(sor,10)*(day*day);
tkappa=read2(sor,11);
ts=read2(sor,12);
tTion=read2(sor,13);
tszorasf=read2(sor,14)/2.5;
szorash=tszoras=read2(sor,15)/2.5;
tkhinegyzetf=read2(sor,16);
khinegyzeth=tkhinegyzet=read2(sor,17);
if(tEp<=0 && dEp!=0) dEp=0;
if(ttp<=0 && dtp!=0) dtp=0;
}
for( ( elso || niag!=0 ) ?ciklus=0 :ciklus=read2(sor,1)+1 ;ciklus<=int(NMC);ciklus++){
t=0; tprev=0; itt=0; lep=0;
if(niag!=1) tilt=0;
xmin=txmin;
// Ni Ag search mode
if(niag==1){
// first value, fixed
if(ciklus==0){
Mni=tMni=sqrt(Mnimin*Mnimax);
Ag=tAg=sqrt(Agmin*Agmax);
}
// This generates the random values
if(ciklus>0){
do{ Mni=tMni*pow(10.,RandomDoubleGauss(2*Beta*sqrt(2.5*tszoras),0) ); } while(Mni<Mnimin || Mni>Mnimax);
do{ Ag=tAg*pow(10.,RandomDoubleGauss(2*Beta*sqrt(2.5*tszoras),0) ); } while(Ag<Agmin || Ag>Agmax );
}
}
if(niag!=1) if(ciklus!=0){ /* Acceptable region ! */
// Smaller region, smooth in lin
//do{ R0=tR0+dR0*RandomDoubleGauss(1.,0); } while(R0<2e12 || R0>20e12);
//do{ M=tM+dM*RandomDoubleGauss(1.,0); } while(M<6e33 || M>60e33);
//do{ Ek=tEk+dEk*RandomDoubleGauss(1.,0); } while(Ek<2e50 || Ek>20e50);
//do{ E=tE+dE*RandomDoubleGauss(1.,0); } while(E<2e50 || E>20e50);
// Bigger region, smooth in log
// *sqrt(2.5*tszoras)
//do{ R0=tR0*pow(10.,RandomDoubleGauss(Beta,0) ); } while(R0<R0min || R0>R0max);
//do{ M=tM*pow(10.,RandomDoubleGauss(Beta,0) ); } while(M<Mmin || M>Mmax);
//do{ Ek=tEk*pow(10.,RandomDoubleGauss(Beta,0) ); } while(Ek<Ekmin || Ek>Ekmax);
//do{ E=tE*pow(10.,RandomDoubleGauss(Beta,0) ); } while(E<Emin || E>Emax);
//do{ R0=tR0*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras) ,0) ); } while(R0<R0min || R0>R0max);
//do{ M=tM*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras) ,0) ); } while(M<Mmin || M>Mmax);
//do{ Ek=tEk*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras) ,0) ); } while(Ek<Ekmin || Ek>Ekmax);
//do{ E=tE*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras) ,0) ); } while(E<Emin || E>Emax);
do{ ER0=tER0*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(ER0<ER0min || ER0>ER0max);
//do{ R0=tR0*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(R0<R0min || R0>R0max);
do{ M=tM*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(M<Mmin || M>Mmax);
do{ Ek=tEk*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(Ek<Ekmin || Ek>Ekmax);
//do{ E=tE*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(E<Emin || E>Emax);
if(dEp!=0) do{ Ep=tEp*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(Ep<Epmin || Ep>Epmax);
if(dtp!=0) do{ tp=ttp*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(tp<tpmin || tp>tpmax);
if(dkappa!=0) do{ kappa=tkappa+dkappa*RandomDoubleGauss(1.,0); } while(kappa<kappamin || kappa>kappamax);
if(ds!=0) do{ s=ts+ds*RandomDoubleGauss(1.,0); } while(s<smin || s>=smax );
if(dTion!=0) do{ Tion=tTion+dTion*RandomDoubleGauss(1.,0); } while(Tion<Tionmin || Tion>Tionmax );
//if(nifit==0) do{ Mni=tMni*pow(10.,RandomDoubleGauss(Beta,0) ); } while(Mni<Mnimin || Mni>Mnimax);
//if(nifit==0) do{ Mni=tMni*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras) ,0) ); } while(Mni<Mnimin || Mni>Mnimax);
if(nifit==0) do{ Mni=tMni*pow(10.,RandomDoubleGauss(Beta*sqrt(2.5*tszoras)*(exp((-1.*ciklus/Delta)+1.)+1) ,0) ); } while(Mni<Mnimin || Mni>Mnimax);
}
E=Ek;
R0=ER0/E;
/*skip=0;
if(R0<R0min || R0>R0max) skip=1;
if(M<Mmin || M>Mmax) skip=1;
if(Ek<Ekmin || Ek>Ekmax) skip=1;
if(E<Emin || E>Emax) skip=1;
if(dkappa!=0) if(kappa<kappamin || kappa>kappamax) skip=1;
if(ds!=0) if(s<smin || s>=smax ) skip=1;
if(dTion!=0) if(Tion<Tionmin || Tion>Tionmax ) skip=1;
if(nifit==0) if(Mni<Mnimin || Mni>Mnimax) skip=1;
*/
szoras=0; szorasf=0;
if(niag!=1){
T0=pow(E*M_PI/(4*pow(R0,3.0)*7.57e-15),0.25);
t=0.0; F=1.0;
xh=1.0; xi=1.0;
Xni=1.0; Xco=0.0;
//Q=1.6e13*Z/A*pow(Z,1.333333); /*Ionization energy release*/
Q = 3.22e13;
Ith=Ith_int(1.0);
IM=IM_int(1.0,a,2.0);
// xmin 0.1 here, because here needs the real value !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
xmin=0.1;
if(s==0.0) f=IM_int(1.0,a,2.0);
else f=(3.0*pow(xmin,s)-s*pow(xmin,3.0))/(3.0*(3.0-s));
if(s==0.0) g1=IM_int(1.0,a,4.0);
else g1=(5.0*pow(xmin,s)-s*pow(xmin,5.0))/(5.0*(5.0-s));
xmin=txmin;
v=sqrt(2.0*Ek*f/(g1*M));
rho=M/(4.0*M_PI*pow(R0,3)*f);
td=3.0*kappa*rho*R0*R0/(pow(M_PI,2.0)*c);
th=R0/v;
Eth=4.0*M_PI*pow(R0,3)*7.57e-15*pow(T0,4.0)*Ith;
//t0=pow(2.0*th*td,0.5); // obsolete
// Ag and Ni compution (depends on the other parameters)
Ag=kgamma*M/(4.0*M_PI*f*v*v);
if(nifit!=0) Mni=Msol*fMni(Ag/86400./86400.);
p1=Eni*Mni*tni/Eth;
p2=tni/td;
p3=tni/Eth;
p4=tni/tco;
p5=Eco/Eni;
}
while(t<=tmax)
{
opac= 1.-exp(-Ag/(t*t));
opac1=1.-exp(- kpoz*Ag/kgamma /(t*t));
R=R0+v*t;
sigma=R/R0;
Tc=T0*pow(F,0.25)/sigma;
//if(xi>=xmin && Tc>Tion){ xi=temp(Tc,xh); }
//else xi=xmin;
// 4th grade Runge-Kutta
if(tilt==0){
dF1=Frk(t, F, 1.);
segedvalt3=segedvalt1;
dxi=segedvalt2*1./6.;
dF2=Frk(t+0.5*dt, F+0.5*dF1*dt/tni, 1.5);
dxi=dxi+segedvalt2*2./6.;
dF3=Frk(t+0.5*dt, F+0.5*dF2*dt/tni, 1.5);
dxi=dxi+segedvalt2*2./6.;
dF4=Frk(t+1.0*dt, F+1.0*dF3*dt/tni, 2.);
dxi=dxi+segedvalt2*1./6.;
F=F+(dF1+2.*dF2+2.*dF3+dF4)*dt/(6.*tni);
}
xi=segedvalt3;
Xni= exp( -t/tni );
Xco= (-exp( -t/tni ) + exp( -t/tco )) / (-tni*(1./tco-1./tni));
g=Xni+p5*Xco;
if(tp==0) Em=0;
else Em=Ep/(tp*pow((1.0+t/tp),2.0));
ri=xi*R;
dr=dxi*R; if(dr>0.0) dr=0.0;
Lion=0.;
if(tilt==0){
if (s==0.0)Lion=-4.0*M_PI*rho*eta(xi,a)*pow(sigma,-3.0)*Q*ri*ri*dr/dt;
else Lion=-4.0*M_PI*rho*theta(xi,s)*pow(sigma,-3.0)*Q*ri*ri*dr/dt;
if (Lion<0) Lion=0.0;
L=xi*F*Eth*opac/td;
}
if(tilt==1) L= Mni*opac*( Eni *Xni + Eco *Xco) + opac*Em;
Lpoz=Mni*(Ekin+Ean*opac)*opac1 * exp(-t/tco)-exp(-t/tni);
Lsn=L+Lion+Lpoz;
logL=log10(Lsn);
// scatter (here in log erg!)
while(Adat[itt][0]*day>tprev && Adat[itt][0]*day<=t){
double y=interpol(Adat[itt][0]*day, tprev, logLh, t, logL);
if(t>=tmin*day && t<=tfark) szoras=szoras+ h( (y-Adat[itt][1])/Adat[itt][2] ) ;
if(t>=tmin*day && t<=tmax) szorasf=szorasf+ h( (y-Adat[itt][1])/Adat[itt][2] ) ;
//if(t>=tmin*day && t<=tmax) szoras=szoras+ h( (y-Adat[itt][1]) ) ;
itt++;
}
xh=xi;
logLh=logL;
tprev=t;
t=t+dt;
// dinamical dt (empirical)
if(niag!=1) if(xi==xmin) lep++;
else lep=0;
if(niag!=1) if(lep> (Ek>M*M*M/4e50?1:40) ) tilt=1; //2e49/Msol**3 = 2e49/8e99 above this line the numerical error is very big after plateu, so it is analitical instantly, else it analitical after 10 day
//if(lep> 400 ) tilt=1; if xmin>0.2 higher numerical step required, but more stabil!
else tilt=0;
if(tilt==1) dt=40000.;
else dt=20000. * fxi(xi);
// simplification, if the scatter is high before the end of the plateu, xmin becomes larger to fasten the run time
if(niag!=1) if(t/day>=tmin+50 && t/day<tmin+51 ) if(2.5*sqrt(szoras/Tnx) > szoraskuszob*2.5 && xi>txmin+0.1 ) xmin=txmin+0.1;
}
khinegyzet=szoras;
khinegyzetf=szorasf;
szoras=sqrt(szoras/Tn); //std.dev between tmin and tfark; before tail
szorasf=sqrt(szorasf/Tnf); //whole std.dev
accept=0;
/* Metropolis–Hastings method */
if(niag!=1){
szorast=exp(-0.5* khinegyzet +0.5* khinegyzeth );
if(vrefstd>0 && vref>0) szorast=szorast*exp(-0.5*pow((v-vref)/vrefstd,2) +0.5*pow((tv-vref)/vrefstd,2));
}
else /*szorast=khinegyzeth/khinegyzet;*/ szorast=szorash/szoras;
if(szorast>1) szorast=1;
if(khinegyzet*0!=0 && khinegyzeth*0==0) szorast=-1;
if(khinegyzeth*0!=0) szorast=1e100;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if(niag!=1){
if(szorast > RandomDouble(0.,1.) || ciklus==0){ tR0=R0; tM=M; tEk=Ek; tE=E; tkappa=kappa; ts=s; tTion=Tion; tszoras=szoras; tMni=Mni; tAg=Ag; accept=1;
tszorasf=szorasf; tkhinegyzetf=khinegyzetf; tkhinegyzet=khinegyzet; tv=v; tT0=T0; tER0=ER0; tEp=Ep; ttp=tp; } // Ths is only used for store
/*if(ciklus==0){ tR0=R0; tM=M; tEk=Ek; tE=E; tkappa=kappa; ts=s; tTion=Tion; tszoras=szoras; tMni=Mni; tAg=Ag; accept=1;
tszorasf=szorasf; tkhinegyzetf=khinegyzetf; tkhinegyzet=khinegyzet; tv=v; tT0=T0; }*/ // Ths is only used for store
} else {
if(szorast > RandomDouble(0.,1.) ){ tszoras=szoras; tMni=Mni; tAg=Ag; }
if(ciklus==0){ tszoras=szoras; tMni=Mni; tAg=Ag; }
}
szorash=tszoras;
khinegyzeth=tkhinegyzet;
if(tszoras*0!=0) tszoras=1;
if(accept==1) acc++;
accall++;
//if(accept==1) fkiS=fki; else fkiS=fki2;
if(niag!=1){
//if(szorasf*0==0 && szoras*0==0) fprintf(fkiS,"%d \t %2.3e %4.3f %2.3e %2.3e %2.3e %2.3e %2.3e %2.3e %4.4f %4.3f %d ",ciklus,R0,M/Msol,Ek,E,v,T0, Mni/Msol,Ag/(day*day) ,kappa,s,int(Tion));
//if(szorasf*0==0 && szoras*0==0) fprintf(fkiS,"%f %f %f %f\n",szorasf*2.5,szoras*2.5,khinegyzetf,khinegyzet);
if(szorasf*0==0 && szoras*0==0) ((accept==1)?outtemp:outtemp2) << setprecision(3) << ciklus
<< " \t " << scientific << ER0 << " " << fixed << M/Msol << scientific << " " << Ek << " " << Ep << " " << fixed << tp/86400
<< " " << int(v/1e5) << " " << scientific << T0 << " " << Mni/Msol << " " << Ag/(day*day)
<< " " << fixed << kappa << " " << s << " " << int(Tion)
<< " " << szorasf*2.5 << " " << szoras*2.5 << " " << scientific << khinegyzetf << " " << khinegyzet << endl;
if(accept==0){
//if(szorasf*0==0 && szoras*0==0) fprintf(fki,"%d \t %2.3e %4.3f %2.3e %2.3e %2.3e %2.3e %2.3e %2.3e %4.4f %4.3f %d ",ciklus,tR0,tM/Msol,tEk,tE,tv,tT0, tMni/Msol,tAg/(day*day) ,tkappa,ts,int(tTion));
//if(szorasf*0==0 && szoras*0==0) fprintf(fki,"%f %f %f %f\n",tszorasf*2.5,tszoras*2.5,tkhinegyzetf,tkhinegyzet);
if(szorasf*0==0 && szoras*0==0) outtemp << setprecision(3) << ciklus
<< " \t " << scientific << tER0 << " " << fixed << tM/Msol << scientific << " " << tEk << " " << tEp << " " << fixed << ttp/86400
<< " " << int(tv/1e5) << " " << scientific << tT0 << " " << tMni/Msol << " " << tAg/(day*day)
<< " " << fixed << tkappa << " " << ts << " " << int(tTion)
<< " " << tszorasf*2.5 << " " << tszoras*2.5 << " " << scientific << tkhinegyzetf << " " << tkhinegyzet << endl;
}
} else{
//if(szoras*0==0) fprintf(fki,"%f ",szoras*2.5);
//if(szoras*0==0) fprintf(fki,"%4.5f %2.3e\n",Mni/Msol,Ag/(86400.*86400.));
if(szoras*0==0) fki << setprecision(4) << scientific << szoras*2.5 << " "
<< Mni/Msol << " " << Ag/(86400.*86400.) << endl;
}
if(ciklus%(niag!=1?100:1000)==0){
if(szoras<szoraskuszob && szoras>=0){printf("+ "); }
printf("Ciklus: %d ratio: %2.2f%c\n",ciklus,100.*acc/accall,'%');
//if(acc/accall<0.2) Beta=Beta*0.99; // numerical method to keep the accep ratio around 20%
//if(acc/accall>0.25) Beta=Beta*1.01;
acc=accall=0;
if(niag!=1){
fki << outtemp.str();
fki2 << outtemp2.str();
outtemp.clear();
outtemp.str(std::string());
outtemp2.clear();
outtemp2.str(std::string());
}
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
}
fki << outtemp.rdbuf();
fki2 << outtemp2.rdbuf();
fki.close();
fki2.close();
//fclose(fki);
//fclose(fki2);
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// If Ni(Ag) fitted, this section makes the best function file, which the program reads
if(niag==1){
//int nn=1000;
double be;
double be1;
double bek;
double a;
double b;
int tari;
double tar[nn][3];
FILE *fkik;
FILE *fki;
fki=fopen("rand-niag.out","r");
rewind(fki);
fkik=fopen("NiAgBest.txt","w");
a=log10(Agmin/86400./86400.); b=log10(Agmax/86400./86400.);
for(i=0;i<nn;i++){
tar[i][0]=a+ i/double(nn) *(b-a);
tar[i][1]=0;
tar[i][2]=1000;
}
for(i=0;i<nn;i++) tar[i][0]=pow(10,tar[i][0]);
while (!feof(fki)){
fscanf(fki,"%lf %lf %lf",&bek,&be,&be1);
tari=inverztar( log10(be1) ,a,b,nn);
if(bek<tar[tari][2]){ tar[tari][2]=bek; tar[tari][1]=be; }
}
printf("Writing best fits\n");
for(i=0;i<nn;i++){
//printf("%e %f %f\n",tar[i][0],tar[i][1],tar[i][2]);
fprintf(fkik,"%e %e %f\n",tar[i][0],tar[i][1],tar[i][2]);
}
fclose(fki);
fclose(fkik);
}
printf("done!\n");
//getchar();
return 0;
}
|
480ebcbeee5aab96b1175ff5c08ffc2bdeee7742 | a0b0eb383ecfeaeed3d2b0271657a0c32472bf8e | /lydsy/2863.cpp | 432a30c7207a76a122c454de13e64f124c706e4d | [
"Apache-2.0"
] | permissive | tangjz/acm-icpc | 45764d717611d545976309f10bebf79c81182b57 | f1f3f15f7ed12c0ece39ad0dd044bfe35df9136d | refs/heads/master | 2023-04-07T10:23:07.075717 | 2022-12-24T15:30:19 | 2022-12-26T06:22:53 | 13,367,317 | 53 | 20 | Apache-2.0 | 2022-12-26T06:22:54 | 2013-10-06T18:57:09 | C++ | UTF-8 | C++ | false | false | 746 | cpp | 2863.cpp | #include <cstdio>
const int maxn = 3001, mod = 1000000007;
int n, pow2[maxn * maxn], c[maxn][maxn], f[maxn];
int main()
{
scanf("%d", &n);
c[0][0] = 1;
for(int i = 1; i <= n; ++i)
{
c[i][0] = c[i][i] = 1;
for(int j = 1; j < i; ++j)
{
c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
if(c[i][j] >= mod)
c[i][j] -= mod;
}
}
pow2[0] = 1;
for(int i = 1; i <= n * n; ++i)
{
pow2[i] = pow2[i - 1] << 1;
if(pow2[i] >= mod)
pow2[i] -= mod;
}
f[0] = 1;
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= i; ++j)
{
int tmp = (long long)c[i][j] * pow2[j * (i - j)] % mod * f[i - j] % mod;
if(!(j & 1) && tmp)
tmp = mod - tmp;
f[i] += tmp;
if(f[i] >= mod)
f[i] -= mod;
}
printf("%d\n", f[n]);
return 0;
}
|
39b7123cb0f81a42fa83737df0f748bda3252093 | bfb9caeb27d216883724710f64a9d5f85248e1a2 | /NFAchv/AchvClerk.cpp | 62698c2f100b4aaa042aa25bccd3a2bbc5b1e2e8 | [] | no_license | bback99/NFGame | 2c0340aa4315ed80aedb85379c32a30d79a1cfcf | e94fb6412271f4f95c200ea4ecab774f506b3877 | refs/heads/master | 2020-07-02T09:52:24.393478 | 2016-11-21T01:02:36 | 2016-11-21T01:02:36 | 74,312,821 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,793 | cpp | AchvClerk.cpp | #include "stdafx.h"
#include <achv/AchvBureau.h>
namespace achv
{
extern bool ConvertNFDateString2time_t( const std::string & NFDateString, time_t & timeVal );
}
using namespace achv;
/*static*/
Clerk* Clerk::Create(Bureau* pBureau, Databank* pDB, LONG GSN, LONG CSN)
{
std::auto_ptr<Clerk> ptr(new Clerk(pBureau, pDB, GSN, CSN));
return (ptr->init()) ? ptr.release() : NULL;
}
/*static*/
void Clerk::Destroy(Clerk *pClerk)
{
if (pClerk != NULL)
delete pClerk;
}
LONG Clerk::AddRef()
{
return ::InterlockedIncrement(&refcnt_);
}
LONG Clerk::Release()
{
LONG result = ::InterlockedDecrement(&refcnt_);
if (result == 0)
pBureau_->dismissClerk(CSN_);
return result;
}
LONG Clerk::getGSN() const
{
return GSN_;
}
LONG Clerk::getCSN() const
{
return CSN_;
}
bool Clerk::report(enum Event evt, double val, const RoomID & rId )
{
return report(EventItem_T(evt, val, rId ));
}
bool Clerk::report(const EventItem_T& eventItem)
{
{
GCSLOCK lock(&gcs_);
eventList_.push_back(eventItem);
}
return (TRUE == ::XtpQueueWorkItem(pBureau_->getThreadPool(), Clerk::__process_event, (LPVOID)this));
}
bool Clerk::setReward(int achv_ID, const std::string & get_reward_date_str, const int reward_item_ids[RewardItemIdCnt])
{
if (achv_ID == InvalidAchvId )
return false;
GCSLOCK lock(&gcs_);
TracerMap_T::iterator it = tracerMap_.find(achv_ID);
if (it == tracerMap_.end())
return false;
Progress_T* prog_ptr = it->second->GetProgress();
time_t get_reward_date;
ConvertNFDateString2time_t( get_reward_date_str, get_reward_date );
if (prog_ptr->IsCompleted() == false || prog_ptr->get_reward_date != InvalidTime_t)
return false;
prog_ptr->get_reward_date = get_reward_date;
prog_ptr->last_update_date = get_reward_date;
std::copy(reward_item_ids, reward_item_ids + RewardItemIdCnt, prog_ptr->reward_item_ids);
return true;
}
const Progress_T* Clerk::getProgress(int achv_ID) const
{
GCSLOCK lock(&gcs_);
TracerMap_T::const_iterator cit = tracerMap_.find(achv_ID);
if (cit != tracerMap_.end())
return cit->second->GetProgress();
else
return NULL;
}
bool Clerk::getProgressMap(ProgressMap_T &outref) const
{
if (!outref.empty())
return false;
GCSLOCK lock(&gcs_);
for (TracerMap_T::const_iterator cit = tracerMap_.begin(); cit != tracerMap_.end(); ++cit)
outref.insert(std::make_pair(cit->first, cit->second->GetProgress()));
return true;
}
Clerk::Clerk(Bureau* pBureau, Databank* pDB, LONG GSN, LONG CSN)
: refcnt_(0), pBureau_(pBureau), pDB_(pDB), GSN_(GSN), CSN_(CSN)
{
if (pBureau == NULL || pDB == NULL || GSN == 0 || CSN == 0)
throw std::bad_alloc("Invalid parameter");
}
Clerk::~Clerk()
{
for (TracerMap_T::iterator it = tracerMap_.begin(); it != tracerMap_.end(); ++it)
delete it->second;
}
Tracer * Clerk::GetFirstIncompleteTracer( Tracer * pStart )
{
Tracer * pRet = pStart ;
while( pRet && pRet->IsCompleted() )
{
pRet = pRet->GetNextTracer();
}
return pRet;
}
bool Clerk::init()
{
// populate tracer map
const AchvMetaMap& metaMap = pDB_->getMetaMap();
for (AchvMetaMap::const_iterator cit = metaMap.begin(); cit != metaMap.end(); ++cit)
{
Tracer *pTracer = Tracer::Create(GSN_, CSN_, cit->first, cit->second);
tracerMap_.insert(std::make_pair(cit->first, pTracer));
}
const AchvSeqMap & seqMap = pDB_->getSeqMap();
for( AchvSeqMap::const_iterator cit = seqMap.begin(); cit!= seqMap.end(); ++cit )
{
const std::vector< AchvSeqMetaData > & vecSeq = cit->second;
if( vecSeq.empty() )
continue;
TracerMap_T::iterator tracerIt, NextTracerIt;
for( size_t i = 0; i < vecSeq.size() - 1; ++i )
{
tracerIt = tracerMap_.find( vecSeq[i].GetAchvId() );
NextTracerIt = tracerMap_.find( vecSeq[ i + 1 ].GetAchvId() );
if( tracerIt != tracerMap_.end() && NextTracerIt != tracerMap_.end( ) )
tracerIt->second->SetNextTracer( NextTracerIt->second );
}
}
TVecProgress vecProgress;
if( EC_OK == pDB_->getProgressList( vecProgress, getGSN(), getCSN() ) )
{
TracerMap_T::iterator tracerIt;
for(TVecProgress::const_iterator cit = vecProgress.begin(); cit != vecProgress.end(); ++cit )
{
tracerIt = tracerMap_.find( cit->achv_ID );
if( tracerIt != tracerMap_.end() )
{
tracerIt->second->SetProgress( *cit );
}
}
}
else
return false;
// load per-user progress data
const EventAchvIDMap & evtAchvMap = pBureau_->GetEvtAchvIDMap();
/*Making Event Map*/
for( EventAchvIDMap::const_iterator cit = evtAchvMap.begin(); cit != evtAchvMap.end(); ++cit )
{
TracerMap_T::iterator itTracer = tracerMap_.find( cit->second );
if( itTracer != tracerMap_.end() )
{
Tracer * pHeader = GetFirstIncompleteTracer( itTracer->second );
eventMap_.insert( make_pair( cit->first, pHeader ) );
}
}
return true;
}
///////////////////////////////////////
// LPTHREAD_START_ROUTINE for report()
//
/*static*/
DWORD WINAPI Clerk::__process_event(LPVOID param)
{
reinterpret_cast<Clerk*>(param)->processEvent();
return 0;
}
//void Clerk::processEvent()
//{
// GCSLOCK lock(&gcs_);
//
// if (eventList_.empty())
// return;
//
// EventItem_T eventItem = *(eventList_.begin());
// eventList_.pop_front();
//
// EventMap_T::iterator it = eventMap_.find(eventItem.evt);
// if (it == eventMap_.end()) // tracer not found
// return;
//
// Tracer* pTracer = it->second;
// Progress_T progress;
// time_t lastUpdateDate = 0L;
//
// while (pTracer)
// {
// Tracer::ProcessResult_T result = pTracer->Process(eventItem, progress);
//
// if (result == Tracer::PR_UNCHANGED)
// return; // OK
//
// bool isCompleted = (result == Tracer::PR_COMPLETED);
//
// if (pDB_->ReqProgressUpdate(progress, isCompleted, &lastUpdateDate) != EC_OK) // DB update failed!
// return; // TO-DO: error handling?
//
// progress.last_update_date = lastUpdateDate;
// if (isCompleted)
// progress.complete_date = lastUpdateDate;
//
// if (pTracer->SetProgress(progress) == false) // set progress failed? Impossible.
// return; // TO-DO: error handling?
//
// if (isCompleted || (result == Tracer::PR_CHANGED_NOTI))
// {
// pBureau_->runReportCallback(CSN_, pTracer->GetID(), &eventItem);
// pTracer = it->second = pTracer->GetNextTracer();
// }
// else
// pTracer = NULL;
// }
//}
void Clerk::processEvent()
{
GCSLOCK lock(&gcs_);
if (eventList_.empty())
return;
EventItem_T eventItem = *(eventList_.begin());
eventList_.pop_front();
EventMap_T::iterator it = eventMap_.find(eventItem.evt);
if (it == eventMap_.end()) // tracer not found
return;
Tracer* pTracer = it->second;
Progress_T progress;
time_t lastUpdateDate = 0L;
while (pTracer)
{
achv::ProcessResult_T result = pTracer->Process(eventItem, progress);
if (result == achv::PR_UNCHANGED)
return; // OK
bool isCompleted = (result == achv::PR_COMPLETED);
if (pDB_->ReqProgressUpdate(progress, isCompleted, &lastUpdateDate) != EC_OK) // DB update failed!
return; // TO-DO: error handling?
progress.last_update_date = lastUpdateDate;
if (isCompleted)
progress.complete_date = lastUpdateDate;
if (pTracer->SetProgress(progress) == false) // set progress failed? Impossible.
return; // TO-DO: error handling?
if (isCompleted || (result == achv::PR_CHANGED_NOTI))
{
eventItem.result = result;
pBureau_->runReportCallback(GSN_, CSN_, pTracer->GetID(), &eventItem);
if (isCompleted)
pTracer = it->second = pTracer->GetNextTracer();
else
pTracer = NULL;
}
else
pTracer = NULL;
}
}
|
42da0d30c49b2841c50559b966ebe9eac63f2694 | 2576195ce1e0fffde521bb80b3e0de689dd86fa0 | /tutorails/skeleton/skeleton.cpp | d89b5b711f2f9dde713a0daddaecd5c36ae3d323 | [] | no_license | woaitubage/QT | 48e62937c4cba349aaf84d1bafaef61b26862a07 | 90d711dda23dff79c16fd76767cb7039200d5257 | refs/heads/master | 2021-01-01T03:32:21.507798 | 2016-05-04T07:42:51 | 2016-05-04T07:42:51 | 56,436,428 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,029 | cpp | skeleton.cpp | #include "skeleton.h"
#include "ui_skeleton.h"
#include <QMenu>
#include <QMenuBar>
#include <QStatusBar>
#include <QTextEdit>
#include <QToolBar>
Skeleton::Skeleton(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Skeleton)
{
ui->setupUi(this);
QPixmap newpix("new.png");
QPixmap openpix("open.png");
QPixmap quitpix("quit.png");
QAction *quit=new QAction("&Quit",this);
QMenu *file;
file=menuBar()->addMenu("&File");
file->addAction(quit);
connect(quit,&QAction::triggered,qApp,QApplication::quit);
QToolBar *toolbar=addToolBar("main ToolBar");
toolbar->addAction(QIcon(newpix),"new File");
toolbar->addAction(QIcon(openpix),"open File");
toolbar->addSeparator();
QAction *quit2=toolbar->addAction(QIcon(quitpix),"Quit Application");
connect(quit2,&QAction::triggered,qApp,&QApplication::quit);
QTextEdit *edit=new QTextEdit(this);
setCentralWidget(edit);
statusBar()->showMessage("Readly");
}
Skeleton::~Skeleton()
{
delete ui;
}
|
36a5f665ccf222a90285528f997e205d70ea9ae3 | 24b543f07c4149b033863c83b83a20d9795a528c | /src/LibLinear/liblinear.clr.h | cf1f0ee155387a7ef708cb27205f9fc38a66ea64 | [
"MIT"
] | permissive | aardvark-community/aardvark.semantictextonforests | a408799a67692f4bfcba4c1bdf4788035d50eff4 | 5f5060d7fc25683808c632bda0620b8e69f4d1c1 | refs/heads/master | 2021-09-18T19:26:57.168331 | 2018-07-18T13:47:58 | 2018-07-18T13:47:58 | 35,613,333 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,966 | h | liblinear.clr.h | #pragma once
#include <stdio.h>
#include <stdlib.h>
#include <msclr/marshal.h>
#include "linear.h"
using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;
using namespace System::Globalization;
using namespace System::IO;
using namespace System::Runtime::InteropServices;
using namespace msclr::interop;
#define COPY_MANAGED_ARRAY_TO_NATIVE(type,n,NAME_NAT,NAME_MAN) { auto count = (n); native.NAME_NAT = new type[n]; pin_ptr<type> p = &model.NAME_MAN[0]; memcpy(native.NAME_NAT, p, (n) * sizeof(type)); }
namespace liblinear_train {
extern struct model* main(int argc, char **argv);
}
namespace LibLinear {
public enum class SolverType
{
L2R_LR = ::L2R_LR,
L2R_L2LOSS_SVC_DUAL = ::L2R_L2LOSS_SVC_DUAL,
L2R_L2LOSS_SVC = ::L2R_L2LOSS_SVC,
L2R_L1LOSS_SVC_DUAL = ::L2R_L1LOSS_SVC_DUAL,
MCSVM_CS = ::MCSVM_CS,
L1R_L2LOSS_SVC = ::L1R_L2LOSS_SVC,
L1R_LR = ::L1R_LR,
L2R_LR_DUAL = ::L2R_LR_DUAL,
L2R_L2LOSS_SVR = ::L2R_L2LOSS_SVR,
L2R_L2LOSS_SVR_DUAL = ::L2R_L2LOSS_SVR_DUAL,
L2R_L1LOSS_SVR_DUAL = ::L2R_L1LOSS_SVR_DUAL
};
public value struct Node
{
int Index;
double Value;
Node(int index, double value) : Index(index), Value(value) { }
internal:
Node(const feature_node& node) : Index(node.index), Value(node.value) { }
};
public value struct Problem
{
array<array<Node>^>^ x;
array<double>^ y;
double Bias;
/// <summary>
/// Number of vectors.
/// </summary>
property int Count {
int get() {
return y->Length;
}
}
Problem(array<array<Node>^>^ xs, array<double>^ ys)
: Problem(xs, ys, -1.0)
{
}
Problem(array<array<Node>^>^ xs, array<double>^ ys, double bias)
: x(xs), y(ys), Bias(bias)
{
if (x->Length != y->Length)
{
throw gcnew ArgumentOutOfRangeException("Their need to be as many target values as training vectors.");
}
}
internal:
Problem(const problem& problem)
{
auto l = problem.l;
auto n = problem.n;
x = gcnew array<array<Node>^>(l);
for (auto i = 0; i < l; i++)
{
auto row = problem.x[i];
auto r = gcnew array<Node>(n);
pin_ptr<Node> pr = &r[0];
memcpy(pr, row, n * sizeof(feature_node));
x[i] = r;
}
y = gcnew array<double>(l);
pin_ptr<double> py = &y[0];
memcpy(py, problem.y, l * sizeof(double));
Bias = problem.bias;
}
};
public ref class Parameter
{
public:
SolverType SolverType;
double Eps;
double C;
int NrThread;
int NrWeight;
array<int>^ WeightLabel;
array<double>^ Weight;
double p;
array<double>^ InitSol;
Parameter()
{
SolverType = SolverType::L2R_L2LOSS_SVC;
Eps = 0.1;
C = 1;
NrThread = 1;
NrWeight = 0;
p = 0.1;
}
Parameter(LibLinear::SolverType solverType)
{
SolverType = solverType;
Eps = 0.1;
C = 1;
NrThread = 1;
NrWeight = 0;
p = 0.1;
}
internal:
Parameter(const parameter& native)
{
SolverType = (LibLinear::SolverType)native.solver_type;
Eps = native.eps;
C = native.C;
NrThread = native.nr_thread;
NrWeight = native.nr_weight;
WeightLabel = gcnew array<int>(native.nr_weight);
for (auto i = 0; i < native.nr_weight; i++) WeightLabel[i] = native.weight_label[i];
Weight = gcnew array<double>(native.nr_weight);
for (auto i = 0; i < native.nr_weight; i++) Weight[i] = native.weight[i];
p = native.p;
InitSol = gcnew array<double>(native.nr_weight);
for (auto i = 0; i < native.nr_weight; i++) InitSol[i] = native.init_sol[i];
}
};
public value struct Model
{
/// <summary>parameter</summary>
Parameter^ Param;
/// <summary>number of classes</summary>
int NrClass;
/// <summary>number of features</summary>
int NrFeature;
/// <summary>w</summary>
array<double>^ W;
/// <summary>label of each class (label[k])</summary>
array<int>^ Label;
/// <summary>bias</summary>
double Bias;
/* for classification only */
/*/// <summary>
/// 1 if svm_model is created by svm_load_model
/// 0 if svm_model is created by svm_train
/// </summary>
int FreeSv;*/
/// <summary>
/// Gets solver type of this model.
/// </summary>
property SolverType Type {
SolverType get() {
return Param->SolverType;
}
}
internal:
Model(const model* native)
{
Param = gcnew Parameter(native->param);
NrClass = native->nr_class;
NrFeature = native->nr_feature;
W = gcnew array<double>(native->nr_feature);
Marshal::Copy((IntPtr)native->w, W, 0, native->nr_feature);
Label = gcnew array<int>(native->nr_class);
Marshal::Copy((IntPtr)native->label, Label, 0, native->nr_class);
Bias = native->bias;
}
};
public ref class Linear abstract sealed
{
public:
static Model Train(String^ inputFileName)
{
auto nativeInputFileName = (char*)Marshal::StringToHGlobalAnsi(inputFileName).ToPointer();
char* argv[] = {
"", nativeInputFileName
};
auto model = liblinear_train::main(2, argv);
auto m = Model(model);
return m;
}
/// <summary>
/// </summary>
static Model Train(Problem problem, Parameter^ parameter)
{
::problem arg_problem;
::parameter arg_parameter;
try
{
// (1) convert managed Problem to native problem
arg_problem = Convert(problem);
// (2) convert managed Parameter to native parameter
arg_parameter = Convert(parameter);
// (3) call actual function
auto r = train(&arg_problem, &arg_parameter);
// debug code
//svm_save_model("C:/Data/test_r1.txt", r);
//svm_save_model("C:/Data/test_r2.txt", &Convert(Model(r)));
// (4) convert resulting native model to managed Model
auto result = Model(r);
FreeNativeModel(r, false);
return result;
}
finally
{
FreeProblem(&arg_problem);
destroy_param(&arg_parameter);
}
}
/// <summary>
/// This function conducts cross validation. Data are separated to
/// NrFold folds. Under given parameters, sequentially each fold is
/// validated using the model from training the remaining. Predicted
/// labels (of all prob's instances) in the validation process are
/// stored in the array called target.
/// The format of problem is same as that for Train().
/// </summary>
static array<double>^ CrossValidation(Problem problem, Parameter^ parameter, int nrFold, array<double>^ target)
{
::problem arg_problem;
::parameter arg_parameter;
double* native_target = NULL;
try
{
arg_problem = Convert(problem);
arg_parameter = Convert(parameter);
auto l = problem.Count;
auto target = new double[l];
::cross_validation(&arg_problem, &arg_parameter, nrFold, target);
auto result = gcnew array<double>(l);
for (auto i = 0; i < l; i++) result[i] = target[i];
return result;
}
finally
{
FreeProblem(&arg_problem);
if (native_target != NULL) free(native_target);
}
}
/// <summary>
/// This function does classification or regression on a test vector x
/// given a model.
/// For a classification model, the predicted class for x is returned.
/// For a regression model, the function value of x calculated using
/// the model is returned.For an one - class model, +1 or -1 is
/// returned.
/// </summary>
static double Predict(Model model, array<Node>^ x)
{
::feature_node* nativeNodes = NULL;
::model nativeModel;
try
{
nativeNodes = Convert(x);
nativeModel = Convert(model);
return ::predict(&nativeModel, nativeNodes);
}
finally
{
if (nativeNodes) delete[] nativeNodes;
FreeNativeModel(&nativeModel, true);
}
}
/// <summary>
/// This function gives decision values on a test vector x given a
/// model, and returns the predicted label (classification) or
/// the function value (regression).
/// For a classification model with NrClass classes, this function
/// gives NrClass*(NrClass - 1)/2 decision values in the array
/// decValues. The order is label[0] vs.label[1], ...,
/// label[0] vs.label[NrClass - 1], label[1] vs.label[2], ...,
/// label[NrClass - 2] vs.label[NrClass - 1]. The returned value is
/// the predicted class for x. Note that when NrClass=1, this
/// function does not give any decision value.
/// For a regression model, decValues[0] and the returned value are
/// both the function value of x calculated using the model. For a
/// one-class model, decValues[0] is the decision value of x, while
/// the returned value is +1/-1.
/// </summary>
static double PredictValues(Model model, array<Node>^ x, array<double>^ decValues)
{
::feature_node* nativeNodes = NULL;
::model nativeModel;
try
{
nativeNodes = Convert(x);
nativeModel = Convert(model);
pin_ptr<double> pDecValues = &decValues[0];
return ::predict_values(&nativeModel, nativeNodes, pDecValues);
}
finally
{
if (nativeNodes) delete[] nativeNodes;
FreeNativeModel(&nativeModel, true);
}
}
/// <summary>
/// This function does classification or regression on a test vector x
/// given a model with probability information.
/// For a classification model with probability information, this
/// function gives NrClass probability estimates in the array
/// probEstimates. The class with the highest probability is
/// returned. For regression/one-class SVM, the array probEstimates
/// is unchanged and the returned value is the same as that of
/// Predict.
/// </summary>
static double PredictProbability(Model model, array<Node>^ x, array<double>^ probEstimates)
{
::feature_node* nativeNodes = NULL;
::model nativeModel;
try
{
nativeNodes = Convert(x);
nativeModel = Convert(model);
pin_ptr<double> pProbEstimates = &probEstimates[0];
return ::predict_probability(&nativeModel, nativeNodes, pProbEstimates);
}
finally
{
if (nativeNodes) delete[] nativeNodes;
FreeNativeModel(&nativeModel, true);
}
}
/// <summary>
/// This function saves a model to a file.
/// </summary>
static void SaveModel(String^ fileName, Model model)
{
auto context = gcnew marshal_context();
const char* nativeFileName = context->marshal_as<const char*>(fileName);
auto native_model = Convert(model);
auto err = ::save_model(nativeFileName, &native_model);
if (err != 0) throw gcnew Exception("SaveModel failed with error code " + err + ".");
}
/// <summary>
/// This function loads a model from file.
/// </summary>
static Model LoadModel(String^ fileName)
{
auto filenameNative = (const char*)Marshal::StringToHGlobalAnsi(fileName).ToPointer();
auto nativeModel = ::load_model(filenameNative);
return Model(nativeModel);
}
/// <summary>
/// Disables liblinear's output to stdout.
/// </summary>
static void DisablePrint();
/// <summary>
/// This function checks whether the parameters are within the feasible
/// range of the problem. This function should be called before
/// Svm.Train() and Svm.CrossValidation(). It returns null if the
/// parameters are feasible, otherwise an error message is returned.
/// </summary>
static String^ CheckParameter(Problem problem, Parameter^ parameter)
{
::problem arg_problem;
::parameter arg_parameter;
try
{
arg_problem = Convert(problem);
arg_parameter = Convert(parameter);
auto r = ::check_parameter(&arg_problem, &arg_parameter);
return gcnew String(r);
}
finally
{
FreeProblem(&arg_problem);
}
}
/// <summary>
/// This function checks whether the model contains required information
/// to do probability estimates. If so, it returns true. Otherwise, false
/// is returned. This function should be called before calling
/// GetSvrProbability and PredictProbability.
/// </summary>
static bool CheckProbabilityModel(Model model)
{
::model nativeModel;
try
{
nativeModel = Convert(model);
auto r = ::check_probability_model(&nativeModel);
return r == 1;
}
finally
{
FreeNativeModel(&nativeModel, true);
}
}
private:
static ::problem Convert(Problem problem)
{
::problem result;
result.l = problem.y->Length;
result.n = problem.x[0]->Length;
pin_ptr<double> yPinned = &problem.y[0];
result.y = new double[result.l];
memcpy(result.y, yPinned, result.l * sizeof(double));
result.x = new ::feature_node*[result.l];
for (int i = 0; i < result.l; i++) result.x[i] = Convert(problem.x[i]);
result.bias = problem.Bias;
return result;
}
static ::feature_node Convert(const Node node)
{
::feature_node x;
x.index = node.Index;
x.value = node.Value;
return x;
}
static ::feature_node* Convert(array<Node>^ x)
{
auto n = x->Length;
auto p = new ::feature_node[n + 1];
pin_ptr<Node> pinned = &x[0];
memcpy(p, pinned, n * sizeof(::feature_node));
p[n].index = -1; p[n].value = 0.0; // add delimiter
return p;
}
static ::parameter Convert(Parameter^ p)
{
::parameter result;
result.solver_type = (int)p->SolverType;
result.eps = p->Eps;
result.C = p->C;
result.nr_thread = p->NrThread;
result.nr_weight = p->Weight ? p->Weight->Length : 0;
if (p->WeightLabel && p->WeightLabel->Length)
{
auto count = p->WeightLabel->Length;
result.weight_label = new int[count];
pin_ptr<int> pinnedWeightLabel = &p->WeightLabel[0];
memcpy(result.weight_label, pinnedWeightLabel, count * sizeof(int));
result.weight = new double[count];
pin_ptr<double> pinnedWeight = &p->Weight[0];
memcpy(result.weight, pinnedWeight, count * sizeof(double));
}
else
{
result.weight_label = NULL;
result.weight = NULL;
}
result.p = p->p;
if (p->InitSol && p->InitSol->Length)
{
auto count = p->InitSol->Length;
result.init_sol = new double[count];
pin_ptr<double> pinnedInitSol = &p->InitSol[0];
memcpy(result.init_sol, pinnedInitSol, count * sizeof(double));
}
else
{
result.init_sol = NULL;
}
return result;
}
static ::model Convert(Model model)
{
::model native;
native.param = Convert(model.Param);
native.nr_class = model.NrClass;
native.nr_feature = model.NrFeature;
COPY_MANAGED_ARRAY_TO_NATIVE(double, model.NrFeature, w, W)
COPY_MANAGED_ARRAY_TO_NATIVE(int, model.NrClass, label, Label)
native.bias = model.Bias;
return native;
}
static void FreeProblem(::problem* problem)
{
if (problem->y)
{
delete[] problem->y;
problem->y = NULL;
}
if (problem->x)
{
for (int i = 0; i < problem->l; i++)
{
delete[] problem->x[i];
problem->x[i] = NULL;
}
delete[] problem->x;
problem->x = NULL;
}
}
static void FreeNativeModel(::model* native, bool deleteInnerSVs)
{
#define Clean(param) { if (native->param) delete[] native->param; native->param = NULL; }
Clean(param.weight);
Clean(param.weight_label);
Clean(param.init_sol);
Clean(label);
Clean(w);
}
};
}
|
ce69f51b9c798b0ae1fe40e76aaa8e4f2691a57a | ee2c15d82ff596f4ca9eda408f8e096b787f0d48 | /lec_04_sorts/codes/countChar.cpp | 2684c0d0ab6a4d566347f66812e1ad6ec16dcd0d | [] | no_license | sainimohit23/algorithms | 1bbfee3bd4d1049b18425bf0d86ecaacd4c43ea0 | 911986abe015f7518ef169a5866b1058c7d41d4f | refs/heads/master | 2022-11-13T17:40:06.128838 | 2020-06-30T17:35:35 | 2020-06-30T17:35:35 | 268,071,412 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 186 | cpp | countChar.cpp | #include <iostream>
using namespace std;
int main(){
char c;
// cin >> c;
int cnt = 0;
while(cin >> c && c != '$'){
// if(c=='$') break;
++cnt;
// cin >> c;
}
cout << cnt;
} |
4ee2643ccd5632399446e668a297a1121c390ebb | a97b9ad50e283b4e930ab59547806eb303b52c6f | /class/4nov_plate_kwSST/20/k | 846835e8d611ec1080faf6c4b8dda82b8791ad66 | [] | no_license | harrisbk/OpenFOAM_run | fdcd4f81bd3205764988ea95c25fd2a5c130841b | 9591c98336561bcfb3b7259617b5363aacf48067 | refs/heads/master | 2016-09-05T08:45:27.965608 | 2015-11-16T19:08:34 | 2015-11-16T19:08:34 | 42,883,543 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 101,144 | k | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "20";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
10000
(
0.0716072
0.0703346
0.0699724
0.0699138
0.0699171
0.0699452
0.069979
0.0699941
0.0699814
0.0699428
0.0698873
0.0698266
0.0697729
0.0697356
0.0697178
0.0697101
0.0696811
0.0695619
0.0691916
0.0678415
0.0716259
0.0703705
0.0700176
0.0699622
0.0699657
0.0699924
0.0700241
0.0700367
0.0700213
0.0699803
0.0699225
0.06986
0.069805
0.0697671
0.0697498
0.0697449
0.0697244
0.069631
0.0693594
0.0686726
0.0716207
0.07036
0.0700039
0.0699474
0.0699508
0.0699777
0.07001
0.0700234
0.0700092
0.0699696
0.0699136
0.0698532
0.0698004
0.0697652
0.0697516
0.0697535
0.0697484
0.0696938
0.069527
0.069165
0.071596
0.0703112
0.069941
0.0698794
0.0698823
0.0699107
0.0699457
0.0699628
0.0699528
0.0699181
0.0698673
0.0698122
0.0697649
0.0697352
0.069728
0.0697397
0.0697539
0.0697409
0.0696623
0.0694802
0.0715557
0.070231
0.0698368
0.0697663
0.0697682
0.0697989
0.0698383
0.0698614
0.0698585
0.0698314
0.0697887
0.0697418
0.0697026
0.069681
0.0696826
0.0697062
0.0697409
0.0697666
0.0697579
0.0696898
0.0715031
0.0701253
0.0696985
0.0696152
0.0696152
0.0696488
0.069694
0.0697249
0.0697312
0.0697143
0.0696822
0.0696459
0.0696171
0.0696057
0.0696181
0.069655
0.0697099
0.0697692
0.0698145
0.0698243
0.0714414
0.0699995
0.069532
0.0694321
0.069429
0.0694656
0.0695176
0.0695579
0.0695753
0.0695705
0.069551
0.0695275
0.0695112
0.0695119
0.0695366
0.0695876
0.0696616
0.0697494
0.069836
0.0699011
0.0713732
0.0698584
0.0693429
0.0692222
0.0692145
0.069254
0.0693135
0.0693643
0.0693942
0.0694033
0.0693983
0.0693893
0.0693872
0.0694016
0.0694399
0.0695056
0.0695976
0.0697092
0.0698275
0.0699325
0.0713007
0.0697058
0.0691355
0.0689899
0.0689758
0.0690176
0.0690849
0.0691472
0.0691909
0.0692152
0.0692262
0.0692333
0.0692469
0.0692765
0.0693296
0.0694105
0.0695194
0.0696513
0.0697945
0.0699287
0.0712257
0.0695452
0.0689139
0.068739
0.0687162
0.0687596
0.0688347
0.0689091
0.0689677
0.0690085
0.0690367
0.0690612
0.0690919
0.0691379
0.0692068
0.0693034
0.0694287
0.0695786
0.069742
0.0698982
0.0711497
0.0693794
0.0686814
0.0684726
0.0684387
0.0684823
0.0685651
0.0686521
0.0687262
0.0687845
0.0688312
0.0688743
0.0689232
0.0689869
0.0690726
0.0691855
0.0693271
0.0694936
0.0696741
0.0698479
0.0710739
0.0692107
0.0684407
0.0681934
0.0681454
0.068188
0.0682779
0.0683775
0.068468
0.0685446
0.0686106
0.0686735
0.0687418
0.0688241
0.0689278
0.0690578
0.0692158
0.0693984
0.0695945
0.069783
0.0709991
0.069041
0.0681942
0.0679038
0.0678386
0.0678782
0.0679744
0.0680867
0.0681937
0.0682894
0.0683758
0.0684594
0.0685481
0.0686503
0.0687728
0.0689208
0.0690958
0.0692945
0.0695055
0.0697075
0.070926
0.0688719
0.067944
0.0676057
0.0675198
0.0675543
0.0676556
0.0677803
0.0679043
0.0680196
0.0681271
0.0682323
0.0683426
0.0684656
0.0686081
0.068775
0.0689679
0.0691831
0.0694092
0.0696241
0.0708553
0.0687047
0.0676921
0.0673009
0.0671906
0.0672176
0.0673226
0.067459
0.0675999
0.0677354
0.0678647
0.0679924
0.0681251
0.0682701
0.0684338
0.0686207
0.0688324
0.069065
0.0693067
0.0695348
0.0707872
0.0685405
0.0674399
0.0669912
0.0668526
0.0668692
0.066976
0.0671233
0.0672811
0.0674369
0.0675886
0.0677397
0.0678959
0.0680639
0.0682498
0.0684579
0.0686895
0.0689405
0.0691987
0.0694406
0.070722
0.0683804
0.067189
0.0666782
0.066507
0.0665102
0.0666167
0.0667737
0.0669478
0.0671242
0.0672988
0.0674739
0.0676546
0.0678467
0.068056
0.0682866
0.0685394
0.06881
0.0690857
0.0693423
0.0706601
0.068225
0.0669408
0.0663635
0.0661553
0.0661418
0.0662455
0.0664106
0.0666004
0.0667972
0.0669952
0.067195
0.067401
0.0676183
0.0678522
0.0681065
0.0683818
0.0686734
0.0689678
0.0692402
0.0706015
0.068075
0.0666966
0.0660487
0.0657991
0.0657653
0.0658634
0.0660347
0.0662391
0.0664561
0.0666775
0.0669027
0.0671348
0.0673784
0.0676382
0.0679175
0.0682168
0.0685306
0.0688452
0.0691344
0.0705463
0.0679311
0.0664576
0.0657352
0.0654399
0.065382
0.0654713
0.0656465
0.0658643
0.0661008
0.0663457
0.0665968
0.0668558
0.0671267
0.0674135
0.0677193
0.0680439
0.0683816
0.0687176
0.0690251
0.0704946
0.0677937
0.0662249
0.0654248
0.0650792
0.0649934
0.0650706
0.0652471
0.0654764
0.0657316
0.0659998
0.066277
0.0665637
0.0668629
0.067178
0.0675117
0.0678631
0.068226
0.0685851
0.0689121
0.0704464
0.0676632
0.0659995
0.0651188
0.0647187
0.064601
0.0646625
0.0648373
0.0650762
0.0653488
0.0656399
0.0659433
0.0662582
0.0665867
0.0669314
0.0672942
0.067674
0.0680638
0.0684474
0.0687953
0.0704017
0.06754
0.0657825
0.0648189
0.0643602
0.0642066
0.0642489
0.0644186
0.0646645
0.0649531
0.0652663
0.0655959
0.0659394
0.0662979
0.0666733
0.0670667
0.0674763
0.0678946
0.0683043
0.0686746
0.0703604
0.0674241
0.0655747
0.0645264
0.0640054
0.063812
0.0638312
0.0639925
0.0642425
0.0645452
0.0648795
0.0652348
0.0656073
0.0659966
0.0664036
0.0668289
0.06727
0.0677183
0.0681556
0.0685498
0.0703225
0.0673159
0.0653768
0.0642428
0.0636559
0.0634188
0.0634115
0.0635606
0.0638118
0.0641262
0.0644801
0.0648606
0.065262
0.0656826
0.0661224
0.0665809
0.0670547
0.0675347
0.0680013
0.0684208
0.0702879
0.0672153
0.0651893
0.0639694
0.0633137
0.0630291
0.0629916
0.063125
0.0633739
0.0636974
0.0640692
0.0644739
0.0649041
0.0653563
0.0658296
0.0663224
0.0668306
0.0673437
0.0678411
0.0682873
0.0702564
0.0671222
0.0650127
0.0637072
0.0629802
0.0626446
0.0625736
0.0626878
0.0629308
0.0632605
0.063648
0.0640757
0.064534
0.0650181
0.0655255
0.0660537
0.0665975
0.0671453
0.0676751
0.0681495
0.0702279
0.0670367
0.0648475
0.0634572
0.0626571
0.0622672
0.0621593
0.062251
0.0624848
0.0628174
0.0632182
0.0636672
0.0641529
0.0646687
0.0652106
0.0657751
0.0663557
0.0669396
0.0675032
0.0680071
0.0702022
0.0669585
0.0646936
0.0632204
0.0623458
0.0618986
0.0617507
0.0618167
0.0620379
0.0623703
0.0627816
0.0632501
0.0637619
0.0643089
0.0648857
0.0654872
0.0661056
0.0667269
0.0673256
0.0678604
0.0701792
0.0668874
0.0645513
0.0629973
0.0620476
0.0615405
0.0613495
0.0613871
0.0615926
0.0619215
0.0623405
0.0628261
0.0633627
0.0639402
0.0645517
0.0651906
0.0658478
0.0665076
0.0671427
0.0677096
0.0701587
0.0668231
0.0644204
0.0627884
0.0617636
0.0611944
0.0609575
0.0609638
0.0611509
0.0614734
0.0618973
0.0623976
0.0629572
0.0635642
0.06421
0.0648866
0.0655832
0.0662824
0.0669551
0.0675551
0.0701405
0.0667653
0.0643007
0.062594
0.0614947
0.0608617
0.0605761
0.0605485
0.0607148
0.0610283
0.0614544
0.0619671
0.0625477
0.0631829
0.0638625
0.0645767
0.0653131
0.0660525
0.0667636
0.0673977
0.0701245
0.0667136
0.0641919
0.0624142
0.0612418
0.0605437
0.060207
0.0601428
0.0602858
0.0605881
0.0610141
0.0615369
0.0621368
0.0627989
0.0635114
0.0642629
0.0650394
0.0658195
0.0665697
0.0672386
0.0701104
0.0666676
0.0640935
0.0622489
0.0610052
0.0602416
0.0598514
0.059748
0.0598653
0.0601543
0.0605782
0.0611094
0.061727
0.0624147
0.0631594
0.0639479
0.0647643
0.0655854
0.0663752
0.0670794
0.0700981
0.066627
0.0640051
0.0620978
0.0607852
0.0599561
0.0595106
0.0593652
0.0594544
0.059728
0.0601482
0.0606863
0.0613202
0.0620327
0.0628089
0.0636341
0.0644906
0.0653529
0.0661826
0.0669224
0.0700875
0.0665912
0.0639262
0.0619606
0.0605821
0.0596879
0.0591856
0.0589958
0.059054
0.0593099
0.0597246
0.0602683
0.0609178
0.0616545
0.062462
0.063324
0.0642207
0.0651245
0.0659943
0.06677
0.0700782
0.0665599
0.0638561
0.0618367
0.0603955
0.0594376
0.0588775
0.0586408
0.0586652
0.0589007
0.0593079
0.0598559
0.0605202
0.0612808
0.0621199
0.0630191
0.0639566
0.0649024
0.0658127
0.0666243
0.0700703
0.0665326
0.0637941
0.0617256
0.0602252
0.0592053
0.0585871
0.0583013
0.058289
0.0585011
0.0588983
0.0594488
0.060127
0.0609114
0.0617823
0.0627194
0.0636987
0.0646874
0.0656389
0.0664869
0.0700634
0.066509
0.0637397
0.0616263
0.0600708
0.058991
0.0583148
0.0579784
0.0579264
0.0581119
0.058496
0.0590468
0.0597375
0.0605451
0.0614481
0.0624241
0.0634462
0.0644789
0.0654726
0.0663575
0.0700576
0.0664887
0.0636921
0.0615383
0.0599315
0.0587946
0.0580612
0.0576729
0.0575786
0.057734
0.0581016
0.0586497
0.0593508
0.0601806
0.0611157
0.062131
0.0631971
0.0642751
0.065312
0.0662346
0.0700527
0.0664712
0.0636508
0.0614606
0.0598066
0.0586156
0.0578264
0.0573856
0.0572466
0.0573686
0.057716
0.0582578
0.0589665
0.0598167
0.060783
0.0618379
0.0629487
0.0640732
0.0651544
0.0661156
0.0700485
0.0664563
0.063615
0.0613923
0.0596953
0.0584535
0.0576102
0.057117
0.0569316
0.057017
0.0573403
0.0578719
0.0585848
0.0594527
0.0604487
0.0615426
0.0626984
0.0638701
0.0649966
0.0659973
0.070045
0.0664437
0.0635843
0.0613328
0.0595965
0.0583075
0.0574124
0.0568673
0.0566343
0.0566805
0.0569759
0.0574932
0.0582063
0.0590887
0.0601119
0.0612436
0.062444
0.0636631
0.0648356
0.0658766
0.070042
0.066433
0.0635579
0.061281
0.0595094
0.0581767
0.0572324
0.0566365
0.0563555
0.0563601
0.0566242
0.0571231
0.0578321
0.0587251
0.0597727
0.06094
0.062184
0.0634504
0.0646691
0.0657509
0.0700396
0.066424
0.0635354
0.0612362
0.059433
0.0580601
0.0570696
0.0564246
0.0560954
0.0560569
0.0562867
0.0567632
0.0574637
0.0583632
0.0594316
0.060632
0.0619179
0.0632307
0.0644956
0.0656183
0.0700375
0.0664164
0.0635163
0.0611976
0.0593662
0.0579568
0.0569231
0.0562309
0.0558542
0.0557716
0.0559646
0.056415
0.0571029
0.0580045
0.0590898
0.0603201
0.0616458
0.0630038
0.0643143
0.065478
0.0700358
0.06641
0.0635001
0.0611646
0.0593081
0.0578656
0.0567919
0.056055
0.0556318
0.0555047
0.055659
0.0560801
0.0567513
0.0576508
0.0587488
0.0600056
0.0613685
0.06277
0.0641251
0.0653297
0.0700344
0.0664048
0.0634865
0.0611363
0.0592579
0.0577856
0.056675
0.0558959
0.0554278
0.0552563
0.0553705
0.0557597
0.0564106
0.0573037
0.0584104
0.0596899
0.0610871
0.06253
0.0639287
0.0651734
0.0700332
0.0664004
0.063475
0.0611123
0.0592145
0.0577155
0.0565712
0.0557527
0.0552415
0.0550264
0.0550998
0.0554549
0.0560822
0.056965
0.0580762
0.0593748
0.060803
0.0622852
0.0637259
0.0650101
0.0700322
0.0663968
0.0634655
0.0610919
0.0591772
0.0576545
0.0564796
0.0556244
0.0550723
0.0548145
0.0548469
0.0551664
0.0557673
0.0566362
0.0577481
0.0590618
0.0605179
0.0620367
0.0635178
0.0648404
0.0700314
0.0663938
0.0634575
0.0610747
0.0591452
0.0576014
0.0563988
0.0555098
0.0549191
0.0546201
0.0546117
0.0548947
0.0554669
0.0563188
0.0574275
0.0587527
0.0602333
0.0617861
0.0633056
0.0646656
0.0700307
0.0663913
0.0634508
0.0610602
0.0591179
0.0575555
0.056328
0.055408
0.054781
0.0544425
0.0543941
0.0546398
0.0551816
0.0560136
0.0571158
0.0584489
0.0599507
0.0615348
0.0630907
0.0644866
0.0700302
0.0663892
0.0634452
0.061048
0.0590947
0.0575158
0.056266
0.0553176
0.054657
0.0542809
0.0541933
0.0544017
0.0549119
0.0557216
0.0568141
0.0581517
0.0596715
0.061284
0.0628742
0.0643046
0.0700297
0.0663876
0.0634407
0.0610377
0.0590749
0.0574817
0.0562119
0.0552377
0.0545458
0.0541342
0.0540089
0.0541802
0.0546577
0.0554433
0.0565234
0.0578623
0.0593968
0.061035
0.0626573
0.0641207
0.0700294
0.0663862
0.0634368
0.0610291
0.0590581
0.0574523
0.0561647
0.0551672
0.0544465
0.0540014
0.0538398
0.0539747
0.0544192
0.055179
0.0562444
0.0575816
0.0591279
0.0607889
0.062441
0.0639357
0.0700291
0.0663851
0.0634337
0.0610219
0.0590438
0.057427
0.0561237
0.0551051
0.0543579
0.0538815
0.0536853
0.0537846
0.0541959
0.0549289
0.0559774
0.0573103
0.0588655
0.0605467
0.0622263
0.0637507
0.0700288
0.0663842
0.0634311
0.0610159
0.0590318
0.0574054
0.0560881
0.0550505
0.054279
0.0537735
0.0535443
0.0536091
0.0539875
0.0546928
0.0557227
0.057049
0.0586103
0.0603092
0.0620141
0.0635663
0.0700286
0.0663834
0.0634289
0.0610108
0.0590215
0.0573868
0.0560572
0.0550025
0.0542089
0.0536763
0.053416
0.0534476
0.0537933
0.0544705
0.0554804
0.056798
0.0583631
0.060077
0.061805
0.0633834
0.0700284
0.0663828
0.0634272
0.0610066
0.0590129
0.0573709
0.0560304
0.0549604
0.0541466
0.0535889
0.0532994
0.053299
0.0536129
0.0542616
0.0552505
0.0565575
0.0581241
0.0598508
0.0615997
0.0632025
0.0700283
0.0663823
0.0634257
0.0610031
0.0590056
0.0573573
0.0560071
0.0549235
0.0540913
0.0535105
0.0531934
0.0531626
0.0534454
0.0540657
0.0550327
0.0563276
0.0578936
0.0596309
0.0613986
0.0630242
0.0700282
0.0663819
0.0634245
0.0610002
0.0589994
0.0573457
0.055987
0.0548911
0.0540423
0.0534401
0.0530973
0.0530375
0.0532901
0.0538824
0.0548269
0.0561083
0.057672
0.0594177
0.0612024
0.062849
0.0700281
0.0663815
0.0634235
0.0609977
0.0589942
0.0573357
0.0559695
0.0548626
0.0539988
0.053377
0.0530102
0.0529228
0.0531464
0.0537109
0.0546325
0.0558994
0.0574591
0.0592114
0.0610111
0.0626772
0.070028
0.0663812
0.0634227
0.0609956
0.0589897
0.0573271
0.0559544
0.0548377
0.0539601
0.0533203
0.0529311
0.0528178
0.0530134
0.0535507
0.0544493
0.0557008
0.057255
0.0590122
0.0608252
0.0625093
0.0700279
0.066381
0.063422
0.0609939
0.058986
0.0573198
0.0559412
0.0548158
0.0539258
0.0532695
0.0528595
0.0527216
0.0528904
0.0534011
0.0542767
0.0555122
0.0570597
0.0588202
0.0606448
0.0623454
0.0700279
0.0663808
0.0634214
0.0609925
0.0589828
0.0573134
0.0559298
0.0547965
0.0538954
0.0532239
0.0527945
0.0526335
0.0527767
0.0532616
0.0541143
0.0553332
0.0568729
0.0586354
0.0604701
0.0621857
0.0700278
0.0663807
0.0634209
0.0609913
0.0589801
0.057308
0.0559198
0.0547796
0.0538683
0.0531829
0.0527356
0.0525529
0.0526716
0.0531315
0.0539616
0.0551635
0.0566946
0.0584577
0.0603011
0.0620305
0.0700278
0.0663805
0.0634205
0.0609902
0.0589777
0.0573033
0.0559111
0.0547647
0.0538442
0.0531461
0.0526821
0.052479
0.0525745
0.0530102
0.053818
0.0550028
0.0565245
0.0582871
0.0601379
0.0618798
0.0700277
0.0663804
0.0634202
0.0609894
0.0589758
0.0572993
0.0559036
0.0547515
0.0538227
0.0531129
0.0526336
0.0524113
0.0524847
0.0528971
0.0536831
0.0548507
0.0563624
0.0581234
0.0599805
0.0617337
0.0700277
0.0663803
0.0634199
0.0609886
0.0589741
0.0572958
0.0558969
0.0547399
0.0538036
0.0530831
0.0525894
0.0523492
0.0524017
0.0527917
0.0535564
0.0547067
0.056208
0.0579666
0.0598288
0.0615923
0.0700277
0.0663803
0.0634197
0.060988
0.0589726
0.0572927
0.0558912
0.0547296
0.0537865
0.0530562
0.0525493
0.0522922
0.0523249
0.0526935
0.0534374
0.0545706
0.056061
0.0578165
0.0596828
0.0614556
0.0700276
0.0663802
0.0634195
0.0609875
0.0589714
0.0572901
0.0558861
0.0547205
0.0537712
0.0530319
0.0525128
0.05224
0.0522538
0.0526019
0.0533257
0.0544419
0.0559212
0.0576729
0.0595425
0.0613236
0.0700276
0.0663802
0.0634194
0.0609871
0.0589703
0.0572878
0.0558816
0.0547124
0.0537575
0.05301
0.0524795
0.052192
0.0521881
0.0525165
0.0532208
0.0543203
0.0557882
0.0575355
0.0594076
0.0611963
0.0700276
0.0663801
0.0634192
0.0609867
0.0589694
0.0572858
0.0558777
0.0547052
0.0537452
0.0529901
0.0524491
0.0521478
0.0521272
0.0524368
0.0531223
0.0542054
0.0556619
0.0574043
0.0592782
0.0610735
0.0700276
0.0663801
0.0634191
0.0609863
0.0589686
0.0572841
0.0558742
0.0546988
0.0537341
0.0529721
0.0524214
0.0521072
0.0520707
0.0523625
0.0530298
0.0540968
0.0555418
0.0572791
0.0591541
0.0609554
0.0700276
0.06638
0.063419
0.0609861
0.0589679
0.0572825
0.0558711
0.0546931
0.0537242
0.0529558
0.052396
0.0520698
0.0520184
0.0522931
0.0529429
0.0539943
0.0554279
0.0571596
0.0590351
0.0608417
0.0700276
0.06638
0.0634189
0.0609858
0.0589673
0.0572812
0.0558684
0.054688
0.0537152
0.052941
0.0523728
0.0520354
0.0519699
0.0522284
0.0528613
0.0538974
0.0553197
0.0570456
0.0589212
0.0607325
0.0700276
0.06638
0.0634189
0.0609856
0.0589667
0.05728
0.055866
0.0546834
0.0537072
0.0529276
0.0523516
0.0520036
0.0519248
0.0521679
0.0527847
0.053806
0.055217
0.0569369
0.0588122
0.0606277
0.0700276
0.06638
0.0634188
0.0609854
0.0589663
0.057279
0.0558638
0.0546793
0.0536999
0.0529153
0.0523321
0.0519743
0.051883
0.0521115
0.0527128
0.0537197
0.0551197
0.0568335
0.058708
0.0605271
0.0700275
0.06638
0.0634187
0.0609853
0.0589659
0.057278
0.0558619
0.0546757
0.0536933
0.0529042
0.0523143
0.0519473
0.0518442
0.0520588
0.0526453
0.0536383
0.0550274
0.056735
0.0586085
0.0604308
0.0700275
0.0663799
0.0634187
0.0609851
0.0589655
0.0572772
0.0558602
0.0546723
0.0536873
0.052894
0.0522979
0.0519223
0.0518082
0.0520096
0.0525819
0.0535616
0.05494
0.0566414
0.0585135
0.0603386
0.0700275
0.0663799
0.0634186
0.060985
0.0589652
0.0572765
0.0558587
0.0546694
0.0536818
0.0528847
0.0522829
0.0518993
0.0517747
0.0519636
0.0525225
0.0534892
0.0548574
0.0565525
0.058423
0.0602505
0.0700275
0.0663799
0.0634186
0.0609849
0.0589649
0.0572758
0.0558573
0.0546667
0.0536769
0.0528762
0.052269
0.051878
0.0517436
0.0519208
0.0524667
0.0534211
0.0547792
0.0564681
0.0583369
0.0601664
0.0700275
0.0663799
0.0634186
0.0609848
0.0589647
0.0572753
0.055856
0.0546642
0.0536724
0.0528684
0.0522564
0.0518583
0.0517148
0.0518808
0.0524146
0.0533571
0.0547055
0.0563883
0.0582551
0.0600864
0.0700275
0.0663799
0.0634186
0.0609847
0.0589645
0.0572747
0.0558549
0.0546621
0.0536684
0.0528614
0.0522447
0.0518402
0.051688
0.0518436
0.0523658
0.053297
0.054636
0.0563128
0.0581776
0.0600103
0.0700275
0.0663799
0.0634185
0.0609846
0.0589643
0.0572743
0.055854
0.0546601
0.0536647
0.0528549
0.052234
0.0518234
0.0516633
0.051809
0.0523202
0.0532407
0.0545707
0.0562416
0.0581043
0.0599382
0.0700275
0.0663799
0.0634185
0.0609846
0.0589641
0.0572739
0.0558531
0.0546583
0.0536613
0.052849
0.0522242
0.051808
0.0516404
0.0517768
0.0522778
0.0531881
0.0545095
0.0561747
0.0580352
0.0598702
0.0700275
0.0663799
0.0634185
0.0609845
0.0589639
0.0572735
0.0558523
0.0546567
0.0536583
0.0528436
0.0522152
0.0517938
0.0516192
0.0517471
0.0522384
0.053139
0.0544522
0.056112
0.0579704
0.0598062
0.0700275
0.0663799
0.0634185
0.0609845
0.0589638
0.0572732
0.0558515
0.0546552
0.0536555
0.0528387
0.0522069
0.0517808
0.0515997
0.0517195
0.0522018
0.0530934
0.0543989
0.0560534
0.0579097
0.0597462
0.0700275
0.0663799
0.0634185
0.0609844
0.0589637
0.0572729
0.0558509
0.0546539
0.053653
0.0528342
0.0521994
0.0517688
0.0515817
0.0516941
0.0521679
0.0530511
0.0543493
0.0559989
0.0578531
0.0596901
0.0700275
0.0663799
0.0634185
0.0609844
0.0589636
0.0572726
0.0558503
0.0546527
0.0536507
0.0528301
0.0521925
0.0517578
0.0515652
0.0516707
0.0521367
0.0530119
0.0543033
0.0559483
0.0578004
0.0596379
0.0700275
0.0663799
0.0634184
0.0609844
0.0589635
0.0572724
0.0558498
0.0546516
0.0536486
0.0528263
0.0521861
0.0517477
0.05155
0.0516491
0.0521078
0.0529757
0.0542608
0.0559014
0.0577516
0.0595895
0.0700275
0.0663799
0.0634184
0.0609843
0.0589634
0.0572722
0.0558493
0.0546506
0.0536467
0.0528229
0.0521803
0.0517384
0.051536
0.0516291
0.0520811
0.0529422
0.0542214
0.0558579
0.0577063
0.0595446
0.0700275
0.0663799
0.0634184
0.0609843
0.0589633
0.057272
0.0558488
0.0546497
0.0536449
0.0528197
0.052175
0.0517298
0.0515231
0.0516107
0.0520564
0.0529112
0.0541849
0.0558176
0.0576644
0.0595029
0.0700275
0.0663799
0.0634184
0.0609843
0.0589632
0.0572718
0.0558484
0.0546488
0.0536433
0.0528168
0.05217
0.0517219
0.0515111
0.0515936
0.0520335
0.0528824
0.054151
0.0557801
0.0576254
0.0594641
0.0700275
0.0663799
0.0634184
0.0609843
0.0589632
0.0572716
0.0558481
0.054648
0.0536418
0.0528141
0.0521654
0.0517145
0.0514999
0.0515777
0.0520121
0.0528555
0.0541193
0.0557451
0.0575888
0.0594279
0.0700275
0.0663799
0.0634184
0.0609842
0.0589631
0.0572715
0.0558477
0.0546473
0.0536404
0.0528116
0.0521611
0.0517075
0.0514892
0.0515625
0.0519917
0.0528298
0.054089
0.0557116
0.0575539
0.0593933
0.0700275
0.0663799
0.0634184
0.0609842
0.0589631
0.0572713
0.0558474
0.0546466
0.053639
0.0528089
0.0521566
0.0517003
0.0514783
0.0515468
0.0519706
0.0528032
0.0540577
0.055677
0.057518
0.0593576
0.0700275
0.0663799
0.0634184
0.0609842
0.058963
0.0572711
0.0558469
0.0546457
0.0536372
0.0528057
0.0521511
0.0516913
0.0514645
0.051527
0.0519439
0.0527694
0.0540177
0.0556327
0.0574717
0.0593116
0.0700275
0.0663799
0.0634184
0.0609842
0.0589629
0.0572708
0.0558463
0.0546442
0.0536343
0.0528003
0.0521415
0.0516756
0.0514402
0.0514915
0.0518953
0.0527071
0.0539431
0.0555491
0.0573836
0.0592233
0.0700275
0.0663799
0.0634184
0.0609841
0.0589627
0.0572703
0.0558449
0.0546412
0.0536282
0.0527885
0.0521203
0.0516397
0.051383
0.0514058
0.051775
0.052549
0.0537489
0.0553262
0.0571429
0.0589768
0.0579272
0.0496522
0.0433497
0.0384455
0.0345601
0.0314333
0.0288819
0.0267746
0.0250154
0.0235328
0.0222725
0.0211933
0.0202628
0.0194557
0.018752
0.0181356
0.0175937
0.0171157
0.0166929
0.0163181
0.0159852
0.0156888
0.0154243
0.0151878
0.0149757
0.0147848
0.0146125
0.0144562
0.0143138
0.0141834
0.0140636
0.0139528
0.01385
0.0137541
0.0136645
0.0135804
0.0135013
0.0134267
0.0133563
0.0132897
0.0132267
0.0131669
0.0131102
0.0130565
0.0130055
0.012957
0.0129108
0.012867
0.0128252
0.0127855
0.0127476
0.0127115
0.0126771
0.0126443
0.012613
0.0125833
0.0125548
0.0125276
0.0125017
0.0124771
0.0124535
0.0124307
0.0124091
0.0123884
0.0123684
0.0123492
0.0123305
0.0123123
0.0122941
0.0122761
0.0122581
0.0122395
0.0122218
0.0122018
0.0121852
0.0121635
0.0121457
0.0121167
0.0121063
0.0120616
0.0667858
0.0642394
0.0615445
0.0588743
0.0563066
0.0538784
0.0516058
0.0494932
0.0475384
0.0457351
0.0440752
0.0425495
0.0411488
0.0398641
0.0386871
0.0376099
0.0366253
0.0357264
0.0349068
0.0341603
0.033481
0.0328632
0.0323013
0.0317901
0.0313245
0.0308997
0.0305114
0.0301555
0.0298283
0.0295266
0.0292473
0.0289881
0.0287467
0.0285214
0.0283104
0.0281125
0.0279265
0.0277516
0.0275868
0.0274314
0.0272848
0.0271463
0.0270156
0.026892
0.0267752
0.0266646
0.02656
0.0264609
0.0263671
0.0262783
0.0261942
0.0261144
0.026039
0.0259676
0.0258999
0.025836
0.0257755
0.025718
0.0256636
0.0256122
0.0255634
0.0255166
0.0254723
0.0254303
0.0253901
0.025351
0.0253134
0.0252765
0.0252395
0.0252034
0.0251656
0.0251284
0.0250864
0.0250504
0.0250028
0.0249696
0.0248991
0.0248642
0.0248093
0.0247309
0.0684664
0.067438
0.0661892
0.0648021
0.0633341
0.0618267
0.0603106
0.0588086
0.0573379
0.0559111
0.0545374
0.053223
0.0519724
0.0507881
0.0496715
0.0486231
0.0476422
0.0467276
0.0458773
0.0450888
0.0443591
0.0436849
0.0430625
0.0424882
0.0419581
0.0414685
0.0410156
0.0405959
0.0402062
0.0398436
0.0395054
0.0391892
0.0388929
0.0386147
0.0383531
0.0381067
0.0378742
0.0376547
0.0374472
0.037251
0.0370652
0.0368893
0.0367226
0.0365646
0.0364147
0.0362724
0.0361372
0.0360089
0.0358871
0.0357714
0.0356615
0.035557
0.0354579
0.0353638
0.0352745
0.0351898
0.0351093
0.0350328
0.0349602
0.0348914
0.0348259
0.0347631
0.0347035
0.0346467
0.0345921
0.0345391
0.0344876
0.0344369
0.0343862
0.0343358
0.0342838
0.0342311
0.0341748
0.0341207
0.0340583
0.0340036
0.0339199
0.0338622
0.0337874
0.0336807
0.069146
0.0686409
0.0679861
0.0672103
0.0663405
0.0654005
0.0644108
0.0633891
0.0623504
0.0613079
0.0602725
0.0592535
0.0582585
0.0572938
0.0563643
0.0554738
0.0546249
0.0538195
0.0530583
0.0523412
0.0516677
0.0510364
0.0504456
0.0498933
0.0493771
0.0488946
0.0484434
0.048021
0.0476252
0.0472537
0.0469045
0.0465758
0.046266
0.0459736
0.0456973
0.0454358
0.0451882
0.0449536
0.0447311
0.0445199
0.0443194
0.0441288
0.0439477
0.0437754
0.0436115
0.0434555
0.0433068
0.0431653
0.0430306
0.0429022
0.0427799
0.0426636
0.0425528
0.0424474
0.0423472
0.0422519
0.0421612
0.0420748
0.0419927
0.0419146
0.0418401
0.0417688
0.0417008
0.0416358
0.0415732
0.0415123
0.0414528
0.041394
0.0413352
0.041276
0.0412152
0.0411528
0.0410873
0.0410217
0.0409495
0.0408806
0.0407892
0.0407163
0.040628
0.040504
0.0695329
0.0692731
0.0689128
0.0684616
0.0679314
0.0673344
0.0666829
0.0659885
0.0652622
0.0645139
0.0637529
0.0629877
0.0622254
0.0614726
0.0607348
0.0600164
0.0593212
0.058652
0.0580106
0.0573983
0.0568157
0.0562628
0.055739
0.0552436
0.0547754
0.0543332
0.0539155
0.0535208
0.0531477
0.0527949
0.0524609
0.0521445
0.0518445
0.0515599
0.0512896
0.0510328
0.0507886
0.0505563
0.0503351
0.0501245
0.0499238
0.0497324
0.0495498
0.0493756
0.0492093
0.0490504
0.0488986
0.0487536
0.0486151
0.0484828
0.0483565
0.0482359
0.0481209
0.0480112
0.0479067
0.047807
0.0477119
0.0476212
0.0475348
0.0474525
0.0473738
0.0472984
0.0472263
0.0471572
0.0470904
0.0470253
0.0469615
0.046898
0.0468343
0.0467699
0.0467037
0.0466353
0.0465637
0.0464908
0.0464118
0.0463334
0.0462371
0.0461537
0.0460562
0.045921
0.0697752
0.0696569
0.0694677
0.0692101
0.0688889
0.0685106
0.0680821
0.0676109
0.0671046
0.0665706
0.0660161
0.065448
0.0648723
0.0642949
0.0637208
0.0631542
0.0625988
0.0620575
0.0615326
0.0610257
0.0605379
0.06007
0.059622
0.059194
0.0587856
0.0583962
0.0580252
0.0576718
0.0573353
0.0570147
0.0567094
0.0564185
0.0561413
0.0558769
0.0556247
0.0553841
0.0551544
0.0549349
0.0547252
0.0545248
0.054333
0.0541495
0.0539738
0.0538055
0.0536442
0.0534896
0.0533414
0.0531993
0.0530631
0.0529327
0.0528078
0.0526882
0.0525738
0.0524644
0.0523598
0.0522599
0.0521644
0.052073
0.0519858
0.0519026
0.0518228
0.0517463
0.051673
0.0516025
0.0515341
0.0514673
0.0514015
0.0513358
0.0512696
0.0512023
0.0511329
0.0510609
0.0509856
0.050908
0.0508246
0.0507399
0.0506407
0.0505499
0.0504463
0.0503043
0.0699237
0.0698967
0.0698173
0.069685
0.0695013
0.0692692
0.0689928
0.068677
0.0683269
0.0679481
0.0675462
0.0671266
0.0666945
0.0662548
0.0658117
0.0653692
0.0649304
0.0644981
0.0640745
0.0636614
0.06326
0.0628712
0.0624957
0.0621338
0.0617855
0.0614508
0.0611295
0.0608214
0.0605261
0.0602432
0.0599723
0.0597128
0.0594644
0.0592265
0.0589986
0.0587803
0.058571
0.0583704
0.058178
0.0579933
0.057816
0.0576456
0.0574818
0.0573243
0.0571728
0.057027
0.0568867
0.0567517
0.0566218
0.056497
0.056377
0.0562618
0.0561512
0.0560452
0.0559436
0.0558462
0.0557528
0.0556633
0.0555777
0.0554957
0.0554171
0.0553414
0.0552688
0.0551986
0.0551304
0.0550635
0.0549973
0.054931
0.0548639
0.0547954
0.0547245
0.0546506
0.0545733
0.0544929
0.0544069
0.0543183
0.0542175
0.0541217
0.0540142
0.0538685
0.0700047
0.0700397
0.0700343
0.0699868
0.069897
0.069766
0.0695961
0.0693902
0.0691522
0.0688862
0.0685967
0.0682881
0.0679647
0.0676306
0.0672896
0.066945
0.0665997
0.0662562
0.0659164
0.0655821
0.0652545
0.0649346
0.0646231
0.0643207
0.0640276
0.0637441
0.0634702
0.0632061
0.0629515
0.0627065
0.0624708
0.0622441
0.0620262
0.0618167
0.0616154
0.0614218
0.0612356
0.0610565
0.060884
0.0607179
0.0605577
0.0604032
0.0602542
0.0601102
0.0599711
0.0598367
0.0597068
0.0595813
0.0594602
0.0593432
0.0592304
0.0591217
0.059017
0.0589162
0.0588193
0.0587261
0.0586365
0.0585505
0.0584679
0.0583886
0.0583123
0.0582388
0.0581679
0.0580993
0.0580323
0.0579664
0.057901
0.0578352
0.0577683
0.0576996
0.0576284
0.0575538
0.0574756
0.0573938
0.0573065
0.0572156
0.0571142
0.0570151
0.0569053
0.0567584
0.0700359
0.0701137
0.0701591
0.07017
0.0701454
0.0700852
0.0699905
0.0698633
0.0697061
0.0695224
0.0693156
0.0690895
0.0688477
0.0685939
0.0683313
0.0680628
0.067791
0.067518
0.0672457
0.0669757
0.066709
0.0664468
0.0661897
0.0659384
0.0656935
0.0654552
0.0652238
0.0649996
0.0647826
0.0645728
0.0643703
0.0641749
0.0639864
0.0638048
0.0636296
0.0634607
0.0632978
0.0631405
0.0629886
0.0628417
0.0626996
0.062562
0.0624286
0.0622993
0.0621738
0.0620519
0.0619337
0.0618189
0.0617076
0.0615997
0.0614952
0.0613941
0.0612963
0.0612018
0.0611106
0.0610225
0.0609376
0.0608558
0.060777
0.0607011
0.0606279
0.0605572
0.0604888
0.0604223
0.0603572
0.0602929
0.0602288
0.0601641
0.060098
0.0600299
0.0599591
0.0598846
0.0598064
0.0597241
0.0596363
0.0595443
0.059443
0.0593419
0.0592309
0.0590845
0.0700305
0.070138
0.0702184
0.0702695
0.07029
0.0702793
0.0702377
0.0701665
0.0700676
0.0699435
0.0697974
0.0696324
0.0694517
0.0692585
0.0690556
0.0688457
0.0686309
0.0684134
0.0681947
0.0679761
0.0677589
0.0675439
0.0673319
0.0671235
0.0669193
0.0667197
0.066525
0.0663355
0.0661515
0.0659731
0.0658003
0.0656332
0.0654717
0.0653155
0.0651647
0.0650189
0.0648778
0.0647413
0.064609
0.0644807
0.0643562
0.0642351
0.0641172
0.0640024
0.0638905
0.0637814
0.063675
0.0635712
0.0634701
0.0633716
0.0632757
0.0631825
0.0630919
0.0630041
0.0629188
0.0628363
0.0627563
0.062679
0.0626043
0.062532
0.0624621
0.0623944
0.0623286
0.0622645
0.0622015
0.062139
0.0620764
0.0620131
0.0619482
0.0618811
0.0618109
0.0617371
0.0616593
0.0615772
0.0614895
0.0613971
0.0612964
0.0611942
0.0610826
0.0609378
0.0699987
0.0701272
0.0702316
0.0703101
0.0703614
0.0703847
0.07038
0.0703482
0.0702906
0.0702096
0.0701075
0.0699873
0.0698519
0.069704
0.0695463
0.069381
0.0692104
0.0690361
0.0688595
0.068682
0.0685044
0.0683277
0.0681526
0.0679796
0.0678092
0.067642
0.0674782
0.0673183
0.0671626
0.0670111
0.0668641
0.0667216
0.0665837
0.0664501
0.0663208
0.0661955
0.0660742
0.0659565
0.0658421
0.0657309
0.0656225
0.0655167
0.0654134
0.0653124
0.0652134
0.0651164
0.0650213
0.0649281
0.0648368
0.0647474
0.0646599
0.0645744
0.064491
0.0644095
0.0643302
0.064253
0.0641778
0.0641048
0.064034
0.0639653
0.0638986
0.0638337
0.0637704
0.0637085
0.0636475
0.0635868
0.0635258
0.0634638
0.0634001
0.063334
0.0632648
0.0631918
0.0631147
0.063033
0.0629459
0.0628536
0.0627536
0.0626508
0.0625392
0.0623967
0.0699483
0.0700921
0.0702132
0.0703103
0.0703822
0.0704283
0.0704486
0.0704437
0.0704148
0.0703639
0.0702932
0.0702053
0.0701029
0.0699885
0.0698645
0.0697331
0.0695962
0.0694553
0.0693118
0.0691667
0.0690208
0.068875
0.0687298
0.0685857
0.0684433
0.068303
0.0681651
0.0680299
0.0678979
0.0677693
0.0676441
0.0675226
0.0674047
0.0672904
0.0671796
0.0670722
0.066968
0.0668666
0.066768
0.0666718
0.0665778
0.0664858
0.0663956
0.0663069
0.0662197
0.0661338
0.0660491
0.0659657
0.0658834
0.0658025
0.0657228
0.0656445
0.0655675
0.0654921
0.0654181
0.0653458
0.0652751
0.065206
0.0651387
0.0650731
0.0650092
0.0649467
0.0648856
0.0648256
0.0647662
0.064707
0.0646473
0.0645865
0.0645239
0.0644588
0.0643905
0.0643183
0.0642419
0.0641609
0.0640744
0.0639825
0.0638833
0.0637803
0.0636689
0.063529
0.0698851
0.0700407
0.0701738
0.0702835
0.0703691
0.0704301
0.0704667
0.0704794
0.0704696
0.070439
0.0703899
0.0703245
0.0702454
0.0701551
0.0700559
0.0699496
0.0698382
0.0697229
0.069605
0.0694853
0.0693647
0.0692437
0.0691228
0.0690024
0.068883
0.068765
0.0686485
0.0685341
0.068422
0.0683124
0.0682055
0.0681016
0.0680006
0.0679025
0.0678074
0.067715
0.0676252
0.0675379
0.0674527
0.0673694
0.0672878
0.0672077
0.0671289
0.0670511
0.0669742
0.066898
0.0668226
0.0667479
0.0666738
0.0666003
0.0665276
0.0664557
0.0663846
0.0663144
0.0662452
0.0661772
0.0661102
0.0660445
0.0659801
0.0659171
0.0658554
0.0657949
0.0657354
0.0656768
0.0656186
0.0655605
0.0655017
0.0654418
0.06538
0.0653157
0.0652481
0.0651766
0.0651009
0.0650205
0.0649346
0.0648433
0.0647449
0.064642
0.0645309
0.0643937
0.0698128
0.0699784
0.0701208
0.0702394
0.0703341
0.0704046
0.0704513
0.0704751
0.0704772
0.0704595
0.0704243
0.0703737
0.0703104
0.0702367
0.0701548
0.0700667
0.0699738
0.0698777
0.0697793
0.0696794
0.0695786
0.0694775
0.0693763
0.0692753
0.0691749
0.0690753
0.0689769
0.0688798
0.0687843
0.0686908
0.0685993
0.0685101
0.0684232
0.0683387
0.0682566
0.0681768
0.0680991
0.0680235
0.0679495
0.0678771
0.067806
0.067736
0.0676669
0.0675983
0.0675303
0.0674626
0.0673952
0.067328
0.0672609
0.067194
0.0671273
0.0670609
0.0669948
0.0669292
0.066864
0.0667995
0.0667356
0.0666726
0.0666105
0.0665494
0.0664892
0.06643
0.0663716
0.0663138
0.0662564
0.0661988
0.0661405
0.066081
0.0660197
0.0659558
0.0658887
0.0658178
0.0657426
0.0656627
0.0655775
0.0654866
0.065389
0.0652863
0.0651756
0.0650412
0.0697344
0.0699091
0.0700593
0.0701849
0.0702858
0.0703623
0.070415
0.0704451
0.070454
0.0704438
0.0704166
0.0703749
0.0703213
0.0702581
0.0701875
0.0701115
0.0700316
0.0699492
0.0698651
0.0697802
0.0696947
0.0696092
0.0695238
0.0694387
0.069354
0.0692699
0.0691865
0.0691041
0.0690228
0.0689429
0.0688644
0.0687877
0.0687128
0.0686397
0.0685686
0.0684992
0.0684317
0.0683657
0.0683011
0.0682378
0.0681754
0.0681138
0.0680528
0.067992
0.0679315
0.0678709
0.0678103
0.0677494
0.0676884
0.067627
0.0675655
0.0675037
0.0674418
0.0673798
0.0673179
0.0672562
0.0671947
0.0671337
0.0670732
0.0670133
0.0669541
0.0668955
0.0668375
0.06678
0.0667226
0.0666651
0.0666068
0.0665473
0.066486
0.0664222
0.0663553
0.0662846
0.0662098
0.0661303
0.0660456
0.0659553
0.0658583
0.065756
0.0656458
0.065514
0.0696514
0.0698352
0.0699927
0.0701242
0.0702298
0.0703103
0.0703665
0.0703998
0.070412
0.0704052
0.0703818
0.0703444
0.0702956
0.070238
0.0701739
0.0701051
0.0700333
0.0699599
0.0698857
0.0698113
0.0697373
0.0696637
0.0695907
0.0695183
0.0694464
0.0693752
0.0693047
0.0692348
0.0691657
0.0690975
0.0690304
0.0689644
0.0688998
0.0688366
0.0687747
0.0687143
0.0686553
0.0685974
0.0685407
0.0684849
0.0684298
0.0683752
0.0683209
0.0682667
0.0682124
0.0681578
0.0681028
0.0680473
0.0679913
0.0679346
0.0678772
0.0678193
0.0677608
0.0677018
0.0676425
0.0675829
0.0675231
0.0674633
0.0674038
0.0673445
0.0672856
0.067227
0.0671688
0.0671109
0.0670531
0.066995
0.0669362
0.0668762
0.0668145
0.0667504
0.0666833
0.0666126
0.066538
0.0664587
0.0663744
0.0662845
0.0661883
0.0660864
0.0659768
0.0658476
0.0695649
0.0697582
0.0699231
0.0700602
0.07017
0.0702535
0.0703117
0.0703464
0.0703595
0.0703534
0.0703308
0.0702943
0.0702468
0.0701909
0.0701291
0.0700634
0.0699957
0.0699271
0.0698587
0.0697912
0.0697248
0.0696597
0.069596
0.0695335
0.069472
0.0694114
0.0693515
0.0692924
0.0692339
0.069176
0.0691189
0.0690625
0.069007
0.0689525
0.0688989
0.0688463
0.0687946
0.0687438
0.0686938
0.0686444
0.0685954
0.0685468
0.0684981
0.0684494
0.0684003
0.0683507
0.0683005
0.0682494
0.0681975
0.0681447
0.0680908
0.068036
0.0679803
0.0679236
0.0678662
0.0678081
0.0677494
0.0676904
0.0676312
0.0675719
0.0675127
0.0674535
0.0673946
0.0673358
0.0672769
0.0672177
0.0671578
0.0670969
0.0670343
0.0669695
0.0669019
0.0668309
0.0667562
0.066677
0.0665929
0.0665035
0.0664079
0.0663066
0.0661977
0.0660712
0.0694755
0.069679
0.0698518
0.0699948
0.0701087
0.0701948
0.0702545
0.0702896
0.0703023
0.0702953
0.0702714
0.0702335
0.0701846
0.0701275
0.0700648
0.0699989
0.0699316
0.0698643
0.0697982
0.0697339
0.0696718
0.0696121
0.0695546
0.0694992
0.0694455
0.0693933
0.0693423
0.0692923
0.0692429
0.0691942
0.069146
0.0690983
0.0690511
0.0690045
0.0689584
0.0689129
0.0688679
0.0688234
0.0687794
0.0687357
0.0686921
0.0686486
0.0686049
0.0685608
0.0685162
0.0684709
0.0684247
0.0683774
0.068329
0.0682794
0.0682284
0.0681762
0.0681226
0.0680678
0.0680118
0.0679547
0.0678966
0.0678379
0.0677785
0.0677187
0.0676587
0.0675985
0.0675383
0.067478
0.0674175
0.0673567
0.0672953
0.0672329
0.0671691
0.0671032
0.0670348
0.0669631
0.066888
0.0668087
0.0667248
0.0666358
0.0665408
0.0664402
0.0663322
0.0662084
0.0693834
0.069598
0.0697795
0.0699289
0.0700474
0.0701363
0.0701973
0.0702325
0.0702443
0.0702355
0.0702091
0.0701682
0.0701161
0.0700557
0.0699898
0.0699209
0.0698512
0.0697822
0.0697152
0.069651
0.06959
0.0695325
0.0694783
0.0694273
0.0693789
0.0693329
0.0692887
0.069246
0.0692044
0.0691636
0.0691234
0.0690836
0.0690441
0.0690049
0.0689659
0.0689271
0.0688885
0.06885
0.0688116
0.0687732
0.0687346
0.0686958
0.0686565
0.0686167
0.0685761
0.0685345
0.0684918
0.0684479
0.0684026
0.0683557
0.0683073
0.0682572
0.0682054
0.068152
0.0680971
0.0680407
0.0679829
0.067924
0.0678641
0.0678035
0.0677423
0.0676806
0.0676187
0.0675565
0.0674941
0.0674313
0.0673679
0.0673036
0.067238
0.0671707
0.067101
0.0670285
0.0669528
0.0668733
0.0667894
0.0667007
0.0666064
0.0665066
0.0663997
0.0662786
0.0692889
0.0695156
0.0697066
0.0698632
0.0699868
0.070079
0.0701417
0.0701771
0.0701878
0.0701769
0.0701475
0.0701029
0.0700464
0.0699812
0.0699104
0.0698367
0.0697623
0.0696891
0.0696185
0.0695515
0.0694888
0.0694306
0.0693769
0.0693274
0.0692817
0.0692394
0.0692
0.0691628
0.0691273
0.0690932
0.0690599
0.0690272
0.0689949
0.0689627
0.0689305
0.0688982
0.0688658
0.0688332
0.0688003
0.0687671
0.0687334
0.0686992
0.0686642
0.0686284
0.0685916
0.0685536
0.0685143
0.0684734
0.0684309
0.0683867
0.0683405
0.0682923
0.0682422
0.0681901
0.068136
0.0680801
0.0680225
0.0679633
0.0679027
0.067841
0.0677783
0.0677149
0.067651
0.0675866
0.0675219
0.0674567
0.0673909
0.0673244
0.0672568
0.0671876
0.0671164
0.0670427
0.0669662
0.0668862
0.0668023
0.0667139
0.0666203
0.0665215
0.066416
0.0662977
0.069192
0.0694317
0.0696333
0.069798
0.0699275
0.0700236
0.0700884
0.0701245
0.0701345
0.0701215
0.070089
0.0700403
0.0699789
0.0699083
0.0698315
0.0697515
0.0696708
0.0695915
0.0695152
0.0694431
0.069376
0.0693144
0.0692584
0.0692078
0.0691622
0.0691212
0.0690841
0.0690503
0.0690192
0.0689901
0.0689625
0.068936
0.06891
0.0688843
0.0688586
0.0688327
0.0688065
0.0687798
0.0687526
0.0687247
0.0686961
0.0686665
0.068636
0.0686043
0.0685714
0.068537
0.068501
0.0684633
0.0684236
0.0683819
0.068338
0.0682919
0.0682434
0.0681925
0.0681394
0.0680839
0.0680264
0.0679669
0.0679056
0.0678427
0.0677786
0.0677134
0.0676473
0.0675806
0.0675133
0.0674455
0.0673771
0.0673081
0.0672381
0.0671668
0.0670938
0.0670187
0.0669411
0.0668605
0.0667765
0.0666884
0.0665955
0.0664979
0.066394
0.0662787
0.0690925
0.0693465
0.0695596
0.0697334
0.0698696
0.0699704
0.0700381
0.0700754
0.0700851
0.0700705
0.0700351
0.0699824
0.069916
0.0698396
0.0697563
0.0696693
0.0695812
0.0694944
0.0694108
0.0693316
0.0692581
0.0691908
0.06913
0.0690757
0.0690276
0.0689852
0.0689481
0.0689154
0.0688865
0.0688607
0.0688372
0.0688155
0.0687949
0.068775
0.0687553
0.0687355
0.0687154
0.0686947
0.0686733
0.0686509
0.0686276
0.0686031
0.0685773
0.0685501
0.0685213
0.0684908
0.0684584
0.068424
0.0683874
0.0683485
0.0683071
0.0682631
0.0682165
0.0681672
0.0681151
0.0680604
0.0680032
0.0679435
0.0678817
0.0678179
0.0677523
0.0676854
0.0676172
0.0675481
0.0674782
0.0674078
0.0673367
0.067265
0.0671924
0.0671188
0.0670439
0.0669672
0.0668884
0.0668071
0.0667228
0.066635
0.066543
0.0664466
0.0663446
0.0662325
0.0689903
0.0692598
0.0694855
0.0696693
0.0698133
0.0699196
0.0699909
0.07003
0.0700401
0.0700244
0.0699865
0.0699302
0.0698592
0.069777
0.0696871
0.0695927
0.0694967
0.0694016
0.0693095
0.069222
0.0691403
0.0690654
0.0689976
0.0689373
0.0688842
0.068838
0.0687983
0.0687643
0.0687353
0.0687107
0.0686894
0.0686709
0.0686543
0.0686391
0.0686246
0.0686105
0.0685961
0.0685813
0.0685657
0.0685492
0.0685314
0.0685123
0.0684916
0.0684693
0.0684451
0.068419
0.0683907
0.0683601
0.0683271
0.0682914
0.0682529
0.0682115
0.0681672
0.0681197
0.0680692
0.0680157
0.0679591
0.0678998
0.0678377
0.0677733
0.0677068
0.0676383
0.0675684
0.0674971
0.0674249
0.0673518
0.067278
0.0672036
0.0671285
0.0670526
0.0669756
0.0668971
0.0668171
0.066735
0.0666505
0.066563
0.0664719
0.066377
0.0662772
0.0661684
0.0688854
0.0691716
0.069411
0.0696058
0.0697583
0.0698711
0.0699468
0.0699886
0.0699996
0.0699835
0.0699438
0.0698844
0.0698091
0.0697215
0.0696252
0.0695236
0.0694195
0.0693158
0.0692146
0.0691177
0.0690267
0.0689427
0.0688663
0.0687979
0.0687377
0.0686854
0.0686406
0.0686029
0.0685714
0.0685456
0.0685244
0.0685071
0.0684928
0.0684809
0.0684704
0.0684609
0.0684518
0.0684425
0.0684326
0.0684218
0.0684099
0.0683965
0.0683814
0.0683644
0.0683454
0.0683242
0.0683006
0.0682744
0.0682454
0.0682136
0.0681787
0.0681405
0.068099
0.0680542
0.0680058
0.067954
0.0678988
0.0678403
0.0677788
0.0677143
0.0676473
0.067578
0.0675066
0.0674337
0.0673594
0.0672841
0.0672079
0.0671311
0.0670535
0.0669753
0.0668963
0.0668162
0.0667349
0.0666521
0.0665673
0.0664803
0.0663902
0.0662971
0.0661996
0.0660943
0.0687775
0.0690815
0.0693358
0.0695427
0.0697047
0.0698248
0.0699057
0.0699509
0.0699637
0.0699478
0.069907
0.0698452
0.0697661
0.0696737
0.0695715
0.0694629
0.069351
0.0692386
0.0691281
0.0690215
0.0689206
0.0688264
0.0687401
0.0686622
0.068593
0.0685325
0.0684805
0.0684366
0.0684003
0.0683708
0.0683473
0.068329
0.0683151
0.0683045
0.0682966
0.0682904
0.0682854
0.0682809
0.0682762
0.068271
0.0682648
0.0682573
0.068248
0.0682369
0.0682236
0.0682079
0.0681895
0.0681684
0.0681443
0.068117
0.0680864
0.0680522
0.0680145
0.0679729
0.0679275
0.0678783
0.0678253
0.0677685
0.0677082
0.0676446
0.0675778
0.0675083
0.0674364
0.0673624
0.0672868
0.0672097
0.0671317
0.0670528
0.0669732
0.066893
0.0668122
0.0667306
0.0666483
0.0665648
0.06648
0.0663935
0.0663047
0.0662135
0.0661187
0.066017
0.0686666
0.0689897
0.0692598
0.0694798
0.0696523
0.0697805
0.0698675
0.0699169
0.0699322
0.0699173
0.0698761
0.0698125
0.0697304
0.0696338
0.0695262
0.0694112
0.0692919
0.0691712
0.0690516
0.0689352
0.068824
0.0687192
0.0686222
0.0685336
0.0684541
0.0683837
0.0683227
0.0682706
0.0682271
0.0681916
0.0681635
0.0681418
0.0681258
0.0681145
0.0681071
0.0681027
0.0681003
0.0680994
0.0680991
0.0680988
0.068098
0.0680961
0.0680928
0.0680877
0.0680804
0.0680707
0.0680583
0.0680429
0.0680244
0.0680025
0.067977
0.0679477
0.0679145
0.0678772
0.0678357
0.0677901
0.0677402
0.0676862
0.0676281
0.0675663
0.0675008
0.0674322
0.0673606
0.0672865
0.0672103
0.0671324
0.0670532
0.066973
0.0668919
0.0668103
0.0667282
0.0666455
0.0665624
0.0664786
0.0663941
0.0663084
0.066221
0.066132
0.0660403
0.0659423
0.0685525
0.0688958
0.069183
0.069417
0.0696009
0.069738
0.0698319
0.0698863
0.0699049
0.0698917
0.0698508
0.0697861
0.0697018
0.0696017
0.0694895
0.0693688
0.0692427
0.0691142
0.0689859
0.06886
0.0687385
0.0686231
0.0685149
0.068415
0.0683242
0.0682428
0.0681711
0.0681091
0.0680565
0.0680129
0.0679777
0.0679503
0.0679299
0.0679156
0.0679065
0.0679017
0.0679002
0.0679012
0.0679039
0.0679074
0.0679112
0.0679145
0.0679168
0.0679177
0.0679166
0.0679132
0.0679071
0.0678981
0.0678859
0.0678701
0.0678505
0.067827
0.0677993
0.0677673
0.0677308
0.0676898
0.0676442
0.067594
0.0675394
0.0674805
0.0674176
0.067351
0.0672809
0.0672079
0.0671323
0.0670546
0.0669752
0.0668945
0.0668129
0.0667306
0.0666478
0.0665646
0.0664813
0.0663977
0.0663138
0.0662293
0.0661438
0.0660574
0.0659689
0.0658748
0.0684351
0.0687999
0.0691051
0.0693541
0.0695503
0.0696973
0.0697989
0.0698589
0.0698815
0.0698708
0.0698309
0.069766
0.0696801
0.0695773
0.0694613
0.0693355
0.0692034
0.0690677
0.0689313
0.0687964
0.0686651
0.0685391
0.0684198
0.0683084
0.0682058
0.0681126
0.0680292
0.0679559
0.0678925
0.0678389
0.0677947
0.0677594
0.0677323
0.0677125
0.0676994
0.0676919
0.0676891
0.0676901
0.067694
0.0676999
0.067707
0.0677145
0.0677217
0.067728
0.0677329
0.0677358
0.0677363
0.067734
0.0677285
0.0677195
0.0677067
0.0676898
0.0676686
0.0676428
0.0676124
0.0675771
0.067537
0.0674919
0.067442
0.0673874
0.0673283
0.067265
0.0671979
0.0671272
0.0670535
0.0669773
0.066899
0.066819
0.0667379
0.0666559
0.0665734
0.0664906
0.0664079
0.0663251
0.0662423
0.0661596
0.0660765
0.065993
0.0659083
0.0658182
0.0683146
0.0687018
0.0690262
0.0692911
0.0695005
0.0696581
0.0697681
0.0698346
0.0698619
0.0698543
0.0698161
0.0697516
0.069665
0.0695603
0.0694411
0.0693112
0.0691738
0.0690318
0.068888
0.0687447
0.0686042
0.068468
0.0683379
0.068215
0.0681005
0.0679951
0.0678994
0.0678139
0.0677386
0.0676735
0.0676186
0.0675733
0.0675373
0.0675099
0.0674904
0.0674778
0.0674714
0.0674702
0.0674732
0.0674795
0.0674883
0.0674985
0.0675095
0.0675204
0.0675306
0.0675394
0.0675463
0.0675507
0.0675523
0.0675504
0.0675449
0.0675354
0.0675214
0.0675029
0.0674795
0.0674511
0.0674176
0.0673789
0.067335
0.0672861
0.0672323
0.0671738
0.067111
0.0670442
0.0669739
0.0669006
0.0668248
0.066747
0.0666676
0.0665872
0.0665062
0.0664248
0.0663435
0.0662624
0.0661817
0.0661013
0.0660212
0.0659413
0.0658606
0.0657747
0.0681912
0.0686019
0.0689462
0.0692281
0.0694514
0.0696204
0.0697395
0.0698131
0.0698458
0.069842
0.0698063
0.0697429
0.0696562
0.0695502
0.0694288
0.0692955
0.0691536
0.0690061
0.0688557
0.0687049
0.0685558
0.0684102
0.0682697
0.0681358
0.0680095
0.0678919
0.0677837
0.0676854
0.0675974
0.0675198
0.0674527
0.067396
0.0673493
0.0673122
0.067284
0.0672641
0.0672517
0.0672458
0.0672457
0.0672503
0.0672586
0.0672698
0.0672829
0.067297
0.0673114
0.0673253
0.067338
0.0673488
0.0673573
0.0673627
0.0673648
0.067363
0.067357
0.0673464
0.067331
0.0673105
0.0672847
0.0672536
0.067217
0.0671752
0.067128
0.0670758
0.0670189
0.0669576
0.0668923
0.0668235
0.0667518
0.0666776
0.0666016
0.0665242
0.0664459
0.0663672
0.0662885
0.0662102
0.0661324
0.0660553
0.0659788
0.0659031
0.0658271
0.0657455
0.068065
0.0685002
0.0688655
0.0691649
0.069403
0.0695841
0.069713
0.0697944
0.069833
0.0698337
0.069801
0.0697395
0.0696534
0.0695469
0.0694239
0.069288
0.0691425
0.0689903
0.0688342
0.0686767
0.0685198
0.0683655
0.0682154
0.0680709
0.0679334
0.0678039
0.0676832
0.067572
0.0674708
0.0673801
0.0673
0.0672306
0.0671717
0.0671232
0.0670845
0.0670551
0.0670344
0.0670216
0.0670159
0.0670163
0.067022
0.067032
0.0670452
0.0670608
0.0670779
0.0670955
0.067113
0.0671294
0.0671442
0.0671567
0.0671662
0.0671724
0.0671746
0.0671725
0.0671656
0.0671538
0.0671368
0.0671143
0.0670862
0.0670527
0.0670136
0.0669692
0.0669197
0.0668654
0.0668067
0.0667441
0.0666781
0.0666092
0.0665381
0.0664652
0.0663912
0.0663166
0.066242
0.0661676
0.0660938
0.066021
0.0659491
0.0658783
0.0658076
0.0657305
0.0679369
0.0683973
0.0687843
0.0691021
0.0693555
0.0695493
0.0696886
0.0697783
0.0698236
0.0698292
0.0698002
0.069741
0.0696562
0.0695499
0.0694261
0.0692883
0.0691399
0.0689839
0.068823
0.0686596
0.0684958
0.0683336
0.0681747
0.0680205
0.0678724
0.0677314
0.0675986
0.0674747
0.0673604
0.0672563
0.0671626
0.0670797
0.0670076
0.0669463
0.0668954
0.0668548
0.0668238
0.0668018
0.0667883
0.0667822
0.0667829
0.0667892
0.0668004
0.0668153
0.0668331
0.0668528
0.0668735
0.0668943
0.0669145
0.0669332
0.0669497
0.0669635
0.0669739
0.0669804
0.0669825
0.0669799
0.0669722
0.0669592
0.0669407
0.0669165
0.0668868
0.0668515
0.0668108
0.0667651
0.0667146
0.0666598
0.0666012
0.0665393
0.0664748
0.0664081
0.06634
0.066271
0.0662018
0.0661327
0.0660642
0.0659968
0.0659304
0.0658654
0.0658006
0.0657285
0.0678076
0.0682941
0.0687033
0.0690401
0.0693094
0.0695164
0.0696666
0.0697651
0.0698174
0.0698285
0.0698036
0.0697474
0.0696644
0.0695589
0.0694349
0.069296
0.0691456
0.0689865
0.0688216
0.0686531
0.0684834
0.0683142
0.0681473
0.0679842
0.0678262
0.0676745
0.0675302
0.067394
0.0672669
0.0671494
0.067042
0.0669452
0.0668592
0.0667842
0.06672
0.0666666
0.0666236
0.0665906
0.066567
0.0665523
0.0665455
0.0665459
0.0665526
0.0665646
0.0665809
0.0666006
0.0666226
0.0666461
0.0666702
0.0666939
0.0667165
0.0667371
0.0667552
0.0667701
0.0667812
0.066788
0.06679
0.066787
0.0667787
0.0667649
0.0667454
0.0667204
0.0666898
0.066654
0.0666132
0.0665677
0.0665181
0.0664649
0.0664086
0.0663498
0.0662892
0.0662274
0.0661651
0.0661027
0.0660409
0.06598
0.0659202
0.065862
0.0658038
0.065737
0.0676789
0.0681917
0.0686237
0.0689798
0.0692654
0.069486
0.0696473
0.069755
0.0698147
0.0698317
0.0698113
0.0697585
0.0696778
0.0695737
0.0694501
0.0693107
0.0691589
0.0689975
0.0688294
0.0686568
0.068482
0.0683068
0.0681328
0.0679617
0.0677947
0.0676331
0.0674779
0.0673301
0.0671906
0.0670601
0.0669392
0.0668285
0.0667283
0.066639
0.0665607
0.0664934
0.0664371
0.0663914
0.0663561
0.0663306
0.0663142
0.0663064
0.0663062
0.0663128
0.0663253
0.0663426
0.0663639
0.066388
0.0664141
0.0664412
0.0664684
0.0664948
0.0665197
0.0665422
0.0665618
0.0665777
0.0665895
0.0665967
0.0665989
0.0665959
0.0665875
0.0665736
0.0665542
0.0665294
0.0664995
0.0664648
0.0664256
0.0663825
0.066336
0.0662867
0.0662352
0.0661821
0.0661282
0.066074
0.0660202
0.0659671
0.0659152
0.0658646
0.0658139
0.0657528
0.0675525
0.068092
0.068547
0.0689226
0.0692246
0.069459
0.0696317
0.0697488
0.069816
0.0698392
0.0698236
0.0697744
0.0696965
0.0695941
0.0694715
0.0693322
0.0691796
0.0690166
0.068846
0.0686702
0.0684911
0.0683107
0.0681306
0.0679524
0.0677773
0.0676067
0.0674415
0.0672829
0.0671317
0.0669887
0.0668547
0.0667303
0.066616
0.0665122
0.0664194
0.0663376
0.066267
0.0662075
0.0661589
0.0661209
0.0660931
0.0660749
0.0660656
0.0660644
0.0660706
0.0660833
0.0661013
0.0661239
0.0661499
0.0661783
0.0662083
0.0662389
0.0662691
0.0662981
0.0663252
0.0663496
0.0663707
0.0663878
0.0664006
0.0664086
0.0664116
0.0664094
0.0664018
0.066389
0.066371
0.0663481
0.0663206
0.066289
0.0662536
0.0662152
0.0661742
0.0661314
0.0660874
0.0660428
0.0659982
0.0659543
0.0659112
0.0658694
0.0658271
0.0657721
0.0674308
0.0679971
0.068475
0.0688701
0.0691886
0.0694367
0.0696207
0.0697472
0.0698221
0.0698514
0.0698408
0.0697955
0.0697205
0.0696203
0.069499
0.0693602
0.0692074
0.0690435
0.0688711
0.0686926
0.0685101
0.0683254
0.0681401
0.0679557
0.0677735
0.0675948
0.0674206
0.067252
0.0670899
0.0669352
0.0667887
0.066651
0.0665229
0.0664049
0.0662974
0.0662008
0.0661153
0.0660412
0.0659782
0.0659265
0.0658855
0.0658551
0.0658347
0.0658237
0.0658214
0.0658268
0.0658393
0.0658578
0.0658813
0.0659089
0.0659396
0.0659723
0.0660061
0.0660401
0.0660733
0.066105
0.0661344
0.0661609
0.0661837
0.0662025
0.0662168
0.0662264
0.0662311
0.0662307
0.0662253
0.066215
0.0662001
0.066181
0.066158
0.0661317
0.0661026
0.0660713
0.0660385
0.0660048
0.0659708
0.0659371
0.0659041
0.065872
0.0658389
0.0657908
0.0673161
0.067909
0.0684097
0.0688241
0.0691588
0.0694204
0.0696157
0.0697513
0.0698337
0.0698692
0.0698635
0.0698222
0.0697503
0.0696524
0.0695326
0.0693948
0.0692422
0.0690779
0.0689043
0.068724
0.0685387
0.0683505
0.0681608
0.0679711
0.0677828
0.0675969
0.0674146
0.067237
0.0670649
0.0668994
0.0667411
0.0665909
0.0664495
0.0663176
0.0661957
0.0660843
0.0659838
0.0658945
0.0658165
0.0657499
0.0656947
0.0656507
0.0656175
0.0655946
0.0655816
0.0655777
0.0655822
0.0655942
0.0656129
0.0656372
0.0656661
0.0656988
0.065734
0.065771
0.0658086
0.0658461
0.0658825
0.065917
0.0659491
0.0659779
0.0660032
0.0660243
0.066041
0.0660532
0.0660607
0.0660636
0.0660619
0.0660561
0.0660463
0.0660331
0.0660168
0.0659982
0.0659777
0.0659561
0.0659339
0.0659116
0.0658897
0.0658684
0.0658453
0.0658045
0.0672095
0.067829
0.0683524
0.068786
0.0691365
0.0694113
0.0696174
0.0697619
0.0698516
0.069893
0.0698922
0.0698548
0.069786
0.0696905
0.0695726
0.0694359
0.069284
0.0691196
0.0689454
0.0687637
0.0685765
0.0683855
0.0681922
0.0679982
0.0678045
0.0676125
0.0674231
0.0672374
0.0670563
0.0668808
0.0667117
0.0665498
0.0663958
0.0662506
0.0661147
0.0659888
0.0658734
0.0657688
0.0656755
0.0655936
0.0655232
0.0654644
0.065417
0.0653807
0.0653552
0.0653399
0.0653342
0.0653375
0.0653488
0.0653674
0.0653922
0.0654223
0.0654567
0.0654944
0.0655344
0.0655756
0.0656173
0.0656584
0.0656983
0.0657361
0.0657713
0.0658033
0.0658316
0.0658561
0.0658764
0.0658925
0.0659043
0.0659122
0.0659162
0.0659167
0.0659141
0.065909
0.0659018
0.0658932
0.0658837
0.0658738
0.065864
0.0658543
0.0658421
0.0658092
0.0671113
0.0677576
0.0683035
0.0687559
0.0691221
0.0694097
0.0696263
0.0697794
0.069876
0.0699231
0.0699269
0.0698933
0.0698276
0.0697346
0.0696186
0.0694834
0.0693323
0.0691683
0.068994
0.0688115
0.0686229
0.0684298
0.0682338
0.0680361
0.0678381
0.0676408
0.0674453
0.0672526
0.0670635
0.0668791
0.0667001
0.0665273
0.0663617
0.066204
0.0660548
0.0659149
0.0657849
0.0656652
0.0655565
0.065459
0.065373
0.0652986
0.065236
0.0651851
0.0651456
0.0651172
0.0650994
0.0650918
0.0650935
0.065104
0.0651222
0.0651473
0.0651784
0.0652144
0.0652544
0.0652972
0.0653421
0.0653879
0.0654339
0.0654791
0.0655229
0.0655646
0.0656037
0.0656397
0.0656723
0.0657013
0.0657265
0.0657481
0.0657661
0.0657807
0.0657923
0.0658012
0.0658081
0.0658132
0.0658172
0.0658206
0.0658236
0.0658264
0.0658258
0.0658012
0.0670202
0.0676934
0.068262
0.0687332
0.0691149
0.0694151
0.0696419
0.0698032
0.0699065
0.0699591
0.0699673
0.0699374
0.0698747
0.0697842
0.0696702
0.0695366
0.0693867
0.0692234
0.0690494
0.0688667
0.0686772
0.0684828
0.0682847
0.0680842
0.0678827
0.0676811
0.0674804
0.0672816
0.0670856
0.0668933
0.0667055
0.066523
0.0663467
0.0661773
0.0660157
0.0658626
0.0657185
0.0655843
0.0654604
0.0653474
0.0652456
0.0651554
0.065077
0.0650104
0.0649558
0.0649129
0.0648814
0.064861
0.0648511
0.0648512
0.0648605
0.0648782
0.0649035
0.0649353
0.0649728
0.0650148
0.0650605
0.0651088
0.0651589
0.0652096
0.0652604
0.0653103
0.0653588
0.0654053
0.0654492
0.0654904
0.0655285
0.0655635
0.0655953
0.065624
0.0656499
0.0656732
0.0656944
0.0657138
0.0657319
0.0657491
0.0657657
0.0657816
0.0657933
0.0657775
0.0669336
0.0676342
0.0682258
0.0687159
0.069113
0.0694257
0.0696626
0.069832
0.0699419
0.0699997
0.0700123
0.0699859
0.0699263
0.0698383
0.0697264
0.0695946
0.0694461
0.0692839
0.0691105
0.068928
0.0687384
0.0685431
0.0683437
0.0681413
0.0679371
0.0677321
0.0675272
0.0673234
0.0671215
0.0669224
0.0667269
0.0665357
0.0663498
0.06617
0.0659969
0.0658314
0.0656743
0.0655261
0.0653876
0.0652595
0.0651421
0.0650359
0.0649415
0.0648589
0.0647883
0.0647298
0.0646833
0.0646486
0.0646254
0.0646132
0.0646114
0.0646194
0.0646364
0.0646616
0.0646941
0.0647328
0.0647768
0.0648252
0.064877
0.0649311
0.0649868
0.0650431
0.0650993
0.0651548
0.0652088
0.0652611
0.0653112
0.0653588
0.0654039
0.0654464
0.0654865
0.0655241
0.0655598
0.0655937
0.0656262
0.0656576
0.0656883
0.0657179
0.0657422
0.0657357
0.0668484
0.0675771
0.068192
0.0687014
0.0691142
0.0694394
0.0696864
0.0698639
0.0699802
0.0700433
0.0700602
0.0700374
0.0699808
0.0698954
0.0697858
0.0696559
0.0695091
0.0693483
0.0691759
0.0689942
0.0688048
0.0686094
0.0684093
0.0682057
0.0679996
0.0677921
0.067584
0.0673762
0.0671696
0.0669648
0.0667627
0.0665641
0.0663698
0.0661806
0.0659973
0.0658206
0.0656513
0.0654902
0.0653379
0.0651953
0.0650628
0.0649411
0.0648306
0.0647318
0.0646449
0.0645703
0.0645079
0.0644577
0.0644197
0.0643935
0.0643788
0.064375
0.0643816
0.0643977
0.0644226
0.0644555
0.0644954
0.0645414
0.0645924
0.0646475
0.0647058
0.0647663
0.0648283
0.0648909
0.0649534
0.0650154
0.0650761
0.0651354
0.065193
0.0652486
0.0653022
0.0653539
0.0654038
0.0654521
0.0654991
0.065545
0.06559
0.0656335
0.065671
0.065674
0.0667615
0.0675189
0.0681577
0.0686868
0.0691155
0.0694537
0.0697109
0.0698966
0.0700195
0.0700879
0.0701091
0.07009
0.0700365
0.0699538
0.0698467
0.0697189
0.069574
0.0694149
0.0692439
0.0690632
0.0688747
0.0686796
0.0684795
0.0682754
0.0680683
0.0678592
0.0676488
0.067438
0.0672276
0.0670183
0.0668109
0.0666061
0.0664046
0.0662074
0.066015
0.0658283
0.0656482
0.0654752
0.0653103
0.0651541
0.0650074
0.0648707
0.0647447
0.0646299
0.0645268
0.0644357
0.064357
0.0642906
0.0642368
0.0641954
0.0641661
0.0641488
0.0641428
0.0641478
0.0641629
0.0641875
0.0642207
0.0642617
0.0643094
0.064363
0.0644214
0.0644838
0.0645493
0.0646169
0.064686
0.0647558
0.0648257
0.0648953
0.064964
0.0650317
0.0650981
0.0651632
0.0652269
0.0652894
0.0653507
0.065411
0.0654703
0.065528
0.0655787
0.0655915
0.0666702
0.0674569
0.0681203
0.0686696
0.0691147
0.069466
0.0697338
0.0699279
0.0700576
0.0701314
0.0701571
0.0701418
0.0700915
0.0700118
0.0699072
0.0697818
0.069639
0.0694818
0.0693125
0.0691334
0.068946
0.0687519
0.0685523
0.0683484
0.068141
0.067931
0.0677192
0.0675064
0.0672933
0.0670806
0.0668689
0.0666591
0.0664518
0.0662478
0.0660477
0.0658525
0.0656627
0.0654793
0.065303
0.0651345
0.0649745
0.0648239
0.0646832
0.0645531
0.0644342
0.0643269
0.0642317
0.0641489
0.0640786
0.0640211
0.0639762
0.0639439
0.0639238
0.0639157
0.0639189
0.063933
0.0639571
0.0639905
0.0640324
0.0640819
0.0641379
0.0641997
0.0642662
0.0643366
0.06441
0.0644857
0.0645629
0.064641
0.0647195
0.0647979
0.064876
0.0649534
0.0650302
0.0651061
0.0651813
0.0652557
0.0653292
0.065401
0.0654651
0.0654875
0.0665726
0.0673891
0.0680776
0.0686476
0.0691097
0.0694746
0.0697533
0.0699561
0.0700927
0.0701722
0.0702026
0.0701912
0.0701443
0.0700675
0.0699657
0.0698428
0.0697023
0.0695473
0.0693801
0.0692027
0.0690169
0.0688242
0.0686256
0.0684223
0.0682152
0.0680051
0.0677927
0.0675788
0.0673639
0.0671487
0.066934
0.0667203
0.0665084
0.0662989
0.0660926
0.0658901
0.0656923
0.0654998
0.0653134
0.065134
0.0649622
0.0647988
0.0646446
0.0645002
0.0643662
0.0642434
0.0641321
0.064033
0.0639462
0.0638722
0.063811
0.0637628
0.0637274
0.0637047
0.0636943
0.0636958
0.0637087
0.0637323
0.0637659
0.0638087
0.0638598
0.0639183
0.0639833
0.064054
0.0641293
0.0642086
0.0642909
0.0643756
0.064462
0.0645496
0.0646379
0.0647265
0.0648152
0.0649038
0.0649921
0.0650801
0.0651674
0.065253
0.0653303
0.0653623
0.0664675
0.0673143
0.0680284
0.0686196
0.069099
0.0694779
0.0697679
0.0699797
0.0701236
0.070209
0.0702442
0.0702369
0.0701935
0.0701199
0.0700208
0.0699006
0.0697626
0.0696099
0.0694449
0.0692696
0.0690857
0.0688946
0.0686974
0.0684953
0.068289
0.0680794
0.067867
0.0676526
0.0674368
0.0672202
0.0670033
0.0667869
0.0665715
0.0663578
0.0661464
0.0659381
0.0657335
0.0655334
0.0653386
0.0651496
0.0649675
0.0647928
0.0646264
0.0644689
0.0643211
0.0641837
0.0640573
0.0639424
0.0638396
0.0637492
0.0636716
0.063607
0.0635555
0.0635172
0.0634918
0.0634792
0.063479
0.0634907
0.0635138
0.0635475
0.0635912
0.0636439
0.0637049
0.0637732
0.063848
0.0639284
0.0640135
0.0641026
0.0641948
0.0642897
0.0643865
0.0644848
0.0645841
0.0646842
0.0647847
0.0648854
0.064986
0.0650849
0.065175
0.0652164
0.0663543
0.0672317
0.0679717
0.0685846
0.0690818
0.0694752
0.0697768
0.069998
0.0701494
0.0702408
0.0702811
0.070278
0.0702382
0.0701678
0.0700717
0.0699542
0.0698188
0.0696685
0.0695058
0.0693327
0.0691509
0.0689617
0.0687662
0.0685656
0.0683605
0.0681518
0.06794
0.0677258
0.0675097
0.0672924
0.0670743
0.066856
0.0666381
0.0664213
0.0662061
0.0659932
0.0657832
0.0655769
0.0653749
0.0651781
0.064987
0.0648026
0.0646254
0.0644564
0.0642962
0.0641455
0.064005
0.0638754
0.0637573
0.0636512
0.0635575
0.0634767
0.0634089
0.0633545
0.0633134
0.0632856
0.0632709
0.0632691
0.0632797
0.0633023
0.0633361
0.0633807
0.063435
0.0634985
0.0635701
0.0636491
0.0637345
0.0638256
0.0639215
0.0640215
0.0641248
0.064231
0.0643394
0.0644495
0.064561
0.0646734
0.0647863
0.0648979
0.0650002
0.0650505
0.0662333
0.0671413
0.0679076
0.0685425
0.0690579
0.0694661
0.0697797
0.0700105
0.0701696
0.0702674
0.0703128
0.070314
0.070278
0.0702108
0.0701177
0.0700029
0.0698701
0.0697223
0.069562
0.0693911
0.0692114
0.0690243
0.0688308
0.0686318
0.0684283
0.0682208
0.06801
0.0677964
0.0675806
0.0673631
0.0671445
0.0669252
0.0667057
0.0664867
0.0662687
0.0660523
0.0658381
0.0656269
0.0654192
0.0652157
0.0650173
0.0648245
0.0646383
0.0644592
0.064288
0.0641255
0.0639725
0.0638295
0.0636972
0.0635764
0.0634674
0.0633709
0.0632873
0.0632168
0.0631597
0.0631161
0.0630862
0.0630696
0.0630664
0.063076
0.0630982
0.0631323
0.0631778
0.0632339
0.0632998
0.0633748
0.063458
0.0635485
0.0636456
0.0637484
0.0638561
0.0639681
0.0640837
0.0642022
0.0643232
0.0644461
0.0645701
0.0646934
0.0648072
0.0648657
0.0661047
0.0670435
0.0678362
0.0684934
0.0690272
0.0694506
0.0697764
0.0700171
0.0701843
0.0702884
0.0703392
0.0703448
0.0703125
0.0702487
0.0701585
0.0700464
0.0699162
0.0697708
0.0696128
0.0694443
0.0692668
0.0690817
0.0688901
0.068693
0.0684911
0.0682851
0.0680756
0.067863
0.0676479
0.0674308
0.0672121
0.0669923
0.066772
0.0665516
0.0663316
0.0661127
0.0658954
0.0656803
0.0654681
0.0652593
0.0650548
0.0648552
0.0646612
0.0644736
0.064293
0.0641203
0.0639561
0.0638012
0.0636562
0.0635219
0.0633989
0.0632877
0.0631889
0.0631029
0.0630302
0.0629709
0.0629253
0.0628935
0.0628755
0.062871
0.06288
0.062902
0.0629365
0.062983
0.0630409
0.0631094
0.0631878
0.0632753
0.063371
0.0634741
0.0635839
0.0636994
0.0638201
0.0639451
0.0640738
0.0642055
0.0643394
0.0644732
0.0645975
0.0646635
0.0659694
0.0669387
0.0677579
0.0684376
0.0689902
0.0694289
0.0697673
0.0700181
0.0701934
0.0703042
0.0703603
0.0703704
0.0703419
0.0702813
0.070194
0.0700847
0.0699569
0.0698139
0.0696582
0.0694918
0.0693165
0.0691334
0.0689439
0.0687486
0.0685485
0.0683441
0.0681359
0.0679245
0.0677104
0.067494
0.0672757
0.0670559
0.0668352
0.066614
0.0663928
0.0661722
0.0659525
0.0657346
0.0655188
0.0653059
0.0650965
0.0648913
0.0646909
0.0644961
0.0643075
0.064126
0.0639522
0.0637869
0.0636307
0.0634844
0.0633486
0.063224
0.0631112
0.0630107
0.062923
0.0628486
0.0627877
0.0627406
0.0627074
0.0626883
0.0626831
0.0626916
0.0627137
0.0627488
0.0627966
0.0628564
0.0629276
0.0630096
0.0631014
0.0632024
0.0633116
0.0634284
0.0635518
0.0636811
0.0638155
0.0639543
0.0640963
0.0642392
0.0643728
0.0644452
0.0658283
0.0668278
0.0676734
0.0683756
0.0689471
0.0694015
0.0697526
0.0700137
0.0701974
0.0703149
0.0703765
0.070391
0.0703663
0.070309
0.0702246
0.0701178
0.0699924
0.0698517
0.0696981
0.0695338
0.0693605
0.0691794
0.0689917
0.0687983
0.0685999
0.0683971
0.0681904
0.0679804
0.0677674
0.0675519
0.0673342
0.0671148
0.0668942
0.0666726
0.0664507
0.0662289
0.0660076
0.0657875
0.0655691
0.0653529
0.0651397
0.0649299
0.0647243
0.0645235
0.0643283
0.0641393
0.0639573
0.063783
0.063617
0.0634602
0.0633131
0.0631765
0.063051
0.0629372
0.0628357
0.0627469
0.0626714
0.0626095
0.0625615
0.0625275
0.0625078
0.0625022
0.0625108
0.0625333
0.0625694
0.0626187
0.0626807
0.0627548
0.0628403
0.0629366
0.0630429
0.0631583
0.0632821
0.0634134
0.0635513
0.063695
0.0638433
0.0639936
0.0641349
0.0642126
0.0656823
0.0667115
0.0675834
0.0683082
0.0688986
0.0693688
0.0697328
0.0700044
0.0701965
0.0703209
0.070388
0.0704071
0.0703862
0.070332
0.0702504
0.070146
0.0700229
0.0698843
0.0697327
0.0695704
0.0693989
0.0692196
0.0690337
0.0688421
0.0686453
0.0684441
0.0682389
0.0680302
0.0678184
0.0676038
0.067387
0.0671682
0.0669478
0.0667263
0.0665041
0.0662816
0.0660592
0.0658376
0.0656171
0.0653984
0.0651821
0.0649687
0.0647588
0.0645532
0.0643524
0.0641572
0.0639682
0.0637862
0.0636118
0.0634458
0.0632888
0.0631415
0.0630047
0.062879
0.0627649
0.062663
0.0625739
0.062498
0.0624357
0.0623874
0.0623533
0.0623335
0.0623282
0.0623373
0.0623606
0.062398
0.0624492
0.0625136
0.0625908
0.0626802
0.0627811
0.0628927
0.0630143
0.0631451
0.0632842
0.0634306
0.063583
0.0637387
0.063886
0.0639676
0.0655323
0.0665908
0.0674886
0.0682358
0.0688453
0.0693313
0.0697084
0.0699906
0.0701913
0.0703226
0.0703953
0.070419
0.0704018
0.0703508
0.0702719
0.0701699
0.0700489
0.0699122
0.0697624
0.0696018
0.069432
0.0692545
0.0690702
0.0688801
0.0686848
0.068485
0.0682812
0.0680738
0.0678632
0.0676497
0.0674338
0.0672156
0.0669958
0.0667745
0.0665522
0.0663293
0.0661062
0.0658835
0.0656616
0.0654409
0.0652222
0.0650058
0.0647925
0.0645829
0.0643775
0.064177
0.0639821
0.0637935
0.0636119
0.0634379
0.0632724
0.0631158
0.062969
0.0628326
0.0627072
0.0625934
0.0624919
0.0624031
0.0623275
0.0622656
0.0622177
0.0621841
0.0621649
0.0621604
0.0621706
0.0621953
0.0622345
0.0622878
0.062355
0.0624356
0.062529
0.0626346
0.0627517
0.0628796
0.0630173
0.063164
0.0633183
0.0634772
0.0636284
0.0637124
0.0653793
0.0664664
0.0673897
0.0681592
0.0687877
0.0692896
0.0696797
0.0699727
0.0701821
0.0703204
0.0703988
0.070427
0.0704136
0.0703657
0.0702894
0.0701896
0.0700706
0.0699357
0.0697877
0.0696286
0.0694604
0.0692842
0.0691014
0.0689126
0.0687187
0.0685203
0.0683177
0.0681115
0.067902
0.0676895
0.0674744
0.067257
0.0670376
0.0668167
0.0665945
0.0663715
0.066148
0.0659245
0.0657015
0.0654793
0.0652587
0.06504
0.0648239
0.0646108
0.0644016
0.0641967
0.0639968
0.0638026
0.0636148
0.063434
0.0632609
0.0630962
0.0629406
0.0627948
0.0626593
0.0625349
0.0624222
0.0623217
0.0622339
0.0621594
0.0620985
0.0620517
0.0620193
0.0620014
0.0619984
0.0620102
0.0620369
0.0620783
0.0621344
0.0622047
0.0622889
0.0623865
0.062497
0.0626196
0.0627537
0.0628983
0.063052
0.0632118
0.0633648
0.0634494
0.0652242
0.0663391
0.0672875
0.0680789
0.0687263
0.069244
0.0696473
0.0699511
0.0701692
0.0703146
0.0703987
0.0704316
0.0704219
0.0703771
0.0703034
0.0702058
0.0700887
0.0699555
0.0698089
0.0696513
0.0694843
0.0693094
0.0691278
0.0689402
0.0687475
0.0685501
0.0683487
0.0681435
0.0679349
0.0677233
0.067509
0.0672923
0.0670735
0.0668529
0.066631
0.0664079
0.0661841
0.0659601
0.0657362
0.0655129
0.0652907
0.0650702
0.0648517
0.0646359
0.0644234
0.0642147
0.0640106
0.0638116
0.0636184
0.0634317
0.063252
0.0630802
0.0629169
0.0627627
0.0626184
0.0624845
0.0623617
0.0622505
0.0621517
0.0620656
0.0619928
0.0619337
0.0618887
0.0618582
0.0618424
0.0618414
0.0618556
0.0618848
0.061929
0.0619882
0.062062
0.0621502
0.0622523
0.0623678
0.0624961
0.0626362
0.0627871
0.0629454
0.0630979
0.0631812
0.0650677
0.0662096
0.0671825
0.0679956
0.0686616
0.0691951
0.0696116
0.0699261
0.0701531
0.0703056
0.0703955
0.070433
0.0704271
0.0703853
0.0703141
0.0702187
0.0701034
0.0699717
0.0698265
0.0696701
0.0695043
0.0693305
0.0691499
0.0689633
0.0687716
0.0685751
0.0683746
0.0681702
0.0679625
0.0677516
0.067538
0.0673219
0.0671035
0.0668833
0.0666615
0.0664385
0.0662146
0.0659901
0.0657656
0.0655414
0.0653179
0.0650957
0.0648753
0.0646572
0.0644419
0.06423
0.0640222
0.063819
0.0636212
0.0634292
0.0632439
0.0630658
0.0628956
0.0627341
0.0625818
0.0624394
0.0623075
0.0621868
0.0620779
0.0619813
0.0618976
0.0618271
0.0617705
0.0617281
0.0617001
0.061687
0.0616889
0.061706
0.0617383
0.0617859
0.0618487
0.0619265
0.062019
0.0621258
0.0622465
0.0623803
0.0625261
0.0626807
0.0628305
0.0629106
0.0649108
0.0660787
0.0670755
0.0679098
0.0685942
0.0691434
0.0695729
0.0698982
0.070134
0.0702937
0.0703893
0.0704315
0.0704294
0.0703907
0.0703219
0.0702286
0.070115
0.0699848
0.0698409
0.0696857
0.0695209
0.069348
0.0691683
0.0689825
0.0687915
0.0685958
0.0683959
0.0681922
0.0679851
0.0677748
0.0675617
0.0673461
0.0671281
0.0669081
0.0666865
0.0664634
0.0662394
0.0660146
0.0657895
0.0655644
0.0653399
0.0651163
0.0648942
0.0646741
0.0644564
0.0642417
0.0640307
0.0638239
0.0636219
0.0634254
0.0632349
0.0630513
0.062875
0.0627069
0.0625474
0.0623974
0.0622574
0.0621281
0.0620101
0.0619039
0.0618102
0.0617294
0.061662
0.0616084
0.0615692
0.0615445
0.0615348
0.0615402
0.0615608
0.0615969
0.0616484
0.0617153
0.0617975
0.0618946
0.0620064
0.0621323
0.0622713
0.0624201
0.0625651
0.0626402
0.0647539
0.0659469
0.0669669
0.067822
0.0685245
0.0690891
0.0695316
0.0698677
0.0701123
0.0702791
0.0703805
0.0704274
0.070429
0.0703933
0.0703271
0.0702358
0.0701239
0.0699951
0.0698524
0.0696982
0.0695344
0.0693623
0.0691833
0.0689982
0.0688078
0.0686127
0.0684133
0.0682101
0.0680034
0.0677935
0.0675808
0.0673654
0.0671476
0.0669278
0.0667062
0.0664831
0.0662588
0.0660336
0.065808
0.0655822
0.0653567
0.0651319
0.0649083
0.0646864
0.0644665
0.0642494
0.0640355
0.0638255
0.0636198
0.0634192
0.0632242
0.0630355
0.0628538
0.0626797
0.0625138
0.0623569
0.0622095
0.0620724
0.061946
0.0618311
0.0617282
0.0616379
0.0615606
0.0614968
0.061447
0.0614116
0.0613908
0.0613851
0.0613946
0.0614194
0.0614599
0.0615158
0.0615874
0.0616743
0.0617764
0.0618933
0.0620241
0.0621656
0.062304
0.0623725
0.0645978
0.0658149
0.0668574
0.0677327
0.068453
0.0690328
0.0694882
0.0698349
0.0700882
0.0702622
0.0703694
0.0704209
0.0704262
0.0703936
0.0703298
0.0702405
0.0701302
0.0700028
0.0698613
0.0697081
0.069545
0.0693737
0.0691953
0.0690108
0.0688209
0.0686262
0.0684272
0.0682243
0.0680179
0.0678083
0.0675957
0.0673804
0.0671627
0.0669429
0.0667212
0.0664979
0.0662733
0.0660477
0.0658215
0.065595
0.0653685
0.0651426
0.0649176
0.064694
0.0644722
0.0642529
0.0640364
0.0638234
0.0636144
0.0634101
0.063211
0.0630178
0.0628311
0.0626516
0.0624798
0.0623166
0.0621625
0.0620181
0.0618841
0.0617612
0.0616498
0.0615506
0.0614641
0.0613909
0.0613313
0.0612858
0.0612547
0.0612385
0.0612374
0.0612516
0.0612813
0.0613266
0.0613875
0.0614641
0.0615562
0.0616635
0.0617852
0.0619183
0.0620487
0.0621093
0.0644429
0.0656831
0.0667474
0.0676424
0.06838
0.0689749
0.0694429
0.0698002
0.0700622
0.0702432
0.0703562
0.0704123
0.0704213
0.0703917
0.0703303
0.0702429
0.0701342
0.0700082
0.0698677
0.0697154
0.0695531
0.0693825
0.0692047
0.0690206
0.0688311
0.0686367
0.068438
0.0682354
0.0680291
0.0678196
0.067607
0.0673917
0.067174
0.066954
0.066732
0.0665084
0.0662834
0.0660573
0.0658304
0.0656031
0.0653757
0.0651486
0.0649222
0.0646971
0.0644735
0.064252
0.0640332
0.0638174
0.0636054
0.0633977
0.0631948
0.0629975
0.0628062
0.0626217
0.0624446
0.0622755
0.0621151
0.0619641
0.0618231
0.0616927
0.0615735
0.0614661
0.061371
0.0612889
0.0612201
0.0611652
0.0611245
0.0610984
0.0610873
0.0610913
0.0611107
0.0611458
0.0611964
0.0612629
0.0613449
0.0614424
0.0615547
0.0616787
0.0618002
0.061852
0.0642898
0.0655521
0.0666373
0.0675515
0.0683061
0.0689156
0.0693961
0.0697638
0.0700345
0.0702225
0.0703411
0.0704018
0.0704146
0.0703879
0.0703288
0.0702433
0.0701362
0.0700114
0.069872
0.0697205
0.0695589
0.0693889
0.0692115
0.0690279
0.0688387
0.0686446
0.0684461
0.0682436
0.0680374
0.0678278
0.0676152
0.0673998
0.0671818
0.0669616
0.0667393
0.0665152
0.0662896
0.0660629
0.0658352
0.065607
0.0653786
0.0651503
0.0649226
0.0646959
0.0644706
0.0642471
0.0640259
0.0638077
0.0635928
0.0633819
0.0631755
0.0629743
0.0627788
0.0625897
0.0624075
0.0622331
0.0620669
0.0619097
0.061762
0.0616246
0.0614981
0.061383
0.0612799
0.0611894
0.061112
0.0610482
0.0609984
0.060963
0.0609424
0.0609368
0.0609465
0.0609717
0.0610125
0.061069
0.0611413
0.0612291
0.0613318
0.0614464
0.0615587
0.0616011
0.0641389
0.0654222
0.0665276
0.0674603
0.0682314
0.0688554
0.0693481
0.0697261
0.0700053
0.0702003
0.0703245
0.0703897
0.0704061
0.0703823
0.0703256
0.0702419
0.0701363
0.0700126
0.0698742
0.0697235
0.0695626
0.0693931
0.0692162
0.0690329
0.068844
0.0686501
0.0684517
0.0682492
0.068043
0.0678334
0.0676207
0.0674051
0.0671868
0.0669662
0.0667434
0.0665188
0.0662926
0.0660651
0.0658366
0.0656074
0.0653779
0.0651484
0.0649192
0.0646909
0.0644638
0.0642384
0.064015
0.0637943
0.0635767
0.0633628
0.0631531
0.0629482
0.0627487
0.0625553
0.0623684
0.0621889
0.0620172
0.0618542
0.0617004
0.0615564
0.0614229
0.0613005
0.0611899
0.0610915
0.0610059
0.0609336
0.0608752
0.0608309
0.0608012
0.0607864
0.0607868
0.0608027
0.0608341
0.0608811
0.0609439
0.0610223
0.0611156
0.0612209
0.0613237
0.0613565
0.0639905
0.0652938
0.0664185
0.0673692
0.0681565
0.0687944
0.0692992
0.0696874
0.0699749
0.0701768
0.0703066
0.0703763
0.0703963
0.0703753
0.0703208
0.070239
0.0701348
0.0700122
0.0698747
0.0697247
0.0695644
0.0693953
0.0692188
0.0690358
0.0688471
0.0686533
0.068455
0.0682526
0.0680464
0.0678367
0.0676237
0.0674078
0.0671892
0.0669682
0.0667449
0.0665196
0.0662927
0.0660644
0.065835
0.0656047
0.065374
0.0651432
0.0649126
0.0646827
0.0644538
0.0642263
0.0640008
0.0637777
0.0635574
0.0633406
0.0631277
0.0629193
0.062716
0.0625184
0.0623272
0.0621428
0.061966
0.0617974
0.0616377
0.0614875
0.0613475
0.0612182
0.0611003
0.0609943
0.0609009
0.0608206
0.0607538
0.0607011
0.0606627
0.0606391
0.0606306
0.0606374
0.0606598
0.0606977
0.0607514
0.0608206
0.0609048
0.061001
0.0610944
0.0611176
0.063845
0.0651673
0.0663106
0.0672786
0.0680814
0.0687331
0.0692497
0.0696478
0.0699436
0.0701523
0.0702876
0.0703617
0.0703852
0.0703671
0.0703148
0.0702347
0.0701318
0.0700104
0.0698736
0.0697243
0.0695645
0.0693958
0.0692195
0.0690368
0.0688482
0.0686546
0.0684563
0.0682539
0.0680476
0.0678377
0.0676245
0.0674084
0.0671894
0.0669679
0.0667441
0.0665182
0.0662905
0.0660613
0.0658309
0.0655995
0.0653676
0.0651354
0.0649033
0.0646717
0.0644409
0.0642115
0.0639837
0.0637582
0.0635353
0.0633156
0.0630996
0.0628879
0.0626809
0.0624794
0.0622838
0.0620949
0.0619132
0.0617393
0.061574
0.0614178
0.0612715
0.0611356
0.0610107
0.0608976
0.0607967
0.0607086
0.0606338
0.0605728
0.0605261
0.060494
0.0604769
0.060475
0.0604885
0.0605177
0.0605626
0.060623
0.0606984
0.0607856
0.0608699
0.0608838
0.0637025
0.0650429
0.0662039
0.0671886
0.0680066
0.0686717
0.0691998
0.0696076
0.0699116
0.0701269
0.0702677
0.0703462
0.0703731
0.0703578
0.0703077
0.0702292
0.0701277
0.0700072
0.0698713
0.0697225
0.0695631
0.0693948
0.0692187
0.0690361
0.0688476
0.068654
0.0684557
0.0682532
0.0680468
0.0678367
0.0676234
0.0674069
0.0671875
0.0669655
0.0667412
0.0665146
0.0662862
0.0660561
0.0658247
0.0655923
0.0653591
0.0651255
0.0648918
0.0646585
0.0644259
0.0641944
0.0639644
0.0637365
0.063511
0.0632884
0.0630694
0.0628543
0.0626438
0.0624384
0.0622387
0.0620453
0.0618588
0.0616799
0.0615092
0.0613473
0.0611949
0.0610526
0.0609211
0.060801
0.0606928
0.0605972
0.0605146
0.0604457
0.0603908
0.0603505
0.0603249
0.0603146
0.0603196
0.0603402
0.0603765
0.0604284
0.0604952
0.0605739
0.0606493
0.0606539
0.0635633
0.0649208
0.0660988
0.0670996
0.0679322
0.0686103
0.0691497
0.0695671
0.069879
0.0701009
0.070247
0.0703299
0.0703603
0.0703476
0.0702996
0.0702228
0.0701225
0.070003
0.0698678
0.0697196
0.0695606
0.0693924
0.0692166
0.069034
0.0688456
0.0686519
0.0684536
0.0682509
0.0680443
0.067834
0.0676203
0.0674035
0.0671838
0.0669613
0.0667364
0.0665092
0.06628
0.0660491
0.0658167
0.0655832
0.0653488
0.0651138
0.0648786
0.0646436
0.0644091
0.0641756
0.0639434
0.063713
0.0634849
0.0632595
0.0630374
0.0628191
0.062605
0.0623958
0.0621921
0.0619944
0.0618033
0.0616194
0.0614435
0.0612761
0.0611178
0.0609694
0.0608314
0.0607045
0.0605893
0.0604863
0.0603963
0.0603196
0.0602567
0.0602083
0.0601745
0.0601558
0.0601525
0.0601647
0.0601926
0.0602361
0.0602946
0.0603649
0.0604316
0.0604274
0.0634276
0.0648012
0.0659954
0.0670117
0.0678586
0.0685493
0.0690996
0.0695264
0.0698461
0.0700745
0.0702259
0.070313
0.0703467
0.0703367
0.0702908
0.0702156
0.0701166
0.069998
0.0698634
0.0697157
0.069557
0.0693891
0.0692133
0.0690308
0.0688423
0.0686485
0.06845
0.0682471
0.0680403
0.0678297
0.0676157
0.0673985
0.0671784
0.0669554
0.0667299
0.0665021
0.0662722
0.0660405
0.0658072
0.0655725
0.0653369
0.0651006
0.0648639
0.0646273
0.064391
0.0641554
0.0639211
0.0636883
0.0634576
0.0632295
0.0630043
0.0627827
0.0625652
0.0623523
0.0621446
0.0619426
0.061747
0.0615583
0.0613773
0.0612045
0.0610405
0.0608861
0.0607418
0.0606083
0.0604862
0.0603761
0.0602786
0.0601943
0.0601237
0.0600673
0.0600254
0.0599986
0.059987
0.0599909
0.0600105
0.0600458
0.0600961
0.0601581
0.0602164
0.0602033
0.0632955
0.0646843
0.0658941
0.0669252
0.0677857
0.0684887
0.0690498
0.0694857
0.0698131
0.0700478
0.0702044
0.0702956
0.0703327
0.0703253
0.0702815
0.0702078
0.0701099
0.0699922
0.0698583
0.069711
0.0695526
0.0693848
0.0692091
0.0690265
0.0688379
0.068644
0.0684453
0.0682422
0.068035
0.0678241
0.0676098
0.0673922
0.0671715
0.066948
0.066722
0.0664935
0.0662629
0.0660303
0.0657961
0.0655605
0.0653237
0.0650861
0.064848
0.0646098
0.0643717
0.0641343
0.0638978
0.0636627
0.0634295
0.0631986
0.0629706
0.0627458
0.0625248
0.0623083
0.0620966
0.0618905
0.0616904
0.061497
0.061311
0.0611328
0.0609633
0.060803
0.0606525
0.0605126
0.0603837
0.0602667
0.060162
0.0600702
0.0599919
0.0599276
0.0598777
0.0598428
0.059823
0.0598187
0.0598301
0.0598572
0.0598993
0.0599532
0.0600031
0.0599815
0.063167
0.0645703
0.0657948
0.0668402
0.067714
0.0684288
0.0690003
0.0694451
0.06978
0.070021
0.0701826
0.070278
0.0703184
0.0703135
0.0702717
0.0701996
0.0701028
0.069986
0.0698526
0.0697057
0.0695475
0.0693799
0.0692042
0.0690215
0.0688328
0.0686387
0.0684397
0.0682363
0.0680288
0.0678175
0.0676027
0.0673846
0.0671634
0.0669394
0.0667127
0.0664836
0.0662522
0.0660189
0.0657838
0.0655471
0.0653093
0.0650705
0.064831
0.0645913
0.0643516
0.0641123
0.0638738
0.0636365
0.0634009
0.0631674
0.0629365
0.0627086
0.0624843
0.0622642
0.0620487
0.0618384
0.061634
0.061436
0.061245
0.0610617
0.0608867
0.0607206
0.0605641
0.0604178
0.0602823
0.0601584
0.0600465
0.0599474
0.0598615
0.0597894
0.0597316
0.0596886
0.0596607
0.0596482
0.0596514
0.0596703
0.0597043
0.05975
0.0597916
0.0597615
0.0630424
0.0644593
0.0656978
0.0667568
0.0676434
0.0683697
0.0689513
0.0694048
0.0697471
0.0699942
0.0701608
0.0702601
0.0703038
0.0703015
0.0702616
0.070191
0.0700953
0.0699793
0.0698465
0.0697
0.069542
0.0693744
0.0691987
0.0690159
0.068827
0.0686327
0.0684334
0.0682296
0.0680217
0.06781
0.0675948
0.0673761
0.0671544
0.0669298
0.0667025
0.0664726
0.0662405
0.0660063
0.0657703
0.0655327
0.0652938
0.0650538
0.0648131
0.0645719
0.0643306
0.0640896
0.0638492
0.0636099
0.063372
0.063136
0.0629023
0.0626715
0.062444
0.0622204
0.0620012
0.061787
0.0615783
0.0613758
0.06118
0.0609916
0.0608112
0.0606394
0.0604769
0.0603244
0.0601824
0.0600516
0.0599327
0.0598263
0.0597329
0.0596531
0.0595874
0.0595364
0.0595003
0.0594797
0.0594746
0.0594853
0.0595112
0.0595487
0.059582
0.0595435
0.0629216
0.0643512
0.0656031
0.0666752
0.0675741
0.0683116
0.068903
0.069365
0.0697144
0.0699674
0.070139
0.0702423
0.070289
0.0702892
0.0702513
0.0701821
0.0700876
0.0699723
0.0698401
0.0696939
0.0695361
0.0693686
0.0691928
0.0690099
0.0688208
0.0686262
0.0684266
0.0682224
0.0680141
0.0678019
0.0675862
0.067367
0.0671447
0.0669195
0.0666914
0.0664609
0.066228
0.0659929
0.065756
0.0655174
0.0652774
0.0650363
0.0647943
0.0645517
0.064309
0.0640663
0.0638241
0.0635828
0.0633428
0.0631044
0.0628682
0.0626346
0.0624041
0.0621772
0.0619544
0.0617364
0.0615236
0.0613167
0.0611162
0.0609228
0.0607372
0.0605598
0.0603915
0.0602328
0.0600844
0.0599469
0.0598211
0.0597074
0.0596065
0.0595191
0.0594455
0.0593865
0.0593423
0.0593134
0.0593002
0.0593026
0.0593202
0.0593495
0.0593745
0.0593275
0.0628046
0.0642463
0.0655109
0.0665956
0.0675062
0.0682545
0.0688554
0.0693256
0.0696821
0.0699409
0.0701173
0.0702245
0.0702743
0.0702769
0.0702409
0.0701732
0.0700797
0.0699652
0.0698336
0.0696877
0.0695301
0.0693626
0.0691867
0.0690037
0.0688143
0.0686194
0.0684194
0.0682149
0.0680061
0.0677935
0.0675772
0.0673574
0.0671345
0.0669086
0.0666799
0.0664485
0.0662148
0.0659789
0.0657411
0.0655015
0.0652604
0.0650181
0.0647749
0.064531
0.0642868
0.0640425
0.0637986
0.0635554
0.0633134
0.0630728
0.0628341
0.0625979
0.0623645
0.0621345
0.0619084
0.0616867
0.06147
0.0612589
0.0610539
0.0608558
0.060665
0.0604823
0.0603082
0.0601435
0.0599888
0.0598447
0.059712
0.0595911
0.0594829
0.0593878
0.0593064
0.0592394
0.0591871
0.0591499
0.0591284
0.0591225
0.0591318
0.0591528
0.0591693
0.0591139
0.0626914
0.0641445
0.0654212
0.0665179
0.0674399
0.0681986
0.0688087
0.069287
0.0696502
0.0699148
0.0700958
0.0702068
0.0702597
0.0702647
0.0702305
0.0701642
0.0700718
0.0699581
0.0698269
0.0696814
0.0695239
0.0693565
0.0691805
0.0689973
0.0688077
0.0686125
0.0684121
0.0682072
0.067998
0.0677848
0.0675679
0.0673476
0.0671241
0.0668974
0.066668
0.0664359
0.0662013
0.0659645
0.0657257
0.0654851
0.065243
0.0649995
0.064755
0.0645098
0.0642642
0.0640184
0.0637728
0.0635278
0.0632838
0.0630411
0.0628001
0.0625614
0.0623253
0.0620924
0.0618631
0.061638
0.0614176
0.0612025
0.0609933
0.0607905
0.0605948
0.0604069
0.0602273
0.0600568
0.0598959
0.0597454
0.0596058
0.059478
0.0593624
0.0592598
0.0591706
0.0590956
0.0590351
0.0589897
0.0589598
0.0589455
0.0589464
0.058959
0.058967
0.0589031
0.0625822
0.064046
0.0653341
0.0664422
0.0673752
0.0681439
0.068763
0.069249
0.0696189
0.069889
0.0700746
0.0701893
0.0702452
0.0702526
0.0702202
0.0701553
0.0700639
0.069951
0.0698203
0.069675
0.0695177
0.0693503
0.0691743
0.0689909
0.0688011
0.0686055
0.0684048
0.0681994
0.0679898
0.0677761
0.0675587
0.0673377
0.0671135
0.0668862
0.066656
0.0664231
0.0661877
0.06595
0.0657102
0.0654686
0.0652254
0.0649807
0.064735
0.0644885
0.0642414
0.0639941
0.0637469
0.0635001
0.0632542
0.0630094
0.0627663
0.0625252
0.0622866
0.0620508
0.0618186
0.0615902
0.0613663
0.0611474
0.0609341
0.060727
0.0605267
0.0603338
0.0601489
0.0599727
0.0598059
0.0596491
0.059503
0.0593682
0.0592454
0.0591353
0.0590385
0.0589555
0.0588869
0.0588332
0.0587949
0.0587722
0.0587646
0.0587686
0.0587679
0.0586955
0.0624768
0.0639506
0.0652496
0.0663687
0.0673122
0.0680905
0.0687183
0.0692118
0.0695881
0.0698637
0.0700537
0.0701721
0.0702309
0.0702406
0.07021
0.0701465
0.0700562
0.0699439
0.0698137
0.0696688
0.0695117
0.0693443
0.0691682
0.0689846
0.0687945
0.0685987
0.0683976
0.0681918
0.0679816
0.0677674
0.0675495
0.0673279
0.067103
0.066875
0.0666441
0.0664104
0.0661741
0.0659355
0.0656948
0.0654521
0.0652078
0.064962
0.064715
0.0644671
0.0642186
0.0639698
0.063721
0.0634725
0.0632247
0.062978
0.0627327
0.0624893
0.0622482
0.0620098
0.0617747
0.0615432
0.061316
0.0610936
0.0608764
0.0606652
0.0604604
0.0602628
0.0600728
0.0598913
0.0597187
0.0595559
0.0594034
0.0592619
0.0591321
0.0590147
0.0589103
0.0588194
0.0587428
0.0586809
0.0586342
0.0586029
0.0585867
0.0585821
0.0585726
0.0584916
0.0623752
0.0638584
0.0651677
0.0662973
0.0672509
0.0680386
0.0686746
0.0691755
0.0695581
0.0698389
0.0700333
0.0701552
0.0702169
0.0702289
0.0702
0.0701379
0.0700486
0.069937
0.0698074
0.0696627
0.0695057
0.0693384
0.0691622
0.0689785
0.0687882
0.068592
0.0683906
0.0681844
0.0679737
0.067759
0.0675405
0.0673183
0.0670928
0.0668641
0.0666324
0.0663979
0.0661608
0.0659213
0.0656796
0.0654359
0.0651904
0.0649435
0.0646952
0.064446
0.0641961
0.0639458
0.0636953
0.0634451
0.0631955
0.0629468
0.0626995
0.0624538
0.0622103
0.0619694
0.0617315
0.0614971
0.0612667
0.0610408
0.06082
0.0606049
0.0603959
0.0601938
0.059999
0.0598123
0.0596343
0.0594657
0.059307
0.0591591
0.0590225
0.058898
0.0587861
0.0586876
0.058603
0.0585329
0.0584778
0.0584381
0.0584132
0.0583999
0.0583816
0.058292
0.0622773
0.0637694
0.0650886
0.0662282
0.0671913
0.067988
0.0686321
0.0691401
0.0695287
0.0698147
0.0700133
0.0701387
0.0702032
0.0702174
0.0701903
0.0701295
0.0700411
0.0699303
0.0698012
0.0696569
0.0695
0.0693327
0.0691565
0.0689726
0.068782
0.0685856
0.0683838
0.0681772
0.0679661
0.0677509
0.0675318
0.0673091
0.0670829
0.0668535
0.0666211
0.0663858
0.0661478
0.0659074
0.0656647
0.06542
0.0651735
0.0649254
0.0646759
0.0644254
0.064174
0.0639222
0.0636702
0.0634183
0.0631668
0.0629162
0.0626668
0.0624189
0.0621731
0.0619296
0.061689
0.0614518
0.0612183
0.0609892
0.0607649
0.060546
0.060333
0.0601265
0.0599272
0.0597356
0.0595524
0.0593782
0.0592137
0.0590595
0.0589164
0.058785
0.0586659
0.0585599
0.0584675
0.0583893
0.058326
0.0582777
0.0582443
0.0582222
0.058195
0.0580968
0.0621832
0.0636837
0.0650121
0.0661612
0.0671336
0.0679389
0.0685908
0.0691056
0.0695001
0.069791
0.0699938
0.0701226
0.0701898
0.0702062
0.0701808
0.0701213
0.070034
0.0699239
0.0697952
0.0696512
0.0694945
0.0693273
0.069151
0.068967
0.0687762
0.0685795
0.0683773
0.0681703
0.0679588
0.0677431
0.0675235
0.0673002
0.0670734
0.0668433
0.0666102
0.0663741
0.0661353
0.065894
0.0656504
0.0654047
0.0651571
0.0649078
0.0646571
0.0644053
0.0641526
0.0638993
0.0636457
0.0633921
0.0631388
0.0628863
0.0626348
0.0623848
0.0621366
0.0618907
0.0616475
0.0614074
0.061171
0.0609387
0.0607109
0.0604884
0.0602715
0.0600609
0.0598572
0.0596609
0.0594727
0.0592932
0.0591231
0.0589629
0.0588135
0.0586754
0.0585494
0.0584361
0.0583361
0.05825
0.0581785
0.058122
0.05808
0.0580491
0.058013
0.0579062
0.0620929
0.0636011
0.0649383
0.0660965
0.0670778
0.0678913
0.0685507
0.0690721
0.0694724
0.0697681
0.0699749
0.070107
0.0701769
0.0701953
0.0701716
0.0701134
0.070027
0.0699177
0.0697895
0.0696458
0.0694893
0.0693221
0.0691458
0.0689616
0.0687707
0.0685737
0.0683712
0.0681639
0.0679519
0.0677358
0.0675157
0.0672918
0.0670644
0.0668337
0.0665998
0.066363
0.0661234
0.0658813
0.0656367
0.06539
0.0651413
0.0648909
0.0646391
0.0643859
0.0641319
0.0638771
0.0636219
0.0633667
0.0631117
0.0628572
0.0626038
0.0623516
0.0621012
0.0618528
0.061607
0.0613642
0.0611248
0.0608894
0.0606583
0.0604322
0.0602116
0.059997
0.059789
0.0595882
0.0593951
0.0592105
0.0590349
0.0588691
0.0587136
0.0585691
0.0584363
0.0583159
0.0582085
0.0581148
0.0580353
0.0579705
0.05792
0.0578805
0.0578355
0.0577202
0.0620062
0.0635217
0.0648672
0.066034
0.0670238
0.0678453
0.0685119
0.0690396
0.0694454
0.0697458
0.0699565
0.0700918
0.0701643
0.0701848
0.0701627
0.0701058
0.0700203
0.0699117
0.069784
0.0696406
0.0694843
0.0693172
0.0691408
0.0689566
0.0687655
0.0685682
0.0683655
0.0681578
0.0679455
0.0677289
0.0675083
0.0672839
0.0670559
0.0668246
0.0665901
0.0663525
0.0661121
0.0658691
0.0656237
0.065376
0.0651263
0.0648748
0.0646218
0.0643674
0.064112
0.0638558
0.0635991
0.0633422
0.0630855
0.0628292
0.0625738
0.0623195
0.0620668
0.0618161
0.0615677
0.0613222
0.0610799
0.0608414
0.0606071
0.0603776
0.0601533
0.0599347
0.0597226
0.0595173
0.0593196
0.05913
0.0589492
0.0587778
0.0586164
0.0584657
0.0583263
0.0581991
0.0580845
0.0579833
0.057896
0.0578231
0.0577643
0.0577162
0.0576624
0.0575386
0.0619231
0.0634455
0.0647989
0.0659739
0.0669717
0.0678008
0.0684743
0.0690082
0.0694192
0.0697242
0.0699386
0.070077
0.070152
0.0701746
0.0701541
0.0700984
0.0700139
0.0699059
0.0697787
0.0696357
0.0694796
0.0693125
0.0691362
0.0689519
0.0687606
0.0685631
0.0683602
0.0681521
0.0679395
0.0677224
0.0675014
0.0672765
0.067048
0.0668161
0.0665809
0.0663426
0.0661015
0.0658577
0.0656114
0.0653628
0.0651121
0.0648596
0.0646054
0.0643498
0.0640931
0.0638355
0.0635773
0.0633188
0.0630604
0.0628023
0.0625449
0.0622886
0.0620337
0.0617806
0.0615298
0.0612816
0.0610365
0.060795
0.0605575
0.0603245
0.0600966
0.0598743
0.059658
0.0594485
0.0592462
0.0590517
0.0588658
0.0586889
0.0585217
0.058365
0.0582193
0.0580853
0.0579638
0.0578552
0.0577603
0.0576795
0.0576124
0.0575559
0.0574933
0.0573612
0.0618437
0.0633725
0.0647332
0.0659161
0.0669216
0.0677579
0.0684381
0.0689778
0.069394
0.0697032
0.0699214
0.0700628
0.0701402
0.0701647
0.0701458
0.0700913
0.0700077
0.0699004
0.0697737
0.069631
0.0694751
0.0693082
0.0691318
0.0689474
0.068756
0.0685584
0.0683551
0.0681468
0.0679338
0.0677164
0.0674949
0.0672696
0.0670406
0.0668081
0.0665723
0.0663334
0.0660916
0.065847
0.0655999
0.0653504
0.0650988
0.0648452
0.0645899
0.0643331
0.0640751
0.0638162
0.0635566
0.0632965
0.0630365
0.0627766
0.0625173
0.062259
0.062002
0.0617466
0.0614933
0.0612425
0.0609947
0.0607502
0.0605096
0.0602733
0.0600418
0.0598157
0.0595955
0.0593817
0.0591749
0.0589757
0.0587847
0.0586025
0.0584297
0.0582671
0.0581151
0.0579746
0.0578461
0.0577304
0.057628
0.0575393
0.0574642
0.0573992
0.057328
0.0571877
0.0617679
0.0633027
0.0646704
0.0658606
0.0668734
0.0677167
0.0684031
0.0689485
0.0693696
0.069683
0.0699047
0.070049
0.0701288
0.0701552
0.0701378
0.0700844
0.0700017
0.0698951
0.0697689
0.0696265
0.0694708
0.069304
0.0691277
0.0689432
0.0687517
0.0685539
0.0683504
0.0681418
0.0679285
0.0677108
0.0674889
0.0672631
0.0670337
0.0668007
0.0665643
0.0663248
0.0660823
0.065837
0.0655891
0.0653388
0.0650862
0.0648317
0.0645753
0.0643174
0.0640582
0.063798
0.0635369
0.0632754
0.0630137
0.0627522
0.0624911
0.0622308
0.0619717
0.0617141
0.0614584
0.0612051
0.0609545
0.0607072
0.0604635
0.0602239
0.059989
0.0597592
0.059535
0.0593171
0.0591059
0.058902
0.0587061
0.0585186
0.0583404
0.0581719
0.0580138
0.0578668
0.0577316
0.0576087
0.0574989
0.0574025
0.0573193
0.057246
0.0571662
0.0570179
0.0616957
0.0632361
0.0646103
0.0658075
0.0668272
0.0676771
0.0683696
0.0689204
0.0693461
0.0696636
0.0698886
0.0700356
0.0701177
0.070146
0.07013
0.0700778
0.069996
0.06989
0.0697642
0.0696222
0.0694667
0.0693
0.0691237
0.0689392
0.0687476
0.0685496
0.068346
0.0681372
0.0679236
0.0677055
0.0674833
0.0672571
0.0670272
0.0667937
0.0665568
0.0663168
0.0660737
0.0658277
0.0655791
0.0653279
0.0650745
0.064819
0.0645617
0.0643027
0.0640423
0.0637808
0.0635185
0.0632555
0.0629923
0.0627291
0.0624662
0.062204
0.0619429
0.0616831
0.0614251
0.0611694
0.0609162
0.060666
0.0604193
0.0601766
0.0599382
0.0597048
0.0594768
0.0592548
0.0590392
0.0588308
0.05863
0.0584374
0.0582537
0.0580795
0.0579153
0.057762
0.0576201
0.0574902
0.057373
0.057269
0.0571778
0.0570962
0.0570079
0.0568515
0.0616272
0.0631727
0.0645531
0.0657569
0.0667832
0.0676392
0.0683375
0.0688934
0.0693236
0.0696448
0.0698731
0.0700228
0.070107
0.0701371
0.0701225
0.0700713
0.0699904
0.069885
0.0697597
0.069618
0.0694628
0.0692961
0.0691199
0.0689353
0.0687436
0.0685455
0.0683417
0.0681327
0.0679189
0.0677005
0.067478
0.0672514
0.0670211
0.0667872
0.0665498
0.0663092
0.0660655
0.0658189
0.0655696
0.0653178
0.0650635
0.0648072
0.0645489
0.0642889
0.0640274
0.0637647
0.0635011
0.0632368
0.0629721
0.0627073
0.0624427
0.0621787
0.0619156
0.0616537
0.0613935
0.0611353
0.0608796
0.0606267
0.0603771
0.0601312
0.0598896
0.0596526
0.0594209
0.0591949
0.0589751
0.0587621
0.0585565
0.0583589
0.0581698
0.0579899
0.0578199
0.0576602
0.0575116
0.0573748
0.0572503
0.0571387
0.0570396
0.0569497
0.0568529
0.0566886
0.0615624
0.0631127
0.0644989
0.0657087
0.0667412
0.0676031
0.0683068
0.0688676
0.069302
0.0696269
0.0698582
0.0700105
0.0700968
0.0701284
0.0701152
0.0700651
0.0699849
0.0698802
0.0697553
0.069614
0.0694589
0.0692924
0.0691161
0.0689316
0.0687398
0.0685416
0.0683376
0.0681284
0.0679143
0.0676957
0.0674729
0.067246
0.0670153
0.066781
0.0665432
0.0663021
0.0660579
0.0658107
0.0655608
0.0653082
0.0650532
0.0647961
0.0645369
0.0642759
0.0640134
0.0637496
0.0634848
0.0632191
0.062953
0.0626867
0.0624205
0.0621548
0.0618898
0.0616259
0.0613635
0.061103
0.0608448
0.0605893
0.0603368
0.060088
0.0598431
0.0596027
0.0593673
0.0591373
0.0589134
0.058696
0.0584857
0.0582831
0.0580888
0.0579033
0.0577273
0.0575615
0.0574063
0.0572626
0.0571309
0.0570117
0.0569047
0.0568065
0.0567012
0.0565291
0.0615014
0.0630561
0.0644476
0.0656632
0.0667014
0.0675689
0.0682777
0.068843
0.0692814
0.0696098
0.0698439
0.0699986
0.0700869
0.0701201
0.0701081
0.070059
0.0699796
0.0698755
0.069751
0.0696099
0.0694551
0.0692886
0.0691125
0.0689279
0.0687361
0.0685377
0.0683336
0.0681242
0.0679099
0.0676911
0.067468
0.0672408
0.0670098
0.0667751
0.0665369
0.0662953
0.0660506
0.0658029
0.0655524
0.0652992
0.0650435
0.0647856
0.0645256
0.0642637
0.0640003
0.0637354
0.0634694
0.0632026
0.0629351
0.0626674
0.0623996
0.0621322
0.0618654
0.0615996
0.0613351
0.0610724
0.0608118
0.0605537
0.0602985
0.0600467
0.0597987
0.0595549
0.0593159
0.0590822
0.0588542
0.0586325
0.0584176
0.0582101
0.0580106
0.0578196
0.0576378
0.0574658
0.0573042
0.0571536
0.0570147
0.0568879
0.056773
0.0566666
0.0565528
0.056373
0.061444
0.0630028
0.0643993
0.0656203
0.0666639
0.0675365
0.0682501
0.0688197
0.0692619
0.0695934
0.0698303
0.0699873
0.0700774
0.0701121
0.0701013
0.0700531
0.0699744
0.0698708
0.0697468
0.069606
0.0694513
0.0692849
0.0691088
0.0689242
0.0687323
0.0685339
0.0683297
0.0681201
0.0679056
0.0676866
0.0674632
0.0672357
0.0670044
0.0667694
0.0665308
0.0662888
0.0660437
0.0657955
0.0655444
0.0652906
0.0650343
0.0647757
0.0645149
0.0642522
0.0639878
0.063722
0.0634549
0.0631869
0.0629182
0.0626491
0.0623799
0.0621108
0.0618423
0.0615747
0.0613082
0.0610434
0.0607804
0.0605199
0.060262
0.0600074
0.0597563
0.0595093
0.0592668
0.0590293
0.0587973
0.0585714
0.058352
0.0581397
0.0579351
0.0577387
0.0575511
0.057373
0.057205
0.0570476
0.0569015
0.0567672
0.0566444
0.0565298
0.0564076
0.0562201
0.0613904
0.062953
0.064354
0.06558
0.0666286
0.0675061
0.0682241
0.0687977
0.0692434
0.069578
0.0698174
0.0699764
0.0700683
0.0701044
0.0700947
0.0700474
0.0699694
0.0698663
0.0697426
0.069602
0.0694475
0.0692812
0.0691051
0.0689205
0.0687286
0.0685301
0.0683257
0.0681159
0.0679013
0.067682
0.0674584
0.0672307
0.0669991
0.0667637
0.0665248
0.0662825
0.0660369
0.0657883
0.0655367
0.0652824
0.0650255
0.0647662
0.0645047
0.0642413
0.063976
0.0637093
0.0634412
0.0631721
0.0629022
0.0626318
0.0623611
0.0620906
0.0618205
0.061551
0.0612827
0.0610157
0.0607506
0.0604876
0.0602272
0.0599698
0.0597158
0.0594656
0.0592197
0.0589786
0.0587427
0.0585126
0.0582888
0.0580717
0.0578621
0.0576603
0.0574671
0.057283
0.0571086
0.0569445
0.0567913
0.0566495
0.0565189
0.056396
0.0562654
0.0560703
0.0613405
0.0629065
0.0643118
0.0655423
0.0665956
0.0674776
0.0681997
0.068777
0.069226
0.0695633
0.0698051
0.0699661
0.0700596
0.070097
0.0700883
0.0700418
0.0699644
0.0698617
0.0697384
0.0695981
0.0694437
0.0692775
0.0691014
0.0689168
0.0687247
0.0685261
0.0683216
0.0681117
0.0678969
0.0676774
0.0674536
0.0672257
0.0669938
0.0667581
0.0665189
0.0662762
0.0660303
0.0657812
0.0655292
0.0652743
0.0650169
0.064757
0.0644949
0.0642307
0.0639647
0.063697
0.063428
0.0631579
0.0628869
0.0626152
0.0623433
0.0620713
0.0617996
0.0615285
0.0612583
0.0609893
0.060722
0.0604568
0.0601939
0.0599337
0.0596768
0.0594235
0.0591743
0.0589297
0.05869
0.0584558
0.0582276
0.0580059
0.0577913
0.0575843
0.0573855
0.0571954
0.0570147
0.0568439
0.0566837
0.0565345
0.056396
0.056265
0.0561259
0.0559234
0.061294
0.0628633
0.0642724
0.0655072
0.0665648
0.0674509
0.0681769
0.0687577
0.0692096
0.0695496
0.0697936
0.0699564
0.0700513
0.0700899
0.0700822
0.0700364
0.0699596
0.0698573
0.0697343
0.0695941
0.0694399
0.0692737
0.0690977
0.068913
0.0687209
0.0685221
0.0683175
0.0681075
0.0678925
0.0676728
0.0674487
0.0672206
0.0669884
0.0667525
0.0665129
0.0662699
0.0660236
0.0657741
0.0655217
0.0652664
0.0650084
0.064748
0.0644852
0.0642204
0.0639536
0.0636852
0.0634153
0.0631441
0.0628721
0.0625993
0.062326
0.0620527
0.0617795
0.0615067
0.0612348
0.0609639
0.0606946
0.060427
0.0601617
0.059899
0.0596392
0.0593829
0.0591305
0.0588823
0.0586389
0.0584007
0.0581682
0.057942
0.0577225
0.0575102
0.0573059
0.0571099
0.0569229
0.0567456
0.0565783
0.0564217
0.0562755
0.0561362
0.0559888
0.0557788
0.061251
0.0628231
0.0642359
0.0654746
0.0665362
0.0674261
0.0681556
0.0687396
0.0691943
0.0695367
0.0697827
0.0699471
0.0700434
0.0700832
0.0700763
0.0700312
0.0699548
0.0698529
0.0697302
0.0695902
0.069436
0.0692699
0.0690938
0.0689091
0.0687169
0.0685181
0.0683133
0.0681031
0.0678879
0.067668
0.0674438
0.0672153
0.066983
0.0667467
0.0665069
0.0662636
0.0660169
0.0657671
0.0655142
0.0652585
0.065
0.064739
0.0644757
0.0642102
0.0639427
0.0636735
0.0634027
0.0631307
0.0628576
0.0625837
0.0623093
0.0620346
0.0617599
0.0614856
0.0612119
0.0609392
0.0606678
0.0603981
0.0601304
0.0598651
0.0596026
0.0593434
0.0590877
0.0588361
0.058589
0.0583468
0.0581101
0.0578794
0.057655
0.0574376
0.0572278
0.057026
0.0568328
0.0566488
0.0564746
0.0563106
0.0561566
0.0560091
0.0558534
0.055636
0.061211
0.0627859
0.064202
0.0654443
0.0665096
0.067403
0.0681358
0.0687227
0.06918
0.0695246
0.0697724
0.0699384
0.070036
0.0700767
0.0700706
0.0700261
0.0699502
0.0698487
0.0697261
0.0695863
0.0694322
0.0692661
0.06909
0.0689052
0.0687129
0.0685139
0.068309
0.0680987
0.0678833
0.0676632
0.0674387
0.0672101
0.0669774
0.0667409
0.0665008
0.0662571
0.0660101
0.0657599
0.0655066
0.0652505
0.0649915
0.06473
0.0644661
0.0642
0.0639318
0.0636619
0.0633903
0.0631173
0.0628433
0.0625683
0.0622926
0.0620167
0.0617406
0.0614647
0.0611894
0.0609148
0.0606415
0.0603696
0.0600996
0.0598318
0.0595666
0.0593044
0.0590456
0.0587906
0.0585398
0.0582937
0.0580528
0.0578175
0.0575884
0.0573659
0.0571505
0.0569429
0.0567435
0.0565529
0.0563717
0.0562003
0.0560384
0.0558827
0.0557185
0.0554938
0.0611738
0.0627512
0.0641704
0.0654161
0.0664848
0.0673815
0.0681173
0.0687069
0.0691666
0.0695132
0.0697628
0.0699302
0.0700289
0.0700706
0.0700652
0.0700213
0.0699458
0.0698445
0.0697222
0.0695825
0.0694284
0.0692623
0.0690862
0.0689013
0.0687089
0.0685098
0.0683047
0.0680942
0.0678786
0.0676583
0.0674336
0.0672047
0.0669717
0.066735
0.0664946
0.0662506
0.0660032
0.0657526
0.065499
0.0652423
0.0649829
0.0647209
0.0644564
0.0641897
0.0639208
0.0636501
0.0633777
0.0631039
0.0628288
0.0625528
0.062276
0.0619987
0.0617212
0.0614438
0.0611668
0.0608905
0.0606151
0.0603411
0.0600688
0.0597985
0.0595306
0.0592654
0.0590034
0.058745
0.0584906
0.0582406
0.0579955
0.0577556
0.0575216
0.0572939
0.057073
0.0568595
0.0566538
0.0564565
0.0562682
0.0560892
0.0559193
0.0557552
0.0555824
0.0553501
0.0611391
0.0627188
0.0641409
0.0653898
0.0664616
0.0673614
0.0681001
0.0686922
0.0691541
0.0695026
0.0697538
0.0699225
0.0700223
0.0700648
0.0700601
0.0700167
0.0699416
0.0698406
0.0697184
0.0695788
0.0694247
0.0692587
0.0690824
0.0688975
0.0687049
0.0685057
0.0683004
0.0680897
0.0678739
0.0676534
0.0674284
0.0671993
0.0669661
0.066729
0.0664883
0.0662439
0.0659962
0.0657452
0.0654911
0.065234
0.0649741
0.0647116
0.0644465
0.0641791
0.0639096
0.0636381
0.0633649
0.0630901
0.062814
0.0625369
0.0622589
0.0619803
0.0617014
0.0614225
0.0611437
0.0608656
0.0605882
0.060312
0.0600373
0.0597644
0.0594937
0.0592255
0.0589603
0.0586984
0.0584402
0.0581861
0.0579366
0.0576921
0.057453
0.0572199
0.0569932
0.0567735
0.0565612
0.0563569
0.056161
0.055974
0.0557957
0.0556227
0.0554408
0.0552006
0.0611059
0.0626879
0.0641128
0.0653647
0.0664396
0.0673423
0.0680837
0.0686782
0.0691423
0.0694926
0.0697453
0.0699153
0.0700161
0.0700594
0.0700553
0.0700124
0.0699376
0.0698369
0.0697148
0.0695753
0.0694213
0.0692552
0.0690789
0.0688938
0.0687012
0.0685018
0.0682963
0.0680854
0.0678694
0.0676486
0.0674234
0.0671939
0.0669604
0.066723
0.0664819
0.0662373
0.0659891
0.0657377
0.0654831
0.0652256
0.0649651
0.0647019
0.0644362
0.0641681
0.0638978
0.0636255
0.0633514
0.0630756
0.0627985
0.0625201
0.0622409
0.0619609
0.0616804
0.0613998
0.0611192
0.060839
0.0605595
0.0602809
0.0600036
0.0597279
0.0594542
0.0591827
0.0589139
0.0586481
0.0583858
0.0581272
0.0578729
0.0576232
0.0573785
0.0571395
0.0569064
0.0566798
0.0564602
0.056248
0.0560439
0.0558481
0.0556604
0.0554775
0.0552856
0.0550367
0.0610717
0.0626561
0.0640839
0.065339
0.0664171
0.0673229
0.0680671
0.0686642
0.0691305
0.0694827
0.0697369
0.0699083
0.0700101
0.0700542
0.0700508
0.0700084
0.069934
0.0698335
0.0697116
0.0695722
0.0694182
0.0692521
0.0690757
0.0688905
0.0686977
0.0684981
0.0682925
0.0680813
0.067865
0.067644
0.0674185
0.0671887
0.0669548
0.0667171
0.0664755
0.0662304
0.0659818
0.0657299
0.0654747
0.0652165
0.0649554
0.0646915
0.064425
0.064156
0.0638848
0.0636114
0.0633362
0.0630592
0.0627807
0.0625009
0.06222
0.0619382
0.0616558
0.0613731
0.0610902
0.0608075
0.0605253
0.0602438
0.0599633
0.0596841
0.0594066
0.0591311
0.0588579
0.0585874
0.05832
0.0580559
0.0577957
0.0575398
0.0572884
0.0570422
0.0568015
0.0565667
0.0563384
0.0561171
0.0559033
0.0556972
0.0554987
0.0553045
0.0551011
0.0548426
0.0610277
0.0626151
0.0640467
0.065306
0.0663883
0.0672981
0.0680461
0.0686465
0.0691157
0.0694704
0.0697268
0.0698999
0.0700031
0.0700484
0.0700458
0.0700041
0.0699302
0.06983
0.0697084
0.0695691
0.0694152
0.069249
0.0690726
0.0688872
0.0686942
0.0684944
0.0682885
0.068077
0.0678604
0.067639
0.067413
0.0671827
0.0669483
0.06671
0.0664678
0.066222
0.0659726
0.0657198
0.0654637
0.0652045
0.0649423
0.0646772
0.0644094
0.0641391
0.0638663
0.0635912
0.0633142
0.0630352
0.0627545
0.0624724
0.0621889
0.0619044
0.061619
0.061333
0.0610467
0.0607603
0.060474
0.0601881
0.0599029
0.0596188
0.0593359
0.0590547
0.0587754
0.0584984
0.058224
0.0579527
0.0576847
0.0574205
0.0571605
0.0569051
0.0566548
0.0564099
0.056171
0.0559386
0.0557131
0.0554948
0.0552837
0.0550764
0.0548601
0.0545903
0.0609425
0.0625354
0.063974
0.0652411
0.0663315
0.0672491
0.0680044
0.0686114
0.0690864
0.0694461
0.0697067
0.0698833
0.0699894
0.0700369
0.0700361
0.0699957
0.0699228
0.0698234
0.0697022
0.0695631
0.0694092
0.0692429
0.0690662
0.0688805
0.068687
0.0684866
0.06828
0.0680677
0.0678502
0.0676277
0.0674006
0.0671691
0.0669334
0.0666936
0.0664498
0.0662023
0.065951
0.0656963
0.065438
0.0651765
0.0649118
0.0646441
0.0643734
0.0640999
0.0638239
0.0635454
0.0632646
0.0629816
0.0626968
0.0624101
0.062122
0.0618324
0.0615418
0.0612502
0.060958
0.0606653
0.0603725
0.0600798
0.0597874
0.0594957
0.059205
0.0589156
0.0586277
0.0583418
0.0580582
0.0577772
0.0574992
0.0572247
0.056954
0.0566875
0.0564256
0.0561689
0.0559179
0.0556729
0.0554344
0.0552029
0.0549781
0.0547571
0.054527
0.0542486
0.0606997
0.0623037
0.0637585
0.0650449
0.066156
0.0670944
0.0678696
0.0684949
0.0689864
0.0693604
0.0696331
0.0698199
0.0699343
0.0699884
0.0699928
0.0699562
0.0698861
0.0697885
0.0696683
0.0695295
0.0693753
0.0692083
0.0690304
0.0688432
0.0686478
0.0684452
0.0682361
0.0680212
0.0678007
0.0675752
0.0673448
0.0671097
0.0668702
0.0666265
0.0663786
0.0661267
0.0658709
0.0656114
0.0653483
0.0650816
0.0648116
0.0645383
0.0642619
0.0639825
0.0637003
0.0634155
0.0631281
0.0628385
0.0625467
0.0622529
0.0619574
0.0616604
0.0613621
0.0610626
0.0607624
0.0604615
0.0601603
0.059859
0.0595579
0.0592573
0.0589575
0.0586589
0.0583617
0.0580663
0.057773
0.0574822
0.0571944
0.0569097
0.0566288
0.056352
0.0560797
0.0558125
0.0555507
0.0552949
0.0550455
0.0548029
0.054567
0.0543347
0.0540961
0.0538162
)
;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.075;
}
outlet
{
type zeroGradient;
}
wall
{
type zeroGradient;
}
center
{
type symmetry;
}
plate
{
type kqRWallFunction;
value nonuniform List<scalar>
80
(
0.0579272
0.0496522
0.0433497
0.0384455
0.0345601
0.0314333
0.0288819
0.0267746
0.0250154
0.0235328
0.0222725
0.0211933
0.0202628
0.0194557
0.018752
0.0181356
0.0175937
0.0171157
0.0166929
0.0163181
0.0159852
0.0156888
0.0154243
0.0151878
0.0149757
0.0147848
0.0146125
0.0144562
0.0143138
0.0141834
0.0140636
0.0139528
0.01385
0.0137541
0.0136645
0.0135804
0.0135013
0.0134267
0.0133563
0.0132897
0.0132267
0.0131669
0.0131102
0.0130565
0.0130055
0.012957
0.0129108
0.012867
0.0128252
0.0127855
0.0127476
0.0127115
0.0126771
0.0126443
0.012613
0.0125833
0.0125548
0.0125276
0.0125017
0.0124771
0.0124535
0.0124307
0.0124091
0.0123884
0.0123684
0.0123492
0.0123305
0.0123123
0.0122941
0.0122761
0.0122581
0.0122395
0.0122218
0.0122018
0.0121852
0.0121635
0.0121457
0.0121167
0.0121063
0.0120616
)
;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //
| |
12f870f35777e86983efcf7d019805fcc08479a7 | cf43f47adbe14d8886d0cca7cafd0d9f66e5b9dc | /4.cc | 122075cd5c2084ffb450ff87e184d34b40652b7d | [] | no_license | schildmeijer/project-euler | d3db80ab3b8d1d969feafed5fb02464538ada0c9 | 881e5542db8d4e9702c80fae21eee4cc3e06fffb | refs/heads/master | 2021-01-01T06:33:59.499913 | 2010-02-20T08:20:42 | 2010-02-20T08:20:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 925 | cc | 4.cc | #include <iostream>
#include <vector>
#include <NTL/ZZ.h>
#include <sstream>
//A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
//Find the largest palindrome made from the product of two 3-digit numbers
using namespace std;
using namespace NTL;
//g++ -I/usr/local/include -L/usr/local/lib main.cpp -o main -lntl -lm
inline string to_s(int n) {
stringstream ss;
ss << n;
return ss.str(); //RVO
}
inline bool is_palindrome(const string & cand) {
return(equal(cand.begin(), cand.begin()+cand.size()/2, cand.rbegin()));
}
int main (int argc, char *const argv[]) {
int largest_pal = 0;
for (int i = 100; i != 1000; ++i)
for (int j = 100; j != 1000; ++j) {
if (is_palindrome(to_s(i*j))) {
largest_pal = i*j > largest_pal ? i*j : largest_pal;
}
}
cout << "largest palindrome of two three digits is: " << largest_pal;
}
|
e41de24b7beb61e9f357069786137498e524331f | 9dbeabc73c230cb4d7421f9b01430afffa7a2893 | /week6/20-kdistance.cpp | 0fadbe411cb51c346d303d9906d071b5050888c3 | [] | no_license | arnavmenon/CPCprep | 3ad4cae9ff3a704135763585ed72cfc2266da740 | dd95216774ea33fd5d327d37513b7ddd96471155 | refs/heads/master | 2023-07-13T13:12:08.076955 | 2021-08-21T21:13:15 | 2021-08-21T21:13:15 | 352,124,288 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 493 | cpp | 20-kdistance.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
void _KDistant(struct Node *root, int k, vector<int> &ans)
{
if(root == NULL|| k < 0 )
return;
if( k == 0 )
{
ans.push_back(root->data);
return;
}
_KDistant( root->left, k - 1, ans ) ;
_KDistant( root->right, k - 1, ans ) ;
}
vector<int> Kdistance(struct Node *root, int k){
vector<int> ans;
_KDistant(root,k,ans);
return ans;
} |
d7e34dc3f896804765985b248964983fdb4659a5 | 8aedfc543df0e636ad1e29e552072d8c515fe074 | /timer.cc | 69697c7d7b3fdad70b48f807e086696b716f2460 | [
"MIT"
] | permissive | DrItanium/libixp | 0a6ecd74994ed01942c8c21f4506b877019ce041 | 2805f7071c671326388a19d3dc082121968e2d99 | refs/heads/master | 2020-05-06T15:32:55.860322 | 2019-04-10T00:48:15 | 2019-04-10T00:48:15 | 180,195,497 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,696 | cc | timer.cc | /* Copyright ©2008-2010 Kris Maglione <maglione.k at Gmail>
* See LICENSE file for license details.
*/
#include <assert.h>
#include <stdlib.h>
#include <sys/time.h>
#include "ixp_local.h"
/*
* This really needn't be threadsafe, as it has little use in
* threaded programs, but it nonetheless is.
*/
static long lastid = 1;
/**
* Function: ixp_msec
*
* Returns the time since the Epoch in milliseconds.
*/
uint64_t
ixp_msec(void) {
timeval tv;
gettimeofday(&tv, 0);
return (uint64_t)tv.tv_sec*1000 + (uint64_t)tv.tv_usec/1000;
}
/**
* Function: ixp_settimer
*
* Params:
* msec: The timeout in milliseconds.
* fn: The function to call after P<msec> milliseconds
* have elapsed.
* aux: An arbitrary argument to pass to P<fn> when it
* is called.
*
* Initializes a callback-based timer to be triggerred after
* P<msec> milliseconds. The timer is passed its id number
* and the value of P<aux>.
*
* Returns:
* Returns the new timer's unique id number.
* See also:
* F<ixp_unsettimer>, F<ixp_serverloop>
*/
long
ixp_settimer(IxpServer *srv, long msec, void (*fn)(long, void*), void *aux) {
Timer **tp;
Timer *t;
uint64_t time;
time = ixp_msec() + msec;
t = (decltype(t))emallocz(sizeof *t);
thread->lock(&srv->lk);
t->id = lastid++;
t->msec = time;
t->fn = fn;
t->aux = aux;
for(tp=&srv->timer; *tp; tp=&tp[0]->link)
if(tp[0]->msec < time)
break;
t->link = *tp;
*tp = t;
thread->unlock(&srv->lk);
return t->id;
}
/**
* Function: ixp_unsettimer
*
* Params:
* id: The id number of the timer to void.
*
* Voids the timer identified by P<id>.
*
* Returns:
* Returns true if a timer was stopped, false
* otherwise.
* See also:
* F<ixp_settimer>, F<ixp_serverloop>
*/
int
ixp_unsettimer(IxpServer *srv, long id) {
Timer **tp;
Timer *t;
thread->lock(&srv->lk);
for(tp=&srv->timer; (t=*tp); tp=&t->link)
if(t->id == id)
break;
if(t) {
*tp = t->link;
free(t);
}
thread->unlock(&srv->lk);
return t != nil;
}
/*
* Function: ixp_nexttimer
*
* Triggers any timers whose timeouts have ellapsed. This is
* primarily intended to be called from libixp's select
* loop.
*
* Returns:
* Returns the number of milliseconds until the next
* timer's timeout.
* See also:
* F<ixp_settimer>, F<ixp_serverloop>
*/
long
ixp_nexttimer(IxpServer *srv) {
Timer *t;
uint64_t time;
long ret;
SET(time);
thread->lock(&srv->lk);
while((t = srv->timer)) {
time = ixp_msec();
if(t->msec > time)
break;
srv->timer = t->link;
thread->unlock(&srv->lk);
t->fn(t->id, t->aux);
free(t);
thread->lock(&srv->lk);
}
ret = 0;
if(t)
ret = t->msec - time;
thread->unlock(&srv->lk);
return ret;
}
|
25de081d69213180bcfd8607e70d27f95ecbbc73 | 7d8263a13413629d4f6e8cf67ee0d9a828b5a13c | /test.cpp | 741ce17a50731298c1daba2a4f0f307f9208ebeb | [] | no_license | ruslanTankist/sem1_c_task2 | 3e026ac3450bdf39808824b51c0b0c084ca0dff0 | fababe4e85daec98bc96c632bfa9aec7f10bdff2 | refs/heads/master | 2021-03-25T17:35:27.355691 | 2020-03-29T17:24:29 | 2020-03-29T17:24:29 | 247,636,294 | 0 | 0 | null | 2020-03-29T17:24:30 | 2020-03-16T07:21:42 | null | UTF-8 | C++ | false | false | 936 | cpp | test.cpp | #include <gtest/gtest.h>
extern "C" {
#include "functionality.h"
}
class TestExecution : public ::testing::Test
{
protected:
void SetUp() override
{
array = NULL;
}
void TearDown() override
{
free(array);
}
char * array;
};
TEST_F(TestExecution, NonParallSuccess)
{
bool correct = true;
array = non_parallel();
if (array != NULL)
for (int i = 0; i < REQUIRED_SIZE; i++)
if(array[i] != (i % 4))
{
correct = false;
break;
}
EXPECT_TRUE(correct);
}
TEST_F(TestExecution, ParallSuccess)
{
bool correct = true;
array = parallel();
if (array != NULL)
for (int i = 0; i < REQUIRED_SIZE; i++)
if(array[i] != (i % 4))
{
correct = false;
break;
}
EXPECT_TRUE(correct);
} |
796d5ffe826f446cfac7fa996c2811183f69c19d | e86b0e308dbf8e585862bdde86dd2e8d81bc3b38 | /main.cpp | 2b84c859042ba9be0806b8646b8d4290be2462a2 | [] | no_license | aodonnell/LowGo | 76a1e9cb4158572b3dd52303c64c18ab6f81b04c | f429a0d9c841f29a90a398741a8656d587220397 | refs/heads/master | 2021-09-12T02:01:10.763358 | 2018-04-13T13:36:49 | 2018-04-13T13:36:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,474 | cpp | main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <limits>
#include "shared/TGAImage.h"
#include "shared/Model.h"
#include "GL/GL.h"
#include "shared/colors.h"
Model *model = NULL;
// scene dimensions
const int width = 800;
const int height = 800;
// scene params
Vec3f light( 1, 1, 1);
Vec3f eye( 1, 1, 4);
Vec3f center( 0, 0, 0);
Vec3f up( 0, 1, 0);
using namespace std;
// Diffuse texture shader with diffused, ambient and specular lighting
struct Shader : public IShader {
// varying is a reserved keyword in GLSL language.
// in varying variables we store data to be interpolated inside the triangle,
// and the fragment shaders get the interpolated value (for the current pixel).
// diffuse texture coordinates (2 per vertex, 3 vertices)
mat<2, 3, float> varying_uv;
// Uniform is a reserved keyword in GLSL, it allows to pass constants to the shaders
// It's faster to combine all these matrices
// Projection*ModelView
mat<4,4,float> uniform_M;
// (Projection*ModelView).invert_transpose()
mat<4,4,float> uniform_MIT;
// Vertex Shader
virtual Vec4f vertex(int iface, int nthvert) {
// read the vertex from .obj file
Vec4f gl_Vertex = embed<4>(model->vert(iface, nthvert));
// read the uv from the .obj file and populate the matrix
varying_uv.set_col(nthvert, model->uv(iface, nthvert));
// transform it to screen coordinates
return Viewport*Projection*ModelView*gl_Vertex;
}
// Fragment Shader
virtual bool fragment(Vec3f bar, TGAColor &color) {
// interpolate uv to retrieve the texture from this pixel
Vec2f uv = varying_uv*bar;
// for diffuse lighting we comput the (cosine of) angle between vectors n and l
Vec3f n = proj<3>(uniform_MIT*embed<4>(model->normal(uv))).normalize();
Vec3f l = proj<3>(uniform_M *embed<4>(light )).normalize();
float diff = std::max(0.f, n*l);
// now we are interested in the (cosine of) angle between vectors r (reflected light direction) and v (view direction).
// find r, our reflected light vector
Vec3f r = (n * (n * l*2.f) - l).normalize();
float spec = pow(std::max(r.z, 0.0f), model->specular(uv));
// apply our intensity to the color read from the diffuse texture
TGAColor c = model->diffuse(uv);
color = c;
// compute our lighting as a weighted sum of ambient, diffuse and specular lighting
// (here our coefficients are 5, 1 and .6)
for (int i=0; i<3; i++){
color[i] = std::min<float>(.5 + c[i]*(diff + .6*spec), 255);
}
// no, we do not discard this pixel
return false;
}
};
int main(int argc, char** argv) {
if (2 == argc) {
// model = new Model(argv[1]); broke lol
} else {
// model = new Model("../resources/diablo3_pose/diablo3_pose.obj",
//// "../resources/diablo3_pose/diablo3_pose_diffuse.tga",
// "../resources/textures/grid.tga",
// "../resources/diablo3_pose/diablo3_pose_nm.tga",
// "../resources/diablo3_pose/diablo3_pose_spec.tga");
model = new Model("../resources/models/face.obj",
"../resources/textures/face_diffuse.tga",
"../resources/normals/face_nm2.tga",
"../resources/spec/face_spec.tga");
}
// creating the image
TGAImage image (width, height, TGAImage::RGB);
TGAImage zbuffer(width, height, TGAImage::GRAYSCALE);
// setting the scene
lookat(eye, center, up);
viewport(width/8, height/8, width*3/4, height*3/4);
projection(-1.f/(eye-center).norm());
light.normalize();
Shader shader;
shader.uniform_M = Projection*ModelView;
shader.uniform_MIT = (Projection*ModelView).invert_transpose();
for (int i=0; i<model->nfaces(); i++) {
Vec4f screen_coords[3];
for (int j=0; j<3; j++) {
screen_coords[j] = shader.vertex(i, j);
}
triangle(screen_coords, shader, image, zbuffer);
}
// to place the origin in the bottom left corner of the image
image. flip_vertically();
zbuffer.flip_vertically();
image. write_tga_file("output.tga");
zbuffer.write_tga_file("zbuffer.tga");
// cleanup
puts("∆");
return 0;
}
|
434676fbd454bd6d402097856b8b0d88e395e58d | b7f2c737686d1feb87a819def55c1df9729bd3f7 | /theory implementation/BFS and DFS.cpp | 5884b79819675edcf47db9a28ebdd3d7a852afde | [] | no_license | frontseat-astronaut/Competitive-Programming | e052c887497c5da9b82c701eacc765b7f839049f | eb49d9112cfe35cd0ef8cf1b690b607a8beede7d | refs/heads/master | 2020-03-21T03:15:41.561248 | 2019-01-27T15:59:19 | 2019-01-27T15:59:19 | 138,044,632 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 976 | cpp | BFS and DFS.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
//undirected graph!
int N;
vector<vector <int>> adj;
void add_node()
{
vector<int> node;
adj.push_back(node);
}
int add_edge(int a, int b)
{
adj[a].push_back(b);
adj[b].push_back(a);
}
void BFS(int x)
{
queue <int> q;
bool visited[N]={0};
int distance[N];
visited[x]=true;
distance[x]=0;
q.push(x);
while(q.size())
{
int node=q.front();
q.pop();
cout<<node<<" "<<distance[node]<<endl;
for(auto anode: adj[node])
{
if(visited[anode]) continue;
q.push(anode);
distance[anode]=distance[node]+1;
visited[anode]=1;
}
}
}
void DFS(int x, bool visited[])
{
if(visited[x]) return;
visited[x]=1;
cout<<x<<endl;
for(auto s:adj[x])
DFS(s,visited);
}
int main()
{
cin>>N;
for(int i=0; i<N; ++i)
add_node();
int e;
cin>>e;
for(int i=0; i<e; ++i)
{
int a,b;
cin>>a>>b;
add_edge(a,b);
}
cout<<endl;
// BFS(1);
bool visited[N]={0};
DFS(0,visited);
} |
7c3832d9f3dac474a49ee0d6e934f8c418edeec0 | 009626c8273633eee13c2e14887e6e8413529a42 | /gy80_poc/sensorServer.cxx | 34002abc466182d365e777a00f717cbda18015dc | [] | no_license | ishansheth/RaspberryPi-Projects | bd7b97a8be8fb8cdd9e4c4f3e79afea622a002f9 | f9fdf25b2d739b0ba2b5afdca3f5cc4a14c0e969 | refs/heads/master | 2022-10-16T21:48:36.613634 | 2022-09-17T13:44:06 | 2022-09-17T13:44:06 | 143,947,710 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,400 | cxx | sensorServer.cxx | /**
This is a sample code from geeksforgeeks
https://www.geeksforgeeks.org/socket-programming-in-cc-handling-multiple-clients-on-server-without-multi-threading/
**/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<errno.h>
#include<unistd.h>
#include<arpa/inet.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<sys/time.h>
#include<netinet/in.h>
#define TRUE 1
#define FALSE 0
#define PORT 8888
int main(){
int opt = TRUE;
int master_socket,addrlen,new_socket, client_socket[30], max_client= 30,activity,i,valread,sd;
int max_sd;
struct sockaddr_in address;
char buffer[1025];
//set of socket descriptors
fd_set readfds;
// a message
char* message = "ECHO Daemon v1.0\n";
// initialize all the client sockets to 0
for(i = 0;i<max_client;i++){
client_socket[i] = 0;
}
// create master socket
if((master_socket = socket(AF_INET,SOCK_STREAM,0)) == 0){
perror("socket failed");
exit(EXIT_FAILURE);
}
// set master socket options to allow multiple connection
if(setsockopt(master_socket,SOL_SOCKET,SO_REUSEADDR,(char*)&opt,sizeof(opt)) < 0){
perror("setsockopt");
exit(EXIT_FAILURE);
}
// type of socket to be created
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(PORT);
// bind the socket to the localhost 8888
if(bind(master_socket,(struct sockaddr *)&address,sizeof(address))<0){
perror("bind failed");
exit(EXIT_FAILURE);
}
printf("Listening on port %d \n", PORT);
// try to specify max 3 pending connecitons for the master socket
if(listen(master_socket,3)<0){
perror("listen failed");
exit(EXIT_FAILURE);
}
addrlen = sizeof(address);
puts("waiting for connections.....");
while(TRUE){
// clear the socket set
FD_ZERO(&readfds);
// add the master socket to set
FD_SET(master_socket,&readfds);
max_sd = master_socket;
// add child sockets to set
for(i = 0;i<max_client;i++){
sd = client_socket[i];
if(sd > 0)
FD_SET(sd,&readfds);
if(sd > max_sd)
max_sd = sd;
}
activity = select(max_sd+1,&readfds,NULL,NULL,NULL);
if((activity < 0) && (errno!=EINTR)){
printf("select error");
}
if(FD_ISSET(master_socket,&readfds)){
if((new_socket = accept(master_socket,(struct sockaddr *)&address,(socklen_t*)&addrlen))<0){
perror("accept error");
exit(EXIT_FAILURE);
}
printf("New Connection, socket fd is %d, ip is : %s,port: %d \n",new_socket,inet_ntoa(address.sin_addr),ntohs(address.sin_port));
if(send(new_socket,message,strlen(message),0) != strlen(message)){
perror("send");
}
puts("Welcome message send successfully");
for(i = 0;i<max_client;i++){
if(client_socket[i] == 0){
client_socket[i] = new_socket;
printf("Adding to list of socket as %d \n",i);
break;
}
}
for(i = 0;i<max_client;i++){
sd = client_socket[i];
if(FD_ISSET(sd,&readfds)){
if((valread = read(sd,buffer,1024)) == 0){
getpeername(sd,(struct sockaddr*)&address,(socklen_t*)&addrlen);
printf("Host disconnected, ip %s, port %d \n",inet_ntoa(address.sin_addr),ntohs(address.sin_port));
close(sd);
client_socket[i] = 0;
}
else{
buffer[valread] = '\0';
send(sd,buffer,strlen(buffer),0);
}
}
}
}
}
}
|
fd2ea5408b5413386e71a2364c60f16607805877 | 0d3b58547eb1148ab4bdc151dca951148eebaae1 | /src/utils/Configuration.hpp | 385ed78a5bdb41fc375124735a41ec99b5e0ec2f | [] | no_license | byfron/pumpkin | 6c4e7bf13df4bdc18d47dd39efc4fa8fcdff6671 | 2e858bd3abe580a36b31993f163e253ab990007e | refs/heads/master | 2021-03-22T05:00:28.411331 | 2017-05-05T14:27:47 | 2017-05-05T14:27:47 | 53,526,880 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 854 | hpp | Configuration.hpp | #pragma once
#include <fcntl.h>
#include <fstream>
#include <google/protobuf/text_format.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
namespace pumpkin {
template <typename T>
class Configuration {
public:
Configuration(const std::string & conf_file) {
parse(conf_file);
}
Configuration(const T & conf) {
m_config = conf;
}
const T & config() const { return m_config; }
private:
bool parse(const std::string & conf_file) {
int fileDescriptor = open(conf_file.c_str(), O_RDONLY);
google::protobuf::io::FileInputStream fileInput(fileDescriptor);
fileInput.SetCloseOnDelete( true );
if (!google::protobuf::TextFormat::Parse(&fileInput, &m_config))
{
//log
assert(false);
//std::cout << "Failed to parse file!" << std::endl;
return false;
}
return true;
}
protected:
T m_config;
};
}
|
9a0e73629dd14f8571af2c034c4d19f1a6672261 | c4b7b51e47b0b5a0af27b1db6ae3e58ab7b010ce | /sensors.cpp | fc51c8c6e9fcabef162a83278c131d35766d5cd4 | [] | no_license | barteksocz/ISP_WIFI_MB_AL_BS_PROJECT | 018f6c278cf947db6f903bf73e7ed890d42dbca2 | a334e790dab122fce5e7443e269e3bf073bbc534 | refs/heads/master | 2021-09-06T10:14:43.220583 | 2018-02-05T12:06:50 | 2018-02-05T12:06:50 | 115,438,635 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 475 | cpp | sensors.cpp | #include "sensors.h"
int16_t magnetic_sensor_read(void) {
int temp_data = analogRead(MAGNETIC_SENSOR_ANALOG_PIN);
if (temp_data <= MS_ADC_THRESHOLD)
return 0;
else
return 1;
}
int16_t temperature_sensor_read(void) {
int temp_data;
temp_data = analogRead(TEMP_SENSOR_ANALOG_PIN);
temp_data = temp_data * TEMPERATURE_SCALE_FACTOR_1 / TEMPERATURE_SCALE_FACTOR_2;
if ((temp_data % 10) >= 5)
return ((temp_data / 10) + 1);
else
return (temp_data / 10);
} |
879e97d52bbd6acf78fe6326e6229c9ab459871a | 124629b9c5a448d7cc264ab94495d051a3582e8e | /data structure univ/link_list/univ.link_list_test.cpp | a31f0da0baa0debe01a1c914b33c7ea1893d7c71 | [] | no_license | nadaese/univ_C | e02456f3c5df45d7aeccfa072ef418cf7d59e1de | a768ab4e46242887fad02f6f4dadd7887523bd81 | refs/heads/master | 2023-05-03T06:10:14.912811 | 2021-05-23T15:03:44 | 2021-05-23T15:03:44 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,834 | cpp | univ.link_list_test.cpp | // 연결리스트 수업 인용
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
int n = 10;
typedef struct List {
int data;
struct List* next;
}list;
typedef struct Link {
List* head;
List* current;
List* before;
}link;
void Link_set(link* link)
{
link->head = NULL;
link->current = NULL;
link->before = NULL;
}
void Link_add(link* link, int indata)
{
list* newlist = (list*)malloc(sizeof(list));
newlist->data = indata;
newlist->next = link->head;
link->head = newlist;
}
int Link_remove(link* link, int indata)
{
if (link->head == NULL)
{
printf(" 연결리스트 없음 \n");
return 0;
}
link->current = link->head;
while (link->current != NULL)
{
if (link->current->data == indata)
{
if (link->current == link->head)
{
link->head = link->head->next;
}
else
{
link->before->next = link->current->next;
}
free(link->current);
return 1;
}
else
{
link->before = link->current;
link->current = link->current->next;
}
}
printf(" [ %d ] 는 연결리스트에 존재하지 않음 \n", indata);
}
void Link_screen(Link* link)
{
link->current = link->head;
printf("연결리스트 : ");
while (link->current != NULL)
{
printf("[ %2d ] ", link->current->data);
link->current = link->current->next;
}
printf("\n");
}
int main(void)
{
Link* link = (Link*)malloc(sizeof(Link));
Link_set(link);
printf("입력리스트 : ");
for (int i = 0; i < n; i++)
{
int randdata = rand() % 99 + 1;
Link_add(link, randdata);
printf("[ %2d ] ", randdata);
}
printf("\n");
Link_screen(link);
int removedata = 999;
printf(" 삭제 종료는 0 입력 \n");
while (removedata != 0)
{
printf(" 삭제할 값 입력 --> ");
scanf_s("%d", &removedata);
Link_remove(link, removedata);
Link_screen(link);
}
return 0;
} |
adf591b85305b86c1489ea112fe2ee40716177c0 | 8cb2766bc3e4d223544f1171141b2a79fe39e37a | /陈江伦/10/part22.cpp | 38b14dc901890a8fff30cbb8b0a8e9f521e7507d | [] | no_license | Nand8Tetris/Project | 66d95a95b13ec957bb1592b7a7ddae5ce07fe58c | 7bdbb056f8dcae5f8870b44a7c2d6b53781ff6f0 | refs/heads/master | 2020-04-13T23:33:09.612381 | 2018-12-29T12:41:52 | 2018-12-29T12:41:52 | 163,509,627 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,349 | cpp | part22.cpp | #include<iostream>
#include<fstream>
using namespace std;
ifstream in;
ofstream out;
int dep;
void output(string s) {
out<<"& ";
out<<s;
out<<"\\\\";
out<<endl;
}
void outputterm(string s) {
output("<term>");
output(" "+s);
output("</term>");
}
string s;
void CompileVarDec(string id,string t) {
output("<"+id+">");
dep++;
output(t);
while (getline(in,s),output(s),s!="<symbol> ; </symbol>");
dep--;
output("</"+id+">");
}
void CompileParameterList() {
getline(in,s);
output(s);//左括号
output("<parameterList>");
dep++;
while (getline(in,s),s!="<symbol> ) </symbol>")
output(s);
dep--;
output("</parameterList>");
output(s);//右括号
}
void CompileExpression();
void CompileExpressionList();
void CompileTerm(bool &ispre) {
getline(in,s);
if (s.substr(0,8)=="<symbol>"&&s[9]==')')
return;
if (!ispre) {
output("<expression>");
dep++;
ispre=true;
}
output("<term>");
dep++;
output(s);
if (s=="<symbol> - </symbol>"||s=="<symbol> ~ </symbol>") {
CompileTerm(ispre);
} else if (s.substr(0,8)=="<symbol>"&&s[9]=='(') {
CompileExpression();
output(s);
getline(in,s);
} else {
getline(in,s);
if (s.substr(0,8)=="<symbol>"&&s[9]=='.') {
output(s);
getline(in,s);
output(s);
getline(in,s);
}
if (s.substr(0,8)=="<symbol>"&&(s[9]=='('||s[9]=='[')) {
output(s);
if (s[9]=='(')
CompileExpressionList();
else {
CompileExpression();
output(s);
}
getline(in,s);
}
}
dep--;
output("</term>");
}
void CompileExpression() {//读到)或者;或者]或者=或者,停止,并输出)或者]或者,或者=或者;
bool ispre=false;
while (1) {
CompileTerm(ispre);
if (s.substr(0,8)=="<symbol>"&&(/*s[9]=='='||*/s[9]==','||s[9]==')'||s[9]==']'||s[9]==';'))
break;
output(s);
}
if (ispre) {
dep--;
output("</expression>");
}
}
void CompileExpressionList() {//读到)或者;或者)停止,并输出)或者;
output("<expressionList>");
dep++;
while (1) {
CompileExpression();
if (s!="<symbol> , </symbol>") break;
output(s);
}
dep--;
output("</expressionList>");
output(s);
}
void CompileDo(string t) {
output("<doStatement>");
dep++;
output(t);
while (getline(in,s)) {
output(s);
if (s=="<symbol> ( </symbol>") break;
}
CompileExpressionList();
getline(in,s);
output(s);//;
dep--;
output("</doStatement>");
}
void CompileLet(string t) {
output("<letStatement>");
dep++;
output(t);
getline(in,s);
output(s);//identifier
getline(in,s);
if (s=="<symbol> [ </symbol>") {
output(s);
CompileExpression();
output(s);
getline(in,s);
}
output(s);//<symbol> = </symbol>
CompileExpression();
output(s);
dep--;
output("</letStatement>");
}
void CompileReturn(string t,bool isvoid) {
output("<returnStatement>");
dep++;
output(t);
if (isvoid)
getline(in,s),output(s);//;
else {
CompileExpression();
output(s);
}
dep--;
output("</returnStatement>");
}
void CompileIf(string,bool);
void CompileWhile(string,bool);
void CompileElse(string,bool);
void CompileStatements(bool isvoid,bool isbegin) {//遇到}结束,并输出}
bool lastif=false;
while (getline(in,s)) {
if (lastif&&s!="<keyword> else </keyword>") {
dep--;
output("</ifStatement>");
}
if (!isbegin&&s!="<keyword> var </keyword>")
isbegin=true,output("<statements>"),dep++;
lastif=false;
if (s=="<symbol> } </symbol>") {
dep--;
output("</statements>");
output(s);
break;
}
if (s=="<symbol> { </symbol>") {
output(s);
isbegin=true,output("<statements>"),dep++;
}
if (s=="<keyword> var </keyword>")
CompileVarDec("varDec",s);
else if (s=="<keyword> let </keyword>")
CompileLet(s);
else if (s=="<keyword> do </keyword>")
CompileDo(s);
else if (s=="<keyword> if </keyword>")
CompileIf(s,isvoid),lastif=true;
else if (s=="<keyword> while </keyword>")
CompileWhile(s,isvoid);
else if (s=="<keyword> return </keyword>")
CompileReturn(s,isvoid);
else if (s=="<keyword> else </keyword>") {
CompileElse(s,isvoid);
dep--;
output("</ifStatement>");
}
}
}
void CompileSubroutine(string t) {
output("<subroutineDec>");
dep++;
output(t);
getline(in,s);
output(s);//函数类型
bool isvoid=s.substr(10,4)=="void";
getline(in,s);
output(s);//函数名
CompileParameterList();
output("<subroutineBody>");
dep++;
getline(in,s);
output(s);//{
CompileStatements(isvoid,false);
dep--;
output("</subroutineBody>");
dep--;
output("</subroutineDec>");
}
void CompileWhile(string t,bool isvoid) {
output("<whileStatement>");
dep++;
output(t);
getline(in,s);
output(s);//(
CompileExpression();
output(s);
CompileStatements(isvoid,true);
dep--;
output("</whileStatement>");
}
void CompileIf(string t,bool isvoid) {//延迟输出if结束符
output("<ifStatement>");
dep++;
output(t);//while
getline(in,s);//(
output(s);
CompileExpression();
output(s);
CompileStatements(isvoid,true);
//dep--;
//output("</ifStatement>");
}
void CompileElse(string t,bool isvoid) {
output(t);
CompileStatements(isvoid,true);
}
void CompileClass(string t) {
output("<class>");
dep++;
output(t);//<keyword> class </keyword>
getline(in,s);
output(s);//<identifier> <identifier>
getline(in,s);
output(s);//<symbol> { </symbol>
while (1) {
getline(in,s);
if (s=="<symbol> } </symbol>") {
output(s);
break;
}
if (s=="<keyword> field </keyword>"||s=="<keyword> static </keyword>")
CompileVarDec("classVarDec",s);
else if (s=="<keyword> constructor </keyword>"||s=="<keyword> function </keyword>"||s=="<keyword> method </keyword>")
CompileSubroutine(s);
}
dep--;
output("</class>");
}
int main(int argc,char **argv) {
if (argc!=3) {
puts("Wrong format for parameter");
return 0;
}
in.open(argv[1]);
out.open(argv[2]);
//in.open("Square/MainT.xml");
//out.open("Square/out.xml");
getline(in,s);//<tokens>
getline(in,s);//keyword<class>
CompileClass(s);
getline(in,s);//</tokens>
return 0;
}
|
5306c73e57e36a5f829a098b6be53c5924f82eae | 8afe840bf1383898704c0e1952f8065a6cbc8710 | /Base/Source/Performance/Performance.cpp | eea77666116fa1a981ca8ad7af59ca10eebf98e4 | [] | no_license | TeaMakesMePee/AGDEVA2 | e175bb7fa04dc53a30cc31b4b8dab1ff911ac316 | a003e726aa2b0334927915fe29996af82761244e | refs/heads/master | 2022-04-08T06:12:08.309167 | 2020-02-12T09:43:56 | 2020-02-12T09:43:56 | 235,534,953 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,590 | cpp | Performance.cpp | #include "Performance.h"
CPerformance::~CPerformance()
{
}
void CPerformance::SetFaceCount(int count)
{
this->faceCount = count;
}
int CPerformance::GetFaceCount(void)
{
return faceCount;
}
void CPerformance::SetCollisionCheckCount(int count)
{
this->collisionCheckCount = count;
}
int CPerformance::GetCollisionCheckCount(void)
{
return collisionCheckCount;
}
bool CPerformance::IsSpatialPartition(void)
{
return usingSpatialPartitioning;
}
void CPerformance::SetIsSpatialPartition(bool x)
{
this->usingSpatialPartitioning = x;
}
bool CPerformance::IsSceneGraph(void)
{
return usingSceneGraph;
}
void CPerformance::SetIsSceneGraph(bool x)
{
this->usingSceneGraph = x;
}
bool CPerformance::IsOrthoView(void)
{
return orthoView;
}
void CPerformance::SetIsOrthoView(bool x)
{
this->orthoView = x;
}
bool CPerformance::IsFrustumView(void)
{
return frustumCull;
}
void CPerformance::SetIsFrustumView(bool x)
{
this->frustumCull = x;
}
bool CPerformance::IsHighLODMode(void)
{
return HighLODMode;
}
void CPerformance::SetIsHighLODMode(bool x)
{
this->HighLODMode = x;
}
bool CPerformance::IsLowLODMode(void)
{
return LowLODMode;
}
void CPerformance::SetIsLowLODMode(bool x)
{
this->LowLODMode = x;
}
bool CPerformance::IsViewTest(void)
{
return viewTest;
}
void CPerformance::SetIsViewTest(bool x)
{
this->viewTest = x;
}
CPerformance::CPerformance(void) :
faceCount(0),
collisionCheckCount(0),
usingSceneGraph(false),
usingSpatialPartitioning(false),
orthoView(false),
frustumCull(false),
HighLODMode(false),
LowLODMode(false),
viewTest(true)
{
}
|
beb271100dbe6189d592589eb83e0b76fc354b9e | 0ac7388d092db127a5f34952a985ee3cfb3ca028 | /deps/libgdal/gdal/ogr/ogrsf_frmts/tiger/tigerpip.cpp | ca25d22142cf1ad927d8aec1d31a3764d58ffe2c | [
"LicenseRef-scancode-warranty-disclaimer",
"SunPro",
"LicenseRef-scancode-info-zip-2005-02",
"BSD-3-Clause",
"MIT",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | mmomtchev/node-gdal-async | 49161ab6864341b1f0dd8b656c74290c63061c77 | 5c75d3d98989c4c246e54bb7ccff3a00d5cc3417 | refs/heads/main | 2023-08-07T11:44:44.011002 | 2023-07-30T17:41:18 | 2023-07-30T17:41:18 | 300,949,372 | 96 | 18 | Apache-2.0 | 2023-09-13T17:43:40 | 2020-10-03T18:28:43 | C++ | UTF-8 | C++ | false | false | 3,584 | cpp | tigerpip.cpp | /******************************************************************************
*
* Project: TIGER/Line Translator
* Purpose: Implements TigerPIP, providing access to .RTP files.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 1999, Frank Warmerdam
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
#include "ogr_tiger.h"
#include "cpl_conv.h"
static const char FILE_CODE[] = "P";
static const TigerFieldInfo rtP_2002_fields[] = {
// fieldname fmt type OFTType beg end len bDefine bSet
{"MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0},
{"FILE", 'L', 'N', OFTInteger, 6, 10, 5, 1, 1},
{"CENID", 'L', 'A', OFTString, 11, 15, 5, 1, 1},
{"POLYID", 'R', 'N', OFTInteger, 16, 25, 10, 1, 1},
{"POLYLONG", 'R', 'N', OFTInteger, 26, 35, 10, 1, 1},
{"POLYLAT", 'R', 'N', OFTInteger, 36, 44, 9, 1, 1},
{"WATER", 'L', 'N', OFTInteger, 45, 45, 1, 1, 1},
};
static const TigerRecordInfo rtP_2002_info = {
rtP_2002_fields, sizeof(rtP_2002_fields) / sizeof(TigerFieldInfo), 45};
static const TigerFieldInfo rtP_fields[] = {
// fieldname fmt type OFTType beg end len bDefine bSet
{"MODULE", ' ', ' ', OFTString, 0, 0, 8, 1, 0},
{"FILE", 'L', 'N', OFTString, 6, 10, 5, 1, 1},
{"STATE", 'L', 'N', OFTInteger, 6, 7, 2, 1, 1},
{"COUNTY", 'L', 'N', OFTInteger, 8, 10, 3, 1, 1},
{"CENID", 'L', 'A', OFTString, 11, 15, 5, 1, 1},
{"POLYID", 'R', 'N', OFTInteger, 16, 25, 10, 1, 1}};
static const TigerRecordInfo rtP_info = {
rtP_fields, sizeof(rtP_fields) / sizeof(TigerFieldInfo), 44};
/************************************************************************/
/* TigerPIP() */
/************************************************************************/
TigerPIP::TigerPIP(OGRTigerDataSource *poDSIn,
CPL_UNUSED const char *pszPrototypeModule)
: TigerPoint(nullptr, FILE_CODE)
{
poDS = poDSIn;
poFeatureDefn = new OGRFeatureDefn("PIP");
poFeatureDefn->Reference();
poFeatureDefn->SetGeomType(wkbPoint);
if (poDS->GetVersion() >= TIGER_2002)
{
psRTInfo = &rtP_2002_info;
}
else
{
psRTInfo = &rtP_info;
}
AddFieldDefns(psRTInfo, poFeatureDefn);
}
OGRFeature *TigerPIP::GetFeature(int nRecordId)
{
return TigerPoint::GetFeature(nRecordId, 26, 35, 36, 44);
}
|
1baf79c528eab8ae47311f8b2ac84f9ca8c6c111 | 8c91ef87f4fb5f7d1e1aabb96dc9431654e1e340 | /Lib/EyerDASH/EyerDASH.hpp | c3dd2a9c19f01535ca9491a63e924e48fd62e1a5 | [] | no_license | mehome/EyerLib | 96eff7a186d0fb5a128c436a7bdbb64502c679bc | 08454824f5e300799ff04bb223c8f83ed5f5b753 | refs/heads/master | 2022-12-25T09:42:45.206796 | 2020-09-22T08:30:06 | 2020-09-22T08:30:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 109 | hpp | EyerDASH.hpp | #ifndef EYER_LIB_DASH_H
#define EYER_LIB_DASH_H
#include "EyerMPD.hpp"
#include "EyerDASHReader.hpp"
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.