Home > matlab > internals.m

internals

PURPOSE ^

@info:

SYNOPSIS ^

function internals(flag, varargin)

DESCRIPTION ^

@info:
! @deftypefn {Function File} internals (@var{flag},@var{a},@var{b}, ...)
! @anchor{internals}
! @sp 1
! This command provides internal documentation and unitary tests for the matlab routines.
! @sp 2
! @strong{Inputs}
! @sp 1
! @table @ @var
! @item flag
! Mandatory argument: --doc (for displaying internal documentation) or --test (for performing unitary tests).
! @item b
! Name of the routine to be tested or for which internal documentation is needed.
! @item c
! Name of the routine to be tested.
! @item d
! @end table
! @sp 1
! @strong{Outputs}
! @sp 1
! None.
! @sp 2
! @strong{Examples}
! @sp 1
! The following instruction:
! @sp 1
! @example
! internals --info particle/local_state_iteration
! @end example
! will display the internal documentation of the routine local_state_iteration located in the particle subfolder of the matlab directory.
! @sp 1
! The following instruction:
! @sp 1
! @example
! internals --test particle/local_state_iteration
! @end example
! will execute the unitary tests associated the routine local_state_iteration.
! @sp 2
! @strong{Remarks}
! @sp 1
! [1] It is not possible to display the internal documentation of more than one routine.
! @sp 1
! [2] It is possible to perform unitary tests on a list of routines.
! @sp 1
! [3] For displaying the internal documentation, matlab calls texinfo which has to be installed.
! @sp 2
! @strong{This function is called by:}
! @sp 2
! None.
! @sp 2
! @strong{This function calls:}
! @sp 1
! @ref{utilities/tests/dynTest} @ref{utilities/doc/dynInfo}
! @end deftypefn
@eod:

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function internals(flag, varargin)
0002 
0003 %@info:
0004 %! @deftypefn {Function File} internals (@var{flag},@var{a},@var{b}, ...)
0005 %! @anchor{internals}
0006 %! @sp 1
0007 %! This command provides internal documentation and unitary tests for the matlab routines.
0008 %! @sp 2
0009 %! @strong{Inputs}
0010 %! @sp 1
0011 %! @table @ @var
0012 %! @item flag
0013 %! Mandatory argument: --doc (for displaying internal documentation) or --test (for performing unitary tests).
0014 %! @item b
0015 %! Name of the routine to be tested or for which internal documentation is needed.
0016 %! @item c
0017 %! Name of the routine to be tested.
0018 %! @item d
0019 %! @end table
0020 %! @sp 1
0021 %! @strong{Outputs}
0022 %! @sp 1
0023 %! None.
0024 %! @sp 2
0025 %! @strong{Examples}
0026 %! @sp 1
0027 %! The following instruction:
0028 %! @sp 1
0029 %! @example
0030 %! internals --info particle/local_state_iteration
0031 %! @end example
0032 %! will display the internal documentation of the routine local_state_iteration located in the particle subfolder of the matlab directory.
0033 %! @sp 1
0034 %! The following instruction:
0035 %! @sp 1
0036 %! @example
0037 %! internals --test particle/local_state_iteration
0038 %! @end example
0039 %! will execute the unitary tests associated the routine local_state_iteration.
0040 %! @sp 2
0041 %! @strong{Remarks}
0042 %! @sp 1
0043 %! [1] It is not possible to display the internal documentation of more than one routine.
0044 %! @sp 1
0045 %! [2] It is possible to perform unitary tests on a list of routines.
0046 %! @sp 1
0047 %! [3] For displaying the internal documentation, matlab calls texinfo which has to be installed.
0048 %! @sp 2
0049 %! @strong{This function is called by:}
0050 %! @sp 2
0051 %! None.
0052 %! @sp 2
0053 %! @strong{This function calls:}
0054 %! @sp 1
0055 %! @ref{utilities/tests/dynTest} @ref{utilities/doc/dynInfo}
0056 %! @end deftypefn
0057 %@eod:
0058 
0059 % Copyright (C) 2011 Dynare Team
0060 %
0061 % This file is part of Dynare.
0062 %
0063 % Dynare is free software: you can redistribute it and/or modify
0064 % it under the terms of the GNU General Public License as published by
0065 % the Free Software Foundation, either version 3 of the License, or
0066 % (at your option) any later version.
0067 %
0068 % Dynare is distributed in the hope that it will be useful,
0069 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0070 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0071 % GNU General Public License for more details.
0072 %
0073 % You should have received a copy of the GNU General Public License
0074 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0075 
0076 % AUTHOR(S) stephane DOT adjemian AT univ DASH lemans DOT fr
0077 
0078 more off
0079 
0080 if strcmpi(flag,'--test')
0081     if nargin>1
0082         dynare_path = dynare_config([],0);
0083         number_of_matlab_routines = length(varargin);
0084         for i=1:number_of_matlab_routines
0085             dynTest(varargin{i},dynare_path);
0086         end
0087     else
0088         disp('You have to specify at least one matlab routine after --test flag!')
0089     end
0090     return
0091 end
0092 
0093 if strcmpi(flag,'--info')
0094     if nargin==2
0095         dynare_config([],0);
0096         dynInfo(varargin{1})
0097     else
0098         if nargin<2
0099             disp('You have to specify a matlab routine after --info flag!')
0100         else
0101             disp('I can only show internal documentation for one matlab routine!')
0102         end
0103     end
0104     return
0105 end
0106 
0107 disp('You should read the manual...')

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005