ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
least_absolute_deviations.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - CloudViewer: www.cloudViewer.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.cloudViewer.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
8
#pragma once
9
10
#include <Eigen/Core>
11
#include <Eigen/SparseCore>
12
13
#include "
util/logging.h
"
14
15
namespace
colmap
{
16
17
struct
LeastAbsoluteDeviationsOptions
{
18
// Augmented Lagrangian parameter.
19
double
rho
= 1.0;
20
21
// Over-relaxation parameter, typical values are between 1.0 and 1.8.
22
double
alpha
= 1.0;
23
24
// Maximum solver iterations.
25
int
max_num_iterations
= 1000;
26
27
// Absolute and relative solution thresholds, as suggested by Boyd et al.
28
double
absolute_tolerance
= 1
e
-4;
29
double
relative_tolerance
= 1
e
-2;
30
};
31
32
// Least absolute deviations (LAD) fitting via ADMM by solving the problem:
33
//
34
// min || A x - b ||_1
35
//
36
// The solution is returned in the vector x and the iterative solver is
37
// initialized with the given value. This implementation is based on the paper
38
// "Distributed Optimization and Statistical Learning via the Alternating
39
// Direction Method of Multipliers" by Boyd et al. and the Matlab implementation
40
// at https://web.stanford.edu/~boyd/papers/admm/least_abs_deviations/lad.html
41
bool
SolveLeastAbsoluteDeviations
(
const
LeastAbsoluteDeviationsOptions
& options,
42
const
Eigen::SparseMatrix<double>& A,
43
const
Eigen::VectorXd& b,
44
Eigen::VectorXd*
x
);
45
46
}
// namespace colmap
e
const double * e
Definition:
essential_matrix_poly.h:10
logging.h
x
normal_z x
Definition:
my_point_types.h:165
colmap
Definition:
AutomaticReconstructionController.h:17
colmap::SolveLeastAbsoluteDeviations
bool SolveLeastAbsoluteDeviations(const LeastAbsoluteDeviationsOptions &options, const Eigen::SparseMatrix< double > &A, const Eigen::VectorXd &b, Eigen::VectorXd *x)
Definition:
least_absolute_deviations.cc:47
colmap::LeastAbsoluteDeviationsOptions
Definition:
least_absolute_deviations.h:17
colmap::LeastAbsoluteDeviationsOptions::relative_tolerance
double relative_tolerance
Definition:
least_absolute_deviations.h:29
colmap::LeastAbsoluteDeviationsOptions::rho
double rho
Definition:
least_absolute_deviations.h:19
colmap::LeastAbsoluteDeviationsOptions::absolute_tolerance
double absolute_tolerance
Definition:
least_absolute_deviations.h:28
colmap::LeastAbsoluteDeviationsOptions::max_num_iterations
int max_num_iterations
Definition:
least_absolute_deviations.h:25
colmap::LeastAbsoluteDeviationsOptions::alpha
double alpha
Definition:
least_absolute_deviations.h:22
libs
Reconstruction
src
optim
least_absolute_deviations.h
Generated on Tue Feb 3 2026 07:12:30 for ACloudViewer by
1.9.1