diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index be45a7fbd..e1b99e81e 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk.h b/basilisk/basilisk.h index 68da72a3c..d90679ecd 100755 --- a/basilisk/basilisk.h +++ b/basilisk/basilisk.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_CMD.c b/basilisk/basilisk_CMD.c index 858786d3c..5696addc9 100755 --- a/basilisk/basilisk_CMD.c +++ b/basilisk/basilisk_CMD.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index badaee894..b47ac7c72 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index e47c2d461..76e019031 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_bitcoin.c b/basilisk/basilisk_bitcoin.c index 014fc121e..4e5ff17cc 100755 --- a/basilisk/basilisk_bitcoin.c +++ b/basilisk/basilisk_bitcoin.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_ping.c b/basilisk/basilisk_ping.c index c02e805f2..f5e6c30c7 100755 --- a/basilisk/basilisk_ping.c +++ b/basilisk/basilisk_ping.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index 2e55bc46a..b340b81ac 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/basilisk_tradebot.c b/basilisk/basilisk_tradebot.c index 23290c8d4..19e4401c2 100755 --- a/basilisk/basilisk_tradebot.c +++ b/basilisk/basilisk_tradebot.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/basilisk/tradebots_SVM.h b/basilisk/tradebots_SVM.h new file mode 100755 index 000000000..0171fcce8 --- /dev/null +++ b/basilisk/tradebots_SVM.h @@ -0,0 +1,1271 @@ +/****************************************************************************** + * Copyright © 2014-2017 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +/* + requires *vals and *vars to be initialized + external calls: OS_milliseconds(), get_jfp_features(), get_yval(), set_ocas_model(), update_ocas_preds(), ocasCL_glue() + */ +//#include + +typedef float svmtype; +typedef double double2 __attribute__((ext_vector_type(2))); +#define MAX_VECTORS (1440 * 365 * 5) +#define MAIN_MAXCORES 16 +#define c_to_refc(c) (c) +#define refc_to_c(refc) (refc) + +#define CONDITION(feature) (feature) +#define FEATURE_THRESHOLD 10. +#define HWMPERC_THRESHOLD 101 +#define HWMPERC_THRESHOLD0 HWMPERC_THRESHOLD + +#ifdef INSIDE_OPENCL +#pragma OPENCL EXTENSION cl_khr_fp64: enable +#define local_barrier() barrier(CLK_LOCAL_MEM_FENCE) +#define global_barrier() barrier(CLK_GLOBAL_MEM_FENCE) +#else +//double get_features(register struct ocas_ptrs *PTRS,register int c,register int weekind,register int numfeatures,register double *features,register double *model,register double *addptr,register struct baserel_info *BR,register double wt); +svmtype *get_jfp_features(register int selector,register int numfeatures,register int c,register int weekind); + +#endif + +#define OCAS_INFINITY (-log(0.0)) +#define OCAS_NEGINFINITY (log(0.0)) +#define OCAS_DECAY .1 +#define OCAS_BIAS 1. +#define OCAS_INDEX(ROW,COL,NUM_ROWS) ((COL)*(NUM_ROWS)+(ROW)) +#define QPSOLVER_MAXITER 1000000 +#define QPSOLVER_MINITER (QPSOLVER_MAXITER * .1) +//#define NUM_CUDA_GROUPS 14 +//#define NUM_BUNDLE_ANSWERS 64 +//#define NUM_TOPCOEFFIS 558 +//#define SMALLVAL .00000000000001 +//#define NUM_PRIMARY_FEATURES 4096 +#ifdef __APPLE__ +#define MAX_OCAS_LHS 512 +#else +#define MAX_OCAS_LHS 2000 +#endif +#define MAX_OCAS_FEATURES (1024 * 1024) + +struct ptrhdr { long allocsize; void *ptr; int devid; char str[64]; }; + +struct ocas_lhsbuffers +{ + double H[MAX_OCAS_LHS * MAX_OCAS_LHS]; + double alpha[MAX_OCAS_LHS],b[MAX_OCAS_LHS],diag_H[MAX_OCAS_LHS],A0[MAX_OCAS_LHS],d[MAX_OCAS_LHS]; + double full_A[]; +}; + +struct ocas_CLtmpspace +{ + double2 hpfb[MAX_VECTORS]; + int poslist[MAX_VECTORS],neglist[MAX_VECTORS]; +}; + +struct ocas_CLbuffers +{ + double output_pred[MAX_VECTORS],old_output[MAX_VECTORS]; + double W[MAX_OCAS_FEATURES+4],oldW[MAX_OCAS_FEATURES+4],new_a[MAX_OCAS_FEATURES+4]; +}; + +struct ocas_vars +{ + struct ptrhdr pH[256]; + double Q_P[TRADEBOTS_NUMANSWERS],Q_D[TRADEBOTS_NUMANSWERS]; + double netcuts[TRADEBOTS_NUMANSWERS],perc[TRADEBOTS_NUMANSWERS],hwmperc[TRADEBOTS_NUMANSWERS],lastmetrics[TRADEBOTS_NUMANSWERS][2]; + double learningrates[TRADEBOTS_NUMANSWERS][2],maxiters[TRADEBOTS_NUMANSWERS],dot_prod_WoldW[TRADEBOTS_NUMANSWERS],cutsum[TRADEBOTS_NUMANSWERS]; + double sq_norm_oldW[TRADEBOTS_NUMANSWERS],oldW0[TRADEBOTS_NUMANSWERS],W0[TRADEBOTS_NUMANSWERS],sq_norm_W[TRADEBOTS_NUMANSWERS]; + double predabs[TRADEBOTS_NUMANSWERS],predsum[TRADEBOTS_NUMANSWERS],dist[TRADEBOTS_NUMANSWERS]; + double xi[TRADEBOTS_NUMANSWERS],pratio[TRADEBOTS_NUMANSWERS],errperc[TRADEBOTS_NUMANSWERS],hwmdist[TRADEBOTS_NUMANSWERS]; + double answerabsaves[TRADEBOTS_NUMANSWERS],answeraves[TRADEBOTS_NUMANSWERS]; + int answercounts,firstweekinds[TRADEBOTS_NUMANSWERS]; + int posA[TRADEBOTS_NUMANSWERS],negA[TRADEBOTS_NUMANSWERS]; + int numIt[TRADEBOTS_NUMANSWERS],numlhs[TRADEBOTS_NUMANSWERS],nNZAlpha[TRADEBOTS_NUMANSWERS],trn_err[TRADEBOTS_NUMANSWERS]; + int qp_exitflag[TRADEBOTS_NUMANSWERS],exitflag[TRADEBOTS_NUMANSWERS],len[TRADEBOTS_NUMANSWERS]; + int have_pendingmodel[TRADEBOTS_NUMANSWERS],cutlen[TRADEBOTS_NUMANSWERS],good[TRADEBOTS_NUMANSWERS],bad[TRADEBOTS_NUMANSWERS]; + int nohwm[TRADEBOTS_NUMANSWERS],numposcuts[TRADEBOTS_NUMANSWERS],numnegcuts[TRADEBOTS_NUMANSWERS]; + struct ocas_CLbuffers *CLspaces[TRADEBOTS_NUMANSWERS]; + struct ocas_lhsbuffers *lhs[TRADEBOTS_NUMANSWERS]; + int *weekinds[TRADEBOTS_NUMANSWERS]; + float *answers,**features; + //unsigned long CLallocsize,tmpallocsize,tmpCLallocsize; + double C,TolRel,TolAbs,MaxTime,QPBound,QPSolverTolAbs,QPSolverTolRel; + double output_time,sort_time,add_time,w_time,qp_solver_time,ocas_time; // total time spent in svm_ocas_solver + int selector,numthreads,starti,modelind,c,refc,maxlen,numfeatures,firstweekind,startweekind,endweekind,numptrs,maxlhs; +}; + +/////////////////////////// Most of runtime is in the add/dot functions +#ifdef INSIDE_OPENCL +typedef double svmtype; + +// numCLthreads: NUM_CUDA_CORES, numgroups: (numdocs + NUM_CUDA_CORES-1)/NUM_CUDA_CORES +__kernel void dot_featuresCL(__local void *lp,__global double *preds,int numfeatures,__global double *W,double W0,__global svmtype *matrix,int numdocs) +{ + register int i,j,docid; + register double sum; + register __global svmtype *features; + if ( (docid = (int)get_global_id(0)) < numdocs ) + { + sum = 0.; + features = &matrix[docid * numfeatures]; + for (i=0; i>= 1; + if ( docid < numdocs ) + { + features = &matrix[docid * numfeatures]; + if ( dir == 0 ) + sum += CONDITION(features[j]); + else sum -= CONDITION(features[j]); + } + } + new_a[j] = sum; + } +} + +#else + +void ocas_purge(struct ocas_vars *vars) +{ + int32_t i; + free(vars->answers); + for (i=0; imaxlen; i++) + if ( vars->features[i] != 0 ) + free(vars->features[i]); + free(vars->features); + for (i=0; iCLspaces[i] != 0 ) + free(vars->CLspaces[i]); + if ( vars->lhs[i] != 0 ) + free(vars->lhs[i]); + if ( vars->weekinds[i] != 0 ) + free(vars->weekinds[i]); + } + free(vars); +} + +/*static inline double dot_expanded_features(register double *W,register int c,register int selector,register int numfeatures) + { + fatal("dot_expanded_features not implemented"); + return(0); + } + + static inline void add_expanded_features(register double *W,register double y,register int c,register int selector,register int numfeatures) + { + fatal("add_expanded_features not implemented"); + }*/ + +static inline double calc_ocas_output(register struct ocas_vars *vars,register int selector,register int c,register int weekind,register int answerind,register double *W,register double W0,register int numfeatures) +{ + register svmtype *features; + register double feature,y,sum = 0.; + register int coeffi; + if ( (y= vars->answers[(weekind-vars->starti)*TRADEBOTS_NUMANSWERS + answerind]) != 0.f ) + { + if ( (features= vars->features[weekind-vars->starti]) != 0 )//get_jfp_features(vars->selector,numfeatures,c,weekind)) != 0 ) + { +#ifdef OCAS_USE_TOPCOEFFIS + for (int i=0; iselector,numfeatures); + sum = y * (W0 + sum); + } + // printf("%f ",sum); + return(sum); +} + +static inline void add_ocas_output(register double y,register struct ocas_vars *vars,register int selector,register int c,register int weekind,register int answerind,register double *W,register double *new_a,register int numfeatures) +{ + register int coeffi; + register svmtype *features,feature; + if ( y != 0 ) + { + if ( (features= vars->features[weekind-vars->starti]) != 0 )//get_jfp_features(vars->selector,numfeatures,c,weekind)) != 0 ) + { + //features = get_jfp_features(vars->selector,numfeatures,c,weekind); +#ifdef OCAS_USE_TOPCOEFFIS + int32_t i; + for (i=0; iselector,numfeatures); + } +} + +static inline void STocas_calc_outputs(register struct ocas_vars *vars,register int c,register int answerind,register double *output,register double *old_output,register double *W,register double W0,register int numfeatures,register int *weekinds,register int numdocs) +{ + register int i,j; + //printf("start STocas_calc_outputs.(%p %s.A%d %p) %p %p %p\n",vars,CONTRACTS[c],answerind,weekinds,output,old_output,W); + for (i=0; iselector,c,weekinds[i],answerind,W,W0,numfeatures); + if ( 1 && isnan(output[i]) != 0 ) + { + svmtype *features = vars->features[weekinds[i]-vars->starti];//get_jfp_features(vars->selector,numfeatures,c,weekinds[i]); + for (j=0; jc; + memset(new_a,0,sizeof(*new_a) * numfeatures); + //printf("STocas_add_newcuts numcuts.%d numfeatures.%d\n",numcuts,numfeatures); + for (i=0; i>= 1; + add_ocas_output(dir==0?1:-1,vars,vars->selector,c,weekind,answerind,W,new_a,numfeatures); + } +} +//////////////////////////// end of add/dot functions +static inline double _dbufave(register double *buf,register int len) +{ + register int i,n; + register double sum; + sum = 0.; + n = 0; + for (i=0; i 0.0000000001 ) + { + n++; + sum += buf[i]; + } + } + if ( n != 0 ) + sum /= n; + if ( fabs(sum) <= 0.0000000001 ) + sum = 0.; + return(sum); +} + +static inline void add_newcut_entry(register struct ocas_vars *vars,register int answerind,register int *new_cut,register int i,register int weekind,register double y) +{ + weekind <<= 1; + if ( y > 0 ) vars->numposcuts[answerind]++; + else if ( y < 0 ) vars->numnegcuts[answerind]++, weekind |= 1; + new_cut[vars->cutlen[answerind]++] = weekind; +} + +static inline double validate_ocas_model(register struct ocas_vars *vars,register int answerind,register double *output_pred,register double *old_output,register int *weekinds,register int numdocs,register double *W,register double W0,register int numfeatures,register int paranoid) +{ + register svmtype *features; + register double y,pred,perc,answer=0.,feature; + register int i,j,pos,neg,good,bad,oldcuts,training_errors,weekind,nonz,posA,negA; + for (i=pos=neg=good=bad=oldcuts=training_errors=posA=negA=0; ianswers[(weekind-vars->starti)*TRADEBOTS_NUMANSWERS + answerind]) != 0. ) + { + if ( y > 0 ) posA++; + else if ( y < 0 ) negA++; + if ( paranoid != 0 ) + { + pred = 0.; + if ( (features= vars->features[weekind-vars->starti]) != 0 )//get_jfp_features(vars->selector,numfeatures,vars->c,weekind)) != 0 ) + { + for (j=nonz=0; j SMALLVAL ) + pred += W0; + } + else pred = 0;//dot_expanded_features(W,c,selector,numfeatures); + if ( output_pred[i] != 0 && fabs(pred - output_pred[i]) > .000001 ) + // if ( (rand() % 10000) == 0 ) + printf("i.%d A %9.6f pred %9.6f != output_pred %9.6f [%14.10f]\n",i,answer,pred,output_pred[i],pred-output_pred[i]); + } + else pred = output_pred[i], nonz = numfeatures; + if ( nonz != 0 ) + { + if ( pred > 0 ) pos++; + else if ( pred < 0 ) neg++; + if ( pred*y > 0 ) good++; + else if ( pred*y < 0 ) bad++; + } + if ( old_output[i] <= 1. ) + { + oldcuts++; + if ( old_output[i] <= 0. ) + training_errors++; + } + } + } + nonz = 0; + for (i=0; i>>>>> %d.A%02d.(+%-6d -%-6d oc.%-6d | good.%-6d bad.%-6d >>>>> %6.2f%% <<<<<).%-6d | W0 %9.6f W[%d] %9.6f | A +%-6d -%-6d | paranoid.%d numdocs.%d\n",c_to_refc(vars->c),answerind,pos,neg,oldcuts,good,bad,perc,training_errors,W0,nonz,_dbufave(W,numfeatures),posA,negA,paranoid,numdocs); + return(perc); +} + +static int _increasing_double(const void *a,const void *b) +{ +#define double_a (*(double *)a) +#define double_b (*(double *)b) + if ( double_b > double_a ) + return(-1); + else if ( double_b < double_a ) + return(1); + return(0); +#undef double_a +#undef double_b +} + +static inline void calc_ocas_strategy(register struct ocas_vars *vars,register int answerind,register double C,register int numfeatures,register int len,register int *weekinds,register int *new_cut,register double *W,register double *oldW,register double *output,register double *old_output,register double2 *hpfb) +{ + double answermag; + register int i,j,num_hp,good,bad,zero; + register double Bval,Cval,newoutput,W0,oldW0,sq_norm_W,A0val,B0,dist,GradVal,t,t1,t2,t_new,val,GradVal_new,y,starttime,*preds = output; + num_hp = 0; + W0 = vars->W0[answerind]; oldW0 = vars->oldW0[answerind]; + A0val = vars->sq_norm_W[answerind] - (2. * vars->dot_prod_WoldW[answerind]) + vars->sq_norm_oldW[answerind]; + B0 = (vars->dot_prod_WoldW[answerind] - vars->sq_norm_oldW[answerind]); + GradVal = B0; + for (i=0; ianswers[(weekinds[i]-vars->starti)*TRADEBOTS_NUMANSWERS + answerind]) != 0.f ) + { + if ( 0 ) + { + double oldsum=oldW0,sum=W0; + svmtype *features = vars->features[weekinds[i]-vars->starti];//get_jfp_features(vars->selector,numfeatures,vars->c,weekinds[i]); + for (j=0; j .000001 ) + { + printf("A%d numIt.%d docid.%-6d sum %11.7f * y%2.0f %11.7f != %11.7f output [%11.7f] W0 %11.7f oldW0 %11.7f\n",answerind,vars->numIt[answerind],i,sum,y,sum*y,output[i],output[i]-sum*y,W0,oldW0); + //output[i] = sum*y; + } + if ( fabs(oldsum*y - old_output[i]) > .000001 ) + { + if ( old_output[i] != 0 && oldW0 != 0 && (rand() % 1000) == 0 ) + printf("A%d numIt.%d docid.%-6d oldsum %11.7f * y%2.0f %11.7f != %11.7f oldoutput [%11.7f] W0 %11.7f oldW0 %11.7f\n",answerind,vars->numIt[answerind],i,oldsum,y,oldsum*y,old_output[i],old_output[i]-oldsum*y,W0,oldW0); + old_output[i] = oldsum*y; + } + } + Cval = C * (1. - old_output[i]); + Bval = C * (old_output[i] - output[i]); + if ( Bval != 0 ) + val = -(Cval / Bval); + else val = OCAS_NEG_INF; + if ( val > 0 ) + { + hpfb[num_hp].y = Bval; + hpfb[num_hp].x = val; + num_hp++; + } + if ( (Bval < 0 && val > 0) || (Bval > 0 && val <= 0) ) + GradVal += Bval; + } + } + //printf("num_hp.%d\n",num_hp); + t = 0; + if ( GradVal < 0 ) + { + starttime = OS_milliseconds(); + qsort(hpfb,num_hp,sizeof(double2),_increasing_double); + //ocas_sort(hpfb,num_hp); + i = 0; + while ( GradVal < 0 && i < num_hp ) + { + t_new = hpfb[i].x; + GradVal_new = GradVal + fabs(hpfb[i].y) + A0val*(t_new - t); + if ( GradVal_new >= 0 ) + t = t + GradVal * (t - t_new) / (GradVal_new - GradVal); + else t = t_new, i++; + GradVal = GradVal_new; + } + vars->sort_time += OS_milliseconds() - starttime; + } + t = MAX(t,0.); // just sanity check; t < 0 should not occur + t1 = t; // new (best so far) W + t2 = t + OCAS_DECAY*(1. - t); // new cutting plane + W0 = oldW0 * (1. - t) + (t * W0); + sq_norm_W = W0 * W0; + for (j=0; jW0[answerind] = W0; vars->sq_norm_W[answerind] = sq_norm_W; + vars->trn_err[answerind] = 0; dist = 0.; + for (i=good=bad=zero=0; ianswers[(weekinds[i]-vars->starti)*TRADEBOTS_NUMANSWERS + answerind]) != 0.f ) + { + answermag = fabs(y); // 1.; + if ( (old_output[i] * (1. - t2) + t2*output[i]) <= answermag ) //1. + add_newcut_entry(vars,answerind,new_cut,i,weekinds[i],y); + newoutput = (old_output[i] * (1. - t1)) + (t1 * output[i]); + if ( 0 ) // won't match unless old_output corresponds with features*oldW + { + double sum=W0; + svmtype *features = vars->features[weekinds[i]-vars->starti];//get_jfp_features(vars->selector,numfeatures,vars->c,weekinds[i]); + for (j=0; j .0000001 ) + printf("numIt.%d docid.%-6d w%-6d sum %11.7f * y%2.0f %11.7f != %11.7f newoutput [%11.7f] W0 %11.7f oldW0 %11.7f\n",vars->numIt[answerind],i,weekinds[i],sum,y,sum*y,newoutput,newoutput-sum*y,W0,oldW0); + newoutput = sum*y; + } + if ( newoutput <= answermag ) + { + vars->xi[answerind] += (answermag - newoutput); + if ( newoutput <= 0. ) + vars->trn_err[answerind]++; + } + preds[i] = y * newoutput; + dist += fabs(preds[i] - y); + old_output[i] = newoutput; + if ( newoutput > 0. ) good++; + else bad++; + } else zero++;//,printf("i.%d -> w%d | zeroes.%d good.%d bad.%d of len.%d\n",i,weekinds[i],zero,good,bad,len); + } + //printf("finished strategy\n"); + vars->good[answerind] = good; vars->bad[answerind] = bad; vars->dist[answerind] = dist / MAX(1,good+bad); + vars->perc[answerind] = (100. * (double)vars->good[answerind]) / MAX(1,good+bad); + if ( vars->perc[answerind] > vars->hwmperc[answerind] || (vars->perc[answerind] == vars->hwmperc[answerind] && (vars->hwmdist[answerind] == 0 || vars->dist[answerind] < vars->hwmdist[answerind])) ) + { + double set_ocas_model(int refc,int answerind,double *W,double W0,int numfeatures,int firstweekind,int len,int bad,double dist,double predabs,int posA,int negA,double answerabs,double aveanswer); + vars->W0[answerind] = set_ocas_model(vars->refc,answerind,vars->CLspaces[answerind]->W,vars->W0[answerind],vars->numfeatures,vars->firstweekind,vars->len[answerind],vars->trn_err[answerind],vars->dist[answerind],vars->predabs[answerind],vars->posA[answerind],vars->negA[answerind],vars->answerabsaves[answerind],0.); + vars->nohwm[answerind] = 0; + vars->hwmperc[answerind] = vars->perc[answerind]; vars->hwmdist[answerind] = vars->dist[answerind]; + } + else vars->nohwm[answerind]++; + //printf("good.%d bad.%d zero.%d errors.%d | selector.%d\n",good,bad,zero,vars->trn_err[answerind],vars->selector); +} + +static inline double ocas_splx_solver(register int *nonzalphap,register int maxlhs,register double *d,register double *activeH,register double *diag_H,register double *f,register double C,register double *alpha,register int n,register int MaxIter,register double TolAbs,register double TolRel,register double QP_TH) +{ + register double *col_u,*col_v; + register double QP,QD,lastQD,tmp,diff,distA,distB,etaA,etaB,improv,tmp_num,delta,x_neq0,xval,dval,diagval,tmp_den,tau; + register int u=0,v=0,i,j,iter,nonzalpha,unlikely = 0; + QP = distA = distB = OCAS_PLUS_INF; lastQD = QD = OCAS_NEG_INF; + x_neq0 = C; + etaA = etaB = 0.; + for (i=0; i 0. ) + { + col_u = &activeH[maxlhs * i]; + for (j=0; j 10*(MaxIter-iter) && etaB > 10*(MaxIter-iter) ) + unlikely++; + else unlikely = 0; + } else unlikely = 0; + diff = (QP - QD); + if ( 0 && (diff <= fabs(QP)*TolRel || diff <= TolAbs || QP <= QP_TH || unlikely > 100) ) + { + if ( 0 ) + { + if ( diff <= fabs(QP)*TolRel ) + printf("caseA %f | ",diff - fabs(QP)*TolRel); + else if ( diff <= TolAbs ) + printf("caseB %f | ",diff - TolAbs); + else if ( etaA > 2*(MaxIter-iter) && etaB > 2*(MaxIter-iter) ) + printf("caseC etas %f %f | ",etaA,etaB); + printf("%d: QP %f QD %f diff %f n.%d d0 %9.6f dA %9.6f %9.6f dB %9.6f %9.6f\n",iter,QP,QD,QP-QD,n,d[0],distA,etaA,distB,etaB); + } + break; + } + distA = (diff - fabs(QP)*TolRel); + distB = (diff - TolAbs); + lastQD = QD; + if ( d[u] > 0 ) + u = -1; + else delta -= C * d[u]; + // if satisfied then k-th block of variables needs update + if ( delta > TolAbs && delta > (TolRel * fabs(QP)) ) + { + // for fixed u select v = argmax_{i in I_k} Improvement(i) + improv = OCAS_NEG_INF; + for (i=0; i<=n; i++) + { + if ( i == u || (xval = ((i 0 ) + { + tmp_num = xval * dval; + if ( tmp_num < tmp_den ) + tmp = tmp_num*tmp_num / tmp_den; + else tmp = tmp_num - .5 * tmp_den; + if ( 0 && i < n ) // jimbo tweak + { + tmp = alpha[i] * MIN(1.,tmp_num/tmp_den); + alpha[i] -= tmp; + if ( u == -1 ) + x_neq0 += tmp; + else alpha[u] += tmp; + } + if ( tmp > improv ) + { + improv = tmp; + tau = MIN(1.,tmp_num/tmp_den); + v = i; + } + } + } + // update d = H*x + f + if ( v < n ) + { + tau *= alpha[v]; + alpha[v] -= tau; + if ( u != -1 ) + { + alpha[u] += tau; + col_v = &activeH[maxlhs * v]; + for (i=0; isq_norm_oldW[answerind] = vars->sq_norm_W[answerind]; + oldW0 = vars->oldW0[answerind] = vars->W0[answerind]; + W0 = 0.; + for (i=0; ialpha[i]) > 0 ) + { + //printf("%9.6f ",alpha); + for (j=0; jfull_A[OCAS_INDEX(j,i,numfeatures)]; + W0 += lhs->A0[i] * alpha; + } + } + vars->W0[answerind] = W0; + sq_norm_W = W0 * W0; + dot_prod_WoldW = W0 * oldW0; + for (j=0; jalpha,numlhs),W0,sq_norm_W,answerind); + vars->dot_prod_WoldW[answerind] = dot_prod_WoldW; + vars->sq_norm_W[answerind] = sq_norm_W; +} + +static inline void ocas_update_Lspace(register struct ocas_vars *vars,register int answerind,register double netcuts,register double cut_length,register int numfeatures,register double C,register double QPSolverTolAbs,register double QPSolverTolRel) +{ + register struct ocas_CLbuffers *ptr = vars->CLspaces[answerind]; + register struct ocas_lhsbuffers *lhs = vars->lhs[answerind]; + register double *new_col_H; + register double sq_norm_a,maxiters,metric,tmp; + register int i,j,iters,numlhs,maxlhs = vars->maxlhs; + numlhs = vars->numlhs[answerind]; + new_col_H = &lhs->H[OCAS_INDEX(0,numlhs,maxlhs)]; + lhs->A0[numlhs] = netcuts; + lhs->b[numlhs] = -cut_length; + sq_norm_a = lhs->A0[numlhs] * lhs->A0[numlhs]; + for (j=0; jfull_A[OCAS_INDEX(j,numlhs,numfeatures)] = ptr->new_a[j]; + if ( fabs(ptr->new_a[j]) > 1000 ) + { + //printf("(%d %9.6f %f) ",j,ptr->new_a[j],sq_norm_a); + ptr->new_a[j] = 0.; + } + else + sq_norm_a += ptr->new_a[j] * ptr->new_a[j]; + ptr->oldW[j] = ptr->W[j]; ptr->W[j] = 0.; + } + new_col_H[numlhs] = sq_norm_a; + //printf("QPsolver.A%02d: ABS %f Rel %.11f numlhs.%d cutlen.%f netcuts.%f sq_norm_a %f netcuts.%f\n",answerind,QPSolverTolAbs,QPSolverTolRel,vars->numlhs[answerind],cut_length,lhs->A0[numlhs],sq_norm_a,netcuts); + for (i=0; iA0[numlhs] * lhs->A0[i]; + for (j=0; jnew_a[j] * lhs->full_A[OCAS_INDEX(j,i,numfeatures)]; + new_col_H[i] = tmp; + } + lhs->d[numlhs] = lhs->alpha[numlhs] = 0.; + lhs->diag_H[numlhs] = lhs->H[OCAS_INDEX(numlhs,numlhs,maxlhs)]; + for (i=0; i H[OCAS_INDEX(numlhs,i,maxlhs)] = lhs->H[OCAS_INDEX(i,numlhs,maxlhs)]; + numlhs = ++vars->numlhs[answerind]; + iters = vars->numIt[answerind]; + if ( vars->nohwm[answerind] > 3 ) + vars->maxiters[answerind] *= 1 + sqrt(vars->nohwm[answerind])/100; + else if ( vars->nohwm[answerind] == 0 ) + vars->maxiters[answerind] *= .5; + if ( vars->maxiters[answerind] > QPSOLVER_MAXITER ) + vars->maxiters[answerind] = QPSOLVER_MAXITER; + if ( vars->maxiters[answerind] < QPSOLVER_MINITER ) + vars->maxiters[answerind] = QPSOLVER_MINITER; + maxiters = MAX(QPSOLVER_MINITER,vars->maxiters[answerind]); + vars->Q_D[answerind] = ocas_splx_solver(&vars->nNZAlpha[answerind],maxlhs,lhs->d,lhs->H,lhs->diag_H,lhs->b,C,lhs->alpha,vars->numlhs[answerind],MIN(maxiters,QPSOLVER_MAXITER),QPSolverTolAbs,QPSolverTolRel,OCAS_NEG_INF); + metric = ((double)vars->len[answerind] / MAX(1,vars->trn_err[answerind])) / 1.; + vars->lastmetrics[answerind][iters & 1] = metric; + update_ocas_model(ptr->W,ptr->oldW,vars,numfeatures,answerind,lhs,numlhs); +} + +/*static inline int calc_thread_startendis(register int *startip,register int threadid,register int numthreads,register int n) +{ + register double incr; + incr = ((double)n / numthreads); + *startip = threadid * incr; + if ( threadid == numthreads-1 ) + return(n-1); + else return(((threadid+1) * incr) - 1); +} + +static inline int count_Numpending() +{ + int i,n=0; + for (i=0; inumdevs == 0 || numthreads == MAIN_MAXCORES ) + { + endi = calc_thread_startendis(&starti,threadid,numthreads,cutlen); + //printf("inside addnewcutglue.t%d\n",threadid); + for (i=starti; i<=endi; i++) + { + weekind = new_cut[i]; + dir = (weekind & 1); + weekind >>= 1; + add_ocas_output(dir==0?1.:-1.,vars,selector,c,weekind,answerind,W,private_newA,numfeatures); + } + //printf("end inside addnewcutglue.t%d\n",threadid); + } + else + { +#ifdef INSIDE_OPENCL + register void *krn; + int numgroups,docid,n,devid,localbufsize = sizeof(double); + devid = threadid; + printf("devid.%d %p %p %p A%02d t%d of %d: start.%d w%d to end.%d w%d\n",devid,PTRS->new_aCL[devid],PTRS->new_cutCL[devid],PTRS->featuresCL[devid],answerind,threadid,numthreads,starti,new_cut[starti],endi,new_cut[endi]); + for (i=n=0; i>= 1; + if ( (docid= PTRS->CLweekinds_map[devid][weekind]) >= 0 ) + { + if ( docid >= PTRS->numdocsCL[devid] ) + fatal("fatal docid >= PTRS->numdocsCL[devid]"); + //printf("i.%d weekind.%d n.%d docid.%d [%d]\n",i,weekind,n,docid,new_cut[i]&1); + PTRS->new_cutCL[devid][n++] = (docid<<1) | dir; + } + } + if ( n != 0 ) + { + _clmsync(devid,devcontext(devid),devid&1,PTRS->new_cutCL[devid],0,sizeof(int) * n,CL_MEM_DEVICE|CL_EVENT_WAIT|CL_EVENT_RELEASE); + krn = PTRS->krns[devid][1]; + clarg_set_local(krn,0,localbufsize); + clarg_set_global(krn,1,PTRS->new_aCL[devid]); + clarg_set(krn,2,numfeatures); + clarg_set_global(krn,3,PTRS->new_cutCL[devid]); + clarg_set(krn,4,n); + clarg_set_global(krn,5,PTRS->featuresCL[devid]); + clarg_set(krn,6,PTRS->numdocsCL[devid]); + numgroups = ((numfeatures + NUM_CUDA_CORES-1)/NUM_CUDA_CORES); + struct clndrange_struct ndr = { 1, {0,0,0,0}, {numgroups*NUM_CUDA_CORES,0,0,0}, {NUM_CUDA_CORES,0,0,0} }; + clfork(devid,devcontext(devid),devid&1,krn,&ndr,CL_FAST); + clmsync(devid,devcontext(devid),devid&1,PTRS->new_aCL[devid],CL_MEM_HOST|CL_EVENT_WAIT|CL_EVENT_RELEASE); + int good,errs,testmode = 0; + for (i=errs=good=0; inew_aCL[devid][i] < 0 ) + { + errs++, printf("i.%d ref %9.6f vs CL %9.6f [%.20f]\n",i,ref_new_a[i],PTRS->new_aCL[devid][i],ref_new_a[i]-PTRS->new_aCL[devid][i]); + //PTRS->new_aCL[devid][i] = ref_new_a[i]; + } else if ( ref_new_a[i] != 0. ) good++; + private_newA[i] = PTRS->new_aCL[devid][i]; + } + if ( testmode != 0 ) + printf("errs.%d good.%d | newA.%d cutlen.%d numgroups.%d ndrange.%d copied %9.6f | ref %9.6f\n",errs,good,devid,n,numgroups,numgroups*NUM_CUDA_CORES,_dbufave(PTRS->new_aCL[devid],numfeatures),_dbufave(ref_new_a,numfeatures)); + } +#endif + } + for (i=0; inumdevs == 0 || numthreads == MAIN_MAXCORES ) + { + endi = calc_thread_startendis(&starti,threadid,numthreads,numdocs); + for (i=starti; i<=endi; i++) + output[i] = calc_ocas_output(vars,selector,c,weekinds[i],answerind,W,W0,numfeatures); + } +#ifdef INSIDE_OPENCL + else + { + register void *krn; + double y; + int numgroups,weekind,outputi,devid,localbufsize = sizeof(double); + devid = threadid; + memcpy(PTRS->WCL[devid],W,sizeof(*W) * numfeatures); + clmsync(devid,devcontext(devid),devid&1,PTRS->WCL[devid],CL_MEM_DEVICE|CL_EVENT_WAIT|CL_EVENT_RELEASE); + krn = PTRS->krns[devid][0]; + clarg_set_local(krn,0,localbufsize); + clarg_set_global(krn,1,PTRS->predCL[devid]); + clarg_set(krn,2,numfeatures); + clarg_set_global(krn,3,PTRS->WCL[devid]); + clarg_set(krn,4,W0); + clarg_set_global(krn,5,PTRS->featuresCL[devid]); + clarg_set(krn,6,PTRS->numdocsCL[devid]); + numgroups = ((numdocs + NUM_CUDA_CORES-1)/NUM_CUDA_CORES); + struct clndrange_struct ndr = { 1, {0,0,0,0}, {numgroups*NUM_CUDA_CORES,0,0,0}, {NUM_CUDA_CORES,0,0,0} }; + printf("fork.%d dot numdocs.%d numgroups.%d\n",devid,numdocs,numgroups); + clfork(devid,devcontext(devid),devid&1,krn,&ndr,CL_FAST); + clmsync(devid,devcontext(devid),devid&1,PTRS->predCL[devid],CL_MEM_HOST|CL_EVENT_WAIT|CL_EVENT_RELEASE); + starti = PTRS->devstarti[devid]; + int errs,good,testmode = 0; + errs = good = 0; + for (i=0; inumdocsCL[devid]; i++) + { + weekind = PTRS->CLweekinds[devid][i]; + y = get_yval(0,selector,weekind,c,answerind); + outputi = PTRS->weekinds_maps[answerind][weekind]; + if ( outputi >= 0 ) + { + if ( testmode != 0 ) + { + if ( fabs(output[outputi] - PTRS->predCL[devid][i] * y) > .000001 || output[outputi] * PTRS->predCL[devid][i] * y < 0 ) + errs++, printf("i.%d starti.%d weekind.%d output[%d] %9.6f vs y.%.0f %9.6f CL [%13.10f] W0 %9.6f W0 %9.6f\n",i,starti,weekind,PTRS->weekinds_maps[answerind][weekind],output[PTRS->weekinds_maps[answerind][weekind]],y,PTRS->predCL[devid][i],output[PTRS->weekinds_maps[answerind][weekind]] - y*PTRS->predCL[devid][i],vars->W0[answerind],W0); + else good++; + } + else output[outputi] = PTRS->predCL[devid][i] * y; + } + } + if ( testmode != 0 ) + printf("errs.%d vs good.%d | devid.%d numdocs.%d numgroups.%d ndrange.%d copy %d to %d | preds %9.6f\n",errs,good,devid,numdocs,numgroups,numgroups*NUM_CUDA_CORES,starti,PTRS->devendi[devid],_dbufave(PTRS->predCL[devid],PTRS->numdocsCL[devid])); + } +#endif + decr_Numpending(threadid); +} + +static inline void lspaceglue(void *_args) +{ + long *args = _args; + double QPSolverTolRel,C,netcuts,cutlen; + int answerind,numfeatures; + struct ocas_vars *vars; + answerind = (int)args[0]; + numfeatures = (int)args[1]; + vars = (struct ocas_vars *)args[2]; + netcuts = *(double *)&args[3]; + cutlen = *(double *)&args[4]; + C = *(double *)&args[5]; + QPSolverTolRel = *(double *)&args[6]; + //printf("LSpace glue.A%d\n",answerind); + ocas_update_Lspace(vars,answerind,netcuts,cutlen,numfeatures,C,0.,QPSolverTolRel); + decr_Numpending(answerind); +} + +static inline void ocas_add_newcuts(register struct ocas_ptrs *PTRS,register int numthreads,register struct ocas_vars *vars,register int answerind,register int numfeatures,register int *weekinds,register int *new_cut,register int numcuts,register double *W,register double *new_a) +{ + STocas_add_newcuts(vars,answerind,numfeatures,weekinds,new_cut,numcuts,W,new_a); +} + +static inline void ocas_calc_outputs(register struct ocas_ptrs *PTRS,register int numthreads,register struct ocas_vars *vars,register int c,register int answerind,register double *output,register double *old_output,register double *W,register double W0,register int numfeatures,register int *weekinds,register int numdocs) +{ + long args[MAIN_MAXCORES][16]; + register int threadid; + register dispatch_group_t group; + if ( numthreads == 1 && PTRS->numdevs == 0 ) + { + STocas_calc_outputs(vars,c,answerind,output,old_output,W,W0,numfeatures,weekinds,numdocs); + return; + } + memset(args,0,sizeof(args)); + for (threadid=0; threadidselector; args[threadid][11] = (long)vars; + args[threadid][12] = (long)PTRS; args[threadid][13] = (long)old_output; + } + group = dispatch_group_create(); + for (threadid=0; threadidpratio[answerind] == 0. ) + vars->pratio[answerind] = vars->answerabsaves[answerind]; + vars->good[answerind] = -1; + vars->bad[answerind] = vars->trn_err[answerind] = vars->cutlen[answerind] = vars->numposcuts[answerind] = vars->numnegcuts[answerind] = 0; + vars->xi[answerind] = vars->predsum[answerind] = vars->dist[answerind] = vars->cutsum[answerind] = vars->netcuts[answerind] = 0.; +} + +static void ocas_print(struct ocas_vars *vars,int answerind,int ishwm,double C) +{ + int i; + double dispvals[4]; + //printf("ocas_print.A%d\n",answerind); + //printf("%s.A%02d %4d %8.2f | QP %9.3f QD %9.3f [%9.4f %7.3f] SV.%d %4d | M%9.6f (%9.6f max %8.1f %9.6f) %s.A%02d %9.6f%%\n", + dispvals[0] = vars->Q_P[answerind]/1000000000.; dispvals[1] = (C * vars->Q_D[answerind])/1000000000.; + dispvals[2] = (vars->Q_P[answerind]-C * vars->Q_D[answerind]) / 1000000000; + dispvals[3] = (vars->Q_P[answerind]-C * vars->Q_D[answerind]) / MAX(1,fabs(vars->Q_P[answerind])); + printf("%3d %d.A%02d",vars->nohwm[answerind],vars->refc,answerind); + printf(" %4d %8.2f |QP %9.3f QD %10.2f [%11.2f %9.1f] SV.%3d %3d |M%9.3f errs.%-6d %-8.0f %5.2f%% errs %6.5f A%9.6f W0%9.6f D%11.9f\n",//[%7.4f%%]\n", + vars->numIt[answerind],vars->ocas_time/1000,dispvals[0],dispvals[1],dispvals[2],dispvals[3], + vars->nNZAlpha[answerind], vars->numlhs[answerind], + // PTRS->lastmetrics[answerind],PTRS->learningrates[answerind][0],PTRS->maxiters[answerind],PTRS->learningrates[answerind][1], + vars->lastmetrics[answerind][0],vars->trn_err[answerind],vars->maxiters[answerind],vars->perc[answerind], + vars->errperc[answerind]/100,_dbufave(vars->CLspaces[answerind]->new_a,vars->numfeatures),vars->W0[answerind], + vars->dist[answerind]/vars->answerabsaves[answerind]);//_dbufave(vars->hwmperc,81));//,vars->errperc+vars->perc); + for (i=0; i<4; i++) + if ( isnan(dispvals[i]) != 0 ) + break; + if ( vars->lastmetrics[answerind][0] > 10 ) + usleep(vars->lastmetrics[answerind][0] * vars->lastmetrics[answerind][0]); + /*if ( 0 && i < 4 )//|| (vars->answerind >= 32 && fabs(vars->W0) > .9) ) + { + int save_model(int refc,int answerind,double *W,int numfeatures,double W0,double perc,int posA,int negA); + memset(&vars->CLspaces[answerind],0,sizeof(vars->CLspaces[answerind])); + vars->W0[answerind] = vars->oldW0[answerind] = 0.; + vars->numIt[answerind] = 0; + vars->perc[answerind] = vars->hwmperc[answerind] = 0.; + printf("reset model %s.A%02d\n",CONTRACTS[vars->selector!=3?vars->refc:NUM_COMBINED],answerind); + save_model(vars->refc,answerind,vars->CLspaces[answerind]->W,vars->numfeatures,vars->W0[answerind],vars->perc[answerind]); + }*/ +} + +static inline void finish_ocasiter(register int answerind,register struct ocas_vars *vars,register double C) +{ + register double den; + vars->have_pendingmodel[answerind] = 0; + if ( vars->good[answerind] == 0 && vars->bad[answerind] == 0 ) + { + vars->bad[answerind] = vars->trn_err[answerind]; + vars->good[answerind] = (vars->len[answerind] - vars->trn_err[answerind]); + } + den = MAX(1.,vars->good[answerind]+vars->bad[answerind]); + if ( (vars->predabs[answerind] = (vars->predsum[answerind] / den)) != 0. ) + vars->pratio[answerind] = (vars->answerabsaves[answerind] / vars->predabs[answerind]); + else vars->pratio[answerind] = 0.; + vars->dist[answerind] = sqrt(vars->dist[answerind] / den); + //printf("W0 %9.6f pred sum %f %f | pratio %f distsum %f (%f vs hwm %f)\n",vars->W0[answerind],vars->predsum[answerind],vars->predabs[answerind],vars->pratio[answerind],vars->dist[answerind],vars->perc[answerind],vars->hwmperc[answerind]); + vars->errperc[answerind] = (100 * (double)vars->trn_err[answerind])/(double)MAX(1,vars->len[answerind]); + vars->Q_P[answerind] = 0.5*vars->sq_norm_W[answerind] + (C * vars->xi[answerind]); + vars->ocas_time = (vars->output_time + vars->w_time + vars->add_time + vars->sort_time + vars->qp_solver_time); + ocas_print(vars,answerind,0,C); +} + +static inline int ocas_iter(struct ocas_vars *vars,int max_nohwm) +{ + int Method = 1; + int min_nohwm = 1; + int skipflags[84]; + static int new_cut[MAX_VECTORS]; + static double2 hpfb[MAX_VECTORS]; + int inactives[81]; + register struct ocas_CLbuffers *ptr; + register double netcuts,startmilli,y,psum,pcount,nosum; + register int i,numfeatures,cutlen,lastanswerind,lwm,numactive,numthreads,answerind,*weekinds; + numactive = 0; + if ( (numfeatures= vars->numfeatures) > MAX_OCAS_FEATURES ) + { + printf("numfeatures > MAX_OCAS_FEATURES\n"); + exit(-1); + } + psum = pcount = nosum = 0; + { + //printf("c.%d mask %lx %p\n",c,contractmask,PTRS->ocas[c]); + memset(inactives,0,sizeof(inactives)); + lastanswerind = TRADEBOTS_NUMANSWERS; + numfeatures = vars->numfeatures; + answerind = 0; + //printf("numIt.%d ocas iter.%s A.mask%lx len.%d CLspace.%p lhs.%p | vars.%p\n",vars->numIt[answerind],CONTRACTS[c_to_refc(c)],answerindmask,vars->len[answerind],vars->CLspaces[answerind],vars->lhs[answerind],vars); + memset(skipflags,0,sizeof(skipflags)); + for (answerind=0; answerindCLspaces[answerind],vars->weekinds[answerind],vars->nohwm[answerind],max_nohwm); + if ( vars->hwmperc[answerind] != 0 ) + { + nosum += vars->nohwm[answerind]; + pcount++, psum += vars->hwmperc[answerind]; + } + //printf("answerind.%d\n",answerind); + if ( vars->len[answerind] == 0 || vars->CLspaces[answerind] == 0 || (vars->nohwm[answerind] > min_nohwm && vars->hwmperc[answerind] > ((answerind==0) ? HWMPERC_THRESHOLD0 : HWMPERC_THRESHOLD)) ) + { + inactives[answerind] = 1; + continue; + } + if ( vars->nohwm[answerind] < max_nohwm ) + { + numactive++; + if ( vars->numIt[answerind]++ == 0 ) + { + for (i=0; iCLspaces[answerind]->W[i] != 0 ) + break; + if ( i == numfeatures ) + skipflags[answerind] = 1; + } + ptr = vars->CLspaces[answerind]; + weekinds = vars->weekinds[answerind]; + //printf("start iter %p %p\n",ptr,weekinds); + start_ocas_iter(vars,vars->c,answerind); + numthreads = vars->numthreads; + if ( skipflags[answerind] != 0 ) + { + for (i=0; ilen[answerind]; i++) + { + if ( (y= vars->answers[(weekinds[i]-vars->starti)*TRADEBOTS_NUMANSWERS + answerind]) != 0.f ) + { + ptr->output_pred[i] = 0; + add_newcut_entry(vars,answerind,new_cut,i,weekinds[i],y); + } + } + fprintf(stderr,"skip %c.A%02d cuts +%d -%d, ",c_to_refc(vars->c),answerind,vars->numposcuts[answerind],vars->numnegcuts[answerind]); + } + else + { + startmilli = OS_milliseconds(); + //printf("%s ocas_calc_outputs.A%d len.%d | numthreads.%d\n",CONTRACTS[c_to_refc(c)],answerind,vars->len[answerind],numthreads); + STocas_calc_outputs(vars,vars->c,answerind,ptr->output_pred,ptr->old_output,ptr->W,vars->W0[answerind],numfeatures,weekinds,vars->len[answerind]); + //ocas_calc_outputs(PTRS,numthreads,vars,c,answerind,ptr->output_pred,ptr->old_output,ptr->W,vars->W0[answerind],numfeatures,weekinds,vars->len[answerind]); + vars->output_time += (OS_milliseconds() - startmilli); + if ( Method != 0 ) + { + startmilli = OS_milliseconds(); + printf("%d calc_ocas_strategy.A%d len.%d | numthreads.%d\n",c_to_refc(vars->c),answerind,vars->len[answerind],numthreads); + calc_ocas_strategy(vars,answerind,vars->C,numfeatures,vars->maxlen,weekinds,new_cut,ptr->W,ptr->oldW,ptr->output_pred,ptr->old_output,hpfb); + vars->w_time += (OS_milliseconds() - startmilli); + } + finish_ocasiter(answerind,vars,vars->C); + } + //printf("%s calc ocas_add_newcuts.A%d poscuts.%d negcuts.%d | numthreads.%d\n",CONTRACTS[c_to_refc(c)],answerind,vars->numposcuts[answerind],vars->numnegcuts[answerind],vars->numthreads); + startmilli = OS_milliseconds(); + //if ( vars->nohwm[answerind] > 13 ) + // numthreads = vars->numthreads;///MAIN_MAXCORES; + memset(ptr->new_a,0,sizeof(ptr->new_a)); + //ocas_add_newcuts(PTRS,numthreads,vars,answerind,numfeatures,weekinds,new_cut,vars->numposcuts[answerind]+vars->numnegcuts[answerind],ptr->W,ptr->new_a); + STocas_add_newcuts(vars,answerind,numfeatures,weekinds,new_cut,vars->numposcuts[answerind]+vars->numnegcuts[answerind],ptr->W,ptr->new_a); + vars->add_time += (OS_milliseconds() - startmilli); +printf("done %d calc ocas_add_newcuts.A%d poscuts.%d negcuts.%d | numthreads.%d\n",c_to_refc(vars->c),answerind,vars->numposcuts[answerind],vars->numnegcuts[answerind],vars->numthreads); + } else inactives[answerind] = 1, printf("maxnohwm.%d\n",max_nohwm); + } + startmilli = OS_milliseconds(); + for (answerind=0; answerindnumposcuts[answerind] - vars->numnegcuts[answerind]); + cutlen = (vars->numposcuts[answerind] + vars->numnegcuts[answerind]); + if ( vars->nohwm[answerind] < lwm ) + lwm = vars->nohwm[answerind]; + ocas_update_Lspace(vars,answerind,netcuts,cutlen,numfeatures,vars->C,0.,vars->QPSolverTolRel); + } + vars->qp_solver_time += (OS_milliseconds() - startmilli); + } + if ( pcount != 0 ) + printf("numactive.%d %.0f | ave perf %f%% | ave nohwm %.1f\n",numactive,pcount,psum/pcount,nosum/pcount); + return(numactive); +} + +static inline int init_ocas_vars(int numthreads,int selector,long answerindmask,struct ocas_vars *vars,int c,double C,int numfeatures,int maxlhs,int maxlen,int len,double *answerabsave,int *posA,int *negA) +{ + int answerind,lastanswerind,retval = 0; + lastanswerind = TRADEBOTS_NUMANSWERS; + vars->maxlen = maxlen; + vars->numthreads = numthreads; + vars->selector = selector; + //printf("init_ocas_vars lastanswerind.%d\n",lastanswerind); + for (answerind=0; answerindlen[answerind]); + if ( vars->len[answerind] > 0 && (answerindmask == -1L || ((1L<refc = c_to_refc(c); vars->c = c; vars->C = C; + vars->numfeatures = numfeatures; vars->maxlhs = maxlhs; + if ( vars->CLspaces[answerind] == 0 ) + vars->CLspaces[answerind] = myaligned_alloc(sizeof(*vars->CLspaces[answerind])); + vars->answerabsaves[answerind] = answerabsave[answerind]; + vars->posA[answerind] = posA[answerind]; vars->negA[answerind] = negA[answerind]; + if ( vars->lhs[answerind] == 0 ) + vars->lhs[answerind] = myaligned_alloc(sizeof(*vars->lhs[answerind]) + numfeatures*maxlhs*sizeof(double)); + vars->maxiters[answerind] = QPSOLVER_MINITER; vars->trn_err[answerind] = vars->len[answerind]; vars->Q_P[answerind] = 0.5*vars->sq_norm_W[answerind] + C*vars->len[answerind]; + vars->perc[answerind] = vars->hwmperc[answerind] = vars->dist[answerind] = vars->hwmdist[answerind] = 0.; vars->numIt[answerind] = 0; + //printf("init.A%d %d | %p %p weekinds.%p\n",answerind,vars->len[answerind],vars->CLspaces[answerind],vars->lhs[answerind],vars->weekinds[answerind]); + } + } + //printf("mask.%lx init_ocas_vars selector.%d weekinds[0].%p\n",answerindmask,selector,vars->weekinds[0]); + return(retval); +} + +void ocas_init(struct ocas_vars *vars,int32_t c,int32_t numfeatures,int32_t starti,int32_t endi) +{ + struct ocas_CLbuffers *ptr; struct ocas_lhsbuffers *lhs; + int32_t nonz,weekind,answerind; double answer,y; + vars->maxlen = (endi - starti + 1); + vars->C = 1.0; + vars->c = c; + vars->TolRel = 0.01; + vars->TolAbs = 0.0; + vars->QPSolverTolRel = vars->TolRel*0.5; + vars->QPSolverTolAbs = vars->TolAbs*0.5; + vars->MaxTime = OCAS_INFINITY; + vars->QPBound = 0.0; + memset(vars->posA,0,sizeof(vars->posA)); + memset(vars->negA,0,sizeof(vars->negA)); + memset(vars->answeraves,0,sizeof(vars->answeraves)); + memset(vars->answerabsaves,0,sizeof(vars->answerabsaves)); + memset(vars->firstweekinds,0,sizeof(vars->firstweekinds)); + vars->starti = starti; + vars->answers = calloc(TRADEBOTS_NUMANSWERS,sizeof(vars->answers)*vars->maxlen); + vars->features = calloc(vars->maxlen,sizeof(*vars->features)); + for (answerind=0; answerindweekinds[answerind] = calloc(vars->maxlen,sizeof(*vars->weekinds[answerind])); + for (weekind=starti; weekind<=endi; weekind++) + { + vars->features[weekind - starti] = get_features(numfeatures,c,weekind); + for (answerind=0; answerindposA[answerind]+vars->negA[answerind]) >= vars->maxlen ) + continue; + if ( (y= get_yval(&answer,0,weekind,c,answerind)) != 0.f ) + { + vars->answers[(weekind-starti)*TRADEBOTS_NUMANSWERS + answerind] = y; + vars->weekinds[answerind][vars->len[answerind]++] = weekind; + if ( vars->posA[answerind]+vars->negA[answerind] == 0 ) + vars->firstweekinds[answerind] = weekind; + vars->answeraves[answerind] += answer; + if ( answer > 0 ) + { + vars->posA[answerind]++; + vars->answerabsaves[answerind] += answer; + } + else if ( answer < 0 ) + { + vars->negA[answerind]++; + vars->answerabsaves[answerind] -= answer; + } + } + } + } + for (answerind=0; answerindposA[answerind]+vars->negA[answerind])) != 0 ) + { + vars->answerabsaves[answerind] /= nonz; + vars->answeraves[answerind] /= nonz; + printf("A%02d.(%9.6f %d %d) ",answerind,vars->answerabsaves[answerind],vars->posA[answerind],vars->negA[answerind]); + } + init_ocas_vars(1,0,-1,vars,c,vars->C,numfeatures,MAX_OCAS_LHS,vars->maxlen,vars->maxlen,vars->answerabsaves,vars->posA,vars->negA); + for (answerind=0; answerindweekinds[0],numfeatures); + //if ( answerindmask != -1 && ((1L<len[answerind]); + lhs = vars->lhs[answerind]; + ptr = vars->CLspaces[answerind]; + vars->numlhs[answerind] = 0;//init_full_A(lhs->full_A,vars->numfeatures,c,answerind,models); + memset(ptr->W,0,sizeof(*ptr->W) * numfeatures); + memset(ptr->oldW,0,sizeof(*ptr->oldW) * numfeatures); + vars->W0[answerind] = vars->oldW0[answerind] = 0; +#ifdef ENABLE_EXISTINGMODEL + double init_model(double *percp,double *W,double *oldW,int c,int answerind,int numfeatures); + vars->W0[answerind] = init_model(&vars->hwmperc[answerind],ptr->W,ptr->oldW,c,answerind,vars->numfeatures); + if ( _dbufave(ptr->W,numfeatures) != 0 && bitweight(answerindmask) == 1 ) + validate_ocas_model(vars,answerind,ptr->output_pred,ptr->old_output,vars->weekinds[answerind],vars->len[answerind],ptr->W,vars->W0[answerind],numfeatures,1); +#endif + //printf("%s.A%d call init ocas vars weekinds[0] %p\n",CONTRACTS[c_to_refc(c)],answerind,vars->weekinds[0]); + } + vars->output_time = vars->sort_time = vars->w_time = vars->qp_solver_time = vars->ocas_time = vars->add_time = 0; + vars->startweekind = starti; vars->endweekind = endi; +} + +int32_t ocas_gen(int32_t c,int32_t numfeatures,int32_t starti,int32_t endi) +{ + int32_t i; struct ocas_vars *vars = calloc(1,sizeof(*vars)); + ocas_init(vars,c,numfeatures,starti,endi); + for (i=0; irefc = Tradebot_numarbpairs++; strcpy(pair->rel,rel); strcpy(pair->base,base); if ( strcmp(base,"NXT") == 0 && strcmp(rel,"BTC") == 0 ) @@ -240,20 +244,20 @@ int32_t tradebots_expandrawfeatures(double *svmfeatures,float *rawfeatures,uint3 return(n); } -int32_t tradebots_calcsvmfeatures(double *svmfeatures,struct tradebot_arbpair *pair) +int32_t tradebots_calcsvmfeatures(double *svmfeatures,struct tradebot_arbpair *pair,float *rawfeatures,float *prevrawfeatures) { int32_t i,j,n,numpairfeatures,flag; struct tradebot_arbpair *ptr; uint32_t reftimestamp; - memcpy(&reftimestamp,pair->rawfeatures,sizeof(reftimestamp)); + memcpy(&reftimestamp,rawfeatures,sizeof(reftimestamp)); if ( reftimestamp == 0 ) return(-1); - numpairfeatures = n = tradebots_expandrawfeatures(svmfeatures,pair->rawfeatures,reftimestamp,pair->prevrawfeatures); - if ( pair->numsvmfeatures != (1+pair->numpairs)*n ) + numpairfeatures = n = tradebots_expandrawfeatures(svmfeatures,rawfeatures,reftimestamp,prevrawfeatures); + if ( 0 && pair->numsvmfeatures != (1+pair->numpairs)*n ) { - for (i=0; inumpairs; i++) + for (i=0; inumpairs; i++) // need to do lookups { flag = -1; - if ( (ptr= tradebot_arbpair_find(pair->svmpairs[i][0],pair->svmpairs[i][1])) != 0 ) - flag = tradebots_expandrawfeatures(&svmfeatures[n],ptr->rawfeatures,reftimestamp,pair->rawfeatures); + if ( (ptr= tradebots_arbpair_find(pair->svmpairs[i][0],pair->svmpairs[i][1])) != 0 ) + flag = tradebots_expandrawfeatures(&svmfeatures[n],ptr->rawfeatures,reftimestamp,rawfeatures); if ( flag < 0 ) { for (j=0; jnumsvmfeatures ) - { - printf("unexpected numsvmfeatures %d vs %d\n",n,pair->numsvmfeatures); - return(-1); - } return(n); } @@ -287,6 +286,7 @@ void tradebots_calcanswers(struct tradebot_arbpair *pair) double highbid,lowask,futurebid,futureask,ave,vol,bidaves[TRADEBOTS_NUMDECAYS],askaves[TRADEBOTS_NUMDECAYS],bidslopes[TRADEBOTS_NUMDECAYS],askslopes[TRADEBOTS_NUMDECAYS]; float rawfeatures[sizeof(pair->rawfeatures)/sizeof(*pair->rawfeatures)],futuremin,futuremax,minval,maxval,*hblas = 0; uint32_t timestamp,firsttime = 0; long fpos,savepos; int32_t flag,i,iter,j,ind,maxi; + OCAS_PLUS_INF = _OCAS_PLUS_INF; OCAS_NEG_INF = -_OCAS_PLUS_INF; if ( pair->fp != 0 ) { for (iter=0; iter<2; iter++) @@ -297,7 +297,7 @@ void tradebots_calcanswers(struct tradebot_arbpair *pair) { savepos = ftell(pair->fp); timestamp = tradebots_featureset(&highbid,&lowask,&ave,&vol,bidaves,askaves,bidslopes,askslopes,rawfeatures); - printf("timestamp.%u firsttime.%u\n",timestamp,firsttime); + //printf("timestamp.%u firsttime.%u\n",timestamp,firsttime); if ( timestamp == 0 ) continue; if ( firsttime == 0 ) @@ -393,6 +393,66 @@ void tradebots_calcanswers(struct tradebot_arbpair *pair) printf("ERROR: %s/%s not on feature boundary\n",pair->base,pair->rel); } +double get_yval(double *answerp,int32_t selector,int32_t ind,int32_t refc,int32_t answerind) +{ + float answer; struct tradebot_arbpair *pair; long savepos; + pair = &Arbpairs[refc]; + if ( pair->fp != 0 ) + { + savepos = ftell(pair->fp); + fseek(pair->fp,ind*sizeof(pair->rawfeatures)+answerind*sizeof(*pair->rawfeatures),SEEK_SET); + if ( fread(&answer,1,sizeof(answer),pair->fp) != sizeof(answer) ) + answer = 0; + fseek(pair->fp,savepos,SEEK_SET); + if ( isnan(answer) != 0 ) + return(0); + if ( answer > .01 ) + answer = .01; + else if ( answer < -.01 ) + answer = -.01; + if ( answerp != 0 ) + *answerp = answer; + if ( answer > 0. ) + return(1.); + else if ( answer < 0. ) + return(-1.); + } + return(0.); +} + +float *get_features(int32_t numfeatures,int32_t refc,int32_t ind) +{ + struct tradebot_arbpair *pair; long savepos; int32_t i,n; double svmfeatures[4096]; + float rawfeatures[sizeof(pair->rawfeatures)],prevrawfeatures[sizeof(pair->rawfeatures)],*svmf=0; + pair = &Arbpairs[refc]; + pair->numsvmfeatures = numfeatures; + if ( pair->fp != 0 && ind > 0 ) + { + savepos = ftell(pair->fp); + fseek(pair->fp,(ind-1)*sizeof(pair->rawfeatures),SEEK_SET); + if ( fread(&prevrawfeatures,1,sizeof(pair->rawfeatures),pair->fp) == sizeof(pair->rawfeatures) && fread(&rawfeatures,1,sizeof(pair->rawfeatures),pair->fp) == sizeof(pair->rawfeatures) ) + { + n = tradebots_calcsvmfeatures(svmfeatures,pair,rawfeatures,prevrawfeatures); + if ( n != pair->numsvmfeatures ) + { + printf("unexpected numsvmfeatures %d vs %d\n",n,pair->numsvmfeatures); + //return(-1); + } + svmf = calloc(n,sizeof(*svmf)); + for (i=0; ifp,savepos,SEEK_SET); + } + return(svmf); +} + +double set_ocas_model(int refc,int answerind,double *W,double W0,int numfeatures,int firstweekind,int len,int bad,double dist,double predabs,int posA,int negA,double answerabs,double aveanswer) +{ + return(0.); +} +#include "tradebots_SVM.h" + static char *assetids[][2] = { { "12071612744977229797", "UNITY" }, @@ -438,7 +498,7 @@ void tradebot_arbentry(struct tradebot_arbentry *arb,char *exchange,double price } else printf("mismatched arbexchange? (%s vs %s)\n",arb->exchange,exchange); } -struct tradebot_arbexchange *tradebot_arbexchange_find(struct tradebot_arbpair *pair,char *exchange) +struct tradebot_arbexchange *tradebots_arbexchange_find(struct tradebot_arbpair *pair,char *exchange) { int32_t i; for (i=0; inumexchanges; i++) @@ -447,7 +507,7 @@ struct tradebot_arbexchange *tradebot_arbexchange_find(struct tradebot_arbpair * return(0); } -struct tradebot_arbexchange *tradebot_arbexchange_create(struct tradebot_arbpair *pair,char *exchange) +struct tradebot_arbexchange *tradebots_arbexchange_create(struct tradebot_arbpair *pair,char *exchange) { if ( pair->numexchanges < sizeof(pair->exchanges)/sizeof(*pair->exchanges) ) { @@ -466,15 +526,15 @@ void tradebot_arbcandidate(struct supernet_info *myinfo,char *exchange,int32_t t return; } offset = (tradedir > 0) ? 0 : 1; - if ( (pair= tradebot_arbpair_find(base,rel)) == 0 ) - pair = tradebot_arbpair_create(base,rel); + if ( (pair= tradebots_arbpair_find(base,rel)) == 0 ) + pair = tradebots_arbpair_create(base,rel); if ( pair == 0 ) { printf("cant get pair for %s %s/%s\n",exchange,base,rel); return; } - if ( (arbex= tradebot_arbexchange_find(pair,exchange)) == 0 ) - arbex = tradebot_arbexchange_create(pair,exchange); + if ( (arbex= tradebots_arbexchange_find(pair,exchange)) == 0 ) + arbex = tradebots_arbexchange_create(pair,exchange); if ( arbex != 0 ) { //printf("cand.%d %16s %s %12.6f (%5s/%-5s) at %12.8f profit %.03f\n",pair->numexchanges,exchange,tradedir<0?"ask":"bid",volume,base,rel,price,profitmargin); @@ -617,13 +677,13 @@ void tradebot_arbcandidate(struct supernet_info *myinfo,char *exchange,int32_t t { if ( myinfo->svmfeatures == 0 ) myinfo->svmfeatures = calloc(sizeof(*myinfo->svmfeatures),pair->numsvmfeatures); - if ( tradebots_calcsvmfeatures(myinfo->svmfeatures,pair) > 0 ) + if ( tradebots_calcsvmfeatures(myinfo->svmfeatures,pair,pair->rawfeatures,pair->prevrawfeatures) > 0 ) tradebots_calcpreds(pair->RTpreds,pair,myinfo->svmfeatures); } } pair->lasttime = (uint32_t)time(NULL); } - if ( time(NULL) > pair->lastanswertime+3600 ) + if ( 0 && time(NULL) > pair->lastanswertime+3600 ) { tradebots_calcanswers(pair); pair->lastanswertime = (uint32_t)time(NULL); @@ -861,8 +921,8 @@ void tradebots_processprices(struct supernet_info *myinfo,struct exchange_info * price = bidasks[1].price; tradebot_arbcandidate(myinfo,exchange->name,-1,base,rel,price,volume,(uint32_t)time(NULL),profitmargin); } - if ( (pair= tradebot_arbpair_find(base,rel)) == 0 ) - pair = tradebot_arbpair_create(base,rel); + if ( (pair= tradebots_arbpair_find(base,rel)) == 0 ) + pair = tradebots_arbpair_create(base,rel); if ( pair != 0 ) { if ( strcmp(rel,"NXT") == 0 ) @@ -885,3 +945,19 @@ void tradebots_processprices(struct supernet_info *myinfo,struct exchange_info * } } } + +#include "../includes/iguana_apidefs.h" +#include "../includes/iguana_apideclares.h" + +TWO_STRINGS(tradebots,gensvm,base,rel) +{ + int32_t numfeatures = 532; struct tradebot_arbpair *pair; + if ( base[0] != 0 && rel[0] != 0 && (pair= tradebots_arbpair_find(base,rel)) != 0 && pair->fp != 0 ) + { + tradebots_calcanswers(pair); + ocas_gen(pair->refc,numfeatures,0,(int32_t)(ftell(pair->fp) / sizeof(pair->rawfeatures))); + return(clonestr("{\"result\":\"success\"}")); + } else return(clonestr("{\"error\":\"cant find arbpair\"}")); +} + +#include "../includes/iguana_apiundefs.h" diff --git a/crypto777/OS_nonportable.c b/crypto777/OS_nonportable.c index 52832bba9..9e4e3f281 100755 --- a/crypto777/OS_nonportable.c +++ b/crypto777/OS_nonportable.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/OS_portable.c b/crypto777/OS_portable.c index c06dfb545..7f614b816 100755 --- a/crypto777/OS_portable.c +++ b/crypto777/OS_portable.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 68a59b0a7..d1baed4e0 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/OS_time.c b/crypto777/OS_time.c index e127ad7a5..245da6928 100755 --- a/crypto777/OS_time.c +++ b/crypto777/OS_time.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/SaM.c b/crypto777/SaM.c index 3f9c2d092..bfc97df59 100755 --- a/crypto777/SaM.c +++ b/crypto777/SaM.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 5960a16c0..2d31acdd2 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index d67dfa742..719c3eb8e 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -634,7 +634,7 @@ void cJSON_Minify(char *json) // the following written by jl777 /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/curve25519.c b/crypto777/curve25519.c index eae51aefc..5d2c24930 100755 --- a/crypto777/curve25519.c +++ b/crypto777/curve25519.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 425e65d73..5363f2135 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/iguana_serdes.c b/crypto777/iguana_serdes.c index eff6f3e5f..996743c78 100755 --- a/crypto777/iguana_serdes.c +++ b/crypto777/iguana_serdes.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index aa532d699..cc058efd1 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/crypto777/ramcoder.c b/crypto777/ramcoder.c index d495914de..86760289f 100755 --- a/crypto777/ramcoder.c +++ b/crypto777/ramcoder.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/datachain/datachain.c b/datachain/datachain.c index d0f661c79..9922e3f78 100755 --- a/datachain/datachain.c +++ b/datachain/datachain.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/deprecated/iguana_instantdex.c b/deprecated/iguana_instantdex.c index 85755175b..5baf88af0 100755 --- a/deprecated/iguana_instantdex.c +++ b/deprecated/iguana_instantdex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/gecko/gecko.c b/gecko/gecko.c index cd7667089..5a0c2dbaa 100755 --- a/gecko/gecko.c +++ b/gecko/gecko.c @@ -1,6 +1,6 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/SuperNET_keys.c b/iguana/SuperNET_keys.c index be283118e..577907b5f 100755 --- a/iguana/SuperNET_keys.c +++ b/iguana/SuperNET_keys.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 4d1c27e4b..d9e3cb1f2 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index b65ec3a50..fc03913fa 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index be5b16837..758e0125d 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 3b942a953..cc2420201 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index 54924fc22..8509397b5 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 2b3b8b23b..4c141cd5d 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/bitcoin.c b/iguana/exchanges/bitcoin.c index 90d4d4fef..5f8c3ec7b 100755 --- a/iguana/exchanges/bitcoin.c +++ b/iguana/exchanges/bitcoin.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/bitcoin.h b/iguana/exchanges/bitcoin.h index 2a5cf651e..ad362a5a2 100755 --- a/iguana/exchanges/bitcoin.h +++ b/iguana/exchanges/bitcoin.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/bitfinex.c b/iguana/exchanges/bitfinex.c index 764167ca3..6643fff89 100755 --- a/iguana/exchanges/bitfinex.c +++ b/iguana/exchanges/bitfinex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/bitstamp.c b/iguana/exchanges/bitstamp.c index 30c9b9a5a..36e928a34 100755 --- a/iguana/exchanges/bitstamp.c +++ b/iguana/exchanges/bitstamp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/bittrex.c b/iguana/exchanges/bittrex.c index 4e1ee5c63..155de4cfa 100755 --- a/iguana/exchanges/bittrex.c +++ b/iguana/exchanges/bittrex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/btc38.c b/iguana/exchanges/btc38.c index 268dce776..493d3fa0d 100755 --- a/iguana/exchanges/btc38.c +++ b/iguana/exchanges/btc38.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/btce.c b/iguana/exchanges/btce.c index c7a255b06..b1d5a1291 100755 --- a/iguana/exchanges/btce.c +++ b/iguana/exchanges/btce.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/coinbase.c b/iguana/exchanges/coinbase.c index 1a0fd190d..528df90a2 100755 --- a/iguana/exchanges/coinbase.c +++ b/iguana/exchanges/coinbase.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/exchange_supports.h b/iguana/exchanges/exchange_supports.h index 083630bc1..fc7c854d2 100755 --- a/iguana/exchanges/exchange_supports.h +++ b/iguana/exchanges/exchange_supports.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/exchange_undefs.h b/iguana/exchanges/exchange_undefs.h index 20862bce8..6d115147d 100755 --- a/iguana/exchanges/exchange_undefs.h +++ b/iguana/exchanges/exchange_undefs.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/fxcm.c b/iguana/exchanges/fxcm.c index 42807a46f..ac39cbbd1 100755 --- a/iguana/exchanges/fxcm.c +++ b/iguana/exchanges/fxcm.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/huobi.c b/iguana/exchanges/huobi.c index 402049a7c..02cc6f941 100755 --- a/iguana/exchanges/huobi.c +++ b/iguana/exchanges/huobi.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/instaforex.c b/iguana/exchanges/instaforex.c index 3efa2a0e4..babcec86f 100755 --- a/iguana/exchanges/instaforex.c +++ b/iguana/exchanges/instaforex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/jumblr.c b/iguana/exchanges/jumblr.c index ba3cb4209..9803bbc05 100755 --- a/iguana/exchanges/jumblr.c +++ b/iguana/exchanges/jumblr.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/lakebtc.c b/iguana/exchanges/lakebtc.c index 992665a07..3542ac9ba 100755 --- a/iguana/exchanges/lakebtc.c +++ b/iguana/exchanges/lakebtc.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/nxtae.c b/iguana/exchanges/nxtae.c index 592532f30..03e2c1eee 100755 --- a/iguana/exchanges/nxtae.c +++ b/iguana/exchanges/nxtae.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/okcoin.c b/iguana/exchanges/okcoin.c index 793fa38e6..af2fe5184 100755 --- a/iguana/exchanges/okcoin.c +++ b/iguana/exchanges/okcoin.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/poloniex.c b/iguana/exchanges/poloniex.c index 037db3715..a45c3e343 100755 --- a/iguana/exchanges/poloniex.c +++ b/iguana/exchanges/poloniex.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/quadriga.c b/iguana/exchanges/quadriga.c index 6347c5118..e686c9787 100755 --- a/iguana/exchanges/quadriga.c +++ b/iguana/exchanges/quadriga.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/truefx.c b/iguana/exchanges/truefx.c index 331eb71d6..1d0049543 100755 --- a/iguana/exchanges/truefx.c +++ b/iguana/exchanges/truefx.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges/unconf.c b/iguana/exchanges/unconf.c index d0cea56ab..951b6419d 100755 --- a/iguana/exchanges/unconf.c +++ b/iguana/exchanges/unconf.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/exchanges777.h b/iguana/exchanges777.h index 2d1ba66a7..fdefd98b5 100755 --- a/iguana/exchanges777.h +++ b/iguana/exchanges777.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 6176e51b7..f8fc045ce 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana777.h b/iguana/iguana777.h index d5a8e6f32..cd2cdd931 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_accept.c b/iguana/iguana_accept.c index b3eaa07be..869d0f3bb 100755 --- a/iguana/iguana_accept.c +++ b/iguana/iguana_accept.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_bitmap.c b/iguana/iguana_bitmap.c index 94a63fc72..b690738b5 100755 --- a/iguana/iguana_bitmap.c +++ b/iguana/iguana_bitmap.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 84bf9c914..9d502494f 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 0c9bba65f..d4ad7a81e 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_chains.c b/iguana/iguana_chains.c index 7a2b1f370..927fc0752 100755 --- a/iguana/iguana_chains.c +++ b/iguana/iguana_chains.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_exchanges.c b/iguana/iguana_exchanges.c index d6f7409cd..d8d678004 100755 --- a/iguana/iguana_exchanges.c +++ b/iguana/iguana_exchanges.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 8d9ccacfd..961996a23 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_interpreter.c b/iguana/iguana_interpreter.c index 4ed277649..d98ac46a8 100755 --- a/iguana/iguana_interpreter.c +++ b/iguana/iguana_interpreter.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index ca7a1fea3..6ca3c0074 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_mofn.c b/iguana/iguana_mofn.c index 50d024457..4cca28947 100755 --- a/iguana/iguana_mofn.c +++ b/iguana/iguana_mofn.c @@ -309,7 +309,7 @@ int maingen(int argc,char **argv) } /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index f9a46eec0..4b7a497d9 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ae4cffadb..f0466aea5 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index db778a1f6..1d23f1a48 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index f981cc82d..bedda833f 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index d94078751..7ed8867fc 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index b54a82e39..bedc4b911 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index f7bd3f598..c310b0a12 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_rpc.c b/iguana/iguana_rpc.c index 70c072490..cc5eaf831 100755 --- a/iguana/iguana_rpc.c +++ b/iguana/iguana_rpc.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_scripts.c b/iguana/iguana_scripts.c index 7a79fed39..4374c50ea 100755 --- a/iguana/iguana_scripts.c +++ b/iguana/iguana_scripts.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index b69929408..984379f3a 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_sign.c b/iguana/iguana_sign.c index 5f34def90..f8790f003 100755 --- a/iguana/iguana_sign.c +++ b/iguana/iguana_sign.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index 0667d429e..e1d9a9479 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_tradebots.c b/iguana/iguana_tradebots.c index f6755e71d..8134c9125 100755 --- a/iguana/iguana_tradebots.c +++ b/iguana/iguana_tradebots.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index c58b7c56d..36972a0c6 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index cf49872ef..6db6d03ed 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 4d2581d69..5e53c357d 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_volatiles.c b/iguana/iguana_volatiles.c index 5ea221167..8bf4923f1 100755 --- a/iguana/iguana_volatiles.c +++ b/iguana/iguana_volatiles.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index f452e3695..cfa8a8d4e 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/main.c b/iguana/main.c index 15fe34b9f..5ee0dd9fe 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/iguana/ramchain_api.c b/iguana/ramchain_api.c index 59fe53824..e14d744d4 100755 --- a/iguana/ramchain_api.c +++ b/iguana/ramchain_api.c @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/includes/iguana_apideclares.h b/includes/iguana_apideclares.h index b3ff9e271..bf81a3f7b 100755 --- a/includes/iguana_apideclares.h +++ b/includes/iguana_apideclares.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * @@ -43,6 +43,7 @@ ZERO_ARGS(pax,start); HASH_ARRAY_STRING(tradebot,liquidity,hash,vals,targetcoin); ZERO_ARGS(tradebot,amlp); ZERO_ARGS(tradebot,notlp); +TWO_STRINGS(tradebots,gensvm,base,rel); INT_AND_ARRAY(iguana,rates,unused,quotes); TWO_STRINGS(iguana,rate,base,rel); diff --git a/includes/iguana_defines.h b/includes/iguana_defines.h index 7fbf0a817..942336699 100755 --- a/includes/iguana_defines.h +++ b/includes/iguana_defines.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/includes/iguana_funcs.h b/includes/iguana_funcs.h index 5ed16af94..efba8cba3 100755 --- a/includes/iguana_funcs.h +++ b/includes/iguana_funcs.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/includes/iguana_globals.h b/includes/iguana_globals.h index 5d8c57f94..cc0a13359 100755 --- a/includes/iguana_globals.h +++ b/includes/iguana_globals.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index 6cf3766a3..0552c6854 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * diff --git a/includes/iguana_types.h b/includes/iguana_types.h index 7b953cea1..4a1b4647e 100755 --- a/includes/iguana_types.h +++ b/includes/iguana_types.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright © 2014-2016 The SuperNET Developers. * + * Copyright © 2014-2017 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright *