A New Approach to Variable Metric Algorithms