Click here to Skip to main content
15,891,529 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: (Possibly) Simple Maths Pin
Alan Balkany9-May-08 3:37
Alan Balkany9-May-08 3:37 
AnswerRe: (Possibly) Simple Maths Pin
CPallini9-May-08 4:20
mveCPallini9-May-08 4:20 
AnswerRe: (Possibly) Simple Maths Pin
73Zeppelin9-May-08 7:45
73Zeppelin9-May-08 7:45 
Questionneed similar to Excel's "Goal Seek" in C/C++ Pin
KimN6-May-08 9:04
KimN6-May-08 9:04 
AnswerRe: need similar to Excel's "Goal Seek" in C/C++ Pin
73Zeppelin6-May-08 9:17
73Zeppelin6-May-08 9:17 
GeneralRe: need similar to Excel's "Goal Seek" in C/C++ Pin
KimN6-May-08 10:06
KimN6-May-08 10:06 
GeneralRe: need similar to Excel's "Goal Seek" in C/C++ Pin
73Zeppelin6-May-08 10:29
73Zeppelin6-May-08 10:29 
AnswerRe: need similar to Excel's "Goal Seek" in C/C++ Pin
cp98766-May-08 15:57
cp98766-May-08 15:57 
KimN wrote:
Is there an existing numerical recipe


There is a famous book called "Numerical Recipes", the original editions are available online for free. See here[^]. I think you need some adobe plugin to view the books - it is well worthwhile.

What you are interested in is optimisation of functions. The way this is typically done is you define a function that you want to minimize, e.g.

double func(double* x)

which takes N variables in the array 'x' and returns a single value. An optimization routine will attempt to find the values of 'x' that minimize the function. A very simple workhorse is called the downhill simplex method in multidimensions, but to you it is simply a function Amoeba to which you pass mainly a pointer to your function, the number of variables and starting values.

If you want to solve f(x) = c, make func(x) = (f(x) - c)^2

You will find a listing for amoeba in section 10.4 of Numerical Recipes in C.

If you know more about the function you are trying to minimize then there are probably better routines available, but I'd suspect that amoeba will work as well as excel (and be much faster in native code).

Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: need similar to Excel's "Goal Seek" in C/C++ Pin
73Zeppelin6-May-08 19:19
73Zeppelin6-May-08 19:19 
QuestionSorting multiple lists so they are unique Pin
jrg20005-May-08 1:10
jrg20005-May-08 1:10 
AnswerRe: Sorting multiple lists so they are unique Pin
73Zeppelin6-May-08 9:19
73Zeppelin6-May-08 9:19 
GeneralRe: Sorting multiple lists so they are unique Pin
jrg20007-May-08 23:24
jrg20007-May-08 23:24 
GeneralRe: Sorting multiple lists so they are unique Pin
cp98768-May-08 20:06
cp98768-May-08 20:06 
AnswerRe: Sorting multiple lists so they are unique Pin
cp98766-May-08 20:40
cp98766-May-08 20:40 
GeneralRe: Sorting multiple lists so they are unique Pin
jrg20007-May-08 23:18
jrg20007-May-08 23:18 
AnswerRe: Sorting multiple lists so they are unique Pin
Andrew Rissing8-May-08 6:48
Andrew Rissing8-May-08 6:48 
GeneralRe: Sorting multiple lists so they are unique Pin
cp98768-May-08 11:52
cp98768-May-08 11:52 
AnswerRe: Sorting multiple lists so they are unique Pin
Cyrilix8-Jun-08 22:01
Cyrilix8-Jun-08 22:01 
Questionwhich one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
huma satti4-May-08 20:46
huma satti4-May-08 20:46 
AnswerRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
Giorgi Dalakishvili4-May-08 21:12
mentorGiorgi Dalakishvili4-May-08 21:12 
GeneralRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
73Zeppelin4-May-08 22:07
73Zeppelin4-May-08 22:07 
GeneralRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
huma satti5-May-08 0:41
huma satti5-May-08 0:41 
AnswerRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
73Zeppelin4-May-08 22:00
73Zeppelin4-May-08 22:00 
GeneralRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
huma satti5-May-08 0:42
huma satti5-May-08 0:42 
GeneralRe: which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite Pin
Jörgen Sigvardsson14-Jun-08 11:35
Jörgen Sigvardsson14-Jun-08 11:35 

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.