From 3ee1a1d83c5ff50221c3eae30b7ae57924883b75 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Mon, 16 Apr 2012 11:01:08 +0000 Subject: [PATCH] fixed mistake in method name (#1798) --- modules/ml/doc/mldata.rst | 6 +++--- modules/ml/include/opencv2/ml/ml.hpp | 4 +++- modules/ml/src/data.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/ml/doc/mldata.rst b/modules/ml/doc/mldata.rst index a72e7ecc25..8c415b1e20 100644 --- a/modules/ml/doc/mldata.rst +++ b/modules/ml/doc/mldata.rst @@ -34,7 +34,7 @@ Class for loading the data from a ``.csv`` file. void mix_train_and_test_idx(); const CvMat* get_var_idx(); - void chahge_var_idx( int vi, bool state ); + void change_var_idx( int vi, bool state ); const CvMat* get_var_types(); void set_var_types( const char* str ); @@ -158,11 +158,11 @@ The method returns the indices of variables (columns) used in the ``values`` mat It returns ``0`` if the used subset is not set. It throws an exception if the data has not been loaded from the file yet. Returned matrix is a single-row matrix of the type ``CV_32SC1``. Its column count is equal to the size of the used variable subset. -CvMLData::chahge_var_idx +CvMLData::change_var_idx ------------------------ Enables or disables particular variable in the loaded data -.. ocv:function:: void CvMLData::chahge_var_idx( int vi, bool state ) +.. ocv:function:: void CvMLData::change_var_idx( int vi, bool state ) By default, after reading the data set all variables in the ``values`` matrix (see :ocv:func:`CvMLData::get_values`) are used. But you may want to use only a subset of variables and include/exclude (depending on ``state`` value) a variable with the ``vi`` index from the used subset. If the data has not been loaded from the file yet, an exception is thrown. diff --git a/modules/ml/include/opencv2/ml/ml.hpp b/modules/ml/include/opencv2/ml/ml.hpp index 09cdc36778..16aaae502b 100644 --- a/modules/ml/include/opencv2/ml/ml.hpp +++ b/modules/ml/include/opencv2/ml/ml.hpp @@ -2051,7 +2051,9 @@ public: void mix_train_and_test_idx(); const CvMat* get_var_idx(); - void chahge_var_idx( int vi, bool state ); // state == true to set vi-variable as predictor + void chahge_var_idx( int vi, bool state ); // misspelled (saved for back compitability), + // use change_var_idx + void change_var_idx( int vi, bool state ); // state == true to set vi-variable as predictor const CvMat* get_var_types(); int get_var_type( int var_idx ) const; diff --git a/modules/ml/src/data.cpp b/modules/ml/src/data.cpp index 9639265b45..8afd1a963d 100644 --- a/modules/ml/src/data.cpp +++ b/modules/ml/src/data.cpp @@ -743,7 +743,12 @@ const CvMat* CvMLData::get_var_idx() void CvMLData::chahge_var_idx( int vi, bool state ) { - CV_FUNCNAME( "CvMLData::get_responses_ptr" ); + change_var_idx( vi, state ); +} + +void CvMLData::change_var_idx( int vi, bool state ) +{ + CV_FUNCNAME( "CvMLData::change_var_idx" ); __BEGIN__; int var_count = 0;