-
Are there any reasons for methods such as |
Beta Was this translation helpful? Give feedback.
Answered by
cdrnet
Nov 9, 2016
Replies: 1 comment
-
You mean as inplace operations? Mainly because matrices cannot change their dimension after creation. This is by design, but ultimately because even for sparse matrices all of these operations require to allocate and copy to new internal data structures (mostly arrays). If you need to insert and remove rows or columns often, do you really need a full matrix or would a list of vectors maybe be more appropriate? |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cdrnet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You mean as inplace operations? Mainly because matrices cannot change their dimension after creation. This is by design, but ultimately because even for sparse matrices all of these operations require to allocate and copy to new internal data structures (mostly arrays).
If you need to insert and remove rows or columns often, do you really need a full matrix or would a list of vectors maybe be more appropriate?