1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

ml: refactor non-virtual methods

This commit is contained in:
berak
2018-04-24 12:11:59 +02:00
parent 4d7d630e92
commit fc5bba66af
4 changed files with 39 additions and 76 deletions
+1 -15
View File
@@ -453,6 +453,7 @@ public:
inline void setRegressionAccuracy(float val) CV_OVERRIDE { impl.params.setRegressionAccuracy(val); }
inline cv::Mat getPriors() const CV_OVERRIDE { return impl.params.getPriors(); }
inline void setPriors(const cv::Mat& val) CV_OVERRIDE { impl.params.setPriors(val); }
inline void getVotes(InputArray input, OutputArray output, int flags) const CV_OVERRIDE {return impl.getVotes(input,output,flags);}
RTreesImpl() {}
virtual ~RTreesImpl() CV_OVERRIDE {}
@@ -485,12 +486,6 @@ public:
impl.read(fn);
}
void getVotes_( InputArray samples, OutputArray results, int flags ) const
{
CV_TRACE_FUNCTION();
impl.getVotes(samples, results, flags);
}
Mat getVarImportance() const CV_OVERRIDE { return Mat_<float>(impl.varImportance, true); }
int getVarCount() const CV_OVERRIDE { return impl.getVarCount(); }
@@ -519,15 +514,6 @@ Ptr<RTrees> RTrees::load(const String& filepath, const String& nodeName)
return Algorithm::load<RTrees>(filepath, nodeName);
}
void RTrees::getVotes(InputArray input, OutputArray output, int flags) const
{
CV_TRACE_FUNCTION();
const RTreesImpl* this_ = dynamic_cast<const RTreesImpl*>(this);
if(!this_)
CV_Error(Error::StsNotImplemented, "the class is not RTreesImpl");
return this_->getVotes_(input, output, flags);
}
}}
// End of file.