  We propose an extremely versatile approach to address a large family of
matrix nearness problems, possibly with additional linear constraints. Our
method is based on splitting a matrix nearness problem into two nested
optimization problems, of which the inner one can be solved either exactly or
cheaply, while the outer one can be recast as an unconstrained optimization
task over a smooth real Riemannian manifold. We observe that this paradigm
applies to many matrix nearness problems of practical interest appearing in the
literature, thus revealing that they are equivalent in this sense to a
Riemannian optimization problem. We also show that the objective function to be
minimized on the Riemannian manifold can be discontinuous, thus requiring
regularization techniques, and we give conditions for this to happen. Finally,
we demonstrate the practical applicability of our method by implementing it for
a number of matrix nearness problems that are relevant for applications and are
currently considered very demanding in practice. Extensive numerical
experiments demonstrate that our method often greatly outperforms its
predecessors, including algorithms specifically designed for those particular
problems.
