This Question has been **Answered**

Featured Replies

- 1
I don't know anything about those objects but my tip would be to consider the Liskov substitution principle in making your decision. Read More

- 1
Hmm. Of the top of my head, I'd say it really depends on what features you plan to support. If there's a huge amount of intersection between the two, I might choose to implement the vector as a composition/specialization of a matrix of 1xN or Nx1. Alternatively, a matrix may … Read More

- 1
After reading about the Barbara Liskov principle, where I also found this interesting [article](http://www.rgoarchitects.com/Files/ooprimer.pdf) and what decepticon had to say, I really got enlighted about OO again! A vector although showing some resemblance with a matrix (you could call it a 1,N or N,1 matrix) is in fact a totaly … Read More

- 1
It worries me that much of this discussion is about the difficulty or efficiency of inheriting either way. And although Liskov is 100% relevant, it's a heavyweight way of expressing the absolute basic English definition: "inheritance" is an *is-a* relationship If a Vector *is-a* Matrix then Vector is a subclass … Read More

- 2
I think that it makes some sense to consider a Vector as a subclass of (derived from, special kind of) Matrix. For example, Matlab creates vectors as matrices (as Nx1), and treats any matrix with one dimension that is 1 as a vector, i.e., it doesn't even "subclass" them, it … Read More

This question has already been answered. Start a new discussion instead.

Recommended Topics