~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to extern/libmv/third_party/ceres/include/ceres/dynamic_autodiff_cost_function.h

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:50:05 UTC
  • mfrom: (14.2.27 sid)
  • Revision ID: siretart@tauware.de-20140531015005-ml6druahuj82nsav
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Ceres Solver - A fast non-linear least squares minimizer
2
 
// Copyright 2012 Google Inc. All rights reserved.
 
2
// Copyright 2013 Google Inc. All rights reserved.
3
3
// http://code.google.com/p/ceres-solver/
4
4
//
5
5
// Redistribution and use in source and binary forms, with or without
26
26
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
27
// POSSIBILITY OF SUCH DAMAGE.
28
28
//
29
 
// Author: mierle@gmail.com (Keir Mierle)
30
 
//         sameeragarwal@google.com (Sameer Agarwal)
31
 
//         thadh@gmail.com (Thad Hughes)
 
29
// Author: sameeragarwal@google.com (Sameer Agarwal)
 
30
//         mierle@gmail.com (Keir Mierle)
32
31
//
33
32
// This autodiff implementation differs from the one found in
34
 
// autodiff_cost_function.h by supporting autodiff on cost functions with
35
 
// variable numbers of parameters with variable sizes. With the other
36
 
// implementation, all the sizes (both the number of parameter blocks and the
37
 
// size of each block) must be fixed at compile time.
 
33
// autodiff_cost_function.h by supporting autodiff on cost functions
 
34
// with variable numbers of parameters with variable sizes. With the
 
35
// other implementation, all the sizes (both the number of parameter
 
36
// blocks and the size of each block) must be fixed at compile time.
38
37
//
39
 
// The functor API differs slightly from the API for fixed size autodiff; the
40
 
// expected interface for the cost functors is:
 
38
// The functor API differs slightly from the API for fixed size
 
39
// autodiff; the expected interface for the cost functors is:
41
40
//
42
41
//   struct MyCostFunctor {
43
42
//     template<typename T>
46
45
//     }
47
46
//   }
48
47
//
49
 
// Since the sizing of the parameters is done at runtime, you must also specify
50
 
// the sizes after creating the dynamic autodiff cost function. For example:
 
48
// Since the sizing of the parameters is done at runtime, you must
 
49
// also specify the sizes after creating the dynamic autodiff cost
 
50
// function. For example:
51
51
//
52
52
//   DynamicAutoDiffCostFunction<MyCostFunctor, 3> cost_function(
53
53
//       new MyCostFunctor());
55
55
//   cost_function.AddParameterBlock(10);
56
56
//   cost_function.SetNumResiduals(21);
57
57
//
58
 
// Under the hood, the implementation evaluates the cost function multiple
59
 
// times, computing a small set of the derivatives (four by default, controlled
60
 
// by the Stride template parameter) with each pass. There is a tradeoff with
61
 
// the size of the passes; you may want to experiment with the stride.
 
58
// Under the hood, the implementation evaluates the cost function
 
59
// multiple times, computing a small set of the derivatives (four by
 
60
// default, controlled by the Stride template parameter) with each
 
61
// pass. There is a tradeoff with the size of the passes; you may want
 
62
// to experiment with the stride.
62
63
 
63
64
#ifndef CERES_PUBLIC_DYNAMIC_AUTODIFF_COST_FUNCTION_H_
64
65
#define CERES_PUBLIC_DYNAMIC_AUTODIFF_COST_FUNCTION_H_