Revision 1956

trunk/src/linad99/fv1f1b.hpp (revision 1956)
1
/*
2
 * $Id$
3
 *
4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California
6
 *
7
 * ADModelbuilder and associated libraries and documentations are
8
 * provided under the general terms of the "New BSD" license
9
 *
10
 * License:
11
 *
12
 * Redistribution and use in source and binary forms, with or without
13
 * modification, are permitted provided that the following conditions are
14
 * met:
15
 *
16
 * 1. Redistributions of source code must retain the above copyright
17
 * notice, this list of conditions and the following disclaimer.
18
 *
19
 * 2.  Redistributions in binary form must reproduce the above copyright
20
 * notice, this list of conditions and the following disclaimer in the
21
 * documentation and/or other materials provided with the distribution.
22
 *
23
 * 3.  Neither the name of the  University of California, Otter Research,
24
 * nor the ADMB Foundation nor the names of its contributors may be used
25
 * to endorse or promote products derived from this software without
26
 * specific prior written permission.
27
 *
28
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
 *
40
 */
41
/**
42
 * \file
43
 * Description not yet available.
44
 */
45
#include <fvar.hpp>
46

  
47
/**
48
 * Description not yet available.
49
 * \param
50
 */
51
  class f1b1_data{
52
  {
53
  public:
54
    double        u;
55
    dvector       udot;      // tangent vector for u
56
    dvector       uhat;      // adjoint vector for u
57
    dvector       uhatdot;   // adjoint vector for udot
58

  
59
    f1b_data(int n) : udot(1,n), uhat(1,n), uhatdot(1,n) {}
60
    int nvar(void) {return udot.indexmax();}
61
  };
62

  
63
/**
64
 * Description not yet available.
65
 * \param
66
 */
67
  class single_f1b1_function
68
  {
69
  public:
70
    double (*f)(double);
71
    double (*d1f)(double);
72
    double (*d11f)(double);
73
    single_f1b1_node operator () (dep_data& v)
74
    {
75
      f1b1_data * dep=v->dep;
76
      f1b_data tmp(dep->nvar());
77
      tmp.u=f(dep->u);
78
      udot=d1f(dep->u)*dep->udot;
79
      single_f1b1_node node : ;
80
      node.ind=*v;
81
    }
82
  }
83

  
84
/**
85
 * Description not yet available.
86
 * \param
87
 */
88
  class double_f1b1_function
89
  {
90
  public:
91
    double (*f)(double,double);
92
    double (*d1f)(double,double);
93
    double (*d2f)(double,double);
94
    double (*d12f)(double,double);
95
    double (*d22f)(double,double);
96
    double_f1b1_node operator () (dep_data& v,dep_data& w)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff