Home > manopt > manifolds > ttfixedrank > TTeMPS_1.1 > algorithms > completion > makeOmegaSet_mod.m

makeOmegaSet_mod

PURPOSE ^

TTeMPS Toolbox.

SYNOPSIS ^

function Omega = makeOmegaSet_mod( n, sizeOmega )

DESCRIPTION ^

   TTeMPS Toolbox. 
   Michael Steinlechner, 2013-2016
   Questions and contact: michael.steinlechner@epfl.ch
   BSD 2-clause license, see LICENSE.txt

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %   TTeMPS Toolbox.
0002 %   Michael Steinlechner, 2013-2016
0003 %   Questions and contact: michael.steinlechner@epfl.ch
0004 %   BSD 2-clause license, see LICENSE.txt
0005 function Omega = makeOmegaSet_mod( n, sizeOmega )
0006     
0007     if sizeOmega > prod(n)
0008         error('makeOmegaSet:sizeOmegaTooHigh', 'Requested size of Omega is bigger than the tensor itself!')
0009     end
0010     
0011     d = length(n);
0012     subs = zeros(sizeOmega,d);
0013     
0014     for i = 1:d
0015         subs(:,i) = randi( n(i), sizeOmega, 1 );
0016     end
0017     
0018     Omega = unique( subs, 'rows' );
0019     m = size(Omega, 1);
0020     
0021     while m < sizeOmega
0022         subs(1:m,:) = Omega;         
0023         for i=1:d
0024              subs(m+1:sizeOmega, i) = randi( n(i), sizeOmega-m, 1 );
0025         end
0026         Omega = unique( subs, 'rows' );
0027         m = size(Omega, 1);
0028     end
0029 end

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005