
I put a combi_tr.zip in vault/Algorithms/combi_tr.zip. It contains three files: combination.hpp: a implementation example.cpp: a example show initialization and using test.cpp: test the combination using partial_permutation It's also available: http://www.bxmy.org/combi/combination.hpp http://www.bxmy.org/combi/example.cpp http://www.bxmy.org/combi/test.cpp About permutation and combination with repetitions, if select 4 elements from {0, 1, 2}, some code can show them: repetition permutation: for (int i = 0; i <= 2; ++i) for (int j = 0; j <= 2; ++j) for (int k = 0; k <= 2; ++k) for (int m = 0; m <= 2; ++m) { result = {i, j, k, m}; } repetition combination: for (int i = 0; i <= 2; ++i) for (int j = i; j <= 2; ++j) for (int k = j; k <= 2; ++k) for (int m = k; m <= 2; ++m) { result = {i, j, k, m}; } 2007/11/13, Hervé Brönnimann <hervebronnimann@mac.com>:
Ben: The concepts of permutations/combinations with/without repetitions are well-known and well-documented. I wouldn't want to provide too many examples for those. In any case, it would be OK and welcome to show a few instances on some actual sequences for a Boost library, but I think would be a waste of space for a C++ Standardization proposal. I think what Jens is asking for (and I intend to provide) are examples of using the proposed API to produce and use them. Thanks for your link, though. HB
On Nov 13, 2007, at 7:46 AM, Ben Bear wrote:
2007/11/13, Jens Seidel <jensseidel@users.sf.net>:
Could you please try to improve it a little bit? Maybe by giving some examples in the documentation?
Oh, I wrote a php page as combination's demo, you can visit through: http://www.bxmy.org/php/combination.php
You can look the php source code: http://www.bxmy.org/php/show.php?filename=combination _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/ listinfo.cgi/boost
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost