Is there a set of matrix transformations that convert a 1D vector into a 2D matrix?

193 Views Asked by At

I think in programming vernacular, this operation would be called perhaps ravel or reshape more generally. say I have a vector:

\begin{bmatrix}a&b& c &d &e &f\end{bmatrix}

which I would like to convert into a 2D matrix. Let's arbitrarily say I'd like to ravel along the rows first (fill one row before moving to the next).

\begin{bmatrix} a&b \\ c&d \\ e&f\end{bmatrix}

Is there a series of multiplicative matrix transformations that performs this reshaping, and if so, what is the general name for this operation?

2

There are 2 best solutions below

3
On BEST ANSWER

Yes, the operation is called matrixication (or the inverse operation of vectorization). From a formal perspective, the space of $m\times n$ matrices is isomorphic to the space of $mn$ dimensional vectors. The isomorphism which establishes the the isomorphy is the vectorization operator $ \mathrm{vec}$. This operator turns a matrix into a vector by stacking the columns. Since $\mathrm{vec}$ is am isomorphism, there exists the inverse operation $\mathrm{vec}^{-1}$, which turns a vector into a matrix by unstacking the vector.

0
On

It is not possible to do this by matrix multiplications: If $A,B$ are matrices such that $$AvB=\pmatrix{a&b\\c&d\\e&f} $$ for all $v=\pmatrix{a&b&c&d&e&f}$, then $A$ must be $3\times 1$ and $B$ must be $6\times 2$. But then $vB$ is only $1\times 2$, which is too small for the six desired dimensions of the final result.