void AllSubsets::reset(Matrix2D* m, Matrix2D& points, Vector& mu) { reset(); //create first subset matrix for(int j = 0; j <= sizeOfSubsample; j++) m->setValue(0, j, 1.0); for(int i = 1; i <= sizeOfSubsample; i++) { m->setValue(i, 0, mu.getValue(i-1)); } for(int j = 0; j < sizeOfSubsample - 1; j++) { selectedElements[j] = j; for(int i = 0; i < sizeOfSubsample; i++) { m->setValue(i+1, j+1, points.getValue(i,j)); } } selectedElements[numberOfElements - 1] = sizeOfSubsample - 1; for(int i = 0; i < sizeOfSubsample; i++) m->setValue(i+1, sizeOfSubsample, points.getValue(i, numberOfElements - 1)); }
void AllSubsets::reset(Matrix2D* m, Matrix2D* m2, Matrix2D& points, Vector& mu) { reset(); reset(m, points, mu); //create first subset matrix for(int j = 0; j < sizeOfSubsample; j++) m2->setValue(0, j, 1.0); for(int j = 0; j < sizeOfSubsample - 1; j++) { for(int i = 0; i < sizeOfSubsample; i++) { m2->setValue(i+1, j, points.getValue(i,j)); } } for(int i = 0; i < sizeOfSubsample; i++) m2->setValue(i+1, sizeOfSubsample - 1, points.getValue(i, numberOfElements - 1)); }
void RandomSubsets::reset(Matrix2D* m, Matrix2D* m2, Matrix2D& points, Vector& mu) { reset(m, points, mu); reset(); //create first subset matrix for(int j = 0; j < sizeOfSubsample; j++) m2->setValue(0, j, 1.0); for(int j = 0; j < sizeOfSubsample - 1; j++) { for(int i = 0; i < sizeOfSubsample; i++) { m2->setValue(i+1, j, points.getValue(i,j)); } } getNextSubset(m,m2,points); count=0; }