


@info:
! @deftypefn {Function File} {[@var{D}, @var{err}] =} sparse_hessian_times_B_kronecker_C (@var{A},@var{B},@var{C},@var{fake})
! @anchor{kronecker/sparse_hessian_times_B_kronecker_C}
! @sp 1
! Computes A*kron(B,C) where A is hessian matrix in sparse format.
! @sp 2
! @strong{Inputs}
! @sp 1
! @table @ @var
! @item A
! mA*nA matrix of doubles.
! @item B
! mB*nB matrix of doubles.
! @item C
! mC*nC matrix of doubles.
! @item fake
! Anything you want, just a fake parameter (because the mex version admits a last argument specifying the number of threads to be used in parallel mode).
! @end table
! @sp 2
! @strong{Outputs}
! @sp 1
! @table @ @var
! @item D
! mA*(nC*nB) or mA*(nB*nB) matrix of doubles.
! @item err
! Integer scalar equal to zero (if all goes well).
! @end table
! @sp 2
! @strong{Remarks}
! @sp 1
! [1] This routine is called by Dynare if and only the mex version is not compiled (also used for testing purposes).
! @sp 1
! [2] This routine can be called with three or four arguments. In the first case A*kron(B,B) is computed.
! @sp 2
! @strong{This function is called by:}
! @sp 1
! @ref{dr1}
! @sp 2
! @strong{This function calls:}
! @sp 1
! @ref{kronecker/A_times_B_kronecker_C}
!
! @end deftypefn
@eod:

0001 function [D, err] = sparse_hessian_times_B_kronecker_C(varargin) 0002 0003 %@info: 0004 %! @deftypefn {Function File} {[@var{D}, @var{err}] =} sparse_hessian_times_B_kronecker_C (@var{A},@var{B},@var{C},@var{fake}) 0005 %! @anchor{kronecker/sparse_hessian_times_B_kronecker_C} 0006 %! @sp 1 0007 %! Computes A*kron(B,C) where A is hessian matrix in sparse format. 0008 %! @sp 2 0009 %! @strong{Inputs} 0010 %! @sp 1 0011 %! @table @ @var 0012 %! @item A 0013 %! mA*nA matrix of doubles. 0014 %! @item B 0015 %! mB*nB matrix of doubles. 0016 %! @item C 0017 %! mC*nC matrix of doubles. 0018 %! @item fake 0019 %! Anything you want, just a fake parameter (because the mex version admits a last argument specifying the number of threads to be used in parallel mode). 0020 %! @end table 0021 %! @sp 2 0022 %! @strong{Outputs} 0023 %! @sp 1 0024 %! @table @ @var 0025 %! @item D 0026 %! mA*(nC*nB) or mA*(nB*nB) matrix of doubles. 0027 %! @item err 0028 %! Integer scalar equal to zero (if all goes well). 0029 %! @end table 0030 %! @sp 2 0031 %! @strong{Remarks} 0032 %! @sp 1 0033 %! [1] This routine is called by Dynare if and only the mex version is not compiled (also used for testing purposes). 0034 %! @sp 1 0035 %! [2] This routine can be called with three or four arguments. In the first case A*kron(B,B) is computed. 0036 %! @sp 2 0037 %! @strong{This function is called by:} 0038 %! @sp 1 0039 %! @ref{dr1} 0040 %! @sp 2 0041 %! @strong{This function calls:} 0042 %! @sp 1 0043 %! @ref{kronecker/A_times_B_kronecker_C} 0044 %! 0045 %! @end deftypefn 0046 %@eod: 0047 0048 % Copyright (C) 1996-2011 Dynare Team 0049 % stephane DOT adjemian AT univ DASH lemans DOT fr 0050 % 0051 % This file is part of Dynare. 0052 % 0053 % Dynare is free software: you can redistribute it and/or modify 0054 % it under the terms of the GNU General Public License as published by 0055 % the Free Software Foundation, either version 3 of the License, or 0056 % (at your option) any later version. 0057 % 0058 % Dynare is distributed in the hope that it will be useful, 0059 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0060 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0061 % GNU General Public License for more details. 0062 % 0063 % You should have received a copy of the GNU General Public License 0064 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0065 0066 A = varargin{1}; 0067 B = varargin{2}; 0068 C = varargin{3}; 0069 fake = varargin{nargin}; 0070 0071 switch nargin 0072 case 4 0073 [D, fake] = A_times_B_kronecker_C(A,B,C,fake); 0074 case 3 0075 [D, fake] = A_times_B_kronecker_C(A,B,C); 0076 otherwise 0077 error('Two or Three input arguments required!') 0078 end 0079 err = 0;