RES: [Dev-C++] Code for all combinations
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <and...@su...> - 2003-07-23 11:11:31
|
Yes! It is.
I am working with genetic algorithms (programming thechnique
that mimics the biological behavior to solve the problems.
A "Darwinian" way to do that. A random set "population" of
candidates of solution begins with mutations, reproductions,
cross-overs, etc, to find the best family of solutions and
its best representant. It´s a sthocastic/heuristic way to
solve NP-hard problems) and I am interested to compare
a simple combinatorial analysis with the GA method. The simple
combinatorial analysis program will test all the
10*10*10*10*10*10=10^6 possible results. With the results
I will make some graphical comparisons.
Fishing this phase, I will need to develop some advanced
"cross-over" techniques.
Finishing this other phase, I will need to apply theese
results in a FPGA digital filter of specificy frequencies.
Thank you
Andre
-----Mensagem original-----
De: Rodolfo Dettorre [mailto:rod...@la...]
Enviada em: quarta-feira, 23 de julho de 2003 01:31
Para: André Macário Barros; Dev-Cpp-Users
Assunto: RE: [Dev-C++] Code for all combinations
Hi,
just curiosity, is that a school assignment? An idea would be to nest six
for statements.
Regards
Rodolfo d'Ettorre
-----Original Message-----
From: André Macário Barros [mailto:and...@su...]
Sent: Wednesday, 23 July 2003 1:54 PM
To: Dev-Cpp-Users
Subject: [Dev-C++] Code for all combinations
Dear Users,
I need to test all possibilities in a specific code.
I couldn´t realize how I can generate theese possibilities with two
for´s.
Here is the problem:
Suppose you have a vector like
int vect[6]={0};
How could be a C code to have (print for example) all possible
combinations in the
six positions from the range 0 to 10?
the output is something like:
0 , 0, 0, 0, 0, 0
1 , 0, 0, 0, 0, 0
2 , 0, 0, 0, 0, 0
...
10, 0, 0, 0, 0, 0
0 , 1, 0, 0, 0, 0
0 , 2, 0, 0, 0, 0
...
0 ,10, 0, 0, 0, 0
1, 1, 0, 0, 0, 0
2, 1, 0, 0, 0, 0
...
10, 1, 0, 0, 0, 0
1 , 2, 0, 0, 0, 0
2 , 2, 0, 0, 0, 0
...
10, 2, 0, 0, 0, 0
...
...
10,10,10,10,10,10
Some repetition values are allowed, that is, if you have to
reset all values to begin the counting to another digit, etc.
Regards
Andre
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|