This repository was archived by the owner on Mar 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -1276,9 +1276,6 @@ class CV_EXPORTS_W RTrees : public DTrees
12761276 /* * @copybrief getTermCriteria @see getTermCriteria */
12771277 CV_WRAP virtual void setTermCriteria (const TermCriteria &val) = 0;
12781278
1279- /* * Set initial random number generator state for training the forest. */
1280- virtual void setForestTrainRNG (const RNG& rng) = 0;
1281-
12821279 /* * Returns the variable importance array.
12831280 The method returns the variable importance vector, computed at the training stage when
12841281 CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is
Original file line number Diff line number Diff line change @@ -90,12 +90,12 @@ class DTreesImplForRTrees CV_FINAL : public DTreesImpl
9090 CV_TRACE_FUNCTION ();
9191 DTreesImpl::clear ();
9292 oobError = 0 .;
93- rng = initRng;
9493 }
9594
9695 const vector<int >& getActiveVars () CV_OVERRIDE
9796 {
9897 CV_TRACE_FUNCTION ();
98+ RNG &rng = theRNG ();
9999 int i, nvars = (int )allVars.size (), m = (int )activeVars.size ();
100100 for ( i = 0 ; i < nvars; i++ )
101101 {
@@ -134,6 +134,7 @@ class DTreesImplForRTrees CV_FINAL : public DTreesImpl
134134 bool train ( const Ptr<TrainData>& trainData, int flags ) CV_OVERRIDE
135135 {
136136 CV_TRACE_FUNCTION ();
137+ RNG &rng = theRNG ();
137138 CV_Assert (!trainData.empty ());
138139 startTraining (trainData, flags);
139140 int treeidx, ntrees = (rparams.termCrit .type & TermCriteria::COUNT) != 0 ?
@@ -424,8 +425,6 @@ class DTreesImplForRTrees CV_FINAL : public DTreesImpl
424425 double oobError;
425426 vector<float > varImportance;
426427 vector<int > allVars, activeVars;
427- RNG rng;
428- RNG initRng = RNG((uint64) - 1 );
429428};
430429
431430
You can’t perform that action at this time.
0 commit comments