void QuantitationRatio::printDelimitedLine2 ( ostream& os, const DoubleVectorVector& dvv, DoubleVectorVectorSizeType peakNumber ) const { for ( int i = 0 ; i < dvv.size () ; i++ ) { if ( ok [i][peakNumber] ) delimitedCell ( os, dvv [i][peakNumber], 0 ); else delimitedEmptyCell ( os ); } }
void QuantitationRatio::printHTMLLine2 ( ostream& os, const DoubleVectorVector& dvv, DoubleVectorVectorSizeType peakNumber, const string& styleID ) const { for ( int i = 0 ; i < dvv.size () ; i++ ) { if ( ok [i][peakNumber] ) tableCell ( os, dvv [i][peakNumber], 0, false, styleID ); else tableEmptyCell ( os, styleID ); } }
void QuantitationRatio::printDelimitedLine4 ( ostream& os, const DoubleVectorVector& ratio, const CharVectorVector& ratioType, DoubleVectorVectorSizeType peakNumber ) const { for ( int i = 0 ; i < ratio.size () ; i++ ) { if ( ok [0][peakNumber] && ok [i+1][peakNumber] && quanPep ) printDelimitedRatio ( os, ratio [i][peakNumber], ratioType [i][peakNumber] ); else delimitedEmptyCell ( os ); } }
void QuantitationRatio::printDelimitedLine3 ( ostream& os, const DoubleVectorVector& dvv, DoubleVectorVectorSizeType peakNumber ) const { for ( int i = 0 ; i < dvv.size () ; i++ ) { if ( ok [0][peakNumber] && ok [i+1][peakNumber] && quanPep ) delimitedCellSigFig ( os, dvv [i][peakNumber], 4 ); else delimitedEmptyCell ( os ); } }
void QuantitationRatio::printHTMLLine4 ( ostream& os, const DoubleVectorVector& ratio, const CharVectorVector& ratioType, DoubleVectorVectorSizeType peakNumber, const string& styleID ) const { for ( int i = 0 ; i < ratio.size () ; i++ ) { if ( ok [0][peakNumber] && ok [i+1][peakNumber] && quanPep ) printHTMLRatio ( os, ratio [i][peakNumber], ratioType [i][peakNumber], styleID ); else tableEmptyCell ( os, styleID ); } }
set<uint> DBSCAN::neighborhood(const DoubleVectorVector& inputdata, uint startObjectID) { set<uint> result; uint nOfObjects=inputdata.size(); for(uint i=0;i<nOfObjects;++i) { if(distance(inputdata,i,startObjectID)<=epsilon_) { result.insert(i); } } return result; }
CosSimilarityList::CosSimilarityList ( const StringVector& formulaString, int charge, const DoubleVectorVector& intensity, const DoubleVectorVector& area, int numQuanStates ) : csi ( numQuanStates, -100.0 ), csa ( numQuanStates, -100.0 ) { for ( int i = 0 ; i < numQuanStates ; i++ ) { CosSimilarity cs ( formulaString [i], charge, i < intensity.size () ? intensity [i] : DoubleVector (), i < area.size () ? area [i] : DoubleVector () ); csi [i] = cs.getIntensity (); csa [i] = cs.getArea (); } }
void DBSCAN::run(const DoubleVectorVector& inputdata, ResultVector &clusterInformation){ DBG(25) << "Init ..."; uint nOfObservations=inputdata.size(); distanceTable_=DoubleVectorVector(nOfObservations); for(uint i=0;i<nOfObservations;++i) { distanceTable_[i]=new DoubleVector(nOfObservations,-1); } clusterInformation=vector<int>(nOfObservations,UNCLASSIFIED); // all observations are unclassified uint tenpercent=nOfObservations/10; uint percent=0; BLINK(25) << "done" << endl; uint clusterId=0; for(uint i=0;i<nOfObservations;++i) { if(i%tenpercent==0) {DBG(10) << percent << "% done" << endl; percent+=10;} if(clusterInformation[i]==UNCLASSIFIED) { if(expandClusters(inputdata,clusterInformation,i,clusterId)) { ++clusterId; DBG(10) << "ClusterId=" << clusterId << endl; } } } }