From 53b73dec4d6e71899d183335509591b7c89a419b Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Thu, 14 Jun 2012 18:34:23 -0400 Subject: pushing the fly-tools into this repository --- fly-tools/misc/test.cpp | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 fly-tools/misc/test.cpp (limited to 'fly-tools/misc/test.cpp') diff --git a/fly-tools/misc/test.cpp b/fly-tools/misc/test.cpp new file mode 100644 index 0000000..a709482 --- /dev/null +++ b/fly-tools/misc/test.cpp @@ -0,0 +1,92 @@ +#include +#include + +using namespace std; + +void largestIncreasingPositiveDotProductSeq(vector velocityDirs, int &startIndex, int &endIndex) { + + int positiveVelSeqSize = 0; + int flag = false; + int maxSeqSize = 0; + int st = 0; + for (int j=0; j 0 && flag == false) { + st = j; + positiveVelSeqSize++; + flag = true; + cout << "In first if positiveSize "< 0 && flag == true) { + positiveVelSeqSize++; + cout << "In second if positive "< maxSeqSize) { + maxSeqSize = positiveVelSeqSize; + startIndex = st; + endIndex = st+positiveVelSeqSize; + cout << "maxseq updated \npositiveSize "< test(4); + test[0]=0; + test[1]=7; + test[2]=0; + test[3]=7; + /*test[4]=5; + test[5]=2; + test[6]=-3; + test[7]=-4; + test[8]=2; + test[9]=3; + */ + int st; + int endIndex; + + largestIncreasingPositiveDotProductSeq(test,st, endIndex ); + for (int i=st; i<=endIndex; i++) { + cout << test[i]<=st; i=i-5) { + c = i; + cout << c << endl; + size++; + } + if ((c-st) != 0) { + cout <<"additional " <