Prev | Next | link_mat_mul |
extern bool link_mat_mul( size_t size , size_t repeat , CppAD::vector<double>& x , CppAD::vector<double>& z , CppAD::vector<double>& dz );
package
,
the corresponding return value for link_mat_mul
should be false
.
n
is the number of rows and columns
in the square matrix
x
.
repeat
is the number of different argument values
that the derivative of
z
(or just the value of
z
)
will be computed.
x
is a vector with
x.size() = size * size
elements.
The input value of its elements does not matter.
The output value of its elements is the last random matrix
that is multiplied and then summed to form
z
;
@[@
x_{i,j} = x[ i * s + j ]
@]@
where
s = size
.
z
is a vector with one element.
The input value of the element does not matter.
The output of its element the sum of the elements of
y = x * x
; i.e.,
@[@
\begin{array}{rcl}
y_{i,j} & = & \sum_{k=0}^{s-1} x_{i,k} x_{k, j}
\\
z & = & \sum_{i=0}^{s-1} \sum_{j=0}^{s-1} y_{i,j}
\end{array}
@]@
dz
is a vector with
dz.size() = size * size
.
The input values of its elements do not matter.
The output value of its elements form the
derivative of
z
with respect to
x
.