Revision 535

tags/admb-11/docs/manuals/README.txt (revision 535)
1
Making the ADMB manuals with LaTeX
2

  
3
1. read http://en.wikibooks.org/wiki/LaTeX/Packages/Installing_Extra_Packages
4

  
5
2. determine where the "right" place is for your LaTeX instalation. It 
6
will be something like /usr/share/texmf/tex/latex
7

  
8
3. determine the name of the LaTeX indexing utility for your installation.
9

  
10
4. edit admbmanual/Makefile and change the varibles as required
11
LATEX_PATH=
12
INDEXER=
13

  
14
5. run make INSTALLATION as superuser. 
15
This step will install the Dangerous Curve ADMB style package in the "right" 
16
place. You should only have to this step once (unless there are some 
17
changes to the package).
18

  
19
6. run make clean to get rid of various files that don't matter much.
20

  
21
7. run make to make the standard admb manuals
22

  
23
8. or run make ALL to make the manuals for manual writers as well as 
24
the standard admb manuals.
tags/admb-11/docs/manuals/autodif/data.sa1 (revision 535)
1
          1.0000          -12.3147  
2
          3.0000          -13.4881  
3
          4.0000           60.7440  
4
          5.0000            1.6816  
5
          6.0000           21.8206  
6
          7.0000           77.0879  
7
          8.0000          147.9142  
8
          9.0000           69.6703  
9
         10.0000          131.8566  
10
         11.0000           18.6763  
11
         12.0000           83.8777  
12
         13.0000           21.1375  
13
         14.0000           37.1014  
14
         15.0000           78.9108  
15
         16.0000          133.2248  
16
         17.0000          102.4813  
17
         19.0000           53.6027  
18
         20.0000          164.4088  
tags/admb-11/docs/manuals/autodif/robust.cpp (revision 535)
1
\begin{lstlisting}
2
// file: robust.cpp
3

  
4
#include <fvar.hpp>
5

  
6
// function prototype
7
double fcomp(dvector& OBS_Y,dvector& OBS_Z,dvar_vector& x);
8

  
9
#ifdef __BCPLUSPLUS__
10
  extern unsigned _stklen = 20000;
11
#endif
12
#ifdef __ZTC__
13
  long _stack = 20000;
14
#endif
15
double alpha;
16
void main()
17
{
18
  ifstream infile("robust.dat"); // robust.dat contains the observed data
19
  if(!infile) // Check for I/O error
20
  {
21
    cerr << "Error trying to open the file robust.dat\n";
22
    exit(1);
23
  }
24
  int nobs; // nobs is the number of observations
25
  infile >> nobs; // read in the number of observations
26
  if(!infile) // Check for I/O error
27
  {
28
    cerr << "Error reading number of observations from the file robust.dat\n";
29
    exit(1);
30
  }
31
  dvector Y(1,nobs);
32
  dvector Z(1,nobs);
33
  // The Data are in the file in the form one Y_i Z_i pair per line
34
  { // Limit the scope of the matrix tmp
35
    dmatrix tmp(1,nobs,1,2);
36
    infile >> tmp; // Read the Y_i Z_i pairs into tmp
37
    if(!infile) // Check for I/O error
38
    {
39
      cerr << "Error reading data in from the file robust.dat\n";
40
      exit(1);
41
    }
42
    Z=extract_column(tmp,1); // Put the first column of tmp into Z
43
    Y=extract_column(tmp,2); // Put the second column of tmp into Y
44
  } // Now tmp goes out of scope
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff