-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
We need 4 things from a Euclidean metric:
- a size
- left-multiplication by the metric
M⁻¹ - a quadratic form
dot(v, M⁻¹, v) - left-division by
W, such thatW'*W == inv(M⁻¹)
Current this is handled by 3 different types:
UnitEuclideanMetricDiagonalEuclideanMetricDenseEuclideanMetric
However, a user may want to initialize with a diagonal metric adapt a dense metric or vice versa. Assuming we only support metrics for which an AbstractMatrix representation is available, it seems like it would be preferable to instead have a single EuclideanMetric type that stores the matrices M⁻¹ and W (UniformScaling for UnitEuclideanMetric) and then have the convenient aliases:
const ScalarEuclideanMetric = EuclideanMetric{<:UniformScaling}
const DiagonalEuclideanMetric = EuclideanMetric{<:Diagonal}for dispatch.
This would also eliminate the need for a custom metric type whenever a user wants to use a different matrix type for the metric for which a more efficient W is available then the Cholesky factor, see e.g. #277, #282
Metadata
Metadata
Assignees
Labels
No labels