Statistics
| Revision:

root / branches / pthreads-737 / docs / manuals / autodif / nvarcal.cpp @ 765

History | View | Annotate | Download (607 Bytes)

1
\begin{lstlisting}
2
// file: nvarcal.cpp
3

    
4
#include <fvar.hpp>
5
#include "mixture.h"
6

    
7
int nvarcal(ivector& control ,int ngroups)
8
{
9
  int ii=1;
10
  if (control(1)>0) // control(1) determines whether the p's are active
11
  {
12
    for (int j=1;j<=ngroups;j++)
13
    {
14
      ii++;
15
    }
16
  }
17
  if (control(2)>0) // control(2) determines whether the mu's are active
18
  {
19
    for (int j=1;j<=ngroups;j++)
20
    {
21
      ii++;
22
    }mix
23
  }
24
  if (control(3)>0) // control(3) determines whether the sd's are active
25
  {
26
    for (int j=1;j<=ngroups;j++)
27
    {
28
      ii++;
29
    }
30
  }
31
  int nvar=ii-1;
32
  return(nvar);
33
}
34
\end{lstlisting}