Fixed the code so to eliminate warnings related to shadowing and unused
parameters. In some settings, these warnings may be treated as an errors
and lead to failed build.
Suggested by Nikita Manovich.
Change qualifiers on auxiliary functions (for solveLP() procedure) from
const (that does not have much sense) to static (that makes them
invisible for outside world and hopefully exacerbates optimization).
In particular, the following things are done:
*) Consistent tabulation of 4 spaces is ensured
*) New function dprintf() is introduced, so now printing of the debug
information can be turned on/off via the ALEX_DEBUG macro
*) Removed solveLP_aux namespace
*) All auxiliary functions are declared as static
*) The return codes of solveLP() are encapsulated in enum.
VideoCapture didn't call release method and just ignored the new capture sources.
OpenCV documentation:
bool VideoCapture::open(const string& filename);
bool VideoCapture::open(int device);
The methods first call VideoCapture::release() to close the already opened file or camera.
- set init value for `numsdev` to prevent use of uninitialized value
- stop use of 'workdir' and files from samples
- forcing use of 'opencv_extra' instead
Note: set OPENCV_TEST_DATA_PATH to full path to 'opencv_extra/testdata' (gitolite@code.opencv.org:opencv_extra.git) before running the test!
Example: img of size 10x10 and templ of size 11x9.
In subsequent code this will results in either width or height of
corrSize to be zero (0).
Line 261 will call crossCorr which will then have a zero size of either
blocksize.width or blocksize.height resulting in a division by zero
crach in lines 137 or 138.
This version is supposed to work on all problems (please, let me know if
this is not so), but is not optimized yet in terms of numerical
stability and performance. Bland's rule is implemented as well, so
algorithm is supposed to allow no cycling. Additional check for multiple
solutions is added (in case of multiple solutions algorithm returns an
appropriate return code of 1 and returns arbitrary optimal solution).
Finally, now we have 5 tests.
Before Thursday we have 4 directions that can be tackled in parallel:
*) Prepare the pull request!
*) Make the code more clear and readable (refactoring)
*) Wrap the core solveLP() procedure in OOP-style interface
*) Test solveLP on non-trivial tests (possibly test against
http://www.coin-or.org/Clp/)
[NSRunLoop currentRunLoop] is not the same as in the main thread.
see
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/F
oundation/Classes/nsrunloop_Class/Reference/Reference.html
"If no input sources or timers are attached to the run loop, this
method exits immediately"
The old code caused grabFrame() to return immediately if the capture
was not done in the main thread.
This code works correctly, even in secondary threads, provided that all
capture functions are called in the *same* thread
What we have now corresponds to "formal simplex algorithm", described in
Cormen's "Intro to Algorithms". It will work *only* if the initial
problem has (0,0,0,...,0) as feasible solution (consequently, it will
work unpredictably if problem was unfeasible or did not have zero-vector as
feasible solution). Moreover, it might cycle.
TODO (first priority)
1. Implement initialize_simplex() procedure, that shall check for
feasibility and generate initial feasible solution. (in particular, code
should pass all 4 tests implemented at the moment)
2. Implement Bland's rule to avoid cycling.
3. Make the code more clear.
4. Implement several non-trivial tests (??) and check algorithm against
them. Debug if necessary.
TODO (second priority)
1. Concentrate on stability and speed (make difficult tests)