3 % @brief MATLAB Coder script to generate MEX function
for pfqn_bs.
5 % This script generates a MEX (MATLAB Executable) version of pfqn_bs
6 %
for improved performance. It configures the code generation settings
7 % and specifies the expected input types and dimensions.
9 % See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
12% UNTITLED Generate
static library pfqn_bs
14% See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
16%% Create configuration
object of
class 'coder.CodeConfig'.
17cfg = coder.config(
'mex',
'ecoder',
false);
18cfg.GenerateReport =
false;
19cfg.ReportPotentialDifferences =
false;
20cfg.GenCodeOnly =
false;
23L_type = coder.typeof(0,[Inf Inf],[1 1]);
24N_type = coder.typeof(0,[1 Inf],[0 1]);
25Z_type = coder.typeof(0,[1 Inf],[0 1]);
26scal_type = coder.typeof(0);
27vec_type = coder.typeof(0,[1 Inf],[0 1]);
28col_vec_type = coder.typeof(0,[Inf 1],[1 0]);
29mat_type = coder.typeof(0,[Inf Inf],[1 1]);
30vec_flex_type = coder.typeof(0,[Inf Inf],[1 1]); % Flexible 1D/2D
31str_type = coder.typeof(
'a', [1 Inf], [0 1]); % Variable
string
34ARGS_LNZ = {L_type, N_type, Z_type};
36codegen -config cfg pfqn_ca -args ARGS_LNZ
37codegen -config cfg pfqn_le -args ARGS_LNZ
38codegen -config cfg pfqn_mmint2 -args ARGS_LNZ
39codegen -config cfg pfqn_panacea -args ARGS_LNZ
40% pfqn_kt - Skipped (calls pfqn_aql which uses variable-size cell arrays)
41% codegen -config cfg pfqn_kt -args ARGS_LNZ
42codegen -config cfg pfqn_xzabalow -args ARGS_LNZ
43codegen -config cfg pfqn_xzabaup -args ARGS_LNZ
44% pfqn_xzgsblow - Skipped (sqrt may produce complex values, codegen
requires real)
45% codegen -config cfg pfqn_xzgsblow -args ARGS_LNZ
46% pfqn_xzgsbup - Skipped (same complex value issue as pfqn_xzgsblow)
47% codegen -config cfg pfqn_xzgsbup -args ARGS_LNZ
48% pfqn_propfair - Skipped (fmincon
'interior-point' not supported in codegen, only
'sqp')
49% codegen -config cfg pfqn_propfair -args ARGS_LNZ
50% pfqn_lap - Skipped (fzero internal nonscalar logical not supported in codegen)
51% codegen -config cfg pfqn_lap -args ARGS_LNZ
53%% Other simple signatures
54% pfqn_grnmol - Skipped (sprod helper has uninitialized variable D in nargin>1 path)
55% codegen -config cfg pfqn_grnmol -args {L_type, N_type}
56% pfqn_sqni - Skipped (element count mismatch at line 54)
57% codegen -config cfg pfqn_sqni -args {N_type, L_type, Z_type}
58codegen -config cfg pfqn_gldsingle -args {L_type, N_type, mat_type}
59codegen -config cfg pfqn_mvaldmx_ec -args {vec_type, L_type, mat_type}
61%% Group: Complex Signatures
63% pfqn_bs (L,N,Z,tol,maxiter,QN0,type)
64codegen -config cfg pfqn_bs -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type, scal_type}
66% pfqn_bsfcfs (L,N,Z,tol,maxiter,QN,weight)
67codegen -config cfg pfqn_bsfcfs -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type, mat_type}
70codegen -config cfg pfqn_mva -args {L_type, N_type, Z_type, vec_flex_type}
72% pfqn_mvams (lambda,L,N,Z,mi,S)
73codegen -config cfg pfqn_mvams -args {vec_type, L_type, N_type, Z_type, vec_flex_type, vec_flex_type}
75% pfqn_mvald (L,N,Z,mu,stabilize)
76codegen -config cfg pfqn_mvald -args {L_type, N_type, Z_type, mat_type, scal_type}
78% pfqn_mvamx (lambda,L,N,Z,mi)
79codegen -config cfg pfqn_mvamx -args {vec_type, L_type, N_type, Z_type, vec_flex_type}
81% pfqn_mvaldms (lambda,L,N,Z,S)
82codegen -config cfg pfqn_mvaldms -args {vec_type, L_type, N_type, Z_type, vec_flex_type}
84% pfqn_mvaldmx (lambda,L,N,Z,mu,S)
85codegen -config cfg pfqn_mvaldmx -args {vec_type, L_type, N_type, Z_type, mat_type, vec_flex_type}
87% pfqn_cub (L,N,Z,order,atol)
88codegen -config cfg pfqn_cub -args {L_type, N_type, Z_type, scal_type, scal_type}
91codegen -config cfg pfqn_ls -args {L_type, N_type, Z_type, vec_type}
93% pfqn_mci (D,N,Z,I,variant)
94codegen -config cfg pfqn_mci -args {L_type, N_type, Z_type, vec_type, scal_type}
96% pfqn_linearizer (L,N,Z,type,tol,maxiter)
97codegen -config cfg pfqn_linearizer -args {L_type, N_type, Z_type, scal_type, scal_type, scal_type}
99% pfqn_linearizerms (L,N,Z,nservers,type,tol,maxiter)
100codegen -config cfg pfqn_linearizerms -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
102% pfqn_conwayms (L,N,Z,nservers,type,tol,maxiter)
103codegen -config cfg pfqn_conwayms -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
105% pfqn_aql (L,N,Z,TOL,MAXITER,QN0)
106codegen -config cfg pfqn_aql -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type}
108% pfqn_gld (L,N,mu) - Options skipped
109codegen -config cfg pfqn_gld -args {L_type, N_type, mat_type}
111% pfqn_comom (L,N,Z,atol)
112codegen -config cfg pfqn_comom -args {L_type, N_type, Z_type, scal_type}
114% pfqn_recal (L,N,Z,m0)
115codegen -config cfg pfqn_recal -args {L_type, N_type, Z_type, vec_flex_type}
118codegen -config cfg pfqn_rd -args {L_type, N_type, Z_type, mat_type}
120% pfqn_mmint2_gausslaguerre (L,N,Z,m)
121codegen -config cfg pfqn_mmint2_gausslaguerre -args {L_type, N_type, Z_type, scal_type}
123% pfqn_mmint2_gausslegendre (L,N,Z,m)
124codegen -config cfg pfqn_mmint2_gausslegendre -args {L_type, N_type, Z_type, scal_type}
126% pfqn_egflinearizer (L,N,Z,type,tol,maxiter,alpha) - alpha
is vector
127codegen -config cfg pfqn_egflinearizer -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, vec_flex_type}
129% pfqn_gflinearizer (L,N,Z,type,tol,maxiter,alpha) - alpha
is scalar
130codegen -config cfg pfqn_gflinearizer -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
132% pfqn_ab_amva (D,N,V,nservers,sched,fcfsSchmidt,marginalProbMethod)
133codegen -config cfg pfqn_ab_amva -args {L_type, N_type, L_type, vec_flex_type, vec_flex_type, scal_type, str_type}
135% pfqn_linearizermx (lambda,L,N,Z,nservers,type,tol,maxiter,method)
136codegen -config cfg pfqn_linearizermx -args {vec_type, L_type, N_type, Z_type, vec_flex_type, vec_flex_type, scal_type, scal_type, str_type}
138%% LCFS Group (alpha,beta,N)
139ARGS_LCFS = {vec_type, vec_type, vec_type};
140codegen -config cfg pfqn_lcfsqn_nc -args ARGS_LCFS
141codegen -config cfg pfqn_lcfsqn_ca -args ARGS_LCFS
142codegen -config cfg pfqn_lcfsqn_mva -args ARGS_LCFS
144%% ===== Additional pfqn functions =====
146%% Group: Load-dependent linearization
147% ljd_linearize(nvec, cutoffs) -> idx
148codegen -config cfg ljd_linearize -args {vec_type, vec_type}
150% ljd_delinearize(idx, cutoffs) -> nvec
151codegen -config cfg ljd_delinearize -args {scal_type, vec_type}
153% ljcd_interpolate(nvec, cutoffs, table, K) -> Xval
154codegen -config cfg ljcd_interpolate -args {vec_type, vec_type, mat_type, scal_type}
156%% Group: Normalizing constant variants
158% pfqn_comomrm(L, N, Z, m, atol) -> [lG, lGbasis]
159codegen -config cfg pfqn_comomrm -args {L_type, N_type, Z_type, scal_type, scal_type}
161% pfqn_comomrm_orig(L, N, Z, atol) -> lG
162codegen -config cfg pfqn_comomrm_orig -args {L_type, N_type, Z_type, scal_type}
164% pfqn_nc_sanitize(lambda, L, N, Z, atol) -> [lambda, L, N, Z, lGremaind]
165codegen -config cfg pfqn_nc_sanitize -args {vec_type, L_type, N_type, Z_type, scal_type}
167% pfqn_fnc(alpha, c) -> [mu, c]
168codegen -config cfg pfqn_fnc -args {vec_type, scal_type}
170%% Group: Queue-dependent and probability methods
172% pfqn_qd(L, N, ga, be, Q0) -> [Q, X, U, iter]
173codegen -config cfg pfqn_qd -args {L_type, N_type, vec_type, vec_type, mat_type}
175% pfqn_procomom(L, N, Z, atol) -> [Pr, Q]
176codegen -config cfg pfqn_procomom -args {L_type, N_type, Z_type, scal_type}
178% pfqn_procomom2(L, N, Z, mu, m) -> [pk, lG, G, T, F, B]
179codegen -config cfg pfqn_procomom2 -args {L_type, N_type, Z_type, mat_type, vec_flex_type}
181%% Group: Schmidt approximation
183% pfqn_schmidt(D, N, S, sched, v) -> [XN, QN, UN, CN, T]
184codegen -config cfg pfqn_schmidt -args {L_type, N_type, vec_type, vec_type, mat_type}
186% pfqn_schmidt_ext(D, N, S, sched) -> [XN, QN, UN, CN, T]
187codegen -config cfg pfqn_schmidt_ext -args {L_type, N_type, vec_type, vec_type}
189%% Group: Result expansion/compression
191% pfqn_expand(QN, UN, CN, mapping, M_original) -> [QN_full, UN_full, CN_full]
192codegen -config cfg pfqn_expand -args {mat_type, mat_type, mat_type, vec_type, scal_type}
194% pfqn_unique(L, mu, gamma) -> [L_unique, mu_unique, gamma_unique, mi, mapping]
195codegen -config cfg pfqn_unique -args {L_type, mat_type, mat_type}