Login Register






C programmer?? filter_list
Author
Message
RE: C programmer?? #5
The solution by @alok9shm is of course correct, but I would add some info just for the sake of correctness.

Please note that, in C, the concept of matrix is vacous since the language does not provide such "type". Programmers can build something representing a matrix in different ways; the most common ones are:
  • array of arrays (which is the solution you were already given)
  • vectorized matrix
  • sparse matrix
If you have to deal with linear algebra, more often than not you will encounter the second one. Vectorization is the operation used to "convert" a matrix into a vector. This is particulary useful because it allows you to exploit data locality (while the array of arrays does not), in fact it is widely used in BLAS (Basic Linear Algebra Subprograms) and other deeply optimized libraries. However, it is a little harder to understand for a beginner.

See Wikipedia - Vectorization.

Reply





Messages In This Thread
C programmer?? - by Yusadolat - 06-05-2014, 01:11 PM