Symetric Matrix calculation
Hi
Need some help about symetric matrix calculation. Need some generic formula to calculate in particular order.
-1 51 54 25 77
51 -1 44 70 96
54 44 -1 87 94
25 70 87 -1 88
77 96 94 88 -1
I want to add several items to make an array of sum in this order.
Example,
sum = 01 +12 + 23 + 34+ 45
(start with element row 0 column 1, last column number is index for next element)
some more example:
sum = 01 +13 + 34 + 45+ 52
sum = 01 +14 + 45 + 52+ 23
sum = 01 +15 + 52 + 23+ 34
sum = 02 +23 + 34 + 45+ 51
sum = 02 +24 + 45 + 51+ 13 and so on.
Each sum should take maximum number (maximum row or column, an item column is row for next item and each column is taken only one times)
as number of items in the matrix. If row and column is same we don't add it or if the cell value is -1.
How can I generelize these?
Br
Aktar
Re: Symetric Matrix calculation
Most programming languages support arrays, indexing of arrays, and loops. C++ is not an exception.
Re: Symetric Matrix calculation
[QUOTE=wizard_hu_;908478]Most programming languages support arrays, indexing of arrays, and loops. C++ is not an exception.[/QUOTE]
I know, would be nice if you can give me general formula for this, I would like to include it in my app. I spent sometimes and looks difficult for me,
Re: Symetric Matrix calculation
This description is not entirely clear to me. Is it some kind of spanning-tree generator for weighted graphs? ([url]http://en.wikipedia.org/wiki/Spanning_tree[/url], [url]http://en.wikipedia.org/wiki/Weighted_graph[/url])
Re: Symetric Matrix calculation
[QUOTE=wizard_hu_;908486]This description is not entirely clear to me. Is it some kind of spanning-tree generator for weighted graphs? ([url]http://en.wikipedia.org/wiki/Spanning_tree[/url], [url]http://en.wikipedia.org/wiki/Weighted_graph[/url])[/QUOTE]
Hi,
Thanks for your information.
Following link gave me some light for solving the problem but
[url]http://www.cplusplus.com/reference/algorithm/next_permutation/[/url]
I am going to use it in my Qt app and I get the following error
error: 'sort' was not declared in this scope
error: 'next_permutation' was not declared in this scope
If I test it in visual studio in windows, work great but in QtSDK it gives this error (I have included #include <algorithm> )
So what is missing for Qt project?