Click here to Skip to main content
15,884,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
RantRe: WriteProcessMemory error 5 Pin
Snoepie29-Apr-09 5:50
Snoepie29-Apr-09 5:50 
GeneralRe: WriteProcessMemory error 5 Pin
CPallini29-Apr-09 6:33
mveCPallini29-Apr-09 6:33 
QuestionPlease help with thisBasic C Program Pin
biggiant2200027-Apr-09 5:45
biggiant2200027-Apr-09 5:45 
AnswerRe: Please help with thisBasic C Program [modified] Pin
CPallini27-Apr-09 6:38
mveCPallini27-Apr-09 6:38 
AnswerRe: Please help with thisBasic C Program Pin
David Crow27-Apr-09 8:10
David Crow27-Apr-09 8:10 
GeneralRe: Please help with thisBasic C Program Pin
CPallini27-Apr-09 10:46
mveCPallini27-Apr-09 10:46 
QuestionCHTMLEdView hides cursor Pin
William Engberts27-Apr-09 5:33
William Engberts27-Apr-09 5:33 
QuestionHow to code a math formula and pass it to a 'weird' function Pin
Episodio127-Apr-09 4:55
Episodio127-Apr-09 4:55 
hi!

I want to use a C++ function which applies minimization on a math formula ( http://www.codecogs.com/d-ox/maths/optimization/nelder.php ) but I dont understand how to pass my formula as the first parameter.


There is even an example but I dont understand it...

double f(double *x) {
    double r = sqrt(x[0] * x[0] + x[1] * x[1]);
    return ABS(r) < 1E-12 ? 1 : sin(r) / r;
}


I dont know what's the unknown. "x"? "r"? Both?

My formula is: http://personal.telefonica.terra.es/web/episodio1/text3.gif

This is what I've made:

for (i=1;i<=numberOfAnchors;i++)
{
   errorsquare+= pow( abs( x[i] - xestim + y[i] - yestim ) - distance[i]  ) , 2 );
}
errorsquare=errorsquare/numberOfAnchors;


2 unknowns: "xestim" and "yestim".

My question is: how should I code/declare my formula so it is accepted by the C++ function ?


Thanks.
AnswerRe: How to code a math formula and pass it to a 'weird' function Pin
CPallini27-Apr-09 6:31
mveCPallini27-Apr-09 6:31 
GeneralRe: How to code a math formula and pass it to a 'weird' function Pin
Episodio127-Apr-09 7:56
Episodio127-Apr-09 7:56 
GeneralRe: How to code a math formula and pass it to a 'weird' function Pin
CPallini27-Apr-09 9:25
mveCPallini27-Apr-09 9:25 
GeneralRe: Cpallini, do you know about NelderMead algorithm? [modified] Pin
Episodio127-Apr-09 12:39
Episodio127-Apr-09 12:39 
Questionhelp me!! Pin
yunpil27-Apr-09 4:39
yunpil27-Apr-09 4:39 
JokeRe: help me!! Pin
Cedric Moonen27-Apr-09 4:43
Cedric Moonen27-Apr-09 4:43 
GeneralRe: help me!! Pin
David Crow27-Apr-09 4:51
David Crow27-Apr-09 4:51 
Questioncopy File/Folder Pin
MsmVc27-Apr-09 2:51
MsmVc27-Apr-09 2:51 
QuestionRe: copy File/Folder Pin
CPallini27-Apr-09 3:02
mveCPallini27-Apr-09 3:02 
AnswerRe: copy File/Folder Pin
KarstenK27-Apr-09 3:12
mveKarstenK27-Apr-09 3:12 
QuestionRe: copy File/Folder Pin
David Crow27-Apr-09 3:35
David Crow27-Apr-09 3:35 
QuestionOne dought Pin
Deepu Antony27-Apr-09 2:38
Deepu Antony27-Apr-09 2:38 
AnswerRe: One dought Pin
CPallini27-Apr-09 2:51
mveCPallini27-Apr-09 2:51 
GeneralRe: One dought Pin
Deepu Antony27-Apr-09 3:00
Deepu Antony27-Apr-09 3:00 
GeneralRe: One dought Pin
CPallini27-Apr-09 3:04
mveCPallini27-Apr-09 3:04 
GeneralRe: One dought Pin
Deepu Antony27-Apr-09 3:06
Deepu Antony27-Apr-09 3:06 
QuestionWhat if I write Interface defination inside a library block. Pin
pandit8426-Apr-09 23:53
pandit8426-Apr-09 23:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.