~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#ifndef CERES_PUBLIC_TYPES_H_
38
38
#define CERES_PUBLIC_TYPES_H_
39
39
 
 
40
#include <string>
 
41
 
40
42
#include "ceres/internal/port.h"
41
43
 
42
44
namespace ceres {
124
126
  CX_SPARSE
125
127
};
126
128
 
 
129
enum DenseLinearAlgebraLibraryType {
 
130
  EIGEN,
 
131
  LAPACK
 
132
};
 
133
 
127
134
enum LinearSolverTerminationType {
128
135
  // Termination criterion was met. For factorization based solvers
129
136
  // the tolerance is assumed to be zero. Any user provided values are
167
174
  // used is determined by NonlinerConjuateGradientType.
168
175
  NONLINEAR_CONJUGATE_GRADIENT,
169
176
 
170
 
  // A limited memory approximation to the inverse Hessian is
171
 
  // maintained and used to compute a quasi-Newton step.
172
 
  //
173
 
  // For more details see
 
177
  // BFGS, and it's limited memory approximation L-BFGS, are quasi-Newton
 
178
  // algorithms that approximate the Hessian matrix by iteratively refining
 
179
  // an initial estimate with rank-one updates using the gradient at each
 
180
  // iteration. They are a generalisation of the Secant method and satisfy
 
181
  // the Secant equation.  The Secant equation has an infinium of solutions
 
182
  // in multiple dimensions, as there are N*(N+1)/2 degrees of freedom in a
 
183
  // symmetric matrix but only N conditions are specified by the Secant
 
184
  // equation. The requirement that the Hessian approximation be positive
 
185
  // definite imposes another N additional constraints, but that still leaves
 
186
  // remaining degrees-of-freedom.  (L)BFGS methods uniquely deteremine the
 
187
  // approximate Hessian by imposing the additional constraints that the
 
188
  // approximation at the next iteration must be the 'closest' to the current
 
189
  // approximation (the nature of how this proximity is measured is actually
 
190
  // the defining difference between a family of quasi-Newton methods including
 
191
  // (L)BFGS & DFP). (L)BFGS is currently regarded as being the best known
 
192
  // general quasi-Newton method.
 
193
  //
 
194
  // The principal difference between BFGS and L-BFGS is that whilst BFGS
 
195
  // maintains a full, dense approximation to the (inverse) Hessian, L-BFGS
 
196
  // maintains only a window of the last M observations of the parameters and
 
197
  // gradients. Using this observation history, the calculation of the next
 
198
  // search direction can be computed without requiring the construction of the
 
199
  // full dense inverse Hessian approximation. This is particularly important
 
200
  // for problems with a large number of parameters, where storage of an N-by-N
 
201
  // matrix in memory would be prohibitive.
 
202
  //
 
203
  // For more details on BFGS see:
 
204
  //
 
205
  // Broyden, C.G., "The Convergence of a Class of Double-rank Minimization
 
206
  // Algorithms,"; J. Inst. Maths. Applics., Vol. 6, pp 76–90, 1970.
 
207
  //
 
208
  // Fletcher, R., "A New Approach to Variable Metric Algorithms,"
 
209
  // Computer Journal, Vol. 13, pp 317–322, 1970.
 
210
  //
 
211
  // Goldfarb, D., "A Family of Variable Metric Updates Derived by Variational
 
212
  // Means," Mathematics of Computing, Vol. 24, pp 23–26, 1970.
 
213
  //
 
214
  // Shanno, D.F., "Conditioning of Quasi-Newton Methods for Function
 
215
  // Minimization," Mathematics of Computing, Vol. 24, pp 647–656, 1970.
 
216
  //
 
217
  // For more details on L-BFGS see:
174
218
  //
175
219
  // Nocedal, J. (1980). "Updating Quasi-Newton Matrices with Limited
176
220
  // Storage". Mathematics of Computation 35 (151): 773–782.
179
223
  // "Representations of Quasi-Newton Matrices and their use in
180
224
  // Limited Memory Methods". Mathematical Programming 63 (4):
181
225
  // 129–156.
 
226
  //
 
227
  // A general reference for both methods:
 
228
  //
 
229
  // Nocedal J., Wright S., Numerical Optimization, 2nd Ed. Springer, 1999.
182
230
  LBFGS,
 
231
  BFGS,
183
232
};
184
233
 
185
234
// Nonliner conjugate gradient methods are a generalization of the
198
247
  // Backtracking line search with polynomial interpolation or
199
248
  // bisection.
200
249
  ARMIJO,
 
250
  WOLFE,
201
251
};
202
252
 
203
253
// Ceres supports different strategies for computing the trust region
310
360
  CONSOLE,
311
361
 
312
362
  // Write out the linear least squares problem to the directory
313
 
  // pointed to by Solver::Options::lsqp_dump_directory as a protocol
314
 
  // buffer. linear_least_squares_problems.h/cc contains routines for
315
 
  // loading these problems. For details on the on disk format used,
316
 
  // see matrix.proto. The files are named lm_iteration_???.lsqp.
317
 
  PROTOBUF,
318
 
 
319
 
  // Write out the linear least squares problem to the directory
320
363
  // pointed to by Solver::Options::lsqp_dump_directory as text files
321
364
  // which can be read into MATLAB/Octave. The Jacobian is dumped as a
322
365
  // text file containing (i,j,s) triplets, the vectors D, x and f are
339
382
  FORWARD
340
383
};
341
384
 
 
385
enum LineSearchInterpolationType {
 
386
  BISECTION,
 
387
  QUADRATIC,
 
388
  CUBIC
 
389
};
 
390
 
 
391
enum CovarianceAlgorithmType {
 
392
  DENSE_SVD,
 
393
  SPARSE_CHOLESKY,
 
394
  SPARSE_QR
 
395
};
 
396
 
342
397
const char* LinearSolverTypeToString(LinearSolverType type);
343
398
bool StringToLinearSolverType(string value, LinearSolverType* type);
344
399
 
351
406
    string value,
352
407
    SparseLinearAlgebraLibraryType* type);
353
408
 
 
409
const char* DenseLinearAlgebraLibraryTypeToString(
 
410
    DenseLinearAlgebraLibraryType type);
 
411
bool StringToDenseLinearAlgebraLibraryType(
 
412
    string value,
 
413
    DenseLinearAlgebraLibraryType* type);
 
414
 
354
415
const char* TrustRegionStrategyTypeToString(TrustRegionStrategyType type);
355
416
bool StringToTrustRegionStrategyType(string value,
356
417
                                     TrustRegionStrategyType* type);
371
432
const char* NonlinearConjugateGradientTypeToString(
372
433
    NonlinearConjugateGradientType type);
373
434
bool StringToNonlinearConjugateGradientType(
374
 
    string value, NonlinearConjugateGradientType* type);
 
435
    string value,
 
436
    NonlinearConjugateGradientType* type);
 
437
 
 
438
const char* LineSearchInterpolationTypeToString(
 
439
    LineSearchInterpolationType type);
 
440
bool StringToLineSearchInterpolationType(
 
441
    string value,
 
442
    LineSearchInterpolationType* type);
 
443
 
 
444
const char* CovarianceAlgorithmTypeToString(
 
445
    CovarianceAlgorithmType type);
 
446
bool StringToCovarianceAlgorithmType(
 
447
    string value,
 
448
    CovarianceAlgorithmType* type);
375
449
 
376
450
const char* LinearSolverTerminationTypeToString(
377
451
    LinearSolverTerminationType type);
381
455
bool IsSchurType(LinearSolverType type);
382
456
bool IsSparseLinearAlgebraLibraryTypeAvailable(
383
457
    SparseLinearAlgebraLibraryType type);
384
 
 
 
458
bool IsDenseLinearAlgebraLibraryTypeAvailable(
 
459
    DenseLinearAlgebraLibraryType type);
385
460
 
386
461
}  // namespace ceres
387
462