Accord.Math.Optimization.QuadraticObjectiveFunction.TryParse C# (CSharp) Метод

TryParse() публичный статический Метод

Attempts to create a QuadraticObjectiveFunction from a System.String representation.
public static TryParse ( string str, CultureInfo culture, QuadraticObjectiveFunction &function ) : bool
str string The string containing the function in textual form.
culture System.Globalization.CultureInfo The culture information specifying how /// numbers written in the should /// be parsed. Default is CultureInfo.InvariantCulture.
function QuadraticObjectiveFunction The resulting function, if it could be parsed.
Результат bool
        public static bool TryParse(string str, CultureInfo culture, out QuadraticObjectiveFunction function)
        {
            // TODO: implement this method without the try-catch block.

            try
            {
                function = new QuadraticObjectiveFunction(str, culture);
            }
            catch (FormatException)
            {
                function = null;
                return false;
            }

            return true;
        }
    }

Same methods

QuadraticObjectiveFunction::TryParse ( string str, QuadraticObjectiveFunction &function ) : bool