8 int main(
int,
char const **) {
17 t_Vector const target0 = t_Vector::Random(
N);
18 t_Vector const target1 = t_Vector::Random(
N) * 4;
30 .regulariser_strength(0.01)
33 .Phi(-t_Matrix::Identity(
N,
N));
37 auto const diagnostic = padmm();
42 if (not diagnostic.good)
throw std::runtime_error(
"Did not converge!");
45 t_Vector const segment = (target1 - target0).normalized();
46 t_Scalar
const alpha = (diagnostic.x - target0).transpose() * segment;
47 if ((target1 - target0).transpose() * segment < alpha)
48 throw std::runtime_error(
"Point beyond x_1 plane");
49 if (alpha < 0e0)
throw std::runtime_error(
"Point before x_0 plane");
50 if ((diagnostic.x - target0 - alpha * segment).stableNorm() > 1e-8)
51 throw std::runtime_error(
"Point not on (x_0, x_1) line");
sopt::Vector< Scalar > t_Vector
sopt::Matrix< Scalar > t_Matrix
Proximal Alternate Direction method of mutltipliers.
ProximalADMM< Scalar > & is_converged(std::function< bool(t_Vector const &x)> const &func)
Convergence function that takes only the output as argument.
Proximal of euclidian norm.
Translation< FUNCTION, VECTOR > translate(FUNCTION const &func, VECTOR const &translation)
Translates given proximal by given vector.
double t_real
Root of the type hierarchy for real numbers.
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector of a given type.
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A matrix of a given type.
int main(int, char const **)