Skip to content

Linear index to matrix index #830

Answered by cdrnet
MohammadrezaMC2 asked this question in Q&A
Discussion options

You must be logged in to vote

Linear indexing as e.g. in Matlab is very storage format specific. But it so happens that dense matrices in Numerics are organized the same way in column-major. So, if the matrix is dense, then m.AsColumnMajorArray() will return the internal array (directly, not a copy) which you can then access in this linear way.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cdrnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #748 on July 24, 2021 07:52.