source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/zisserman/vgg_numerics/vgg_vec.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

  • Property svn:executable set to *
File size: 646 bytes
Line 
1% vgg_vec  De-/vectorization of a matrix.
2%
3% For a matrix X, vgg_vec(X) = X(:).
4% For a N^2-vector x, vgg_vec(x) = reshape(x,N,N).
5%
6% Classical matrix re-arrangement operator, see book Magnus-Neudecker.
7% Trivial function, included mainly for consistency with notation in literature.
8%
9% Useful for rearranging matrix equations. Matrix from the middle of a product can be put to the right as
10%
11%    vgg_vec(A*B*C) = kron(C',A)*vgg_vec(B)
12%
13% See also vgg_vec_swap, vgg_commut_matrix, vgg_duplic_matrix.
14
15function v = vgg_vec(A)
16
17if any(size(A)==1)
18  v = reshape(A,[1 1]*sqrt(prod(size(A))));
19else
20  v = A(:);
21end
22 
23return
Note: See TracBrowser for help on using the repository browser.