} // data point j
// (3) Iterations
Int_t nit = 0;
- Bool_t rmovalStep = kFALSE;
while(1) {
nit++;
} // data point j
// (3) Iterations
Int_t nit = 0;
- Bool_t rmovalStep = kFALSE;
while(1) {
nit++;
// Constructor
}
+AliKMeansResult::AliKMeansResult(const AliKMeansResult &res):
+ TObject(res),
+ fK(res.GetK()),
+ fMx(0),
+ fMy(0),
+ fSigma2(0),
+ fRk(0),
+ fTarget(0),
+ fInd(0)
+{
+ // Copy constructor
+ for (Int_t i = 0; i <fK; i++) {
+ fMx[i] = (res.GetMx()) [i];
+ fMy[i] = (res.GetMy()) [i];
+ fSigma2[i] = (res.GetSigma2())[i];
+ fRk[i] = (res.GetRk()) [i];
+ fTarget[i] = (res.GetTarget())[i];
+ fInd[i] = (res.GetInd()) [i];
+ }
+}
+
+AliKMeansResult& AliKMeansResult::operator=(const AliKMeansResult& res)
+{
+ //
+ // Assignment operator
+ if (this != &res) {
+ fK = res.GetK();
+ for (Int_t i = 0; i <fK; i++) {
+ fMx[i] = (res.GetMx()) [i];
+ fMy[i] = (res.GetMy()) [i];
+ fSigma2[i] = (res.GetSigma2())[i];
+ fRk[i] = (res.GetRk()) [i];
+ fTarget[i] = (res.GetTarget())[i];
+ fInd[i] = (res.GetInd()) [i];
+ }
+ }
+ return *this;
+}
+
+
AliKMeansResult::~AliKMeansResult()
{
// Destructor
TMath::Sort(fK, fTarget, fInd);
}
+
+void AliKMeansResult::CopyResults(AliKMeansResult* res)
+{
+ fK = res->GetK();
+ for (Int_t i = 0; i <fK; i++) {
+ fMx[i] = (res->GetMx()) [i];
+ fMy[i] = (res->GetMy()) [i];
+ fSigma2[i] = (res->GetSigma2())[i];
+ fRk[i] = (res->GetRk()) [i];
+ fTarget[i] = (res->GetTarget())[i];
+ fInd[i] = (res->GetInd()) [i];
+ }
+}