# davidcoleman

Member

51

134 Neutral

• Rank
Member
1. ## Boost - brent_find_minima problem

Thanks! I solved the main problem by making vals[] global variable (unelegant but it works)
2. ## Boost - brent_find_minima problem

This works (although with predefined values) void CtestDlg::OnBnClickedButton1() { doSomething(); } double sinc(double x) { static const double PI = 3.14159265358979323846264338327950288419716939937510; return (x == 0.0) ? 1.0 : sin( PI * x ) / ( PI * x ); } double x(double t) { static double vals[6] = { 5.0, 14.0, 60.0, 111.0, 100.0, 37.0 }; double result = 0; for (int i = 0; i < 6; i++) result += vals * sinc(t-i); return -result; } typedef std::pair<double, double> Range; void CtestDlg::doSomething() { std::pair<double, double> mm = boost::math::tools::brent_find_minima(x, 0.0, 6.0, 64); } But if I make those functions class members and try to pass values like this void CtestDlg::OnBnClickedButton1() { vals[0]=5.0; vals[1]=14.0; vals[2]=60.0; vals[3]=111.0; vals[4]=100.0; vals[5]=37.0; doSomething(); } typedef std::pair<double, double> Range; void CtestDlg::doSomething() { std::pair<double, double> mm = boost::math::tools::brent_find_minima(x, 0.0, 6.0, 64); } double CtestDlg::sinc(double x) { static const double PI = 3.14159265358979323846264338327950288419716939937510; return (x == 0.0) ? 1.0 : sin( PI * x ) / ( PI * x ); } double CtestDlg::x(double t) { //static double vals[6] = { 5.0, 14.0, 60.0, 111.0, 100.0, 37.0 }; -THIS CANCLED OUT double result = 0; for (int i = 0; i < 6; i++) result += vals * sinc(t-i); return -result; } I get errors: Error 1 error C3867: 'CtestDlg::x': function call missing argument list; use '&CtestDlg::x' to create a pointer to member Error 2 error C2780: 'std::pair<T,T> boost::math::tools::brent_find_minima(F,T,T,int,boost::uintmax_t &)' : expects 5 arguments - 4 provided and if I do type there &CtestDlg::x instead of just x I get error in boost itself Error 1 error C2064: term does not evaluate to a function taking 1 arguments c:\program files\boost\boost_1_39\boost\math\tools\minima.hpp How can I fix it? (The program uses this values to define Y of the curve and mm is the x value where the curve has maximum)
3. ## Process video frames

What is the easiest way (and fastest to process) to grab frame by frame from a video file and analize is by 'walking' throught pixels (1-dimensional or 2D array) in C++ [Edited by - davidcoleman on January 28, 2010 3:49:08 AM]
4. ## stereo matching

What is the best algorithm for stereo matching and creating disparity maps? What is "ground truth".. according to some pages it is an algorithm, and for other it is a scanned scene with laser 3d scanner to show how the perfect match would look like? Do you know some finished examples (rather exe than source code), I am at this moment more interested in playing with it than trying to invent something that much better programmers with more time and budget already made.
5. ## Compiling code that comes with makefile

How do I compile it? I have a vs2005 and it does not work just putting all files in empty solution. Do I need separate program od can I use vs2005 dev environment?
6. ## Running cs file without solution

I did try it adding before but unsuccessfully Do I need Windows application, Console application or Empty project When I am told to compile using Makefile... how do I do it?
7. ## Running cs file without solution

I am learning c# by modifying samples of various programs on the net. But sometimes they do not come with solution file, just .cs how do I run them?

Maybe I was not clear enough... I have a dialog with a lot of buttons, radios, pictureboxes with particular sizes and I need to organize it on the dialog so I am trying to do it in resource editor, but in the bottom of the resource editor is written 800x477 but the dialog is 1206xSomething, and I need it to be 1024x768 in real pixels. After I run the app and picture of 120x90 is loaded into picturebox I see that it covers some button, and if I had this box with this size in resource editor I would move the button away... so I have to constantly compile to see if elements are not overlapping I use VS2005 and c++

No I meant seeing real values when designing the dialog in dialog editor. For example I want fixed size dialog 1024x768 on the screen and be able to move around elements also of fixed size...

Now my dialog is 800 units wide, but it is in fact around 1200pixel wide How to switch to real units and also make sure on different systems and font sizes that it will look the same?
11. ## Redistributing my app

Hey thanks!!! Installing this vcredist_x86.exe solved the problem, and it works on 2 different systems!
12. ## Redistributing my app

It is an app made in VS2005 C++ using MFC I compiled it as 'Release' and it works doubleclicking on exe on PC I developped it on Now when I try to start it on another PC where I do not have VS intalled I get the message "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem" I thought #include .h puts all what app needs in the exe...
13. ## CFileDialog problem

First after clicking button Save it takes about 10 seconds to open dialog, and then it shows no folders, it's just empty. Function looks like this: CFileDialog fileDlg(FALSE, NULL, NULL, OFN_HIDEREADONLY, "rtf files(*.rtf)|*.rtf||",this); if (fileDlg.DoModal ()=OK) {... Is it some kind of bug, or what could be the problem?
14. ## CFileDialog problem - empty

I am trying simply to open Save dialog to save content of richtextbox, but on a button click (code down) it takes 10 seconds to open and then just shows an empty drive D:, with no folders... when I click on drive C: it shows the folder, but after entering one subfolder and gound back up, C: shows empty ?!??! Any ideas? CFileDialog fileDlg(FALSE, ".rtf", NULL, 0, "rtf Files (*.rtf)|*.rtf|All Files (*.*)|*.*||"); if( fileDlg.DoModal() == IDOK ) ...
15. ## Save memory DC to file

hmmm... microsoft could have make it less complicated Thanks for the link! The code works but leaks somewhere in SaveBMPFile function.