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};
35ARGS_XZ = {vec_type, scal_type, scal_type};
37codegen -config cfg pfqn_ca -args ARGS_LNZ
38codegen -config cfg pfqn_le -args ARGS_LNZ
39codegen -config cfg pfqn_mmint2 -args ARGS_LNZ
40codegen -config cfg pfqn_panacea -args ARGS_LNZ
41% pfqn_kt - Skipped (calls pfqn_aql which uses variable-size cell arrays)
42% codegen -config cfg pfqn_kt -args ARGS_LNZ
43codegen -config cfg pfqn_xzabalow -args ARGS_XZ
44codegen -config cfg pfqn_xzabaup -args ARGS_XZ
45codegen -config cfg pfqn_xzgsblow -args ARGS_XZ
46codegen -config cfg pfqn_xzgsbup -args ARGS_XZ
47% pfqn_propfair - Skipped (fmincon
'interior-point' not supported in codegen, only
'sqp')
48% codegen -config cfg pfqn_propfair -args ARGS_LNZ
49% pfqn_lap - Skipped (fzero internal nonscalar logical not supported in codegen)
50% codegen -config cfg pfqn_lap -args ARGS_LNZ
52%% Other simple signatures
53codegen -config cfg pfqn_grnmol -args {L_type, N_type}
54codegen -config cfg pfqn_sqni -args {N_type, vec_type, Z_type}
55codegen -config cfg pfqn_gldsingle -args {L_type, N_type, mat_type}
56codegen -config cfg pfqn_mvaldmx_ec -args {vec_type, L_type, mat_type}
58%% Group: Complex Signatures
60% pfqn_bs (L,N,Z,tol,maxiter,QN0,type)
61codegen -config cfg pfqn_bs -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type, scal_type}
63% pfqn_bsfcfs (L,N,Z,tol,maxiter,QN,weight)
64codegen -config cfg pfqn_bsfcfs -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type, mat_type}
66codegen -config cfg pfqn_mva -args {L_type, N_type, Z_type, vec_flex_type}
68codegen -config cfg pfqn_mvams -args {vec_type, L_type, N_type, Z_type, vec_flex_type, vec_flex_type}
70codegen -config cfg pfqn_mvald -args {L_type, N_type, Z_type, mat_type, scal_type}
72codegen -config cfg pfqn_mvamx -args {vec_type, L_type, N_type, Z_type, vec_flex_type}
74% pfqn_mvaldms (lambda,L,N,Z,S)
75codegen -config cfg pfqn_mvaldms -args {vec_type, L_type, N_type, Z_type, vec_flex_type}
77% pfqn_mvaldmx (lambda,L,N,Z,mu,S)
78codegen -config cfg pfqn_mvaldmx -args {vec_type, L_type, N_type, Z_type, mat_type, vec_flex_type}
80% pfqn_cub - Skipped (anonymous functions not supported in codegen)
81% codegen -config cfg pfqn_cub -args {L_type, N_type, Z_type, scal_type, scal_type}
83% pfqn_ls - Skipped (anonymous functions, mvnrnd, mvnpdf not supported in codegen)
84% codegen -config cfg pfqn_ls -args {L_type, N_type, Z_type, vec_type}
86% pfqn_mci - Skipped (persistent in nested function not supported in codegen)
87% codegen -config cfg pfqn_mci -args {L_type, N_type, Z_type, vec_type, scal_type}
89% pfqn_linearizer (L,N,Z,type,tol,maxiter)
90codegen -config cfg pfqn_linearizer -args {L_type, N_type, Z_type, scal_type, scal_type, scal_type}
92% pfqn_linearizerms (L,N,Z,nservers,type,tol,maxiter)
93codegen -config cfg pfqn_linearizerms -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
95% pfqn_conwayms (L,N,Z,nservers,type,tol,maxiter)
96codegen -config cfg pfqn_conwayms -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
98% pfqn_aql - Skipped (cell
array elements cannot be verified as fully defined before use)
99% codegen -config cfg pfqn_aql -args {L_type, N_type, Z_type, scal_type, scal_type, mat_type}
101% pfqn_gld - Skipped (uses SolverNC.defaultOptions OOP + pfqn_nc which uses Solver.parseOptions)
102% codegen -config cfg pfqn_gld -args {L_type, N_type, mat_type}
104codegen -config cfg pfqn_comom -args {L_type, N_type, Z_type, scal_type}
106% pfqn_recal (L,N,Z,m0)
107codegen -config cfg pfqn_recal -args {L_type, N_type, Z_type, vec_flex_type}
109% pfqn_rd - Skipped (depends on pfqn_nc which uses OOP Solver.parseOptions)
110% codegen -config cfg pfqn_rd -args {L_type, N_type, Z_type, mat_type}
112codegen -config cfg pfqn_mmint2_gausslaguerre -args {L_type, N_type, Z_type, scal_type}
114codegen -config cfg pfqn_mmint2_gausslegendre -args {L_type, N_type, Z_type, scal_type}
116% pfqn_egflinearizer (L,N,Z,type,tol,maxiter,alpha) - alpha
is vector
117codegen -config cfg pfqn_egflinearizer -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, vec_flex_type}
119% pfqn_gflinearizer (L,N,Z,type,tol,maxiter,alpha) - alpha
is scalar
120codegen -config cfg pfqn_gflinearizer -args {L_type, N_type, Z_type, vec_flex_type, scal_type, scal_type, scal_type}
122% pfqn_ab_amva - Skipped (containers.Map not supported in codegen)
123% codegen -config cfg pfqn_ab_amva -args {L_type, N_type, L_type, vec_flex_type, vec_flex_type, scal_type, str_type}
125% pfqn_linearizermx (lambda,L,N,Z,nservers,type,tol,maxiter,method)
126codegen -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}
128%% LCFS Group (alpha,beta,N)
129ARGS_LCFS = {vec_type, vec_type, vec_type};
130% pfqn_lcfsqn_nc - Skipped (issym + cell
array element verification)
131% codegen -config cfg pfqn_lcfsqn_nc -args ARGS_LCFS
132codegen -config cfg pfqn_lcfsqn_ca -args ARGS_LCFS
133codegen -config cfg pfqn_lcfsqn_mva -args ARGS_LCFS
135%% ===== Additional pfqn functions =====
137%% Group: Load-dependent linearization
138% ljd_linearize(nvec, cutoffs) -> idx
139codegen -config cfg ljd_linearize -args {vec_type, vec_type}
141% ljd_delinearize(idx, cutoffs) -> nvec
142codegen -config cfg ljd_delinearize -args {scal_type, vec_type}
144% ljcd_interpolate(nvec, cutoffs, table, K) -> Xval
145codegen -config cfg ljcd_interpolate -args {vec_type, vec_type, mat_type, scal_type}
147%% Group: Normalizing constant variants
149codegen -config cfg pfqn_comomrm -args {L_type, N_type, Z_type, scal_type, scal_type}
151% pfqn_comomrm_orig - Skipped (undefined variable h_1 + complex codegen issues)
152% codegen -config cfg pfqn_comomrm_orig -args {L_type, N_type, Z_type, scal_type}
154% pfqn_nc_sanitize(lambda, L, N, Z, atol) -> [lambda, L, N, Z, lGremaind]
155codegen -config cfg pfqn_nc_sanitize -args {vec_type, L_type, N_type, Z_type, scal_type}
157% pfqn_fnc - Skipped (sparse mrdivide not supported in codegen)
158% codegen -config cfg pfqn_fnc -args {vec_type, scal_type}
160%% Group: Queue-dependent and probability methods
162% pfqn_qd - Skipped (anonymous functions in
default args not supported in codegen)
163% codegen -config cfg pfqn_qd -args {L_type, N_type, vec_type, vec_type, mat_type}
165% pfqn_procomom - Skipped (nonscalar logical operations not supported in codegen)
166% codegen -config cfg pfqn_procomom -args {L_type, N_type, Z_type, scal_type}
168% pfqn_procomom2 - Skipped (sparse + tic not supported in codegen)
169% codegen -config cfg pfqn_procomom2 -args {L_type, N_type, Z_type, mat_type, vec_flex_type}
171%% Group: Schmidt approximation
173% pfqn_schmidt - Skipped (table() + repmat dimension change not supported in codegen)
174% codegen -config cfg pfqn_schmidt -args {L_type, N_type, vec_type, vec_type, mat_type}
176% pfqn_schmidt_ext - Skipped (same as pfqn_schmidt)
177% codegen -config cfg pfqn_schmidt_ext -args {L_type, N_type, vec_type, vec_type}
179%% Group: Result expansion/compression
181% pfqn_expand(QN, UN, CN, mapping, M_original) -> [QN_full, UN_full, CN_full]
182codegen -config cfg pfqn_expand -args {mat_type, mat_type, mat_type, vec_type, scal_type}
184% pfqn_unique(L, mu, gamma) -> [L_unique, mu_unique, gamma_unique, mi, mapping]
185codegen -config cfg pfqn_unique -args {L_type, mat_type, mat_type}