Home > subfunctions > ccl_math_ss.m

ccl_math_ss

PURPOSE ^

search = ccl_math_ss (search)

SYNOPSIS ^

function search = ccl_math_ss (search)

DESCRIPTION ^

 search = ccl_math_ss (search)

 Generate search space for theta and alpha

 Input:
   search                                 Searching parameters

 Output:
   search                                 Returned generated searching space

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function search = ccl_math_ss (search)
0002 % search = ccl_math_ss (search)
0003 %
0004 % Generate search space for theta and alpha
0005 %
0006 % Input:
0007 %   search                                 Searching parameters
0008 %
0009 % Output:
0010 %   search                                 Returned generated searching space
0011 
0012 search.min_theta    = zeros(1,search.dim_t) ;
0013 search.max_theta    = ( pi-(pi/search.num_theta) )*ones(1,search.dim_t) ;
0014 
0015 num_theta  = search.num_theta ;
0016 dim_u      = search.dim_u ;
0017 dim_t      = search.dim_t ;
0018 dim_s      = num_theta ^ dim_t ;
0019 list       = zeros(dim_s, dim_t) ;
0020 theta      = cell(1,dim_s) ;
0021 alpha      = cell(1,dim_s) ;
0022 
0023 for t = 1:dim_t
0024     list_theta  = linspace(search.min_theta(t), search.max_theta(t), num_theta) ;
0025     list_theta  = repmat(list_theta,    num_theta^(dim_t-t), 1) ;
0026     list(:,t)   = repmat(list_theta(:), num_theta^(t-1), 1) ;
0027 end
0028 
0029 % make list of alpha
0030 for s = 1: dim_s
0031     theta{s} = list(s,:) ;
0032     alpha{s} = ccl_math_uvec ( list(s,:) ) ;
0033 end
0034 search.list = list ;
0035 search.I_u      = eye(dim_u) ;
0036 search.dim_s    = dim_s ;
0037 search.theta    = theta ;
0038 search.alpha    = alpha ;
0039 search.interval = list(2,dim_t)-list(1,dim_t) ;
0040 end

Generated on Mon 01-Jan-2018 15:49:39 by m2html © 2005