Revision 1110 trunk/src/df1b2-separable/df1b2lp7.cpp

df1b2lp7.cpp (revision 1110)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
/**
8 8
 * \file
......
25 25
  df1b2_gradlist::set_no_derivatives();
26 26
  df1b2variable::passnumber=1;
27 27
  df1b2_gradcalc1();
28
   
28

  
29 29
  init_df1b2vector & locy= *funnel_init_var::py;
30 30
  imatrix& list=*funnel_init_var::plist;
31 31
  int num_local_re=0;
......
37 37

  
38 38
  for (i=1;i<=funnel_init_var::num_active_parameters;i++)
39 39
  {
40
    if (list(i,1)>xsize) 
40
    if (list(i,1)>xsize)
41 41
    {
42 42
      lre_index(++num_local_re)=i;
43 43
    }
44
    else if (list(i,1)>0) 
44
    else if (list(i,1)>0)
45 45
    {
46 46
      lfe_index(++num_local_fe)=i;
47 47
    }
48 48
  }
49
 
50
  
49

  
51 50
  if (num_local_re > 0)
52 51
  {
53 52
    int j;
......
97 96
            int i2=list(lrei,2);
98 97
            int j1=list(lrej,1)-xsize;
99 98
            int j2=list(lrej,2);
100
            
99

  
101 100
            if (i1<=j1)
102 101
            {
103 102
              sparse_count++;
......
109 108
      }
110 109
    }
111 110
  }
112
  
111

  
113 112
  // Now the adjoint code
114 113

  
115 114
  if (num_local_re > 0)
......
127 126
          int i2=list(lrei,2);
128 127
          int j1=list(lrej,1)-xsize;
129 128
          int j2=list(lrej,2);
130
          if (i1>=j1) 
129
          if (i1>=j1)
131 130
          {
132 131
            //(*bHess)(i1,j1)+=locy(i2).u_bar[j2-1];
133 132
            locy(i2).get_u_bar_tilde()[j2-1]=(*bHessadjoint)(i1,j1);
......
158 157
      }
159 158
      else
160 159
      {
161
        dcompressed_triplet * vsparse_triplet_adjoint = 
160
        dcompressed_triplet * vsparse_triplet_adjoint =
162 161
          pmin->lapprox->vsparse_triplet_adjoint;
163 162
        for (i=1;i<=num_local_re;i++)
164 163
        {
......
188 187
      }
189 188
    }
190 189
  }
191
  
190

  
192 191
  df1b2variable::passnumber=2;
193 192
  df1b2_gradcalc1();
194
  
193

  
195 194
  df1b2variable::passnumber=3;
196 195
  df1b2_gradcalc1();
197
  
196

  
198 197
  f1b2gradlist->reset();
199 198
  f1b2gradlist->list.initialize();
200 199
  f1b2gradlist->list2.initialize();

Also available in: Unified diff