T(s)
We use @(@
\R{T} ( s )
@)@ to denote the ad_type of a scalar value @(@
s
@)@.
There are four possible
ad_types
:
identical_zero, constant, dynamic, and variable in that order.
Theory
This routine must calculate the following value for
@(@
i = 0, \ldots, m-1
@)@; see m
:
@[@
\R{T} [ y_i (x) ] = \max_k \R{T} [ v_i^k (x) ]
@]@
The type @(@
\R{T} [ v_i^0 (x) ] = \R{T}[ b_i (x) ]
@)@.
This is easy to calculate given the type of the components of
x
;
see b(x)
.
Furthermore, for @(@
k > 0
@)@
@[@
v_i^k (x)
=
\frac{r}{k} \sum_{j=0}^{m-1} A_{i,j} (x) v_j^{k-1} (x)
@]@
@[@
\R{T} [ v_i^k (x) ]
=
\max_j \R{T} [ A_{i,j} (x) v_j^{k-1} (x) ]
@]@
@[@
\R{T} [ A_{i,j} (x) v_j^k (x) ]
=
\left\{ \begin{array}{ll}
\R{identical\_zero} &
\R{if} A_{i,j} (x) \W{\R{or}} v_j^{k-1} (x) \W{\R{is}} \R{identical\_zero}
\\
\max\{ \R{T} [ A_{i,j} (x) ] \W{,} \R{T} [ v_j^{k-1} (x) ] \} &
\R{otherwise}
\end{array} \right.
@]@
If @(@
A_{i,j} (x)
@)@ is not in the sparsity
pattern
, it is identically zero.
Furthermore we are allowing for the case where
@(@
A_{i,j} (x)
@)@ is in the pattern and it is identically zero; i.e.,
the sparsity pattern is not efficient as it could be.
The type @(@
\R{T} [ A_{i,j} (x) ]
@)@ for components in the sparsity pattern
is easy to calculate given the type of the components of
x
;
see A(x)
.
Suppose @(@
\ell
@)@ is such that for all @(@
i
@)@
@[@
\R{T} [ v_i^\ell (x) ] \leq \max_{k < \ell} \R{T} [ v_i^k (x) ]
@]@
It follows that
@[@
\R{T} [ v_j^{\ell+1} (x) ] = \max_j \R{T} [ A_{i,j} (x) v_j^\ell (x) ]
@]@
@[@
\R{T} [ v_j^{\ell+1} (x) ]
\leq
\max_{k < \ell} \max_j \R{T} [ A_{i,j} (x) v_j^k (x) ]
@]@
@[@
\R{T} [ v_j^{\ell+1} (x) ]
\leq
\max_{k < \ell} \R{T} [ v_i^k (x) ]
@]@
From this it is clear that
@[@
\R{T} [ y_i (x) ] = \max_{k < \ell} \R{T} [ v_i^k (x) ]
@]@