cppad
  • Table of Contents
  • user_guide
    • Install
    • Theory
    • AD
    • ADFun
    • preprocessor
    • multi_thread
    • utility
    • ipopt_solve
    • Example
    • speed
      • speed_main
        • link_routines
          • link_det_lu
          • link_det_minor
          • link_mat_mul
          • link_ode
          • link_poly
          • link_sparse_hessian
          • link_sparse_jacobian
      • speed_utility
      • speed_double
      • speed_adolc
      • speed_cppad
      • speed_fadbad
      • speed_cppad_jit
      • speed_cppadcg
      • speed_sacado
      • speed_xpackage
  • appendix
  • Index
  • Search
cppad
  • user_guide
  • speed
  • speed_main
  • link_routines
  • link_mat_mul
  • View page source

\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)

link_mat_mul

Speed Testing Derivative of Matrix Multiply

  • Prototype

  • Purpose

  • Return Value

  • n

  • repeat

  • x

  • z

  • dz

Prototype

extern bool link_mat_mul(
   size_t                     size     ,
   size_t                     repeat   ,
   CppAD::vector<double>&     x        ,
   CppAD::vector<double>&     z        ,
   CppAD::vector<double>&     dz
);

Purpose

Each package must define a version of this routine as specified below. This is used by the speed_main program to run the corresponding speed and correctness tests.

Return Value

If this speed test is not yet supported by a particular package , the corresponding return value for link_mat_mul should be false .

n

The argument n is the number of rows and columns in the square matrix x .

repeat

The argument repeat is the number of different argument values that the derivative of z (or just the value of z ) will be computed.

x

The argument 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

The argument 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{eqnarray} 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{eqnarray}

dz

The argument 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 .

Previous Next

© Copyright .

Built with Sphinx using a theme provided by Read the Docs.