public static VectorNd Min(VectorNd left, VectorNd right)
        {
            var dim    = Math.Max(left.Dimension, right.Dimension);
            var result = new double[dim];

            for (var i = 0; i < dim; i++)
            {
                result[i] = Math.Min(left[i], right[i]);
            }

            return(new VectorNd(ref result));
        }
        public static double DotP(VectorNd left, VectorNd right)
        {
            double result = 0;
            var    dim    = Math.Min(left.Dimension, right.Dimension);

            for (var i = 0; i < dim; i++)
            {
                result += left[i] * right[i];
            }

            return(result);
        }