Prepare Downhill Simplex for pull request
This is an implementation of so-called downhill simplex method (https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method) Please, let me know if you have any comments, whoever you'd be.
This commit is contained in:
18
modules/optim/src/debug.hpp
Normal file
18
modules/optim/src/debug.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace cv{namespace optim{
|
||||
#ifdef ALEX_DEBUG
|
||||
#define dprintf(x) printf x
|
||||
static void print_matrix(const Mat& x){
|
||||
printf("\ttype:%d vs %d,\tsize: %d-on-%d\n",x.type(),CV_64FC1,x.rows,x.cols);
|
||||
for(int i=0;i<x.rows;i++){
|
||||
printf("\t[");
|
||||
for(int j=0;j<x.cols;j++){
|
||||
printf("%g, ",x.at<double>(i,j));
|
||||
}
|
||||
printf("]\n");
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define dprintf(x)
|
||||
#define print_matrix(x)
|
||||
#endif
|
||||
}}
|
Reference in New Issue
Block a user