# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.3.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.


import collections

from sys import version_info as _version_info
if _version_info < (3, 7, 0):
    raise RuntimeError("Python 3.7 or later required")

from . import _ITKCommonPython


from . import _ITKOptimizersv4Python



from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _itkVnlTypesPython
else:
    import _itkVnlTypesPython

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


if _swig_python_version_info[0:2] >= (3, 3):
    import collections.abc
else:
    import collections

import itk.vnl_matrixPython
import itk.stdcomplexPython
import itk.pyBasePython
import itk.vnl_vectorPython
import itk.vnl_cost_functionPython
import itk.vnl_unary_functionPython
class vnl_nonlinear_minimizer(object):
    r"""Proxy of C++ vnl_nonlinear_minimizer class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _itkVnlTypesPython.delete_vnl_nonlinear_minimizer

    def set_f_tolerance(self, v):
        r"""
        set_f_tolerance(self, v)

        Parameters
        ----------
        v: double

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_f_tolerance(self, v)

    def get_f_tolerance(self):
        r"""get_f_tolerance(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_f_tolerance(self)

    def set_x_tolerance(self, v):
        r"""
        set_x_tolerance(self, v)

        Parameters
        ----------
        v: double

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_x_tolerance(self, v)

    def get_x_tolerance(self):
        r"""get_x_tolerance(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_x_tolerance(self)

    def set_g_tolerance(self, v):
        r"""
        set_g_tolerance(self, v)

        Parameters
        ----------
        v: double

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_g_tolerance(self, v)

    def get_g_tolerance(self):
        r"""get_g_tolerance(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_g_tolerance(self)

    def set_max_function_evals(self, v):
        r"""
        set_max_function_evals(self, v)

        Parameters
        ----------
        v: int

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_max_function_evals(self, v)

    def get_max_function_evals(self):
        r"""get_max_function_evals(self) -> int"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_max_function_evals(self)

    def set_epsilon_function(self, v):
        r"""
        set_epsilon_function(self, v)

        Parameters
        ----------
        v: double

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_epsilon_function(self, v)

    def get_epsilon_function(self):
        r"""get_epsilon_function(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_epsilon_function(self)

    def set_trace(self, on):
        r"""
        set_trace(self, on)

        Parameters
        ----------
        on: bool

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_trace(self, on)

    def get_trace(self):
        r"""get_trace(self) -> bool"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_trace(self)

    def set_verbose(self, verb):
        r"""
        set_verbose(self, verb)

        Parameters
        ----------
        verb: bool

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_verbose(self, verb)

    def get_verbose(self):
        r"""get_verbose(self) -> bool"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_verbose(self)

    def set_check_derivatives(self, cd):
        r"""
        set_check_derivatives(self, cd)

        Parameters
        ----------
        cd: int

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_set_check_derivatives(self, cd)

    def get_check_derivatives(self):
        r"""get_check_derivatives(self) -> int"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_check_derivatives(self)

    def get_start_error(self):
        r"""get_start_error(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_start_error(self)

    def get_end_error(self):
        r"""get_end_error(self) -> double"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_end_error(self)

    def get_num_evaluations(self):
        r"""get_num_evaluations(self) -> int"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_num_evaluations(self)

    def get_num_iterations(self):
        r"""get_num_iterations(self) -> int"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_num_iterations(self)
    ReturnCodes_ERROR_FAILURE = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_ERROR_FAILURE
    
    ReturnCodes_ERROR_DODGY_INPUT = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_ERROR_DODGY_INPUT
    
    ReturnCodes_CONVERGED_FTOL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_CONVERGED_FTOL
    
    ReturnCodes_CONVERGED_XTOL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_CONVERGED_XTOL
    
    ReturnCodes_CONVERGED_XFTOL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_CONVERGED_XFTOL
    
    ReturnCodes_CONVERGED_GTOL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_CONVERGED_GTOL
    
    ReturnCodes_FAILED_TOO_MANY_ITERATIONS = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_FAILED_TOO_MANY_ITERATIONS
    
    ReturnCodes_TOO_MANY_ITERATIONS = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_TOO_MANY_ITERATIONS
    
    ReturnCodes_FAILED_FTOL_TOO_SMALL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_FAILED_FTOL_TOO_SMALL
    
    ReturnCodes_FAILED_XTOL_TOO_SMALL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_FAILED_XTOL_TOO_SMALL
    
    ReturnCodes_FAILED_GTOL_TOO_SMALL = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_FAILED_GTOL_TOO_SMALL
    
    ReturnCodes_FAILED_USER_REQUEST = _itkVnlTypesPython.vnl_nonlinear_minimizer_ReturnCodes_FAILED_USER_REQUEST
    

    def obj_value_reduced(self):
        r"""obj_value_reduced(self) -> bool"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_obj_value_reduced(self)

    def get_covariance(self):
        r"""get_covariance(self) -> vnl_matrixD"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_covariance(self)

    def is_a(self):
        r"""is_a(self) -> std::string"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_is_a(self)

    def is_class(self, s):
        r"""
        is_class(self, s) -> bool

        Parameters
        ----------
        s: std::string const &

        """
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_is_class(self, s)

    def get_failure_code(self):
        r"""get_failure_code(self) -> vnl_nonlinear_minimizer::ReturnCodes"""
        return _itkVnlTypesPython.vnl_nonlinear_minimizer_get_failure_code(self)

    def __init__(self, *args):
        r"""
        __init__(self) -> vnl_nonlinear_minimizer
        __init__(self, arg0) -> vnl_nonlinear_minimizer

        Parameters
        ----------
        arg0: vnl_nonlinear_minimizer const &

        """
        _itkVnlTypesPython.vnl_nonlinear_minimizer_swiginit(self, _itkVnlTypesPython.new_vnl_nonlinear_minimizer(*args))

# Register vnl_nonlinear_minimizer in _itkVnlTypesPython:
_itkVnlTypesPython.vnl_nonlinear_minimizer_swigregister(vnl_nonlinear_minimizer)
class vnl_lbfgs(vnl_nonlinear_minimizer):
    r"""Proxy of C++ vnl_lbfgs class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def minimize(self, x):
        r"""
        minimize(self, x) -> bool

        Parameters
        ----------
        x: vnl_vectorD &

        """
        return _itkVnlTypesPython.vnl_lbfgs_minimize(self, x)

    def __init__(self, *args):
        r"""
        __init__(self) -> vnl_lbfgs
        __init__(self, f) -> vnl_lbfgs

        Parameters
        ----------
        f: vnl_cost_function &

        __init__(self, arg0) -> vnl_lbfgs

        Parameters
        ----------
        arg0: vnl_lbfgs const &

        """
        _itkVnlTypesPython.vnl_lbfgs_swiginit(self, _itkVnlTypesPython.new_vnl_lbfgs(*args))
    __swig_destroy__ = _itkVnlTypesPython.delete_vnl_lbfgs

# Register vnl_lbfgs in _itkVnlTypesPython:
_itkVnlTypesPython.vnl_lbfgs_swigregister(vnl_lbfgs)
class vnl_lbfgsb(vnl_nonlinear_minimizer):
    r"""Proxy of C++ vnl_lbfgsb class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def minimize(self, x):
        r"""
        minimize(self, x) -> bool

        Parameters
        ----------
        x: vnl_vectorD &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_minimize(self, x)

    def set_bound_selection(self, nbd):
        r"""
        set_bound_selection(self, nbd)

        Parameters
        ----------
        nbd: vnl_vectorSL const &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_bound_selection(self, nbd)

    def get_bound_selection(self, nbd):
        r"""
        get_bound_selection(self, nbd)

        Parameters
        ----------
        nbd: vnl_vectorSL &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_get_bound_selection(self, nbd)

    def set_lower_bound(self, l):
        r"""
        set_lower_bound(self, l)

        Parameters
        ----------
        l: vnl_vectorD const &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_lower_bound(self, l)

    def get_lower_bound(self, l):
        r"""
        get_lower_bound(self, l)

        Parameters
        ----------
        l: vnl_vectorD &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_get_lower_bound(self, l)

    def set_upper_bound(self, u):
        r"""
        set_upper_bound(self, u)

        Parameters
        ----------
        u: vnl_vectorD const &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_upper_bound(self, u)

    def get_upper_bound(self, u):
        r"""
        get_upper_bound(self, u)

        Parameters
        ----------
        u: vnl_vectorD &

        """
        return _itkVnlTypesPython.vnl_lbfgsb_get_upper_bound(self, u)

    def set_max_variable_metric_corrections(self, m):
        r"""
        set_max_variable_metric_corrections(self, m)

        Parameters
        ----------
        m: long

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_max_variable_metric_corrections(self, m)

    def get_max_variable_metric_corrections(self):
        r"""get_max_variable_metric_corrections(self) -> long"""
        return _itkVnlTypesPython.vnl_lbfgsb_get_max_variable_metric_corrections(self)

    def set_cost_function_convergence_factor(self, factor):
        r"""
        set_cost_function_convergence_factor(self, factor)

        Parameters
        ----------
        factor: double

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_cost_function_convergence_factor(self, factor)

    def get_cost_function_convergence_factor(self):
        r"""get_cost_function_convergence_factor(self) -> double"""
        return _itkVnlTypesPython.vnl_lbfgsb_get_cost_function_convergence_factor(self)

    def set_projected_gradient_tolerance(self, tol):
        r"""
        set_projected_gradient_tolerance(self, tol)

        Parameters
        ----------
        tol: double

        """
        return _itkVnlTypesPython.vnl_lbfgsb_set_projected_gradient_tolerance(self, tol)

    def get_projected_gradient_tolerance(self):
        r"""get_projected_gradient_tolerance(self) -> double"""
        return _itkVnlTypesPython.vnl_lbfgsb_get_projected_gradient_tolerance(self)

    def get_inf_norm_projected_gradient(self):
        r"""get_inf_norm_projected_gradient(self) -> double"""
        return _itkVnlTypesPython.vnl_lbfgsb_get_inf_norm_projected_gradient(self)

    def __init__(self, *args):
        r"""
        __init__(self, f) -> vnl_lbfgsb

        Parameters
        ----------
        f: vnl_cost_function &

        __init__(self, arg0) -> vnl_lbfgsb

        Parameters
        ----------
        arg0: vnl_lbfgsb const &

        """
        _itkVnlTypesPython.vnl_lbfgsb_swiginit(self, _itkVnlTypesPython.new_vnl_lbfgsb(*args))
    __swig_destroy__ = _itkVnlTypesPython.delete_vnl_lbfgsb

# Register vnl_lbfgsb in _itkVnlTypesPython:
_itkVnlTypesPython.vnl_lbfgsb_swigregister(vnl_lbfgsb)

