Click here to Skip to main content
11,496,146 members (307 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: C#
How can i align a sparse matrix.assemble values by their row & column

input = int[,] sparse = new int[,] { { 4, 4, 2 }, { 3, 3, 2 }, { 1, 1, 4 } };
 
output = int[,] sparse = new int[,] { { 4, 4, 2 }, { 1, 1, 4 }, { 3, 3, 2 } };
Posted 13-Jan-13 10:34am
Edited 13-Jan-13 10:39am
v2
Comments
Sergey Alexandrovich Kryukov at 13-Jan-13 22:44pm
   
What do you mean my "align", anyway? There is no such thing; and matrices do not have any certain graphical representation...
—SA

1 solution

These matrices are not sparse.
See http://en.wikipedia.org/wiki/Sparse_matrix[^] for further clarification.
Cheers
Andi
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 13-Jan-13 22:42pm
   
My 5. First glance at the code sample, and the question: how are they sparse? :-)
—SA
Andreas Gieriet at 14-Jan-13 2:01am
   
Thank you for your 5!
Andi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 13 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100