Skip to main content
Code Review

Return to Question

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I posted an earlier version of the class as an answer to a question here here, but have since made some improvements. The test code there is still valid.

I posted an earlier version of the class as an answer to a question here, but have since made some improvements. The test code there is still valid.

I posted an earlier version of the class as an answer to a question here, but have since made some improvements. The test code there is still valid.

edited title
Link
Mathieu Guindon
  • 75.5k
  • 18
  • 194
  • 467

Enter the Matrix class for VBA

Clarification of the details of the operations
Source Link
Blackhawk
  • 1.1k
  • 1
  • 10
  • 19

The Elementary Row Operations are destructive, because doing otherwise would degrade the performance too much.

The Matrix operations are non-destructive, in that they create a new Matrix with the results and return it. This allows method chaining , such as Set D = A.Multiply(B).Add(C).ScalarMultiply(5), and the intuitive behavior such that C = A x B and A and B themselves are not modified in the process. I'm tempted to make these methods destructive to improve performance (an object is created for every intermediate matrix operation), but I'm not sure how intuitive it would be that the result of A.Multiply(B) would be A.

And here are a couple examples of use:

And here are a couple examples:

The Elementary Row Operations are destructive, because doing otherwise would degrade the performance too much.

The Matrix operations are non-destructive, in that they create a new Matrix with the results and return it. This allows method chaining , such as Set D = A.Multiply(B).Add(C).ScalarMultiply(5), and the intuitive behavior such that C = A x B and A and B themselves are not modified in the process. I'm tempted to make these methods destructive to improve performance (an object is created for every intermediate matrix operation), but I'm not sure how intuitive it would be that the result of A.Multiply(B) would be A.

And here are a couple examples of use:

Source Link
Blackhawk
  • 1.1k
  • 1
  • 10
  • 19
Loading
lang-vb

AltStyle によって変換されたページ (->オリジナル) /