Home > release > flatten_adj.m

flatten_adj

PURPOSE ^

FLATTEN_ADJ - mode-k folding of a matrix X into a tensor

SYNOPSIS ^

function X=flatten_adj(X,sz,jj)

DESCRIPTION ^

 FLATTEN_ADJ - mode-k folding of a matrix X into a tensor

 Syntax
  function X=flatten_adj(X,sz,k)

 See also
  FLATTEN

 Reference
 "On the extension of trace norm to tensors"
 Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima
 arXiv:1010.0789
 http://arxiv.org/abs/1010.0789

 Copyright(c) 2010 Ryota Tomioka
 This software is distributed under the MIT license. See license.txt

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % FLATTEN_ADJ - mode-k folding of a matrix X into a tensor
0002 %
0003 % Syntax
0004 %  function X=flatten_adj(X,sz,k)
0005 %
0006 % See also
0007 %  FLATTEN
0008 %
0009 % Reference
0010 % "On the extension of trace norm to tensors"
0011 % Ryota Tomioka, Kohei Hayashi, and Hisashi Kashima
0012 % arXiv:1010.0789
0013 % http://arxiv.org/abs/1010.0789
0014 %
0015 % Copyright(c) 2010 Ryota Tomioka
0016 % This software is distributed under the MIT license. See license.txt
0017 
0018 
0019 function X=flatten_adj(X,sz,jj)
0020 nd=length(sz);
0021 sz=sz([jj:nd, 1:jj-1]);
0022 X=reshape(X,sz);
0023 if jj~=1
0024   X=permute(X,[nd-jj+2:nd 1:nd-jj+1]);
0025 end

Generated on Wed 22-Dec-2010 16:09:20 by m2html © 2003