1function [Q,U,R,T,C,X,lG,runtime,iter,method] = solver_mvald_analyzer(sn, options)
2% [Q,U,R,T,C,X,RUNTIME,ITER] = SOLVER_MVALD_ANALYZER(SN, OPTIONS)
4% Copyright (c) 2012-2026, Imperial College London
8method = options.method;
10line_debug(
'MVA load-dependent analyzer starting: method=%s, nclasses=%d, njobs=%s', method, sn.nclasses, mat2str(sn.njobs));
14 if ~isempty(sn.cdscaling)
15 line_error(mfilename,'Exact class-dependent solver not available in MVA.');
17 line_debug('Using exact load-dependent MVA, calling solver_mvald');
18 [Q,U,R,T,C,X,lG,iter] = solver_mvald(sn, options);
19 case {
'default',
'amva',
'qd',
'lin',
'qdlin'} %,
'aql',
'qdaql'
20 if strcmpi(options.method,
'default') && isempty(sn.cdscaling) ...
21 && all(isfinite(sn.njobs)) && sn.nchains <= 4 && sum(sn.njobs) <= 20 ...
22 && sn_has_product_form(sn) && ~sn_has_fractional_populations(sn)
23 % Small closed product-form LD model: use
the exact load-dependent
24 % MVA recursion, mirroring
the default-to-exact upgrade applied to
25 % non-LD models in solver_mva_analyzer.
26 line_debug(
'Default method: using exact load-dependent MVA\n');
27 [Q,U,R,T,C,X,lG,iter] = solver_mvald(sn, options);
30 if strcmpi(options.method,
'default')
31 line_debug('Default method: using approximate MVA\n');
33 line_debug('Using approximate MVA method: %s, calling solver_amva', options.method);
34 [Q,U,R,T,C,X,lG,iter,method] = solver_amva(sn, options);
37 line_error(mfilename,sprintf('The %s method
is not supported by
the load-dependent MVA solver.',options.method));
43 % line_printf('\nMVA load-dependent analysis completed. Runtime: %f seconds.\n',runtime);