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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cae9de73d46ee049510db4fd19901182a8829c67
|
72102e9f9106dbb1a6cee25f55c8bcf5ac014f36
|
/HackerEarth/October18Circuits/QuestionPaper.cpp
|
a68f5bfadc4e08a8bcc9954ae74a16aed34360e6
|
[] |
no_license
|
harshitdiit/CompetitiveCoding
|
07ad7b08f596395614fbecfaa68837b56a3be539
|
c5c35d8d360eff227d572132a16d7d7c36e184bb
|
refs/heads/master
| 2021-08-17T08:30:42.594898
| 2020-04-08T00:50:01
| 2020-04-08T00:50:01
| 154,908,713
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 467
|
cpp
|
QuestionPaper.cpp
|
#include<bits/stdc++.h>
using namespace std;
int gcd(int A,int B){
if(A==0)
return B;
return gcd(B%A, A);
}
int main(){
int T;
cin>>T;
while(T--){
int N, a, b, combis;
cin>>N>>a>>b;
int A = min(a,b)/gcd(a,b);
int B = max(a,b)/gcd(a,b);
int S=A+B;
int diff = N-S;
combis = ((N+1)*(N+2))/2 - (diff>=0?((diff+1)*(diff+2))/2:0);
cout<<combis<<endl;
}
return 0;
}
|
56d08c454b683cd8346d1f6d9e74fd8db5858e09
|
34880511948870687a27160e067d572ffe16c076
|
/core-cpp/src/main/c++/javolution/lang/Runnable.hpp
|
e4a609162ceb86c117757e3376c0e44416c4ceb7
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
alicanalbayrak/javolution
|
60a7482b7fa309155998a75cdabf2b171a85b48b
|
1bed60dee5c9ab358680181544962b2df84c8c14
|
refs/heads/master
| 2021-01-13T04:20:24.437022
| 2016-12-23T18:24:31
| 2016-12-23T18:24:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,013
|
hpp
|
Runnable.hpp
|
/*
* Javolution - Java(TM) Solution for Real-Time and Embedded Systems
* Copyright (C) 2012 - Javolution (http://javolution.org/)
* All rights reserved.
*/
#ifndef _JAVOLUTION_LANG_RUNNABLE_HPP
#define _JAVOLUTION_LANG_RUNNABLE_HPP
#include "javolution/lang/Object.hpp"
namespace javolution {
namespace lang {
class Runnable_API;
typedef Type::Handle<Runnable_API> Runnable;
}
}
/**
* This interface should be implemented by any class whose instances are
* intended to be executed by a thread.
*
* @see <a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html">
* Java - Runnable</a>
* @version 1.0
*/
class javolution::lang::Runnable_API : public virtual javolution::lang::Object_API {
public:
/**
* When an object implementing interface Runnable is used to create a
* thread, starting the thread causes the object's run method to be called
* in that separately executing thread.
*/
virtual void run() = 0;
};
#endif
|
da6e2bc5fb27e611067f3e0831ae5ce5c5f5620b
|
00693763ac68c6151211e19355e633e45cecbbb4
|
/Fourier_Transform/ipTool.cpp
|
09c8c8066c16225762b471dbd33af25947c4fc4c
|
[] |
no_license
|
sjitb/ImageAlgorithms
|
a735838309bdf0044689090c561146707d733390
|
9b348096cc11897eee8b40e4b0f49a507eacb596
|
refs/heads/master
| 2020-12-24T13:17:08.438511
| 2020-01-23T07:30:36
| 2020-01-23T07:30:36
| 38,796,133
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 22,861
|
cpp
|
ipTool.cpp
|
// ipTool.cpp: implementation of the ipTool class.
// Please see the README.txt for comments
//////////////////////////////////////////////////////////////////////
#include "ipTool.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ipTool::ipTool(){}
ipTool::~ipTool(){}
void ipTool::ppm2i(Image &src, Image &tgt) {
tgt.initialize(src.NR,src.NC);
for(int i = 0; i < src.NR; i++)
for(int j = 0; j < src.NC; j++) {
int r,g,b;
double h,s,in;
r=src(i,j,RED);
g=src(i,j,GREEN);
b=src(i,j,BLUE);
rgb2hsi(r,g,b,h,s,in);
tgt(i,j,RED) = (int)in;
tgt(i,j,BLUE) = (int)in;
tgt(i,j,GREEN) = (int)in;
}
}
void ipTool::PassFilter(Image &src, ROI &roi, Image &tgt, Image &tgt2, char* filt) {
int M=src.NR;
int N=src.NC;
fftw_real a[M][2*(N/2+1)], b[M][2*(N/2+1)], c[M][N];
fftw_complex *A, *B, C[M][N/2+1],D[M][N];
rfftwnd_plan p, pinv;
fftw_real scale = 1.0 / (M * N);
int i, j;
/* create plan for FFT; */
p = rfftw2d_create_plan(M, N, FFTW_REAL_TO_COMPLEX,
FFTW_ESTIMATE | FFTW_IN_PLACE);
/* create plan for IFFT; */
pinv = rfftw2d_create_plan(M, N, FFTW_COMPLEX_TO_REAL,
FFTW_ESTIMATE);
/* aliases for accessing complex transform outputs: */
A = (fftw_complex*) &a[0][0];
B = (fftw_complex*) &b[0][0];
/* let a[i][j]=src(i,j,RED), then image data is stored in 'a' */
for (i = 0; i < M; ++i)
for (j = 0; j < N; ++j) {
a[i][j] =src(i,j,RED) ;
}
/* Fast Fourier Transform: save the result of FFT in 'A' */
rfftwnd_one_real_to_complex(p, &a[0][0], NULL);
/********************************************************************/
int thresh = roi.roiList[0].thresh;
if (strncasecmp(filt,"FFT",MAXLEN)==0)
for (i = 0; i < M; ++i)
for (j = 0; j < N/2+1; ++j) {
int ij = i*(N/2+1) + j;
B[ij].re=1;
B[ij].im=0;
}
if (strncasecmp(filt,"LPF",MAXLEN)==0)
for (i = 0; i < M; ++i)
for (j = 0; j < N/2+1; ++j) {
double distTop = 0;
double distBot = 0;
int ij = i*(N/2+1) + j;
distTop = sqrt(pow(i,2)+pow(j,2));
distBot = sqrt(pow(M-i,2)+pow(j,2));
if( distTop < thresh || distBot < thresh) {
B[ij].re=1;
B[ij].im=0;
} else {
B[ij].re=0;
B[ij].im=0;
}
}
if (strncasecmp(filt,"HPF",MAXLEN)==0)
for (i = 0; i < M; ++i)
for (j = 0; j < N/2+1; ++j) {
double distTop = 0;
double distBot = 0;
int ij = i*(N/2+1) + j;
distTop = sqrt(pow(i,2)+pow(j,2));
distBot = sqrt(pow(M-i,2)+pow(j,2));
if( distTop > thresh && distBot > thresh) {
B[ij].re=1;
B[ij].im=0;
} else {
B[ij].re=0;
B[ij].im=0;
}
}
if (strncasecmp(filt,"BPF",MAXLEN)==0) {
int thresh2 = roi.roiList[0].winSize;
for (i = 0; i < M; ++i)
for (j = 0; j < N/2+1; ++j) {
double distTop = 0;
double distBot = 0;
int ij = i*(N/2+1) + j;
distTop = sqrt(pow(i,2)+pow(j,2));
distBot = sqrt(pow(M-i,2)+pow(j,2));
if( (distTop > thresh2 && distBot > thresh2) && (distTop < thresh || distBot < thresh) ) {
B[ij].re=1;
B[ij].im=0;
} else {
B[ij].re=0;
B[ij].im=0;
}
}
}
/********************************************************************/
/* Mutiply image and filter in Fourier Domain */
for (i = 0; i < M; ++i)
for (j = 0; j < N/2+1; ++j) {
int ij = i*(N/2+1) + j;
C[i][j].re = (A[ij].re * B[ij].re
- A[ij].im * B[ij].im) * scale;
C[i][j].im = (A[ij].re * B[ij].im
+ A[ij].im * B[ij].re) * scale;
}
/* Inverse transform to get c, the convolution of a and b;
this has the side effect of overwriting C */
rfftwnd_one_complex_to_real(pinv, &C[0][0], &c[0][0]);
rfftwnd_destroy_plan(p);
rfftwnd_destroy_plan(pinv);
/* Save Fourier Amplitude Image */
for (i=0; i<M; ++i)
for (j=0; j<N; ++j) {
int ij = abs((M/2-i))*(N/2+1) + abs(N/2+1-j);
tgt2(i,j,RED)=abs((int)(a[abs(M/2-i)][abs(N/2-j)]*B[ij].re*scale*255.0));
}
/* Save the output image in 'tgt' */
for (i=0; i<M; ++i)
for (j=0; j<N; ++j)
if(roi.InROI(i,j)!=-1)
tgt(i,j,RED)=(int)c[i][j];
else
tgt(i,j,RED)=src(i,j,RED);
}
//Assignment 2. See below for Assignment 3.
void ipTool::pgm2ppm(Image &src, Image &tgt) {
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,RED);
tgt(i,j,BLUE)=src(i,j,RED);
}
}
}
void ipTool::ppm2pgm(Image &src, Image &tgt) {
for(int i=0;i<tgt.NR;i++)
for(int j=0;j<tgt.NC;j++)
tgt(i,j,RED)=(src(i,j,RED)+src(i,j,GREEN)+src(i,j,BLUE))/3;
}
//static void ROIThresh(Image& src, ROI roi, Image& tgt);
void ipTool::ROIThresh(Image &src, ROI &roi, Image &tgt) {
for(int i=0;i<tgt.NR;i++)
for(int j=0;j<tgt.NC;j++)
if(roi.InROI(i,j)!=-1)
if( src(i,j,RED) > roi.roiList[roi.InROI(i,j)].thresh )
tgt(i,j,RED)=255;
else
tgt(i,j,RED)=0;
else
tgt(i,j,RED)=src(i,j,RED);
}
//static void OutputROI(Image& src, ROI roi, Image& tgt);
void ipTool::OutputROI(Image &src, ROI &roi, Image &tgt) {
for(int i=0;i<tgt.NR;i++)
for(int j=0;j<tgt.NC;j++)
if(roi.InROI(i,j)!=-1) {
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt(i,j,GREEN)=src(i,j,GREEN);
} else {
tgt(i,j,RED)=0;
tgt(i,j,BLUE)=0;
tgt(i,j,GREEN)=0;
}
}
//static void GrayArithmetic(Image &src,ROI &roi,Image &tgt);
void ipTool::GrayArithmetic(Image &src,ROI &roi,Image &tgt) {
for(int i=0;i<tgt.NR;i++)
for(int j=0;j<tgt.NC;j++)
if (roi.InROI(i,j)!=-1)
if(src(i,j,RED)+roi.roiList[roi.InROI(i,j)].thresh>255||src(i,j,RED)+roi.roiList[roi.InROI(i,j)].thresh<0)
if(src(i,j,RED)+roi.roiList[roi.InROI(i,j)].thresh>255)
tgt(i,j,RED)=255;
else
tgt(i,j,RED)=0;
else
tgt(i,j,RED)=src(i,j,RED)+roi.roiList[roi.InROI(i,j)].thresh;
else
tgt(i,j,RED)=src(i,j,RED);
}
//static void AdaptiveThresh(Image &src,ROI roi,Image &tgt);
void ipTool::AdaptiveThresh(Image &src,ROI &roi,Image &tgt)
{
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1)
{
int thresh=roi.roiList[roi.InROI(i,j)].thresh;
int winsize=roi.roiList[roi.InROI(i,j)].winSize;
double avg = 0;
double nThresh = 0;
int valid = 0;
for(int di = (winsize-1)/-2;di<(winsize-1)/2;di++)
for(int dj = (winsize-1)/-2;dj<(winsize-1)/2;dj++)
{
if(!(i+di>tgt.NR||i+di<0||j+dj>tgt.NC||j+dj<0))
{
if(roi.InROI(i+di,j+dj)!=-1)
{
avg += src(i+di,j+dj,RED);
valid++;
}
}
}
avg /= valid;
nThresh = (double)(thresh)+avg;
if (src(i,j,RED)>nThresh)
tgt(i,j,RED)=255;
else
tgt(i,j,RED)=0;
}
else
tgt(i,j,RED)=src(i,j,RED);
}
}
}
//static void ColorThresh(Image &src,ROI roi,Image &tgt);
void ipTool::ColorThresh(Image &src,ROI &roi,Image &tgt)
{
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1)
{
double radius=roi.roiList[roi.InROI(i,j)].radius;
int cred=roi.roiList[roi.InROI(i,j)].cRed;
int cgreen=roi.roiList[roi.InROI(i,j)].cGreen;
int cblue=roi.roiList[roi.InROI(i,j)].cBlue;
double dist = sqrt(pow(src(i,j,RED)-cred,2)+pow(src(i,j,GREEN)-cgreen,2)+pow(src(i,j,BLUE)-cblue,2));
if(dist < radius) {
tgt(i,j,RED)=0;
tgt(i,j,BLUE)=0;
tgt(i,j,GREEN)=0;
}else{
tgt(i,j,RED)=255;
tgt(i,j,BLUE)=255;
tgt(i,j,GREEN)=255;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void ColorArithmetic(Image &src,ROI roi,Image &tgt);
void ipTool::ColorArithmetic(Image &src, ROI &roi,Image &tgt)
{
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1)
{
int cred=roi.roiList[roi.InROI(i,j)].cRed;
int cgreen=roi.roiList[roi.InROI(i,j)].cGreen;
int cblue=roi.roiList[roi.InROI(i,j)].cBlue;
if(src(i,j,RED)+cred>255||src(i,j,RED)+cred<0)
if(src(i,j,RED)+cred>255)
tgt(i,j,RED)=255;
else
tgt(i,j,RED)=0;
else
tgt(i,j,RED)=src(i,j,RED)+cred;
if(src(i,j,GREEN)+cgreen>255||src(i,j,GREEN)+cgreen<0)
if(src(i,j,GREEN)+cgreen>255)
tgt(i,j,GREEN)=255;
else
tgt(i,j,GREEN)=0;
else
tgt(i,j,GREEN)=src(i,j,GREEN)+cgreen;
if(src(i,j,BLUE)+cblue>255||src(i,j,BLUE)+cblue<0)
if(src(i,j,BLUE)+cblue>255)
tgt(i,j,BLUE)=255;
else
tgt(i,j,BLUE)=0;
else
tgt(i,j,BLUE)=src(i,j,BLUE)+cblue;
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//Assignment 3
// Sobel for Gray and Color
// rgb2hsi used for color space conversion
void ipTool::rgb2hsi(int r, int g, int b, double &h, double &s, double &i) {
//Compute Intensity
i=double(r+g+b)/3.0;
double red = double(r)/255.0;
double green = double(g)/255.0;
double blue = double(b)/255.0;
if(!(r==0&&b==0&&g==0)) {
red=red/(red+green+blue);
green=green/(red+green+blue);
blue=blue/(red+green+blue);
//Compute saturation
if(r<=g&&r<=b)
s=1.0-3.0*red;
else if(g<=r&&g<=b)
s=1.0-3.0*green;
else
s=1.0-3.0*blue;
s*=255.0;
//Compute Hue
h=acos(0.5*(double(red-green)+double(red-blue))/sqrt(pow(red-green,2)+double(red-blue)*double(green-blue)));
if(b>g)
h=2.0*M_PI-h;
h=h/(2*M_PI)*255.0;
} else { //Gray image
h=0;
s=0;
}
}
void ipTool::hsi2rgb(double h, double s, double i, int &r, int &g, int &b) {
double rt,gt,bt;
if(h>0&&h<2.0/3.0*M_PI) {
rt=((1+(double(s)*cos(h))/(cos(1.0/3.0*M_PI-double(h))))/3.0);
bt=(1-s)/3;
gt=1-b-r;
} else if(h<2.0/3.0*M_PI&&h>4.0/3.0*M_PI) {
gt=(1+(s*cos(h))/(cos(1.0/3.0*M_PI-h)))/3.0;
rt=(1-s)/3;
gt=1-b-r;
} else {
bt=(1+(s*cos(h))/(cos(1.0/3.0*M_PI-h)))/3.0;
gt=(1-s)/3;
rt=1-g-b;
}
r=int(rt*3.0*i);
g=int(gt*3.0*i);
b=int(bt*3.0*i);
}
//static void Sobel(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::Sobel(Image& src, ROI &roi, Image& tgt, Image& tgt2) {
int * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new int[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
int dx = 0;
int dy = 0;
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
dx+=src(i+x,j+y,RED)*mask[x+1][y+1];
dy+=src(i+x,j+y,RED)*mask[y+1][x+1];
}
double amp = sqrt(pow(dx,2)+pow(dy,2));
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
} else {
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelR(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelR(Image& src, ROI &roi, Image& tgt, Image& tgt2){
int * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new int[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
int dx = 0;
int dy = 0;
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
dx+=src(i+x,j+y,RED)*mask[x+1][y+1];
dy+=src(i+x,j+y,RED)*mask[y+1][x+1];
}
double amp = sqrt(pow(dx,2)+pow(dy,2));
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelG(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelG(Image& src, ROI &roi, Image& tgt, Image& tgt2){
int * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new int[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
int dx = 0;
int dy = 0;
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
dx+=src(i+x,j+y,GREEN)*mask[x+1][y+1];
dy+=src(i+x,j+y,GREEN)*mask[y+1][x+1];
}
double amp = sqrt(pow(dx,2)+pow(dy,2));
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelB(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelB(Image& src, ROI &roi, Image& tgt, Image& tgt2){
int * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new int[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
int dx = 0;
int dy = 0;
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
dx+=src(i+x,j+y,BLUE)*mask[x+1][y+1];
dy+=src(i+x,j+y,BLUE)*mask[y+1][x+1];
}
double amp = sqrt(pow(dx,2)+pow(dy,2));
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelRGB(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelRGB(Image& src, ROI &roi, Image& tgt, Image& tgt2){
int * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new int[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
int dx[3] = {0,0,0};
int dy[3] = {0,0,0};
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
dx[0]+=src(i+x,j+y,RED)*mask[x+1][y+1];
dy[0]+=src(i+x,j+y,RED)*mask[y+1][x+1];
dx[1]+=src(i+x,j+y,GREEN)*mask[x+1][y+1];
dy[1]+=src(i+x,j+y,GREEN)*mask[y+1][x+1];
dx[2]+=src(i+x,j+y,BLUE)*mask[x+1][y+1];
dy[2]+=src(i+x,j+y,BLUE)*mask[y+1][x+1];
}
double amp = 0;
for(int l = 0; l < 3; l++)
amp += sqrt(pow(dx[l],2)+pow(dy[l],2))/3.0;
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelH(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelH(Image& src, ROI &roi, Image& tgt, Image& tgt2){
double * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new double[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
double h,s,in;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
double dx[3] = {0,0,0};
double dy[3] = {0,0,0};
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
int r,g,b;
r=src(i+x,j+y,RED);
g=src(i+x,j+y,GREEN);
b=src(i+x,j+y,BLUE);
rgb2hsi(r,g,b,h,s,in);
dx[0]+=h*mask[x+1][y+1];
dy[0]+=h*mask[y+1][x+1];
}
double amp = 0;
for(int l = 0; l < 1; l++)
amp += sqrt(pow(dx[l],2)+pow(dy[l],2))/1.0;
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelS(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelS(Image& src, ROI &roi, Image& tgt, Image& tgt2){
double * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new double[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
double h,s,in;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
double dx[3] = {0,0,0};
double dy[3] = {0,0,0};
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
int r,g,b;
r=src(i+x,j+y,RED);
g=src(i+x,j+y,GREEN);
b=src(i+x,j+y,BLUE);
rgb2hsi(r,g,b,h,s,in);
dx[0]+=s*mask[x+1][y+1];
dy[0]+=s*mask[y+1][x+1];
}
double amp = 0;
for(int l = 0; l < 1; l++)
amp += sqrt(pow(dx[l],2)+pow(dy[l],2))/1.0;
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelI(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelI(Image& src, ROI &roi, Image& tgt, Image& tgt2) {
double * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new double[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
double h,s,in;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1){
double dx[3] = {0,0,0};
double dy[3] = {0,0,0};
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
int r,g,b;
r=src(i+x,j+y,RED);
g=src(i+x,j+y,GREEN);
b=src(i+x,j+y,BLUE);
rgb2hsi(r,g,b,h,s,in);
dx[0]+=in*mask[x+1][y+1];
dy[0]+=in*mask[y+1][x+1];
}
double amp = 0;
for(int l = 0; l < 1; l++)
amp += sqrt(pow(dx[l],2)+pow(dy[l],2))/1.0;
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
} else {
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
//static void SobelHSI(Image& src, ROI &roi, Image& tgt, Image& tgt2);
void ipTool::SobelHSI(Image& src, ROI &roi, Image& tgt, Image& tgt2) {
double * mask [3];
for(int i = 0; i < 3; i++)
mask[i] = new double[3];
mask[0][0] = -1;
mask[0][1] = 0;
mask[0][2] = 1;
mask[1][0] = -2;
mask[1][1] = 0;
mask[1][2] = 2;
mask[2][0] = -1;
mask[2][1] = 0;
mask[2][2] = 1;
double h,s,in;
for(int i=0;i<tgt.NR;i++){
for(int j=0;j<tgt.NC;j++){
if (roi.InROI(i,j)!=-1) {
double dx[3] = {0,0,0};
double dy[3] = {0,0,0};
for(int x = -1; x <=1; x++)
for(int y=-1; y<=1; y++)
if(i+x&&j+y) {
int r,g,b;
r=src(i+x,j+y,RED);
g=src(i+x,j+y,GREEN);
b=src(i+x,j+y,BLUE);
rgb2hsi(r,g,b,h,s,in);
dx[0]+=h*mask[x+1][y+1];
dy[0]+=h*mask[y+1][x+1];
dx[1]+=s*mask[x+1][y+1];
dy[1]+=s*mask[y+1][x+1];
dx[2]+=i*mask[x+1][y+1];
dy[2]+=i*mask[y+1][x+1];
}
double amp = 0;
for(int l = 0; l < 3; l++)
amp += sqrt(pow(dx[l],2)+pow(dy[l],2))/3.0;
tgt(i,j,RED)=int(amp);
tgt(i,j,GREEN)=int(amp);
tgt(i,j,BLUE)=int(amp);
if(amp > roi.roiList[roi.InROI(i,j)].thresh) {
tgt2(i,j,RED)=int(amp);
tgt2(i,j,GREEN)=int(amp);
tgt2(i,j,BLUE)=int(amp);
}else{
tgt2(i,j,RED)=0;
tgt2(i,j,GREEN)=0;
tgt2(i,j,BLUE)=0;
}
}
else
{
tgt(i,j,RED)=src(i,j,RED);
tgt(i,j,GREEN)=src(i,j,GREEN);
tgt(i,j,BLUE)=src(i,j,BLUE);
tgt2(i,j,RED)=src(i,j,RED);
tgt2(i,j,GREEN)=src(i,j,GREEN);
tgt2(i,j,BLUE)=src(i,j,BLUE);
}
}
}
}
|
169e76221583a9b4f46bd60e60ae07bab2bdcdf8
|
457bff26da2a4205d94892727553e372b358cc0e
|
/more_map_main.cpp
|
2efff22ba783c2473ceebad19c7236aee0f938dc
|
[] |
no_license
|
karta2164480/DSA_final_project
|
e180c71398cb9bdb5905bfd5413bea9a995866ed
|
faa4fd68e2e1df308dd8a90a3984f2356c8d1d76
|
refs/heads/master
| 2022-11-06T05:15:58.838368
| 2020-06-22T13:08:37
| 2020-06-22T13:08:37
| 266,141,093
| 1
| 0
| null | 2020-06-05T07:42:44
| 2020-05-22T15:13:47
|
C++
|
UTF-8
|
C++
| false
| false
| 7,264
|
cpp
|
more_map_main.cpp
|
#include "string.h" //strtok
#include <map> //map
#include <vector> //vector
#include <algorithm> //sort
#include "email.h" //email
#include "parser.h" //parser
#define MAX_STRING_LENGTH 10000
int main(){
string opr;
unsigned int to_delete_id;
char file_path[MAX_STRING_LENGTH];
char query_filter[MAX_STRING_LENGTH];
/* main data structure */
map< unsigned int, Email* > id_map;
map< string, map< string, multimap< long long, Email* > > > from_to_date_map;
map< string, multimap< long long, Email* > > to_date_map;
multimap< long long, Email* > date_map;
map< int, map< int, int > > length_id_map;
int cnt = 0;
while(cin >> opr){
switch(opr[0]){
case 'a': { //add
cin >> file_path;
Email *mail = new Email(file_path);
bool duplicated = false;
if(id_map[mail->getMessage_ID()] != NULL)
duplicated = true;
if(duplicated){
cout << "-" << endl;
delete mail;
}else{
id_map[mail->getMessage_ID()] = mail;
pair< long long, Email* > mp(mail->getDate(), mail);
from_to_date_map[mail->getFrom()][mail->getTo()].insert(mp);
to_date_map[mail->getTo()].insert(mp);
date_map.insert(mp);
length_id_map[mail->getLength()][mail->getMessage_ID()] = 1; //1 means exist
cnt++;
cout << cnt << endl;
}
break;
}
case 'r': { //remove
cin >> to_delete_id;
bool found = false;
Email *target = id_map[to_delete_id];
if(target != NULL){
found = true;
from_to_date_map[target->getFrom()][target->getTo()].erase(target->getDate());
if(from_to_date_map[target->getFrom()][target->getTo()].empty()){
from_to_date_map[target->getFrom()].erase(target->getTo());
if(from_to_date_map[target->getFrom()].empty())
from_to_date_map.erase(target->getFrom());
}
pair< multimap< long long, Email* >::iterator,
multimap< long long, Email* >::iterator > ret;
ret = to_date_map[target->getTo()].equal_range(target->getDate());
multimap< long long, Email* >::iterator it;
if(ret.first == ret.second){
to_date_map[target->getTo()].erase(ret.first);
to_date_map.erase(target->getTo());
}else{
for(it = ret.first; it != ret.second; ++it){
if(it->second->getMessage_ID() == to_delete_id){
to_date_map[target->getTo()].erase(it);
break;
}
}
}
id_map.erase(target->getMessage_ID());
ret = date_map.equal_range(target->getDate());
for(it = ret.first; it != ret.second; ++it){
if(it->second->getMessage_ID() == to_delete_id){
date_map.erase(it);
break;
}
}
length_id_map[target->getLength()].erase(target->getMessage_ID());
if(length_id_map[target->getLength()].empty())
length_id_map.erase(target->getLength());
delete target;
cnt--;
cout << cnt << endl;
}
if(!found)
cout << "-" << endl;
break;
}
case 'l': { //longest
if(cnt == 0)
cout << "-" << endl;
else{
map< int, map< int, int > >::reverse_iterator rit = length_id_map.rbegin();
cout << (rit->second).begin()->first << " " << rit->first << endl;
}
break;
}
case 'q': { //query
fgets(query_filter, MAX_STRING_LENGTH, stdin);
if(cnt == 0){
cout << "-" << endl;
break;
}
bool checkFrom = false, checkTo = false, checkDate = false;
string from, to, expr;
long long start_date, end_date;
char d1[MAX_STRING_LENGTH], d2[MAX_STRING_LENGTH];
int d1cnt = 0, d2cnt = 0;
char *token = strtok(query_filter, " \n");
while(token != NULL){
if(token[0] == '-' && token[1] != 'd'){
string temp;
for(int i = 2; i < strlen(token); i++){
if(isalpha(token[i]))
temp.push_back(tolower(token[i]));
else if(isdigit(token[i]))
temp.push_back(token[i]);
}
switch(token[1]){
case 'f':
checkFrom = true;
from = temp;
break;
case 't':
checkTo = true;
to = temp;
break;
}
}else if(token[0] == '-' && token[1] == 'd'){
checkDate = true;
bool first = true;
for(int i = 2; i < strlen(token); i++){
if(token[i] == '~'){
first = false;
continue;
}
if(first){
d1[d1cnt] = token[i];
d1cnt++;
}
else{
d2[d2cnt] = token[i];
d2cnt++;
}
}
char *eptr;
if(d1cnt == 0)
start_date = 0;
else{
start_date = strtoll(d1, &eptr, 10);
}
if(d2cnt == 0)
end_date = 500000000000; //Bigger than all valid date
else{
end_date = strtoll(d2, &eptr, 10);
}
}else{
for(int i = 0; i < strlen(token); i++){
if(isalpha(token[i]))
expr.push_back(tolower(token[i]));
else
expr.push_back(token[i]);
}
}
token = strtok(NULL, " \n");
}
Parser parser(expr);
vector< unsigned int > chosen;
bool need_sort = true;
vector< multimap< long long, Email* >* > search_list;
if(checkFrom){
if(checkTo)
search_list.push_back(&from_to_date_map[from][to]);
else{
map< string, multimap< long long, Email* > >::iterator it, end;
it = from_to_date_map[from].begin();
end = from_to_date_map[from].end();
for(; it != end; ++it)
search_list.push_back(&(it->second));
}
}else if(checkTo){
search_list.push_back(&to_date_map[to]);
}else{
search_list.push_back(&date_map);
}
if(checkDate){
for(int i = 0; i < search_list.size(); i++){
multimap< long long, Email* >::iterator it, end;
it = search_list[i]->lower_bound(start_date);
end = search_list[i]->upper_bound(end_date);
for(; it != end; ++it)
if(parser.evaluate(it->second->getContent()))
chosen.push_back(it->second->getMessage_ID());
}
/*
if(has_filtered){
for(int i = 0; i < search_list.size(); i++){
map< long long, Email* >::iterator it, end;
it = search_list[i]->lower_bound(start_date);
end = search_list[i]->upper_bound(end_date);
for(; it != end; ++it)
if(parser.evaluate(it->second->getContent()))
chosen.push_back(it->second->getMessage_ID());
}
}else{
multimap< long long, Email* >::iterator it, end;
it = date_map.lower_bound(start_date);
end = date_map.lower_bound(end_date);
for(; it != end; ++it)
if(parser.evaluate(it->second->getContent()))
chosen.push_back(it->second->getMessage_ID());
}
*/
}else{
for(int i = 0; i < search_list.size(); i++){
multimap< long long, Email* >::iterator it, end;
it = search_list[i]->begin();
end = search_list[i]->end();
for(; it != end; ++it)
if(parser.evaluate(it->second->getContent()))
chosen.push_back(it->second->getMessage_ID());
}
}
sort(chosen.begin(), chosen.end());
if(chosen.size() != 0){
sort(chosen.begin(), chosen.end());
for(int i = 0; i < chosen.size(); i++)
cout << chosen[i] << " ";
cout << endl;
}else{
cout << "-" << endl;
}
break;
}
}
}
return 0;
}
|
46274a1dd5379af6e2e5cd476d7d87cd78e5e946
|
47ab3c1144428bfcdad475e404182e49fe18aa3a
|
/30DaysOfCode/2DArrays.cpp
|
3ff6aacd5d2c7b24fd8e8527d03888f8624c1342
|
[] |
no_license
|
adc-code/HackerRankPractice
|
0748e4b4fa6c3fefc156d95826762fdbad955941
|
031e56bbd2311b5375609e2469f280a567d1dbbe
|
refs/heads/master
| 2022-12-25T02:57:18.089761
| 2020-09-27T20:42:12
| 2020-09-27T20:42:12
| 277,374,557
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 742
|
cpp
|
2DArrays.cpp
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<vector<int>> arr(6);
for (int i = 0; i < 6; i++) {
arr[i].resize(6);
for (int j = 0; j < 6; j++) {
cin >> arr[i][j];
}
cin.ignore(numeric_limits<streamsize>::max(), '\n');
}
int maxValue = -99999999;
for (int i = 1; i < 5; i++)
{
for (int j = 1; j < 5; j++)
{
int hg = arr[i-1][j-1] + arr[i-1][j] + arr[i-1][j+1]
+ arr[i][j] +
arr[i+1][j-1] + arr[i+1][j] + arr[i+1][j+1];
if (hg > maxValue)
maxValue = hg;
}
}
cout << maxValue << endl;
return 0;
}
|
2a76c39c46070b2245e34ae35f5671bacc1c5d12
|
033679d90f6a483e7a07c8ac34130affe25dc7a5
|
/src/nfa/shengcompile.cpp
|
c4094cedc720968fecc0ed0c9e6dfb58431c807c
|
[
"BSD-3-Clause",
"BSL-1.0",
"BSD-2-Clause"
] |
permissive
|
kunpengcompute/hyperscan
|
199948aa6a40126a44a22bc26aaca2786f84e8fe
|
ef46fc7c88b667d6a3b1ec54d001b417612c3759
|
refs/heads/aarch64
| 2023-08-06T13:57:24.146289
| 2021-03-19T11:08:15
| 2021-03-19T11:08:15
| 233,202,598
| 83
| 28
|
NOASSERTION
| 2020-11-27T03:23:26
| 2020-01-11T08:49:52
|
C++
|
UTF-8
|
C++
| false
| false
| 17,110
|
cpp
|
shengcompile.cpp
|
/*
* Copyright (c) 2016-2017, Intel Corporation
*
* 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 Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL 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 "shengcompile.h"
#include "accel.h"
#include "accelcompile.h"
#include "shufticompile.h"
#include "trufflecompile.h"
#include "util/alloc.h"
#include "util/bitutils.h"
#include "util/charreach.h"
#include "util/compare.h"
#include "util/container.h"
#include "util/order_check.h"
#include "util/report_manager.h"
#include "util/unaligned.h"
#include "grey.h"
#include "nfa_internal.h"
#include "sheng_internal.h"
#include "ue2common.h"
#include "util/compile_context.h"
#include "util/make_unique.h"
#include "util/verify_types.h"
#include "util/simd_types.h"
#include <map>
#include <vector>
#include <sstream>
#include <boost/range/adaptor/map.hpp>
using namespace std;
using boost::adaptors::map_keys;
namespace ue2 {
#define ACCEL_DFA_MAX_OFFSET_DEPTH 4
/** Maximum tolerated number of escape character from an accel state.
* This is larger than nfa, as we don't have a budget and the nfa cheats on stop
* characters for sets of states */
#define ACCEL_DFA_MAX_STOP_CHAR 160
/** Maximum tolerated number of escape character from a sds accel state. Larger
* than normal states as accelerating sds is important. Matches NFA value */
#define ACCEL_DFA_MAX_FLOATING_STOP_CHAR 192
struct dfa_info {
accel_dfa_build_strat &strat;
raw_dfa &raw;
vector<dstate> &states;
dstate &floating;
dstate &anchored;
bool can_die;
explicit dfa_info(accel_dfa_build_strat &s)
: strat(s), raw(strat.get_raw()), states(raw.states),
floating(states[raw.start_floating]),
anchored(states[raw.start_anchored]), can_die(dfaCanDie(raw)) {}
// returns adjusted size
size_t size() const {
return can_die ? states.size() : states.size() - 1;
}
// expects adjusted index
dstate &operator[](dstate_id_t idx) {
return states[raw_id(idx)];
}
dstate &top(dstate_id_t idx) {
if (isDead(idx)) {
return floating;
}
return next(idx, TOP);
}
dstate &next(dstate_id_t idx, u16 chr) {
auto &src = (*this)[idx];
auto next_id = src.next[raw.alpha_remap[chr]];
return states[next_id];
}
// get original idx from adjusted idx
dstate_id_t raw_id(dstate_id_t idx) {
assert(idx < size());
// if DFA can't die, shift all indices left by 1
return can_die ? idx : idx + 1;
}
bool isDead(dstate &state) {
return raw_id(state.impl_id) == DEAD_STATE;
}
bool isDead(dstate_id_t idx) {
return raw_id(idx) == DEAD_STATE;
}
private:
static bool dfaCanDie(raw_dfa &rdfa) {
for (unsigned chr = 0; chr < 256; chr++) {
for (dstate_id_t state = 0; state < rdfa.states.size(); state++) {
auto succ = rdfa.states[state].next[rdfa.alpha_remap[chr]];
if (succ == DEAD_STATE) {
return true;
}
}
}
return false;
}
};
namespace {
struct raw_report_list {
flat_set<ReportID> reports;
raw_report_list(const flat_set<ReportID> &reports_in,
const ReportManager &rm, bool do_remap) {
if (do_remap) {
for (auto &id : reports_in) {
reports.insert(rm.getProgramOffset(id));
}
} else {
reports = reports_in;
}
}
bool operator<(const raw_report_list &b) const {
return reports < b.reports;
}
};
struct raw_report_info_impl : public raw_report_info {
vector<raw_report_list> rl;
u32 getReportListSize() const override;
size_t size() const override;
void fillReportLists(NFA *n, size_t base_offset,
std::vector<u32> &ro /* out */) const override;
};
}
u32 raw_report_info_impl::getReportListSize() const {
u32 rv = 0;
for (const auto &reps : rl) {
rv += sizeof(report_list);
rv += sizeof(ReportID) * reps.reports.size();
}
return rv;
}
size_t raw_report_info_impl::size() const {
return rl.size();
}
void raw_report_info_impl::fillReportLists(NFA *n, size_t base_offset,
vector<u32> &ro) const {
for (const auto &reps : rl) {
ro.push_back(base_offset);
report_list *p = (report_list *)((char *)n + base_offset);
u32 i = 0;
for (const ReportID report : reps.reports) {
p->report[i++] = report;
}
p->count = verify_u32(reps.reports.size());
base_offset += sizeof(report_list);
base_offset += sizeof(ReportID) * reps.reports.size();
}
}
unique_ptr<raw_report_info> sheng_build_strat::gatherReports(
vector<u32> &reports,
vector<u32> &reports_eod,
u8 *isSingleReport,
ReportID *arbReport) const {
DEBUG_PRINTF("gathering reports\n");
const bool remap_reports = has_managed_reports(rdfa.kind);
auto ri = ue2::make_unique<raw_report_info_impl>();
map<raw_report_list, u32> rev;
for (const dstate &s : rdfa.states) {
if (s.reports.empty()) {
reports.push_back(MO_INVALID_IDX);
continue;
}
raw_report_list rrl(s.reports, rm, remap_reports);
DEBUG_PRINTF("non empty r\n");
if (rev.find(rrl) != rev.end()) {
reports.push_back(rev[rrl]);
} else {
DEBUG_PRINTF("adding to rl %zu\n", ri->size());
rev[rrl] = ri->size();
reports.push_back(ri->size());
ri->rl.push_back(rrl);
}
}
for (const dstate &s : rdfa.states) {
if (s.reports_eod.empty()) {
reports_eod.push_back(MO_INVALID_IDX);
continue;
}
DEBUG_PRINTF("non empty r eod\n");
raw_report_list rrl(s.reports_eod, rm, remap_reports);
if (rev.find(rrl) != rev.end()) {
reports_eod.push_back(rev[rrl]);
continue;
}
DEBUG_PRINTF("adding to rl eod %zu\n", s.reports_eod.size());
rev[rrl] = ri->size();
reports_eod.push_back(ri->size());
ri->rl.push_back(rrl);
}
assert(!ri->rl.empty()); /* all components should be able to generate
reports */
if (!ri->rl.empty()) {
*arbReport = *ri->rl.begin()->reports.begin();
} else {
*arbReport = 0;
}
/* if we have only a single report id generated from all accepts (not eod)
* we can take some short cuts */
set<ReportID> reps;
for (u32 rl_index : reports) {
if (rl_index == MO_INVALID_IDX) {
continue;
}
assert(rl_index < ri->size());
insert(&reps, ri->rl[rl_index].reports);
}
if (reps.size() == 1) {
*isSingleReport = 1;
*arbReport = *reps.begin();
DEBUG_PRINTF("single -- %u\n", *arbReport);
} else {
*isSingleReport = 0;
}
return move(ri);
}
u32 sheng_build_strat::max_allowed_offset_accel() const {
return ACCEL_DFA_MAX_OFFSET_DEPTH;
}
u32 sheng_build_strat::max_stop_char() const {
return ACCEL_DFA_MAX_STOP_CHAR;
}
u32 sheng_build_strat::max_floating_stop_char() const {
return ACCEL_DFA_MAX_FLOATING_STOP_CHAR;
}
size_t sheng_build_strat::accelSize() const {
return sizeof(AccelAux);
}
#ifdef DEBUG
static really_inline
void dumpShuffleMask(const u8 chr, const u8 *buf, unsigned sz) {
stringstream o;
for (unsigned i = 0; i < sz; i++) {
o.width(2);
o << (buf[i] & SHENG_STATE_MASK) << " ";
}
DEBUG_PRINTF("chr %3u: %s\n", chr, o.str().c_str());
}
#endif
static
void fillAccelOut(const map<dstate_id_t, AccelScheme> &accel_escape_info,
set<dstate_id_t> *accel_states) {
for (dstate_id_t i : accel_escape_info | map_keys) {
accel_states->insert(i);
}
}
static
u8 getShengState(dstate &state, dfa_info &info,
map<dstate_id_t, AccelScheme> &accelInfo) {
u8 s = state.impl_id;
if (!state.reports.empty()) {
s |= SHENG_STATE_ACCEPT;
}
if (info.isDead(state)) {
s |= SHENG_STATE_DEAD;
}
if (accelInfo.find(info.raw_id(state.impl_id)) != accelInfo.end()) {
s |= SHENG_STATE_ACCEL;
}
return s;
}
static
void fillAccelAux(struct NFA *n, dfa_info &info,
map<dstate_id_t, AccelScheme> &accelInfo) {
DEBUG_PRINTF("Filling accel aux structures\n");
sheng *s = (sheng *)getMutableImplNfa(n);
u32 offset = s->accel_offset;
for (dstate_id_t i = 0; i < info.size(); i++) {
dstate_id_t state_id = info.raw_id(i);
if (accelInfo.find(state_id) != accelInfo.end()) {
s->flags |= SHENG_FLAG_HAS_ACCEL;
AccelAux *aux = (AccelAux *)((char *)n + offset);
info.strat.buildAccel(state_id, accelInfo[state_id], aux);
sstate_aux *saux =
(sstate_aux *)((char *)n + s->aux_offset) + state_id;
saux->accel = offset;
DEBUG_PRINTF("Accel offset: %u\n", offset);
offset += ROUNDUP_N(sizeof(AccelAux), alignof(AccelAux));
}
}
}
static
void populateBasicInfo(struct NFA *n, dfa_info &info,
map<dstate_id_t, AccelScheme> &accelInfo, u32 aux_offset,
u32 report_offset, u32 accel_offset, u32 total_size,
u32 dfa_size) {
n->length = total_size;
n->scratchStateSize = 1;
n->streamStateSize = 1;
n->nPositions = info.size();
n->type = SHENG_NFA;
n->flags |= info.raw.hasEodReports() ? NFA_ACCEPTS_EOD : 0;
sheng *s = (sheng *)getMutableImplNfa(n);
s->aux_offset = aux_offset;
s->report_offset = report_offset;
s->accel_offset = accel_offset;
s->n_states = info.size();
s->length = dfa_size;
s->flags |= info.can_die ? SHENG_FLAG_CAN_DIE : 0;
s->anchored = getShengState(info.anchored, info, accelInfo);
s->floating = getShengState(info.floating, info, accelInfo);
}
static
void fillTops(NFA *n, dfa_info &info, dstate_id_t id,
map<dstate_id_t, AccelScheme> &accelInfo) {
sheng *s = (sheng *)getMutableImplNfa(n);
u32 aux_base = s->aux_offset;
DEBUG_PRINTF("Filling tops for state %u\n", id);
sstate_aux *aux = (sstate_aux *)((char *)n + aux_base) + id;
DEBUG_PRINTF("Aux structure for state %u, offset %zd\n", id,
(char *)aux - (char *)n);
/* we could conceivably end up in an accept/dead state on a top event,
* so mark top as accept/dead state if it indeed is.
*/
auto &top_state = info.top(id);
DEBUG_PRINTF("Top transition for state %u: %u\n", id, top_state.impl_id);
aux->top = getShengState(top_state, info, accelInfo);
}
static
void fillAux(NFA *n, dfa_info &info, dstate_id_t id, vector<u32> &reports,
vector<u32> &reports_eod, vector<u32> &report_offsets) {
sheng *s = (sheng *)getMutableImplNfa(n);
u32 aux_base = s->aux_offset;
auto raw_id = info.raw_id(id);
auto &state = info[id];
sstate_aux *aux = (sstate_aux *)((char *)n + aux_base) + id;
DEBUG_PRINTF("Filling aux and report structures for state %u\n", id);
DEBUG_PRINTF("Aux structure for state %u, offset %zd\n", id,
(char *)aux - (char *)n);
aux->accept = state.reports.empty() ? 0 : report_offsets[reports[raw_id]];
aux->accept_eod =
state.reports_eod.empty() ? 0 : report_offsets[reports_eod[raw_id]];
DEBUG_PRINTF("Report list offset: %u\n", aux->accept);
DEBUG_PRINTF("EOD report list offset: %u\n", aux->accept_eod);
}
static
void fillSingleReport(NFA *n, ReportID r_id) {
sheng *s = (sheng *)getMutableImplNfa(n);
DEBUG_PRINTF("Single report ID: %u\n", r_id);
s->report = r_id;
s->flags |= SHENG_FLAG_SINGLE_REPORT;
}
static
void createShuffleMasks(sheng *s, dfa_info &info,
map<dstate_id_t, AccelScheme> &accelInfo) {
for (u16 chr = 0; chr < 256; chr++) {
u8 buf[16] = {0};
for (dstate_id_t idx = 0; idx < info.size(); idx++) {
auto &succ_state = info.next(idx, chr);
buf[idx] = getShengState(succ_state, info, accelInfo);
}
#ifdef DEBUG
dumpShuffleMask(chr, buf, sizeof(buf));
#endif
memcpy(&s->shuffle_masks[chr], buf, sizeof(m128));
}
}
bool has_accel_sheng(const NFA *) {
return true; /* consider the sheng region as accelerated */
}
bytecode_ptr<NFA> shengCompile(raw_dfa &raw, const CompileContext &cc,
const ReportManager &rm, bool only_accel_init,
set<dstate_id_t> *accel_states) {
if (!cc.grey.allowSheng) {
DEBUG_PRINTF("Sheng is not allowed!\n");
return nullptr;
}
sheng_build_strat strat(raw, rm, only_accel_init);
dfa_info info(strat);
DEBUG_PRINTF("Trying to compile a %zu state Sheng\n", raw.states.size());
DEBUG_PRINTF("Anchored start state id: %u, floating start state id: %u\n",
raw.start_anchored, raw.start_floating);
DEBUG_PRINTF("This DFA %s die so effective number of states is %zu\n",
info.can_die ? "can" : "cannot", info.size());
if (info.size() > 16) {
DEBUG_PRINTF("Too many states\n");
return nullptr;
}
if (!cc.streaming) { /* TODO: work out if we can do the strip in streaming
* mode with our semantics */
raw.stripExtraEodReports();
}
auto accelInfo = strat.getAccelInfo(cc.grey);
// set impl_id of each dfa state
for (dstate_id_t i = 0; i < info.size(); i++) {
info[i].impl_id = i;
}
DEBUG_PRINTF("Anchored start state: %u, floating start state: %u\n",
info.anchored.impl_id, info.floating.impl_id);
u32 nfa_size = ROUNDUP_16(sizeof(NFA) + sizeof(sheng));
vector<u32> reports, eod_reports, report_offsets;
u8 isSingle = 0;
ReportID single_report = 0;
auto ri =
strat.gatherReports(reports, eod_reports, &isSingle, &single_report);
u32 total_aux = sizeof(sstate_aux) * info.size();
u32 total_accel = strat.accelSize() * accelInfo.size();
u32 total_reports = ri->getReportListSize();
u32 reports_offset = nfa_size + total_aux;
u32 accel_offset =
ROUNDUP_N(reports_offset + total_reports, alignof(AccelAux));
u32 total_size = ROUNDUP_N(accel_offset + total_accel, 64);
DEBUG_PRINTF("NFA: %u, aux: %u, reports: %u, accel: %u, total: %u\n",
nfa_size, total_aux, total_reports, total_accel, total_size);
auto nfa = make_zeroed_bytecode_ptr<NFA>(total_size);
populateBasicInfo(nfa.get(), info, accelInfo, nfa_size, reports_offset,
accel_offset, total_size, total_size - sizeof(NFA));
DEBUG_PRINTF("Setting up aux and report structures\n");
ri->fillReportLists(nfa.get(), reports_offset, report_offsets);
for (dstate_id_t idx = 0; idx < info.size(); idx++) {
fillTops(nfa.get(), info, idx, accelInfo);
fillAux(nfa.get(), info, idx, reports, eod_reports, report_offsets);
}
if (isSingle) {
fillSingleReport(nfa.get(), single_report);
}
fillAccelAux(nfa.get(), info, accelInfo);
if (accel_states) {
fillAccelOut(accelInfo, accel_states);
}
createShuffleMasks((sheng *)getMutableImplNfa(nfa.get()), info, accelInfo);
return nfa;
}
} // namespace ue2
|
02752eaccaaf85852e1c75314925181a53787835
|
525f8fc59b58c82926f7e4cb6c60393014f7daaa
|
/c++/hight_and_diameter_of_tree.cpp
|
c53166cfe19e2be1ed26afc9e033e0f748872ea0
|
[] |
no_license
|
Ayushaps1/coding
|
4211663fd418af0594271b8f43502b422fc7ee7f
|
7391650f11d86fb2217fe895146ce593c5c212b2
|
refs/heads/main
| 2023-08-22T22:22:32.929673
| 2021-09-28T06:09:38
| 2021-09-28T06:09:38
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,374
|
cpp
|
hight_and_diameter_of_tree.cpp
|
#include<iostream>
#include<queue>
using namespace std;
struct node{
int data;
node* left;
node* right;
node(int val){
data=val;
left=NULL;
right=NULL;
}
};
int hight(node* root){
if(root == NULL){
return 0;
}
return max(hight(root->left),hight(root->right))+1;
}
int diameter(node* root){
if(root == NULL)
return 0;
int lefthight=hight(root->left);
int righthight=hight(root->right);
int currentdiameter=lefthight+righthight+1;
return max(max(diameter(root->left),diameter(root->right)),currentdiameter);
}
int diameter(node* root,int *h){
if(root == NULL){
return 0;
}
int lh=0,rh=0;
int leftdiameter=diameter(root->left,&lh);
int rightdiameter=diameter(root->right,&rh);
int currentdiameter=lh+rh+1;
*h=max(lh,rh)+1;
return max(max(leftdiameter,rightdiameter),currentdiameter);
}
int main(){
node* root=new node(1);
root->left=new node(2);
root->right=new node(3);
root->left->left=new node(4);
root->left->right=new node(5);
root->right->left=new node(6);
root->right->right=new node(7);
//height of tree
cout<<hight(root)<<endl;
//diameter of tree
cout<<diameter(root)<<endl;
//optimised diameter function
int hight=0;
cout<<diameter(root,&hight);
return 0;
}
|
7a885dd70112a12d45f95b135c96030d2c98db83
|
57d1302ecad42af168f6e958852708f8766e35be
|
/WoW/DX9/Graphics/Model/X/SkinnedMesh.h
|
de34592d16812c46da45b32a954e74ff72ab24c3
|
[] |
no_license
|
KeeJuneLim/WoW_Team_Project
|
ce86c96fa24c2f73deb12e4451911026910d176e
|
ebd82c9d9f5f9f7028b7f59a0b26f6dd9247357c
|
refs/heads/master
| 2020-04-10T17:17:43.544086
| 2018-12-20T07:30:36
| 2018-12-20T07:30:36
| 161,169,945
| 1
| 0
| null | null | null | null |
UHC
|
C++
| false
| false
| 1,979
|
h
|
SkinnedMesh.h
|
#pragma once
class SkinnedMesh : public IUnitObject
{
protected:
LPD3DXFRAME m_pRootFrame;
LPD3DXANIMATIONCONTROLLER m_pAC;
int m_animIndex;
float m_fBlendTime;
float m_fPassedBlendTime;
LPD3DXMESH m_pSphereMesh;
bool m_bWireFrame;
bool m_bDrawFrame;
bool m_bDrawSkeleton;
int m_numFrame;
int m_numMesh;
/////Frame Separate/////
protected:
LPD3DXFRAME m_pConnetFrame;
LPD3DXFRAME m_pSubRootFrame;
LPD3DXANIMATIONCONTROLLER m_pSubAC;
void SeparateFrame(LPD3DXFRAME pFrame, LPCSTR name,
LPD3DXANIMATIONCONTROLLER &pAC_Dest, LPD3DXANIMATIONCONTROLLER &pAC_Src);
/////Frame Separate/////
public:
SkinnedMesh();
virtual ~SkinnedMesh();
// IUnitObject을(를) 통해 상속됨
virtual void Init() override;
virtual void Update() override;
virtual void Render() override;
void Load(LPD3DXFRAME &pRootFrame, LPD3DXANIMATIONCONTROLLER &pAC, LPCTSTR path, LPCTSTR filename);
void AddAnimSet(LPD3DXANIMATIONCONTROLLER &pAC_Dest, LPD3DXANIMATIONCONTROLLER &pAC_Src, UINT index);
private:
void SetupBoneMatrixPointers(LPD3DXFRAME pFrame);
void SetupBoneMatrixPointersOnMesh(LPD3DXMESHCONTAINER pMeshContainerBase);
void UpdateAnim(LPD3DXANIMATIONCONTROLLER pAC);
void UpdateFrameMatrices(LPD3DXFRAME pFrame, LPD3DXFRAME pParent);
void DrawFrame(LPD3DXFRAME pFrame);
void DrawMeshContainer(LPD3DXFRAME pFrame);
void DrawSkeleton(LPD3DXFRAME pFrame, LPD3DXFRAME pParent);
void RenderUseShader(LPD3DXFRAME pFrame);
void RenderUseShader_0();
void RenderUseShader_1();
public:
void SetAnimationIndex(LPD3DXANIMATIONCONTROLLER pAC, int nIndex, bool isBlend);
};
// OnInit
// pMeshContainerEx->ppBoneMatrixPtrs[i] = &pFrameExInfluence->CombinedTM;
// OnUpdate
// pFrameEx->CombinedTM = pFrameEx->TransformationMatrix * ((FRAME_EX*)pParent)->CombinedTM;
//
// pMeshContainerEx->pFinalBoneMatrices[i] =
// pMeshContainerEx->pBoneOffsetMatrices[i] * *(pMeshContainerEx->ppBoneMatrixPtrs[i]);
|
95f7979a83722c3bbeb317d0f2bc5d052b105c74
|
0d47255822ebb007e50a96887e1778ae74807989
|
/CS32-DataStructures/BugBlast/BugBlast/Actor.cpp
|
04b4901375d930cba3e4e466adc8c54caad89d25
|
[] |
no_license
|
tgaldes/UCLA
|
7eadb28edf8fcbe3861e0c3b48cc40ed0df02280
|
b0593fcc1b1b54d7372ad2c7ccc9eeac3a049b9c
|
refs/heads/master
| 2021-01-11T03:28:38.313042
| 2016-10-16T03:33:56
| 2016-10-16T03:33:56
| 71,027,445
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 12,048
|
cpp
|
Actor.cpp
|
#include "Actor.h"
#include "StudentWorld.h"
#include "GameConstants.h"
#include <iostream>
#include <queue>
using namespace std;
// Students: Add code to this file (if you wish), Actor.h, StudentWorld.h, and StudentWorld.cpp
Actor::Actor(int image, int x, int y, StudentWorld* pt) : GraphObject(image, x, y)
{
setVisible(true);
m_isAlive = true;
int ID = image;
world = pt;
id = image;
}
bool Actor::isAlive() const
{
return m_isAlive;
}
StudentWorld& Actor::getWorld()
{
return *world;
}
void Actor::setDead()
{
m_isAlive = false;
}
Brick::Brick(int image, int x, int y, StudentWorld* pt) : Actor(image, x, y, pt)
{
}
bool Brick::takeTurn()
{
if(!isAlive())
{
setVisible(false);
getWorld().bricks[getX()][VIEW_HEIGHT - getY() - 1] = 0;
return isAlive();
}
}
PermaBrick::PermaBrick(int x, int y, StudentWorld* pt) : Brick(IID_PERMA_BRICK, x, y, pt)
{
}
void Brick::checkIsAlive()
{
}
DestroyableBrick::DestroyableBrick(int x, int y, StudentWorld* pt) : Brick(IID_DESTROYABLE_BRICK, x, y, pt)
{
}
Player::Player(int x, int y, StudentWorld* pt) : Actor(IID_PLAYER, x, y, pt)
{
m_canWalkThroughWalls = false;
walkThroughWallsTicks = 0;
maxSprayerTicks = 0;
}
void Player::checkIsAlive()
{
if(getWorld().bricks[getX()][VIEW_HEIGHT - getY() - 1] != 0 && !m_canWalkThroughWalls)
if(getWorld().bricks[getX()][VIEW_HEIGHT - getY() - 1] != 5)
{
setDead();
return;
}
//NEED TO CHECK S=ZUMIS
}
bool Player::canWalkThroughWalls() const
{
return m_canWalkThroughWalls;
}
bool Player::takeTurn()
{
checkIsAlive();
if(!isAlive())
return false;
if(m_canWalkThroughWalls)
{
walkThroughWallsTicks--;
if(walkThroughWallsTicks < 0)
m_canWalkThroughWalls = false;
}
int ch;
if(getWorld().getKey(ch))
{
getWorld().movePlayer(ch, this);
}
return isAlive();
}
void Player::setWalkThroughWalls(int ticks)
{
walkThroughWallsTicks+=ticks;
m_canWalkThroughWalls = true;
}
Zumi::Zumi(int x, int y, int image, StudentWorld* pt, int ticks, int dir) : Actor(image, x, y, pt)
{
ticksPerMove = ticks;
m_dir = dir;
ticksUntilNextMove = 0;
}
void Zumi::checkIsAlive()
{
getWorld().checkIsZumiAlive(getX(), getY(), this);
}
SimpleZumi::SimpleZumi(int x, int y, StudentWorld* pt, int ticks, int dir) : Zumi (x, y, IID_SIMPLE_ZUMI, pt, ticks, dir)
{}
bool SimpleZumi::takeTurn()
{
checkIsAlive();
if(!isAlive())
{
setVisible(false);
getWorld().decrementZumis();
getWorld().playSound(SOUND_ENEMY_DIE);
getWorld().increaseScore(100);
//goodies
int random = getWorld().randInt(0, 99);
if(random < getWorld().probOfGoodieOverall)
{
if(getWorld().randInt(0, 99) < getWorld().probOfExtraLifeGoodie)
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_EXTRA_LIFE_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), 0, 0));
}
else if(getWorld().randInt(0, 99 - getWorld().probOfExtraLifeGoodie) < getWorld().probOfMoreSprayersGoodie)
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_INCREASE_SIMULTANEOUS_SPRAYER_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), getWorld().maxSprayerDuration, getWorld().newMaxSprayers));
}
else
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_WALK_THRU_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), getWorld().walkThroughDuration, 0));
//cout << getWorld().walkThroughDuration << endl;
}
}
return false;
}
//check to see if it is on the same square as the player
if(getX() == getWorld().getPlayer()->getX() && getY() == getWorld().getPlayer()->getY() )
getWorld().getPlayer()->setDead();
if(ticksUntilNextMove == 0)
{
ticksUntilNextMove = ticksPerMove;
//north
if(m_dir == 0 && getWorld().bricks[getX()][VIEW_HEIGHT - getY() - 2] == 0)
{
moveTo(getX(), getY() + 1);
}
//east
else if(m_dir == 1 && getWorld().bricks[getX() + 1][VIEW_HEIGHT - getY() - 1] == 0)
{
moveTo(getX() + 1, getY());
}
//south
else if(m_dir == 2 && getWorld().bricks[getX()][VIEW_HEIGHT - getY()] == 0)
{
moveTo(getX(), getY() - 1);
}
//west
else if(m_dir == 3 && getWorld().bricks[getX() - 1][VIEW_HEIGHT - getY() - 1] == 0)
{
moveTo(getX() - 1, getY());
}
else
m_dir = getWorld().randInt(0, 3);
}
else
ticksUntilNextMove--;
if(getX() == getWorld().getPlayer()->getX() && getY() == getWorld().getPlayer()->getY() )
getWorld().getPlayer()->setDead();
return isAlive();
}
ComplexZumi::ComplexZumi(int x, int y, StudentWorld* pt, int ticks, int dir) : Zumi(x, y, IID_COMPLEX_ZUMI, pt, ticks, dir)
{
}
bool ComplexZumi::takeTurn()
{
checkIsAlive();
if(!isAlive())
{
setVisible(false);
getWorld().decrementZumis();
getWorld().playSound(SOUND_ENEMY_DIE);
getWorld().increaseScore(500);
//goodies
int random = getWorld().randInt(0, 99);
if(random < getWorld().probOfGoodieOverall)
{
if(getWorld().randInt(0, 99) < getWorld().probOfExtraLifeGoodie)
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_EXTRA_LIFE_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), 0, 0));
}
else if(getWorld().randInt(0, 99 - getWorld().probOfExtraLifeGoodie) < getWorld().probOfMoreSprayersGoodie)
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_INCREASE_SIMULTANEOUS_SPRAYER_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), getWorld().maxSprayerDuration, getWorld().newMaxSprayers));
}
else
{
getWorld().pushActor(new Goodie(getX(), getY(), IID_WALK_THRU_GOODIE, getWorld().goodieLifetimeInTicks, &getWorld(), getWorld().walkThroughDuration, 0));
}
}
return false;
}
//check to see if it is on the same square as the player
if(getX() == getWorld().getPlayer()->getX() && getY() == getWorld().getPlayer()->getY() )
getWorld().getPlayer()->setDead();
if(ticksUntilNextMove == 0)
{
ticksUntilNextMove = ticksPerMove;
bool canSmell = false;
//smell distance computation
if(getX() - getWorld().getPlayer()->getX() < getWorld().smellDistance && getX() - getWorld().getPlayer()->getX() > -getWorld().smellDistance && getY() - getWorld().getPlayer()->getY() < getWorld().smellDistance && getY() - getWorld().getPlayer()->getY() > -getWorld().smellDistance)
{
canSmell = true;
}
bool foundPlayer = false;
int moveDirection;
if(canSmell)
{
queue<int> coordsX;
queue<int> coordsY;
queue<int> dir;
int tempMap[VIEW_WIDTH][VIEW_HEIGHT];
for(int i = 0; i < VIEW_WIDTH; i++)
for(int j = 0; j < VIEW_HEIGHT; j++)
tempMap[j][i] = getWorld().bricks[i][j];
coordsX.push(getX());
coordsY.push(getY());
dir.push(5);
int loopCount = 0;
tempMap[VIEW_HEIGHT - coordsY.front() - 1][coordsX.front()] = 5;
int endX = getWorld().getPlayer()->getX();
int endY = getWorld().getPlayer()->getY();
while(!coordsX.empty() && !foundPlayer)
{
if(coordsX.front() == endX && coordsY.front() == endY)
{
foundPlayer = true;
}
//look west
if(tempMap[VIEW_HEIGHT - coordsY.front() - 1][coordsX.front() - 1] == 0)
{
if(loopCount == 0)
dir.push(3);
else
dir.push(dir.front());
coordsX.push(coordsX.front() - 1);
coordsY.push(coordsY.front());
tempMap[VIEW_HEIGHT - coordsY.front() - 1][coordsX.front() - 1] = 5;
}
//look east
if(tempMap[VIEW_HEIGHT - coordsY.front() - 1][coordsX.front() + 1] == 0)
{
if(loopCount == 0)
dir.push(1);
else
dir.push(dir.front());
coordsX.push(coordsX.front() + 1);
coordsY.push(coordsY.front());
tempMap[VIEW_HEIGHT - coordsY.front() - 1][coordsX.front() + 1] = 5;
}
//look south
if(tempMap[VIEW_HEIGHT - coordsY.front()][coordsX.front()] == 0)
{
if(loopCount == 0)
dir.push(2);
else
dir.push(dir.front());
coordsX.push(coordsX.front());
coordsY.push(coordsY.front() - 1);
tempMap[VIEW_HEIGHT - coordsY.front()][coordsX.front()] = 5;
}
//look north
if(tempMap[VIEW_HEIGHT - coordsY.front() - 2][coordsX.front()] == 0)
{
if(loopCount == 0)
dir.push(0);
else
dir.push(dir.front());
coordsX.push(coordsX.front());
coordsY.push(coordsY.front() + 1);
tempMap[VIEW_HEIGHT - coordsY.front() - 2][coordsX.front()] = 5;
}
loopCount++;
coordsX.pop();
coordsY.pop();
moveDirection = dir.front();
if(!dir.empty())
dir.pop();
}//end while loop
}//end algorithim to determine move direction if player is within smelling distance
if(foundPlayer)
{
if(moveDirection == 0)
{
moveTo(getX(), getY() + 1);
m_dir = moveDirection;
}
if(moveDirection == 1)
{
moveTo(getX() + 1, getY());
m_dir = moveDirection;
}
if(moveDirection == 2)
{
moveTo(getX(), getY() - 1);
m_dir = moveDirection;
}
if(moveDirection == 3)
{
moveTo(getX() - 1, getY());
m_dir = moveDirection;
}
}
else//if can't smell the player
{
if(m_dir == 0 && getWorld().bricks[getX()][VIEW_HEIGHT - getY() - 2] == 0)
{
moveTo(getX(), getY() + 1);
}
//east
else if(m_dir == 1 && getWorld().bricks[getX() + 1][VIEW_HEIGHT - getY() - 1] == 0)
{
moveTo(getX() + 1, getY());
}
//south
else if(m_dir == 2 && getWorld().bricks[getX()][VIEW_HEIGHT - getY()] == 0)
{
moveTo(getX(), getY() - 1);
}
//west
else if(m_dir == 3 && getWorld().bricks[getX() - 1][VIEW_HEIGHT - getY() - 1] == 0)
{
moveTo(getX() - 1, getY());
}
else
m_dir = getWorld().randInt(0, 3);
}
}
else
ticksUntilNextMove--;
if(getX() == getWorld().getPlayer()->getX() && getY() == getWorld().getPlayer()->getY() )
getWorld().getPlayer()->setDead();
return isAlive();
}
BugSprayer::BugSprayer(int x, int y, StudentWorld* pt) : Actor(IID_BUGSPRAYER, x, y, pt)
{
m_ticksRemaining = 40;
}
bool BugSprayer::takeTurn()
{
if(m_ticksRemaining <= 0)
{
setVisible(false);
getWorld().explode(this);
return false;
}
if(!isAlive())
return false;
m_ticksRemaining--;
return true;
}
void BugSprayer::checkIsAlive()
{
if(m_ticksRemaining <= 0)
setDead();
}
BugSpray::BugSpray(int x, int y, StudentWorld* pt) : Actor(IID_BUGSPRAY, x, y, pt)
{
m_ticksRemaining = 3;
}
bool BugSpray::takeTurn()
{
checkIsAlive();
//needs to delete itself as well
if(!isAlive())
{
setVisible(false);
return false;
}
getWorld().bugSprayTakeTurn(getX(), getY());
m_ticksRemaining--;
return true;
}
void BugSpray::checkIsAlive()
{
if(m_ticksRemaining <= 0)
setDead();
}
Exit::Exit(int x, int y, StudentWorld* pt) : Actor(3, x, y, pt)
{
setVisible(false);
m_isVisible = false;
}
bool Exit::takeTurn()
{
if(m_isVisible)
{
if(getWorld().getPlayer()->getX() == getX() && getWorld().getPlayer()->getY() == getY())
{
getWorld().playSound(SOUND_FINISHED_LEVEL);
getWorld().finishedLevel();
}
}
return true;
}
void Exit::checkIsAlive()
{
}
void Exit::setVisibility(bool input)
{
m_isVisible = input;
if(m_isVisible)
getWorld().playSound(SOUND_REVEAL_EXIT);
}
bool Exit::isVisible()
{
return m_isVisible;
}
Goodie::Goodie(int x, int y, int image, int ticksRemaining, StudentWorld* pt, int duration, int newMax) : Actor(image, x, y, pt)
{
ticksTillDeath = ticksRemaining;
longLasting = duration;
newMaxSprayers = newMax;
}
bool Goodie::takeTurn()
{
checkIsAlive();
if(!isAlive())
{
setVisible(false);
return false;
}
ticksTillDeath--;
if(getX() == getWorld().getPlayer()->getX() && getY() == getWorld().getPlayer()->getY() )
{
getWorld().playSound(SOUND_GOT_GOODIE);
getWorld().increaseScore(1000);
//extra life goodie
if(id == IID_EXTRA_LIFE_GOODIE)
{
getWorld().incLives();
setDead();
}
//walk through walls goodie
if(id == IID_WALK_THRU_GOODIE)
{
getWorld().getPlayer()->setWalkThroughWalls(longLasting);
setDead();
}
//max sprayers goodie
if(id == IID_INCREASE_SIMULTANEOUS_SPRAYER_GOODIE)
{
getWorld().setMaxSprayers();
setDead();
}
}
return true;
}
void Goodie::checkIsAlive()
{
if(ticksTillDeath == 0)
setDead();
}
|
9e992cb5ab888538495777a9911ca5aa047eee0c
|
17ad1146e6213ac7fae7847351419a5c1064509c
|
/Lark.cpp
|
3ea9775178da36756e120ecbe629f0162bf268a9
|
[] |
no_license
|
e-workman/Object_Oriented_Programming_Birds
|
d1fc63718e81a55442b9fc252517bfd50afe4f8c
|
ca0ce8457b21c742d85f173bfd5421b53a86220d
|
refs/heads/main
| 2023-02-26T17:40:49.870502
| 2021-02-04T21:15:43
| 2021-02-04T21:15:43
| 336,079,688
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 713
|
cpp
|
Lark.cpp
|
#include "Lark.h"
#include <cmath>
Lark::Lark(TwoVector position, TwoVector velocity)
:Bird(position, velocity){}
Lark::~Lark(){}
//update calculates velocity and position of each bird:
void Lark::update(TwoVector v_steer1, TwoVector v_steer2 , TwoVector v_steer3) {
//larks more strongly align, but have weaker separation force when compared to starling
//they also have a weaker cohesion force than starlings
//weighting of each force is determined by the constant each steering velcoity is multiplied by
fVelocity +=( 2 * v_steer1 +0.3 * v_steer2 + 2 * v_steer3);
Bird::VelocityLimit();
fPosition += fVelocity;
Bird::AvoidEdges();
}
int Lark::Species(){
return 2;
}
|
a429fabca8f53fff3c3f3cb79b5a2a2ea2309c94
|
36431b5717030e7933aa74eaef2b948697fdd684
|
/src/misc/char_input_dialog.cpp
|
1924cec32feed155efdcdfcfbe632f263f89886d
|
[] |
no_license
|
children-of-gazimba/companion-qt-tool
|
af9ce544b5bbdfb148ae2d5353a5439f2d775be9
|
7bcc4733f7677bc708c509b134d7ebbad4cdc67c
|
refs/heads/master
| 2021-06-19T21:02:47.248815
| 2018-10-27T21:38:34
| 2018-10-27T21:38:34
| 106,701,749
| 0
| 0
| null | 2018-12-18T16:38:31
| 2017-10-12T14:13:12
|
C++
|
UTF-8
|
C++
| false
| false
| 1,968
|
cpp
|
char_input_dialog.cpp
|
#include "char_input_dialog.h"
#include <QHBoxLayout>
#include <QRegExp>
#include <QDebug>
CharInputDialog::CharInputDialog(QWidget *parent)
: QDialog(parent)
, selected_char_(' ')
, label_(0)
, edit_(0)
, ok_(0)
, cancel_(0)
{
setWindowTitle(tr("Select Key"));
initWidgets();
initLayout();
}
void CharInputDialog::setDialogMessage(const QString& text)
{
label_->setText(text);
}
const QString CharInputDialog::getDialogMessage() const
{
return label_->text();
}
const QChar &CharInputDialog::getChar() const
{
return selected_char_;
}
void CharInputDialog::setChar(const QChar& c)
{
selected_char_ = c;
edit_->setText(QString(c));
}
void CharInputDialog::onOk()
{
if(edit_->text().size() > 0)
accept();
else
reject();
}
void CharInputDialog::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_Enter)
onOk();
QRegExp r("[A-Za-z0-9]");
QString cap((char)e->key());
if(r.exactMatch(cap))
setChar(e->key());
}
void CharInputDialog::initWidgets()
{
label_ = new QLabel(this);
label_->setText(tr("Press a Letter or Number key to change selection. Selection:"));
edit_ = new QLineEdit(this);
edit_->setReadOnly(true);
ok_ = new QPushButton(tr("OK"), this);
cancel_ = new QPushButton(tr("Cancel"), this);
connect(ok_, SIGNAL(pressed()),
this, SLOT(onOk()));
connect(cancel_, SIGNAL(pressed()),
this, SLOT(reject()));
}
void CharInputDialog::initLayout()
{
QHBoxLayout* upper_layout = new QHBoxLayout;
upper_layout->addWidget(label_, 1);
upper_layout->addWidget(edit_, 0);
QHBoxLayout* lower_layout = new QHBoxLayout;
lower_layout->addStretch(2);
lower_layout->addWidget(ok_, 1);
lower_layout->addWidget(cancel_, 1);
QVBoxLayout* layout = new QVBoxLayout;
layout->addLayout(upper_layout);
layout->addLayout(lower_layout);
setLayout(layout);
}
|
eb9b7c29348b9cfa0cb8fb02d892c83768924d9e
|
ee21530730a7d843ca6dae2d2394f1b9fda0f464
|
/DividedMethod/Source.cpp
|
09075e1e7993f66c0f3cbf07074ab5c24d831c03
|
[] |
no_license
|
devvados/numeric-methods
|
5303a9f8df60615ba067864bf4fb89034bc77299
|
b85326d23116b613855761e48fcbfafc5b5ca5b1
|
refs/heads/master
| 2021-09-10T10:43:12.450991
| 2018-03-24T18:20:21
| 2018-03-24T18:20:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 573
|
cpp
|
Source.cpp
|
#include <conio.h>
#include <cmath>
#include <iostream>
#define pi 3.14
#define eps 0.001
using namespace std;
double f(double x) {
return x*x*x - 6.0*x - 8.0;
}
double f1(double x)
{
return tan(0.58*x + 0.1) - x*x;
}
int main() {
int n = 0;
double a, b, c;
cout << "a="; cin >> a;
cout << "b="; cin >> b;
do {
c = (a + b) / 2;
if (f(c)*f(a) > 0) a = c;
else b = c;
n += 1;
cout << a << "\t" << b << "\t" << c << "\t" << f(c) << endl;
} while (fabs(a - b) >= eps);
cout << "c=" << c << "\n";
cout << "n=" << n << "\n";
system("pause");
return 0;
}
|
43025e29c654b4d7137153c990df85de412d2982
|
8ff0c1b6daa5ebc58dda4e41300af3b3b74e56a1
|
/deletearray.cpp
|
8a403d76bb3b8f69b3eff051b2287a92725f17f0
|
[] |
no_license
|
vridhi-sahu/nau
|
f8ab7c62d3b21e70064d4e211dfa156b6c1bea52
|
dfde773c95e30326231540b670abbde64e831a5e
|
refs/heads/master
| 2020-04-14T16:28:16.467275
| 2019-01-10T17:37:21
| 2019-01-10T17:37:21
| 163,952,661
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 434
|
cpp
|
deletearray.cpp
|
#include<stdio.h>
int main(){
int loc, num, i, arr[100];
printf("Enter the number of elements in the array.");
scanf("%d",&num);
printf("Enter the location of the element in the array.");
scanf("%d",&loc);
printf("Enter the elements in the array.");
for(i=0;i<num;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<=num;i++){
if(num==loc)
{
arr[i]=arr[i+1];
}num--;
}
for(i=0;i<=num;i++)
{
printf("%d",arr[i]);
}
}
|
a40525389d4f51d3998883c0b02151d7e285c50d
|
5428c966ec3f2054ad7dd700816afee40983729e
|
/src/null_character_control.h
|
044663ae31a3f815886cd47f2cb33316c925e5c4
|
[
"MIT"
] |
permissive
|
quinsmpang/MagicalGirlMica
|
98dc7cc9c24ad7652590b21da85749de0bb4c825
|
f061641e49aefd67cacef642e498efd3a666c14f
|
refs/heads/master
| 2021-01-18T09:51:43.480935
| 2015-03-18T16:27:49
| 2015-03-18T16:27:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 413
|
h
|
null_character_control.h
|
/*
* null_character_control.h
*
* Copyright (C) 2014-2015 Ming Tsang, Nathan Ng
* Refer to LICENSE for details
*/
#pragma once
#include "character_control.h"
namespace mica
{
class Character;
}
namespace mica
{
/**
* A CharacterControl that could only tell the Character to stand
*/
class NullCharacterControl : public CharacterControl
{
public:
void control(Character *character) override;
};
}
|
40a36ae27fa489c5684c541069bd0567ae2a7beb
|
f621882d8e358963c3f454e53ed12f1662ee882a
|
/src/operator/contrib/gradient_cancel-inl.h
|
049bce922957aba1939d9fa0934ed11dc2777a0e
|
[
"Apache-2.0",
"NCSA",
"BSD-2-Clause-Views",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"Zlib",
"BSL-1.0",
"BSD-2-Clause",
"Intel",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense"
] |
permissive
|
rayjs/BMXNet-v2
|
0c29d3d885fc3a0f410a8690565483cce3d81916
|
756a21f23ab10af2825f50663de251523084d4a8
|
refs/heads/master
| 2020-12-13T22:58:40.170002
| 2020-08-12T13:04:40
| 2020-08-12T13:04:40
| 234,555,112
| 0
| 0
|
Apache-2.0
| 2020-08-12T13:04:41
| 2020-01-17T13:35:19
| null |
UTF-8
|
C++
| false
| false
| 8,085
|
h
|
gradient_cancel-inl.h
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/*!
* \file gradient_cancel-inl.h
* \brief Operator implementing gradient cancelling function.
* Similar to quadratic_op-inl.h
* For usage in binary neural networks.
*/
#ifndef MXNET_OPERATOR_CONTRIB_GRADIENT_CANCEL_INL_H_
#define MXNET_OPERATOR_CONTRIB_GRADIENT_CANCEL_INL_H_
#include <mxnet/operator_util.h>
#include <vector>
#include "../mshadow_op.h"
#include "../mxnet_op.h"
#include "../operator_common.h"
#include "../elemwise_op_common.h"
#include "../tensor/init_op.h"
namespace mxnet {
namespace op {
struct GradCancelParam : public dmlc::Parameter<GradCancelParam> {
float threshold;
DMLC_DECLARE_PARAMETER(GradCancelParam) {
DMLC_DECLARE_FIELD(threshold)
.set_default(1.0)
.describe("Threshold for gradient cancelling.");
}
};
inline bool GradCancelOpShape(const nnvm::NodeAttrs& attrs,
mxnet::ShapeVector* in_attrs,
mxnet::ShapeVector* out_attrs) {
CHECK_EQ(in_attrs->size(), 1U);
CHECK_EQ(out_attrs->size(), 1U);
SHAPE_ASSIGN_CHECK(*out_attrs, 0, in_attrs->at(0));
SHAPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(0));
return !mxnet::op::shape_is_none(out_attrs->at(0));
}
inline bool GradCancelOpType(const nnvm::NodeAttrs& attrs,
std::vector<int>* in_attrs,
std::vector<int>* out_attrs) {
CHECK_EQ(in_attrs->size(), 1U);
CHECK_EQ(out_attrs->size(), 1U);
TYPE_ASSIGN_CHECK(*out_attrs, 0, in_attrs->at(0));
TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(0));
return out_attrs->at(0) != -1;
}
inline bool GradCancelOpStorageType(const nnvm::NodeAttrs& attrs,
const int dev_mask,
DispatchMode* dispatch_mode,
std::vector<int>* in_attrs,
std::vector<int>* out_attrs) {
CHECK_EQ(in_attrs->size(), 1U);
CHECK_EQ(out_attrs->size(), 1U);
const int in_stype = in_attrs->at(0);
int& out_stype = out_attrs->at(0);
bool dispatched = false;
if (!dispatched && in_stype == kDefaultStorage) {
// dns -> dns
dispatched = storage_type_assign(&out_stype, kDefaultStorage,
dispatch_mode, DispatchMode::kFCompute);
}
if (!dispatched && in_stype == kCSRStorage) {
// csr -> csr
dispatched = storage_type_assign(&out_stype, kCSRStorage,
dispatch_mode, DispatchMode::kFComputeEx);
}
if (!dispatched) {
dispatched = dispatch_fallback(out_attrs, dispatch_mode);
}
return dispatched;
}
template<int req>
struct gradcancel_forward {
template<typename DType>
MSHADOW_XINLINE static void Map(int i, DType* out_data, const DType* in_data) {
KERNEL_ASSIGN(out_data[i], req, in_data[i]);
}
};
template<int req>
struct gradcancel_backward {
template<typename DType>
MSHADOW_XINLINE static void Map(int i, DType* in_grad, const DType* out_grad,
const DType* in_data, const float threshold) {
KERNEL_ASSIGN(in_grad[i], req, math::fabs(in_data[i]) <= threshold ? out_grad[i] : DType(0));
}
};
template<typename xpu>
void GradCancelOpForward(const nnvm::NodeAttrs& attrs,
const OpContext& ctx,
const std::vector<TBlob>& inputs,
const std::vector<OpReqType>& req,
const std::vector<TBlob>& outputs) {
CHECK_EQ(inputs.size(), 1U);
CHECK_EQ(outputs.size(), 1U);
CHECK_EQ(req.size(), 1U);
mshadow::Stream<xpu> *s = ctx.get_stream<xpu>();
const TBlob& in_data = inputs[0];
const TBlob& out_data = outputs[0];
using namespace mxnet_op;
MSHADOW_TYPE_SWITCH(out_data.type_flag_, DType, {
MXNET_ASSIGN_REQ_SWITCH(req[0], req_type, {
Kernel<gradcancel_forward<req_type>, xpu>::Launch(
s, out_data.Size(), out_data.dptr<DType>(), in_data.dptr<DType>());
});
});
}
template<typename xpu>
void GradCancelOpForwardCsrImpl(const GradCancelParam& param,
const OpContext& ctx,
const NDArray& input,
const OpReqType req,
const NDArray& output) {
using namespace mshadow;
using namespace mxnet_op;
using namespace csr;
if (req == kNullOp) return;
CHECK_EQ(req, kWriteTo) << "GradCancelOp with CSR only supports kWriteTo";
Stream<xpu> *s = ctx.get_stream<xpu>();
if (!input.storage_initialized()) {
FillZerosCsrImpl(s, output);
return;
}
const nnvm::dim_t nnz = input.storage_shape()[0];
const nnvm::dim_t num_rows = output.shape()[0];
output.CheckAndAlloc({Shape1(num_rows + 1), Shape1(nnz)});
CHECK_EQ(output.aux_type(kIdx), output.aux_type(kIndPtr))
<< "The dtypes of indices and indptr don't match";
MSHADOW_TYPE_SWITCH(output.dtype(), DType, {
MSHADOW_IDX_TYPE_SWITCH(output.aux_type(kIdx), IType, {
MXNET_ASSIGN_REQ_SWITCH(req, req_type, {
Kernel<gradcancel_forward<req_type>, xpu>::Launch(
s, nnz, output.data().dptr<DType>(), input.data().dptr<DType>());
Copy(output.aux_data(kIdx).FlatTo1D<xpu, IType>(s),
input.aux_data(kIdx).FlatTo1D<xpu, IType>(s), s);
Copy(output.aux_data(kIndPtr).FlatTo1D<xpu, IType>(s),
input.aux_data(kIndPtr).FlatTo1D<xpu, IType>(s), s);
});
});
});
}
template<typename xpu>
void GradCancelOpForwardEx(const nnvm::NodeAttrs& attrs,
const OpContext& ctx,
const std::vector<NDArray>& inputs,
const std::vector<OpReqType>& req,
const std::vector<NDArray>& outputs) {
CHECK_EQ(inputs.size(), 1U);
CHECK_EQ(outputs.size(), 1U);
CHECK_EQ(req.size(), 1U);
const GradCancelParam& param = nnvm::get<GradCancelParam>(attrs.parsed);
const auto in_stype = inputs[0].storage_type();
const auto out_stype = outputs[0].storage_type();
if (in_stype == kCSRStorage && out_stype == kCSRStorage) {
GradCancelOpForwardCsrImpl<xpu>(param, ctx, inputs[0], req[0], outputs[0]);
} else {
LogUnimplementedOp(attrs, ctx, inputs, req, outputs);
}
}
template<typename xpu>
void GradCancelOpBackward(const nnvm::NodeAttrs& attrs,
const OpContext& ctx,
const std::vector<TBlob>& inputs,
const std::vector<OpReqType>& req,
const std::vector<TBlob>& outputs) {
CHECK_EQ(inputs.size(), 2U);
CHECK_EQ(outputs.size(), 1U);
CHECK_EQ(req.size(), 1U);
mshadow::Stream<xpu> *s = ctx.get_stream<xpu>();
const TBlob& out_grad = inputs[0];
const TBlob& in_data = inputs[1];
const TBlob& in_grad = outputs[0];
const GradCancelParam& param = nnvm::get<GradCancelParam>(attrs.parsed);
using namespace mxnet_op;
MSHADOW_TYPE_SWITCH(out_grad.type_flag_, DType, {
MXNET_ASSIGN_REQ_SWITCH(req[0], req_type, {
Kernel<gradcancel_backward<req_type>, xpu>::Launch(
s, in_grad.Size(), in_grad.dptr<DType>(), out_grad.dptr<DType>(),
in_data.dptr<DType>(), param.threshold);
});
});
}
} // namespace op
} // namespace mxnet
#endif // MXNET_OPERATOR_CONTRIB_GRADIENT_CANCEL_INL_H_
|
8d3bcf924aaa76b81fc78fe69101d6f150f6ac0a
|
d1829a6e4e12dc3ee9e5fb4dcb5bd75fbec4a5a3
|
/chessboard.cpp
|
65f110d18ba6fa8c61409357918bd98c03322698
|
[] |
no_license
|
dsilvao/Chess
|
d2fd901fae8d609132ce3e962dba33713326ed6d
|
33305ff79ecf5755f949bbd6a89e4e1194833b3a
|
refs/heads/master
| 2020-04-30T01:34:25.484287
| 2019-03-19T14:41:37
| 2019-03-19T14:41:37
| 176,532,266
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,360
|
cpp
|
chessboard.cpp
|
#include<iostream>
#include<string>
#include<stdlib.h>
using namespace std;
const int pawn = 100;
const int bishop = 305;
const int knight = 300;
const int rook = 500;
const int queen = 900;
const int king = 2000;
int board[8][8];
const int startup[8][8] = { rook, knight, bishop, queen, king, bishop, knight, rook, pawn, pawn,pawn,pawn,pawn,pawn,pawn, pawn, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -rook, -knight, -bishop, -queen, -king, -bishop, -knight, -rook};
void setup (void) {
int i, j;
for (i = 0; i < 8; i++){
for (j = 0; j < 8; j++){
board[i][j] = startup[i][j]; //setup starting position
}
}
}
void printb (void){
using namespace std; // this must be here in order to begin using strings.
int a, b;
string piece;
for (a = 7; a > -1; a--){ // we must iterate the ranks down from 7 to 0 otherwise the board will be upside down
cout << endl;
for (b = 0; b < 8; b++){
switch (board[a][b]){
case 0:
piece = "-";
break;
case 1:
piece = "-";
break;
case pawn:
piece = "P";
break;
case knight:
piece = "N";
break;
case bishop:
piece = "B";
break;
case rook:
piece = "R";
break;
case queen:
piece = "Q";
break;
case king:
piece = "K";
break;
case -pawn:
piece = "p";
break;
case -knight:
piece = "n";
break;
case -bishop:
piece = "b";
break;
case -rook:
piece = "r";
break;
case -queen:
piece = "q";
break;
case -king:
piece = "k";
break;
}
cout << " " << piece << " ";
}
}
cout << endl << endl;
}
// every program in win32 console must have a main
int main (void) {
cout << "Type 'new' to start a new game" << endl;
cout << "Type 'exit' to quit the game, type 'forfeit' to forfeit the game and type 'print' to display the board." << endl << endl;
cout << "Please type your moves in 4 letter algebraic such as e2e4 in lower case only" << endl;
string passd; // this will be the string that contains info from the user
setup(); //we must set up the initial position
while (1){ // a while loop that always loops; except when a break; statement occurs
getline (cin, passd ); //ask the user to input what he wants the app to do
if (passd.substr(0, 4) == "exit" || passd.substr(0, 5) == "abort" ) { //test //for quit or exit statements
break;
}
if (passd.substr(0, 5) == "print") { // display the board
printb();
}
if (passd.substr(0, 3) == "new") { // ask for a new game
setup();
}
if (passd.substr(0, 1) >= "a" && passd.substr(0, 1) <= "h" && passd.substr(1, 1) >= "1" && passd.substr(1, 1) <= "8" && passd.substr(2, 1) >= "a" && passd.substr(2, 1) <= "h" && passd.substr(3, 1) >= "1" && passd.substr(3, 1) <= "8") { // this statement makes sure both squares are on the chess board when executing //a move
// execute move
// then display new board position
int a, b, c, d;
a = passd[0] - 'a';
b = passd[1] - '1';
c = passd[2] - 'a';
d = passd[3] - '1';
//executes the move if its on the board!
board[d][c] = board[b][a];
board[b][a] = 0;
printb(); //prints out to the screen the updated position after moving the pieces
}
}
}
|
2f2a1fbfc294367fa0f33355c2c7da1805dedbf5
|
4113bbf1adfabf0fff260a0a4bf82f6b8e7da9b7
|
/Lec-9/LongestSubstringWithoutRepeatingChar.Cpp
|
ee8537106fd5900333748a7c1d86bb03756b26e3
|
[] |
no_license
|
Mohit29061999/CbOffJan
|
c7de7901bb86a414bfb81b21fa263e9293ec5716
|
727bc22cbf3acd11d03dfaab9fc9874d0381256b
|
refs/heads/main
| 2023-05-12T15:14:39.577195
| 2021-05-28T16:18:08
| 2021-05-28T16:18:08
| 336,571,334
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 837
|
cpp
|
LongestSubstringWithoutRepeatingChar.Cpp
|
//problem link: https://leetcode.com/problems/longest-substring-without-repeating-characters/
class Solution {
public:
int lengthOfLongestSubstring(string s) {
int n=s.length();
int freq[256]={0}; //to store freq of every character in substring
int st=0; //substring ka starting point
int ans =0;
for(int i=0;i<n;i++){ //try every index as ending point of substring
//check if current character is already present in substring
while(freq[s[i]]>0){
freq[s[st]]--; //move starting point one step ahead
st++;
}
//include current character and make it ending point of substring
freq[s[i]]++;
ans = max(ans,i-st+1);
}
return ans;
}
};
|
a1b16f3e5186356ccd04435d1e214d264cf4593c
|
c454bae589236c472d761437a7337a12d3a687fb
|
/Data/Data/Main.cpp
|
b5efb70c0b1d24868b06af595eda774b7c0614bb
|
[] |
no_license
|
madladwolf/Classes
|
9247f2d690b1530e7641b06b79e1f93f012a1669
|
3190efb3dc4834935a2f756332c8d4cd4a5a7edb
|
refs/heads/master
| 2020-05-21T07:03:16.262501
| 2019-05-16T01:25:04
| 2019-05-16T01:25:04
| 185,949,414
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 477
|
cpp
|
Main.cpp
|
#include "Data.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
int x;
Data d1;
Data d2(d1);
Data d3(2001, 12, 10);
cout << d3.getAno();
d2.setDia(14);
cout << "\n" + d3.toString();
cout << "\n" + d2.toString();
cout << "\nDigite o ano";
cin >> x;
if (d2.setAno(x) == true)
cout << "ez pz\n";
else
cout << "ERROOOO";
cout << d3.diferente2Datas(d2);
system("pause");
}
|
c07bc0bf93c81e86081b0fa93a9c42148a800087
|
7997e7b185d5c77216c356e85af6e562a4926586
|
/codeOfAlgorithms/codeOfAlgorithms/Test_ResizingArrayStack.h
|
a3aa8f1ee5ce44b7ddb203c7fa2f27b5a7d23e84
|
[] |
no_license
|
pi-nyan/Algorithms_p
|
1e5e1936628d8da7344b86cdf45e1e4639dc865f
|
7ac7d0f404605d0ba1723eab133cf157457d344e
|
refs/heads/master
| 2020-09-26T15:52:15.259446
| 2016-10-27T01:26:16
| 2016-10-27T01:26:16
| 67,682,776
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 265
|
h
|
Test_ResizingArrayStack.h
|
#pragma once
#ifndef TEST_RESIZING_ARRAY_STACK_H
#define TEST_RESIZING_ARRAY_STACK_H
#include "ResizingArrayStack.h"
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
namespace AlgorithmsTest
{
void tResizingArrayStack();
}
#endif
|
76b73850790f927373a5c267c7aa106be8ea25d2
|
7c9136d87b8895ac6532ef2af58edf3ecc29d175
|
/LongOpnFrameWnd.h
|
81e89683899785a220463d33e08302073195a1bc
|
[] |
no_license
|
khhubb/csda-new-ssb
|
038d75858cba1e029f4f1315d6ebba95e5d9fb91
|
96eaf896ba6c91914f69671171f5488cf0fb5d3f
|
refs/heads/master
| 2020-07-01T03:36:45.777439
| 2016-08-17T22:00:09
| 2016-08-17T22:00:09
| 74,102,071
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,304
|
h
|
LongOpnFrameWnd.h
|
#if !defined(AFX_LONGOPNFRAMEWND_H__BA9FA470_8F57_11D1_8065_006097B38214__INCLUDED_)
#define AFX_LONGOPNFRAMEWND_H__BA9FA470_8F57_11D1_8065_006097B38214__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// LongOpnFrameWnd.h : header file
//
class CLongOpnView;
/////////////////////////////////////////////////////////////////////////////
// CLongOpnFrameWnd frame
//
// This class provides a CFrameWnd for the CLongOpn mechanism.
//
// See the .cpp file for more details.
//
/////////////////////////////////////////////////////////////////////////////
class CLongOpnFrameWnd : public CFrameWnd
{
DECLARE_DYNCREATE(CLongOpnFrameWnd)
public:
CLongOpnFrameWnd(); // protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
void SetStrings(vector<CString>& strings);
int m_step;
// the current step, i.e., which operation in the sequence we are one
int m_incr;
// the index into the bitmap array
UINT m_timerId;
// the active timer sending messages that allow this to update its display
vector<CString> m_strings;
// this list of strings to display in the list
bool m_bInitialized;
// flag to indicate if initialization has occurred
CListCtrl m_list;
// the list displayed in the frame.
CImageList m_imageList;
// the images used to animate the current step
// ## change return type to LRESULT
// # change args from (UINT,LONG) to (WPARAM,LPARAM)
afx_msg LRESULT OnStep(WPARAM, LPARAM);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLongOpnFrameWnd)
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CLongOpnFrameWnd();
// Generated message map functions
//{{AFX_MSG(CLongOpnFrameWnd)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// ## Change UINT to UINT_PTR
afx_msg void OnTimer(UINT_PTR nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LONGOPNFRAMEWND_H__BA9FA470_8F57_11D1_8065_006097B38214__INCLUDED_)
|
5a726c88a046b5b9417f3dc898a4f16616bbcbd8
|
4eeb53ab8dac63d2bbdf0d8db2b8f52e0abe5998
|
/src/action/test/form_error_packet_test.cpp
|
0b4dc853dd42cabaee6152437a30da456b8b52be
|
[] |
no_license
|
zwiibac/msm-tftp
|
7d42298d7e06ad954d6e6014b5129a6a0695b402
|
060a4a52cc1ac2c9238f4433bc70730943b9a883
|
refs/heads/main
| 2023-08-28T11:16:53.910463
| 2021-10-24T23:21:17
| 2021-10-24T23:21:17
| 332,569,157
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,062
|
cpp
|
form_error_packet_test.cpp
|
#include <optional>
#include <boost/asio.hpp>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <zwiibac/tftp/test_utils/random_iterator.h>
#include <zwiibac/tftp/test_utils/buffer_assert.h>
#include <zwiibac/tftp/action/form_error_packet.h>
namespace {
using namespace zwiibac::tftp;
using namespace zwiibac::tftp::test_utils;
struct StateMachine
{
using ConstBuffer = boost::asio::const_buffer;
std::optional<ErrorCode> last_error_code_;
std::array<char, 1024> send_buffer_;
size_t last_block_size_;
ConstBuffer send_packet_;
};
struct Event{};
struct SourceState{};
struct TargetState{};
class FormErrorPacketFixture : public ::testing::TestWithParam<std::tuple<std::optional<ErrorCode>, uint16_t>>
{
public:
enum Param : size_t
{
ErrorCodeOption,
ErrorNumber
};
protected:
Event event;
StateMachine machine;
SourceState source_state;
TargetState target_state;
FormErrorPacket sut;
std::optional<ErrorCode> error_code;
uint16_t expected_error_code;
virtual void SetUp() override
{
machine.last_error_code_ = Get<Param::ErrorCodeOption>();
expected_error_code = Get<Param::ErrorNumber>();
}
template<size_t Index>
typename std::tuple_element_t<Index, ParamType> Get() { return std::get<Index>(GetParam()); }
};
TEST_P(FormErrorPacketFixture, Do)
{
// arrange
// act
sut(event, machine, source_state, target_state);
// assert
auto header = HeaderProxy::FromBuffer(machine.send_buffer_);
EXPECT_EQ(header.OpCd(), OpCode::Error);
EXPECT_EQ(header.Word(), expected_error_code);
EXPECT_EQ(machine.send_buffer_[HeaderProxy::Size()], '\0');
EXPECT_EQ(machine.send_packet_.size(), 5);
}
INSTANTIATE_TEST_SUITE_P(FormErrorPacketTest, FormErrorPacketFixture, testing::Values(
std::make_tuple(ErrorCode::AccessViolation, 2),
std::make_tuple(ErrorCode::NotDefined, 0),
std::make_tuple(ErrorCode::NoSuchUser, 7),
std::make_tuple(std::nullopt, 0))
);
} // end anonymous namespace
|
b3bc890264ea449fb9f9f198ce8473e470e7d0ed
|
7d63bab9ff2bb2de67fef12aa77a521f601f8578
|
/include/nomlib/actions/CallbackAction.hpp
|
88871708695d87cafd1a514d6f869a9846e2fada
|
[
"BSD-2-Clause"
] |
permissive
|
i8degrees/nomlib
|
7aa4c944256d36d4fb17bb632f7f5d2f83a09ce3
|
7c981c0faf040584e980eb0cadfea1ac5a7cd482
|
refs/heads/dev
| 2023-02-06T16:07:04.271032
| 2015-07-30T20:36:37
| 2015-07-30T20:41:20
| 9,707,652
| 2
| 1
| null | 2015-03-24T08:45:19
| 2013-04-27T01:59:17
|
C++
|
UTF-8
|
C++
| false
| false
| 3,484
|
hpp
|
CallbackAction.hpp
|
/******************************************************************************
nomlib - C++11 cross-platform game engine
Copyright (c) 2013, 2014 Jeffrey Carpenter <i8degrees@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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.
******************************************************************************/
#ifndef NOMLIB_ACTIONS_CALLBACK_ACTION_HPP
#define NOMLIB_ACTIONS_CALLBACK_ACTION_HPP
#include <memory>
#include "nomlib/config.hpp"
#include "nomlib/actions/IActionObject.hpp"
namespace nom {
/// \brief Execute a function over a time period.
class CallbackAction: public virtual IActionObject
{
public:
/// \brief Allow access into our private parts for unit testing.
friend class ActionTest;
typedef CallbackAction self_type;
typedef IActionObject derived_type;
typedef std::function<void()> callback_func;
/// \brief Execute a function instantaneously.
///
/// \param action A function pointer; NULL actions are valid.
CallbackAction(const callback_func& action);
/// \brief Execute a function over a time period.
///
/// \param seconds The duration of the animation.
/// \param action A function pointer; NULL actions are valid.
CallbackAction(real32 seconds, const callback_func& action);
virtual ~CallbackAction();
virtual std::unique_ptr<IActionObject> clone() const override;
virtual IActionObject::FrameState next_frame(real32 delta_time) override;
virtual IActionObject::FrameState prev_frame(real32 delta_time) override;
/// \brief This action does not support being paused.
virtual void pause(real32 delta_time) override;
/// \brief This action does not support being resumed.
virtual void resume(real32 delta_time) override;
/// \brief This action does not support being reset.
virtual void rewind(real32 delta_time) override;
virtual void release() override;
private:
static const char* DEBUG_CLASS_NAME;
/// \brief The stored function pointer.
callback_func action_;
};
} // namespace nom
#endif // include guard defined
/// \class nom::CallbackAction
/// \ingroup actions
///
/// \brief ...
///
/// \remarks This action is not reversible; the reverse of this action is
/// the same action.
///
|
7d0a798aaf292a67630f79be375efa098a6afb38
|
b797c758e6da03741ad0e46b2ac52f1dba79cd6a
|
/src/gm/template/python/module.cpp
|
de079010bf1852a8f2d6bbb0c202dbfdd0dc5502
|
[
"MIT"
] |
permissive
|
hamedsabri/GraphicsMath
|
f8783752053a03a7dc0d40cdc7541b09bf1d0b60
|
b15f9c52a090ffdb4028f7b2aa70d7ef3dfc14f2
|
refs/heads/main
| 2023-01-04T20:56:48.668149
| 2020-10-26T04:17:06
| 2020-10-26T04:17:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 561
|
cpp
|
module.cpp
|
#include <pybind11/pybind11.h>
// Type Declarations.
{% for type in types -%}
void Bind{{ type.className }}( pybind11::module& );
{% endfor %}
// Function Declarations.
{% for function in functions -%}
void Bind{{ function.name }}( pybind11::module& );
{% endfor %}
PYBIND11_MODULE( gm, o_module )
{
o_module.doc() = "GraphicsMath python module.";
// Types.
{% for type in types -%}
Bind{{ type.className }}( o_module );
{%- endfor %}
// Functions.
{% for function in functions -%}
Bind{{ function.name }}( o_module );
{%- endfor %}
}
|
7c0b54371ac2c0752ce6613e90d251e83219a1a8
|
965d7ced83f41d1e3336499e53e2221e0d157c93
|
/src/renderer/particle_system.h
|
265462a0fbf32b715c3f1cc273bdcc57554d1fe4
|
[
"MIT"
] |
permissive
|
lvshiling/LumixEngine
|
2dc06a923af77a5139e082ff67d938f123f9e2dd
|
e4a33930ca8c657f402b059af4484250d9087f5a
|
refs/heads/master
| 2021-01-13T08:58:17.106393
| 2016-09-23T11:05:45
| 2016-09-23T11:05:45
| 69,271,415
| 1
| 1
| null | 2016-09-26T16:49:18
| 2016-09-26T16:49:17
| null |
UTF-8
|
C++
| false
| false
| 5,933
|
h
|
particle_system.h
|
#pragma once
#include "engine/lumix.h"
#include "engine/array.h"
#include "engine/vec.h"
namespace Lumix
{
class ParticleEmitter;
class IAllocator;
class InputBlob;
class Material;
class OutputBlob;
class RenderScene;
class ResourceManager;
class Universe;
class WorldEditor;
struct IntInterval
{
int from;
int to;
IntInterval();
int getRandom() const;
};
struct Interval
{
float from;
float to;
Interval();
float getRandom() const;
void check();
void checkZero();
void operator=(const Vec2& value)
{
from = value.x;
to = value.y;
}
operator Vec2()
{
return Vec2(from, to);
}
};
class LUMIX_RENDERER_API ParticleEmitter
{
public:
struct LUMIX_RENDERER_API ModuleBase
{
explicit ModuleBase(ParticleEmitter& emitter);
virtual ~ModuleBase() {}
virtual void spawnParticle(int /*index*/) {}
virtual void destoryParticle(int /*index*/) {}
virtual void update(float /*time_delta*/) {}
virtual void serialize(OutputBlob& blob) = 0;
virtual void deserialize(InputBlob& blob, int version) = 0;
virtual ComponentType getType() const = 0;
virtual void drawGizmo(WorldEditor& editor, RenderScene& scene) {}
ParticleEmitter& m_emitter;
};
struct LUMIX_RENDERER_API SpawnShapeModule : public ModuleBase
{
explicit SpawnShapeModule(ParticleEmitter& emitter);
void spawnParticle(int index) override;
void serialize(OutputBlob& blob) override;
void deserialize(InputBlob& blob, int version) override;
ComponentType getType() const override { return s_type; }
static const ComponentType s_type;
enum Shape : uint8
{
SPHERE
};
float m_radius;
Shape m_shape;
};
struct LUMIX_RENDERER_API LinearMovementModule : public ModuleBase
{
explicit LinearMovementModule(ParticleEmitter& emitter);
void spawnParticle(int index) override;
void serialize(OutputBlob& blob) override;
void deserialize(InputBlob& blob, int version) override;
ComponentType getType() const override { return s_type; }
static const ComponentType s_type;
Interval m_x;
Interval m_y;
Interval m_z;
};
struct LUMIX_RENDERER_API PlaneModule : public ModuleBase
{
explicit PlaneModule(ParticleEmitter& emitter);
void serialize(OutputBlob& blob) override;
void deserialize(InputBlob& blob, int version) override;
void update(float time_delta) override;
ComponentType getType() const override { return s_type; }
void drawGizmo(WorldEditor& editor, RenderScene& scene) override;
static const ComponentType s_type;
Entity m_entities[8];
float m_bounce;
int m_count;
};
struct LUMIX_RENDERER_API AttractorModule : public ModuleBase
{
explicit AttractorModule(ParticleEmitter& emitter);
void serialize(OutputBlob& blob) override;
void deserialize(InputBlob& blob, int version) override;
void update(float time_delta) override;
ComponentType getType() const override { return s_type; }
void drawGizmo(WorldEditor& editor, RenderScene& scene) override;
static const ComponentType s_type;
Entity m_entities[8];
float m_force;
int m_count;
};
struct LUMIX_RENDERER_API ForceModule : public ModuleBase
{
explicit ForceModule(ParticleEmitter& emitter);
void serialize(OutputBlob& blob) override;
void deserialize(InputBlob& blob, int version) override;
void update(float time_delta) override;
ComponentType getType() const override { return s_type; }
static const ComponentType s_type;
Vec3 m_acceleration;
};
struct LUMIX_RENDERER_API AlphaModule : public ModuleBase
{
explicit AlphaModule(ParticleEmitter& emitter);
void update(float time_delta) override;
void serialize(OutputBlob&) override;
void deserialize(InputBlob&, int) override;
ComponentType getType() const override { return s_type; }
void sample();
static const ComponentType s_type;
Array<Vec2> m_values;
Array<float> m_sampled;
};
struct LUMIX_RENDERER_API SizeModule : public ModuleBase
{
explicit SizeModule(ParticleEmitter& emitter);
void update(float time_delta) override;
void serialize(OutputBlob&) override;
void deserialize(InputBlob&, int) override;
ComponentType getType() const override { return s_type; }
void sample();
static const ComponentType s_type;
Array<Vec2> m_values;
Array<float> m_sampled;
};
struct LUMIX_RENDERER_API RandomRotationModule : public ModuleBase
{
explicit RandomRotationModule(ParticleEmitter& emitter);
void spawnParticle(int index) override;
void serialize(OutputBlob&) override {}
void deserialize(InputBlob&, int) override {}
ComponentType getType() const override { return s_type; }
static const ComponentType s_type;
};
public:
ParticleEmitter(Entity entity, Universe& universe, IAllocator& allocator);
~ParticleEmitter();
void reset();
void init();
void drawGizmo(WorldEditor& editor, RenderScene& scene);
void serialize(OutputBlob& blob);
void deserialize(InputBlob& blob, ResourceManager& manager, bool has_version);
void update(float time_delta);
Material* getMaterial() const { return m_material; }
void setMaterial(Material* material);
IAllocator& getAllocator() { return m_allocator; }
void addModule(ModuleBase* module);
ModuleBase* getModule(ComponentType hash);
public:
Array<float> m_rel_life;
Array<float> m_life;
Array<float> m_size;
Array<Vec3> m_position;
Array<Vec3> m_velocity;
Array<float> m_alpha;
Array<float> m_rotation;
Array<float> m_rotational_speed;
Interval m_spawn_period;
Interval m_initial_life;
Interval m_initial_size;
IntInterval m_spawn_count;
Array<ModuleBase*> m_modules;
Entity m_entity;
bool m_is_valid;
private:
void spawnParticle();
void destroyParticle(int index);
void spawnParticles(float time_delta);
void updateLives(float time_delta);
void updatePositions(float time_delta);
void updateRotations(float time_delta);
private:
IAllocator& m_allocator;
float m_next_spawn_time;
Universe& m_universe;
Material* m_material;
};
} // namespace Lumix
|
ba5ced66015f5ce72594f13d7e0b91232dac4b53
|
123381f4eaecba23a531893541cf09ed926bc07f
|
/code/standard/inverse.cpp
|
cf6a259cdfc299589c787369e7633e551c78e6b5
|
[] |
no_license
|
SHASHA1S2/Code
|
15d3d015fd74bca06529873bdc90248d99a9dc1e
|
820c5f35f09f8f078f2a811c7efe2954b62a2c79
|
refs/heads/master
| 2021-01-17T23:49:31.412662
| 2012-12-09T16:35:20
| 2012-12-09T16:35:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 758
|
cpp
|
inverse.cpp
|
#include<cstdio>
#include<iostream>
using namespace std;
typedef long long LL;
LL mod=1000000007LL;
LL inverse(LL n)
{
LL a=mod,temp;
LL b=n,c00,d00,c11,d11,c01,q,d01,d10,c10;
c00=1;c01=0;c10=0;c11=1;
while(b!=0)
{
q=a/b;
d00=c10;d01=c11;d10=c00-q*c10;d11=c01-q*c11;
c00=d00;c01=d01;c11=d11;c10=d10;
temp=b;
b=a%b;
a=temp;
}
while(c01<mod)
c01+=mod;
return c01%mod;
}
LL fact[2000009];
//LL rev[1000009];
void init()
{
fact[0]=1;
for (int i=1;i<2000009;i++)
fact[i]=(fact[i-1]*i)%mod;
}
LL solve(LL n)
{
LL p=1;
p*=fact[2*n];
p=(p*inverse(fact[n]))%mod;
p=(p*inverse(fact[n-1]))%mod;
p=(p*inverse(2))%mod;
return p;
}
int main()
{
LL n,t;
cin>>t;
init();
while(t--){
cin>>n;
cout<<solve(n)<<endl;
}
return 0;
}
|
07cc7d9ec7abd564be653168ee96463e9eb0c694
|
bd90976eee39f81c73fee3406b50525a276c9468
|
/assign3/src/parser.cpp
|
97b2b4e3fdb495327afdb81c5e472f7fcaec5aeb
|
[] |
no_license
|
ngattusohw/Operating-Systems
|
7c4a6301d6bb6474120493cdd403a15153700520
|
dfbd10045a9980413d3e0de521354c365ef4710d
|
refs/heads/master
| 2021-03-30T15:31:52.582784
| 2018-04-27T02:38:46
| 2018-04-27T02:38:46
| 122,225,097
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,102
|
cpp
|
parser.cpp
|
#include "linkedlist.h"
#include "Gtree.h"
#include <stdio.h>
#include "main.h"
#include "parser.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstring>
#include <list>
#include <cmath>
using namespace std;
using std::string;
int MAXLINE = 256;
parser::parser(){
}
parser::~parser(){
}
void parser::dirList(string file){
ifstream inFile (file.c_str());
char oneline[MAXLINE];
while (inFile)
{
inFile.getline(oneline, MAXLINE);
cout << oneline << endl; //something with Dir
}
inFile.close();
}
void parser::fileList(string file){
ifstream inFile (file.c_str());
char oneline[MAXLINE];
string ID;
string fileSize;
string date1;
string date2;
string date3;
string filename;
string garbage;
while (inFile)
{
inFile.getline(oneline, MAXLINE);
inFile >> ID >> garbage >> garbage >> garbage >> garbage >> garbage >> fileSize >> date1 >> date2 >> date3 >> filename;
cout << ID << " fileSize:: " << fileSize << " Date:: " << date1 << date2 << date3 << " File name::" << filename << endl; //something with Dir
}
inFile.close();
}
|
efd2a068642835727408a80f98836c5343422357
|
f6439b5ed1614fd8db05fa963b47765eae225eb5
|
/mojo/common/common_type_converters.cc
|
2439432c8ba262b11529ea8c760027107f6ba7a3
|
[
"BSD-3-Clause"
] |
permissive
|
aranajhonny/chromium
|
b8a3c975211e1ea2f15b83647b4d8eb45252f1be
|
caf5bcb822f79b8997720e589334266551a50a13
|
refs/heads/master
| 2021-05-11T00:20:34.020261
| 2018-01-21T03:31:45
| 2018-01-21T03:31:45
| 118,301,142
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,308
|
cc
|
common_type_converters.cc
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/common/common_type_converters.h"
#include <string>
#include "base/strings/utf_string_conversions.h"
#include "url/gurl.h"
namespace mojo {
// static
String TypeConverter<String, base::StringPiece>::ConvertFrom(
const base::StringPiece& input) {
if (input.empty()) {
char c = 0;
return String(&c, 0);
}
return String(input.data(), input.size());
}
// static
base::StringPiece TypeConverter<String, base::StringPiece>::ConvertTo(
const String& input) {
return input.get();
}
// static
String TypeConverter<String, base::string16>::ConvertFrom(
const base::string16& input) {
return TypeConverter<String, base::StringPiece>::ConvertFrom(
base::UTF16ToUTF8(input));
}
// static
base::string16 TypeConverter<String, base::string16>::ConvertTo(
const String& input) {
return base::UTF8ToUTF16(TypeConverter<String, base::StringPiece>::ConvertTo(
input));
}
String TypeConverter<String, GURL>::ConvertFrom(const GURL& input) {
return String(input.spec());
}
GURL TypeConverter<String, GURL>::ConvertTo(const String& input) {
return GURL(input.get());
}
} // namespace mojo
|
d3f2c3b5a1e1f782fc051f8b056c293e18f71ddf
|
ed32cc4bb9824017228f43d0f3449312670f0bd1
|
/第二章/2.64.cpp
|
16ada1c40a28ac90ed2bd815cc98900dc9a01433
|
[] |
no_license
|
jay-hg/Homework-of-CS
|
0fa2dc8922fa9c55fef581ac9591149a8b106ef1
|
6dba376871890574d840151b121543fe82b6e824
|
refs/heads/master
| 2021-01-18T04:11:52.415769
| 2017-03-11T15:26:56
| 2017-03-11T15:26:56
| 84,272,419
| 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 433
|
cpp
|
2.64.cpp
|
#include <stdio.h>
typedef unsigned char* byte_pointer;
int any_even_one(unsigned x) {
return !((x & 0x55555555) ^ 0x55555555);
}
int main() {
printf("%d\n",sizeof(unsigned));
printf("所有偶数位都是1?(0x07777777):%d\n",any_even_one(0x07777777));
printf("所有偶数位都是1?(0xfd577777):%d\n",any_even_one(0xfd577777));
printf("所有偶数位都是1?(0x55555555):%d\n",any_even_one(0x55555555));
return 0;
}
|
9771b7e4b54b4e560f5a9a6cfb21fbd619c6745b
|
9bf932d2d301da0c6ac8d35c1cc439c1a51734da
|
/Schema_stm/main.cpp
|
9acf05c770c0b50258a49592af87f0d356a93b06
|
[] |
no_license
|
X-Robot-2015/Coupe_2017
|
b3da28763f0a92431a73f5cc2c44858cc1213c2e
|
2d521868c0ceb7da11b8d4b6b396d543ac2eca12
|
refs/heads/master
| 2021-01-11T15:22:06.076534
| 2017-03-15T16:16:58
| 2017-03-15T16:16:58
| 80,343,568
| 1
| 1
| null | 2017-03-01T13:31:26
| 2017-01-29T11:58:08
|
Arduino
|
UTF-8
|
C++
| false
| false
| 1,002
|
cpp
|
main.cpp
|
#include "mbed.h"
//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------
Serial pc(SERIAL_TX, SERIAL_RX);
DigitalOut myled(LED1);
unsigned int cardArg[16];
unsigned int cardCommand, cardArgCount;
void setup()
{
}
void loop()
{
if(pc.readable()){
cardCommand = pc.getc();
pc.putc(cardCommand);
cardArgCount= pc.getc();
pc.putc(cardArgCount);
for (int i = 0; i < cardArgCount; i++){
pc.printf("test3");
cardArg[i] = pc.getc();
}
switch(cardCommand)
{
case 0 :
myled = 1;
pc.printf("test4");
break;
case 1 :
myled = 0;
pc.printf("test5");
break;
}
}
}
int main()
{
setup();
while(1) {
loop();
}
}
|
97c89a54df262ce673ac5d6eb128416fbd358b3a
|
15972773a62d1950d472c077eab728e15860247d
|
/Q6/pagamento.h
|
75bfe9071b86ea434e7f4cbf45284c1dfd7b92b2
|
[] |
no_license
|
lygiaagueda/Roteiro_3
|
0c7091bd5802396b2d0b7434315fa68371a6f41f
|
9307fca7c48e7db0cdc32e5a163b2bd4ff7ee8cf
|
refs/heads/master
| 2020-03-10T02:27:08.568463
| 2018-04-23T18:20:00
| 2018-04-23T18:20:00
| 129,137,131
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 513
|
h
|
pagamento.h
|
#ifndef PAGAMENTO_H
#define PAGAMENTO_H
#include <iostream>
#include <string>
using namespace std;
class Pagamento {
private:
double valorDoPagamento;
string nomeDoFuncionario;
public:
void setValorDoPagamento(double valorDoPagamento);
void setNomeDoFuncionario(double nomeDoFuncionarioo);
double getValorDoPagamento();
string getNomeDoFuncionario();
Pagamento(double valorDoPagamento, string nomeDoFuncionario);
virtual ~Pagamento();
};
#endif
|
5557981e9f5598e72eb971307aecc862e5cf40f7
|
5ab292f9ca5e4c204aae1e11ff53dfc681445b0b
|
/src/State.h
|
7ebfeebf7c4e3f82e30d02f1c90e021dd6f57521
|
[] |
no_license
|
sanjaykrishnagouda/CMPE-259
|
174258a5762f6034b4497bb059484663f096e24f
|
229786cbc3d5cf6377a3ef6939462617abebbf79
|
refs/heads/master
| 2020-12-30T12:35:04.091951
| 2017-06-13T23:30:39
| 2017-06-13T23:30:39
| 91,389,287
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,673
|
h
|
State.h
|
/**************************************************************************
File: State.h
Class: State
Description: This object holds a set of viewpoints. All of its
data fields are public, but it provides a few access
methods.
The int arrays pi[] and pj[] contain coordinates of
viewpoints. The int num_viewpoints stores the number
of valid viewpoints in the array (the greatest valid
array index is num_viewpoints - 1).
sa_rand_next_state() Helper function with the wrong
prefix.
Methods: delete_viewpoint(k) Reduce number of viewpoints.
print(s) Send debugging info to stdout.
**************************************************************************/
class State
{
public:
int num_viewpoints; // TODO Rework as a vector
int pi[MAX_NUM_VIEWPOINTS]; // TODO Rework as a vector
int pj[MAX_NUM_VIEWPOINTS]; // TODO Rework as a vector
bool pcommunicating[MAX_NUM_VIEWPOINTS]; // TODO Rework as a vector
State() {};
State(int n, int *pi, int *pj, bool *pcom = NULL);
void delete_viewpoint(int k);
void print(const char *prefix);
};
State sa_rand_next_state
(
State S,
int sensor_radius_max,
int jump_radius_max,
Disk exploration_region,
CVIS_WANG *v,
bool force_viewpoint = false,
int forced_k = 0
);
|
b146a41c0a541e0f481b0f91206906ea6b4f8523
|
451bcb4a41ac1875cdf00b81ff789d658e69008c
|
/lab7/Rozdzielczosc.h
|
e7dbb1a40d658731b62a7e85b75329a27397397f
|
[] |
no_license
|
Vectrom/oop_labs
|
94c5b2b01881145b61292519fd2c2dfd4454731a
|
d925daef42b2e43feacde4d9fb7578d055c48c39
|
refs/heads/master
| 2020-05-03T00:02:53.145587
| 2019-04-18T00:58:00
| 2019-04-18T00:58:00
| 178,298,116
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,197
|
h
|
Rozdzielczosc.h
|
#pragma once
#include <iostream>
/**
* @class Rozdzielczosc
* @brief Klasa reprezentujaca rozdzielczosc urzadzen biurowych.
*/
class Rozdzielczosc {
public:
/**
* @fn Rodzielczosc
* @brief Konstruktor tworzacy nowy obiekt reprezentujący rozdzielczosc z zadana wysokością i szerokością
* @param width Szerokość
* @param height Wysokość
*/
Rozdzielczosc(const int width, const int height) : _width(width), _height(height) {}
/**
* @fn getWidth
* @brief Zwraca szerokosc rozdzielczosci
* @return Szerokosc
*/
int getWidth() const {return _width;}
/**
* @fn getHeight
* @brief Zwraca wysokosc rozdzielczosci
* @return Wysokosc
*/
int getHeight() const {return _height;}
private:
int _width;
int _height;
};
/**
* @fn operator<<
* @brief Przeciazenie operatora << pozwalajace na wypisanie przy jego uzyciu rozdzielczosci
* @param o Referencja do obiektu typu ostream, do którego zostanie wypisana rodzielczość
* @param rozdzielczosc Rozdzielczość, która zostanie wypisana
* @return Obiekt typu ostream, do ktorego zostala wypisana rozdzielczosc
*/
std::ostream& operator<<(std::ostream&o, const Rozdzielczosc& rozdzielczosc);
|
2b00ba22abefea50252fde9b996f4c707122a47d
|
5671c626ee367c9aacb909cd76a06d2fadf941e2
|
/frameworks/core/components/test/unittest/image_animator/image_animator_test.cpp
|
9e1c1aaca5070b5ef4b0c8688891096dc1097d99
|
[
"Apache-2.0"
] |
permissive
|
openharmony/ace_ace_engine
|
fa3f2abad9866bbb329524fb039fa89dd9517592
|
c9be21d0e8cb9662d5f4f93184fdfdb538c9d4e1
|
refs/heads/master
| 2022-07-21T19:32:59.377634
| 2022-05-06T11:18:20
| 2022-05-06T11:18:20
| 400,083,641
| 2
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 22,242
|
cpp
|
image_animator_test.cpp
|
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "gtest/gtest.h"
#include "adapter/aosp/entrance/java/jni/jni_environment.h"
#include "base/log/log.h"
#include "core/animation/card_transition_controller.h"
#include "core/components/box/box_component.h"
#include "core/components/image/image_animator_component.h"
#include "core/components/image/image_animator_element.h"
#include "core/components/stage/stage_element.h"
#include "core/components/test/json/json_frontend.h"
#include "core/components/test/unittest/mock/render_mock.h"
#include "core/components/test/unittest/mock/window_mock.h"
#include "core/mock/fake_asset_manager.h"
#include "core/mock/fake_task_executor.h"
#include "core/mock/mock_resource_register.h"
#include "core/pipeline/pipeline_context.h"
using namespace testing;
using namespace testing::ext;
namespace OHOS::Ace {
Platform::JniEnvironment::JniEnvironment() {}
Platform::JniEnvironment::~JniEnvironment() = default;
CardTransitionController::CardTransitionController(const WeakPtr<PipelineContext>& context) {}
void CardTransitionController::RegisterTransitionListener() {}
RRect CardTransitionController::GetCardRect(const ComposeId& composeId) const
{
return RRect();
}
std::shared_ptr<JNIEnv> Platform::JniEnvironment::GetJniEnv(JNIEnv* jniEnv) const
{
return nullptr;
}
Platform::JniEnvironment& Platform::JniEnvironment::GetInstance()
{
static Platform::JniEnvironment jniEnvironment;
return jniEnvironment;
}
namespace {
constexpr int32_t FRAME_TIME_IN_MILLISECOND = 10;
constexpr int32_t NANOSECOND_TO_MILLISECOND = 1000000;
constexpr int32_t TEST_SURFACE_WIDTH = 1080;
constexpr int32_t TEST_SURFACE_HEIGHT = 1920;
std::vector<ImageProperties> g_images;
std::vector<ImageProperties> g_secondImages;
std::vector<ImageProperties> g_thirdImages;
using ConfigImageAnimator = std::function<void(const RefPtr<ImageAnimatorComponent>&)>;
ConfigImageAnimator g_configImageAnimator;
} // namespace
class ImageAnimatorTest : public testing::Test {
public:
static void SetUpTestCase() {}
static void TearDownTestCase() {}
void SetUp() override
{
ImageProperties image1 = { "image1", Dimension(220), Dimension(220), Dimension(100), Dimension(100) };
ImageProperties image2 = { "image2", Dimension(240), Dimension(240), Dimension(110), Dimension(110) };
ImageProperties image3 = { "image3", Dimension(260), Dimension(260), Dimension(120), Dimension(120) };
g_images.emplace_back(image1);
g_images.emplace_back(image2);
g_images.emplace_back(image3);
ImageProperties secondImage1 = { "image1", Dimension(220), Dimension(220), Dimension(100), Dimension(100), 30 };
ImageProperties secondImage2 = { "image2", Dimension(240), Dimension(240), Dimension(110), Dimension(110), 30 };
ImageProperties secondImage3 = { "image3", Dimension(260), Dimension(260), Dimension(120), Dimension(120), 30 };
g_secondImages.emplace_back(secondImage1);
g_secondImages.emplace_back(secondImage2);
g_secondImages.emplace_back(secondImage3);
ImageProperties thirdImage1 = { "image1", Dimension(220), Dimension(220), Dimension(100), Dimension(100) };
ImageProperties thirdImage2 = { "image2", Dimension(240), Dimension(240), Dimension(110), Dimension(110), 30 };
ImageProperties thirdImage3 = { "image3", Dimension(260), Dimension(260), Dimension(120), Dimension(120), 30 };
g_thirdImages.emplace_back(thirdImage1);
g_thirdImages.emplace_back(thirdImage2);
g_thirdImages.emplace_back(thirdImage3);
}
void TearDown() override
{
g_images.clear();
g_secondImages.clear();
g_thirdImages.clear();
}
void InitImageAnimatorComponent()
{
std::unique_ptr<PlatformWindow> platformWindow = TweenTestUtils::CreatePlatformWindow();
platformWindowRaw_ = reinterpret_cast<MockPlatformWindow*>(platformWindow.get());
auto window = TweenTestUtils::CreateWindow(std::move(platformWindow));
auto taskExecutor = AceType::MakeRefPtr<FakeTaskExecutor>();
auto assetManager = Referenced::MakeRefPtr<FakeAssetManager>();
auto resRegister = Referenced::MakeRefPtr<MockResourceRegister>();
RefPtr<Frontend> frontend = Frontend::CreateDefault();
context_ = AceType::MakeRefPtr<PipelineContext>(
std::move(window), taskExecutor, assetManager, resRegister, frontend, 0);
context_->SetTimeProvider(
[this] { return this->platformWindowRaw_->GetCurrentTimestampNano() + NANOSECOND_TO_MILLISECOND * 10; });
imageAnimatorComponent_ = AceType::MakeRefPtr<ImageAnimatorComponent>("ImageAnimatorTest");
if (g_configImageAnimator) {
g_configImageAnimator(imageAnimatorComponent_);
}
auto pageComponent = AceType::MakeRefPtr<PageComponent>(0, "", imageAnimatorComponent_);
context_->SetupRootElement();
context_->PushPage(pageComponent);
context_->OnSurfaceChanged(TEST_SURFACE_WIDTH, TEST_SURFACE_HEIGHT);
platformWindowRaw_->SetNanoFrameTime(NANOSECOND_TO_MILLISECOND * frameTimeMs_);
GetImageAnimatorElement();
}
void GetImageAnimatorElement()
{
EXPECT_TRUE(context_);
auto stageElement = context_->GetStageElement();
EXPECT_TRUE(stageElement);
auto displayElement = stageElement->GetFirstChild();
EXPECT_TRUE(displayElement);
auto pageElement = displayElement->GetFirstChild();
EXPECT_TRUE(pageElement);
imageAnimatorElement_ = AceType::DynamicCast<ImageAnimatorElement>(pageElement->GetFirstChild());
EXPECT_TRUE(imageAnimatorElement_);
}
protected:
RefPtr<ImageAnimatorElement> imageAnimatorElement_;
RefPtr<ImageAnimatorComponent> imageAnimatorComponent_;
RefPtr<PipelineContext> context_;
uint32_t frameTimeMs_ = FRAME_TIME_IN_MILLISECOND;
MockPlatformWindow* platformWindowRaw_ = nullptr;
};
/**
* @tc.name: ImageAnimatorTest001
* @tc.desc: test image animator element(go forward).
* @tc.type: FUNC
* @tc.require: AR000E3DMG
* @tc.author: jiangdayuan
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest001, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
// go forward.
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_images);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(220, render->GetWidth());
EXPECT_EQ(220, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest002
* @tc.desc: test image animator element(go back).
* @tc.type: FUNC
* @tc.require: AR000E3DMG
* @tc.author: jiangdayuan
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest002, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
imageAnimator->SetIsFixedSize(false);
// go back.
imageAnimator->SetIsReverse(true);
imageAnimator->SetImageProperties(g_images);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest003
* @tc.desc: test image animator element(infinite play).
* @tc.type: FUNC
* @tc.require: AR000E3DMG
* @tc.author: jiangdayuan
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest003, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
// infinite repeat
imageAnimator->SetIteration(-1);
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_images);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. trigger frames and get the first repeat time value
* @tc.expected: step2. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
/**
* @tc.steps: step3. trigger frames and get the second repeat time value
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest004
* @tc.desc: test image animator element(go forward).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest004, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
// go forward.
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_secondImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(220, render->GetWidth());
EXPECT_EQ(220, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(220, render->GetWidth());
EXPECT_EQ(220, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest005
* @tc.desc: test image animator element(go back).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest005, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
imageAnimator->SetIsFixedSize(false);
// go back.
imageAnimator->SetIsReverse(true);
imageAnimator->SetImageProperties(g_secondImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest006
* @tc.desc: test image animator element(infinite play).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest006, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
// infinite repeat
imageAnimator->SetIteration(-1);
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_secondImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. trigger frames and get the first repeat time value
* @tc.expected: step2. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(220, render->GetWidth());
EXPECT_EQ(220, render->GetHeight());
/**
* @tc.steps: step3. trigger frames and get the second repeat time value
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest007
* @tc.desc: test image animator element(go forward).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest007, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
// go forward.
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_thirdImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest008
* @tc.desc: test image animator element(go back).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest008, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(1);
imageAnimator->SetIsFixedSize(false);
// go back.
imageAnimator->SetIsReverse(true);
imageAnimator->SetImageProperties(g_thirdImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. get the init value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
/**
* @tc.steps: step3. trigger frames to let image animation go
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest009
* @tc.desc: test image animator element(infinite play).
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest009, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
// infinite repeat
imageAnimator->SetIteration(-1);
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_thirdImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. trigger frames and get the first repeat time value
* @tc.expected: step2. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
/**
* @tc.steps: step3. trigger frames and get the second repeat time value
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
}
/**
* @tc.name: ImageAnimatorTest010
* @tc.desc: test image animator paly duration.
* @tc.type: FUNC
* @tc.require: AR000FL0UC
* @tc.author: jiachunhui
*/
HWTEST_F(ImageAnimatorTest, ImageAnimatorTest010, TestSize.Level1)
{
/**
* @tc.steps: step1. init ImageAnimator component
*/
g_configImageAnimator = [](const RefPtr<ImageAnimatorComponent>& imageAnimator) {
std::vector<RefPtr<Component>> images;
imageAnimator->SetDuration(20);
imageAnimator->SetIteration(-1);
imageAnimator->SetIsReverse(false);
imageAnimator->SetIsFixedSize(false);
imageAnimator->SetImageProperties(g_thirdImages);
};
InitImageAnimatorComponent();
/**
* @tc.steps: step2. trigger frames and get the first repeat time value
* @tc.expected: step2. value is correct
*/
auto box = imageAnimatorElement_->GetFirstChild();
EXPECT_TRUE(box);
auto image = box->GetFirstChild();
EXPECT_TRUE(image);
auto renderImage = image->GetRenderNode();
EXPECT_TRUE(renderImage);
auto render = AceType::DynamicCast<MockRenderImage>(renderImage);
EXPECT_TRUE(render);
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
/**
* @tc.steps: step3. trigger frames and get the second repeat time value
* @tc.expected: step3. value is correct
*/
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
EXPECT_EQ(260, render->GetWidth());
EXPECT_EQ(260, render->GetHeight());
/**
* @tc.steps: step3. trigger frames six times and get the second repeat time value
* @tc.expected: step3. if value is same as first frame value, the duration is 60.
*/
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
platformWindowRaw_->TriggerOneFrame();
// verify the animation duration is 60, not 20.
EXPECT_EQ(240, render->GetWidth());
EXPECT_EQ(240, render->GetHeight());
}
} // namespace OHOS::Ace
|
c00b1bd34d886340daed287b2ce8d595a2ae7e16
|
5a41ebdf9e26f5f2b6e2cc04632590ea6b6d8751
|
/src/lib/processor/cpp/parser_nodes.h
|
3e94dbeb93b5b453e1bd16597befdedd6c96a2a0
|
[] |
no_license
|
nadiasvertex/cql-db
|
202e044de2893d578be846fd15f4ce44ed386b46
|
cc5e82f8d6bd2e96a93440fd6662a437587d3c6e
|
refs/heads/master
| 2020-06-06T14:07:11.491959
| 2012-11-28T01:44:00
| 2012-11-28T01:44:00
| 32,324,322
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,390
|
h
|
parser_nodes.h
|
/*
* parser_actions.h
*
* Created on: Nov 1, 2012
* Author: cnelson
*/
#ifndef __LATTICE_PROCESSOR_PARSER_NODES_H__
#define __LATTICE_PROCESSOR_PARSER_NODES_H__
#include <memory>
#include <stack>
#include <cell/cpp/data_value.h>
#include <pegtl.hh>
namespace lattice {
namespace processor {
namespace actions {
using namespace pegtl;
/**
* Base class for nodes.
*/
class node
{
public:
enum class node_type
{
ROOT,
OP_ADD,
OP_SUB,
OP_MUL,
OP_DIV,
OP_MOD,
OP_CAT,
COLUMN_REF,
TABLE_REF,
LITERAL
};
private:
node_type type;
public:
node(node_type _type) :
type(_type)
{
}
virtual ~node()
{
}
;
/**
* Provides the type of the node.
*/
node_type get_type()
{
return type;
}
/**
* Visit each node in the tree once. Call fn with each node
* as the parameter.
*
* @param fn: The function to execute on each node.
*
* Performs a left-first, depth-first traversal.
*/
void visit(std::function<void(node*)> fn);
template<typename T>
T visit_mr(std::function<T(node*)> map,
std::function<T(const T&, const T&)> reduce);
};
typedef std::shared_ptr<node> node_handle_type;
typedef std::stack<node_handle_type> node_list_type;
/**
* Binary operation node.
*/
class binop: public node
{
node_handle_type left;
node_handle_type right;
public:
binop(node::node_type _type, node_handle_type _left, node_handle_type _right) :
node(_type), left(_left), right(_right)
{
}
virtual ~binop()
{
}
/**
* Get the left node.
*/
node_handle_type get_left()
{
return left;
}
/**
* Get the right node.
*/
node_handle_type get_right()
{
return right;
}
};
/**
* Literal node.
*/
class literal: public node
{
cell::data_value value;
public:
literal(const cell::data_value& v) :
node(node::node_type::LITERAL), value(v)
{
}
virtual ~literal()
{
}
const cell::data_value& get_value() const
{
return value;
}
};
/**
* Column reference.
*/
class column_ref: public node
{
int column_index;
std::string name;
public:
column_ref(const std::string& n, int index) :
node(node::node_type::COLUMN_REF), name(n), column_index(index)
{
}
virtual ~column_ref()
{
}
std::string& get_name()
{
return name;
}
int get_index()
{
return column_index;
}
};
/**
* Table reference.
*/
class table_ref: public node
{
std::string name;
std::unique_ptr<column_ref> col_ref;
public:
table_ref(const std::string& n) :
node(node::node_type::TABLE_REF), name(n), col_ref(nullptr)
{
}
virtual ~table_ref()
{
}
std::string& get_name()
{
return name;
}
/**
* Sets the column reference.
*/
void set_column_ref(column_ref *cr)
{
col_ref = std::unique_ptr<column_ref>(cr);
}
column_ref* get_column_ref()
{
return col_ref.get();
}
};
inline void node::visit(std::function<void(node*)> fn)
{
switch (get_type())
{
case node_type::OP_ADD:
case node_type::OP_SUB:
case node_type::OP_MUL:
case node_type::OP_DIV:
case node_type::OP_MOD:
{
auto* bn = dynamic_cast<binop*>(this);
if (bn != nullptr)
{
bn->get_left()->visit(fn);
bn->get_right()->visit(fn);
}
}
break;
}
fn(this);
}
template<typename T>
inline T node::visit_mr(std::function<T(node*)> map,
std::function<T(const T&, const T&)> reduce)
{
switch (get_type())
{
case node_type::OP_ADD:
case node_type::OP_SUB:
case node_type::OP_MUL:
case node_type::OP_DIV:
case node_type::OP_MOD:
{
auto* bn = dynamic_cast<binop*>(this);
if (bn != nullptr)
{
auto l = bn->get_left()->visit_mr(map, reduce);
auto r = bn->get_right()->visit_mr(map, reduce);
return reduce(l, r);
}
}
break;
default:
return map(this);
}
}
} // namespace actions
} // namespace processor
} // namespace lattice
#endif // __LATTICE_PROCESSOR_PARSER_NODES_H__
|
20a33323c1095de532289705645dcf93ada79268
|
989784cf74d6a56c543c0459a58606e2a0fe195d
|
/CaseStudy_13/Source/nvt.inc
|
15f2976f6d7d31932cefa4a13815baf8dde90aaf
|
[
"MIT"
] |
permissive
|
UnderstandingMolecularSimulation/CaseStudies
|
96cf321c34d01a5864a3d9e16052e165a3b7cc73
|
37ef456278ca31594646769f6bfbb2f751062f08
|
refs/heads/main
| 2023-08-31T18:07:44.364373
| 2023-08-21T14:37:56
| 2023-08-21T14:37:56
| 584,754,712
| 10
| 2
|
MIT
| 2023-08-21T14:36:31
| 2023-01-03T12:38:49
|
Fortran
|
UTF-8
|
C++
| false
| false
| 290
|
inc
|
nvt.inc
|
c nvt.inc
double precision temp
logical nvt
integer metht
common/nvtc/temp,metht,nvt
c
c temp : impost temperature
c metht : method used in simulation:
c 1 : Andersen
c 2 : Nose-Hoover
c NVT : if .true. simulate NVT ensemble
c
|
074aeb22621690bf395fbd54612560c800ed9698
|
b16e2f8cc94df8320f9caf8c8592fa21b1f7c413
|
/HDUOJ/6483/mo's_algorithm_binary_indexed_tree_doubling.cpp
|
70149111f7dc2cacfc93c8af395bbca3ddd683fe
|
[
"MIT"
] |
permissive
|
codgician/Competitive-Programming
|
000dfafea0575b773b0a10502f5128d2088f3398
|
391f3ce9b89b0a4bbbe3ff60eb2369fef57460d4
|
refs/heads/master
| 2022-06-13T04:59:52.322037
| 2020-04-29T06:38:59
| 2020-04-29T06:38:59
| 104,017,512
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,257
|
cpp
|
mo's_algorithm_binary_indexed_tree_doubling.cpp
|
#include <bits/stdc++.h>
using namespace std;
#define SIZE 100010
#define DSC_SIZE 200010
typedef struct _Query {
int id, qLeftPt, qRightPt;
} Query;
Query qArr[SIZE];
int arr[SIZE], posArr[SIZE];
pair<int, int> dsc[DSC_SIZE];
int numArr[DSC_SIZE], bit[DSC_SIZE], cntId;
bool ans[SIZE];
int lowbit(int n) {
return n & -n;
}
void add(int pos, int val) {
pos++;
for (int i = pos; i <= cntId + 1; i += lowbit(i))
bit[i] += val;
}
int prefixSum(int pos) {
pos++;
int ans = 0;
for (int i = pos; i > 0; i -= lowbit(i))
ans += bit[i];
return ans;
}
int getOnePos(int k) {
int sum = 0, ans = 0;
for (int i = 1 << 18; i > 0; i >>= 1) {
ans += i;
if (ans >= cntId + 1 || cnt + bit[ans] >= k)
ans -= i;
else
cnt += bit[ans];
}
return ans + 1;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int caseNum;
cin >> caseNum;
int blockSize = sqrt(SIZE);
for (int i = 0; i < SIZE; i++)
posArr[i] = i / blockSize;
while (caseNum--) {
int len, qNum;
cin >> len >> qNum;
for (int i = 0; i < len; i++) {
cin >> arr[i];
dsc[i] = make_pair(arr[i], i);
}
sort(dsc + 0, dsc + len);
arr[dsc[0].second] = 0;
cntId = 0;
for (int i = 1; i < len; i++) {
if (dsc[i].first == dsc[i - 1].first + 1)
cntId++;
else if (dsc[i].first > dsc[i - 1].first + 1)
cntId += 2;
arr[dsc[i].second] = cntId;
}
for (int i = 0; i < qNum; i++) {
cin >> qArr[i].qLeftPt >> qArr[i].qRightPt;
qArr[i].qLeftPt--, qArr[i].qRightPt--;
qArr[i].id = i;
}
sort(qArr + 0, qArr + qNum, [](const Query & fst, const Query & snd) {
if (posArr[fst.qLeftPt] == posArr[snd.qLeftPt])
return fst.qRightPt < snd.qRightPt;
return posArr[fst.qLeftPt] < posArr[snd.qLeftPt];
});
for (int i = 0; i <= cntId + 1; i++)
numArr[i] = 0, bit[i] = 0;
int cntLeftPt = 0, cntRightPt = 0;
numArr[arr[0]] = 1;
add(arr[0], 1);
for (int i = 0; i < qNum; i++) {
while (qArr[i].qLeftPt < cntLeftPt) {
// Add left
cntLeftPt--;
int cntPt = cntLeftPt;
if (numArr[arr[cntPt]] == 0) {
add(arr[cntPt], 1);
}
numArr[arr[cntPt]]++;
}
while (qArr[i].qRightPt > cntRightPt) {
// Add right
cntRightPt++;
int cntPt = cntRightPt;
if (numArr[arr[cntPt]] == 0) {
add(arr[cntPt], 1);
}
numArr[arr[cntPt]]++;
}
while (qArr[i].qLeftPt > cntLeftPt) {
// Delete left
int cntPt = cntLeftPt;
if (numArr[arr[cntPt]] == 1) {
add(arr[cntPt], -1);
}
numArr[arr[cntPt]]--;
cntLeftPt++;
}
while (qArr[i].qRightPt < cntRightPt) {
// Delete right
int cntPt = cntRightPt;
if (numArr[arr[cntPt]] == 1) {
add(arr[cntPt], -1);
}
numArr[arr[cntPt]]--;
cntRightPt--;
}
int oneNum = prefixSum(cntId);
if (oneNum <= 1) {
ans[qArr[i].id] = true;
continue;
}
int leftPt = getOnePos(1), rightPt = getOnePos(oneNum);
leftPt--, rightPt--;
if (prefixSum(rightPt) - prefixSum(leftPt - 1) == rightPt - leftPt + 1)
ans[qArr[i].id] = true;
else
ans[qArr[i].id] = false;
}
for (int i = 0; i < qNum; i++) {
cout << (ans[i] ? "YES\n" : "NO\n");
}
}
return 0;
}
|
392c34aa065367dfc9589d872c427393147b5118
|
febba07bb5d3bcf2128d85dfe1fd969459935608
|
/texprog2/Source.cpp
|
45a6f5f8b5483744c116f7f6731f82e077471e97
|
[] |
no_license
|
DanyaSWorlD/texprog2
|
1ababfa2974b012587fc574be8135dee1b261d63
|
0fa1600e0ffd521c3ba7dd77f5b20449b1cbaf22
|
refs/heads/master
| 2021-10-24T20:00:11.779028
| 2019-03-28T08:09:28
| 2019-03-28T08:09:28
| 110,579,334
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,576
|
cpp
|
Source.cpp
|
#include <iostream>
#include <windows.h>
#include "Semaphore.h"
using namespace std;
DWORD WINAPI testFunc(LPVOID param); /// Тестовая функция
Semaphore sem(4);
bool ct;
int main(int argc, char *argv[])
{
DWORD id;
for (int i = 0; i < 8; i++)
{
HANDLE h = CreateThread(NULL, 0, testFunc, LPVOID(new int(i)), 0, &id); /// Запуск потока
}
ct = true;
while (1)
if (sem.ret_Count_dbg() > 10) /// Если количество потоков больше 10
{
cout << "Error"; return 0;
}
}
DWORD WINAPI testFunc(LPVOID a) /// Тестовая функция
{
while (!ct);
int number = *(int *)(a);
while (1)
{
sem.Enter(); ///Входим в семафор
printf("%i Start\n", number);
auto mas = new int[(number+1)*20]; ///Объявляем массив. номер потока *20. 0 поток сортирует 20, 1 сортирует 40
for (int i = 0; i<(number + 1) * 20; i++) /// Забиваем рандомными значениями
{
mas[i] = rand() % 10;
}
bool changes = true;
while (changes) /// Сортировка пузырьком. Полезная нагрузка
{
changes = false;
for (int i = 0; i < (number + 1) * 20-1; i++)
if (mas[i] > mas[i + 1])
{
int a = mas[i];
mas[i] = mas[i + 1];
mas[i + 1] = a;
changes = true;
}
Sleep(number);
}
for (int i = 0; i < (number + 1) * 20; i++)
printf("%i ", mas[i]);
Sleep(1);
printf("\n%i End.\n", number);
sem.Leave(); /// Покидаем семафор
}
}
|
1d1ba109a28ac907196cb01416d62c3f6b170a9c
|
935fa4f586f4990b506a693dff8945d2b7f9c677
|
/u/t_async_operationlist.cpp
|
e781bb13621a43aeaeded70cbd62424fc5b07e0f
|
[] |
no_license
|
stefanreuther/afl
|
8e96be19a502463cdb72b42b6042cdd6869ecf0b
|
35d2eb7c6be1a3aebfdf1ce046e6e1310dc7caf8
|
refs/heads/master
| 2023-07-20T11:12:27.849160
| 2023-05-07T11:03:03
| 2023-05-07T11:03:03
| 69,809,604
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,824
|
cpp
|
t_async_operationlist.cpp
|
/**
* \file u/t_async_operationlist.cpp
* \brief Test for afl::async::OperationList
*/
#include "afl/async/operationlist.hpp"
#include "u/t_async.hpp"
#include "afl/async/operation.hpp"
#include "afl/async/sendoperation.hpp"
#include "afl/async/controller.hpp"
/** Test all operations with the base class. */
void
TestAsyncOperationList::testBase()
{
afl::async::OperationList<afl::async::Operation> list;
afl::async::Operation op1, op2, op3;
afl::async::Controller ctl;
// Nothing there yet
TS_ASSERT(list.extractFront() == 0);
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.empty());
TS_ASSERT(list.extractByController(&ctl) == 0);
TS_ASSERT(!list.remove(&op1));
// Move two items through the list
list.pushBack(&op1);
list.pushBack(&op2);
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op1);
TS_ASSERT(list.extractFront() == &op1);
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op2);
TS_ASSERT(list.extractFront() == &op2);
TS_ASSERT(list.empty());
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.extractFront() == 0);
// Now with remove()
list.pushBack(&op1);
list.pushBack(&op2);
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op1);
TS_ASSERT(list.remove(&op2));
TS_ASSERT(!list.remove(&op2));
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op1);
TS_ASSERT(list.extractFront() == &op1);
TS_ASSERT(list.empty());
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.extractFront() == 0);
// Now with controller
op1.setController(&ctl);
op3.setController(&ctl);
list.pushBack(&op1);
list.pushBack(&op2);
list.pushBack(&op3);
TS_ASSERT(list.extractByController(&ctl) == &op1);
TS_ASSERT(list.extractByController(&ctl) == &op3);
TS_ASSERT(list.extractByController(&ctl) == 0);
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op2);
TS_ASSERT(list.extractFront() == &op2);
TS_ASSERT(list.empty());
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.extractFront() == 0);
}
/** Test all operations with a derived class. */
void
TestAsyncOperationList::testDerived()
{
afl::async::OperationList<afl::async::SendOperation> list;
afl::async::SendOperation op1;
afl::async::Controller ctl;
// Nothing there yet
TS_ASSERT(list.extractFront() == 0);
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.empty());
TS_ASSERT(list.extractByController(&ctl) == 0);
TS_ASSERT(!list.remove(&op1));
// Walk element through the list
list.pushBack(&op1);
TS_ASSERT(!list.empty());
TS_ASSERT(list.front() == &op1);
TS_ASSERT(list.extractFront() == &op1);
TS_ASSERT(list.empty());
TS_ASSERT(list.front() == 0);
TS_ASSERT(list.extractFront() == 0);
}
|
9a141e99f51cb8323ab187bf941c2b59e4f62288
|
ac5d9dced7c723cbbb7c541fb5031b548003342d
|
/Code/bzoj3283_data.cpp
|
b97e710c58c02a4f3f2c7c6c05bb16a85892da5d
|
[] |
no_license
|
kzoacn/OI
|
2f47e1bd30a07d8e2b45b5813b1491aff0ef1f10
|
d34e2739b4ae1ddfe20faeda3b152329816dd960
|
refs/heads/master
| 2020-05-17T00:31:25.886309
| 2015-07-21T12:38:56
| 2015-07-21T12:38:56
| 37,414,200
| 4
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 431
|
cpp
|
bzoj3283_data.cpp
|
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
int range(int l,int r){return rand()%(r-l)+l;}
typedef long long LL;
LL pow(LL x,LL k,LL p){
LL ans=1;
for(;k;k>>=1){
if(k&1)ans=ans*x%p;
x=x*x%p;
}return ans;
}
int main(){
srand(time(0)^getpid());
int T=50;
printf("%d\n",T);
while(T--){
LL a=range(1,1000),x=range(0,1000),p=range(1,1000);
printf("2 %lld %lld %lld\n",a,pow(a,x,p),p);
}
return 0;
}
|
1c06c14c421f82572f0f9fd0e96de4271a33fbe8
|
6f78a4c4896563a52d86eacf49dbb6a358a3646e
|
/codility/cpp/codility_lesson13_1.cpp
|
6e0c1a989f13a4822a9d5129e5a20535ffb75f5b
|
[] |
no_license
|
wj1224/algorithm_solve
|
259c39d2a85ecb2630e089eb0c86cdde9ff3baeb
|
8b0f15b71a4dd8eb40d3c9baee003a0678c3f2aa
|
refs/heads/master
| 2023-08-25T06:14:21.615802
| 2021-10-26T05:00:59
| 2021-10-26T05:00:59
| 219,981,525
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 715
|
cpp
|
codility_lesson13_1.cpp
|
// you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
vector<int> solution(vector<int> &A, vector<int> &B) {
// write your code in C++14 (g++ 6.2.0)
int N = A.size();
vector<int> v;
int maxA = -99999999;
int maxB = -99999999;
for (int i = 0; i < N; i++)
{
if (A[i] > maxA)
maxA = A[i];
if (B[i] > maxB)
maxB = B[i];
}
int* fib = new int[maxA + 2]{ 0, };
fib[1] = 1;
fib[2] = 2;
for (int i = 3; i < maxA + 2; i++)
{
fib[i] = (fib[i - 1] + fib[i - 2]) & ((1 << maxB) - 1);
}
for (int i = 0; i < N; i++)
v.push_back(fib[A[i]] % ((1 << B[i])));
delete[] fib;
return v;
}
|
dcf997ed5a6b902a1e5cbd6bb6632c017b92de50
|
61826c9bc454d3857bed864e29751f541d602106
|
/test/spirit.cpp
|
958f53f6c3983b52be7a811667b9b4302da86255
|
[
"BSL-1.0"
] |
permissive
|
reuk/strict-variant
|
d00f624b972f05cfc6947e03ff662f4a5065f046
|
7d0f1433d5126951b1af350213a0c7e75575fab0
|
refs/heads/master
| 2022-11-21T10:48:47.077949
| 2020-07-24T22:51:26
| 2020-07-24T22:51:26
| 282,328,692
| 0
| 0
|
BSL-1.0
| 2020-07-24T22:41:09
| 2020-07-24T22:41:09
| null |
UTF-8
|
C++
| false
| false
| 2,421
|
cpp
|
spirit.cpp
|
#include <boost/spirit/include/qi.hpp>
#include <strict_variant/variant.hpp>
#include <strict_variant/variant_spirit.hpp>
#include <strict_variant/variant_stream_ops.hpp>
#include "test_harness/test_harness.hpp"
#include <string>
#include <type_traits>
namespace qi = boost::spirit::qi;
using str_it = std::string::const_iterator;
using var_one_t = strict_variant::variant<std::string, int>;
template <typename Iterator>
struct test_grammar : qi::grammar<Iterator, var_one_t()> {
qi::rule<Iterator, std::string()> str_;
qi::rule<Iterator, int()> int_;
qi::rule<Iterator, var_one_t()> main_;
test_grammar()
: test_grammar::base_type(main_) {
str_ = qi::lit("s") >> *qi::char_;
int_ = qi::lit("i") >> qi::int_;
main_ = str_ | int_;
}
};
UNIT_TEST(string_int_grammar) {
var_one_t v;
test_grammar<str_it> gram;
std::string t1 = "sabc";
std::string t2 = "i120";
std::string t3 = "si120";
std::string t4 = "i0";
std::string t5 = "ssabci120";
std::string t6 = "is";
std::string t7 = "i70sabc";
{
str_it it = t1.begin(), end = t1.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const std::string * s = strict_variant::get<std::string>(&v);
TEST_TRUE(s);
TEST_EQ(*s, "abc");
}
{
str_it it = t2.begin(), end = t2.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const int * i = strict_variant::get<int>(&v);
TEST_TRUE(i);
TEST_EQ(*i, 120);
}
{
str_it it = t3.begin(), end = t3.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const std::string * s = strict_variant::get<std::string>(&v);
TEST_TRUE(s);
TEST_EQ(*s, "i120");
}
{
str_it it = t4.begin(), end = t4.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const int * i = strict_variant::get<int>(&v);
TEST_TRUE(i);
TEST_EQ(*i, 0);
}
{
str_it it = t5.begin(), end = t5.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const std::string * s = strict_variant::get<std::string>(&v);
TEST_TRUE(s);
TEST_EQ(*s, "sabci120");
}
{
str_it it = t6.begin(), end = t6.end();
TEST_FALSE(qi::parse(it, end, gram, v));
}
{
str_it it = t7.begin(), end = t7.end();
TEST_TRUE(qi::parse(it, end, gram, v));
const int * i = strict_variant::get<int>(&v);
TEST_TRUE(i);
TEST_EQ(*i, 70);
}
}
int
main() {
std::cout << "Variant spirit tests:" << std::endl;
test_registrar::run_tests();
}
|
b49f604040abe232f1c394d129ee7b438c47c34f
|
d0fb46aecc3b69983e7f6244331a81dff42d9595
|
/elasticsearch/src/model/CreateComponentIndexRequest.cc
|
14d100f29094f591a72c46152a5d544c648ac529
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-cpp-sdk
|
3d8d051d44ad00753a429817dd03957614c0c66a
|
e862bd03c844bcb7ccaa90571bceaa2802c7f135
|
refs/heads/master
| 2023-08-29T11:54:00.525102
| 2023-08-29T03:32:48
| 2023-08-29T03:32:48
| 115,379,460
| 104
| 82
|
NOASSERTION
| 2023-09-14T06:13:33
| 2017-12-26T02:53:27
|
C++
|
UTF-8
|
C++
| false
| false
| 1,790
|
cc
|
CreateComponentIndexRequest.cc
|
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/elasticsearch/model/CreateComponentIndexRequest.h>
using AlibabaCloud::Elasticsearch::Model::CreateComponentIndexRequest;
CreateComponentIndexRequest::CreateComponentIndexRequest()
: RoaServiceRequest("elasticsearch", "2017-06-13") {
setResourcePath("/openapi/instances/[InstanceId]/component-index/[name]"};
setMethod(HttpRequest::Method::Post);
}
CreateComponentIndexRequest::~CreateComponentIndexRequest() {}
string CreateComponentIndexRequest::getInstanceId() const {
return instanceId_;
}
void CreateComponentIndexRequest::setInstanceId(string instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), std::to_string(instanceId));
}
string CreateComponentIndexRequest::getName() const {
return name_;
}
void CreateComponentIndexRequest::setName(string name) {
name_ = name;
setParameter(std::string("name"), std::to_string(name));
}
std::string CreateComponentIndexRequest::getBody() const {
return body_;
}
void CreateComponentIndexRequest::setBody(const std::string &body) {
body_ = body;
setBodyParameter(std::string("body"), body);
}
|
390a7af08e74d9a8c91b38ccfc50d359ba6ec459
|
41a0fa3b6fa55f2c278e06718a04ad38e645dfa0
|
/leetcode/771.cpp
|
ea0fea24a54ec5bba74c3299c67f87e8b55514fd
|
[] |
no_license
|
sharmarajdaksh/cp
|
d3a42bca8349fd958f2a3f19a173980d4aa94e44
|
c0f900e14a4f502c647b0f40c2b00871e2fd43de
|
refs/heads/master
| 2023-07-28T22:04:02.357209
| 2021-09-13T14:59:50
| 2021-09-13T14:59:50
| 277,243,723
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 449
|
cpp
|
771.cpp
|
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int numJewelsInStones(string J, string S)
{
int stonesCount = 0;
for (char stone : J)
{
stonesCount += count(S.begin(), S.end(), stone);
}
return stonesCount;
}
};
int main()
{
Solution s = Solution();
assert(s.numJewelsInStones("aA", "aAAbbbb") == 3);
assert(s.numJewelsInStones("z", "ZZ") == 0);
}
|
565ad2e299374ae06e55d2c7bea96c30b5d943c0
|
aaabf0a2e81cdb3eee5d4dec4e2b2e4f0753e71d
|
/3.8.1/3.8.1/3.8.1.cpp
|
75897aa41d652838cc6069aeb35025c715bef015
|
[] |
no_license
|
Twelvecat/C-
|
ff51b7cd4d89fc4bc3f90cd3253510e1cfa6c375
|
25da356289a16b36b328eea15514169942ec7946
|
refs/heads/master
| 2020-04-11T18:58:24.867385
| 2018-12-17T02:23:19
| 2018-12-17T02:23:19
| 162,018,420
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 445
|
cpp
|
3.8.1.cpp
|
#include <iostream>
using namespace std;
int main() {
int i, b, c = 0, a = 0;
cin >> i;
b = i;
do {
while (a < i) {
for(;c < b - i;c++){
cout << " ";
}
a++;
cout << "*";
}
cout << '\n';
i -= 1;
a = 0;
c = 0;
} while (a < i);
int h, j, k;
for (h = 0; h < 9; h++) {
for (j = 0; j <= h - 1; j++) {
cout << " ";
}
for (k = 0; k < 9 - h; k++) {
cout << "*";
}
cout << '\n';
}
return 0;
}
|
446677d90a5901bfdb5151d4058d8d9b7459799c
|
cdb43c308f4930b2e4138d9d5b5b030bf9e94176
|
/src/energizer.h
|
61a08ac353738421e0b07cc125dbb03b485283e1
|
[
"CC0-1.0",
"BSD-3-Clause"
] |
permissive
|
KDE/kapman
|
91e783be57ed3f277fceec2e5d024b83a3250b28
|
d26b250268c34ee59cff5012d39bf952f19a71ac
|
refs/heads/master
| 2023-09-04T07:13:50.299648
| 2023-09-03T01:51:34
| 2023-09-03T01:51:34
| 42,719,065
| 12
| 5
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,295
|
h
|
energizer.h
|
/*
SPDX-FileCopyrightText: 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
SPDX-FileCopyrightText: 2007-2008 Gaël Courcelle <gael.courcelle@gmail.com>
SPDX-FileCopyrightText: 2007-2008 Alexia Allanic <alexia_allanic@yahoo.fr>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef ENERGIZER_H
#define ENERGIZER_H
#include "element.h"
/**
* @brief This class represents an energizer enabling to eat Ghosts.
*/
class Energizer : public Element
{
Q_OBJECT
public:
/** The value of an Energyzer */
static const int POINTS;
public:
/**
* Creates a new Energizer instance.
* @param p_x the x-coordinate
* @param p_y the y-coordinate
* @param p_maze the Maze the Energyzer is on
* @param p_imageId the path to the Energyzer image
*/
Energizer(qreal p_x, qreal p_y, Maze *p_maze, const QString &p_imageId);
/**
* Deletes the Energizer instance.
*/
~Energizer() override;
/**
* Gets the type of the Energyzer.
* @return the type of the Energyzer
*/
QString getType();
/**
* Computes an action on a collision with the Kapman.
* @param p_kapman the instance of Kapman which collides with the Energyzer
*/
void doActionOnCollision(Kapman *p_kapman) override;
};
#endif
|
56c59e161d7eb5ae33ef0031c1552565074486c8
|
88a98406c59299686031cd1842724ecc452d012b
|
/author-sol.cpp
|
78f4f0438294c7b0ceff9a491d822b010ba7b0c4
|
[] |
no_license
|
mgalang229/Codeforces-1011A-Stages
|
2287f740cac2fbfddd114fe94761cfae834a5c83
|
f22d70e1d324a591cc1e0a3d668bbdc05e1ee15f
|
refs/heads/main
| 2023-07-30T11:20:07.777976
| 2021-09-28T13:15:14
| 2021-09-28T13:15:14
| 411,211,974
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 809
|
cpp
|
author-sol.cpp
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
string s;
cin >> s;
sort(s.begin(), s.end());
// set 'last' to (0 - 2 = -2), so we can include the first letter
char last = 'a' - 2;
int ans = 0;
int len = 0;
for (int i = 0; i < n; i++) {
// check if the current letter is at least two positions away from the previous letter
// (except for the first letter since we need to start with this)
// calculate the value for every letter and increment 'len'
// once 'len' is equal to 'k', then print the answer and exit the program
if (s[i] >= last + 2) {
last = s[i];
ans += (s[i] - 'a' + 1);
len += 1;
if (len == k) {
cout << ans << '\n';
exit(0);
}
}
}
cout << -1 << '\n';
return 0;
}
|
409599b99bfbbb5f376d52fce6160fa37907bb8b
|
ece0df2446dae16ed5ff4891379924484e595f1a
|
/src/asnNodeSprite/CNodeGrid2D.h
|
0209cbf098257941a92f4e596d3ff7fcc70ecdb2
|
[] |
no_license
|
RandomAmbersky/AmberSkyNet
|
838376d5426254d8ee76bfaa5ab378d5f40d35a1
|
fb7a10c6edd4691a0e65d06f11c32250df3c5707
|
refs/heads/master
| 2020-04-28T21:57:33.823704
| 2013-06-27T19:22:00
| 2013-06-27T19:22:00
| null | 0
| 0
| null | null | null | null |
MacCyrillic
|
C++
| false
| false
| 1,256
|
h
|
CNodeGrid2D.h
|
#ifndef _CNodeGrid2D_H
#define _CNodeGrid2D_H
#include "CNode.h"
#include "IDevice.h"
#include "Interfaces/ASNIGrid2D.h"
class CNodeGrid2D: public CNode, public ASNIGrid2D {
public:
CNodeGrid2D(IEngine* engine);
~CNodeGrid2D();
virtual bool LoadResource();
virtual bool Draw();
virtual void SetParam(const char* param_name,const char* param_value);
// interface
ASNInterface* GetInterface(const char* interface_name);
void SetCell(int cell_x, int cell_y, INode* node);
INode* GetCell(int cell_x, int cell_y);
bool MoveCell(int cell_xs, int cell_ys, int cell_xf, int cell_yf );
bool FindMouseCell(int scr_x, int scr_y, int* cell_x, int* cell_y);
protected:
void Calculate(); // функци€ пересчета базовых параметров (ширина и высота €чейки)
INode **myNodes; // массив нод
int NumX; // число €чеек по ’
int NumY; // число €чеек по Y
float w_x; // ширина 1 €чейки сетки
float w_y; // высота 1 €чейки сетки
IDrawObject* myGrid; // объект отрисовки
float *buff; // буфер дл€ отрисовки линий сетки
bool show_grid;
bool rescale;
};
#endif
|
6efb304fec4e41f53f72ea606cf579c239ea6de2
|
8d16b45007096e0342c7e43a4155b5d6dc916b62
|
/Algorithm/181-240/214_Shortest_Palindrome_1.cpp
|
7d08a8b5835f5e917e7388317d9971ae9e2046fd
|
[] |
no_license
|
FuzeT/LeetCode
|
f39b4830f76071b70129953353750de6870f0676
|
32d7876f4a182a8f279fe7d8e55a2560c808c399
|
refs/heads/master
| 2021-01-18T01:27:05.925990
| 2015-08-28T02:56:15
| 2015-08-28T02:56:15
| 33,971,620
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 855
|
cpp
|
214_Shortest_Palindrome_1.cpp
|
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <math.h>
#include <inttypes.h>
#include <unordered_set>
using namespace std;
class Solution {
public:
string shortestPalindrome(string s) {
string output;
if (s.size() == 0) return output;
int i = s.size() - 1;
for (; i>0; i--){
if (isPalindrome(s, i)) break;
}
return reverse(s, i);
}
bool isPalindrome(string s, int end){
int start = 0;
while (start<end){
if (s[start++] != s[end--]) return false;
}
return true;
}
string reverse(string s, int start){
if (start == s.size() - 1) return s;
string newString = s.substr(start + 1);
for (int i = 0; i<newString.size(); i++){
s = newString[i] + s;
}
return s;
}
};
|
d959e1a7313674861db877f181307a2cdfd039f3
|
192507eec73ab6736b5ecc90b8ba160aed090ad0
|
/B_CfSeq.cpp
|
9d19c4382759ce70193e888d70a27a46c4d7e366
|
[] |
no_license
|
SaadNoor555/cp-practice
|
615af29e949e319d6ea058b12c5d2d81d07eaa5d
|
70022373ed74017ae30e7c1ae381450f09f37c73
|
refs/heads/master
| 2023-07-01T05:16:44.071798
| 2021-08-08T21:05:45
| 2021-08-08T21:05:45
| 318,886,998
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 319
|
cpp
|
B_CfSeq.cpp
|
#include<bits/stdc++.h>
using namespace std;
long long n,k,a[12],p;
string s;
int main(){
cin>>n;
for(k=1;k<=10;k++)
a[k]=1;
p=1;
while(p<n){
for(k=1;k<=10;k++){
p/=a[k];
a[k]++;
p*=a[k]; if(p>=n) break;
}
}
s="codeforces";
for(k=0;k<10;k++){
while(a[k+1]--){
cout<<s[k];
}
}
}
|
89710c8634eb87a4a36901041cfe144f47a7276f
|
935927010571e2f820e70cead9a1fd471d88ea16
|
/Online Judge/Codeforces/Practice/1800/Password.cpp
|
b99d8a6fcf614bbc65769f911bc79f6eff14fdc4
|
[] |
no_license
|
muhammadhasan01/cp
|
ebb0869b94c2a2ab9487861bd15a8e62083193ef
|
3b0152b9621c81190dd1a96dde0eb80bff284268
|
refs/heads/master
| 2023-05-30T07:18:02.094877
| 2023-05-21T22:03:57
| 2023-05-21T22:03:57
| 196,739,005
| 6
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 818
|
cpp
|
Password.cpp
|
#include<bits/stdc++.h>
using namespace std;
string s;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> s;
int n = s.size();
vector<int> lps(n+3,0);
for(int i=1,j=0;i<n;i++){
while(j > 0 && s[j] != s[i])j = lps[j-1];
if(s[j] == s[i])j++;
lps[i] = j;
}
reverse(s.begin(),s.end());
vector<int> lps2(n+3,0);
for(int i=1,j=0;i<n;i++){
while(j > 0 && s[j] != s[i])j = lps2[j-1];
if(s[j] == s[i])j++;
lps2[i] = j;
}
reverse(s.begin(),s.end());
int len = 0;
for(int i=1;i<n-1;i++){
if(lps[i] > 0 && lps[i] == lps2[n - (i - lps[i] + 1) - 1]){
len = max(len,lps[i]);
}
}
cout << (len > 0 ? s.substr(0,len) : "Just a legend") << "\n";
return 0;
}
|
8d8e8f7b4bec074f84fbc60699dae104b9a8215e
|
3efc50ba20499cc9948473ee9ed2ccfce257d79a
|
/data/code-jam/files/1836486_mayorandrew_1484496_0_extracted_A.cpp
|
6de22fd4f43759f320631fd861f0d7210341e301
|
[] |
no_license
|
arthurherbout/crypto_code_detection
|
7e10ed03238278690d2d9acaa90fab73e52bab86
|
3c9ff8a4b2e4d341a069956a6259bf9f731adfc0
|
refs/heads/master
| 2020-07-29T15:34:31.380731
| 2019-12-20T13:52:39
| 2019-12-20T13:52:39
| 209,857,592
| 9
| 4
| null | 2019-12-20T13:52:42
| 2019-09-20T18:35:35
|
C
|
UTF-8
|
C++
| false
| false
| 2,091
|
cpp
|
1836486_mayorandrew_1484496_0_extracted_A.cpp
|
#include <iostream>
#include <fstream>
#define SMALL
//#define DEBUG
using namespace std;
int S;
int *var;
bool working=true;
void increase(int k=0){
if(S-k>=1){
var[S-k-1]++;
if(var[S-k-1]==3){
var[S-k-1]=0;
increase(k+1);
}
}else{
working=false;
}
}
int main(){
#ifndef DEBUG
#ifdef SMALL
ifstream input("input1.txt");
ofstream output("output1.txt");
#else
ifstream input("input2.txt");
ofstream output("output2.txt");
#endif
#endif
int N;
input >> N;
for(int i=0; i<N; i++){
input >> S;
if(i>0){
delete[] var;
}
var = new int[S];
int numbers[S];
for(int k=0; k<S; k++){
var[k]=0;
input >> numbers[k];
}
working=true;
output << "Case #" << (i+1) << ": " << endl;
while(working){
int S1=0;
int S2=0;
int N1=0;
int N2=0;
for(int k=0; k<S; k++){
if(var[k]==1){
S1+=numbers[k];
N1++;
}else if(var[k]==2){
S2+=numbers[k];
N2++;
}
}
if(S1==S2 && N1>0 && N2>0){
for(int k=0; k<S; k++){
if(var[k]==1){
output << numbers[k] << " ";
}
}
output << endl;
for(int k=0; k<S; k++){
if(var[k]==2){
output << numbers[k] << " ";
}
}
output << endl;
break;
}
increase();
}
if(!working){
output << "Impossible" << endl;
}
}
#ifndef DEBUG
output.close();
input.close();
#endif
return 0;
}
|
dc66d09f46730f1c7ec05723f1164f03fa4eb47f
|
307d3837d31f9e3728af2b62ca51ebf63fe6ec6b
|
/hall_of_fame/wi-seong-cheol/PGS/2019 KAKAO BLIND RECRUITMENT/무지의 먹방 라이브.cpp
|
9a637ac96c272c296acd7460147b75ad76874d1a
|
[] |
no_license
|
ellynhan/challenge100-codingtest-study
|
905043497d154b8a7333ca536e536d013f6e7454
|
bcdc6d04f13b12ba80b42e066f9d244d7c2cc698
|
refs/heads/master
| 2023-09-01T14:10:13.481013
| 2023-08-27T14:38:52
| 2023-08-27T14:38:52
| 401,561,230
| 162
| 176
| null | 2023-09-09T14:56:25
| 2021-08-31T03:30:36
|
C++
|
UTF-8
|
C++
| false
| false
| 1,233
|
cpp
|
무지의 먹방 라이브.cpp
|
//
// 무지의 먹방 라이브.cpp
// wi-seong-cheol
//
// Created by wi_seong on 2023/03/03.
//
// 시간복잡도: O(n)
// 최악시간: 200,000
// 난이도: Level 4
// Timer: 1h
// Url: https://school.programmers.co.kr/learn/courses/30/lessons/42891
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
#define time first
#define idx second
bool cmp(pair<ll, int>& a, pair<ll, int>& b) {
return a.second < b.second;
}
int solution(vector<int> food_times, long long k) {
int n = food_times.size();
vector<pair<ll, int>> food;
for(int i = 0; i < n; i++)
food.push_back({food_times[i], i + 1});
sort(food.begin(), food.end());
ll prev_time = 0;
for(int i = 0; i < n; i++) {
ll cnt = (ll)(n - i) * (food[i].time - prev_time);
if(cnt == 0) continue;
if(cnt <= k) { // 모두 먹을 수 있을 때
k -= cnt;
prev_time = food[i].time;
} else { // 모두 먹을 수 없을 때
k %= (n - i);
sort(food.begin() + i, food.end(), cmp);
return food[i + k].idx;
}
}
return -1;
}
|
c5a8d32f1b0509217202af7bd6a0d6f6b4f0bdfc
|
acf30fa254f72c282fce77b22dced66b21f8277d
|
/src/commands/certificatetopivcardcommand.h
|
bb92e524ed55607e4c7b7dff5ccc7a1921ce51fd
|
[
"CC0-1.0",
"BSD-3-Clause"
] |
permissive
|
KDE/kleopatra
|
fc879c3d1f9fa4e7f54ebcb825eaea8705386d72
|
3e6db6e439bbb62886dd58cfc4239f256fec5415
|
refs/heads/master
| 2023-08-18T04:37:13.963770
| 2023-08-16T21:17:25
| 2023-08-16T21:17:34
| 53,312,712
| 84
| 16
| null | 2020-12-29T18:58:39
| 2016-03-07T09:27:39
|
C++
|
UTF-8
|
C++
| false
| false
| 851
|
h
|
certificatetopivcardcommand.h
|
/* commands/certificatetopivcardcommand.h
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2020 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include <commands/cardcommand.h>
namespace GpgME
{
class Error;
}
namespace Kleo
{
namespace Commands
{
class CertificateToPIVCardCommand : public CardCommand
{
Q_OBJECT
public:
CertificateToPIVCardCommand(const std::string &cardSlot, const std::string &serialno);
~CertificateToPIVCardCommand() override;
public Q_SLOTS:
void certificateToPIVCardDone(const GpgME::Error &err);
private:
void doStart() override;
void doCancel() override;
private:
class Private;
inline Private *d_func();
inline const Private *d_func() const;
};
}
}
|
313aa3fe6e6dd88c2383c7da11eb974eef1e75ac
|
4579eaaeabeaa4d945ec9e0c802ec28bbb9aa8ef
|
/cse461/lab1/lab1.cpp
|
27769383d526ccbdf3dcfbdda12271163d124ee3
|
[] |
no_license
|
CircuitMonster/School
|
bbed854f3ff5e8ae859c68c9c5a6be609fdd14cb
|
e6e71ce8c0beb3791958949245a7665908caa3de
|
refs/heads/master
| 2021-01-22T19:59:52.686214
| 2017-03-17T04:41:06
| 2017-03-17T04:41:06
| 85,271,605
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,507
|
cpp
|
lab1.cpp
|
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
class PasswordFile
{
public:
PasswordFile(string filename); // opens the file and reads the names/passwords in the vectors user and password.
void addpw(string newuser, string newpassword); //this adds a new user/password to the vectors and writes the vectors to the file filename
bool checkpw(string usr, string passwd); // returns true if user exists and password matches
private:
string filename; // the file that contains password information
vector<string> user; // the list of usernames
vector<string> password; // the list of passwords
void synch(); //writes the user/password vectors to the password file
void checkuser(string check);
};
void PasswordFile::synch()
{
ofstream out;
out.open(filename.c_str());
for (int i = 0; i < user.size(); i++)
{
out << user[i] << " " << password[i] << endl;
}
out.close();
}
PasswordFile::PasswordFile(string filename)
{
this->filename = filename;
ifstream infile;
string u, p;
infile.open(filename.c_str());
if (infile.is_open())
{
infile >> u >> p;
while (infile.good())
{
user.push_back(u);
password.push_back(p);
infile >> u >> p;
}
infile.close();
}
}
void PasswordFile::addpw(string newuser, string newpassword)
{
checkuser(newuser);
user.push_back(newuser);
password.push_back(newpassword);
synch();
}
bool PasswordFile::checkpw(string usr, string passwd)
{
for (int i = 0; i < password.size(); i++)
{
if ((user[i] == usr) and (password[i] == passwd))
{
return true;
}
}
}
void PasswordFile::checkuser(string check)
{
for (int i = 0; i < user.size(); i++)
{
if (check == user[i])
{
cout << "User name exsits, please choose another name" << endl;
return;
}
}
}
int main()
{
PasswordFile passfile("password.txt");
passfile.addpw("dbotting","123qwe");
passfile.addpw("egomez","qwerty");
passfile.addpw("tongyu","liberty");
// write some lines to see if passwords match users
if (passfile.checkpw("dbotting","123qwe") == true)
{
cout << "correct name and password" << endl;
}
else
{
cout << "incorrect name and password" << endl;
}
if (passfile.checkpw("egomez","qwerty") == true)
{
cout << "correct name and password" << endl;
}
else
{
cout << "incorrect name and password" << endl;
}
if (passfile.checkpw("whatttt","noooooo") == true)
{
cout << "correct name and password" << endl;
}
else
{
cout << "incorrect name and password" << endl;
}
}
|
e97f4e283dc802ffa690dabd34c5914a5c355212
|
04a540847c1333c987a1957fd8d31197c594f6bb
|
/BOJ/17609_1.cpp
|
d1fb43141bdc94dd3423e13fd4a2f70cb1640abb
|
[] |
no_license
|
k8440009/Algorithm
|
fd148269b264b580876c7426e19dbe2425ddc1ab
|
a48eba0ac5c9f2e10f3c509ce9d349c8a1dc3f0c
|
refs/heads/master
| 2023-04-02T16:06:10.260768
| 2023-04-02T11:04:32
| 2023-04-02T11:04:32
| 200,506,643
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,296
|
cpp
|
17609_1.cpp
|
// 회문
// https://www.acmicpc.net/problem/17609
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int N;
string str;
int alpha[26];
bool sudoPalin(int left, int right, bool flag)
{
if (left > right)
return true;
if (str[left] == str[right])
return sudoPalin(left + 1, right - 1, flag);
else if (flag)
return max(sudoPalin(left + 1, right, false), sudoPalin(left, right - 1, false));
else
return false;
}
bool palin(string str)
{
int left = 0, right = str.size() - 1;
while (left <= right)
{
if (str[left] != str[right])
return false;
left += 1;
right -= 1;
}
return true;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> str;
// 회문인 경우
if (palin(str))
cout << 0 << '\n';
// 유사 회문 체크
else
{
// str크기가 홀수인 경우 => 유사 회문인 경우
if (sudoPalin(0, str.size() - 1, true))
cout << 1 << '\n';
else
cout << 2 << '\n';
}
}
return 0;
}
/*
참고
https://newdeal123.tistory.com/13
*/
|
2428d729588a7c7e86c72843030bb4e44eeb07d9
|
95c0ba4895954c26bcd18d827a01cf369044eb45
|
/src/C/t.cpp
|
3efae48e5a95259707d4e2357bf49290a83b82de
|
[] |
no_license
|
odedns/oldsrc
|
dc71099f2d75974acda7a9d6552641f7c90b94c5
|
c722106a1ffcc6002a9b8b01d52bf1a8e19afc1e
|
refs/heads/master
| 2022-11-16T04:05:34.803679
| 2020-07-08T17:34:14
| 2020-07-08T17:34:14
| 268,712,648
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 74
|
cpp
|
t.cpp
|
#include <iostream.h>
void main(void)
{
cout << "test ...." << endl;
}
|
d93b63631f07430e8dcd7c2a7f66848156acd515
|
447872e198e67cf5efe21d3c71b65366ee754b4a
|
/Graphics Programming Assignment/Project 1/glutapp3d/floor.cpp
|
fb2eac6c6cd7376d6b85d5b99f95f81bda630a2b
|
[] |
no_license
|
Anghagaed/GraphicsPA
|
1496acbd1a15b5d86f01a8fbc4b9f08c3892fd59
|
90afe247af8597db6e36cf3f0af5fd942778e517
|
refs/heads/master
| 2021-03-22T04:06:31.294934
| 2017-05-11T16:45:20
| 2017-05-11T16:45:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,812
|
cpp
|
floor.cpp
|
#include "floor.h"
using namespace std;
SoFloor::SoFloor()
{
_numpoints = 0;
x = 0.0f; y = 0.0f; z = 0.0f; l = 0.0f; w = 0.0f;
}
void SoFloor::init(float x, float y, float z, float l, float w, string imagePath)
{
this->x = x; this->y = y; this->z = z; this->l = l; this->w = w; this->imagePath = imagePath;
_vshphong.load_and_compile(GL_VERTEX_SHADER, "../texgouraud.vert");
_fshphong.load_and_compile(GL_FRAGMENT_SHADER, "../texgouraud.frag");
_progphong.init_and_link(_vshphong, _fshphong);
// Define buffers needed:
gen_vertex_arrays(1); // will use 1 vertex array
gen_buffers(3); // will use 3 buffers
_progphong.uniform_locations(11); // will send 10 variables
_progphong.uniform_location(0, "vTransf");
_progphong.uniform_location(1, "vProj");
_progphong.uniform_location(2, "lPos");
_progphong.uniform_location(3, "la");
_progphong.uniform_location(4, "ld");
_progphong.uniform_location(5, "ls");
_progphong.uniform_location(6, "ka");
_progphong.uniform_location(7, "kd");
_progphong.uniform_location(8, "ks");
_progphong.uniform_location(9, "sh");
_progphong.uniform_location(10, "Tex1");
// Copy paste here
GsImage I1;
gsuint id1;
if (!I1.load(imagePath.c_str())) { std::cout << "COULD NOT LOAD IMAGE!\n"; exit(1); }
glGenTextures(1, &_texid1);
glBindTexture(GL_TEXTURE_2D, _texid1);
glTexImage2D(GL_TEXTURE_2D, 0, 4, I1.w(), I1.h(), 0, GL_RGBA, GL_UNSIGNED_BYTE, I1.data());
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glGenerateMipmap(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 0);
glBindVertexArray(0);
I1.init(0, 0); // free image from CPU
}
void SoFloor::buildSquare() {
GsPnt a, b, c, d;
a = GsPnt(x - l / 2, y, z - w / 2);
b = GsPnt(x - l / 2, y, z + w / 2);
c = GsPnt(x + l / 2, y, z + w / 2);
d = GsPnt(x + l / 2, y, z - w / 2);
// a, b, c
P.push() = a; P.push() = b; P.push() = c;
// a, d, c
P.push() = a; P.push() = d; P.push() = c;
/*
T.push_back(GsVec2(0.0f, 0.0f)); // for point a
T.push_back(GsVec2(1.0f, 0.0f)); // for point b
T.push_back(GsVec2(1.0f, 1.0f)); // for point c
T.push_back(GsVec2(0.0f, 1.0f)); // for point d
*/
// a, b, c
T.push_back(GsVec2(0.0f, 0.0f));
T.push_back(GsVec2(1.0f, 0.0f));
T.push_back(GsVec2(1.0f, 1.0f));
// a, d, c
T.push_back(GsVec2(0.0f, 0.0f));
T.push_back(GsVec2(0.0f, 1.0f));
T.push_back(GsVec2(1.0f, 1.0f));
GsVec n1 = GsVec(0.0f, 1.0f, 0.0f);
for (int i = 0; i < 6; ++i) { N.push() = n1; }
}
void SoFloor::build()
{
T.clear();
this->buildSquare();
_numpoints = P.size();
glBindVertexArray(va[0]);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(2);
glBindBuffer(GL_ARRAY_BUFFER, buf[0]);
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float)*P.size(), P.pt(), GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ARRAY_BUFFER, buf[1]);
glBufferData(GL_ARRAY_BUFFER, 3 * sizeof(float)*N.size(), N.pt(), GL_STATIC_DRAW);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ARRAY_BUFFER, buf[2]);
glBufferData(GL_ARRAY_BUFFER, T.size() * 2 * sizeof(float), &T[0], GL_STATIC_DRAW);
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 0, 0);
glBindVertexArray(0); // break the existing vertex array object binding.
// free non-needed memory:
P.capacity(0); T.clear(); N.capacity(0);
//_mtl.specular.set(255, 255, 255);
_mtl.diffuse.set(255, 0, 0);
_mtl.shininess = 8; // increase specular effect
}
void SoFloor::draw(const GsMat& tr, const GsMat& pr, const GsLight& l)
{
float f[4];
float sh = (float)_mtl.shininess;
if (sh<0.001f) sh = 64;
glUseProgram(_progphong.id);
glBindVertexArray(va[0]);
glBindTexture(GL_TEXTURE_2D, _texid1);
// Updates uniforms
glUniformMatrix4fv(_progphong.uniloc[0], 1, GL_FALSE, tr.e);
glUniformMatrix4fv(_progphong.uniloc[1], 1, GL_FALSE, pr.e);
glUniform3fv(_progphong.uniloc[2], 1, l.pos.e);
glUniform4fv(_progphong.uniloc[3], 1, l.amb.get(f));
glUniform4fv(_progphong.uniloc[4], 1, l.dif.get(f));
glUniform4fv(_progphong.uniloc[5], 1, l.spe.get(f));
glUniform4fv(_progphong.uniloc[6], 1, _mtl.ambient.get(f));
glUniform4fv(_progphong.uniloc[7], 1, _mtl.diffuse.get(f));
glUniform4fv(_progphong.uniloc[8], 1, _mtl.specular.get(f));
glUniform1fv(_progphong.uniloc[9], 1, &sh);
glUniform1ui(_progphong.uniloc[10], _texid1);
glBindVertexArray(va[0]);
glDrawArrays(GL_TRIANGLES, 0, _numpoints);
glBindVertexArray(0); // break the existing vertex array object binding.
}
|
64bb08575e74dff6bb47906c2e098c47458b3b5e
|
7479d6306e386265502c7fd5d0e0670d90c1b499
|
/zsqlite/snappy-sqlite.cc
|
5b0737a3c45c495ffd3bd3f399e529a184800b69
|
[] |
no_license
|
bramp/zsqlite
|
a21501036be3d23c89f39f09181098c171c9e57d
|
de794d04934ad428a84a783c0dd93425a17275bb
|
refs/heads/master
| 2023-03-19T17:13:21.565279
| 2012-09-18T03:00:36
| 2012-09-18T03:00:36
| 5,848,430
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,585
|
cc
|
snappy-sqlite.cc
|
#include <string>
#include <iostream>
#include <iterator>
#include <fstream>
#include <vector>
#include <cerrno>
#include <cstring>
#include <stdexcept>
#include <assert.h>
#include <stdint.h>
#include <snappy.h>
#include <lzo/lzoconf.h>
#include <lzo/lzo1x.h>
using namespace std;
using namespace snappy;
// function copied from snappy
inline char* string_as_array(std::string * str) {
return str->empty() ? NULL : &*str->begin();
}
inline const char* string_as_array(const std::string * str) {
return str->empty() ? NULL : &*str->begin();
}
struct header {
int block_size;
int index_len; // 16 Terabytes (compressed)
header(int block_size, int index_len)
: block_size(block_size), index_len(index_len) {}
friend ostream& operator<< (ostream &, const struct header &);
};
streampos file_len(ifstream &s) {
s.seekg (0, ios::end);
return s.tellg();
}
class SnappyCompressor {
public:
SnappyCompressor() {}
void compress(const std::string & in, std::string & out) {
Compress(in.data(), in.size(), &out);
#ifdef PARANOID
assert( IsValidCompressedBuffer(string_as_array(&out), out.size()) );
#endif
}
};
/**
* TODO Test LZO1F
*/
class LZOCompressor {
char * wrkmem;
public:
LZOCompressor() {
if (lzo_init() != LZO_E_OK) {
cerr << "Failed to init LZO" << endl;
throw new runtime_error("Failed to init LZO");
}
this->wrkmem = new char[LZO1X_1_MEM_COMPRESS];
}
~LZOCompressor() {
delete[] this->wrkmem;
}
void compress(const std::string & in, std::string & out) {
size_t in_len = in.size();
size_t out_len = in_len + in_len / 16 + 64 + 3;
out.reserve(out_len);
int r = lzo1x_1_compress(
(unsigned char *) string_as_array(&in), in_len,
(unsigned char *) string_as_array(&out), &out_len, wrkmem);
if (r != LZO_E_OK) {
printf("internal error - compression failed: %d\n", r);
}
out.resize(out_len);
}
};
int main(int argc, const char *argv[]) {
const size_t block_size = 4096;
if (argc != 3) {
cerr << "Usage: " << argv[0] << " {source} {dest}" << endl;
return -1;
}
const char * src = argv[1];
const char * dst = argv[2];
ifstream in_file (src, ios::binary | ios::in);
if (!in_file) {
cerr << "Failed to open source file: " << src << endl;
return -1;
}
// in_file.exceptions(ios::badbit | ios::failbit);
ofstream out_file(dst, ios::binary | ios::out);
if (!out_file) {
cerr << "Failed to open output file: " << dst << endl;
return -1;
}
// out_file.exceptions(ios::badbit | ios::failbit);
LZOCompressor * compressor = new LZOCompressor();
//SnappyCompressor * compressor = new SnappyCompressor();
int index_len = file_len(in_file) / block_size + 1;
header head(block_size, index_len);
vector< uint16_t > index;
index.reserve(index_len);
string uncompressed( block_size, '\0' );
string compressed( MaxCompressedLength(block_size), '\0' );
long long in_total = 0, out_total = 0;
in_file.seekg(0, ios_base::beg);
int index_bytes = index_len * sizeof(uint16_t);
int data_start = index_bytes + sizeof(head);
out_file.seekp(data_start, ios_base::beg);
while (in_file.good()) {
in_file.read(string_as_array(&uncompressed), uncompressed.size());
if (in_file.bad()) {
cerr << "Error while reading source " << in_file.rdstate() << endl;
return -1;
}
size_t in_len = in_file.gcount();
uncompressed.resize(in_len);
in_total += in_len;
assert(in_len > 0);
compressor->compress(uncompressed, compressed);
// write compressed to file
out_file.write(compressed.data(), compressed.size());
if (out_file.bad()) {
cerr << "Error while writing to destination" << endl;
return -1;
}
out_total += compressed.size();
index.push_back(compressed.size()); // Store the size of this block
}
assert(index.size() > 0);
assert(index.size() == index_len);
in_file.close();
// Seek to the beginning of the file and write the header / index
out_file.clear();
out_file.seekp(0, ios_base::beg);
out_file.write( reinterpret_cast<char*>(&head), sizeof(head));
out_file.write( reinterpret_cast<char*>(&index[0]), index_len * sizeof(index[0]) );
if (out_file.bad()) {
cerr << "Error while writing index to destination: " << strerror(errno) << endl;
return -1;
}
assert( out_file.tellp() == data_start );
out_file.close();
cout << "Uncompressed: " << (in_total / 1024) << " KiB " << endl
<< " Compressed: " << (out_total / 1024) << " KiB + "
<< "Index: " << (index_bytes / 1024) << " KiB " << endl
<< " Ratio: x" << ((float)in_total / (float)(out_total + index_bytes))
<< endl;
return 0;
}
|
0dca038e6ba128d907df0478cc27b6584842fb85
|
faa932aa4c28315ee8175c3307b1b5cf53ac8d43
|
/GenerateRandomNumNotInList.cpp
|
6d1076a5fd33bcc26d46e978b2736daab67eb290
|
[] |
no_license
|
bsarvan/code_algorithms
|
2daad99da90894d830f5fc38d647cfae49141821
|
43855386c3646bd84effacef3362b925835d6ba0
|
refs/heads/master
| 2023-06-09T12:39:56.112624
| 2021-06-27T14:15:55
| 2021-06-27T14:15:55
| 380,757,573
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,395
|
cpp
|
GenerateRandomNumNotInList.cpp
|
//
// main.cpp
// GenerateRandomNumNotInList
//
// Created by bsarvan on 05/09/19.
// Copyright © 2019 bsarvan. All rights reserved.
//
/*
Given an integer n and a list of integers l, write a function that randomly generates a number from 0 to n-1 that isn't in l (uniform).
Solution -
One way we can approach this problem is by using rejection sampling. First, we generate a (uniformly) random integer between 0 and n-1 (inclusive). Then, we check whether the random integer is found within the list l. If it is found, then generate repeat the process. If it is not found, then return that number. To make sure we can check for the presence of a number in O(1) time, we can put all integers in l in a set.
Since this solution involves repeatedly generating a new random number, it could have up to infinite worst-case runtime. The initial call also incurs O(N) to convert list into a set. The probability of selecting a random number depends on the the ratio of numbers in l that are within the bounds 0 to n-1, versus the number n.
Another way we can approach this problem is by generating a random number strictly from the numbers available. We can construct the list of numbers of available by subtracting the set of integers in l from the set of integers in the range 0 to n-1. Then, we can simply generate a random number within 0 and the length of this new list, and return the integer at that index.
This solution takes O(N) time to pre-process the list, and O(1) time to generate a random integer.
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
void printArray(vector<int> V) {
for(auto c:V){
cout<<c<<" ";
}
cout<<endl;
return;
}
vector<int> buildList(int n, set<int> L) {
vector<int> list;
for(int i=0;i<n;i++) {
if (L.find(i)==L.end()) {
list.emplace_back(i);
}
}
printArray(list);
return (list);
}
int main(int argc, const char * argv[]) {
vector<int> L = {5,1,3,4,8,10,15,20,11,13,8,10,14};
set<int> S;
for(auto c:L){
S.emplace(c);
}
int N = 20;
vector<int> mask = buildList(N,S);
/* initialize random seed: */
srand((unsigned)time(NULL));
int r = rand()%mask.size();
cout<<"Random Number not in List - "<<r<<", "<<mask[r]<<endl;
return 0;
}
|
32f9c21de26aad2e6bb76571624fd4df34fedf11
|
1c3f319b03fe3e1da903390123972dd2958d80a2
|
/10474 - Where is the Marble.cpp
|
13bca07c622a0ac09a518fa87d106ecc005e738b
|
[] |
no_license
|
AhmadRehan98/UVA
|
cbf29f74cc53cf6b631c225f96982fe1f102b7f8
|
0dc4ade955abcdce6f9d9bab8ba52d906f2c4cea
|
refs/heads/master
| 2021-09-25T14:20:10.649495
| 2018-10-22T21:13:00
| 2018-10-22T21:13:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 827
|
cpp
|
10474 - Where is the Marble.cpp
|
#include <bits/stdc++.h>
using namespace std;
int arr[10000];
int binary_search (int start , int end , int x){
while (start < end){
int mid = start + (end - start)/2;
if (arr[mid] < x) start = mid+1;
else end = mid;
}
if (arr[start] == x) return start+1;
else return -1;
}
int main() {
int n,q,x,y;
for (int i=1; i<=65; i++){
cin >> n >> q;
if (n == 0 && q == 0) return 0;
for (int j=0; j<n; j++){
cin >> arr[j];
}
sort (arr,arr+n);
cout << "CASE# " << i << ":" << endl;
for (int j=0; j<q; j++){
cin >> x;
y = binary_search (0 , n-1 , x);
if (y == -1) cout << x << " not found" << endl;
else cout << x << " found at " << y << endl;
}
}
return 0;
}
|
240bd18be5cca417ede69d237ed9ba5198360ebe
|
bde0c2cf8ac40e8ffee74e8f2db92d928571f954
|
/ATM.cpp
|
c74ffeaa515c4a30601f3647e6806c9a177d1c95
|
[] |
no_license
|
happyy07/ATM
|
978f071ece3d9be2f2be7c09b3cda8f18c816de9
|
4a4d1e1621d98bcb2356488971236c151944781e
|
refs/heads/main
| 2023-02-24T15:19:46.685661
| 2021-02-04T20:03:03
| 2021-02-04T20:03:03
| 336,068,420
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,083
|
cpp
|
ATM.cpp
|
#include"ATM.h"
void main()
{
User tabUser[25];
User ur;
short nb, choice, i,cpin;
int final_income;
string Nip;
while(true) {
system("cls");
displayTitle("banque royale");
displayTitle("guichet automatique bancaire");
nb = openFile(tabUser);
i = getNumero(tabUser, nb);
if (i == -1) { continue; system("pause");}
cout << "\n\tBienvenue " << tabUser[i].Client << "\n";
cpin = getNip(tabUser, i);
if (cpin == -1) { continue; system("pause"); }
DisplayChoiceTitle("\nChoisir votre Transaction");
DisplayChoiceTitle("\t1-Pour Deposer");
DisplayChoiceTitle("\t2-Pour Retirer");
DisplayChoiceTitle("\t3-Pour Consulter");
choice = getChoice();
switch (choice)
{
case 1:
final_income = getDeposer(tabUser, i);
getUpdate(tabUser, i, final_income);
overwriteFile(tabUser, i, nb);
break;
case 2:
final_income = getRetirer(tabUser, i);
getUpdate(tabUser, i, final_income);
overwriteFile(tabUser, i, nb);
break;
case 3:
getConsulter(tabUser,i);
break;
}
}
}
|
91562e86fec3f4abc6561bae28bc9dde944a42a2
|
50d028afa24b18a3508a68b24aa5ade2c0a6a9ab
|
/Project1/Makestars.cpp
|
fc39c528a86c649d764a0d3801390a1545095d9f
|
[] |
no_license
|
ThanakomFl/CG_Solar_system
|
44085c770a64f338705dce9a758f36bf3f0cebb1
|
ab0827859432a1cbe307420ec72ab00c14f2d02e
|
refs/heads/master
| 2020-05-30T09:10:41.320175
| 2019-05-31T17:57:46
| 2019-05-31T17:57:46
| 189,636,706
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,404
|
cpp
|
Makestars.cpp
|
#include "Makestars.h"
Makestars::Makestars()
{
}
void Makestars::Makestar(float r, int n, float kx, float ky, float red, float green, float blue)
{
glBegin(GL_POLYGON);
for (int i = 1; i <= n; i++)
{
theta = 2.0 * pi * (float)i / n;
x = kx + r * cos(theta);
y = ky + r * sin(theta);
glColor3f(red, green, blue);
glVertex2f(x, y);
}
glEnd();
}
float Makestars::makeOrbitX(int r, float rotate, int n, float mx)
{
float x;
theta = 2.0 * pi * rotate / n;
x = mx + r * cos(theta);
return x;
}
float Makestars::makeOrbitY(int r, float rotate, int n, float my)
{
float y;
theta = 2.0 * pi * rotate / n;
y = my + r * sin(theta);
return y;
}
void Makestars::MakeangleR(float r, float kx, float ky, float red, float green, float blue)
{
glLineWidth(1);
glColor3f(red, green, blue);
glBegin(GL_POLYGON);
glVertex2f(kx - r - 1, ky);
glVertex2f(kx - r, ky + r / 6);
glVertex2f(kx + r, ky + r / 3);
glVertex2f(kx + r + 1, ky);
glVertex2f(kx + r, ky - r / 6);
glVertex2f(kx - r, ky - r / 8);
glEnd();
}
void Makestars::MakeangleL(float r, float kx, float ky, float red, float green, float blue)
{
glLineWidth(1);
glColor3f(red, green, blue);
glBegin(GL_POLYGON);
glVertex2f(kx - r - 1, ky);
glVertex2f(kx - r, ky + r / 6);
glVertex2f(kx + r, ky + r / 8);
glVertex2f(kx + r + 1, ky);
glVertex2f(kx + r, ky - r / 6);
glVertex2f(kx - r, ky - r / 3);
glEnd();
}
void Makestars::starline(float r, float kx, float ky, float red, float green, float blue, float widthz)
{
glLineWidth(widthz);
glColor3f(red, green, blue);
glBegin(GL_LINES);
glVertex2f(kx - r, ky - r);
glVertex2f(kx + r, ky + r);
glEnd();
glBegin(GL_LINES);
glVertex2f(kx + r, ky - r);
glVertex2f(kx - r, ky + r);
glEnd();
}
void Makestars::randomstar()
{
int v1, v2;
for (int i = -180; i <= 180; i += 3)
{
for (int j = -180; j <= 180; j += 3)
{
v1 = rand() % 121;
v2 = rand() % 4;
if (v1 == 3)
{
if (v2 == 0)
{
Makestar(1, n, i, j, 0.278, 0.352, 0.407);
}
else if (v2 == 1)
{
Makestar(1.5, n, i, j, 0.278, 0.352, 0.407);
}
else if (v2 == 2)
{
starline(1.5, i, j, 0.278, 0.352, 0.407, 3);
}
else
{
starline(1, i, j, 0.278, 0.352, 0.407, 2);
}
}
}
}
}
Makestars::~Makestars()
{
}
|
2581787919838875c54330c04824f4197b8711de
|
8875effac15cf5d5fc665c4ab0c479979f3ce913
|
/codeforces/614/c.cpp
|
4da628a51c12e33ee3a8b52f77c815cb8366c853
|
[] |
no_license
|
modanhan/problem-solving
|
03bee4a27a7d10a335d79e190e7760128fcfadeb
|
9a98f0e87cf87dd75e4a7c8ebf13adef9976182c
|
refs/heads/master
| 2021-09-06T22:29:40.869818
| 2018-02-12T16:25:32
| 2018-02-12T16:25:32
| 27,393,777
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,620
|
cpp
|
c.cpp
|
#include <bits/stdc++.h>
using namespace std;
# define PI 3.14159265358979323846
typedef pair<double, double> dd;
int n;
vector<dd> v;
double maxd = 0, mind = 10000000000;
double cx, cy, px, py, cd, x, y;
int main() {
cin >> n >> x >> y;
v.assign(n, dd(0, 0));
cin >> v[0].first >> v[0].second;
cx = v[0].first;
cy = v[0].second;
cd = hypot(cx - x, cy - y);
if (cd > maxd)
maxd = cd;
if (cd < mind)
mind = cd;
for (int i = 1; i < n; i++) {
cin >> v[i].first >> v[i].second;
cx = v[i].first;
cy = v[i].second;
px = v[i - 1].first;
py = v[i - 1].second;
cd = hypot(cx - x, cy - y);
if (cd > maxd)
maxd = cd;
if (cd < mind)
mind = cd;
// cloest point on a line
double u = (x - px) * (cx - px) + (y - py) * (cy - py);
u /= (cx - px) * (cx - px) + (cy - py) * (cy - py);
double ix = px + u * (cx - px), iy = py + u * (cy - py);
if (abs(
hypot(cx - px, cy - py)
- (hypot(ix - px, iy - py) + hypot(ix - cx, iy - cy)))
< .00001f) {
mind = min(mind, hypot(ix - x, iy - y));
}
}
cx = v[0].first;
cy = v[0].second;
px = v.back().first;
py = v.back().second;
{
double u = (x - px) * (cx - px) + (y - py) * (cy - py);
u /= (cx - px) * (cx - px) + (cy - py) * (cy - py);
double ix = px + u * (cx - px), iy = py + u * (cy - py);
if (abs(
hypot(cx - px, cy - py)
- (hypot(ix - px, iy - py) + hypot(ix - cx, iy - cy)))
< .00001f) {
mind = min(mind, hypot(ix - x, iy - y));
}
}
// cout << maxd << ' ' << mind << '\n';
double ans = PI * maxd * maxd - PI * mind * mind;
if (ans < 0)
ans *= -1;
printf(("%.16f"), ans);
}
|
0f9b532628792be74a50f57ac18e77c261f623de
|
44f04b8f2b6c0dba51f1e998985d3a9e8540715f
|
/HDU/5411/p.cpp
|
99210f0a1c42a9c5355f0801379c0389573bcf95
|
[] |
no_license
|
GuessEver/ACMICPCSolutions
|
2dd318a45939711eff1dd208cffc05a029b38130
|
909927778efd77ca9ec8e18aed3ff22c167d2a33
|
refs/heads/master
| 2020-05-18T20:52:32.359955
| 2015-11-04T08:31:43
| 2015-11-04T08:31:43
| 29,720,059
| 5
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 731
|
cpp
|
p.cpp
|
#include <cstdio>
#include <vector>
using std::vector;
const int N = 50 + 10;
const int mod = 2015;
vector<int> v[N];
int n, m;
int res;
int ans[N];
void dfs(int x, int deep)
{
if(deep > m) return;
(res += 1) %= mod;
(ans[deep] += 1) %= mod;
for(vector<int>::iterator it = v[x].begin(); it != v[x].end(); it++)
dfs(*it, deep + 1);
}
int main()
{
int T; scanf("%d", &T);
while(T--)
{
scanf("%d%d", &n, &m);
for(int i = 1; i <= n; i++)
{
v[i].clear();
int k; scanf("%d", &k);
while(k--)
{
int x; scanf("%d", &x);
v[i].push_back(x);
}
}
res = 1;
for(int i = 1; i <= n; i++) dfs(i, 1);
printf("%d\n", res);
for(int i = 1; i <= m; i++) printf("%d ", ans[i]); puts("");
}
return 0;
}
|
eb76bbe3f1ca377c58905ae6960121588b3013b5
|
f96d6d7e2c46d375d1662ff0e4567c2c7f771856
|
/display_standard.cpp
|
3edb6d7125d97d39c0237a90711c6d7e0576d40a
|
[] |
no_license
|
jose3ww/akafugu_nixie_clock
|
5195066ce496284691f138e30e4c881290ccba79
|
70d570a419afa4dc061a5fbfc66ae6b3367f4b46
|
refs/heads/master
| 2020-04-28T02:24:08.433585
| 2019-05-15T11:01:21
| 2019-05-15T11:01:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 8,054
|
cpp
|
display_standard.cpp
|
/*
* The Akafugu Nixie Clock
* (C) 2012-13 Akafugu Corporation
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
*/
#include "global.h"
#ifdef BOARD_STANDARD
#include "rgbled.h"
extern uint8_t display_on;
extern uint8_t digits;
extern volatile uint8_t data[6];
extern volatile uint8_t g_blank;
extern volatile bool g_blink_on;
extern state_t g_clock_state;
extern volatile bool g_24h;
extern volatile bool g_is_am;
// anodes (digits)
pin_direct_t digit0_pin;
pin_direct_t digit1_pin;
pin_direct_t digit2_pin;
pin_direct_t digit3_pin;
pin_direct_t digit4_pin;
pin_direct_t digit5_pin;
// K155ID1 nixie driver (A~D = PC0~PC3)
// PC0~PC3 = 14~17 (A0~A3)
#define DRIVER_DDR DDRC
#define DRIVER_PORT PORTC
uint8_t multiplex_counter = 0;
void clear_display();
void write_nixie(uint8_t digit, uint8_t value);
void set_number(uint8_t num);
uint32_t rnd(void);
void set_indicator(uint8_t intensity, bool override_state = false);
// fixme: hide alarm switch behind abstraction
extern pin_direct_t switch_pin;
extern volatile uint8_t g_alarm_switch;
void board_init()
{
// alarm switch
pinMode(PinMap::alarm_switch, INPUT); // switch as input
digitalWrite(PinMap::alarm_switch, HIGH); // enable pullup
switch_pin.pin = PinMap::alarm_switch;
switch_pin.reg = PIN_TO_INPUT_REG(PinMap::alarm_switch);
switch_pin.bitmask = PIN_TO_BITMASK(PinMap::alarm_switch);
if ( (*switch_pin.reg & switch_pin.bitmask) == 0)
g_alarm_switch = true;
else
g_alarm_switch = false;
// dots
pinMode(PinMap::dot1, OUTPUT);
pinMode(PinMap::dot2, OUTPUT);
// driver
pinMode(PinMap::nixie_driver0, OUTPUT);
pinMode(PinMap::nixie_driver1, OUTPUT);
pinMode(PinMap::nixie_driver2, OUTPUT);
pinMode(PinMap::nixie_driver3, OUTPUT);
// digits
pinMode(PinMap::digit0, OUTPUT);
pinMode(PinMap::digit1, OUTPUT);
pinMode(PinMap::digit2, OUTPUT);
pinMode(PinMap::digit3, OUTPUT);
pinMode(PinMap::digit4, OUTPUT);
pinMode(PinMap::digit5, OUTPUT);
digit0_pin.pin = PinMap::digit0;
digit0_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit0);
digit0_pin.bitmask = PIN_TO_BITMASK(PinMap::digit0);
digit1_pin.pin = PinMap::digit1;
digit1_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit1);
digit1_pin.bitmask = PIN_TO_BITMASK(PinMap::digit1);
digit2_pin.pin = PinMap::digit2;
digit2_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit2);
digit2_pin.bitmask = PIN_TO_BITMASK(PinMap::digit2);
digit3_pin.pin = PinMap::digit3;
digit3_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit3);
digit3_pin.bitmask = PIN_TO_BITMASK(PinMap::digit3);
digit4_pin.pin = PinMap::digit4;
digit4_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit4);
digit4_pin.bitmask = PIN_TO_BITMASK(PinMap::digit4);
digit5_pin.pin = PinMap::digit5;
digit5_pin.reg = PIN_TO_OUTPUT_REG(PinMap::digit5);
digit5_pin.bitmask = PIN_TO_BITMASK(PinMap::digit5);
}
void set_dots(bool dot1, bool dot2)
{
if (dot1) digitalWrite(PinMap::dot1, HIGH);
else digitalWrite(PinMap::dot1, LOW);
if (dot1) digitalWrite(PinMap::dot2, HIGH);
else digitalWrite(PinMap::dot2, LOW);
}
// Display multiplex routine optimized for 4 digits
void display_multiplex(void)
{
if (multiplex_counter >= 0 && multiplex_counter <= 4)
clear_display();
else if (multiplex_counter >= 5 && multiplex_counter <= 14)
display_on ? write_nixie(0, data[5]) : clear_display();
else if (multiplex_counter >= 15 && multiplex_counter <= 19)
clear_display();
else if (multiplex_counter >= 20 && multiplex_counter <= 29)
display_on ? write_nixie(1, data[4]) : clear_display();
else if (multiplex_counter >= 30 && multiplex_counter <= 34)
clear_display();
else if (multiplex_counter >= 35 && multiplex_counter <= 44)
display_on ? write_nixie(2, data[3]) : clear_display();
else if (multiplex_counter >= 45 && multiplex_counter <= 49)
clear_display();
else if (multiplex_counter >= 50 && multiplex_counter <= 59)
display_on ? write_nixie(3, data[2]) : clear_display();
multiplex_counter++;
if (multiplex_counter == 60) multiplex_counter = 0;
}
// Display multiplex routine for up to 6 digits
void display_multiplex_6(void)
{
if (multiplex_counter == 0)
clear_display();
else if (multiplex_counter >= 1 && multiplex_counter <= 10)
display_on ? write_nixie(0, data[5]) : clear_display();
else if (multiplex_counter == 11)
clear_display();
else if (multiplex_counter >= 12 && multiplex_counter <= 21)
display_on ? write_nixie(1, data[4]) : clear_display();
else if (multiplex_counter == 22)
clear_display();
else if (multiplex_counter >= 23 && multiplex_counter <= 32)
display_on ? write_nixie(2, data[3]) : clear_display();
else if (multiplex_counter == 33)
clear_display();
else if (multiplex_counter >= 34 && multiplex_counter <= 43)
display_on ? write_nixie(3, data[2]) : clear_display();
else if (multiplex_counter == 44)
clear_display();
else if (multiplex_counter >= 45 && multiplex_counter <= 54)
display_on ? write_nixie(4, data[1]) : clear_display();
else if (multiplex_counter == 55)
clear_display();
else if (multiplex_counter >= 56 && multiplex_counter <= 65)
display_on ? write_nixie(4, data[1]) : clear_display();
multiplex_counter++;
if (multiplex_counter == 66) multiplex_counter = 0;
}
void write_nixie(uint8_t digit, uint8_t value)
{
//clear_display();
if (g_blink_on) {
if (g_blank == 4) { clear_display(); return; }
else if (g_blank == 1 && (digit == 0 || digit == 1)) { clear_display(); return; }
else if (g_blank == 2 && (digit == 2 || digit == 3)) { clear_display(); return; }
else if (g_blank == 3 && (digit == 4 || digit == 5)) { clear_display(); return; }
}
if (value == 10) return;
switch (digit) {
case 0:
DIRECT_PIN_LOW(digit0_pin.reg, digit0_pin.bitmask);
break;
case 1:
DIRECT_PIN_LOW(digit1_pin.reg, digit1_pin.bitmask);
break;
case 2:
DIRECT_PIN_LOW(digit2_pin.reg, digit2_pin.bitmask);
break;
case 3:
DIRECT_PIN_LOW(digit3_pin.reg, digit3_pin.bitmask);
break;
case 4:
DIRECT_PIN_LOW(digit4_pin.reg, digit4_pin.bitmask);
break;
case 5:
DIRECT_PIN_LOW(digit5_pin.reg, digit5_pin.bitmask);
break;
}
set_number(value);
}
void clear_display(void)
{
DIRECT_PIN_HIGH(digit0_pin.reg, digit0_pin.bitmask);
DIRECT_PIN_HIGH(digit1_pin.reg, digit1_pin.bitmask);
DIRECT_PIN_HIGH(digit2_pin.reg, digit2_pin.bitmask);
DIRECT_PIN_HIGH(digit3_pin.reg, digit3_pin.bitmask);
DIRECT_PIN_HIGH(digit4_pin.reg, digit4_pin.bitmask);
DIRECT_PIN_HIGH(digit5_pin.reg, digit5_pin.bitmask);
}
void set_number(uint8_t num)
{
DRIVER_PORT = (DRIVER_PORT & 0xF0) | num;
}
void set_indicator(uint8_t intensity, bool override_state)
{
switch (intensity)
{
case INDICATOR_OFF:
//analogWrite(PinMap::piezo, 0);
if (g_clock_state == STATE_CLOCK && !override_state) {
if (g_24h)
pca9685_set_channel(13, 0);
else
pca9685_set_channel(13, g_is_am ? 0 : 100);
pca9685_set_channel(14, 0);
pca9685_set_channel(15, g_alarm_switch ? 100 : 0);
}
else {
pca9685_set_channel(13, 0);
pca9685_set_channel(14, 0);
pca9685_set_channel(15, 0);
}
break;
case INDICATOR_HIGH:
//analogWrite(PinMap::piezo, 150);
pca9685_set_channel(13, 3000);
case INDICATOR_MID:
//analogWrite(PinMap::piezo, 100);
pca9685_set_channel(14, 3000);
case INDICATOR_LO:
//analogWrite(PinMap::piezo, 50);
pca9685_set_channel(15, 3000);
}
}
#endif // BOARD_STANDARD
|
f85630affe850054ac54f517d96dda21350c9cb9
|
0eff74b05b60098333ad66cf801bdd93becc9ea4
|
/second/download/collectd/gumtree/collectd_repos_function_1418_collectd-4.9.1.cpp
|
a70959a9db710d7d472f54726a76fe2f85b72103
|
[] |
no_license
|
niuxu18/logTracker-old
|
97543445ea7e414ed40bdc681239365d33418975
|
f2b060f13a0295387fe02187543db124916eb446
|
refs/heads/master
| 2021-09-13T21:39:37.686481
| 2017-12-11T03:36:34
| 2017-12-11T03:36:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,233
|
cpp
|
collectd_repos_function_1418_collectd-4.9.1.cpp
|
static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_list, user_data_t *data) {
int i;
cpy_callback_t *c = data->data;
PyObject *ret, *v, *list;
CPY_LOCK_THREADS
list = PyList_New(value_list->values_len); /* New reference. */
if (list == NULL) {
cpy_log_exception("write callback");
CPY_RETURN_FROM_THREADS 0;
}
for (i = 0; i < value_list->values_len; ++i) {
if (ds->ds->type == DS_TYPE_COUNTER) {
if ((long) value_list->values[i].counter == value_list->values[i].counter)
PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].counter));
else
PyList_SetItem(list, i, PyLong_FromUnsignedLongLong(value_list->values[i].counter));
} else if (ds->ds->type == DS_TYPE_GAUGE) {
PyList_SetItem(list, i, PyFloat_FromDouble(value_list->values[i].gauge));
} else if (ds->ds->type == DS_TYPE_DERIVE) {
if ((long) value_list->values[i].derive == value_list->values[i].derive)
PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].derive));
else
PyList_SetItem(list, i, PyLong_FromLongLong(value_list->values[i].derive));
} else if (ds->ds->type == DS_TYPE_ABSOLUTE) {
if ((long) value_list->values[i].absolute == value_list->values[i].absolute)
PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].absolute));
else
PyList_SetItem(list, i, PyLong_FromUnsignedLongLong(value_list->values[i].absolute));
} else {
Py_BEGIN_ALLOW_THREADS
ERROR("cpy_write_callback: Unknown value type %d.", ds->ds->type);
Py_END_ALLOW_THREADS
Py_DECREF(list);
CPY_RETURN_FROM_THREADS 0;
}
if (PyErr_Occurred() != NULL) {
cpy_log_exception("value building for write callback");
CPY_RETURN_FROM_THREADS 0;
}
}
v = PyObject_CallFunction((void *) &ValuesType, "sOssssdi", value_list->type, list,
value_list->plugin_instance, value_list->type_instance, value_list->plugin,
value_list->host, (double) value_list->time, value_list->interval);
Py_DECREF(list);
ret = PyObject_CallFunctionObjArgs(c->callback, v, c->data, (void *) 0); /* New reference. */
if (ret == NULL) {
cpy_log_exception("write callback");
} else {
Py_DECREF(ret);
}
CPY_RELEASE_THREADS
return 0;
}
|
5109cc8e26439bbe8d0cdb32f2729659f5fe4f7c
|
972bd8f69bb508559d8848853c3fe2e50ae20db4
|
/ride/wx.h
|
f8e0cd54aeb3cc260435758284d27ff2d414949a
|
[
"MIT"
] |
permissive
|
zhangf911/ride
|
2d0efdc5ba4eab133a54f494d9dc828f629f108c
|
d609cf94bfbd3a669e51beb2adc0294d9b24fcc7
|
refs/heads/master
| 2020-04-06T05:25:10.061137
| 2015-04-07T21:56:18
| 2015-04-07T21:56:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 433
|
h
|
wx.h
|
#ifndef RIDE_LOCALWX_H
#define RIDE_LOCALWX_H
// hopefully this fixes this error:
// http://stackoverflow.com/questions/13219007/xcode-4-5-tr1-type-traits-file-not-found
#include <ciso646> // detect std::lib
#ifdef _LIBCPP_VERSION
// using libc++
#define HAVE_TYPE_TRAITS
#else
// using libstdc++
#define HAVE_TR1_TYPE_TRAITS
#endif
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#endif // RIDE_LOCALWX_H
|
88d9657dfa2bcf0d100499d510e304694bc210d9
|
019f238b82b1207286615d1078ae868b55ebcbda
|
/pimpl_unique_ptr_test/three.h
|
8885e4c65f1f4286cd30a513880a144833f5090a
|
[] |
no_license
|
heshanu3d/cpp-tips
|
98077e9c7bd6c6cd3693399ea13b0e672eaa0ab8
|
a6959b8bfdbdac7920f912a58edf85e254c06835
|
refs/heads/master
| 2023-02-17T01:42:29.113587
| 2020-12-23T17:00:48
| 2020-12-23T17:00:48
| 323,954,390
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 152
|
h
|
three.h
|
#pragma once
#include <memory>
class four;
class three {
public:
// ~three();
~three() {}
void func();
std::unique_ptr<four> fouru;
};
|
8b75728c951d8a2d31eefce399a1b2d313d7e81d
|
24004e1c3b8005af26d5890091d3c207427a799e
|
/Win32/NXOPEN/NXOpen/CAE_ResponseSimulation_ExcitationBuilder.hxx
|
d52bf5fc3ab758c6b6e4e2dbdf860c00c5aadc3d
|
[] |
no_license
|
15831944/PHStart
|
068ca6f86b736a9cc857d7db391b2f20d2f52ba9
|
f79280bca2ec7e5f344067ead05f98b7d592ae39
|
refs/heads/master
| 2022-02-20T04:07:46.994182
| 2019-09-29T06:15:37
| 2019-09-29T06:15:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,619
|
hxx
|
CAE_ResponseSimulation_ExcitationBuilder.hxx
|
#ifndef NXOpen_CAE_RESPONSESIMULATION_EXCITATIONBUILDER_HXX_INCLUDED
#define NXOpen_CAE_RESPONSESIMULATION_EXCITATIONBUILDER_HXX_INCLUDED
//--------------------------------------------------------------------------
// Header for C++ interface to JA API
//--------------------------------------------------------------------------
//
// Source File:
// CAE_ResponseSimulation_ExcitationBuilder.ja
//
// Generated by:
// apiwrap
//
// WARNING:
// This file is automatically generated - do not edit by hand
//
#ifdef _MSC_VER
#pragma once
#endif
#include <NXOpen/NXDeprecation.hxx>
#include <vector>
#include <NXOpen/NXString.hxx>
#include <NXOpen/Callback.hxx>
#include <NXOpen/CAE_ResponseSimulation_BaseBuilder.hxx>
#include <NXOpen/libnxopencpp_cae_exports.hxx>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4996)
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace NXOpen
{
namespace CAE
{
namespace ResponseSimulation
{
class ExcitationBuilder;
}
}
namespace CAE
{
namespace ResponseSimulation
{
class BaseBuilder;
}
}
namespace CAE
{
namespace ResponseSimulation
{
class ExcitationLocationDefinition;
}
}
namespace CAE
{
namespace ResponseSimulation
{
class RSEvent;
}
}
namespace CAE
{
namespace ResponseSimulation
{
class _ExcitationBuilderBuilder;
class ExcitationBuilderImpl;
/** Represents the abstract excitation builder class. Any of real excitation builder
must inherit from this class.
<br> This is an abstract class, and cannot be created. <br>
<br> Created in NX5.0.0. <br>
*/
class NXOPENCPP_CAEEXPORT ExcitationBuilder : public CAE::ResponseSimulation::BaseBuilder
{
/** the type of excitation location */
public: enum ExcitationLocationType
{
ExcitationLocationTypeStaticLoad = -2/** static load */ ,
ExcitationLocationTypeDistributedLoad/** distributed load */ ,
ExcitationLocationTypeNodalForce/** nodal force */ ,
ExcitationLocationTypeEnforcedMotion/** enforced motion */
};
private: ExcitationBuilderImpl * m_excitationbuilder_impl;
private: friend class _ExcitationBuilderBuilder;
protected: ExcitationBuilder();
public: ~ExcitationBuilder();
/**Returns the parent dynamic event object
<br> Created in NX5.0.0. <br>
<br> License requirements : nx_response_anlys ("NX Response Analysis") */
public: NXOpen::CAE::ResponseSimulation::RSEvent * DynamicEvent
(
);
/**Returns the excitation location definition
<br> Created in NX5.0.0. <br>
<br> License requirements : nx_response_anlys ("NX Response Analysis") */
public: NXOpen::CAE::ResponseSimulation::ExcitationLocationDefinition * ExcitationLocationDefinition
(
);
};
}
}
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef __GNUC__
#ifndef NX_NO_GCC_DEPRECATION_WARNINGS
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#endif
#endif
#undef EXPORTLIBRARY
#endif
|
3ae1f5ce5f9890d7fa4e0b2a3ddf2a513cb7297c
|
6c2e25fac94f6aa4f27de58a6af74de83d2f92de
|
/main.cpp
|
7bd9c3dee29a310b5e25bdb1bfe64077c2fabdf1
|
[] |
no_license
|
integral96/Simf_diff
|
960e3de78d0dbefaa4d58150f396a86941e377a9
|
3f3b9b0eac90871ea24a42ba133fbf0845c4962f
|
refs/heads/main
| 2023-03-07T03:08:51.153604
| 2021-02-19T14:14:20
| 2021-02-19T14:14:20
| 340,389,214
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,716
|
cpp
|
main.cpp
|
#include <iostream>
#include <sstream>
#include <boost/hana.hpp>
#include <boost/hana/assert.hpp>
#include "simvolic_diff.hpp"
namespace hana = boost::hana;
using namespace hana::literals;
using namespace std::literals;
constexpr auto A = hana::make_set(hana::int_c<1>, hana::int_c<3>, hana::int_c<5>, hana::int_c<7>);
constexpr auto B = hana::make_set(hana::int_c<2>, hana::int_c<4>, hana::int_c<6>);
constexpr auto U = hana::union_(A, B);
constexpr auto result = hana::unpack(U, [](auto... x){
return hana::make_set(hana::make_pair(9 - x, hana::max(x, 9 - x) == x ? x : 0)...);
});
constexpr auto result1 = hana::unpack(U, [](auto... x){
return hana::make_tuple(hana::make_pair(x, 8 - x)...);
});
using type_A = mpl::vector4_c<int, 1, 3, 5, 7>;
using type_B = mpl::vector3_c<int, 2, 4, 6>;
template<int N, int M>
struct pair {
static constexpr int first = mpl::at_c<type_A, N>::type::value;
static constexpr int second = mpl::at_c<type_B, M>::type::value;
};
template<int N, int M>
struct U_st : mpl::if_c<(mpl::plus<typename mpl::at_c<type_A, N>::type, typename mpl::at_c<type_B, M>::type>::type::value == 9),
pair<N, M>, mpl::na>::type {
};
#define eps 0.000001
double fx(double x) { return x*x + x;} // вычисляемая функция
double dfx(double x) { return 2*x + 1;} // производная функции
typedef double(*function)(double x); // задание типа function
double solve(function fx, function dfx, double x0) {
double x1 = x0 - fx(x0)/dfx(x0); // первое приближение
while (std::abs(x1-x0)>eps) { // пока не достигнута точность 0.000001
x0 = x1;
x1 = x0 - fx(x0)/dfx(x0); // последующие приближения
}
return x1;
}
auto result2 = hana::sort(result1, hana::less);
int main()
{
std::stringstream ss2;
hana::for_each(result, [&](auto x) {
if(hana::first(x) + hana::second(x) == 9)
ss2 << hana::first(x) << " " << hana::second(x) << "\n";
});
std::stringstream ss3;
hana::for_each(result2, [&](auto x) {
// if(hana::first(x) < hana::second(x))
ss3 << hana::first(x) << " " << hana::second(x) << "\n";
});
std::cout << ss2.str() << std::endl;
std::cout << "============================" << std::endl;
std::cout << ss3.str() << std::endl;
std::cout << "============================" << std::endl;
std::cout << U_st<3, 0>::first << std::endl;
variable x;
double result = newton(x*x + x , 1.1, 1000);
std::cout << result << '\n';
std::cout << "============================" << std::endl;
std::cout << solve(fx, dfx, 1.1) << '\n';
return 0;
}
|
4084de091bad943addf3b267efd95be9e5b91686
|
527739ed800e3234136b3284838c81334b751b44
|
/include/RED4ext/Types/generated/scn/BraindancePaused_ConditionType.hpp
|
961f235b9a925f00c338123a562651ccd6e7d4f1
|
[
"MIT"
] |
permissive
|
0xSombra/RED4ext.SDK
|
79ed912e5b628ef28efbf92d5bb257b195bfc821
|
218b411991ed0b7cb7acd5efdddd784f31c66f20
|
refs/heads/master
| 2023-07-02T11:03:45.732337
| 2021-04-15T16:38:19
| 2021-04-15T16:38:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 689
|
hpp
|
BraindancePaused_ConditionType.hpp
|
#pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/REDhash.hpp>
#include <RED4ext/Types/SimpleTypes.hpp>
#include <RED4ext/Types/generated/scn/IBraindanceConditionType.hpp>
namespace RED4ext
{
namespace scn { struct SceneResource; }
namespace scn {
struct BraindancePaused_ConditionType : scn::IBraindanceConditionType
{
static constexpr const char* NAME = "scnBraindancePaused_ConditionType";
static constexpr const char* ALIAS = NAME;
RaRef<scn::SceneResource> sceneFile; // 38
};
RED4EXT_ASSERT_SIZE(BraindancePaused_ConditionType, 0x40);
} // namespace scn
} // namespace RED4ext
|
c59a6e12f9f4c08cbf14a132520f4694df26d6f0
|
3f0366faff8b3c8ff0282e8b3179859db2a0caa3
|
/src/GeekyMQTT.cpp
|
9c0aba2411fc3e1238ff6971e86a49af51df6abf
|
[
"MIT"
] |
permissive
|
Ravi-Pansuriya/GeekyMQTT
|
438f8d686a991210748ed972b22131db1ec2e267
|
a9c0e7bd48841c393f3cfe84ebc47eef742a5888
|
refs/heads/master
| 2020-04-18T11:30:21.625008
| 2019-02-11T09:16:28
| 2019-02-11T09:16:28
| 167,502,278
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,376
|
cpp
|
GeekyMQTT.cpp
|
#include "GeekyMQTT.h"
#include <WiFi.h>
GeekyMQTT::GeekyMQTT(Client& client, String username, String password){
_client.setClient(client);
_username = username;
_password = password;
}
void GeekyMQTT::setServer(const char* mqttHost, int port){
_client.setServer(mqttHost, port);
}
String GeekyMQTT::clientId(){
return _clientId;
}
// Generate client id based on MAC address and last 8 bits of microsecond counter
String GeekyMQTT::generateClientId(boolean isPublish){
String _id = "ESP32-";
uint8_t mac[6];
WiFi.macAddress(mac);
_id += GeekyMQTT::macToStr(mac);
_id += (isPublish ? "-pub" : "-sub");
_id += String(micros() & 0xff, 16);
return _id;
}
// Static functions
String GeekyMQTT::macToStr(const uint8_t* mac){
String result;
for (int i = 0; i < 6; ++i) {
result += String(mac[i], 16);
// if (i < 5)
// result += ':';
}
return result;
}
/* Private/Protected methods*/
boolean GeekyMQTT::connect() {
byte _connectionCounter = 0;
/* Loop till 3 tries */
while (!_client.connected() && _connectionCounter < 3) {
/* connect now */
if (_client.connect(_clientId.c_str(), _username.c_str(), _password.c_str())) {
Serial.print("Connected as: ");
Serial.println(_clientId);
return true;
} else {
_connectionCounter += 1;
}
delay(50);
}
return false;
}
|
e043512022c0507a99735dc5fe844219e1f557af
|
ec2b398e7ea27813cfbdde046adbf844c7a81638
|
/Assignment 3/BigInt.h
|
6c2407c17f21b4778036c1d4cfa346cd1ee7c3d3
|
[] |
no_license
|
matthynes/CS2510
|
eebce9d3f0dd97d8ac9a84caa04e9dc7592079ac
|
05b7c5ebb081f634c46f239a58e3d61085c7a667
|
refs/heads/master
| 2021-01-17T12:45:53.978908
| 2016-07-30T14:10:33
| 2016-07-30T14:10:33
| 59,024,740
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 519
|
h
|
BigInt.h
|
// Matthew Hynes (201200318)
#ifndef BIGINT_H
#define BIGINT_H
#include <vector>
#include <string>
#include <iomanip>
#include <ostream>
class BigInt {
public:
BigInt();
BigInt(std::string strInt);
std::vector<int> getBigInt() const;
friend std::ostream &operator<<(std::ostream &os, const BigInt &bi) {
for (int i = 0; i < bi.bigInteger.size(); i++) {
os << bi.bigInteger[i];
}
return os;
}
private:
std::vector<int> bigInteger;
};
#endif //BIGINT_H
|
69b5bfccc99818bb727643498c9470e5de649d4b
|
71ec6111129da5fa053791303fe33dc726ab0b7f
|
/Insomnia/insomnia.h
|
a003161ca8765fd1ee5f15ee1391f915f7d77d64
|
[
"MIT"
] |
permissive
|
KrossX/Insomnia
|
62f2887392829237424f2fc5e74556671af6d79f
|
53cd8c5ba413795ded8f4bc206a17d8106fac2f9
|
refs/heads/master
| 2021-01-18T20:20:38.777287
| 2015-11-12T00:54:23
| 2015-11-12T00:54:23
| 13,973,765
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 226
|
h
|
insomnia.h
|
/* Copyright (c) 2012 KrossX <krossx@live.com>
* License: http://www.opensource.org/licenses/mit-license.html MIT License
*/
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string>
#include <list>
|
71150592630d1484fa9afc2a8584410e2bdda5db
|
c6e7f3bee051fe906295fdf8bfe7dedd5158f7a6
|
/1551020_Week06/ex2g/function.cpp
|
a1a2955a2e391effdd3ae589bd7d873db7a80a45
|
[] |
no_license
|
luong-komorebi/CS161
|
81066209c26158705951febab9ed94fcc80af94a
|
e21f292166db110b1c79f7403eedb357b0776f71
|
refs/heads/master
| 2021-06-08T16:21:25.992353
| 2016-12-20T03:31:46
| 2016-12-20T03:31:46
| 59,763,771
| 1
| 0
| null | 2023-09-07T08:43:09
| 2016-05-26T15:56:21
|
C++
|
UTF-8
|
C++
| false
| false
| 276
|
cpp
|
function.cpp
|
#include "function.h"
int prime ( int n)
{
bool check=true ;
for (int k=2; k<= n; ++k)
{
for ( int i=2 ; i<= sqrt(k*1.0); ++i)
{
if (k%i ==0)
{
check = false;
break;
}
check = true ;
}
if ( check == true )
cout << k << " " ;
}
return 0;
}
|
d704fb8d6f9ab11de70e1f2286b31327cce9b8ee
|
c9cf0586ace11aa32fa67606d237a130a06364ee
|
/circular-cylinder-2-40/12.6/p
|
720077ebef103354cd17f92a33205fcbc0bfdba2
|
[] |
no_license
|
jezvonek/CFD-Final-Project
|
c74cfa21f22545c27d97d85cf30eb6dc8c824dc1
|
7c9a7fb032d74f20888effa0a0b75b212bf899f4
|
refs/heads/master
| 2022-07-05T14:43:52.967657
| 2020-05-14T03:40:56
| 2020-05-14T03:40:56
| 262,370,756
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 89,405
|
p
|
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6.0
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "12.6";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField nonuniform List<scalar>
9600
(
-158.217
-137.663
-122.872
-110.709
-99.7058
-89.8874
-81.189
-73.4733
-66.6203
-60.5259
-55.096
-50.247
-45.9058
-42.0092
-38.5024
-35.3384
-32.4768
-29.8807
-27.5171
-25.3831
-159.222
-138.646
-123.798
-111.565
-100.495
-90.6181
-81.8696
-74.1114
-67.2223
-61.0968
-55.6399
-50.7671
-46.4047
-42.4888
-38.9645
-35.7845
-32.908
-30.2975
-27.9195
-25.7754
-160.228
-139.612
-124.706
-112.406
-101.27
-91.3357
-82.5383
-74.7386
-67.8143
-61.6587
-56.1755
-51.2795
-46.8963
-42.9617
-39.4202
-36.2244
-33.3332
-30.7084
-28.316
-26.1621
-161.231
-140.567
-125.597
-113.229
-102.03
-92.0393
-83.194
-75.3539
-68.3954
-62.2105
-56.7019
-51.7833
-47.38
-43.4271
-39.8689
-36.6577
-33.7521
-31.113
-28.7065
-26.5434
-162.224
-141.509
-126.472
-114.036
-102.774
-92.7279
-83.8357
-75.9563
-68.9646
-62.7513
-57.218
-52.2778
-47.8549
-43.8844
-40.31
-37.0839
-34.1643
-31.5114
-29.0911
-26.9197
-163.203
-142.435
-127.33
-114.826
-103.5
-93.4001
-84.4622
-76.5446
-69.5208
-63.2801
-57.7231
-52.7619
-48.3204
-44.3329
-40.7431
-37.5027
-34.5697
-31.9035
-29.4701
-27.2914
-164.163
-143.341
-128.168
-115.595
-104.208
-94.0545
-85.0721
-77.1174
-70.0625
-63.7955
-58.2158
-53.2347
-48.7755
-44.772
-41.1676
-37.9138
-34.9682
-32.2894
-29.8439
-27.6591
-165.103
-144.227
-128.986
-116.344
-104.896
-94.6898
-85.6639
-77.6733
-70.5885
-64.2963
-58.695
-53.695
-49.2191
-45.2007
-41.5828
-38.3167
-35.3596
-32.6693
-30.2126
-28.0235
-166.02
-145.09
-129.78
-117.071
-105.561
-95.3044
-86.2362
-78.2108
-71.0973
-64.781
-59.1591
-54.1415
-49.65
-45.6179
-41.9877
-38.7106
-35.7433
-33.0427
-30.5766
-28.3851
-166.912
-145.927
-130.55
-117.773
-106.204
-95.8967
-86.7872
-78.7282
-71.5871
-65.2478
-59.6066
-54.5724
-50.0667
-46.0221
-42.381
-39.0942
-36.1183
-33.4091
-30.9355
-28.7442
-167.777
-146.739
-131.293
-118.449
-106.821
-96.465
-87.3154
-79.2237
-72.056
-65.6948
-60.0354
-54.9859
-50.4671
-46.4115
-42.761
-39.4663
-36.4834
-33.7674
-31.2883
-29.0996
-168.616
-147.522
-132.009
-119.099
-107.413
-97.0077
-87.8188
-79.6954
-72.5019
-66.1198
-60.4431
-55.3793
-50.8489
-46.7837
-43.1255
-39.8248
-36.837
-34.1164
-31.6342
-29.45
-169.426
-148.276
-132.696
-119.72
-107.976
-97.5234
-88.2958
-80.1414
-72.9228
-66.5202
-60.8269
-55.7496
-51.2085
-47.1351
-43.4711
-40.1668
-37.177
-34.4546
-31.9723
-29.7963
-170.209
-149
-133.353
-120.312
-108.51
-98.0106
-88.745
-80.5598
-73.3165
-66.8938
-61.184
-56.0936
-51.5421
-47.4612
-43.7924
-40.4862
-37.497
-34.7766
-32.2997
-30.1408
-170.961
-149.693
-133.978
-120.873
-109.015
-98.4683
-89.1647
-80.949
-73.6809
-67.2379
-61.5117
-56.408
-51.8462
-47.7576
-44.084
-40.7759
-37.7878
-35.0716
-32.6063
-30.4754
-171.687
-150.355
-134.573
-121.403
-109.489
-98.895
-89.5534
-81.3069
-74.0136
-67.5499
-61.8067
-56.6894
-52.1171
-48.0211
-44.3429
-41.0331
-38.0459
-35.3339
-32.8805
-30.7722
-172.397
-150.992
-135.136
-121.901
-109.93
-99.2893
-89.9095
-81.6317
-74.3123
-67.8264
-62.0645
-56.9319
-52.348
-48.2445
-44.5637
-41.2567
-38.2768
-35.5735
-33.1283
-31.024
-173.107
-151.611
-135.67
-122.366
-110.338
-99.6514
-90.2335
-81.9238
-74.5768
-68.0663
-62.282
-57.1293
-52.5281
-48.4118
-44.7251
-41.4225
-38.458
-35.7772
-33.3616
-31.3137
-173.814
-152.21
-136.174
-122.799
-110.717
-99.9854
-90.5299
-82.1877
-74.8114
-68.2735
-62.4623
-57.2824
-52.6536
-48.5098
-44.7979
-41.4752
-38.4994
-35.8285
-33.4908
-31.664
-174.445
-152.767
-136.65
-123.208
-111.074
-100.299
-90.8061
-82.431
-75.0243
-68.4568
-62.6155
-57.4034
-52.7387
-48.5531
-44.7902
-41.4017
-38.3419
-35.5908
-33.2515
-31.531
-179.946
-179.917
-179.823
-179.707
-179.577
-179.423
-179.241
-179.03
-178.793
-178.532
-178.247
-177.941
-177.613
-177.266
-176.9
-176.517
-176.12
-175.713
-175.3
-174.887
-157.531
-157.551
-157.525
-157.471
-157.391
-157.283
-157.146
-156.979
-156.785
-156.567
-156.324
-156.059
-155.773
-155.467
-155.143
-154.8
-154.441
-154.064
-153.671
-153.246
-140.59
-140.648
-140.671
-140.662
-140.622
-140.552
-140.452
-140.325
-140.173
-139.996
-139.796
-139.576
-139.334
-139.074
-138.795
-138.498
-138.182
-137.845
-137.484
-137.089
-126.478
-126.552
-126.597
-126.61
-126.592
-126.545
-126.471
-126.372
-126.249
-126.104
-125.937
-125.751
-125.547
-125.325
-125.085
-124.828
-124.552
-124.257
-123.938
-123.591
-113.874
-113.949
-113.998
-114.019
-114.011
-113.976
-113.915
-113.832
-113.727
-113.601
-113.457
-113.295
-113.116
-112.922
-112.712
-112.487
-112.246
-111.988
-111.709
-111.407
-102.795
-102.864
-102.909
-102.929
-102.922
-102.889
-102.834
-102.758
-102.661
-102.546
-102.414
-102.267
-102.105
-101.93
-101.742
-101.541
-101.328
-101.1
-100.855
-100.59
-93.1091
-93.1682
-93.2056
-93.2195
-93.2088
-93.1747
-93.119
-93.0436
-92.9499
-92.8395
-92.7138
-92.5745
-92.423
-92.2606
-92.088
-91.9061
-91.7144
-91.5117
-91.2955
-91.0624
-84.6065
-84.6551
-84.6833
-84.6895
-84.6727
-84.634
-84.5752
-84.4979
-84.4037
-84.2941
-84.1708
-84.0357
-83.8904
-83.7362
-83.5749
-83.4074
-83.2333
-83.0517
-82.8604
-82.6557
-77.1076
-77.1461
-77.1651
-77.1631
-77.1396
-77.0954
-77.0322
-76.9517
-76.8552
-76.7446
-76.6215
-76.4879
-76.3459
-76.1973
-76.0443
-75.888
-75.7288
-75.5661
-75.3976
-75.2194
-70.4649
-70.4942
-70.5046
-70.495
-70.4649
-70.4152
-70.3474
-70.2631
-70.1636
-70.0508
-69.9266
-69.793
-69.6523
-69.5073
-69.3603
-69.2131
-69.0669
-68.9217
-68.7751
-68.6229
-64.5557
-64.5768
-64.5796
-64.563
-64.5269
-64.4721
-64.3999
-64.3117
-64.209
-64.0934
-63.9672
-63.8324
-63.6918
-63.5485
-63.4056
-63.2656
-63.131
-63.0022
-62.8774
-62.7517
-59.2781
-59.292
-59.2881
-59.2656
-59.2241
-59.1647
-59.0883
-58.9965
-58.8904
-58.7719
-58.643
-58.506
-58.3642
-58.221
-58.0803
-57.9458
-57.8211
-57.7078
-57.6052
-57.5074
-54.548
-54.5558
-54.5461
-54.5182
-54.4722
-54.4086
-54.3286
-54.2333
-54.124
-54.0023
-53.8703
-53.7303
-53.586
-53.4412
-53.3007
-53.1692
-53.0527
-52.9538
-52.8741
-52.8067
-50.2955
-50.2979
-50.2832
-50.2508
-50.2007
-50.1336
-50.0504
-49.9519
-49.8395
-49.7145
-49.579
-49.4353
-49.2874
-49.1389
-48.9964
-48.865
-48.7544
-48.6679
-48.6123
-48.5787
-46.4619
-46.4595
-46.4405
-46.4043
-46.3508
-46.2807
-46.1946
-46.0934
-45.978
-45.8498
-45.7105
-45.5625
-45.4097
-45.2557
-45.1084
-44.9737
-44.8656
-44.7881
-44.7578
-44.7617
-42.9977
-42.9912
-42.9684
-42.9288
-42.8725
-42.7998
-42.7112
-42.6075
-42.4895
-42.3581
-42.2149
-42.062
-41.9031
-41.7416
-41.5866
-41.4439
-41.3341
-41.2604
-41.2558
-41.299
-39.8612
-39.8511
-39.8248
-39.7823
-39.7234
-39.6484
-39.5577
-39.4517
-39.331
-39.1964
-39.0491
-38.8908
-38.7246
-38.5534
-38.3868
-38.2303
-38.112
-38.0349
-38.0574
-38.136
-37.0148
-37.0019
-36.9733
-36.9287
-36.8681
-36.7916
-36.6994
-36.5917
-36.4688
-36.3314
-36.1801
-36.0163
-35.8422
-35.6598
-35.4779
-35.3006
-35.1626
-35.0701
-35.1252
-35.2449
-34.4237
-34.4099
-34.3809
-34.3366
-34.2767
-34.2013
-34.1102
-34.0036
-33.8815
-33.7443
-33.5923
-33.4264
-33.2474
-33.0569
-32.8605
-32.6605
-32.4899
-32.3599
-32.4368
-32.6542
-32.0723
-32.0534
-32.0208
-31.9746
-31.9142
-31.8392
-31.7495
-31.6451
-31.5257
-31.3915
-31.2422
-31.0785
-30.8997
-30.7071
-30.5011
-30.2837
-30.0698
-29.8727
-29.8623
-30.1958
-170.383
-171.23
-171.993
-172.745
-173.489
-174.206
-174.886
-175.523
-176.117
-176.668
-177.175
-177.638
-178.055
-178.428
-178.758
-179.045
-179.292
-179.504
-179.683
-179.836
-147.796
-148.648
-149.451
-150.229
-150.984
-151.705
-152.387
-153.026
-153.623
-154.179
-154.691
-155.161
-155.588
-155.973
-156.317
-156.62
-156.884
-157.109
-157.298
-157.442
-130.995
-131.827
-132.628
-133.397
-134.132
-134.83
-135.49
-136.111
-136.692
-137.234
-137.736
-138.199
-138.621
-139.005
-139.349
-139.655
-139.924
-140.154
-140.344
-140.491
-117.313
-118.104
-118.869
-119.601
-120.298
-120.958
-121.582
-122.17
-122.722
-123.236
-123.714
-124.155
-124.559
-124.927
-125.258
-125.553
-125.813
-126.036
-126.222
-126.37
-105.295
-106.035
-106.753
-107.44
-108.093
-108.711
-109.295
-109.844
-110.359
-110.839
-111.285
-111.696
-112.073
-112.416
-112.725
-113.001
-113.243
-113.452
-113.627
-113.769
-94.8461
-95.5384
-96.2093
-96.852
-97.4617
-98.0377
-98.5804
-99.0902
-99.567
-100.011
-100.422
-100.801
-101.148
-101.463
-101.746
-101.999
-102.22
-102.411
-102.57
-102.699
-85.7686
-86.4185
-87.0476
-87.6493
-88.2189
-88.7555
-89.2595
-89.7315
-90.1717
-90.5806
-90.9584
-91.3056
-91.6228
-91.9102
-92.1682
-92.3971
-92.5971
-92.7684
-92.9111
-93.0252
-77.8242
-78.438
-79.0306
-79.5957
-80.1291
-80.6297
-81.0984
-81.5358
-81.9425
-82.319
-82.666
-82.984
-83.2737
-83.5354
-83.7695
-83.9763
-84.1561
-84.309
-84.4351
-84.5347
-70.8253
-71.4087
-71.97
-72.5031
-73.0042
-73.4726
-73.9093
-74.3154
-74.6916
-75.0389
-75.3579
-75.6496
-75.9144
-76.153
-76.3655
-76.5524
-76.7138
-76.85
-76.9611
-77.0473
-64.6261
-65.1843
-65.719
-66.2243
-66.6967
-67.1361
-67.544
-67.9216
-68.2703
-68.5911
-68.885
-69.153
-69.3957
-69.6136
-69.807
-69.9763
-70.1215
-70.243
-70.3407
-70.415
-59.1099
-59.6477
-60.1603
-60.6412
-61.0878
-61.5008
-61.8822
-62.2338
-62.5573
-62.8541
-63.1254
-63.3721
-63.5951
-63.7947
-63.9714
-64.1252
-64.2563
-64.3649
-64.451
-64.5148
-54.1822
-54.7043
-55.1986
-55.6581
-56.0809
-56.4693
-56.8262
-57.1537
-57.454
-57.7287
-57.9794
-58.2071
-58.4125
-58.5959
-58.7578
-58.8981
-59.0169
-59.1143
-59.1903
-59.2451
-49.7661
-50.277
-50.7564
-51.1964
-51.5969
-51.9621
-52.2956
-52.6005
-52.879
-53.1334
-53.3653
-53.5757
-53.7653
-53.9345
-54.0833
-54.2118
-54.3199
-54.4076
-54.4749
-54.5219
-45.7986
-46.3026
-46.7697
-47.1912
-47.5701
-47.9128
-48.2239
-48.5069
-48.765
-49.0004
-49.215
-49.4097
-49.5852
-49.7416
-49.879
-49.9972
-50.096
-50.1753
-50.2351
-50.2753
-42.2287
-42.7313
-43.1867
-43.5885
-43.9455
-44.2661
-44.5551
-44.8169
-45.0553
-45.2729
-45.4715
-45.652
-45.8147
-45.9599
-46.0872
-46.1963
-46.2871
-46.3592
-46.4124
-46.4468
-39.0094
-39.522
-39.966
-40.3444
-40.678
-40.9761
-41.2427
-41.4834
-41.7028
-41.9037
-42.0874
-42.2548
-42.4061
-42.5412
-42.6597
-42.7609
-42.8446
-42.9104
-42.9579
-42.9872
-36.0843
-36.6271
-37.0649
-37.4172
-37.7255
-38
-38.2438
-38.4638
-38.6653
-38.8505
-39.0206
-39.1764
-39.3177
-39.4441
-39.5549
-39.6495
-39.7271
-39.7875
-39.83
-39.8547
-33.4069
-33.9791
-34.4207
-34.7535
-35.0367
-35.2864
-35.5082
-35.7094
-35.895
-36.0667
-36.2256
-36.3722
-36.5059
-36.6258
-36.7311
-36.8208
-36.8942
-36.9507
-36.9898
-37.0113
-31.079
-31.5786
-31.9946
-32.3282
-32.5907
-32.8099
-33.0086
-33.1929
-33.3634
-33.5221
-33.6709
-33.8096
-33.9371
-34.0519
-34.153
-34.2394
-34.3101
-34.3644
-34.4017
-34.4215
-29.4825
-29.7437
-29.9521
-30.2916
-30.5403
-30.7056
-30.8629
-31.0204
-31.1661
-31.3007
-31.4288
-31.55
-31.6621
-31.763
-31.8516
-31.9269
-31.9878
-32.0334
-32.063
-32.076
-20.2391
-22.1904
-24.365
-26.7514
-29.3783
-32.2793
-35.4885
-39.0452
-42.9959
-47.3956
-52.3096
-57.8178
-64.0189
-71.039
-79.0468
-88.2717
-98.9312
-111.192
-126.662
-148.275
-20.6314
-22.5999
-24.7853
-27.1851
-29.8279
-32.7465
-35.9752
-39.5537
-43.5287
-47.9556
-52.9005
-58.4438
-64.6854
-71.7522
-79.8145
-89.1028
-99.8336
-112.167
-127.702
-149.354
-21.0286
-23.0137
-25.2098
-27.6234
-30.2826
-33.2194
-36.4681
-40.0689
-44.0688
-48.5237
-53.5002
-59.0795
-65.3623
-72.4767
-80.5941
-89.946
-100.748
-113.153
-128.742
-150.415
-21.4297
-23.4306
-25.6373
-28.0649
-30.7408
-33.6961
-36.9654
-40.5889
-44.6142
-49.0976
-54.1061
-59.7219
-66.0465
-73.2091
-81.3818
-90.7971
-101.67
-114.148
-129.798
-151.5
-21.8334
-23.8495
-26.0666
-28.5086
-31.2016
-34.1757
-37.4658
-41.1124
-45.1634
-49.6756
-54.7166
-60.3692
-66.7359
-73.9468
-82.1751
-91.6538
-102.598
-115.151
-130.868
-152.61
-22.2386
-24.2693
-26.497
-28.9538
-31.6642
-34.6576
-37.9687
-41.6388
-45.7159
-50.2572
-55.331
-61.0207
-67.4297
-74.6892
-82.9735
-92.5159
-103.531
-116.161
-131.948
-153.734
-22.6442
-24.689
-26.9275
-29.3996
-32.128
-35.141
-38.4737
-42.1676
-46.2713
-50.842
-55.9489
-61.676
-68.1277
-75.4362
-83.7766
-93.3831
-104.47
-117.176
-133.033
-154.865
-23.0495
-25.108
-27.3575
-29.8456
-32.5925
-35.6256
-38.9804
-42.6985
-46.829
-51.4296
-56.5699
-62.3347
-68.8293
-76.187
-84.5839
-94.2548
-105.413
-118.194
-134.121
-155.999
-23.4539
-25.5257
-27.7865
-30.2913
-33.0573
-36.1111
-39.4883
-43.2311
-47.3887
-52.0195
-57.1934
-62.9961
-69.5339
-76.9409
-85.3945
-95.1297
-106.359
-119.215
-135.211
-157.136
-23.857
-25.9417
-28.2143
-30.7365
-33.5224
-36.5973
-39.9974
-43.7652
-47.9502
-52.6113
-57.819
-63.6597
-70.2406
-77.6971
-86.2072
-96.0067
-107.307
-120.237
-136.302
-158.273
-24.2586
-26.3562
-28.641
-31.1816
-33.988
-37.0846
-40.5078
-44.3008
-48.5134
-53.2048
-58.4462
-64.3249
-70.9489
-78.4545
-87.0211
-96.8847
-108.256
-121.259
-137.391
-159.409
-24.6594
-26.7697
-29.0674
-31.6272
-34.4548
-37.5734
-41.0201
-44.8383
-49.0784
-53.8
-59.0749
-64.9911
-71.6578
-79.2123
-87.835
-97.7622
-109.203
-122.279
-138.478
-160.541
-25.06
-27.1834
-29.4949
-32.075
-34.9243
-38.0651
-41.5351
-45.3783
-49.6454
-54.3966
-59.7045
-65.6578
-72.3666
-79.9695
-88.6476
-98.6379
-110.149
-123.297
-139.561
-161.668
-25.4628
-27.5996
-29.9255
-32.5265
-35.3978
-38.5606
-42.0536
-45.9212
-50.2146
-54.9946
-60.3345
-66.324
-73.0742
-80.7246
-89.4574
-99.5101
-111.09
-124.308
-140.637
-162.788
-25.8717
-28.0235
-30.3646
-32.9867
-35.8792
-39.0628
-42.5773
-46.4678
-50.7862
-55.5937
-60.9644
-66.9889
-73.7793
-81.4761
-90.2627
-100.377
-112.024
-125.314
-141.706
-163.9
-26.2923
-28.4589
-30.8145
-33.4567
-36.3692
-39.5723
-43.1066
-47.0183
-51.3597
-56.193
-61.5929
-67.6509
-74.4802
-82.2223
-91.0614
-101.236
-112.951
-126.31
-142.765
-165.001
-26.7421
-28.9258
-31.2913
-33.9476
-36.8748
-40.0928
-43.6432
-47.5729
-51.9346
-56.7913
-62.2184
-68.3082
-75.1747
-82.9605
-91.8508
-102.084
-113.865
-127.294
-143.814
-166.094
-27.229
-29.4206
-31.7866
-34.4519
-37.3914
-40.6217
-44.185
-48.1294
-52.5087
-57.3863
-62.8385
-68.9581
-75.8602
-83.6883
-92.6282
-102.919
-114.764
-128.263
-144.851
-167.178
-27.8332
-30.0006
-32.3293
-34.9859
-37.9273
-41.1612
-44.7305
-48.6849
-53.0784
-57.9745
-63.4496
-69.5973
-76.5333
-84.4019
-93.3897
-103.736
-115.643
-129.21
-145.871
-168.258
-28.5209
-30.5548
-32.8495
-35.5207
-38.4679
-41.7006
-45.2718
-49.2334
-53.6389
-58.5513
-64.0476
-70.2217
-77.19
-85.0975
-94.1315
-104.53
-116.495
-130.125
-146.862
-169.336
-14.6458
-15.8844
-17.6311
-19.717
-22.0473
-24.633
-27.5087
-30.7085
-34.27
-38.2385
-42.6683
-47.6249
-53.189
-59.4628
-66.5869
-74.7604
-84.18
-95.0333
-109.061
-129.541
-15.0383
-16.3765
-18.161
-20.2147
-22.5024
-25.0575
-27.9141
-31.1024
-34.6583
-38.626
-43.0594
-48.024
-53.6004
-59.892
-67.0404
-75.247
-84.7088
-95.6092
-109.68
-130.19
-15.0844
-16.6115
-18.4841
-20.5704
-22.873
-25.4366
-28.2975
-31.4887
-35.0482
-39.0218
-43.4638
-48.4404
-54.0329
-60.3455
-67.5213
-75.7632
-85.2693
-96.2174
-110.322
-130.832
-15.2173
-16.8107
-18.7268
-20.8494
-23.1838
-25.7728
-28.6528
-31.8589
-35.4316
-39.4183
-43.8747
-48.8678
-54.4802
-60.8172
-68.023
-76.3024
-85.8549
-96.856
-111.006
-131.535
-15.413
-17.0279
-18.9703
-21.1193
-23.4794
-26.0921
-28.9933
-32.2188
-35.8097
-39.8143
-44.2894
-49.303
-54.9389
-61.3033
-68.5421
-76.8616
-86.4634
-97.5234
-111.733
-132.3
-15.6009
-17.248
-19.2194
-21.3923
-23.7748
-26.4089
-29.3308
-32.5764
-36.1875
-40.2127
-44.7094
-49.7464
-55.4084
-61.8032
-69.078
-77.4406
-87.0949
-98.218
-112.494
-133.109
-15.7856
-17.4698
-19.469
-21.6654
-24.0703
-26.7264
-29.6696
-32.9364
-36.5689
-40.6163
-45.1364
-50.199
-55.8897
-62.3175
-69.6309
-78.0396
-87.7493
-98.9377
-113.284
-133.95
-15.9898
-17.7042
-19.7258
-21.943
-24.3696
-27.0476
-30.0127
-33.3014
-36.9563
-41.0271
-45.5723
-50.6621
-56.3834
-62.8463
-70.2009
-78.6584
-88.4258
-99.6814
-114.098
-134.82
-16.2196
-17.9575
-19.9969
-22.2322
-24.6785
-27.3771
-30.3634
-33.674
-37.3518
-41.4468
-46.0181
-51.1367
-56.8902
-63.39
-70.7878
-79.2962
-89.1237
-100.448
-114.938
-135.717
-16.4713
-18.2302
-20.2852
-22.5363
-25.0004
-27.7182
-30.7248
-34.0568
-37.7574
-41.8771
-46.4751
-51.6234
-57.4104
-63.9487
-71.3914
-79.9528
-89.8425
-101.238
-115.802
-136.64
-16.7424
-18.5214
-20.5905
-22.856
-25.3366
-28.0725
-31.0985
-34.4515
-38.1747
-42.3191
-46.9444
-52.1231
-57.9446
-64.5226
-72.0118
-80.628
-90.5817
-102.05
-116.69
-137.588
-17.0322
-18.8304
-20.9122
-23.191
-25.6872
-28.4404
-31.4853
-34.8588
-38.6045
-42.7736
-47.4265
-52.6362
-58.493
-65.1119
-72.6489
-81.3213
-91.3408
-102.883
-117.6
-138.559
-17.3402
-19.1566
-21.2499
-23.5411
-26.0522
-28.8221
-31.8853
-35.279
-39.0471
-43.241
-47.9217
-53.1629
-59.0558
-65.7165
-73.3025
-82.0326
-92.1192
-103.737
-118.531
-139.552
-17.6648
-19.4987
-21.6026
-23.9056
-26.4311
-29.2173
-32.2985
-35.7122
-39.5025
-43.7213
-48.4301
-53.7032
-59.6328
-66.3361
-73.9722
-82.7612
-92.9165
-104.612
-119.484
-140.566
-18.004
-19.8549
-21.969
-24.2835
-26.8229
-29.6251
-32.7242
-36.1578
-39.9704
-44.2143
-48.9513
-54.2568
-60.2237
-66.9705
-74.6576
-83.5067
-93.7319
-105.505
-120.457
-141.601
-18.3558
-20.2234
-22.3474
-24.6732
-27.2267
-30.0448
-33.1617
-36.6152
-40.4502
-44.7192
-49.485
-54.8232
-60.8279
-67.6189
-75.358
-84.2682
-94.5646
-106.418
-121.45
-142.657
-18.7183
-20.6025
-22.7362
-25.0735
-27.641
-30.4751
-33.6099
-37.0835
-40.941
-45.2356
-50.0303
-55.4017
-61.4449
-68.2807
-76.0725
-85.0448
-95.4135
-107.348
-122.462
-143.733
-19.0896
-20.9903
-23.1338
-25.4828
-28.0645
-30.9149
-34.0678
-37.5617
-41.4421
-45.7624
-50.5864
-55.9915
-62.0737
-68.955
-76.8002
-85.8352
-96.2771
-108.294
-123.494
-144.833
-19.4678
-21.3851
-23.5387
-25.8997
-28.4961
-31.363
-34.5343
-38.0489
-41.9524
-46.2988
-51.1525
-56.5917
-62.7132
-69.6405
-77.5397
-86.638
-97.1532
-109.254
-124.545
-145.958
-19.8514
-21.7856
-23.9496
-26.3231
-28.9346
-31.8183
-35.0084
-38.5439
-42.4709
-46.8438
-51.7276
-57.2011
-63.3624
-70.3362
-78.2897
-87.4515
-98.0394
-110.222
-125.606
-147.111
-13.2618
-12.6416
-12.3275
-12.1473
-12.0235
-11.9277
-11.8576
-11.8061
-11.7738
-11.7583
-11.7598
-11.7776
-11.8115
-11.8615
-11.9274
-12.0091
-12.1068
-12.2204
-12.3501
-12.4961
-15.0895
-14.576
-14.1923
-13.966
-13.8069
-13.6927
-13.6094
-13.5498
-13.5119
-13.4929
-13.4922
-13.5088
-13.5425
-13.5929
-13.6597
-13.7429
-13.8423
-13.9579
-14.0897
-14.2379
-17.003
-16.5692
-16.1976
-15.9488
-15.7639
-15.6316
-15.5346
-15.4659
-15.4214
-15.3984
-15.3953
-15.411
-15.4449
-15.4965
-15.5655
-15.6516
-15.7546
-15.8742
-16.0105
-16.1637
-19.1799
-18.7672
-18.4114
-18.1499
-17.946
-17.7954
-17.6828
-17.6021
-17.5483
-17.5183
-17.5103
-17.5227
-17.5547
-17.6057
-17.6751
-17.7625
-17.8677
-17.9903
-18.1302
-18.2876
-21.5785
-21.1799
-20.8348
-20.5651
-20.3485
-20.1831
-20.0567
-19.9646
-19.9014
-19.8643
-19.8509
-19.8596
-19.8893
-19.9392
-20.0087
-20.0973
-20.2044
-20.3298
-20.4731
-20.6347
-24.2089
-23.8271
-23.4916
-23.2169
-22.9918
-22.8147
-22.677
-22.5746
-22.5028
-22.4588
-22.4402
-22.4453
-22.4728
-22.5218
-22.5916
-22.6814
-22.7908
-22.9192
-23.0663
-23.2325
-27.1111
-26.7439
-26.4166
-26.1394
-25.908
-25.7215
-25.574
-25.4624
-25.3826
-25.3321
-25.3085
-25.3101
-25.3355
-25.3837
-25.4539
-25.5453
-25.6572
-25.789
-25.9405
-26.1119
-30.3262
-29.9692
-29.6477
-29.3689
-29.1325
-28.9381
-28.7822
-28.6622
-28.5751
-28.5184
-28.49
-28.4882
-28.5117
-28.5594
-28.6303
-28.7236
-28.8385
-28.9742
-29.1306
-29.3081
-33.8961
-33.5452
-33.2267
-32.9462
-32.7052
-32.5039
-32.3405
-32.2129
-32.1189
-32.0564
-32.0235
-32.0187
-32.0406
-32.0881
-32.1601
-32.2558
-32.3743
-32.5146
-32.6768
-32.8611
-37.8678
-37.5193
-37.2011
-36.918
-36.6722
-36.4644
-36.2938
-36.1591
-36.0587
-35.9908
-35.9538
-35.9463
-35.9669
-36.0146
-36.0883
-36.187
-36.3097
-36.4556
-36.6244
-36.8168
-42.2963
-41.9465
-41.6258
-41.3385
-41.0871
-40.8726
-40.6948
-40.5532
-40.4465
-40.3734
-40.3325
-40.3225
-40.3423
-40.3906
-40.4665
-40.5689
-40.6967
-40.8489
-41.0255
-41.2271
-47.2474
-46.8924
-46.5661
-46.2724
-46.0138
-45.7915
-45.6061
-45.4571
-45.3439
-45.2655
-45.2206
-45.2083
-45.2273
-45.2766
-45.3551
-45.4618
-45.5955
-45.755
-45.9404
-46.1526
-52.8013
-52.4367
-52.1011
-51.7979
-51.5296
-51.2978
-51.1032
-50.9458
-50.8252
-50.7407
-50.6914
-50.6763
-50.6944
-50.7446
-50.826
-50.9374
-51.0775
-51.245
-51.4402
-51.6641
-59.0596
-58.6802
-58.3303
-58.0133
-57.7318
-57.4874
-57.281
-57.1129
-56.9831
-56.8909
-56.8358
-56.8168
-56.8331
-56.8836
-56.9675
-57.0834
-57.23
-57.406
-57.6115
-57.8477
-66.1613
-65.7602
-65.3897
-65.0532
-64.7533
-64.4916
-64.2693
-64.0869
-63.9445
-63.8418
-63.7783
-63.7532
-63.7657
-63.8148
-63.8997
-64.0191
-64.1716
-64.3555
-64.571
-64.8195
-74.3038
-73.8726
-73.4733
-73.1094
-72.7837
-72.4979
-72.2535
-72.0512
-71.8911
-71.7731
-71.6968
-71.6616
-71.6667
-71.7112
-71.7942
-71.9146
-72.0708
-72.2609
-72.4845
-72.7432
-83.683
-83.2112
-82.772
-82.3696
-82.0075
-81.688
-81.4127
-81.1822
-80.9968
-80.8564
-80.7607
-80.709
-80.7006
-80.7348
-80.8105
-80.9268
-81.0819
-81.2738
-81.5017
-81.767
-94.4853
-93.9573
-93.4612
-93.005
-92.5932
-92.2282
-91.9109
-91.642
-91.4215
-91.2492
-91.1247
-91.0476
-91.0172
-91.0325
-91.0924
-91.1961
-91.3425
-91.5308
-91.7598
-92.0279
-108.434
-107.822
-107.247
-106.723
-106.25
-105.829
-105.46
-105.144
-104.879
-104.665
-104.503
-104.392
-104.33
-104.318
-104.354
-104.437
-104.569
-104.753
-104.986
-105.255
-128.777
-128.054
-127.401
-126.811
-126.282
-125.81
-125.393
-125.031
-124.723
-124.47
-124.271
-124.126
-124.034
-123.995
-124.008
-124.074
-124.195
-124.382
-124.63
-124.899
-12.6577
-12.8338
-13.0243
-13.2293
-13.4486
-13.6824
-13.9306
-14.193
-14.4692
-14.7588
-15.0613
-15.3746
-15.6942
-16.0152
-16.3373
-16.6523
-16.916
-17.0985
-17.2842
-17.4586
-14.402
-14.5809
-14.7745
-14.9827
-15.2053
-15.4422
-15.6933
-15.9583
-16.2366
-16.5275
-16.8299
-17.1417
-17.4593
-17.7779
-18.0927
-18.3972
-18.6753
-18.8955
-19.0324
-19.1659
-16.3333
-16.5181
-16.718
-16.9329
-17.1625
-17.4066
-17.6648
-17.9367
-18.2216
-18.5186
-18.8264
-19.1425
-19.4638
-19.7861
-20.104
-20.411
-20.6999
-20.9531
-21.1433
-21.3164
-18.4621
-18.6524
-18.8583
-19.0796
-19.3159
-19.567
-19.8322
-20.1112
-20.4029
-20.7064
-21.02
-21.3414
-21.6675
-21.9945
-22.3175
-22.6307
-22.9282
-23.2008
-23.4407
-23.677
-20.8141
-21.0098
-21.2217
-21.4494
-21.6925
-21.9506
-22.2231
-22.5092
-22.8081
-23.1185
-23.4386
-23.7662
-24.0984
-24.4317
-24.7619
-25.0844
-25.3937
-25.6845
-25.9598
-26.2423
-23.4173
-23.619
-23.8375
-24.0722
-24.3228
-24.5886
-24.869
-25.1632
-25.4701
-25.7885
-26.1165
-26.452
-26.7922
-27.1342
-27.4745
-27.8093
-28.1342
-28.4464
-28.7517
-29.0673
-26.3028
-26.5112
-26.737
-26.9796
-27.2384
-27.513
-27.8024
-28.1058
-28.4221
-28.75
-29.0876
-29.4329
-29.7835
-30.1367
-30.4896
-30.8394
-31.1828
-31.5187
-31.853
-32.1975
-29.5059
-29.7219
-29.9559
-30.2074
-30.4758
-30.7602
-31.06
-31.3741
-31.7013
-32.0404
-32.3896
-32.747
-33.1103
-33.4772
-33.8455
-34.2128
-34.5769
-34.9381
-35.301
-35.6739
-33.0669
-33.2916
-33.5351
-33.7968
-34.0759
-34.3718
-34.6835
-35.01
-35.3502
-35.7025
-36.0656
-36.4374
-36.8161
-37.1997
-37.5862
-37.9737
-38.361
-38.7485
-39.1403
-39.5425
-37.0317
-37.2664
-37.5208
-37.7941
-38.0857
-38.3948
-38.7203
-39.0613
-39.4165
-39.7846
-40.1641
-40.5532
-40.9503
-41.3535
-41.7613
-42.1722
-42.5852
-43.0009
-43.4228
-43.8558
-41.4526
-41.6988
-41.9656
-42.2523
-42.5583
-42.8825
-43.2241
-43.5819
-43.9548
-44.3414
-44.7402
-45.1498
-45.5684
-45.9947
-46.4273
-46.8649
-47.3067
-47.7533
-48.2074
-48.6735
-46.3901
-46.6492
-46.9302
-47.2322
-47.5544
-47.8961
-48.2561
-48.6334
-49.0267
-49.4349
-49.8564
-50.2899
-50.7338
-51.187
-51.6482
-52.1162
-52.5904
-53.0709
-53.5604
-54.063
-51.9148
-52.1884
-52.4851
-52.8042
-53.1448
-53.5061
-53.887
-54.2865
-54.7034
-55.1363
-55.584
-56.0451
-56.5183
-57.0024
-57.4963
-57.999
-58.5095
-59.0279
-59.5566
-60.0997
-58.1127
-58.4017
-58.7153
-59.0528
-59.4135
-59.7964
-60.2006
-60.6249
-61.0681
-61.529
-62.0063
-62.4987
-63.005
-63.5241
-64.0551
-64.5968
-65.1482
-65.7089
-66.2811
-66.8692
-65.0985
-65.403
-65.7338
-66.0904
-66.4721
-66.8779
-67.3068
-67.7578
-68.2296
-68.721
-69.2309
-69.7579
-70.3008
-70.8587
-71.4307
-72.0158
-72.6125
-73.2202
-73.8406
-74.478
-73.0346
-73.353
-73.6998
-74.0745
-74.4765
-74.9048
-75.3586
-75.8367
-76.3379
-76.8611
-77.4051
-77.9687
-78.5506
-79.15
-79.766
-80.3978
-81.0437
-81.7021
-82.3743
-83.0644
-82.0671
-82.3956
-82.7542
-83.1428
-83.5613
-84.0089
-84.4849
-84.9879
-85.5169
-86.0705
-86.6477
-87.2472
-87.8679
-88.5088
-89.1691
-89.848
-90.5438
-91.2547
-91.9806
-92.7255
-92.3302
-92.6595
-93.0198
-93.4134
-93.8405
-94.3006
-94.7924
-95.3145
-95.8655
-96.4441
-97.0492
-97.6797
-98.3345
-99.0124
-99.7121
-100.433
-101.175
-101.939
-102.722
-103.524
-105.54
-105.849
-106.195
-106.581
-107.006
-107.468
-107.966
-108.497
-109.06
-109.653
-110.276
-110.928
-111.607
-112.312
-113.042
-113.797
-114.581
-115.4
-116.252
-117.114
-125.123
-125.387
-125.708
-126.078
-126.493
-126.949
-127.443
-127.973
-128.537
-129.135
-129.764
-130.425
-131.118
-131.84
-132.592
-133.375
-134.197
-135.075
-136.004
-136.917
-137.702
-117.954
-104.339
-93.4867
-83.77
-75.1303
-67.4716
-60.6566
-54.5791
-49.1529
-44.3019
-39.9582
-36.0616
-32.559
-29.404
-26.5538
-23.9636
-21.6004
-19.5041
-17.6962
-138.511
-118.791
-105.156
-94.2556
-84.4841
-75.7911
-68.083
-61.2231
-55.1053
-49.6431
-44.7599
-40.3871
-36.464
-32.937
-29.7591
-26.8875
-24.2823
-21.9202
-19.83
-17.9756
-139.366
-119.643
-105.983
-95.0361
-85.2102
-76.4636
-68.7059
-61.8013
-55.6437
-50.1464
-45.232
-40.8314
-36.8836
-33.3344
-30.1364
-27.2474
-24.6287
-22.2545
-20.1375
-18.2397
-140.262
-120.522
-106.827
-95.8303
-85.9492
-77.1485
-69.3411
-62.392
-56.1951
-50.6632
-45.7185
-41.2914
-37.3202
-33.7504
-30.5346
-27.6308
-25.0007
-22.6169
-20.4867
-18.5748
-141.19
-121.425
-107.688
-96.639
-86.7015
-77.8461
-69.9886
-62.9951
-56.7593
-51.1935
-46.2194
-41.7667
-37.7732
-34.1842
-30.9519
-28.0339
-25.3922
-22.9983
-20.8556
-18.9324
-142.147
-122.351
-108.567
-97.4627
-87.467
-78.5561
-70.6483
-63.6103
-57.3359
-51.7367
-46.7337
-42.2561
-38.2412
-34.6338
-31.3857
-28.4547
-25.8025
-23.4005
-21.2485
-19.3151
-143.127
-123.299
-109.464
-98.3007
-88.2452
-79.2778
-71.3193
-64.2369
-57.9239
-52.2916
-47.2602
-42.7581
-38.7222
-35.0967
-31.8332
-28.8889
-26.2259
-23.8152
-21.6529
-19.708
-144.129
-124.265
-110.377
-99.1522
-89.0352
-80.0106
-72.0008
-64.8738
-58.5224
-52.8571
-47.7974
-43.2711
-39.2142
-35.5708
-32.2918
-29.3342
-26.6601
-24.2401
-22.0669
-20.1091
-145.151
-125.248
-111.304
-100.016
-89.8359
-80.7531
-72.6917
-65.5198
-59.1299
-53.4316
-48.3437
-43.7932
-39.7154
-36.0538
-32.7589
-29.7876
-27.1016
-24.6712
-22.4859
-20.5144
-146.19
-126.246
-112.243
-100.89
-90.6461
-81.5042
-73.3906
-66.1736
-59.7451
-54.0138
-48.8976
-44.3227
-40.2237
-36.5437
-33.2326
-30.2469
-27.5484
-25.1067
-22.9083
-20.9223
-147.244
-127.257
-113.194
-101.774
-91.4641
-82.2623
-74.0962
-66.8339
-60.3666
-54.6022
-49.4575
-44.8579
-40.7376
-37.0387
-33.7109
-30.7103
-27.9984
-25.5446
-23.3323
-21.3315
-148.313
-128.28
-114.154
-102.665
-92.2885
-83.0261
-74.807
-67.4991
-60.9928
-55.1951
-50.0218
-45.3975
-41.2554
-37.5373
-34.1924
-31.1763
-28.4505
-25.9838
-23.757
-21.7412
-149.393
-129.312
-115.121
-103.562
-93.1175
-83.7939
-75.5215
-68.1678
-61.6224
-55.7913
-50.5892
-45.9399
-41.7758
-38.0382
-34.6757
-31.6437
-28.9035
-26.4232
-24.1814
-22.1506
-150.484
-130.351
-116.093
-104.462
-93.9496
-84.5643
-76.2381
-68.8385
-62.254
-56.3894
-51.1584
-46.4839
-42.2976
-38.5402
-35.1598
-32.1115
-29.3564
-26.8621
-24.605
-22.5593
-151.583
-131.395
-117.068
-105.365
-94.7831
-85.3355
-76.9555
-69.5099
-62.8862
-56.988
-51.7281
-47.0283
-42.8197
-39.0423
-35.6438
-32.5789
-29.8086
-27.2999
-25.0272
-22.9669
-152.688
-132.442
-118.045
-106.268
-95.6161
-86.1058
-77.6717
-70.1802
-63.5174
-57.5858
-52.297
-47.5719
-43.3409
-39.5434
-36.1267
-33.0452
-30.2595
-27.7362
-25.4478
-23.3732
-153.804
-133.493
-119.02
-107.169
-96.4458
-86.8727
-78.3847
-70.8475
-64.146
-58.1812
-52.8638
-48.1135
-43.8603
-40.0427
-36.6078
-33.5096
-30.7086
-28.1705
-25.8664
-23.7782
-154.938
-134.549
-119.993
-108.064
-97.2699
-87.6342
-79.0927
-71.5102
-64.7704
-58.7729
-53.4271
-48.652
-44.3766
-40.5392
-37.0862
-33.9714
-31.1551
-28.6024
-26.2829
-24.1819
-156.085
-135.608
-120.962
-108.953
-98.0878
-88.3904
-79.7959
-72.1686
-65.3909
-59.3609
-53.9869
-49.187
-44.8896
-41.0324
-37.5615
-34.4303
-31.5988
-29.0316
-26.6972
-24.5844
-157.201
-136.654
-121.924
-109.836
-98.9012
-89.1427
-80.4959
-72.824
-66.0083
-59.9459
-54.5438
-49.7192
-45.3998
-41.5228
-38.0339
-34.8863
-32.0397
-29.4581
-27.109
-24.9854
-19.4151
-12.8078
-8.74676
-5.91633
-4.00574
-2.68858
-1.76982
-1.13428
-0.699399
-0.40851
-0.220074
-0.103581
-0.0365705
-0.00268761
0.00980013
0.00919002
0.00128997
-0.00990142
-0.0215751
-0.031799
-0.0391586
-0.0427736
-0.0418186
-0.0361972
-0.0255185
-0.0107025
0.00845325
0.0295272
0.0527619
0.0738047
0.0935819
0.106424
0.114802
0.113488
0.10517
0.0866911
0.0595793
0.0235014
-0.00228838
-0.0414992
-19.8174
-13.1225
-8.9917
-6.10845
-4.15243
-2.80309
-1.85994
-1.20578
-0.756737
-0.454916
-0.257933
-0.134647
-0.0621576
-0.0238017
-0.00762574
-0.00517485
-0.0105269
-0.019592
-0.0294938
-0.0382488
-0.0443947
-0.0470144
-0.0452612
-0.039012
-0.0278615
-0.0127036
0.006656
0.0278357
0.0510456
0.0720167
0.0916225
0.104359
0.112607
0.111359
0.10317
0.0851107
0.0586402
0.023509
-0.00131995
-0.0395014
-20.2169
-13.4415
-9.24314
-6.30691
-4.3038
-2.92078
-1.9522
-1.27857
-0.814756
-0.501569
-0.29575
-0.165496
-0.0874334
-0.0445665
-0.0247016
-0.0192122
-0.0220514
-0.0290319
-0.0372056
-0.0445337
-0.0495059
-0.0511677
-0.048649
-0.0417998
-0.0302009
-0.0147197
0.00482996
0.0261069
0.0492892
0.0701918
0.0896359
0.10228
0.110416
0.109251
0.101201
0.0835745
0.0577348
0.0235605
-0.000366164
-0.03751
-20.6149
-13.7643
-9.50066
-6.51188
-4.46014
-3.04186
-2.0468
-1.35283
-0.873577
-0.548563
-0.333602
-0.19619
-0.112448
-0.0650222
-0.04146
-0.0329484
-0.0333048
-0.0382381
-0.0447238
-0.0506644
-0.0545007
-0.0552398
-0.0519867
-0.0445638
-0.0325386
-0.0167518
0.00297531
0.024342
0.0474948
0.0683332
0.0876258
0.100193
0.108232
0.107165
0.0992638
0.0820815
0.0568613
0.0236514
0.000567747
-0.0355285
-21.0127
-14.091
-9.76391
-6.72359
-4.62185
-3.16659
-2.14393
-1.42872
-0.933334
-0.596003
-0.371572
-0.226792
-0.137252
-0.0852094
-0.0579334
-0.0464093
-0.0443078
-0.0472269
-0.0520611
-0.0566511
-0.059387
-0.0592363
-0.0552783
-0.0473071
-0.0348766
-0.0188005
0.00109255
0.0225425
0.0456648
0.0664439
0.0855953
0.0980997
0.106056
0.105103
0.0973587
0.0806307
0.0560176
0.0237776
0.00147886
-0.0335602
-21.4113
-14.4221
-10.0329
-6.94242
-4.78947
-3.29536
-2.24385
-1.50643
-0.994175
-0.644003
-0.409745
-0.257372
-0.161898
-0.10517
-0.074155
-0.0596211
-0.0550809
-0.0560146
-0.0592302
-0.0625034
-0.064172
-0.0631628
-0.0585278
-0.0500322
-0.0372161
-0.0208662
-0.000817694
0.0207099
0.0438016
0.0645267
0.0835474
0.0960029
0.103891
0.103066
0.0954862
0.0792207
0.0552021
0.0239347
0.00236411
-0.0316093
-21.812
-14.7586
-10.3079
-7.16887
-4.96358
-3.42853
-2.3468
-1.58618
-1.05626
-0.692685
-0.448216
-0.288
-0.186443
-0.124948
-0.0901588
-0.0726104
-0.0656451
-0.0646174
-0.0662436
-0.068231
-0.0688632
-0.0670245
-0.0617387
-0.0527414
-0.0395585
-0.022949
-0.00275466
0.0188459
0.0419076
0.0625846
0.0814852
0.0939054
0.101738
0.101054
0.0936467
0.0778505
0.0544129
0.0241187
0.00322089
-0.0296792
-22.2165
-15.1025
-10.5892
-7.40277
-5.14434
-3.56631
-2.45296
-1.66814
-1.11976
-0.742176
-0.487084
-0.318753
-0.210944
-0.144587
-0.10598
-0.0854043
-0.0760213
-0.0730515
-0.0731138
-0.0738434
-0.0734675
-0.0708267
-0.0649148
-0.0554372
-0.041905
-0.0250491
-0.00471744
0.0169522
0.0399852
0.0606206
0.0794117
0.0918097
0.0996014
0.0990696
0.0918404
0.0765187
0.0536483
0.0243257
0.00404693
-0.0277733
-22.627
-15.4544
-10.875
-7.64236
-5.33107
-3.70857
-2.56239
-1.75244
-1.1848
-0.792597
-0.526443
-0.349706
-0.235461
-0.164135
-0.121653
-0.0980299
-0.0862305
-0.081333
-0.0798532
-0.0793499
-0.077992
-0.0745742
-0.0680594
-0.0581214
-0.0442562
-0.0271662
-0.00670501
0.0150308
0.038037
0.0586374
0.0773299
0.0897183
0.0974812
0.0971124
0.0900676
0.0752241
0.0529068
0.0245521
0.00484028
-0.0258944
-23.0438
-15.8122
-11.1617
-7.88543
-5.52331
-3.85542
-2.67522
-1.83922
-1.25151
-0.844058
-0.566387
-0.380933
-0.260052
-0.183634
-0.137213
-0.110514
-0.0962935
-0.0894778
-0.0864737
-0.0847595
-0.0824431
-0.0782717
-0.0711755
-0.0607959
-0.0466131
-0.0293001
-0.00871625
0.0130835
0.0360655
0.0566379
0.0752425
0.0876333
0.0953796
0.0951835
0.0883281
0.0739655
0.0521868
0.0247943
0.00559927
-0.0240454
-23.464
-16.1734
-11.4498
-8.1343
-5.72361
-4.00859
-2.79233
-1.92893
-1.32017
-0.89673
-0.60703
-0.412516
-0.284776
-0.203132
-0.152696
-0.122884
-0.10623
-0.0975013
-0.092987
-0.0900807
-0.0868271
-0.0819236
-0.074266
-0.0634622
-0.0489761
-0.0314504
-0.0107499
0.0111123
0.0340733
0.0546249
0.0731521
0.0855571
0.0932981
0.0932834
0.0866221
0.0727415
0.0514867
0.025049
0.00632253
-0.0222288
-23.8852
-16.5482
-11.7538
-8.39987
-5.93876
-4.1719
-2.91572
-2.02264
-1.39137
-0.950964
-0.648582
-0.444587
-0.309723
-0.222689
-0.168143
-0.13517
-0.116064
-0.10542
-0.0994051
-0.0953226
-0.0911505
-0.0855341
-0.0773337
-0.066122
-0.0513456
-0.0336167
-0.0128047
0.00911916
0.0320627
0.052601
0.0710614
0.0834916
0.0912383
0.0914127
0.0849494
0.071551
0.0508051
0.0253133
0.00700898
-0.0204467
-24.3197
-16.9641
-12.0927
-8.69012
-6.17186
-4.34708
-3.04659
-2.1212
-1.46574
-1.00718
-0.691321
-0.477329
-0.335012
-0.242387
-0.183612
-0.147412
-0.125823
-0.113255
-0.105743
-0.100496
-0.0954206
-0.0891085
-0.0803818
-0.068777
-0.0537224
-0.0357987
-0.0148797
0.00710589
0.0300362
0.0505688
0.0689728
0.0814387
0.0892013
0.0895719
0.0833099
0.0703927
0.0501408
0.0255842
0.00765779
-0.0187013
-24.7914
-17.4253
-12.4467
-8.98076
-6.40618
-4.52536
-3.18076
-2.22275
-1.54249
-1.06511
-0.735187
-0.51076
-0.360686
-0.262268
-0.199139
-0.159639
-0.135529
-0.121023
-0.112014
-0.10561
-0.0996443
-0.0926514
-0.0834135
-0.0714291
-0.0561073
-0.0379961
-0.0169736
0.00507424
0.0279959
0.0485308
0.0668885
0.0794002
0.0871884
0.0877611
0.0817033
0.0692655
0.0494924
0.0258592
0.00826842
-0.0169942
-25.2735
-17.8454
-12.7297
-9.21233
-6.60748
-4.68825
-3.30802
-2.3215
-1.61845
-1.12302
-0.779249
-0.544376
-0.386468
-0.282179
-0.214638
-0.171802
-0.145155
-0.128706
-0.118206
-0.110656
-0.103815
-0.0961575
-0.0864241
-0.0740741
-0.0584964
-0.0402056
-0.0190835
0.00302704
0.0259445
0.046489
0.0648103
0.0773771
0.0852003
0.0859805
0.0801292
0.0681681
0.0488589
0.0261363
0.00884081
-0.015327
-25.6474
-18.1265
-12.9066
-9.38157
-6.77979
-4.83811
-3.42845
-2.4166
-1.69264
-1.18012
-0.822905
-0.577753
-0.412072
-0.301927
-0.229977
-0.183811
-0.154636
-0.136259
-0.124285
-0.115609
-0.107913
-0.0996096
-0.089399
-0.0766996
-0.0608792
-0.0424184
-0.0212024
0.00096971
0.0238859
0.0444464
0.0627402
0.0753707
0.0832374
0.0842297
0.078587
0.0670991
0.0482394
0.0264134
0.00937529
-0.0137007
-25.9374
-18.482
-13.2128
-9.66583
-7.03535
-5.04109
-3.5804
-2.53014
-1.77769
-1.24362
-0.870323
-0.613337
-0.438961
-0.322412
-0.245725
-0.196034
-0.164217
-0.143849
-0.130367
-0.120551
-0.111997
-0.103052
-0.0923715
-0.07933
-0.0632733
-0.044646
-0.0233361
-0.00109895
0.0218228
0.0424077
0.0606835
0.0733855
0.0813028
0.0825101
0.0770766
0.0660571
0.0476314
0.0266869
0.00987029
-0.0121175
-26.6413
-19.4468
-14.0214
-10.2924
-7.51064
-5.38412
-3.82064
-2.69861
-1.89679
-1.32828
-0.930961
-0.657251
-0.471162
-0.34633
-0.263724
-0.209755
-0.174813
-0.15214
-0.136949
-0.125861
-0.116363
-0.106721
-0.0955315
-0.0821182
-0.0657985
-0.0469783
-0.0255461
-0.00321491
0.0197407
0.040373
0.0586483
0.0714314
0.0794053
0.0808279
0.0756009
0.0650423
0.047032
0.0269495
0.0103192
-0.010581
-27.9104
-20.8051
-15.045
-11.0126
-8.03775
-5.76907
-4.09313
-2.88954
-2.0313
-1.42351
-0.99875
-0.705965
-0.506594
-0.372439
-0.283224
-0.224519
-0.186146
-0.160965
-0.143929
-0.131482
-0.120984
-0.110609
-0.0988852
-0.0850801
-0.0684777
-0.0494425
-0.0278623
-0.00540862
0.01761
0.0383164
0.0566135
0.0694944
0.077537
0.0791818
0.0741628
0.0640602
0.0464479
0.0272076
0.010727
-0.00908922
-27.6423
-20.6787
-14.9073
-10.8882
-7.999
-5.79028
-4.13082
-2.92767
-2.06642
-1.45363
-1.02321
-0.725321
-0.521749
-0.384264
-0.292468
-0.231783
-0.191896
-0.165557
-0.147638
-0.134522
-0.123533
-0.112809
-0.100861
-0.0869268
-0.0702851
-0.0512633
-0.0297599
-0.00738245
0.0155326
0.0362117
0.0544842
0.0674704
0.0756121
0.0775127
0.0727357
0.0631088
0.0459117
0.0275274
0.0111692
-0.00760738
-24.7846
-18.8798
-13.544
-9.90244
-7.3736
-5.41414
-3.89673
-2.77853
-1.9719
-1.3929
-0.982776
-0.697364
-0.50174
-0.36949
-0.281285
-0.223158
-0.185137
-0.160173
-0.143273
-0.130922
-0.120546
-0.11036
-0.098964
-0.085627
-0.0696916
-0.0514465
-0.0308268
-0.00927723
0.0128718
0.0330999
0.0511262
0.0642336
0.0725905
0.0749476
0.0706335
0.0617651
0.0452618
0.0281738
0.0119899
-0.00548215
-21.8049
-17.0253
-12.3096
-9.05024
-6.83692
-5.11119
-3.73207
-2.69227
-1.93428
-1.38464
-0.990222
-0.712234
-0.519317
-0.38712
-0.297596
-0.237562
-0.197484
-0.170542
-0.151856
-0.137949
-0.126265
-0.115007
-0.10278
-0.0888219
-0.0724923
-0.0540227
-0.0333865
-0.0119196
0.0099907
0.0300145
0.0477844
0.060832
0.069166
0.0718008
0.0678351
0.0597576
0.0439968
0.028487
0.0124897
-0.00305393
-19.1834
-15.3814
-11.2835
-8.33366
-6.35077
-4.81959
-3.56891
-2.60251
-1.88996
-1.36965
-0.992477
-0.723649
-0.535027
-0.404175
-0.314259
-0.252904
-0.211085
-0.182289
-0.161812
-0.146269
-0.133153
-0.120674
-0.107451
-0.0926995
-0.075797
-0.0569283
-0.0361088
-0.0145912
0.00717138
0.0270142
0.0445055
0.0574312
0.0656841
0.0685459
0.0649025
0.0576087
0.0425834
0.0286679
0.0128248
-0.000696123
-16.696
-13.7377
-10.2919
-7.67987
-5.89845
-4.53451
-3.40636
-2.51336
-1.84496
-1.35316
-0.993179
-0.733504
-0.549155
-0.419704
-0.329518
-0.267002
-0.223616
-0.193132
-0.171012
-0.153959
-0.139517
-0.12591
-0.111777
-0.0963186
-0.0789326
-0.0597598
-0.0388542
-0.0173772
0.00416434
0.0237831
0.0409861
0.0538066
0.0620149
0.0651412
0.0618693
0.0553936
0.0411404
0.0288306
0.0131094
0.00162347
-14.4205
-12.1484
-9.31334
-7.03586
-5.44023
-4.22877
-3.22348
-2.41034
-1.7903
-1.32962
-0.989151
-0.740401
-0.561449
-0.4341
-0.344076
-0.280654
-0.235851
-0.203769
-0.180062
-0.161534
-0.14579
-0.131076
-0.116056
-0.0999176
-0.0820827
-0.0626484
-0.0417036
-0.0203127
0.000973555
0.0203508
0.0372684
0.0499989
0.0581929
0.0616091
0.0587508
0.0531111
0.0396629
0.0289426
0.0133223
0.00386257
-12.3531
-10.6158
-8.32986
-6.39754
-4.99323
-3.92186
-3.03165
-2.29912
-1.72939
-1.30087
-0.981062
-0.744434
-0.571805
-0.447227
-0.357847
-0.293851
-0.247849
-0.214309
-0.189101
-0.16915
-0.152132
-0.136328
-0.120429
-0.103618
-0.0853406
-0.065655
-0.044681
-0.0233884
-0.00236407
0.0167667
0.0334047
0.0460509
0.0542509
0.0579681
0.0555574
0.0507549
0.0381409
0.0289671
0.0134431
0.00597369
-10.5157
-9.19303
-7.37777
-5.76833
-4.54959
-3.60881
-2.82782
-2.17729
-1.66104
-1.26658
-0.968749
-0.745447
-0.580075
-0.458927
-0.370664
-0.306431
-0.259465
-0.224626
-0.198024
-0.176722
-0.158479
-0.141616
-0.124861
-0.107394
-0.0886881
-0.0687653
-0.0477727
-0.0265899
-0.0058318
0.0130483
0.029414
0.0419802
0.0502071
0.0542323
0.0523031
0.0483283
0.0365793
0.0288841
0.0134723
0.00791627
-8.90719
-7.89519
-6.46603
-5.15044
-4.11604
-3.30174
-2.62235
-2.05035
-1.58779
-1.22806
-0.952777
-0.743567
-0.586214
-0.469093
-0.3824
-0.318267
-0.270578
-0.234612
-0.206736
-0.184167
-0.16476
-0.146883
-0.129303
-0.111209
-0.0920954
-0.0719566
-0.0509613
-0.0299038
-0.00941686
0.00920869
0.0253122
0.0378043
0.0460813
0.0504196
0.0490062
0.0458392
0.0349883
0.0286781
0.0134194
0.00965201
-7.51139
-6.73432
-5.6187
-4.56068
-3.69857
-3.00283
-2.41709
-1.91951
-1.51028
-1.18587
-0.933594
-0.738986
-0.590237
-0.477662
-0.392954
-0.329248
-0.281085
-0.244174
-0.215159
-0.191422
-0.170921
-0.152084
-0.13372
-0.115033
-0.0955388
-0.0752095
-0.0542289
-0.0333126
-0.0131
0.00526896
0.0211235
0.033548
0.0418997
0.0465531
0.0456879
0.0432982
0.0333787
0.0283356
0.0132974
0.0111445
-6.31309
-5.71456
-4.84874
-4.00873
-3.30292
-2.71834
-2.21915
-1.79025
-1.4316
-1.14163
-0.91205
-0.732099
-0.592274
-0.484633
-0.402265
-0.339286
-0.290893
-0.253228
-0.223217
-0.198421
-0.176909
-0.157176
-0.138077
-0.118837
-0.0989938
-0.0785014
-0.0575532
-0.0367928
-0.0168548
0.00125812
0.0168796
0.0292438
0.0376938
0.042661
0.0423723
0.0407191
0.0317626
0.027847
0.0131231
0.0123623
-5.29726
-4.83506
-4.16688
-3.50769
-2.93853
-2.45402
-2.03251
-1.66542
-1.3535
-1.09638
-0.888864
-0.723344
-0.592524
-0.49006
-0.410308
-0.348318
-0.299922
-0.261692
-0.230837
-0.2051
-0.182669
-0.162112
-0.142336
-0.122588
-0.102431
-0.0818041
-0.0609057
-0.0403137
-0.0206478
-0.00278756
0.0126187
0.0249305
0.0335007
0.0387773
0.0390863
0.0381208
0.0301536
0.0272092
0.0129158
0.0132824
-4.45097
-4.09293
-3.5796
-3.06654
-2.61215
-2.21454
-1.86133
-1.54883
-1.27884
-1.0519
-0.865076
-0.713322
-0.591295
-0.494065
-0.417104
-0.356309
-0.308113
-0.269497
-0.237949
-0.211396
-0.188146
-0.166845
-0.146454
-0.126249
-0.105815
-0.0850836
-0.064251
-0.0438375
-0.0244379
-0.00682382
0.00838688
0.0206548
0.0293634
0.0349423
0.0358607
0.0355279
0.0285665
0.0264275
0.0126955
0.013894
-3.76179
-3.48235
-3.08849
-2.69047
-2.32908
-2.004
-1.70881
-1.44308
-1.20952
-1.00946
-0.841526
-0.702584
-0.588917
-0.496816
-0.422713
-0.363256
-0.315425
-0.276586
-0.244492
-0.217248
-0.193284
-0.171325
-0.150386
-0.129778
-0.109107
-0.0882991
-0.0675464
-0.0473177
-0.0281753
-0.0107973
0.0042383
0.0164715
0.0253321
0.0312034
0.0327304
0.0329718
0.0270175
0.0255171
0.01248
0.0142012
-3.21524
-2.99383
-2.6902
-2.38014
-2.09134
-1.82444
-1.57682
-1.35002
-1.14727
-0.970403
-0.819148
-0.691754
-0.58578
-0.498528
-0.427233
-0.369182
-0.321838
-0.282916
-0.250411
-0.222599
-0.198027
-0.175499
-0.154085
-0.133129
-0.11226
-0.0914024
-0.0707408
-0.0506985
-0.0318005
-0.0146446
0.000236871
0.0124448
0.0214649
0.0276157
0.0297358
0.0304914
0.0255254
0.0245048
0.0122832
0.0142251
-2.79374
-2.61415
-2.37689
-2.13204
-1.89794
-1.676
-1.46606
-1.27066
-1.09316
-0.935681
-0.798674
-0.681364
-0.58225
-0.499428
-0.430784
-0.374135
-0.327352
-0.288454
-0.255658
-0.227395
-0.20232
-0.179313
-0.157496
-0.136249
-0.11522
-0.0943372
-0.0737736
-0.0539138
-0.0352431
-0.0182912
-0.0035429
0.00864893
0.0178292
0.0242429
0.0269244
0.0281338
0.0241124
0.023429
0.0121138
0.0140051
-2.47768
-2.32758
-2.13778
-1.93976
-1.74553
-1.55719
-1.3761
-1.20521
-1.04776
-0.905957
-0.78071
-0.671896
-0.578678
-0.49975
-0.433503
-0.378175
-0.331975
-0.293179
-0.260193
-0.231585
-0.206106
-0.182708
-0.160561
-0.139077
-0.117926
-0.0970367
-0.076573
-0.0568854
-0.0384203
-0.0216504
-0.00701438
0.00516969
0.0145034
0.0211585
0.024353
0.0259554
0.0228066
0.0223403
0.011976
0.0135973
-2.24766
-2.11798
-1.96112
-1.79566
-1.62958
-1.46553
-1.30577
-1.15333
-1.01122
-0.881612
-0.765687
-0.663734
-0.575369
-0.499708
-0.435521
-0.381368
-0.335724
-0.297072
-0.263974
-0.235112
-0.209324
-0.185619
-0.163212
-0.141545
-0.120304
-0.0994224
-0.0790541
-0.0595216
-0.0412353
-0.0246213
-0.0100768
0.00210622
0.0115792
0.0184474
0.0220897
0.0240222
0.0216442
0.0213009
0.0118704
0.0130721
-2.08708
-1.97115
-1.83626
-1.69257
-1.54558
-1.39834
-1.25363
-1.11441
-0.98345
-0.862849
-0.753913
-0.657186
-0.572576
-0.499486
-0.436952
-0.383769
-0.338607
-0.300107
-0.266952
-0.237916
-0.211902
-0.187971
-0.165371
-0.143569
-0.122267
-0.101401
-0.0811172
-0.061715
-0.0435748
-0.0270862
-0.0126122
-0.000426028
0.00916411
0.0162091
0.0202173
0.022412
0.0206728
0.0203828
0.0118009
0.0125058
-1.98371
-1.87647
-1.75521
-1.62503
-1.49001
-1.35351
-1.21854
-1.08799
-0.964415
-0.849848
-0.745653
-0.652516
-0.570517
-0.499239
-0.437886
-0.38541
-0.340611
-0.302239
-0.269062
-0.239917
-0.213754
-0.18967
-0.166941
-0.14505
-0.123711
-0.102863
-0.0826438
-0.0633386
-0.0453051
-0.0289068
-0.0144819
-0.00229127
0.00738643
0.0145608
0.0188382
0.0212143
0.0199599
0.019656
0.0118003
0.0119651
-1.93149
-1.82853
-1.71401
-1.59051
-1.46146
-1.33035
-1.20032
-1.07419
-0.954419
-0.842981
-0.741262
-0.650013
-0.569398
-0.499087
-0.438371
-0.386279
-0.341682
-0.303385
-0.2702
-0.241001
-0.214762
-0.190599
-0.167802
-0.145866
-0.12451
-0.103674
-0.0834924
-0.0642417
-0.0462671
-0.0299184
-0.0155196
-0.00332648
0.00640158
0.0136439
0.0180794
0.020533
0.0195961
0.0191817
0.0119325
0.0115248
-28.5899
-28.5358
-28.4713
-28.3969
-28.3117
-28.2151
-28.1064
-27.9854
-27.8515
-27.7046
-27.5434
-27.3682
-27.1757
-26.9679
-26.7344
-26.4831
-26.1803
-25.871
-25.4955
-25.5303
-24.4159
-24.3444
-24.2664
-24.1826
-24.0923
-23.9949
-23.8901
-23.7781
-23.6584
-23.5311
-23.3951
-23.2508
-23.0948
-22.9286
-22.7429
-22.5491
-22.3276
-22.1485
-21.9882
-22.1965
-20.8184
-20.7414
-20.6619
-20.5804
-20.4965
-20.4101
-20.3211
-20.2298
-20.1361
-20.0402
-19.9415
-19.8408
-19.7363
-19.6312
-19.5219
-19.4203
-19.3136
-19.2402
-19.164
-19.3181
-17.7031
-17.6311
-17.5587
-17.4863
-17.4137
-17.341
-17.2682
-17.1956
-17.1233
-17.0515
-16.9802
-16.9101
-16.8406
-16.7734
-16.7049
-16.6392
-16.5641
-16.5041
-16.4509
-16.5904
-15.0288
-14.9653
-14.9023
-14.8401
-14.7786
-14.718
-14.6583
-14.5999
-14.5429
-14.4875
-14.4338
-14.3821
-14.3317
-14.2831
-14.2345
-14.1895
-14.1448
-14.1198
-14.1127
-14.243
-12.7464
-12.6921
-12.6386
-12.5861
-12.5347
-12.4845
-12.4358
-12.3886
-12.3433
-12.3
-12.2589
-12.2202
-12.1841
-12.1513
-12.1218
-12.0978
-12.0772
-12.0693
-12.0729
-12.1708
-10.8024
-10.7572
-10.7128
-10.6693
-10.627
-10.5859
-10.5461
-10.508
-10.4718
-10.4377
-10.4059
-10.3767
-10.3504
-10.3272
-10.307
-10.2906
-10.2768
-10.2716
-10.2769
-10.3492
-9.14663
-9.10986
-9.07372
-9.03832
-9.00378
-8.97023
-8.93784
-8.90683
-8.87738
-8.84967
-8.82392
-8.80033
-8.77903
-8.76028
-8.74416
-8.73135
-8.72173
-8.71879
-8.72417
-8.77419
-7.73657
-7.70734
-7.67843
-7.64994
-7.62196
-7.59461
-7.56804
-7.54243
-7.51794
-7.49472
-7.47298
-7.45291
-7.43469
-7.41856
-7.40469
-7.39345
-7.38483
-7.3806
-7.38218
-7.41289
-6.54121
-6.51844
-6.49564
-6.47288
-6.45025
-6.42783
-6.40578
-6.38423
-6.36332
-6.3432
-6.32404
-6.30601
-6.28924
-6.27393
-6.26023
-6.24836
-6.23844
-6.23146
-6.2286
-6.24402
-5.53888
-5.52142
-5.50356
-5.48537
-5.4669
-5.44826
-5.42954
-5.41088
-5.39239
-5.37419
-5.35643
-5.33925
-5.32277
-5.30716
-5.29257
-5.27916
-5.26709
-5.25684
-5.2493
-5.25244
-4.71263
-4.69932
-4.68528
-4.67055
-4.65519
-4.63929
-4.62294
-4.60623
-4.58926
-4.57216
-4.55501
-4.53797
-4.52114
-4.50464
-4.48861
-4.47319
-4.45849
-4.44478
-4.43266
-4.4263
-4.04587
-4.03564
-4.02441
-4.01221
-3.99909
-3.98513
-3.9704
-3.95498
-3.93896
-3.92244
-3.90549
-3.88825
-3.87079
-3.85324
-3.8357
-3.81827
-3.80108
-3.78426
-3.76817
-3.75491
-3.51984
-3.5118
-3.50257
-3.49216
-3.48064
-3.46804
-3.45445
-3.43993
-3.42455
-3.40839
-3.39154
-3.37407
-3.35609
-3.33767
-3.31891
-3.29991
-3.28075
-3.26153
-3.2424
-3.22458
-3.11373
-3.1072
-3.09936
-3.09022
-3.07984
-3.06825
-3.05552
-3.0417
-3.02685
-3.01105
-2.99435
-2.97685
-2.95861
-2.93971
-2.92023
-2.90025
-2.87985
-2.8591
-2.83802
-2.81754
-2.80668
-2.80119
-2.79432
-2.7861
-2.77658
-2.76578
-2.75375
-2.74054
-2.72622
-2.71083
-2.69445
-2.67713
-2.65894
-2.63996
-2.62024
-2.59986
-2.5789
-2.5574
-2.53535
-2.51353
-2.58
-2.57521
-2.56903
-2.5615
-2.55263
-2.54246
-2.53104
-2.5184
-2.5046
-2.48969
-2.47371
-2.45674
-2.43883
-2.42005
-2.40044
-2.38009
-2.35905
-2.33737
-2.31505
-2.29268
-2.41913
-2.41482
-2.40914
-2.40211
-2.39376
-2.38411
-2.3732
-2.36107
-2.34776
-2.33332
-2.3178
-2.30124
-2.2837
-2.26524
-2.24591
-2.22577
-2.20488
-2.1833
-2.16102
-2.13845
-2.31384
-2.30984
-2.30449
-2.29782
-2.28984
-2.28058
-2.27006
-2.25834
-2.24543
-2.23138
-2.21624
-2.20005
-2.18285
-2.16471
-2.14566
-2.12577
-2.10508
-2.08365
-2.06151
-2.03884
-2.26044
-2.25663
-2.2515
-2.24508
-2.23737
-2.2284
-2.21819
-2.20677
-2.19418
-2.18043
-2.16558
-2.14965
-2.13268
-2.11472
-2.09582
-2.07601
-2.05534
-2.03386
-2.01162
-1.98867
-28.0687
-28.3526
-27.7062
-27.876
-28.1136
-28.1523
-28.1774
-28.2468
-28.3191
-28.3799
-28.4376
-28.495
-28.5481
-28.5932
-28.6287
-28.6539
-28.6677
-28.6691
-28.6572
-28.631
-25.5672
-25.7213
-24.4766
-24.2545
-24.5057
-24.5514
-24.4804
-24.4696
-24.5065
-24.54
-24.5626
-24.5829
-24.6014
-24.6137
-24.617
-24.6105
-24.5939
-24.5666
-24.5282
-24.478
-22.6229
-22.6678
-21.2648
-20.8528
-21.1303
-21.2806
-21.2205
-21.1667
-21.1781
-21.201
-21.205
-21.1961
-21.1826
-21.1644
-21.1387
-21.1047
-21.0626
-21.0128
-20.9554
-20.8905
-19.6048
-19.6793
-18.3574
-17.877
-18.1334
-18.3522
-18.3282
-18.2461
-18.219
-18.2207
-18.2092
-18.1799
-18.1431
-18.1038
-18.0609
-18.0128
-17.9595
-17.9015
-17.8393
-17.773
-16.8232
-16.9682
-15.8505
-15.3566
-15.5364
-15.7551
-15.7573
-15.6645
-15.6035
-15.5802
-15.5569
-15.5187
-15.4719
-15.4234
-15.3742
-15.3229
-15.2687
-15.2118
-15.1527
-15.0916
-14.3673
-14.5371
-13.6528
-13.1921
-13.2811
-13.4538
-13.4674
-13.3827
-13.3079
-13.268
-13.2379
-13.1995
-13.1532
-13.1048
-13.0567
-13.0081
-12.9583
-12.9069
-12.8542
-12.8006
-12.2057
-12.3523
-11.6785
-11.2885
-11.3122
-11.4285
-11.4427
-11.3763
-11.3065
-11.2619
-11.2299
-11.1951
-11.1544
-11.1114
-11.0684
-11.0256
-10.9822
-10.938
-10.8932
-10.8479
-10.2937
-10.4017
-9.90174
-9.59818
-9.59125
-9.6628
-9.67266
-9.62519
-9.56975
-9.52957
-9.49973
-9.46996
-9.43662
-9.40112
-9.36529
-9.32959
-9.29369
-9.25737
-9.22064
-9.18368
-8.6106
-8.68789
-8.32875
-8.10784
-8.09297
-8.1358
-8.14135
-8.1092
-8.06954
-8.03817
-8.01359
-7.98979
-7.96401
-7.93664
-7.90873
-7.88072
-7.85251
-7.82396
-7.79506
-7.76589
-7.15249
-7.21245
-6.9659
-6.81409
-6.80108
-6.82731
-6.83078
-6.81051
-6.78475
-6.76324
-6.74556
-6.7284
-6.71007
-6.69059
-6.67047
-6.64999
-6.62913
-6.6078
-6.586
-6.56379
-5.91707
-5.96843
-5.80954
-5.7118
-5.70387
-5.7214
-5.72525
-5.71468
-5.70045
-5.68822
-5.67781
-5.66743
-5.65612
-5.64383
-5.6308
-5.61714
-5.60283
-5.58784
-5.57216
-5.55583
-4.89768
-4.94385
-4.85043
-4.7936
-4.79189
-4.80583
-4.81185
-4.80938
-4.80448
-4.80023
-4.79649
-4.79232
-4.78719
-4.78106
-4.774
-4.76606
-4.75722
-4.74744
-4.73674
-4.72513
-4.08283
-4.12466
-4.07736
-4.05015
-4.0547
-4.06812
-4.07701
-4.08096
-4.08317
-4.08519
-4.08689
-4.08779
-4.08761
-4.08632
-4.08392
-4.08042
-4.07578
-4.07001
-4.06309
-4.05504
-3.45376
-3.49139
-3.47414
-3.46681
-3.47657
-3.49083
-3.50237
-3.51093
-3.51808
-3.52452
-3.53017
-3.53477
-3.53818
-3.54035
-3.54128
-3.54094
-3.53931
-3.53639
-3.53216
-3.52664
-2.98345
-3.01688
-3.0175
-3.02236
-3.03575
-3.05107
-3.06455
-3.07604
-3.08627
-3.09553
-3.10374
-3.11075
-3.1165
-3.12093
-3.12403
-3.12578
-3.12614
-3.12512
-3.12271
-3.11891
-2.64091
-2.67033
-2.68069
-2.6924
-2.70795
-2.724
-2.73864
-2.75178
-2.76372
-2.77455
-2.78422
-2.79264
-2.79975
-2.80552
-2.80993
-2.81294
-2.81453
-2.81471
-2.81346
-2.81078
-2.39741
-2.42335
-2.43861
-2.45385
-2.47046
-2.48681
-2.50198
-2.51587
-2.52859
-2.54016
-2.55054
-2.55964
-2.56745
-2.57391
-2.57901
-2.58272
-2.58502
-2.5859
-2.58536
-2.58339
-2.23037
-2.25361
-2.27113
-2.28802
-2.30501
-2.32136
-2.33662
-2.35073
-2.3637
-2.37551
-2.38613
-2.39549
-2.40356
-2.41032
-2.41574
-2.41978
-2.42245
-2.42372
-2.42359
-2.42206
-2.12432
-2.14576
-2.16419
-2.18172
-2.19871
-2.21489
-2.23003
-2.24408
-2.25702
-2.2688
-2.2794
-2.28877
-2.29688
-2.3037
-2.30921
-2.31338
-2.31621
-2.31767
-2.31776
-2.31648
-2.0714
-2.0921
-2.11094
-2.12873
-2.14572
-2.1618
-2.17684
-2.1908
-2.20364
-2.21532
-2.22582
-2.2351
-2.24314
-2.2499
-2.25538
-2.25954
-2.26238
-2.2639
-2.26408
-2.26293
0.774502
0.765066
0.741834
0.701613
0.640595
0.552949
0.430416
0.261747
0.0321058
-0.277546
-0.690891
-1.23727
-1.9535
-2.888
-4.11638
-5.7439
-7.98856
-11.0674
-15.5257
-22.4809
0.683894
0.673862
0.650103
0.608923
0.546618
0.457482
0.333386
0.163271
-0.067489
-0.377737
-0.791046
-1.33663
-2.05128
-2.98231
-4.20198
-5.80846
-7.98233
-10.9752
-14.9782
-21.2122
0.59002
0.580132
0.556759
0.516051
0.454558
0.366934
0.245508
0.07983
-0.143939
-0.443656
-0.841672
-1.36543
-2.04909
-2.93448
-4.08246
-5.57638
-7.52639
-10.2248
-13.4773
-18.6787
0.492918
0.483031
0.459817
0.419469
0.358805
0.272937
0.154801
-0.00520331
-0.219776
-0.505309
-0.882284
-1.37561
-2.01551
-2.83807
-3.88682
-5.24012
-6.90803
-9.24626
-11.8379
-16.007
0.393052
0.38311
0.359973
0.319931
0.260044
0.175875
0.0609889
-0.0933215
-0.298516
-0.569363
-0.924196
-1.38535
-1.97821
-2.73613
-3.67997
-4.9007
-6.31046
-8.29842
-10.467
-13.7097
0.290986
0.28106
0.258128
0.218624
0.159833
0.0777686
-0.0333671
-0.181388
-0.376484
-0.631789
-0.963276
-1.39112
-1.93466
-2.62884
-3.46856
-4.56522
-5.77604
-7.43286
-9.33249
-11.8378
0.187372
0.17755
0.155001
0.116342
0.0590948
-0.0202584
-0.12685
-0.267574
-0.451296
-0.689537
-0.995596
-1.38817
-1.87916
-2.50795
-3.2476
-4.21538
-5.28021
-6.627
-8.28635
-10.2524
0.0829706
0.0733366
0.0513405
0.0138195
-0.0414542
-0.117525
-0.218829
-0.351327
-0.522492
-0.742298
-1.02107
-1.37646
-1.81306
-2.37212
-3.02009
-3.84764
-4.79121
-5.86579
-7.26435
-8.83047
-0.0213427
-0.0307082
-0.0519823
-0.0880869
-0.140995
-0.213285
-0.308699
-0.432276
-0.5901
-0.790656
-1.04141
-1.35833
-1.74206
-2.22665
-2.7928
-3.47614
-4.29718
-5.153
-6.28513
-7.52885
-0.124582
-0.1336
-0.153989
-0.188416
-0.238602
-0.306684
-0.395737
-0.509923
-0.654052
-0.835045
-1.05838
-1.33634
-1.67135
-2.08014
-2.57055
-3.12106
-3.81084
-4.49835
-5.38718
-6.3559
-0.225663
-0.234261
-0.253614
-0.286132
-0.333294
-0.396827
-0.4792
-0.583735
-0.714219
-0.875791
-1.07325
-1.31319
-1.60372
-1.94168
-2.3582
-2.79902
-3.35799
-3.91142
-4.59616
-5.33271
-0.323413
-0.331528
-0.349721
-0.380147
-0.424059
-0.482815
-0.55836
-0.653228
-0.770458
-0.913327
-1.08673
-1.29162
-1.54084
-1.8185
-2.16359
-2.5191
-2.96069
-3.40148
-3.92349
-4.47251
-0.416592
-0.424176
-0.441118
-0.469329
-0.50986
-0.563748
-0.632498
-0.717957
-0.822578
-0.948111
-1.0993
-1.27376
-1.48477
-1.71434
-1.99491
-2.28381
-2.62876
-2.97504
-3.37105
-3.77585
-0.5039
-0.510924
-0.526568
-0.552516
-0.589641
-0.63872
-0.700892
-0.777465
-0.870352
-0.980389
-1.11145
-1.26054
-1.4377
-1.62952
-1.8562
-2.09182
-2.36159
-2.6323
-2.93307
-3.23201
-0.583988
-0.590447
-0.604795
-0.628512
-0.662325
-0.706807
-0.7628
-0.831236
-0.913506
-1.01007
-1.12354
-1.2518
-1.40066
-1.56238
-1.74675
-1.93985
-2.15318
-2.36672
-2.59743
-2.82164
-0.655449
-0.661363
-0.674471
-0.696079
-0.726797
-0.767046
-0.817441
-0.878662
-0.95166
-1.0368
-1.13552
-1.24678
-1.37313
-1.51076
-1.66323
-1.82338
-1.99544
-2.1674
-2.34799
-2.5208
-0.716783
-0.722198
-0.734181
-0.753894
-0.781857
-0.818389
-0.863936
-0.919015
-0.984258
-1.05998
-1.1469
-1.24454
-1.3537
-1.47253
-1.60165
-1.73719
-1.8798
-2.02228
-2.16793
-2.30598
-0.766325
-0.771316
-0.782349
-0.800475
-0.826151
-0.859628
-0.901243
-0.951399
-1.01053
-1.07892
-1.15685
-1.24413
-1.34075
-1.44565
-1.55828
-1.67624
-1.79859
-1.92076
-2.04287
-2.158
-0.802113
-0.806785
-0.817107
-0.834053
-0.858042
-0.889284
-0.92805
-0.974674
-1.02948
-1.0927
-1.16446
-1.24459
-1.33282
-1.42834
-1.53023
-1.63666
-1.74607
-1.85524
-1.96267
-2.06366
-0.821671
-0.826166
-0.836092
-0.852374
-0.875422
-0.905428
-0.942631
-0.987327
-1.0398
-1.10024
-1.16871
-1.24505
-1.32891
-1.41953
-1.5159
-1.6164
-1.71928
-1.82186
-1.92201
-2.01614
1.91688
1.91392
1.90619
1.89113
1.86592
1.8259
1.7649
1.67492
1.54593
1.36558
1.11893
0.787367
0.346926
-0.23879
-1.02836
-2.13562
-3.71137
-6.09413
-9.58638
-15.0839
1.85534
1.85197
1.84312
1.82652
1.79924
1.75659
1.69234
1.59837
1.46447
1.27807
1.0239
0.682947
0.230931
-0.368955
-1.17448
-2.30019
-3.89564
-6.29932
-9.8302
-15.3765
1.7942
1.79043
1.78049
1.76238
1.73305
1.68781
1.62034
1.52241
1.38362
1.19116
0.929428
0.579
0.115273
-0.499044
-1.32102
-2.4658
-4.0823
-6.50841
-10.079
-15.6735
1.73351
1.72934
1.71834
1.69874
1.66741
1.61962
1.54897
1.4471
1.30344
1.1049
0.835583
0.475604
2.84658e-05
-0.62896
-1.46787
-2.6323
-4.2711
-6.72115
-10.3329
-15.9752
1.67329
1.66874
1.65671
1.63568
1.60238
1.55207
1.47829
1.37251
1.22399
1.01938
0.742431
0.372822
-0.114738
-0.758626
-1.61493
-2.79959
-4.46179
-6.9371
-10.5914
-16.2801
1.61358
1.60867
1.59566
1.57322
1.53801
1.48523
1.40834
1.29869
1.14534
0.934635
0.650024
0.270702
-0.228987
-0.887998
-1.76215
-2.9676
-4.65422
-7.15593
-10.8538
-16.5868
1.55442
1.54916
1.53521
1.51141
1.47433
1.41914
1.33919
1.2257
1.06752
0.850728
0.558408
0.169284
-0.342686
-1.01705
-1.90949
-3.13628
-4.84829
-7.37741
-11.12
-16.8939
1.49583
1.49025
1.47541
1.4503
1.4114
1.35384
1.27088
1.15358
0.990602
0.7677
0.467622
0.0686015
-0.455815
-1.14576
-2.05694
-3.30563
-5.04398
-7.60135
-11.39
-17.2007
1.43784
1.43196
1.4163
1.38992
1.34926
1.28938
1.20346
1.08239
0.914616
0.685593
0.3777
-0.0313221
-0.568365
-1.27413
-2.2045
-3.47565
-5.24127
-7.82751
-11.6641
-17.5064
1.38048
1.37434
1.3579
1.33032
1.28795
1.22581
1.13696
1.01216
0.839604
0.60444
0.288666
-0.130471
-0.680334
-1.40217
-2.35219
-3.64633
-5.44024
-8.05564
-11.9424
-17.8103
1.32378
1.3174
1.30025
1.27152
1.2275
1.16315
1.07143
0.942925
0.7656
0.52427
0.200542
-0.228837
-0.791733
-1.5299
-2.50006
-3.81771
-5.64101
-8.28541
-12.2251
-18.1117
1.26775
1.26116
1.24337
1.21356
1.16795
1.10145
1.0069
0.874726
0.692635
0.445108
0.11334
-0.326423
-0.902585
-1.65737
-2.64817
-3.9898
-5.84378
-8.51654
-12.5127
-18.4106
1.21242
1.20566
1.18731
1.15646
1.10934
1.04074
0.943409
0.807589
0.620733
0.366971
0.0270665
-0.423236
-1.01292
-1.78462
-2.79662
-4.16264
-6.04879
-8.74857
-12.8049
-18.7056
1.15779
1.15092
1.13207
1.10027
1.05168
0.98104
0.880976
0.741541
0.549917
0.289873
-0.058278
-0.519293
-1.12278
-1.91172
-2.9455
-4.33627
-6.25637
-8.98149
-13.1028
-18.9992
1.10389
1.09695
1.07769
1.04499
0.995
0.922382
0.81963
0.676604
0.480204
0.213822
-0.142699
-0.61462
-1.23221
-2.03872
-3.09493
-4.51073
-6.46667
-9.21466
-13.4037
-19.2881
1.05071
1.04375
1.02417
0.990645
0.93932
0.864779
0.759383
0.612791
0.411602
0.13882
-0.226207
-0.709248
-1.34127
-2.16572
-3.24504
-4.68622
-6.68022
-9.44998
-13.7104
-19.5848
0.998291
0.991376
0.971549
0.93727
0.884673
0.808258
0.700256
0.550113
0.344116
0.0648621
-0.308823
-0.803217
-1.45002
-2.29282
-3.39591
-4.86277
-6.89606
-9.68635
-14.0108
-19.8826
0.946644
0.939898
0.919972
0.885043
0.831258
0.753028
0.642442
0.488727
0.27785
-0.0080024
-0.390541
-0.89657
-1.55856
-2.42023
-3.54801
-5.042
-7.11708
-9.9364
-14.3218
-20.248
0.895756
0.889301
0.869444
0.834015
0.779187
0.69927
0.586185
0.428916
0.213081
-0.0795583
-0.471251
-0.989299
-1.66693
-2.54801
-3.7011
-5.22386
-7.34
-10.1984
-14.6113
-20.6839
0.84534
0.83869
0.818534
0.782283
0.726157
0.644389
0.528763
0.368033
0.147442
-0.151781
-0.55263
-1.08322
-1.77792
-2.68151
-3.86544
-5.42947
-7.6049
-10.5602
-15.0503
-21.5529
3.16317
3.16594
3.17659
3.19187
3.20871
3.22267
3.22827
3.21878
3.18618
3.12082
3.01039
2.8373
2.57338
2.16687
1.51851
0.498454
-0.994017
-3.21472
-6.82445
-11.8737
3.1028
3.10499
3.11458
3.12783
3.14183
3.15212
3.15312
3.13793
3.09823
3.02383
2.90164
2.71287
2.42762
1.99321
1.3088
0.22701
-1.36732
-3.65825
-7.26735
-12.4138
3.04226
3.04463
3.05392
3.06601
3.07819
3.08598
3.08387
3.06501
3.02116
2.94231
2.81587
2.62425
2.33969
1.91426
1.25683
0.225345
-1.29331
-3.42521
-6.74577
-11.8063
2.98126
2.98375
2.99269
3.00368
3.01417
3.01969
3.01475
2.99257
2.945
2.86225
2.73228
2.5388
2.25635
1.84142
1.21263
0.236386
-1.20948
-3.24267
-6.41958
-11.593
2.91981
2.92226
2.93064
2.94038
2.94901
2.95208
2.94408
2.91824
2.86641
2.77884
2.64366
2.44516
2.15891
1.74323
1.12151
0.161763
-1.28017
-3.3349
-6.50607
-11.7326
2.85798
2.8603
2.86801
2.87639
2.88307
2.88355
2.87235
2.84263
2.7862
2.69325
2.55184
2.3464
2.05283
1.62978
1.00221
0.0371875
-1.42954
-3.53495
-6.69106
-11.8564
2.79582
2.79797
2.80494
2.81192
2.81659
2.81446
2.80001
2.76637
2.70528
2.60683
2.459
2.24626
1.94482
1.51361
0.879018
-0.0899978
-1.5685
-3.69717
-6.80865
-11.9193
2.73337
2.73531
2.74148
2.74701
2.74965
2.74489
2.72719
2.68962
2.62386
2.51991
2.36567
2.14565
1.83651
1.3979
0.758335
-0.208446
-1.68262
-3.81858
-6.90125
-12.0042
2.67069
2.67237
2.67767
2.68172
2.6823
2.67488
2.6539
2.61239
2.54193
2.43243
2.2717
2.04425
1.7272
1.28114
0.636669
-0.327374
-1.79494
-3.94405
-7.02734
-12.1374
2.60781
2.6092
2.61358
2.61611
2.61459
2.60449
2.58021
2.53472
2.45951
2.34437
2.17699
1.94183
1.61636
1.16198
0.510798
-0.454443
-1.9204
-4.09106
-7.1902
-12.3023
2.54479
2.54585
2.54925
2.55023
2.54659
2.53379
2.50618
2.45668
2.37667
2.25583
2.08165
1.8385
1.50404
1.04036
0.380488
-0.590025
-2.05819
-4.25191
-7.37172
-12.4862
2.48166
2.48238
2.48476
2.48416
2.47837
2.46285
2.4319
2.37837
2.29353
2.1669
1.98581
1.73444
1.39054
0.916785
0.246902
-0.73143
-2.20308
-4.41759
-7.56236
-12.688
2.41849
2.41883
2.42015
2.41796
2.41001
2.39174
2.35745
2.29987
2.21017
2.07771
1.8896
1.62982
1.27613
0.791721
0.111006
-0.87676
-2.35265
-4.58619
-7.76164
-12.9084
2.3553
2.35526
2.3555
2.35169
2.34157
2.32055
2.2829
2.22126
2.12668
1.98833
1.79313
1.52478
1.16101
0.665426
-0.0267866
-1.02545
-2.50708
-4.75915
-7.97032
-13.1461
2.29217
2.29172
2.29084
2.28542
2.27311
2.24935
2.20833
2.14263
2.04315
1.89888
1.69649
1.41944
1.04531
0.538069
-0.166308
-1.17735
-2.66679
-4.93732
-8.18738
-13.3983
2.22912
2.22827
2.22625
2.21921
2.20472
2.17821
2.13383
2.06406
1.95967
1.80943
1.5998
1.31392
0.929183
0.409816
-0.307382
-1.33218
-2.83156
-5.12043
-8.41102
-13.6624
2.16621
2.16494
2.16178
2.15311
2.13645
2.1072
2.05946
1.98563
1.87632
1.7201
1.50315
1.20832
0.812778
0.280846
-0.44978
-1.48947
-3.00078
-5.30787
-8.63967
-13.9361
2.10349
2.10179
2.09748
2.0872
2.06837
2.0364
1.98531
1.90742
1.79318
1.63096
1.40665
1.10277
0.696229
0.151342
-0.593266
-1.64879
-3.17382
-5.49918
-8.87222
-14.2173
2.04099
2.03888
2.03342
2.02152
2.00054
1.96586
1.91146
1.82952
1.71035
1.5421
1.31038
0.997358
0.579662
0.0214685
-0.737638
-1.80976
-3.3502
-5.69411
-9.10785
-14.5038
1.97878
1.97624
1.96963
1.95615
1.93304
1.89567
1.83796
1.75199
1.62791
1.45361
1.21445
0.89219
0.463189
-0.108625
-0.882727
-1.97212
-3.52952
-5.89249
-9.346
-14.7933
5.29176
5.29712
5.30861
5.32662
5.35047
5.37894
5.4107
5.44449
5.47908
5.51332
5.54619
5.57686
5.60465
5.62905
5.64968
5.66618
5.67822
5.68537
5.68702
5.68233
5.26798
5.27369
5.28592
5.30511
5.33057
5.36101
5.39511
5.43155
5.46906
5.50644
5.54263
5.5767
5.6079
5.63561
5.65934
5.67861
5.69296
5.70183
5.70443
5.69976
5.224
5.23031
5.24383
5.26507
5.2933
5.32718
5.36532
5.40637
5.44897
5.49185
5.53382
5.57384
5.61102
5.64457
5.67379
5.698
5.71649
5.72848
5.7327
5.72805
5.16223
5.1693
5.18446
5.20832
5.24008
5.27835
5.32166
5.36857
5.41766
5.46754
5.5169
5.56456
5.60944
5.65054
5.68691
5.71756
5.74151
5.75765
5.76371
5.75908
5.08456
5.09247
5.10946
5.13621
5.17188
5.21498
5.26397
5.31733
5.37354
5.43111
5.4886
5.54467
5.59808
5.64757
5.69189
5.72973
5.75982
5.78043
5.78736
5.78209
4.99276
5.00152
5.02033
5.04998
5.08957
5.13749
5.19211
5.25184
5.31507
5.38019
5.44566
5.51001
5.5718
5.62954
5.68163
5.72638
5.76218
5.78604
5.79067
5.78249
4.88864
4.89817
4.91867
4.95101
4.99418
5.04647
5.10618
5.1716
5.24105
5.31282
5.38528
5.45683
5.52585
5.5906
5.649
5.69889
5.7381
5.76123
5.75712
5.74144
4.77413
4.78432
4.80624
4.84084
4.887
4.94288
5.00669
5.07662
5.1509
5.22773
5.30539
5.38216
5.45624
5.52549
5.58721
5.6385
5.67606
5.69058
5.66729
5.63685
4.65126
4.66193
4.68494
4.72124
4.76958
4.82801
4.89461
4.96748
5.04473
5.12445
5.20483
5.28402
5.35997
5.42993
5.49025
5.53692
5.56443
5.55784
5.4999
5.44395
4.52209
4.53307
4.55675
4.5941
4.64371
4.70347
4.77135
4.84532
4.92333
5.00336
5.08346
5.1616
5.2353
5.30094
5.35346
5.38711
5.3927
5.34737
5.23301
5.13581
4.38867
4.39975
4.42369
4.4614
4.5113
4.57112
4.63868
4.71178
4.78817
4.86566
4.94211
5.01521
5.08183
5.13702
5.1738
5.18396
5.15243
5.04533
4.84509
4.68396
4.25293
4.26392
4.2877
4.32511
4.37433
4.43295
4.4986
4.56884
4.6412
4.71323
4.78251
4.84631
4.90055
4.93838
4.95029
4.92471
4.83808
4.64083
4.31646
4.05954
4.11662
4.12735
4.15061
4.18707
4.23473
4.29098
4.35322
4.41874
4.48474
4.54844
4.60703
4.65717
4.69343
4.70631
4.68313
4.60865
4.44788
4.12801
3.6315
3.23524
3.98131
3.99163
4.01403
4.04901
4.09433
4.14717
4.20467
4.26377
4.3213
4.37402
4.4186
4.45096
4.46399
4.44466
4.37604
4.23881
3.98387
3.50566
2.7801
2.18829
3.84832
3.8581
3.87938
3.91243
3.95474
4.00331
4.05495
4.1062
4.15342
4.19281
4.22035
4.23098
4.2155
4.15617
4.03034
3.81596
3.45065
2.7829
1.76411
0.902225
3.71872
3.72786
3.74784
3.77859
3.8174
3.86101
3.90589
3.94814
3.98354
4.00766
4.01562
4.00121
3.95317
3.84844
3.65636
3.3514
2.85929
1.97029
0.587981
-0.634704
3.59338
3.60179
3.62032
3.64853
3.68346
3.72162
3.7591
3.79147
3.8139
3.82116
3.80735
3.76481
3.67984
3.52318
3.25295
2.83939
2.20758
1.08756
-0.714836
-2.41318
3.47296
3.48064
3.49766
3.52313
3.5539
3.58626
3.61589
3.63783
3.64654
3.63591
3.59893
3.52635
3.40228
3.19196
2.83969
2.3051
1.51672
0.149208
-2.134
-4.45171
3.35796
3.36507
3.38076
3.40346
3.42991
3.45615
3.47748
3.48836
3.48251
3.45286
3.391
3.28549
3.11724
2.84574
2.39974
1.71954
0.743307
-0.867904
-3.62607
-6.7091
3.24827
3.25439
3.26869
3.28865
3.31097
3.33142
3.34481
3.34496
3.32475
3.27598
3.18889
3.05002
2.83689
2.50288
1.95923
1.11241
-0.10835
-2.02187
-5.28108
-9.3705
5.67537
5.67193
5.66787
5.66327
5.65811
5.65238
5.64603
5.63907
5.63146
5.62319
5.61425
5.60462
5.59429
5.58323
5.57145
5.55893
5.54565
5.53161
5.5168
5.50122
5.69417
5.69055
5.68581
5.68053
5.67473
5.66831
5.66124
5.65351
5.6451
5.636
5.6262
5.61567
5.60442
5.59241
5.57965
5.56612
5.55181
5.53671
5.52083
5.50416
5.72597
5.72208
5.71608
5.70955
5.70257
5.69494
5.68662
5.6776
5.66787
5.65743
5.64627
5.63436
5.62172
5.60831
5.59414
5.5792
5.56348
5.54696
5.52966
5.51156
5.76437
5.7605
5.75296
5.74498
5.73671
5.72781
5.71817
5.70781
5.69673
5.68493
5.67239
5.6591
5.64506
5.63026
5.61468
5.59831
5.58115
5.56319
5.54442
5.52483
5.80005
5.79675
5.78784
5.77866
5.76941
5.75952
5.74884
5.7374
5.7252
5.71223
5.69847
5.68392
5.66855
5.65236
5.63534
5.61746
5.59873
5.57912
5.55862
5.53722
5.81793
5.81589
5.80637
5.79677
5.78716
5.77677
5.76546
5.75327
5.74019
5.7262
5.7113
5.69546
5.67868
5.66094
5.64223
5.62253
5.60183
5.5801
5.55735
5.53353
5.79688
5.79686
5.78823
5.77949
5.77044
5.76032
5.74901
5.73656
5.72295
5.70819
5.69227
5.67517
5.65688
5.63741
5.61672
5.59481
5.57167
5.54727
5.52161
5.49465
5.71375
5.71687
5.71108
5.70474
5.69748
5.68864
5.6782
5.66619
5.65262
5.63751
5.62085
5.60264
5.58289
5.56158
5.53871
5.51427
5.48824
5.46061
5.43136
5.40047
5.54489
5.55288
5.55202
5.54985
5.54587
5.53966
5.53126
5.52071
5.50803
5.49324
5.47637
5.45742
5.4364
5.4133
5.38814
5.3609
5.33157
5.30014
5.26658
5.23088
5.26517
5.28054
5.28696
5.29099
5.29217
5.2903
5.28544
5.27764
5.26695
5.2534
5.23703
5.21786
5.19591
5.17118
5.14369
5.11343
5.0804
5.04459
5.00597
4.96451
4.84679
4.87303
4.88933
4.90189
4.91038
4.91478
4.91517
4.91161
4.90419
4.89294
4.87793
4.85919
4.83674
4.81062
4.78084
4.74739
4.71029
4.66951
4.62505
4.57684
4.25987
4.30144
4.33014
4.35358
4.37152
4.3841
4.39142
4.39358
4.39067
4.38276
4.36992
4.35221
4.32967
4.30233
4.27022
4.23335
4.19172
4.14532
4.09413
4.03808
3.47478
3.53698
3.58008
3.61635
3.64537
3.6676
3.68311
3.69205
3.69452
3.69063
3.68044
3.66404
3.64147
3.61279
3.57803
3.53719
3.49029
3.43731
3.37821
3.31292
2.46597
2.55428
2.61243
2.66245
2.70309
2.73553
2.75969
2.77575
2.7838
2.78395
2.77629
2.7609
2.73785
2.70718
2.66893
2.6231
2.5697
2.50871
2.44006
2.36367
1.21037
1.33017
1.40302
1.46711
1.51895
1.56126
1.5935
1.6161
1.62909
1.63259
1.62669
1.61143
1.58688
1.55306
1.51
1.45771
1.3962
1.32541
1.24524
1.1556
-0.306629
-0.149738
-0.064935
0.010733
0.0704646
0.120253
0.158619
0.186239
0.202791
0.208358
0.202904
0.186473
0.159084
0.120756
0.0714904
0.0112813
-0.0599005
-0.142145
-0.235622
-0.340453
-2.1009
-1.90925
-1.82245
-1.73979
-1.67563
-1.62023
-1.57777
-1.54701
-1.52874
-1.52271
-1.52906
-1.54778
-1.57896
-1.62267
-1.67897
-1.74791
-1.82957
-1.92413
-2.03184
-2.15285
-4.23621
-3.99854
-3.90748
-3.81587
-3.75118
-3.69474
-3.65279
-3.62216
-3.60445
-3.59943
-3.60773
-3.62952
-3.6651
-3.7146
-3.77815
-3.85582
-3.94771
-4.05407
-4.17528
-4.31143
-6.64554
-6.36122
-6.29585
-6.22109
-6.17533
-6.12881
-6.09442
-6.06911
-6.05677
-6.05738
-6.07207
-6.10097
-6.14446
-6.20263
-6.27562
-6.36347
-6.46632
-6.58447
-6.71837
-6.86804
-9.56707
-9.25756
-9.22721
-9.15402
-9.10974
-9.06262
-9.03139
-9.01077
-9.00479
-9.01243
-9.03471
-9.07154
-9.12329
-9.19007
-9.27206
-9.36939
-9.48225
-9.61096
-9.75597
-9.91733
5.48486
5.46771
5.44978
5.43106
5.41155
5.39127
5.3702
5.34836
5.32575
5.30238
5.27826
5.25339
5.2278
5.20149
5.17448
5.14678
5.11841
5.08938
5.05969
5.02955
5.48668
5.46841
5.44934
5.42948
5.40884
5.38741
5.3652
5.34224
5.31853
5.29409
5.26893
5.24307
5.21654
5.18935
5.16154
5.13313
5.10415
5.07456
5.04435
5.01454
5.49266
5.47297
5.45247
5.43118
5.4091
5.38623
5.36259
5.33819
5.31303
5.28714
5.26053
5.23323
5.20526
5.17664
5.1474
5.1176
5.08724
5.05615
5.02428
4.99432
5.50441
5.48316
5.46109
5.43818
5.41445
5.38988
5.36449
5.33828
5.31127
5.28346
5.25488
5.22555
5.19548
5.1647
5.13325
5.10119
5.06848
5.03473
4.99996
4.96898
5.51491
5.49168
5.46753
5.44245
5.41643
5.38948
5.3616
5.33279
5.30306
5.27242
5.2409
5.20851
5.17527
5.1412
5.10638
5.07088
5.03458
4.99674
4.95757
4.92437
5.50865
5.4827
5.45566
5.42753
5.39829
5.36795
5.3365
5.30395
5.27031
5.23558
5.19979
5.16295
5.12507
5.08618
5.04638
5.00581
4.96414
4.92001
4.87376
4.83663
5.46638
5.4368
5.40589
5.37363
5.34002
5.30505
5.26872
5.23102
5.19195
5.15154
5.10977
5.06666
5.02219
4.9764
4.92947
4.88165
4.8322
4.77839
4.72067
4.67771
5.36791
5.33369
5.29778
5.26015
5.22081
5.17972
5.13689
5.09229
5.04593
4.9978
4.9479
4.8962
4.84265
4.78728
4.73054
4.67289
4.61266
4.54438
4.46863
4.41797
5.193
5.15296
5.11071
5.06623
5.01949
4.97048
4.91917
4.86554
4.80956
4.75124
4.69054
4.62738
4.56159
4.49333
4.42359
4.35328
4.27877
4.18932
4.08606
4.02599
4.92018
4.873
4.82291
4.76989
4.71389
4.65488
4.59282
4.52767
4.45942
4.38806
4.31353
4.23557
4.15383
4.0688
3.9827
3.89718
3.80468
3.68493
3.54063
3.46946
4.52487
4.46916
4.40963
4.34626
4.27898
4.20775
4.13251
4.05318
3.96979
3.88239
3.79083
3.69445
3.59256
3.48634
3.38058
3.27815
3.16379
3.00075
2.7954
2.71146
3.97716
3.9114
3.84071
3.76505
3.68436
3.59855
3.50752
3.41118
3.30963
3.20304
3.09111
2.97241
2.84535
2.71252
2.58357
2.46355
2.32329
2.09836
1.80329
1.70715
3.24144
3.16381
3.07994
2.98977
2.89324
2.79024
2.68056
2.56404
2.44088
2.31156
2.17568
2.03042
1.87232
1.70586
1.54926
1.41244
1.2442
0.935812
0.515958
0.413977
2.27957
2.18784
2.08839
1.98114
1.86601
1.74287
1.61139
1.47124
1.32265
1.1666
1.00307
0.827585
0.633272
0.425757
0.236127
0.0856538
-0.10495
-0.511154
-1.09033
-1.18993
1.05658
0.948348
0.830766
0.703749
0.567211
0.421007
0.26474
0.097849
-0.0795798
-0.265959
-0.460103
-0.667114
-0.898594
-1.15115
-1.37948
-1.54034
-1.73736
-2.23691
-3.00317
-3.10788
-0.456424
-0.583248
-0.721075
-0.870005
-1.03012
-1.20148
-1.38439
-1.57949
-1.78701
-2.00514
-2.23082
-2.46751
-2.73083
-3.02534
-3.29813
-3.47502
-3.66388
-4.23267
-5.19902
-5.34639
-2.28674
-2.43298
-2.59167
-2.76286
-2.94658
-3.14277
-3.35145
-3.57305
-3.80817
-4.05567
-4.31147
-4.57533
-4.86317
-5.19161
-5.51563
-5.73273
-5.92207
-6.5286
-7.67206
-7.90516
-4.46173
-4.62528
-4.80209
-4.99219
-5.19566
-5.41242
-5.64239
-5.88577
-6.14343
-6.41582
-6.70029
-6.99345
-7.30576
-7.66265
-8.0438
-8.33753
-8.5604
-9.1679
-10.397
-10.6917
-7.03224
-7.20977
-7.40079
-7.6055
-7.82413
-8.05688
-8.30395
-8.56557
-8.84262
-9.13673
-9.44812
-9.77331
-10.1134
-10.4891
-10.9088
-11.2857
-11.554
-12.0729
-13.1999
-13.4312
-10.0938
-10.2843
-10.4891
-10.7086
-10.9429
-11.1924
-11.4571
-11.7371
-12.0326
-12.3441
-12.6723
-13.0149
-13.3662
-13.7276
-14.1139
-14.4951
-14.7647
-15.0407
-15.7473
-15.8256
4.95593
4.82144
4.6695
4.50125
4.3169
4.11618
3.89935
3.66777
3.42366
3.16975
2.90917
2.64533
2.38196
2.12283
1.8717
1.63195
1.40673
1.19843
1.00916
0.839965
0.69192
0.564623
0.45836
0.371408
0.303617
0.252166
0.216626
0.193527
0.181826
0.178309
0.180376
0.186093
0.190917
0.192957
0.189619
0.174146
0.152389
0.115782
0.0714527
0.0233895
4.94703
4.80816
4.65032
4.47824
4.29126
4.08766
3.86762
3.6331
3.38662
3.13096
2.86924
2.60493
2.34177
2.08352
1.83386
1.5961
1.37327
1.16766
0.981259
0.815003
0.669865
0.545367
0.441762
0.357246
0.291742
0.242293
0.208675
0.187182
0.177086
0.174944
0.178294
0.18544
0.191083
0.194599
0.191511
0.176494
0.154795
0.116372
0.0722406
0.0223081
4.9353
4.78758
4.62054
4.44251
4.25094
4.04175
3.81594
3.57647
3.32609
3.06754
2.804
2.53902
2.27633
2.01963
1.77249
1.53808
1.31924
1.11808
0.936385
0.774938
0.634524
0.514584
0.415255
0.334702
0.272846
0.226657
0.196083
0.177202
0.169654
0.169693
0.175128
0.184451
0.191436
0.197265
0.194305
0.180289
0.158036
0.11699
0.07288
0.019822
4.91561
4.7557
4.5795
4.39497
4.19796
3.98117
3.74845
3.50362
3.24914
2.98772
2.72267
2.45756
2.19607
1.94181
1.6982
1.46825
1.25456
1.05903
0.883183
0.727651
0.592984
0.478554
0.384342
0.308526
0.250976
0.208654
0.181634
0.165806
0.161231
0.163703
0.171647
0.183213
0.191893
0.200126
0.197082
0.184423
0.160625
0.116912
0.0722204
0.0154465
4.8721
4.6991
4.51623
4.32541
4.12422
3.89925
3.66091
3.41233
3.15525
2.89254
2.62755
2.36386
2.10506
1.85466
1.61591
1.39165
1.18422
0.995328
0.826225
0.677376
0.549107
0.440737
0.352086
0.281385
0.228418
0.190214
0.166904
0.154267
0.152752
0.157635
0.168208
0.181745
0.192332
0.202526
0.1993
0.187989
0.161586
0.115675
0.0693375
0.00895167
4.78403
4.60056
4.41571
4.21966
4.01882
3.78755
3.54782
3.29908
3.04264
2.7816
2.51938
2.25947
2.00544
1.76069
1.52835
1.31108
1.11102
0.929653
0.76801
0.6264
0.504953
0.402953
0.320078
0.254642
0.206331
0.172302
0.15267
0.143211
0.144654
0.151833
0.164936
0.180103
0.192621
0.204096
0.200686
0.19034
0.160502
0.113068
0.0637985
0.000471602
4.62847
4.44255
4.26405
4.06474
3.87253
3.64002
3.40568
3.16198
2.91073
2.65539
2.39932
2.14605
1.89916
1.66203
1.43769
1.22867
1.03693
0.863825
0.710168
0.576152
0.461754
0.366243
0.289189
0.229007
0.185294
0.155365
0.139284
0.1329
0.13711
0.14644
0.161847
0.178338
0.192614
0.20468
0.201074
0.191088
0.157417
0.10908
0.0557927
-0.00952861
4.3811
4.20641
4.04793
3.8496
3.67758
3.45308
3.23245
3.00028
2.7599
2.51495
2.2689
2.02542
1.78818
1.56062
1.34577
1.14611
0.963505
0.799185
0.653844
0.52759
0.420295
0.331235
0.259913
0.204852
0.165585
0.139593
0.126877
0.123406
0.130156
0.141474
0.158904
0.176458
0.192171
0.204243
0.200374
0.190103
0.152699
0.103879
0.0460134
-0.0203704
4.01668
3.87048
3.753
3.56647
3.42787
3.22524
3.0274
2.81453
2.59147
2.36205
2.13009
1.89957
1.6744
1.45822
1.25418
1.06478
0.891902
0.73671
0.599836
0.481351
0.381071
0.298303
0.232524
0.182364
0.147325
0.125048
0.115476
0.114716
0.123769
0.136899
0.156052
0.174433
0.191195
0.202825
0.198603
0.187497
0.146865
0.0977613
0.0353821
-0.0313055
3.50984
3.41108
3.36358
3.2124
3.11978
2.9567
2.79143
2.60654
2.40764
2.199
1.98512
1.77053
1.55963
1.35639
1.16421
0.985768
0.822987
0.677079
0.548667
0.437825
0.344366
0.267644
0.207148
0.161615
0.130545
0.111723
0.105055
0.106781
0.117901
0.132655
0.15324
0.172225
0.189651
0.200528
0.195886
0.183553
0.140428
0.0910811
0.0247909
-0.0416513
2.83534
2.80959
2.86575
2.78861
2.75323
2.64877
2.52704
2.37914
2.21119
2.02839
1.83627
1.64028
1.44549
1.25644
1.07692
0.909861
0.757362
0.62073
0.500642
0.397219
0.310306
0.239328
0.18381
0.142599
0.115215
0.0995726
0.0955605
0.0995398
0.112502
0.128685
0.150428
0.169812
0.187566
0.197499
0.192405
0.178637
0.133806
0.0841873
0.0149461
-0.0508876
1.97187
2.06489
2.25365
2.29807
2.33271
2.30408
2.238
2.13584
2.00524
1.85288
1.68577
1.51058
1.33338
1.15944
0.99308
0.837622
0.695409
0.567908
0.455901
0.359597
0.278903
0.21333
0.162465
0.125258
0.10127
0.0885311
0.0869302
0.0929328
0.107523
0.124943
0.147594
0.167195
0.185008
0.193908
0.188361
0.173114
0.1273
0.0773791
0.00631012
-0.0586961
0.909178
1.19934
1.53452
1.74406
1.86742
1.92784
1.92956
1.8811
1.79336
1.67526
1.53571
1.38301
1.22444
1.06618
0.913237
0.769396
0.637322
0.5187
0.414458
0.324921
0.250088
0.189567
0.143021
0.109501
0.0886243
0.0785193
0.0790945
0.0869007
0.102918
0.121392
0.144732
0.1644
0.182069
0.189922
0.183946
0.1673
0.121103
0.070884
-0.000887349
-0.0649484
-0.358784
0.242126
0.7253
1.12935
1.36837
1.52834
1.60856
1.62049
1.5798
1.49864
1.38834
1.25912
1.1197
0.977326
0.837779
0.705381
0.583169
0.473085
0.376235
0.293083
0.223739
0.167912
0.125355
0.0952169
0.0771772
0.0694525
0.071983
0.0813883
0.0986482
0.118007
0.14185
0.161466
0.178847
0.185693
0.179324
0.161436
0.115327
0.0648547
-0.00660231
-0.0696656
-1.86745
-0.813802
-0.166095
0.450081
0.840802
1.11307
1.28127
1.35934
1.36876
1.32618
1.24594
1.1405
1.02022
0.89355
0.767091
0.645758
0.532993
0.431017
0.341135
0.263958
0.199718
0.14823
0.109341
0.0822905
0.0668293
0.0612481
0.0655289
0.0763455
0.0946804
0.114773
0.138962
0.158437
0.175437
0.181348
0.174631
0.155695
0.110022
0.0593778
-0.010918
-0.0729688
-3.7113
-2.05819
-1.16609
-0.312908
0.275063
0.680696
0.947971
1.0987
1.16157
1.15918
1.10965
1.02807
0.926706
0.815325
0.701465
0.590677
0.486838
0.392468
0.30908
0.237442
0.17791
0.130405
0.0948685
0.0706235
0.0574944
0.0538349
0.059675
0.0717304
0.0909874
0.111678
0.136086
0.155354
0.171918
0.176983
0.169966
0.150185
0.105198
0.0544876
-0.0139909
-0.0750343
-5.99283
-3.63647
-2.32699
-1.18292
-0.34859
0.219577
0.600439
0.832504
0.953916
0.994585
0.977302
0.920321
0.838088
0.7419
0.640351
0.539717
0.444368
0.357155
0.279829
0.213324
0.158129
0.114275
0.0817973
0.0600972
0.0490734
0.0471338
0.0543598
0.0674995
0.0875428
0.108715
0.13324
0.152262
0.168362
0.172678
0.165411
0.144977
0.100846
0.0501816
-0.0160159
-0.0760597
-8.64449
-5.56479
-3.63041
-2.12919
-1.01952
-0.267714
0.237195
0.557005
0.741228
0.827782
0.844639
0.813499
0.751185
0.670644
0.581617
0.491171
0.404221
0.323997
0.252518
0.190913
0.139822
0.099393
0.0697671
0.0504244
0.0413405
0.0409739
0.0494594
0.0635739
0.0843094
0.10589
0.130471
0.149235
0.164869
0.168531
0.161052
0.14013
0.0969462
0.0464308
-0.0172116
-0.076247
-11.1985
-7.47799
-4.83446
-2.98094
-1.6287
-0.713308
-0.0988178
0.298883
0.539614
0.668063
0.716577
0.709784
0.666521
0.601143
0.524373
0.443961
0.365304
0.291974
0.226242
0.169428
0.122329
0.0852148
0.0583361
0.0412545
0.0340261
0.0351586
0.0448423
0.0598807
0.08127
0.103234
0.127855
0.146372
0.16155
0.164627
0.156954
0.135665
0.0934544
0.0431792
-0.0177822
-0.0757978
-12.75
-8.66302
-5.48412
-3.44316
-1.96629
-0.971167
-0.303534
0.133543
0.404162
0.55607
0.623308
0.631708
0.600961
0.546038
0.478103
0.405216
0.332995
0.265171
0.20414
0.151318
0.107592
0.0733017
0.0487736
0.033619
0.0279618
0.0303375
0.0409942
0.0567408
0.0785898
0.100751
0.125272
0.143454
0.158159
0.160712
0.152898
0.131392
0.0902301
0.0403473
-0.0177462
-0.0748671
-12.5551
-8.74187
-5.39715
-3.39017
-1.93274
-0.954957
-0.301239
0.128343
0.394766
0.544945
0.611783
0.620499
0.590417
0.536319
0.469283
0.397335
0.326074
0.259217
0.199141
0.147231
0.104347
0.0707886
0.0468647
0.0321513
0.0267858
0.0292803
0.0399196
0.0554805
0.0769902
0.0986626
0.122606
0.140256
0.154563
0.156873
0.149172
0.127793
0.087762
0.0384323
-0.0169789
-0.0736919
-12.3765
-8.71627
-5.38597
-3.39787
-1.96899
-0.999125
-0.351402
0.0774273
0.345094
0.497927
0.568238
0.580937
0.555102
0.505316
0.442492
0.374522
0.306919
0.243349
0.186174
0.136784
0.0960633
0.0643345
0.0419362
0.0284698
0.0240964
0.0273526
0.0385347
0.0544507
0.0761096
0.0977716
0.121507
0.13884
0.152765
0.154701
0.146856
0.125351
0.0859121
0.0369314
-0.0167188
-0.0728217
-12.5735
-8.82245
-5.48831
-3.45616
-2.03557
-1.05942
-0.410369
0.0211921
0.291784
0.447863
0.521731
0.53828
0.516538
0.470986
0.412404
0.348556
0.284841
0.224847
0.170889
0.124344
0.0861004
0.0565035
0.0359142
0.0239626
0.0208233
0.0250653
0.0369774
0.0534171
0.0753513
0.0971103
0.120688
0.137715
0.151211
0.152709
0.144644
0.122955
0.0840455
0.0354177
-0.016538
-0.0718655
-12.8672
-8.93208
-5.61628
-3.53003
-2.11216
-1.12675
-0.473039
-0.036842
0.238168
0.398518
0.476657
0.497513
0.480104
0.438847
0.384434
0.324538
0.264489
0.207824
0.156839
0.112909
0.0769358
0.0492879
0.0303491
0.0197766
0.0177578
0.0228917
0.0354591
0.0523634
0.0745277
0.0963504
0.119751
0.136476
0.149561
0.150665
0.142415
0.120596
0.0822489
0.0340105
-0.0162436
-0.0707891
-13.2186
-9.06407
-5.76026
-3.61676
-2.19397
-1.19819
-0.537711
-0.0959797
0.184169
0.349283
0.432064
0.457499
0.444607
0.407751
0.357543
0.301579
0.24513
0.191702
0.143581
0.102149
0.0683325
0.0425238
0.0251329
0.0158451
0.0148621
0.0208128
0.0339726
0.0512878
0.07364
0.0954929
0.118697
0.135121
0.147814
0.148564
0.140162
0.118267
0.0805144
0.0327074
-0.0158352
-0.0696
-13.581
-9.20546
-5.90751
-3.71288
-2.27952
-1.27307
-0.604168
-0.156068
0.129858
0.300152
0.38784
0.418007
0.409709
0.377273
0.331252
0.279178
0.226274
0.176021
0.1307
0.0917073
0.0599882
0.0359648
0.020072
0.0120234
0.0120356
0.018767
0.0324884
0.0501884
0.072707
0.0945734
0.117571
0.133697
0.146008
0.146431
0.1379
0.115969
0.0788323
0.0314968
-0.0153387
-0.0683094
-13.9528
-9.36373
-6.059
-3.81814
-2.36873
-1.35098
-0.672253
-0.216976
0.0753183
0.251194
0.344051
0.379105
0.375469
0.347462
0.305594
0.257352
0.207923
0.160771
0.118179
0.0815577
0.0518761
0.0295841
0.0151417
0.00829033
0.00926113
0.0167421
0.030999
0.0490625
0.07173
0.0935971
0.116382
0.132213
0.144153
0.144276
0.135635
0.113708
0.0772018
0.0303774
-0.0147655
-0.0669251
-14.3269
-9.53548
-6.21342
-3.93112
-2.46154
-1.4316
-0.741858
-0.278601
0.0206167
0.20246
0.300736
0.340823
0.341918
0.318348
0.280601
0.236133
0.190108
0.145981
0.106043
0.0717225
0.0440141
0.0233955
0.010352
0.00465263
0.00654255
0.0147394
0.0295035
0.0479074
0.0707055
0.0925605
0.115126
0.130669
0.142251
0.142101
0.133369
0.111484
0.075624
0.0293501
-0.0141213
-0.0654538
-14.7043
-9.72151
-6.37195
-4.0511
-2.55804
-1.51471
-0.812894
-0.340863
-0.0341941
0.153985
0.257916
0.303172
0.309056
0.289928
0.256267
0.215514
0.172821
0.131645
0.0942863
0.0621972
0.0363984
0.0173962
0.00570072
0.00110822
0.00387791
0.0127567
0.0279998
0.0467208
0.0696314
0.0914622
0.113803
0.129066
0.140304
0.13991
0.131107
0.109302
0.0740989
0.0284147
-0.0134126
-0.0639024
-15.0836
-9.92021
-6.53493
-4.17728
-2.65822
-1.60013
-0.885287
-0.403705
-0.0890757
0.105795
0.215604
0.266156
0.276882
0.262193
0.23258
0.195481
0.156049
0.117747
0.0828953
0.0529694
0.0290181
0.0115767
0.00117967
-0.00234946
0.00126202
0.0107902
0.0264848
0.0455008
0.0685066
0.0903021
0.112416
0.127407
0.138315
0.137705
0.128851
0.107162
0.0726261
0.02757
-0.0126464
-0.0622779
-15.4653
-10.1312
-6.70308
-4.30917
-2.76209
-1.68777
-0.958981
-0.467089
-0.144003
0.0579031
0.173806
0.229772
0.245388
0.235133
0.209527
0.176021
0.139778
0.104276
0.0718585
0.0440285
0.0218636
0.00592819
-0.00321852
-0.00572661
-0.00131011
0.00883587
0.0249559
0.0442454
0.0673303
0.0890809
0.110966
0.125695
0.13629
0.13549
0.126604
0.105066
0.0712049
0.0268143
-0.0118297
-0.0605873
-15.8491
-10.3535
-6.87681
-4.44638
-2.86962
-1.77756
-1.03394
-0.530994
-0.198966
0.010313
0.132518
0.194015
0.214563
0.208734
0.187095
0.157121
0.123995
0.0912196
0.0611651
0.0353648
0.014926
0.000443185
-0.0075005
-0.00902879
-0.00384298
0.00689035
0.0234103
0.042953
0.066102
0.0877993
0.109455
0.123934
0.134231
0.13327
0.124369
0.103016
0.0698346
0.0261454
-0.0109694
-0.0588376
-16.235
-10.5868
-7.05655
-4.5887
-2.98079
-1.86948
-1.11015
-0.595417
-0.253963
-0.0369816
0.0917314
0.158869
0.184391
0.182981
0.165268
0.138764
0.108687
0.0785655
0.0508041
0.0269684
0.008197
-0.00488584
-0.0116727
-0.0122614
-0.00634091
0.00495031
0.0218459
0.0416223
0.0648215
0.0864584
0.107886
0.122127
0.132142
0.131046
0.122149
0.101012
0.0685141
0.0255609
-0.0100722
-0.0570357
-16.6229
-10.8304
-7.24264
-4.73604
-3.09559
-1.96355
-1.18761
-0.660371
-0.309011
-0.0839966
0.0514275
0.124317
0.154853
0.157854
0.144026
0.120935
0.0938371
0.0663001
0.0407637
0.0188295
0.00166782
-0.0100663
-0.0157414
-0.0154296
-0.00880803
0.00301264
0.0202605
0.0402522
0.0634889
0.0850595
0.106261
0.120276
0.130028
0.128822
0.119946
0.0990555
0.0672422
0.0250576
-0.00914454
-0.0551881
-17.0129
-11.0838
-7.43535
-4.88838
-3.21403
-2.0598
-1.26635
-0.725886
-0.364135
-0.130758
0.0115818
0.0903333
0.125926
0.13333
0.12335
0.103614
0.0794305
0.0544095
0.0310321
0.0109377
-0.00467015
-0.0151056
-0.0197128
-0.0185385
-0.0112483
0.00107444
0.0186522
0.038842
0.0621045
0.0836042
0.104583
0.118387
0.127891
0.126602
0.117762
0.0971466
0.0660177
0.0246323
-0.00819274
-0.0533015
-17.4052
-11.3469
-7.6349
-5.0458
-3.33615
-2.15831
-1.34642
-0.792005
-0.419372
-0.177299
-0.0278371
0.0568893
0.0975811
0.109385
0.103216
0.0867823
0.0654496
0.0428792
0.021597
0.00328293
-0.0108255
-0.020011
-0.023593
-0.021593
-0.0136656
-0.000866965
0.0170195
0.037391
0.060669
0.0820945
0.102855
0.116462
0.125736
0.124387
0.1156
0.0952856
0.064839
0.0242813
-0.00722288
-0.0513822
-17.8003
-11.6195
-7.84157
-5.20842
-3.46201
-2.25916
-1.42788
-0.858785
-0.474771
-0.223662
-0.0668665
0.0239514
0.0697896
0.0859918
0.0836017
0.0704184
0.0518769
0.0316942
0.0124459
-0.00414526
-0.0168069
-0.0247896
-0.0273878
-0.0245977
-0.0160633
-0.00281401
0.015361
0.0358992
0.0591833
0.0805324
0.101081
0.114505
0.123566
0.122181
0.113461
0.0934726
0.0637047
0.0240006
-0.00624047
-0.049436
-18.1993
-11.902
-8.05578
-5.37649
-3.59171
-2.36245
-1.51082
-0.926297
-0.53039
-0.269897
-0.105549
-0.00851754
0.0425183
0.0631215
0.0644815
0.0545013
0.0386944
0.0208396
0.00356644
-0.011357
-0.0226226
-0.0294483
-0.0311026
-0.0275569
-0.0184446
-0.00476883
0.0136755
0.0343664
0.0576486
0.0789201
0.0992632
0.112519
0.121385
0.119986
0.111347
0.0917071
0.062613
0.0237862
-0.00525108
-0.0474691
-18.6027
-12.195
-8.27807
-5.55034
-3.72546
-2.46835
-1.59536
-0.994641
-0.586305
-0.316066
-0.143935
-0.0405613
0.0157298
0.0407423
0.0458287
0.0390083
0.025883
0.0102996
-0.0050543
-0.0183627
-0.028281
-0.0339936
-0.0347429
-0.0304748
-0.0208126
-0.00673332
0.0119623
0.0327929
0.0560662
0.0772602
0.0974049
0.110507
0.119195
0.117804
0.10926
0.0899888
0.0615621
0.0236338
-0.00425996
-0.045487
-19.0094
-12.4978
-8.50861
-5.73029
-3.86344
-2.57702
-1.68166
-1.06393
-0.642612
-0.362245
-0.182089
-0.0722313
-0.0106187
0.0188184
0.027613
0.0239144
0.0134224
5.74795e-05
-0.01343
-0.0251733
-0.0337909
-0.0384326
-0.0383141
-0.0333555
-0.0231701
-0.00870927
0.0102207
0.0311793
0.0544379
0.0755553
0.0955094
0.108474
0.116999
0.115637
0.1072
0.088317
0.06055
0.023539
-0.00326894
-0.0434975
)
;
boundaryField
{
inlet
{
type freestreamPressure;
freestreamValue uniform 0;
supersonic false;
value nonuniform List<scalar>
80
(
0.774502
0.683894
0.59002
0.492918
0.393052
0.290986
0.187372
0.0829706
-0.0213427
-0.124582
-0.225663
-0.323413
-0.416592
-0.5039
-0.583988
-0.655449
-0.716783
-0.766325
-0.802113
-0.821671
1.91688
1.85534
1.7942
1.73351
1.67329
1.61358
1.55442
1.49583
1.43784
1.38048
1.32378
1.26775
1.21242
1.15779
1.10389
1.05071
0.998291
0.946644
0.895756
0.84534
3.16317
3.1028
3.04226
2.98126
2.91981
2.85798
2.79582
2.73337
2.67069
2.60781
2.54479
2.48166
2.41849
2.3553
2.29217
2.22912
2.16621
2.10349
2.04099
1.97878
5.29176
5.26798
5.224
5.16223
5.08456
4.99276
4.88864
4.77413
4.65126
4.52209
4.38867
4.25293
4.11662
3.98131
3.84832
3.71872
3.59338
3.47296
3.35796
3.24827
)
;
}
outlet
{
type freestreamPressure;
freestreamValue uniform 0;
supersonic false;
value nonuniform List<scalar>
80
(
-0.000353931
-0.000188589
-4.07555e-05
8.92432e-05
0.000197341
0.000280613
0.000337962
0.000369776
0.000377765
0.000364845
0.00033493
0.000292644
0.000242954
0.000190753
0.000140429
9.54815e-05
5.82788e-05
3.00258e-05
1.1007e-05
1.24021e-06
-0.00229776
-0.00230197
-0.00228702
-0.0022534
-0.00220207
-0.00213442
-0.00205208
-0.00195694
-0.00185099
-0.0017363
-0.00161495
-0.00148894
-0.00136019
-0.00123046
-0.00110134
-0.00097423
-0.000850408
-0.000731085
-0.000616875
-0.000506136
-0.000348029
-0.000417198
-0.000495322
-0.000582247
-0.000677922
-0.00078208
-0.000894124
-0.00101312
-0.0011378
-0.00126656
-0.00139746
-0.0015283
-0.00165663
-0.00177986
-0.00189536
-0.00200054
-0.00209296
-0.0021705
-0.0022313
-0.00227413
7.92471e-09
8.47463e-08
2.92375e-07
6.28651e-07
7.77657e-07
6.95182e-08
-1.95295e-06
-4.88917e-06
-7.5163e-06
-8.47331e-06
-7.07078e-06
-3.83208e-06
-6.49093e-07
-6.00315e-07
-7.53195e-06
-2.55079e-05
-5.82275e-05
-0.000108493
-0.000177771
-0.00026591
)
;
}
top
{
type symmetryPlane;
}
bottom
{
type symmetryPlane;
}
cylinder
{
type zeroGradient;
}
frontandback
{
type empty;
}
}
// ************************************************************************* //
|
|
9474367361ed53835479a257b554c7d35b2c43fa
|
ea89955e343ced5e705b4a338039e658a4ba67cb
|
/Session14-RaveGun/Behavior/PursueBehavior.cpp
|
e8c1c80194262eb15af02cd0db73fc22ffcf089c
|
[] |
no_license
|
kennethdmiller3/videoventure
|
775ce24ee4aebe3dfc65876a3fc9abb93f29b51d
|
7182b78fde61421c48abc679ef6f2992e740d678
|
refs/heads/master
| 2021-06-03T19:26:26.704306
| 2020-07-25T05:37:02
| 2020-07-25T05:37:02
| 32,195,803
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,532
|
cpp
|
PursueBehavior.cpp
|
#include "StdAfx.h"
#include "PursueBehavior.h"
#include "TargetBehavior.h"
#include "BotUtilities.h"
#include "Controller.h"
#include "Entity.h"
namespace Database
{
Typed<PursueBehaviorTemplate> pursuebehaviortemplate(0xb9b0800f /* "pursuebehaviortemplate" */);
Typed<PursueBehavior *> pursuebehavior(0xa211bfc9 /* "pursuebehavior" */);
}
namespace BehaviorDatabase
{
namespace Loader
{
class PursueBehaviorLoader
{
public:
PursueBehaviorLoader()
{
AddConfigure(0x0297228f /* "pursue" */, Entry(this, &PursueBehaviorLoader::Configure));
}
unsigned int Configure(unsigned int aId, const TiXmlElement *element)
{
PursueBehaviorTemplate &pursue = Database::pursuebehaviortemplate.Open(aId);
pursue.Configure(element, aId);
Database::pursuebehaviortemplate.Close(aId);
return 0xb9b0800f /* "pursuebehaviortemplate" */;
}
}
pursuebehaviorloader;
}
namespace Initializer
{
class PursueBehaviorInitializer
{
public:
PursueBehaviorInitializer()
{
AddActivate(0xb9b0800f /* "pursuebehaviortemplate" */, ActivateEntry(this, &PursueBehaviorInitializer::Activate));
AddDeactivate(0xb9b0800f /* "pursuebehaviortemplate" */, DeactivateEntry(this, &PursueBehaviorInitializer::Deactivate));
}
Behavior *Activate(unsigned int aId, Controller *aController)
{
const PursueBehaviorTemplate &pursuebehaviortemplate = Database::pursuebehaviortemplate.Get(aId);
PursueBehavior *pursuebehavior = new PursueBehavior(aId, pursuebehaviortemplate, aController);
Database::pursuebehavior.Put(aId, pursuebehavior);
return pursuebehavior;
}
void Deactivate(unsigned int aId)
{
if (PursueBehavior *pursuebehavior = Database::pursuebehavior.Get(aId))
{
delete pursuebehavior;
Database::pursuebehavior.Delete(aId);
}
}
}
pursuebehaviorinitializer;
}
}
PursueBehaviorTemplate::PursueBehaviorTemplate()
: mStrength(0.0f)
, mLeading(0.0f)
, mOffset(Transform2::Identity())
{
}
bool PursueBehaviorTemplate::Configure(const TiXmlElement *element, unsigned int aId)
{
element->QueryFloatAttribute("strength", &mStrength);
element->QueryFloatAttribute("leading", &mLeading);
if (element->QueryFloatAttribute("angle", &mOffset.a) == TIXML_SUCCESS)
mOffset.a *= float(M_PI) / 180.0f;
element->QueryFloatAttribute("x", &mOffset.p.x);
element->QueryFloatAttribute("y", &mOffset.p.y);
return true;
}
PursueBehavior::PursueBehavior(unsigned int aId, const PursueBehaviorTemplate &aTemplate, Controller *aController)
: Behavior(aId, aController)
{
bind(this, &PursueBehavior::Execute);
}
// pursue behavior
Status PursueBehavior::Execute(void)
{
// get target
const TargetData &targetdata = Database::targetdata.Get(mId);
// get target entity
Entity *targetEntity = Database::entity.Get(targetdata.mTarget);
if (!targetEntity)
return runningTask;
// get pursue behavior template
const PursueBehaviorTemplate &pursue = Database::pursuebehaviortemplate.Get(mId);
// get owner entity
Entity *entity = Database::entity.Get(mId);
// direction to target
Vector2 targetDir(pursue.mOffset.Untransform(TargetDir(pursue.mLeading, entity, targetEntity, targetdata.mOffset)));
// save range
float distSq = targetDir.LengthSq();
// normalize direction
targetDir *= InvSqrt(distSq);
// move towards target
mController->mMove += pursue.mStrength * targetDir;
return runningTask;
}
|
121c37d7656561ad0eaa803a9dbeb228d7cd3f37
|
a7c8006328872180ce8500c90ade1ca324f569a1
|
/10003.cpp
|
1f6c37eeaf396ffb85633a02301daa08513f13da
|
[] |
no_license
|
ChilleFlex/UVA_solves
|
f79f1f7e73c480897b1b9ff3d07bf66cdbcbf913
|
9b7f7d8b86529e1f549b4af8581a8a4527103aa1
|
refs/heads/main
| 2023-04-08T09:30:56.514949
| 2021-04-13T10:51:40
| 2021-04-13T10:51:40
| 357,518,589
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,190
|
cpp
|
10003.cpp
|
#include <bits/stdc++.h>
const int N = 1005;
const int MOD = 1000000007;
using ll = long long;
using namespace std;
void __print(int x) {cerr << x;} void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;} void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;} void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';} void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V> void __print(const pair<T, V> &x)
{cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T> void __print(const T &x)
{int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V> void _print(T t, V... v)
{__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define db(x...) cerr << "[" << #x << "] = [", _print(x)
#endif
int n,dp[N][N];
bool taken[N];
vector<int>vec;
int func(int l,int r)
{
if(dp[l][r]!=-1)
return dp[l][r];
int i,ans=INT_MAX;
bool f=false;
rep0(i,n)
{
if(vec[i]>l && vec[i]<r)
{
f=true;
int x=r-l;
x+=func(vec[i],r);
x+=func(l,vec[i]);
ans=min(ans,x);
}
}
if(!f)
return dp[l][r]=0;
return dp[l][r]=ans;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
//freopen("output.txt","w",stdout);
#endif
int len;
while(1)
{
sf(len);
if(!len)
return 0;
mem(dp,-1);
memb(taken);
vec.clear();
int i,k;
sf(n);
rep0(i,n)
{
sf(k);
vec.pb(k);
}
pf("The minimum cutting is %d.\n",func(0,len));
}
}
|
f16c66f9a5e0c92cdfcb7c456457a065433b9cc0
|
b744863237d0843a22dd215240a32120dc6e2b6e
|
/examples/Eficiencia/Regleta/Regleta.ino
|
6eb000923cd16860326e7f091da74ef02f96b16f
|
[] |
no_license
|
guadalinfo/SmartCities_Library
|
7f04bbeb67cc7f6ad6c49ff48636dd9585c99519
|
40543f2169c894143daf9e803086202329945dbe
|
refs/heads/master
| 2020-03-10T02:35:38.315415
| 2018-07-18T06:29:26
| 2018-07-18T06:29:26
| 129,140,186
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,091
|
ino
|
Regleta.ino
|
/*
Control remoto de una regleta que mide el consumo y lo muestra por el LCD
Usa RTC para establecer con precision el tiempo
Conexion del LCD
-----------------------------
Vin (Voltage In) -> 5V
Gnd (Ground) -> Gnd
SDA (Serial Data) -> A4 on Uno/Pro-Mini, 20 on Mega2560/Due, 2 Leonardo/Pro-Micro
SCK (Serial Clock) -> A5 on Uno/Pro-Mini, 21 on Mega2560/Due, 3 Leonardo/Pro-Micro
Relé -> pin 11
Sensor de corriente -> pin A0
Conexion del RTC 1302
VCC 5V
Gnd GND
SCK_PIN 4
IO_PIN 5 //También conocido como Data
CE_PIN 6 //También conocido como RST
*/
/* ==== Includes ==== */
// Librerias para la pantalla LCD
#include <Wire.h> // Needed for legacy versions of Arduino.
#include <LiquidCrystal_I2C.h> // Pantalla LCD
// Libreria para filtrado
#include <Filters.h>
// Librerias para RTC
#include <DS1302RTC.h>
#include <Time.h>
/* ==== END Includes ==== */
/* ==== Defines ==== */
#define SERIAL_BAUD 9600
#define PIN_SENSOR_CORRIENTE A0
#define PIN_RELE 11
#define SCK_PIN 4
#define IO_PIN 5
#define CE_PIN 6
/* ==== END Defines ==== */
/* ==== Global Variables ==== */
// Set the LCD address to 0x27 or 0x3F for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
//LiquidCrystal_I2C lcd(0x3F, 16, 2);
// Medida de corriente
float testFrequency = 60; // test signal frequency (Hz)
float windowLength = 20.0/testFrequency; // how long to average the signal, for statistist
int sensorValue = 0;
float intercept = -0.065;//-0.1129; // to be adjusted based on calibration testing
float slope = 0.066; // 0.0405; // to be adjusted based on calibration testing
float current_amps; // estimated actual current in amps
unsigned long printPeriod = 1000; // in milliseconds
// Track time in milliseconds since last reading
unsigned long previousMillis = 0;
// RTC DS1302
// Set pins: CE, IO,CLK
DS1302RTC RTC(CE_PIN, IO_PIN, SCK_PIN);
/* ==== END Global Variables ==== */
/* ==== Prototypes ==== */
/* ==== END Prototypes ==== */
/* ==== Setup ==== */
void setup_Serial(){
Serial.begin(SERIAL_BAUD);
while(!Serial) {} // Wait
}
void setup_LCD(){
lcd.init(); // Inicializamos el LCD
lcd.backlight(); // Encendemos la luz
}
void setup_Rele(){
pinMode(PIN_RELE,OUTPUT);
}
void setup_RTC(){
lcd.print("RTC activado");
delay(500);
lcd.clear();
if (RTC.haltRTC()) {
lcd.print(F("RTC parado!"));
}
else
lcd.print(F("RTC Funcionando"));
lcd.setCursor(0,1);
if (RTC.writeEN())
lcd.print(F("Escritura Permitida"));
else
lcd.print(F("Escritura Bloqueada"));
delay ( 500 );
// Setup time library
lcd.clear();
lcd.print(F("RTC Sincronizando"));
setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus() == timeSet)
lcd.print(F(" Ok!"));
else
lcd.print(F(" Error!"));
delay ( 500 );
lcd.clear();
}
void setup() {
setup_Serial();
setup_LCD();
setup_Rele();
setup_RTC();
enciende_Rele();
}
/* ==== END Setup ==== */
/* ==== Loop ==== */
void loop() {
// Para ajustar el tiempo si es necesario
if (Serial.available() >= 12){
setTime();
}
RunningStatistics inputStats; // create statistics to look at the raw test signal
inputStats.setWindowSecs( windowLength );
while( true ) {
sensorValue = analogRead(PIN_SENSOR_CORRIENTE); // read the analog in value:
inputStats.input(sensorValue); // log to Stats function
if((unsigned long)(millis() - previousMillis) >= printPeriod) {
previousMillis = millis(); // update time
// convert signal sigma value to current in amps
current_amps = intercept + slope * inputStats.sigma();
float current_watts=current_amps*220*0.95;
Serial.print( current_amps );
Serial.print( "," );
Serial.println( inputStats.sigma() );
lcd.setCursor(0,0);
lcd.print(current_amps);
lcd.print("A ");
lcd.print(current_watts);
lcd.print("w ");
}
lcd.setCursor(0,1);
showTime();
Serial.println();
}
}
/* ==== End Loop ==== */
/* ==== Functions ==== */
void enciende_Rele(){
digitalWrite(PIN_RELE,HIGH);
lcd.setCursor(13,1);
lcd.print(" On");
Serial.print(1);
}
void apaga_Rele(){
digitalWrite(PIN_RELE,LOW);
lcd.setCursor(13,1);
lcd.print("Off");
Serial.print(0);
}
void setTime(){
//check for input to set the RTC, minimum length is 12, i.e. yy,m,d,h,m,s
{
tmElements_t tm;
time_t t;
//note that the tmElements_t Year member is an offset from 1970,
//but the RTC wants the last two digits of the calendar year.
//use the convenience macros from Time.h to do the conversions.
int y = Serial.parseInt();
if (y >= 100 && y < 1000)
lcd.println(F("Error: Year must be two digits or four digits!"));
else {
if (y >= 1000)
tm.Year = CalendarYrToTm(y);
else //(y < 100)
tm.Year = y2kYearToTm(y);
tm.Month = Serial.parseInt();
tm.Day = Serial.parseInt();
tm.Hour = Serial.parseInt();
tm.Minute = Serial.parseInt();
tm.Second = Serial.parseInt();
t = makeTime(tm);
//use the time_t value to ensure correct weekday is set
if(RTC.set(t) == 0) { // Success
setTime(t);
lcd.clear();
lcd.print(F("RTC set!"));
} else {
lcd.clear();
lcd.print(F("RTC not set!"));
}
//dump any extraneous input
while (Serial.available() > 0) Serial.read();
}
}
}
void printSerialAndLCD(String str){
Serial.print(str);
lcd.print(str);
}
void print2Digit(int valor){
if(valor<10)
printSerialAndLCD("0");
printSerialAndLCD(String(valor));
}
void showTime(){
print2Digit(hour());
printSerialAndLCD(":");
print2Digit(minute());
printSerialAndLCD(":");
print2Digit(second());
}
/* ==== END Functions ==== */
|
493fcbe0690ff0f9ba8462ba6819304006949740
|
044c978d905ee64657e76b7fddc4410c7527dfa9
|
/stolyarov.alexey/B3/phoneBook.cpp
|
4e86d05a26f62c67b71e822071efad8c2294194e
|
[] |
no_license
|
sdimosik/spbspu-labs-2020-904-4
|
bbbb2e6e7d64f28646a9eea3f8f3c10a49f3d913
|
1adedb23a08f345b7e975b78814b8a7fdbb5a736
|
refs/heads/master
| 2023-06-04T17:01:25.310853
| 2020-12-15T20:57:28
| 2020-12-15T20:57:28
| 378,229,599
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 822
|
cpp
|
phoneBook.cpp
|
#include "phoneBook.hpp"
void PhoneBook::show(iterator it) const
{
std::cout << it->number_ << " " << it->name_ << "\n";
}
void PhoneBook::pushBack(const PhoneBookNote& note)
{
noteList_.push_back(note);
}
PhoneBook::iterator PhoneBook::deleteBookmark(iterator it)
{
if (noteList_.empty())
{
return noteList_.end();
}
return noteList_.erase(it);
}
PhoneBook::iterator PhoneBook::insertAfter(PhoneBook::iterator it, const PhoneBook::PhoneBookNote& note)
{
return noteList_.insert(++it, note);
}
PhoneBook::iterator PhoneBook::insertBefore(PhoneBook::iterator it, const PhoneBook::PhoneBookNote& note)
{
return noteList_.insert(it, note);
}
PhoneBook::iterator PhoneBook::begin() noexcept
{
return noteList_.begin();
}
PhoneBook::iterator PhoneBook::end() noexcept
{
return noteList_.end();
}
|
0682e448e8261cd47ef3378ae02ad4f23a9ff003
|
ba4b9465a3d33564dc956d682217cd9e881c00cf
|
/main.cpp
|
adb7bc7af5578a2047f7089e9e9071736594e6df
|
[] |
no_license
|
nashvent/aEstrella
|
ee0cc0b732edd8b95db36e993779f690381bbfca
|
1c467c56fb6e2e98765b0c664555113092c82236
|
refs/heads/master
| 2021-08-28T15:16:04.149723
| 2017-12-12T15:17:04
| 2017-12-12T15:17:04
| 112,461,041
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,729
|
cpp
|
main.cpp
|
#include <bits/stdc++.h>
using namespace std;
float D=100.2;
double tiempoConsumido=0;
template<class T>
T dEuclidiana(T*a,T*b){
return abs(a[0]-b[0])+abs(a[1]-b[1]);
}
template<class T>
T dEuclidianaManhatan(T*a,T*b){
return (abs(a[0]-b[0])+abs(a[1]-b[1]))*D;
}
template<class T>
T dEuclidiana2(T*a,T*b){
T Dx=abs(a[0]-b[0]);
T Dy=abs(a[1]-b[1]);
return D*(sqrt((Dx*Dx)+(Dy*Dy)));
}
template<class T>
T dEuclidiana3(T*a,T*b){
T Dx=abs(a[0]-b[0]);
T Dy=abs(a[1]-b[1]);
return D*((Dx*Dx)+(Dy*Dy));
}
template<class T>
T breakTies(T*a,T*b,T*c){
T dx1=c[0]-b[0];
T dy1=c[1]-b[1];
T dx2=a[0]-b[0];
T dy2=a[1]-b[1];
return abs((dx1*dy2)-(dx2*dy1));
}
template<class T>
T diagonalDistance(T*a,T*b){
return max(abs(a[0]-b[0]),abs(a[1]-b[1]))*D;
}
struct Graph{
int V;
list< pair<int,float> >*adj;
vector<float*>coord;
vector<vector<int*> >preCalc;
Graph(int V){
this->V=V;
adj=new list<pair<int,float> >[V];
coord.resize(V);
}
void addNode(int pos,float x,float y){
float *p=new float[2];
p[0]=x;
p[1]=y;
coord[pos]=p;
}
void addEdge(int u,int v,float w){
adj[u].push_back(make_pair(v,w));
// adj[v].push_back(make_pair(u, w));
}
void print(){
for (int i = 0; i <V; ++i) {
cout<<i<<" ["<<coord[i][0]<<"]["<<coord[i][1]<<"]: "<<endl;
list<pair<int,float> >::iterator j;
for (j = adj[i].begin(); j !=adj[i].end(); j++) {
cout.width(2);
cout<<"-"<<(*j).second<<"-> "<<(*j).first<<endl;
}
}
}
int menor(vector<float*>score,vector<int>&openList){
clock_t begin = clock();
int pos=0;
for(int a=0;a<openList.size();a++){
if(score[openList[a]][0]<score[openList[pos]][0]){
pos=a;
}
}
int val=openList[pos];
openList.erase(openList.begin()+pos);
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
tiempoConsumido=tiempoConsumido+elapsed_secs;
return val;
}
void aStar(int a,int b){
vector<int>openList,closeList;
vector<float*>score(V);//0:F(G+H) , 1:G Peso, 2:Heuristic,3:Estado (1:OpenList,2:CloseList)
int path[V]={-1};
openList.push_back(a);
score[a]=new float[4];
score[a][0]=score[a][1]=score[a][2]=score[a][3]=0;
while(openList.size()>0){
int temp=menor(score,openList);
//cout<<"temp: "<<temp<<endl;
closeList.push_back(temp);
score[temp][3]=2;
if(temp==b){
break;
}
list<pair<int,float> >::iterator vecino;
for (vecino = adj[temp].begin(); vecino !=adj[temp].end(); vecino++) {
int tempN=(*vecino).first;
//if(!pertenece(closeList,tempN)){
float F,G,H;
float pesoTempN=(*vecino).second;
G=pesoTempN+score[temp][1];
//H=(dEuclidiana(coord[tempN],coord[b]));//Basica
//H=(dEuclidianaManhatan(coord[tempN],coord[b]))+breakTies(coord[a],coord[b],coord[tempN]);//Mejor
//H=(dEuclidiana2(coord[tempN],coord[b]));//Mucho mejor
//H=(dEuclidiana2(coord[tempN],coord[b]))+breakTies(coord[a],coord[b],coord[tempN]);//Mucho pero no tanto mejor
H=diagonalDistance(coord[tempN],coord[b])+breakTies(coord[a],coord[b],coord[tempN]);
//H=dEuclidiana3(coord[tempN],coord[b])+breakTies(coord[a],coord[b],coord[tempN]);
F=G+H;
if(score[tempN]!=NULL){
if(score[tempN][3]==1){
if(G<score[tempN][1]){
score[tempN][0]=F;
score[tempN][1]=G;
score[tempN][2]=H;
path[tempN]=temp;
}
}
}
else{
openList.push_back(tempN);
float*scoreTemp=new float[4];
scoreTemp[0]=F;
scoreTemp[1]=G;
scoreTemp[2]=H;
scoreTemp[3]=1;
path[tempN]=temp;
score[tempN]=scoreTemp;
}
}
}
/*
for(int x=0;x<V;x++){
if(score[x]!=NULL){
cout<<"### "<<x<<" ####"<<endl;
cout<<"F: "<<score[x][0]<<" ";
cout<<"G: "<<score[x][1]<<" ";
cout<<"H: "<<score[x][2]<<" ";
cout<<"Path: "<<path[x]<<" ";
cout<<endl;
}
}
*/
/*
if(closeList[closeList.size()-1]==b){
vector<int>camino;
int bTemp=b;
while(bTemp!=-1){
//cout<<"btemo "<<bTemp<<endl;
camino.push_back(bTemp);
bTemp=path[bTemp];
}
for(int x=camino.size();x>0;x--)
cout<<camino[x-1]<<",";
cout<<endl;
}
else
cout<<"No hay camino"<<endl;
*/
}
/*
void buscarCamino(int a,int b){
int*aCamino,*bCamino;
vector<int>*centroides(10);
for(int xc=0;xc<centroides.size();xc++){
centroides=rand()%V;
}
}
*/
};
int main(){
/* int tam=10;
Graph Grafo(tam);
float coordInicio[tam*2]={0,0,5,0,1,3,4,3,0,6,2,6,6,6,1,8,5,8,6,9};
int j=0;
for(int x=0;x<tam;x++){
Grafo.addNode(x,coordInicio[j],coordInicio[j+1]);
j=j+2;
}
Grafo.addEdge(0,1,10.0);
Grafo.addEdge(0,2,20.0);
Grafo.addEdge(0,4,20.0);
Grafo.addEdge(2,4,80.0);
Grafo.addEdge(2,1,5.0);
Grafo.addEdge(2,5,6.0);
Grafo.addEdge(1,3,15.0);
Grafo.addEdge(1,6,10.0);
Grafo.addEdge(3,5,7.0);
Grafo.addEdge(5,6,1.0);
Grafo.addEdge(5,7,6.0);
Grafo.addEdge(5,8,20.0);
Grafo.addEdge(6,8,3.0);
Grafo.addEdge(7,8,12.0);
*/
//Grafo.aStar(0,9);
//Grafo.print();
int nv, ne, u, v;
float w;
cin >> nv >> ne;
Graph g(nv);
float x,y;
for(int a=0;a<nv;a++){
cin >> x >> y;
g.addNode(a, x, y);
}
int*camino;
//printCoord(g.coord);
for(int a=0;a<ne;a++){
cin >> u >> v >> w;
g.addEdge(u, v, w);
}
//g.aStar(0,nv-1);
clock_t begin = clock();
for(int count=0;count<1000;count++){
g.aStar(rand()%nv,rand()%nv);
}
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
cout<<"en seg: "<<elapsed_secs<<endl;
cout<<"Tiempo De fundion: "<<tiempoConsumido<<endl;
return 0;
}
|
a630e5a3dc36f4b11cae720224b62261cec72fea
|
9556aa97e91ea3c6d219128d7e821393cfc850fc
|
/Thirdparty/Gc/Math/Constant.h
|
1ff197bdcead583d219e7be13fe3bde03a6090cd
|
[
"LGPL-2.1-only",
"LicenseRef-scancode-other-permissive",
"MPL-2.0",
"GPL-3.0-only",
"BSD-3-Clause",
"BSL-1.0",
"Apache-2.0",
"MIT"
] |
permissive
|
dyollb/osparc-iseg
|
2f033b46f94dd4264489894618b9ab5554e9c8cb
|
9b85cdce87f589b216914782f4b2b8b6ed69bf06
|
refs/heads/master
| 2023-05-28T00:43:36.689182
| 2023-05-12T14:26:15
| 2023-05-12T14:26:15
| 126,824,315
| 1
| 0
|
MIT
| 2019-02-26T13:45:48
| 2018-03-26T12:19:25
|
C++
|
UTF-8
|
C++
| false
| false
| 1,328
|
h
|
Constant.h
|
/*
This file is part of Graph Cut (Gc) combinatorial optimization library.
Copyright (C) 2008-2010 Centre for Biomedical Image Analysis (CBIA)
Copyright (C) 2008-2010 Ondrej Danek
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Graph Cut library. If not, see <http://www.gnu.org/licenses/>.
*/
/**
@file
Mathematical constants.
@author Ondrej Danek <ondrej.danek@gmail.com>
@date 2009
*/
#ifndef GC_MATH_CONSTANT_H
#define GC_MATH_CONSTANT_H
#include "../Type.h"
namespace Gc {
namespace Math {
/** Mathematical constants. */
namespace Constant {
/** \f$ \pi \f$ number. */
const Float64 Pi = 3.14159265358979323846;
/** Euler number. */
const Float64 E = 2.7182818284590452354;
} // namespace Constant
}
} // namespace Gc::Math
#endif
|
d7bb5bd0b2b7b8f4ad9070950772e26243e4e5d6
|
9ef9a26801cb9c5e733f1b75ad3037034ed10a46
|
/code/vj/kuangbin7/g.cpp
|
2d8bfc48bda50441be79a2a115200639cdbbddd3
|
[] |
no_license
|
shi-yang/algorithms
|
5c8e07fdff4689a5790f329153c0fe18ba0ce65a
|
cb7a75fdfa1af6c83625ab7f6930710965337776
|
refs/heads/master
| 2021-07-17T02:14:40.713967
| 2017-10-25T12:43:32
| 2017-10-25T12:43:32
| 82,473,964
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,226
|
cpp
|
g.cpp
|
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 50005;
struct edge {
int mi, mx;
} e[maxn << 2];
void pushup(int rt)
{
e[rt].mi = min(e[rt << 1].mi, e[rt << 1 | 1].mi);
e[rt].mx = max(e[rt << 1].mx, e[rt << 1 | 1].mx);
}
void build(int l, int r, int rt)
{
if (l == r) {
int x;
scanf("%d", &x);
e[rt].mi = e[rt].mx = x;
} else {
int m = (l + r) >> 1;
build(l, m, rt << 1);
build(m + 1, r, rt << 1 | 1);
pushup(rt);
}
}
int query(int ll, int rr, int l, int r, int rt, int c)
{
if (ll <= l && r <= rr) {
if (c) return e[rt].mx;
else return e[rt].mi;
}
int m = (l + r) >> 1;
if (c) {
int ans = 0;
if (ll <= m)
ans = max(ans, query(ll, rr, l, m, rt << 1, c));
if (rr > m)
ans = max(ans, query(ll, rr, m + 1, r, rt << 1 | 1, c));
return ans;
} else {
int ans = 1e9;
if (ll <= m)
ans = min(ans, query(ll, rr, l, m, rt << 1, c));
if (rr > m)
ans = min(ans, query(ll, rr, m + 1, r, rt << 1 | 1, c));
return ans;
}
}
int main()
{
int n, q;
scanf("%d %d", &n, &q);
build(1, n, 1);
while (q--) {
int a, b;
scanf("%d%d", &a, &b);
int mx = query(a, b, 1, n, 1, 1);
int mi = query(a, b, 1, n, 1, 0);
printf("%d\n", mx - mi);
}
return 0;
}
|
9aeb12119d25b059f6d91f55b747c6c052b70985
|
87f37ee31b50d4df37c98ee3df2569de4052d6e3
|
/Person-Recognizer/main.cpp
|
756a41e26367c890ed556e0f214eba32e56ca1cb
|
[] |
no_license
|
liu6tot/CV_tutorial
|
d890a85d4707a198e517571c583951d231aa949a
|
1d9705fdb354451b57f161b891290845d1b32b6b
|
refs/heads/master
| 2021-01-23T01:26:07.033497
| 2017-03-31T07:45:22
| 2017-03-31T07:45:22
| 85,906,895
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,005
|
cpp
|
main.cpp
|
/*
* File: main.cpp
* Author: Eyal Arubas <EyalArubas at gmail>
*/
/** Includes: **/
#include <cstdlib>
#include "defs.h"
#include "FramesReader.h"
#include "FramesWriter.h"
#include "CsvWriter.h"
#include "FaceDetector.h"
#include "PersonRecognizer.h"
using namespace std;
void read_training_set(const string &list_path, vector<Mat> &images) {
ifstream file(list_path.c_str());
string path;
while (getline(file, path)) {
images.push_back(imread(path, CV_LOAD_IMAGE_GRAYSCALE));
}
}
int main(int argc, char** argv) {
/** Initializations: **/
FramesReader fr(string(IN_VID), START_FRAME, END_FRAME, FRAMES_DELTA);
Size frame_size(fr.getSize()); //frame size of the input video
FaceDetector fd(string(CASCADE_PATH), DET_SCALE_FACTOR, DET_MIN_NEIGHBORS, DET_MIN_SIZE_RATIO, DET_MAX_SIZE_RATIO);
vector<Mat> training_set;
vector<Rect> faces;
Mat m;
int c = START_FRAME == -1 ? 0 : START_FRAME - 1;
#ifdef WRITE_OUTPUT
FramesWriter fw(string(OUT_VID), OUT_FPS, frame_size, OUT_FOURCC);
#endif
#ifdef WRITE_CSV
CsvWriter cw(string(CSV_FILE));
#endif
read_training_set(string(TRAINING_LIST), training_set);
PersonRecognizer pr(training_set, LBPH_RADIUS, LBPH_NEIGHBORS, LBPH_GRID_X, LBPH_GRID_Y, LBPH_THRESHOLD);
/**********************/
while (fr.getNext(m)){
c++;
#ifdef WRITE_OUTPUT
cw.addEntry(format("%d", c)); //write frame number
#endif
//detect faces in the image:
fd.findFacesInImage(m, faces);
bool has_match = false;
double match_conf = 0;
//analyze each detected face:
for (vector<Rect>::const_iterator face = faces.begin() ; face != faces.end() ; face++){
Scalar color = NO_MATCH_COLOR;
Mat face_img = m(*face);
double confidence = 0;
bool face_match = false;
//try to recognize the face:
if (pr.recognize(face_img, confidence)){
color = MATCH_COLOR;
has_match = true;
face_match = true;
match_conf = confidence;
}
Point center(face->x + face->width * 0.5, face->y + face->height * 0.5);
circle(m, center, FACE_RADIUS_RATIO * face->width, color, CIRCLE_THICKNESS, LINE_TYPE, 0);
#ifdef WRITE_OUTPUT
cw.addEntry(format("%f", face_match ? confidence : 0)); //write confidence of current face
#endif
}
#ifdef WRITE_OUTPUT
cw.nextLine();
#endif
//write some information on the frame:
putText(m, "Face recognition demo (frontal)", POS_TITLE,
FONT, SCALE_TITLE, FONT_COLOR, THICKNESS_TITLE, LINE_TYPE);
putText(m, "http://blog.eyalarubas.com/category/opencv/", POS_LINK,
FONT, SCALE_LINK, FONT_COLOR, THICKNESS_LINK, LINE_TYPE);
putText(m, format("Frame: %d", c), cvPoint(10, m.rows - 105),
FONT, 2, FONT_COLOR, 1, LINE_TYPE);
putText(m, format("FPS: %d", 15), cvPoint(10, m.rows - 80),
FONT, 2, FONT_COLOR, 1, LINE_TYPE);
putText(m, format("Faces: %d", faces.size()), cvPoint(10, m.rows - 55),
FONT, 2, FONT_COLOR, 1, LINE_TYPE);
putText(m, format("Match: %s", has_match ? "True" : "False"), cvPoint(10, m.rows - 30),
FONT, 2, FONT_COLOR, 1, LINE_TYPE);
putText(m, format("Confidence: %f", has_match ? match_conf : 0), cvPoint(10, m.rows - 5),
FONT, 2, FONT_COLOR, 1, LINE_TYPE);
#ifdef SHOW_OUTPUT
imshow("Output",m);
if ('x' == waitKey(1)){
return 0;
}
#endif
#ifdef WRITE_OUTPUT
fw.write(m);
#endif
}
return 0;
}
|
dd5753225d8323d367f1caeaa073a85998e5c5ef
|
55903a9564931b4579e5c5030376f0989d15b00e
|
/P2pNet/UdpCmdCallBack.h
|
9a57033b82ef55636be7e02257f2d68fb117ff76
|
[] |
no_license
|
zhenyouluo/liveshow_r2
|
04b391fd9ba4e809a88aa1e4eed1477ac4e9ef88
|
300441c14ed31cfa10ec0459bac5a67693f592ea
|
refs/heads/master
| 2020-12-26T00:35:26.403288
| 2012-09-10T02:28:22
| 2012-09-10T02:28:22
| null | 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 566
|
h
|
UdpCmdCallBack.h
|
#pragma once
#include "cmdbase.h"
class PeerMgr;
class UdpCmdCallBack :
public UdpCmdBase
{
public:
UdpCmdCallBack(void);
~UdpCmdCallBack(void);
//处理指令
virtual int process(PeerMgr &mgr,UdpListenerTask &udp_task_,ACE_INET_Addr &remote_addr_);
//反序列化数据
virtual void deserialize(const char* buffer_,ssize_t len_);
//序列化数据
virtual ACE_Message_Block* serialize(ACE_UINT32 seqId,ACE_UINT32 chId,PeerID peerId) ;
ACE_Message_Block* serialize(PeerMgr &mgr_,ACE_UINT32 seqId,ACE_UINT32 chId,PeerID peerId) ;
};
|
f9a2571019197ee76e42141b2a462ddb7c352b87
|
16c394831912c70b47edb63903884f37d90bc7b5
|
/interface/SelectionFit.h
|
69bbc029c9fee96718ef1212558d28cc5610a5c2
|
[] |
no_license
|
matthewkenzie/Bs2KstKst
|
19d48b7a42f9b364bbf5a078c7ea523b6af84745
|
411af400f92f82400606a3f21de5b68659507546
|
refs/heads/master
| 2021-01-13T14:28:13.867620
| 2015-04-20T11:00:45
| 2015-04-20T11:00:45
| 24,888,071
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 357
|
h
|
SelectionFit.h
|
#ifndef SelectionFit_h
#define SelectionFit_h
#include "../interface/FitterBase.h"
class SelectionFit : public FitterBase {
public:
SelectionFit(TString wsname="w");
~SelectionFit();
void addObsVars();
void addCuts();
void addDatasets();
void constructPdfs();
void run();
private:
void makeDataPlot();
};
#endif
|
1cb40f93a86832ac080bc34bf475a04d71b67b60
|
18fc6586d07398a2766ac7343ba63bc924d94350
|
/include/eventpp/httpc/response.hpp
|
16cdab83b3ec7a8efbf0d26966223e15f503b433
|
[
"BSD-3-Clause"
] |
permissive
|
msaf1980/eventpp
|
6790e44f5b17e51c02fb61f1fca15b8344b65ff8
|
10c291a10f81b79501e1f207a66a5cc6a5da444c
|
refs/heads/master
| 2023-07-13T22:26:27.617410
| 2021-08-24T18:05:00
| 2021-08-24T18:05:00
| 399,223,906
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 943
|
hpp
|
response.hpp
|
#ifndef __EVENT_RESPONSE_HPP__
#define __EVENT_RESPONSE_HPP__
#include <map>
#include "eventpp/base.hpp"
#include "eventpp/event_loop.hpp"
#include "eventpp/slice.hpp"
struct evhttp_request;
namespace eventpp {
namespace httpc {
class Request;
class EVPP_EXPORT Response {
public:
typedef std::map<eventpp::Slice, eventpp::Slice> Headers;
Response(Request* r, struct evhttp_request* evreq, bool had_ssl_error = false);
~Response();
int http_code() const {
return http_code_;
}
bool had_ssl_error() const {
return had_ssl_error_;
}
const eventpp::Slice& body() const {
return body_;
}
const Request* request() const {
return request_;
}
const char* FindHeader(const char* key);
private:
Request* request_;
struct evhttp_request* evreq_;
int http_code_;
bool had_ssl_error_;
eventpp::Slice body_;
};
}
}
#endif // __EVENT_RESPONSE_HPP__
|
353ca087fc4681e03fa537c26a02b562fdbd3e26
|
2d767e619daa46871c93d98007f78974d444ab71
|
/message.cpp
|
e928281f5370d87fe0a23a5a22fb04664a7cded2
|
[] |
no_license
|
mrbrainsample/qtnotifydaemon
|
ec033fa45528fbbf9c1217db654edbb1a9431ca4
|
642698c9aeda5fdd0707cb1df9f9faa944ba71b5
|
refs/heads/master
| 2020-12-10T04:29:37.008666
| 2017-03-02T04:19:57
| 2017-03-02T04:19:57
| 83,618,323
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 474
|
cpp
|
message.cpp
|
#include "notifyarea.h"
#include <QPixmap>
Message::Message()
{
timeout = 3000;
urgency=1;
id = 0;
app_name = "";
text = "";
header = "";
isComplete = false;
}
Message::Message(const Message &t)
{
icon = new QPixmap;
icon = t.icon;
action = t.action;
timeout = t.timeout;
urgency = t.urgency;
app_name = t.app_name;
text = t.text;
header = t.header;
isComplete = t.isComplete;
hints = t.hints;
}
Message::~Message()
{
if(icon!=NULL)
{
delete icon;
icon = NULL;
}
}
|
d80b0b71c9f7b2ed0ed9368491eddab3af351fcf
|
9c7c58220a546d583e22f8737a59e7cc8bb206e6
|
/Project/MyProject/MyProject/Source/MyProject/Private/MyEngine/MyBase/Frame/MyGameUserSettingsBase.h
|
fced2ee1fa1800198412dff8b31efdfe200115c2
|
[] |
no_license
|
SiCoYu/UE
|
7176f9ece890e226f21cf972e5da4c3c4c4bfe41
|
31722c056d40ad362e5c4a0cba53b05f51a19324
|
refs/heads/master
| 2021-03-08T05:00:32.137142
| 2019-07-03T12:20:25
| 2019-07-03T12:20:25
| null | 0
| 0
| null | null | null | null |
WINDOWS-1252
|
C++
| false
| false
| 438
|
h
|
MyGameUserSettingsBase.h
|
#pragma once
#include "GameFramework/GameUserSettings.h"
#include "MyGameUserSettingsBase.generated.h"
/**
* @brief
ÔÚÕâÀïÉèÖÃ
DefaultEngine.ini
[/Script/EngineSettings.GameMapsSettings]
GameUserSettingsClassName=/Script/MyProject.MyTPUserSettings
*/
UCLASS()
class UMyGameUserSettingsBase : public UGameUserSettings
{
GENERATED_UCLASS_BODY()
// interface UGameUserSettings
virtual void SetToDefaults() override;
};
|
5019f8bb1af6d8cfac55d8ad91de538fe5bbd4e5
|
f4a52a7dd6f6266878f4351934f99ea5174663e4
|
/hw26/B1.cpp
|
ec0c3d756ccebe22b81bff33ba36e0efb7b6872b
|
[] |
no_license
|
askoulwassim/Algorithms-and-Data-Structures
|
8aa8e831c5e6bdc788a59f1c4033f4496ae2f3d4
|
60e15c8a1bb463ed46dafaecbdc2ec2d952e395b
|
refs/heads/master
| 2020-04-08T01:21:25.054788
| 2018-11-24T01:13:45
| 2018-11-24T01:13:45
| 158,890,506
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 240
|
cpp
|
B1.cpp
|
#include <iostream>
#include <math.h>
using namespace std;
int fnc(int x)
{
if (x > 0) {
return fnc(x-2) + fnc(x-4) + fnc(x-6);
}
else
return x;
};
int main()
{
int x = 70;
int a = fnc(x);
cout << a << endl;
}
|
02c28b3f84a97eab5d7f92fc6a6086ee56ede1b1
|
6cb3eb77b3ff98c78a5a6ee01e16349a5199841c
|
/3/3/3.cpp
|
0984d3f82303901cc02d6302566fa3b2b66dc5af
|
[] |
no_license
|
KischenkoVladislava/Lab_2
|
4a70a912917a67f7f71c6efb0841e78f09509de6
|
c9e7a0ccd747631d30f7931196cf3c028230953f
|
refs/heads/master
| 2023-08-22T22:05:33.168195
| 2021-10-31T21:38:00
| 2021-10-31T21:38:00
| 423,266,016
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 447
|
cpp
|
3.cpp
|
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int f[100];
int n = 0;
f[0] = 1;
f[1] = 1;
for (int i=2; i < 100; i++)
{
f[i] = f[i-1] + f[i-2];
if ((f[i] > 999) && (f[i] < 10000))
{
n = n + 1;
}
}
cout << "Количество четырехзначных чисел в ряде Фибоначчи: " << n;
return 0;
}
|
966707b49439be12c35914ab15003608cc46e1d5
|
0feb5832e9790a430d475e11ed2eeed9a790e59d
|
/src/customtimer.cpp
|
78a5294195a92f6aab3e21f8a1f5f6d804035237
|
[] |
no_license
|
apmechev/GUTimer
|
c517f78fe31e9d47b25cd0bb3912306d77549599
|
9e53bced86a15dcadf8ab986923cfcb002842ea0
|
refs/heads/master
| 2021-01-01T05:16:17.200197
| 2019-02-20T14:02:45
| 2019-02-20T14:02:45
| 56,753,164
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 467
|
cpp
|
customtimer.cpp
|
#include "customtimer.h"
customtimer::customtimer(std::string type)
{
//ctor
}
customtimer::~customtimer()
{
//dtor
}
customtimer& customtimer::operator=(const customtimer& rhs)
{
if (this == &rhs) return *this; // handle self assignment
//assignment operator
return *this;
}
uint64_t customtimer::ClockGetTime()
{
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
return (uint64_t)ts.tv_sec * 1000000LL + (uint64_t)ts.tv_nsec ;
}
|
1f72e5b5b39a53c1b6ef3b3a663b647a8b0e8be7
|
a803f31a447f90376a95d0034108703f9b2c7c9c
|
/Src/Pagerank/Pagerank.hpp
|
ac83ae4ab3dc7be1ce5bc706ea20f318db60548c
|
[] |
no_license
|
LaiosDimitris/pagerank
|
b29a9283dff145ef029bf94b774b2a5d47f06eff
|
b2da80b35d29e6b03f45e6d3feb0e922bcd5e4fd
|
refs/heads/master
| 2023-04-10T14:54:52.796817
| 2021-04-08T18:00:23
| 2021-04-08T18:00:23
| 355,960,791
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 407
|
hpp
|
Pagerank.hpp
|
#include "../Matrix/Matrix.hpp"
#include "../Surfer/Surfer.hpp"
#include "../Webpage/Webpage.hpp"
class Pagerank
{
public:
Pagerank(int pages, int surfers, int rounds, double damping_factor);
void random_surfer_walk();
void rank_webpages();
void print_pagerank();
private:
std::vector<Surfer> surfers;
std::vector<Webpage> webpages;
double damping_factor;
int rounds;
};
|
5467b438377ef3bb73e4e0fddab61b2bc399e53b
|
55e18224e94d62c8967e82d8b91ea24c65ffda10
|
/Vector Model.cpp
|
7800f7c556601e93b6426c3a92841c2e67277110
|
[] |
no_license
|
keygenx/N-Vector-Model
|
f978e5d5d675d41016e90b0dae5613b5fff2e414
|
18ca691a3248f331c594b12a64b5885f8a5eb8a6
|
refs/heads/master
| 2020-03-08T19:24:16.783789
| 2018-04-11T06:30:58
| 2018-04-11T06:30:58
| 128,351,533
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 12,153
|
cpp
|
Vector Model.cpp
|
#include "stdafx.h" //Precompiled Headers used while working with Visual Studio.
#include <mathimf.h> //Intel optimized math library. Replace it with math.h if not available.
#include <omp.h> //OpenMP for Parallelization
#include <chrono> //Chrono for Timing
#include <iostream>
//#include <random>
#include <fstream>
#include <string>
//Using Boost Library
#include <boost/random/uniform_real.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/variate_generator.hpp>
//Simulation Parameters
#define vd 2 //Dimension of Vector. vd>=1
#define ld 2 //Dimension of Lattice. ld>=1
#define n 20 //No of lattice points along each side
#define latlen 400 //Total number of lattice points = n^ld .You'll get segmentation fault if you set it wrong.
#define thetamax 3.14/4.0 //Maximum angle while generating a random angle
#define tempmin 1 //min temperature in units of 0.01
#define tempmax 8 //max temperature in units of 0.01
#define tempsteps 1 //temperature steps in units of 0.01
#define maxthreads 8 //Maximum number of parallel threads to use
#define measurelen 50 //Number of sweeps after which measurement has to be taken
#define measurenum 20000 //Number of measurements to take
#define equibsweep 40000 //Number of sweeps to run to equilibriate
#define folder "output" //Name of the output directory. Create the folder before running
#define j 1 //coupling parameter in the hamiltonian
double b[vd] = {}; //external field in the hamiltonian
//Some definitions to make timing easier. Change 'steady_clock' to 'monotonic_clock' for older c++ standards
#define startt starttime = chrono::steady_clock::now() //start counting
#define endt endtime = chrono::steady_clock::now() //End counting
#define showt chrono::duration_cast<chrono::milliseconds>(endtime - starttime).count() //show time elapsed
using namespace std;
/*
///Globally defining random number generators
uniform_real_distribution<double> angle(-thetamax, +thetamax);
uniform_real_distribution<double> metro(0, 1);
uniform_int_distribution<unsigned int> vect(0, vd - 1);
uniform_int_distribution<unsigned int> posi(0, n - 1);
mt19937 rng1, rng2;
#pragma omp threadprivate(rng1,rng2,angle,metro,vect,posi,b)
*/
//Mersenne twister Psuedo Random Number Generator with seed = 1 . u means the datatype is long
boost::mt19937 rng1(1u);
//threadprivate makes an independent copy of variable rng1 for each thread so that they dont have to share the same memory
#pragma omp threadprivate(rng1)
//Some random variables we'll eventually use
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > vect(rng1, boost::uniform_int<> (0,vd-1));
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > posi(rng1, boost::uniform_int<>(0, n-1));
boost::variate_generator<boost::mt19937&, boost::uniform_real<> > angle(rng1, boost::uniform_real<>(-thetamax, +thetamax));
boost::uniform_01<boost::mt19937> metro(rng1);
//Making a copy of the random variables for each thread
#pragma omp threadprivate(vect,posi,angle,metro,b)
unsigned int l(unsigned int* pos)
{
unsigned int len = 0;
for (unsigned int i = 0;i < ld;i++)
len += pos[i] * (unsigned int)pow(n, i);
return len;
}
//Returns vec1.vec2
double dot(double *vec1, double *vec2)
{
double temp = 0.0;
for (unsigned int i = 0;i < vd;i++)
temp += vec1[i] * vec2[i];
return temp;
}
//vec = {0,0,...,0}
void vectorzero(double* vec)
{
#pragma ivdep
for (unsigned int i = 0;i < vd;i++)
vec[i] = 0;
}
//tempvec=vec;
void vectorcpy(double* tempvec, double* vec)
{
#pragma ivdep
for (unsigned int i = 0; i < vd; i++)
tempvec[i] = vec[i];
}
//vec1 = vec2 + vec3
void vectoradd(double* vec1, double* vec2, double val)
{
#pragma ivdep
for (unsigned int i = 0; i < vd; i++)
vec1[i] += val*vec2[i];
}
//vec1 = val2*vec2 + val3*vec3
void vectoradd(double* vec1, double* vec2, double val2, double* vec3, double val3)
{
#pragma ivdep
for (unsigned int i = 0; i < vd; i++)
vec1[i] += val2*vec2[i] + val3*vec3[i];
}
//vec is randomly rotated and the value is stored in tempvec.
//Random rotation is achieved by choosing 2 components of the vector at random and rotating it using 2D rotation matrix.
//It can be shown that this satisfies detailed balance and would eventually span the whole configuration space.
void vectorrandrot(double* tempvec, double* vec)
{
if(vd==1)
{
tempvec[0] = -vec[0];
}
else
{
double theta = angle();
unsigned int t1 = vect(), t2 = vect();
while (t1 == t2)
{
t2 = vect();
}
#pragma ivdep
for (unsigned int i = 0;i < vd;i++)
{
if (i == t1) tempvec[i] = sin(theta)*vec[t2] + cos(theta)*vec[t1];
else if (i == t2) tempvec[i] = -sin(theta)*vec[t1] + cos(theta)*vec[t2];
else tempvec[i] = vec[i];
}
}
}
//tempvec is assigned with a randomly oriented unit vector. Note: it's not uniformly distribution on a n-sphere.
void vectorrand(double* tempvec)
{
double abs = 0.0;
for (unsigned int i = 0;i < vd;i++)
{
tempvec[i] = angle(); //Generating a random real.Using angle() since I didn't want to use another random variable.
abs += tempvec[i] * tempvec[i]; //Calculating absolute value of the vector
}
abs = sqrt(abs);
for (unsigned int i = 0;i < vd;i++)
{
tempvec[i] = tempvec[i] / abs; //Normalizing the vector
}
}
//Returns norm of tempvec
double vectorabs(double* tempvec)
{
double abs = 0.0;
for (unsigned int i = 0;i < vd;i++)
{
abs += tempvec[i] * tempvec[i];
}
return sqrt(abs);
}
void poscpy(unsigned int* temppos, unsigned int* pos)
{
for (unsigned int i = 0; i < ld; i++)
temppos[i] = pos[i];
}
void posrand(unsigned int* pos)
{
for (unsigned int i = 0;i < ld;i++)
{
pos[i] = posi();
}
}
void nearestneighbour(double **lattice, unsigned int pos[ld], double npossum[vd])
{
unsigned int temppos[ld];
vectorzero(npossum);
poscpy(temppos, pos);
for (unsigned int i = 0;i < ld;i++)
{
if (pos[i] == n - 1)
{
temppos[i] --;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i] = 0;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
else if (pos[i] == 0)
{
temppos[i] ++;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i] = n - 1;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
else
{
temppos[i] ++;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i] -= 2;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
temppos[i] = pos[i];
}
}
void latticeinirand(double** templat)
{
for (unsigned int i = 0;i < latlen;i++)
{
vectorrand(templat[i]);
}
}
void latticeini1(double** templat)
{
for (unsigned int i = 0;i < latlen;i++)
{
for (unsigned int k = 0;k < vd;k++)
templat[i][k] = 1.0;
}
}
double latticeenergy(double **lattice)
{
double tempenergy = 0.0;
double npossum[vd] = {};
unsigned int pos[ld] = {};
unsigned int kld = 0;
while (pos[ld - 1] != n)
{
kld = 0;
if (pos[kld] < n)
{
vectorzero(npossum);
nearestneighbour(lattice, pos, npossum);
tempenergy += -dot(b, lattice[l(pos)]) - j*dot(lattice[l(pos)], npossum);
pos[kld]++;
}
else
while (pos[kld] == n && pos[ld - 1] != n)
{
pos[kld] = 0;
kld++;
pos[kld]++;
}
}
return tempenergy / 2.0;
}
void latticemag(double **lattice, double* mag)
{
vectorzero(mag);
for (unsigned int i = 0;i < latlen;i++)
vectoradd(mag, lattice[i], 1.0);
}
double latticemagabs(double **lattice)
{
double mag[vd] = {};
for (unsigned int i = 0;i < latlen;i++)
vectoradd(mag, lattice[i], 1.0);
return vectorabs(mag);
}
void latticeexport(double** lattice, double t)
{
ofstream lwrite;
lwrite.open("./" folder "/lat_ld" + to_string((long long)ld) + "_vd" + to_string((long long)vd) + "_n" + to_string((long long)n) + "_t" + to_string((long double)t) + ".csv");
for (unsigned int i1 = 0;i1 < latlen;i1++)
{
lwrite << lattice[i1][0];
unsigned int i2 = 1;
while (i2 < vd)
{
lwrite << "," << lattice[i1][i2];
i2++;
}
lwrite << "\n";
}
lwrite.close();
}
void latticecopy(double** newlattice, double** oldlattice)
{
for (unsigned int i = 0;i < latlen;i++)
for (unsigned int k = 0;k < vd;k++)
newlattice[i][k] = oldlattice[i][k];
}
double runmcmc(double **lattice, unsigned int sweeps, double t, int measure)
{
unsigned int pos[ld],temppos[ld];
double acceptance = 0.0;
double tempvec[vd], ediff, energy, mag[vd];
double theta;
unsigned int t1 , t2 ;
double* vec;
//Initializing energy and magnetization
ofstream fileenergy;
ofstream filemag;
if (measure > 1)
{
energy = latticeenergy(lattice);
latticemag(lattice, mag);
fileenergy.open("./" folder "/latenergy_ld" + to_string((long long)ld) + "_vd" + to_string((long long)vd) + "_n" + to_string((long long)n) + "_t" + to_string((long double)t) + ".csv");
filemag.open("./" folder "/latmag_ld" + to_string((long long)ld) + "_vd" + to_string((long long)vd) + "_n" + to_string((long long)n) + "_t" + to_string((long double)t) + ".csv");
}
for (unsigned int i = 0;i < sweeps;i++)
{
for (unsigned int k = 0;k < latlen;k++)
{
posrand(pos);
//nearestneighbour(lattice, pos, npossum);
vec = lattice[l(pos)];
//Start:: Nearest Neighbour Code
//vectorzero(npossum);
double npossum[vd] = {};
poscpy(temppos, pos);
for (unsigned int i2 = 0;i2 < ld;i2++)
{
if (pos[i2] == n - 1)
{
temppos[i2] --;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i2] = 0;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
else if (pos[i2] == 0)
{
temppos[i2] ++;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i2] = n - 1;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
else
{
temppos[i2] ++;vectoradd(npossum, lattice[l(temppos)], 1.0);
temppos[i2] -= 2;vectoradd(npossum, lattice[l(temppos)], 1.0);
}
temppos[i2] = pos[i2];
}
//End:: Nearest Neighbour Code
//vectorrandrot(tempvec, vec);
//Start:: Vector random rotation code
theta = angle();
t1 = vect(); t2 = vect();
while (t1 == t2)
{
t2 = vect();
}
#pragma ivdep
for (unsigned int i1 = 0;i1 < vd;i1++)
{
if (i1 == t1) tempvec[i1] = sin(theta)*vec[t2] + cos(theta)*vec[t1];
else if (i1 == t2) tempvec[i1] = -sin(theta)*vec[t1] + cos(theta)*vec[t2];
else tempvec[i1] = vec[i1];
}
//End:: Vector random rotation code
ediff = - j*(dot(npossum, tempvec) - dot(npossum, vec));
if (metro() < exp(-ediff / t))
{
if (measure > 1)
{
energy += ediff;
vectoradd(mag, vec, -1.0, tempvec, +1.0);
}
vectorcpy(vec, tempvec);
acceptance += 1.0;
}
}
if (measure > 1 && i%measurelen==0)
{
fileenergy << energy << "\n";
filemag << mag[0];
for (unsigned int i = 1;i < vd;i++)
filemag << "," << mag[i];
filemag << "\n";
}
}
filemag.close();
fileenergy.close();
return acceptance / (sweeps*latlen);
}
int main()
{
omp_set_num_threads(maxthreads);
#pragma omp parallel
{
auto starttime = chrono::steady_clock::now(); //Change 'steady_clock' to 'monotonic_clock' for older c++ standards
auto endtime = chrono::steady_clock::now(); //Change 'steady_clock' to 'monotonic_clock' for older c++ standards
double acc;
//Dynamically allocating array to store the lattice (each thread has its own separate copy)
double **lattice = new double*[latlen];
for (unsigned int i = 0; i < latlen; ++i)
{
lattice[i] = new double[vd];
}
#pragma omp for
for (int t = tempmin;t <= tempmax; t+= tempsteps)
{
startt;
latticeinirand(lattice);
//run simulation for 40000 sweeps
acc=runmcmc(lattice, equibsweep, 0.01*(double)t, 0);
endt;
printf("Equilibration:: t=%f__acc=%f__Time=%I64d__Thread=%d\n", 0.01*(double)t, acc, showt, omp_get_thread_num());
latticeexport(lattice, 0.01*(double)t);
startt;
acc = runmcmc(lattice, measurelen*measurenum, 0.01*(double)t, 2);
endt;
printf("Measurement:: t=%f__acc=%f__Time=%I64d__Thread=%d\n", 0.01*(double)t, acc, showt, omp_get_thread_num());
}
//Deleting dynamically allocated array storing the lattice
for (unsigned int i = 0; i < latlen; ++i)
{
delete[] lattice[i];
}
delete[] lattice;
}
cout << "The End";
//getchar();
return;
}
|
908ef7f63d1b88d7116102442cbe05db55f30f09
|
da1f4c3ab2df963ae6a6d616c39294ba319d0304
|
/reconstruction/CManageData.h
|
0cacffb600f5a1d244add8a37d65b064764f287e
|
[] |
no_license
|
seed93/reconstruction
|
cd00c0c9cac6bdb086453da6ebdf7fa546420839
|
984d4139bb84e424b2e359e6af5985cdf3782a78
|
refs/heads/master
| 2022-05-26T23:29:44.316216
| 2022-05-20T09:10:58
| 2022-05-20T09:10:58
| 26,626,407
| 54
| 25
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,383
|
h
|
CManageData.h
|
#ifndef CManageData_H
#define CManageData_H
// CManageData.h
// class CManageData
// manage all common images, masks, parameters
#include "SharedInclude.h"
struct Boundary
{
int YL,YR,XL,XR;
int width, height;
};
struct camera
{
cv::Mat CamCenter;
cv::Mat P,MatIntrinsics,MatExtrinsics;
string image_name,mask_name;
cv::Mat image;
cv::Mat mask;
Boundary bound;
vector<int> **bucket;
int camID;
};
class CManageData
{
public:
vector<vector<camera>> cam;
int m_CameraNum; // camera number
int m_CampairNum;
int m_PyrmNum; // number of pyramid levels
cv::Size m_LowestLevelSize; // size of lowest level image
string m_FilePath; // input file path
int isoutput;
string outfilename;
cv::Size m_OriginSize;
cv::Mat **imagePyrm, **maskPyrm;
CManageData();
~CManageData();
bool Init(cv::FileStorage fs);
double WindowToVec(uchar * image_ptr[], int x, int window_size, arma::vec &u); // get pixels of a window in image and return a vec
double WindowToVec(cv::Mat image, int x, int y, int window_size, arma::vec &u)
{
int k = 0;
int x3 = x*3;
int w3 = window_size*3;
for (int i=y; i<y+window_size; i++)
{
uchar *ptr = image.ptr<uchar>(i)+x3;
for (int j=0; j<w3; j++)
u(k++) = ptr[j];
}
u -= mean(u);
double normu = norm(u);
return normu==0?1:normu;
};
bool SaveMat(cv::Mat input, char * filename);
};
#endif
|
fa842a59e954ab76a60c483311584c94762e2ffd
|
31d6af84680f765b365bc880694d0347a199c506
|
/Assignment#2/Art2Trail/Art2Trail/src/ofApp.cpp
|
91ee0d345f8895056088784a8356b93c937c74fd
|
[] |
no_license
|
teacow2/fortugnn_AlgoSims2106
|
cab2d95ea0e6bbb07004b69e67a41f8a726b5719
|
d4b9c61e117f76f8a4d11e7d19bab30fc8bb1bc1
|
refs/heads/master
| 2020-04-17T08:19:35.408968
| 2016-12-15T23:30:43
| 2016-12-15T23:30:43
| 67,743,254
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,370
|
cpp
|
ofApp.cpp
|
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup() {
ofSetVerticalSync(true);
ofEnableAlphaBlending();
for (int i = 0; i< 4; i++) {
rectangle temp;
myRect.push_back(temp);
myRect[i].catchUpSpeed /= i + 1;
// myRect[i].pos.x = 100+(i*20);
// myRect[i].pos.y = 50+(i*10);
myRect[i].pos.x = ofRandom(0.0, ofGetWidth());
myRect[i].pos.y = ofRandom(0.0, ofGetHeight());
myRect[i].rectR += (i * 30);
// myRect[i].rectG += (i * 30);
// myRect[i].rectB += (i * 30);
}
}
//--------------------------------------------------------------
void ofApp::update() {
for (int i = 0; i < 4; i++) {
if (i == 0) {
myRect[i].xenoToPoint(mouseX, mouseY);
}
else {
myRect[i].xenoToPoint(myRect[i - 1].pos.x, myRect[i - 1].pos.y);
}
}
}
//--------------------------------------------------------------
void ofApp::draw() {
for (int i = 0; i < 4; i++) {
myRect[i].draw();
}
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
}
//--------------------------------------------------------------
void ofApp::keyReleased(int key){
}
//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y ){
}
//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){
/* for (int i = 0; i < 4; i++) {
if (i == 0) {
myRect[i].xenoToPoint(mouseX, mouseY);
}
else {
myRect[i].xenoToPoint(myRect[i - 1].pos.x, myRect[i - 1].pos.y);
}
} */
}
//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){
}
//--------------------------------------------------------------
void ofApp::mouseEntered(int x, int y){
}
//--------------------------------------------------------------
void ofApp::mouseExited(int x, int y){
}
//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){
}
//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){
}
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
}
|
07aa31456ec0c72be5ec6be1ea0a0340ee6230da
|
52f72a3b208452e22009526110b33a46eb46b70e
|
/Archive/Engine/Objects/Object.h
|
3dea4e557615fc0c7530226b60077bdf08a4dc1c
|
[] |
no_license
|
lineCode/Berserk
|
b5bb1e66b2062e78ff51643c2c81dc269800a099
|
5b856a46693f4584c08d2ed335d0c5fba3466601
|
refs/heads/master
| 2020-05-09T16:18:59.103498
| 2019-04-13T21:59:47
| 2019-04-13T21:59:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 929
|
h
|
Object.h
|
//
// Created by Egor Orachyov on 25.07.2018.
//
#ifndef BERSERKENGINE_OBJECT_H
#define BERSERKENGINE_OBJECT_H
#include "Strings/CString.h"
#include "Strings/CStaticString.h"
namespace Berserk
{
class Object
{
public:
Object(const CStaticString& name);
virtual ~Object();
const CString& getName() const;
bool isStatic() const;
protected:
friend class ObjectManager;
INT8 mIsStatic : 1;
INT8 mIsActive : 1;
INT8 mIsVisible : 1;
INT8 mIsPaused : 1;
INT8 mIsEditable : 1;
INT8 mIsAttachable : 1;
INT8 mCastShadows : 1;
INT8 mIsToggleable : 1;
INT8 mIsDamageable : 1;
INT8 mCastLightShafts : 1;
INT8 data2;
INT8 data3;
CString mName;
};
} // namespace Berserk
#endif //BERSERKENGINE_OBJECT_H
|
b9fc439d7ced4c7ebea5f25cdbf2a639efef7a05
|
b617478c1cde912926737f31d9bbcd97a7ef95e4
|
/acceleratedcpp/5/students_lists/src/fail.cpp
|
b0c46ccf9737ad4892fb0791a808c99d4b6f7a96
|
[
"MIT"
] |
permissive
|
kjchalup/algorithm_design
|
bb000764a0bfce2d2365eebda7a306799a7eb230
|
99176322b83d120f0ceb83dbba254a6e15f95264
|
refs/heads/master
| 2021-01-18T23:25:17.106476
| 2017-08-02T22:39:19
| 2017-08-02T22:39:19
| 87,109,968
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 480
|
cpp
|
fail.cpp
|
// Split a list of students into failing and passing lists.
#include "fail.h"
#include "grade.h"
using std::list;
bool fgrade(const Student_info& s){
return grade(s) < 60;
}
data extract_fails(data& students)
{
data fail;
data::iterator iter = students.begin();
while (iter != students.end()) {
if (fgrade(*iter)) {
fail.push_back(*iter);
iter = students.erase(iter);
} else
++iter;
}
return fail;
}
|
d37d3b3dd0dfc5ce36e50ca793ff4221d469d9df
|
214682d54200d6791ca5a202dcaacdce1912e86f
|
/MySoftwarePackage/ppElastic.h
|
7bd1c63e38b6707fb3a09c18e3daa30e4f6c994a
|
[] |
no_license
|
erezcoh4/mySoftware
|
800f4b4524ee74ae9ec8a321892053aeb4cd0256
|
1d0104637970310dec8860dc0491d9697b100574
|
refs/heads/master
| 2021-03-09T12:50:33.785980
| 2019-01-16T06:02:38
| 2019-01-16T06:02:38
| 52,619,643
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,684
|
h
|
ppElastic.h
|
/**
* \file ppElastic.h
*
* \ingroup MySoftwarePackage
*
* \brief Class def header for a class ppElastic
*
* @author erezcohen
*/
/** \addtogroup MySoftwarePackage
@{*/
#ifndef PPELASTIC_H
#define PPELASTIC_H
#include <iostream>
#include "myIncludes.h"
#include "TPlots.h"
#include <math.h>
/**
\class ppElastic
User defined class ppElastic ... these comments are used to generate
doxygen documentation!
*/
class ppElastic{
public:
TRandom3 r;
TPlots plot;
vector<Double_t> pars;
Double_t factor;
TF1 *alpha[8] , *XsecTheta[6];
TF1 *fTheta;
TF2 *Xsec;
TH2F *XsecHist;
TF12 *f12;
/// Default constructor
ppElastic(){};
~ppElastic(){};
// cross-section for p-p elastic scattering in c.m. frame
// following GSI ppElastic analysis [http://web-docs.gsi.de/~webhades/computing/pluto/NN/pp_elastic.html#ref*]
void CreateAlphas ();
TCanvas * DrawAlphas ();
void CreateXsec ();
TCanvas * DrawXsec ();
Double_t pol ( vector<Double_t> par , Double_t x );
Double_t a0 (Double_t);
Double_t a1 (Double_t);
Double_t a2 (Double_t);
Double_t a3 (Double_t);
Double_t a4 (Double_t);
Double_t a5 (Double_t);
Double_t a6 (Double_t);
Double_t a7 (Double_t);
Double_t g_p (Double_t , Double_t);
Double_t g_q (Double_t , Double_t);
Double_t g_W (Double_t , Double_t);
Double_t g_v (Double_t , Double_t);
Double_t f_Theta_cm (Double_t , Double_t);
Double_t RandomTheta (Double_t);
};
#endif
/** @} */ // end of doxygen group
|
c9d1c1158981367549e3e667c035a32cdf3102f3
|
ada2ecc6deafd8fb08c8a34ea95372b83ca2b27a
|
/include/point_type.hpp
|
8939abeb6472e3ac587695ebe4720a7c029f47ea
|
[] |
no_license
|
andreyp74/kdtree
|
dbab63479bc22accfbca3dec591594938646fa2a
|
2c1abc8b01ce41ff26c30532485c693f5733878c
|
refs/heads/master
| 2022-11-06T18:02:20.866015
| 2020-06-06T22:08:50
| 2020-06-06T22:08:50
| 268,371,237
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 490
|
hpp
|
point_type.hpp
|
#pragma once
#include <vector>
using point_type = std::vector<double>;
using sample_type = std::vector<point_type>;
inline bool less_at(const point_type& p1, const point_type& p2, int idx) {
return p1.at(idx) < p2.at(idx);
}
inline double distance_squared(const point_type& p1, const point_type& p2) {
assert(p1.size() == p2.size());
double distance = .0;
for (size_t i = 0; i < p1.size(); ++i) {
distance += pow(p1.at(i) - p2.at(i), 2);
}
return distance;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.