Can you consider a 0x0 matrix as a square matrix, I can't find the precise definition. I need it for my programming assignment for throwing exceptions.
Square matrix 0 x 0?
273 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
It's more or less up to you if you want to bother with zero-size matrices. I will name a few trivial properties of a 0×0 matrix.
There is only one matrix in $\Bbb{R}^{0×0}$: It's $[]$. They can be added, multiplied, each time you get $[]$. It has an inverse, it is also $[]$. Its determinant is 1 because the product of empty sequence is 1 and there is only the empty permutation. The rank of [] is 0 so it is a regular matrix. It is also the identity matrix. It can be multiplied only with matrices which have either zero width or zero length. [] has no eigen-velues. Its trace is 0 because there are no elements on the diagonal and an empty sum is 0.
You can also define $\Bbb{R}^{n×0}$ and $\Bbb{R}^{0×n}$ matrices, these sets of matrices also have only one element each.
Unless it is specifically mentioned in the statement of the assignment, I would say that it's up to you. If I were given this project, I would disallow it and throw an exception. An alternative approach is to make it depend on a compile-time flag (
#define ZERO_DIMENSIONS_ALLOWED 0or#define ZERO_DIMENSIONS_ALLOWED 1). The important thing is that whatever you decide, you document it when you submit your project.