Permalink
Browse files

More changes to Doxygen docs

  • Loading branch information...
1 parent 981f120 commit c52145f7898b49d2dc32072e1256172d9880c679 @skaug skaug committed Nov 21, 2013
@@ -1,5 +1,5 @@
/** \file
-* \brief Main TMB file containing interfaces to R and CppAD
+* \brief Includes and sets all stuff needed to compile the user defined objective function.
*/
/* To be removed */
#define TMB_DEBUG 0
@@ -1,3 +1,6 @@
+/** \file
+ \brief Gamma function and gamma probability densities
+*/
template <class Type>
inline Type lgamma(const Type &y)
{
@@ -28,11 +31,12 @@ inline Type lgamma(const Type &y)
return term1 + (term2 - Type(7.0));
}
-/* Negative binomial probability function.
- * Considering the return value we need to make sure that:
- * (1) n>0 (2) 0<p (3) p<1
- * This is obtained by adding small constants appropriate places.
- */
+/** \brief Negative binomial probability function.
+
+ Considering the return value we need to make sure that:
+ (1) n>0 (2) 0<p (3) p<1
+ This is obtained by adding small constants appropriate places.
+*/
template<class Type>
inline Type dnbinom(const Type &x, const Type &mu0, const Type &var0,
int give_log=0)
@@ -46,23 +50,23 @@ inline Type dnbinom(const Type &x, const Type &mu0, const Type &var0,
if (give_log) return logres; else return exp(logres);
}
-/* Poisson probability function. */
+/** \brief Poisson probability function. */
template<class Type>
inline Type dpois(const Type &x, const Type &lambda, int give_log=0)
{
Type logres = -lambda + x*log(lambda) - lgamma(x+Type(1));
if (give_log) return logres; else return exp(logres);
}
-/* Density of X where X~gamma distributed */
+/** \brief Density of X where X~gamma distributed */
template<class Type>
Type dgamma(Type y, Type shape, Type scale, int give_log=0)
{
Type logres=-lgamma(shape)+(shape-Type(1.0))*log(y)-y;
if(give_log)return logres; else return exp(logres);
}
-/* Density of log(X) where X~gamma distributed */
+/** \brief Density of log(X) where X~gamma distributed */
template<class Type>
inline Type dlgamma(Type y, Type shape, Type scale, int give_log=0)
{
@@ -1,3 +1,7 @@
+/** \file
+* \brief Interfaces to R and CppAD
+*/
+
/* Memory manager:
Count the number of external pointers alive.
When total number is zero it is safe to dyn.unload
@@ -1,6 +1,5 @@
-/**
- \file density.cpp
- Classes to construct multivariate Gaussian density objects.
+/** \file
+ \brief Classes to construct multivariate Gaussian density objects.
*/
@@ -1,3 +1,8 @@
+/** \file
+ \brief Kronecker product of two matrices
+*/
+
+/** \brief Kronecker product of two matrices */
template <class scalartype, int n1, int n2, int n3, int n4>
Matrix<scalartype,n1*n3,n2*n4> kronecker(Matrix<scalartype,n1,n2> x, Matrix<scalartype,n3,n4> y){
Matrix<scalartype,n1*n3,n2*n4> ans;
@@ -1,4 +1,4 @@
-/**
+/** \file
\brief Namespace of utility functions for TMB
*/
namespace tmbutils{
@@ -1,6 +1,5 @@
-/**
- \file vector.cpp
- Matrix vector templates using inheritance.
+/** \file
+ \brief Defines TMB vectors
*/
using namespace Eigen;
View
@@ -575,11 +575,7 @@ WARN_LOGFILE =
# with spaces.
INPUT = mainpage.txt \
- ../TMB/inst/include \
- ../tmb_examples/spatial.cpp \
- ../tmb_examples/nmix.cpp \
- ../tmb_examples/matrix_arrays.cpp \
- ../tmb_examples/sdv_multi.cpp
+ ../TMB/inst/include
# This tag can be used to specify the character encoding of the source files
@@ -637,7 +633,8 @@ EXCLUDE_SYMBOLS =
# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH =
+EXAMPLE_PATH = ../tmb_examples \
+ ../TMB/inst/examples
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
View
@@ -0,0 +1,188 @@
+<doxygenlayout version="1.0">
+ <!-- Navigation index tabs for HTML output -->
+ <navindex>
+ <tab type="mainpage" visible="yes" title=""/>
+ <tab type="pages" visible="yes" title="" intro=""/>
+ <tab type="modules" visible="yes" title="Tutorials" intro=""/>
+ <tab type="examples" visible="yes" title="" intro="List of examples:"/>
+ <tab type="namespaces" visible="yes" title="">
+ <tab type="namespacelist" visible="yes" title="" intro=""/>
+ <tab type="namespacemembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="classes" visible="yes" title="">
+ <tab type="classlist" visible="yes" title="" intro=""/>
+ <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
+ <tab type="hierarchy" visible="yes" title="" intro=""/>
+ <tab type="classmembers" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="files" visible="yes" title="">
+ <tab type="filelist" visible="yes" title="" intro=""/>
+ <tab type="globals" visible="yes" title="" intro=""/>
+ </tab>
+ <tab type="dirs" visible="yes" title="" intro=""/>
+ </navindex>
+
+ <!-- Layout definition for a class page -->
+ <class>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <inheritancegraph visible="$CLASS_GRAPH"/>
+ <collaborationgraph visible="$COLLABORATION_GRAPH"/>
+ <allmemberslink visible="yes"/>
+ <memberdecl>
+ <nestedclasses visible="yes" title=""/>
+ <publictypes title=""/>
+ <publicslots title=""/>
+ <signals title=""/>
+ <publicmethods title=""/>
+ <publicstaticmethods title=""/>
+ <publicattributes title=""/>
+ <publicstaticattributes title=""/>
+ <protectedtypes title=""/>
+ <protectedslots title=""/>
+ <protectedmethods title=""/>
+ <protectedstaticmethods title=""/>
+ <protectedattributes title=""/>
+ <protectedstaticattributes title=""/>
+ <packagetypes title=""/>
+ <packagemethods title=""/>
+ <packagestaticmethods title=""/>
+ <packageattributes title=""/>
+ <packagestaticattributes title=""/>
+ <properties title=""/>
+ <events title=""/>
+ <privatetypes title=""/>
+ <privateslots title=""/>
+ <privatemethods title=""/>
+ <privatestaticmethods title=""/>
+ <privateattributes title=""/>
+ <privatestaticattributes title=""/>
+ <friends title=""/>
+ <related title="" subtitle=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <constructors title=""/>
+ <functions title=""/>
+ <related title=""/>
+ <variables title=""/>
+ <properties title=""/>
+ <events title=""/>
+ </memberdef>
+ <usedfiles visible="$SHOW_USED_FILES"/>
+ <authorsection visible="yes"/>
+ </class>
+
+ <!-- Layout definition for a namespace page -->
+ <namespace>
+ <briefdescription visible="yes"/>
+ <memberdecl>
+ <nestednamespaces visible="yes" title=""/>
+ <classes visible="yes" title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </namespace>
+
+ <!-- Layout definition for a file page -->
+ <file>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <includegraph visible="$INCLUDE_GRAPH"/>
+ <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
+ <sourcelink visible="yes"/>
+ <memberdecl>
+ <classes visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ </memberdef>
+ <authorsection/>
+ </file>
+
+ <!-- Layout definition for a group page -->
+ <group>
+ <briefdescription visible="yes"/>
+ <groupgraph visible="$GROUP_GRAPHS"/>
+ <memberdecl>
+ <classes visible="yes" title=""/>
+ <namespaces visible="yes" title=""/>
+ <dirs visible="yes" title=""/>
+ <nestedgroups visible="yes" title=""/>
+ <files visible="yes" title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ <membergroups visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ <memberdef>
+ <pagedocs/>
+ <inlineclasses title=""/>
+ <defines title=""/>
+ <typedefs title=""/>
+ <enums title=""/>
+ <enumvalues title=""/>
+ <functions title=""/>
+ <variables title=""/>
+ <signals title=""/>
+ <publicslots title=""/>
+ <protectedslots title=""/>
+ <privateslots title=""/>
+ <events title=""/>
+ <properties title=""/>
+ <friends title=""/>
+ </memberdef>
+ <authorsection visible="yes"/>
+ </group>
+
+ <!-- Layout definition for a directory page -->
+ <directory>
+ <briefdescription visible="yes"/>
+ <directorygraph visible="yes"/>
+ <memberdecl>
+ <dirs visible="yes"/>
+ <files visible="yes"/>
+ </memberdecl>
+ <detaileddescription title=""/>
+ </directory>
+</doxygenlayout>
View
@@ -1,13 +1,14 @@
-/** \defgroup Tutorial Introduction: how to write the C++ part of the model
+/** \defgroup Tutorial Getting started
-This tutorial describes how to write the C++ part of a TMB "project". The
-tutorial assumes familiarity with C++ and to some extent with R.
-TMB projects typically consist of a *.R file and a *.cpp (C++) file (see example collection).
-The *.R file does pre- and post processing of data in addition to calling the *.cpp program.
+
+A TMB projects consists of an R file (*.R) and a C++ file (*.cpp).
+The R file does pre- and post processing of data in addition to maximizing
+the log-likelihood contained in *.cpp. See \ref Examples for more details.
All R functions are documented within the standard help system i R.
+This tutorial describes how to write the C++ file, and assumes familiarity with C++ and to some extent with R.
The purpose of the C++ program is to evaluate the objective function, i.e. the negative log-likelihood
-of the model. This program is compiled and called from R, where
+of the model. The program is compiled and called from R, where
it can be fed to a function minimizer like nlminb().
The objective function should be of the following C++ type:
@@ -109,8 +110,6 @@ See \ref Examples for more examples
*/
-/** \defgroup Examples Example collection
-*/
/** \defgroup matrix_arrays Matrices and arrays
@@ -125,7 +124,7 @@ the multiplication operator "*" is the same:
- \c vector: can be used in linear algebra with \c matrix, but at the same
time admits R style element-wise operations.
-See matrix_arrays.cpp for examples of use.
+See \ref matrix_arrays.cpp "matrix_arrays.cpp" for examples of use.
\section Relation_Eigen Relationship to Eigen
@@ -140,3 +139,31 @@ the <a href="http://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html">Eig
\brief TMB contains several classes of probability distributions. These are organized into C++ name spaces
as shown below.
*/
+
+*/
+/** \defgroup Examples
+For a list of all examples please click on the "Examples" tab on
+the top of the page.
+
+Simple example:
+\include simple.cpp
+
+\example linreg.cpp
+\example matrix_arrays.cpp
+\example nmix.cpp
+\example orange_big.cpp
+\example rw.cpp
+\example rw_sparse.cpp
+\example sdv_multi.cpp
+\example socatt.cpp
+\example spatial.cpp
+\example ar1xar1.cpp
+\example atomic.cpp
+\example randomregression.cpp
+\example rw.cpp
+\example simple.cpp
+\example sumtest.cpp
+
+*/
+
+
@@ -72,9 +72,3 @@ Type objective_function<Type>::operator() ()
}
return nll;
}
-
-/** \file
-\ingroup Examples
-\brief nmix example from https://groups.nceas.ucsb.edu/non-linear-modeling/projects/nmix
-*/
-
Oops, something went wrong.

0 comments on commit c52145f

Please sign in to comment.