protected ArrayModifiableDBIDs initialMedoids ( DistanceQuery < V > distQ , DBIDs ids ) { if ( getLogger ( ) . isStatistics ( ) ) { getLogger ( ) . statistics ( new StringStatistic ( getClass ( ) . getName ( ) + ".initialization" , initializer . toString ( ) ) ) ; } Duration initd = getLogger ( ) . newDuration ( getClass ( ) . getName ( ) + ".initialization-time" ) . begin ( ) ; ArrayModifiableDBIDs medoids = DBIDUtil . newArray ( initializer . chooseInitialMedoids ( k , ids , distQ ) ) ; getLogger ( ) . statistics ( initd . end ( ) ) ; if ( medoids . size ( ) != k ) { throw new AbortException ( "Initializer " + initializer . toString ( ) + " did not return " + k + " means, but " + medoids . size ( ) ) ; } return medoids ; }
Choose the initial medoids .