LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
cdclassfactor.m
1function f = cdclassfactor(beta, nirmat, rows, class)
2% F = CDCLASSFACTOR(BETA, NIRMAT, ROWS, CLASS)
3%
4% Per-row class-dependence factor for event rates. BETA is a class-dependence
5% handle mapping a 1xR per-class population vector n to the 1xR vector of
6% dimensionless rate scalings beta_r(n) (see fes_beta_handle). NIRMAT is the
7% per-state per-class population matrix (nstates x R, one row per enabled
8% state). ROWS selects the enabled rows (logical mask or index vector over the
9% rows of NIRMAT) and CLASS is the class completing service.
10%
11% For each selected row j the handle is evaluated on that row's population
12% vector and the component of the completing class is returned:
13% F(j) = v(min(CLASS, numel(v))), v = BETA(NIRMAT(ROWS(j),:))
14% so a neutral scaling @(n) 1 (scalar) yields F(j) = 1 for every class.
15%
16% Copyright (c) 2012-2026, Imperial College London
17% All rights reserved.
18
19if islogical(rows)
20 rows = find(rows);
21end
22rows = rows(:);
23f = ones(numel(rows),1);
24for j = 1:numel(rows)
25 v = beta(nirmat(rows(j),:));
26 f(j) = v(min(class, numel(v)));
27end
28end
Definition Station.m:245