public Partition run(IDoubleMatrix similarity){
  DoubleMatrixOps.assertDiagonallyDominant(similarity);
  DoubleMatrixOps.assertSymmetric(similarity,1e-16);
  if (similarity.getRowNum() <= 2) {
    throw new AdeCoreIllegalArgumentException("Minimal matrix size 3x3");
  }
  mSimilarity=similarity;
  if (mRunsSummary != null) {
    mRunsSummary.clear();
  }
  myPrintln(1,"Starting " + mRunNum + " runs");
  Partition bestPartition=null;
  mConverged=false;
  for (int i=0; i < mRunNum; ++i) {
    Partition partition;
    long startTime=System.currentTimeMillis();
    partition=execute();
    long stopTime=System.currentTimeMillis();
    long duration=stopTime - startTime;
    if (mRunsSummary != null) {
      mRunsSummary.add(new IClustRunSummary(partition.mTotalScore,mTrials,duration,partition.mSeed,mIdleTrials));
    }
    if (bestPartition == null || partition.mTotalScore > bestPartition.mTotalScore) {
      mConverged=(mTrials < mMaxTrialNum);
      bestPartition=partition;
    }
    if (partition.getScore() >= 1) {
      break;
    }
  }
  myPrintln(1,"Finished all runs with score=" + (bestPartition != null ? bestPartition.mTotalScore : 0));
  return bestPartition;
}

public Partition run ( IDoubleMatrix similarity ) { DoubleMatrixOps . assertDiagonallyDominant ( similarity ) ; DoubleMatrixOps . assertSymmetric ( similarity , 1e-16 ) ; if ( similarity . getRowNum ( ) <= 2 ) { throw new AdeCoreIllegalArgumentException ( "Minimal matrix size 3x3" ) ; } mSimilarity = similarity ; if ( mRunsSummary != null ) { mRunsSummary . clear ( ) ; } myPrintln ( 1 , "Starting " + mRunNum + " runs" ) ; Partition bestPartition = null ; mConverged = false ; for ( int i = 0 ; i < mRunNum ; ++ i ) { Partition partition ; long startTime = System . currentTimeMillis ( ) ; partition = execute ( ) ; long stopTime = System . currentTimeMillis ( ) ; long duration = stopTime - startTime ; if ( mRunsSummary != null ) { mRunsSummary . add ( new IClustRunSummary ( partition . mTotalScore , mTrials , duration , partition . mSeed , mIdleTrials ) ) ; } if ( bestPartition == null || partition . mTotalScore > bestPartition . mTotalScore ) { mConverged = ( mTrials < mMaxTrialNum ) ; bestPartition = partition ; } if ( partition . getScore ( ) >= 1 ) { break ; } } myPrintln ( 1 , "Finished all runs with score=" + ( bestPartition != null ? bestPartition . mTotalScore : 0 ) ) ; return bestPartition ; }
performs iclust run on the given similarity matrix .
