demo + utils venv
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from ._trlib import TRLIBQuadraticSubproblem
|
||||
|
||||
__all__ = ['TRLIBQuadraticSubproblem', 'get_trlib_quadratic_subproblem']
|
||||
|
||||
|
||||
def get_trlib_quadratic_subproblem(tol_rel_i=-2.0, tol_rel_b=-3.0, disp=False):
|
||||
def subproblem_factory(x, fun, jac, hess, hessp):
|
||||
return TRLIBQuadraticSubproblem(x, fun, jac, hess, hessp,
|
||||
tol_rel_i=tol_rel_i,
|
||||
tol_rel_b=tol_rel_b,
|
||||
disp=disp)
|
||||
return subproblem_factory
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
from __future__ import division, print_function, absolute_import
|
||||
|
||||
def configuration(parent_package='', top_path=None):
|
||||
from numpy import get_include
|
||||
from scipy._build_utils.system_info import get_info, NotFoundError
|
||||
from numpy.distutils.misc_util import Configuration
|
||||
|
||||
from os.path import join, dirname
|
||||
|
||||
lapack_opt = get_info('lapack_opt')
|
||||
lib_inc = join(dirname(dirname(dirname(__file__))), '_lib')
|
||||
|
||||
config = Configuration('_trlib', parent_package, top_path)
|
||||
config.add_extension('_trlib',
|
||||
sources=['_trlib.c', 'trlib_krylov.c',
|
||||
'trlib_eigen_inverse.c', 'trlib_leftmost.c',
|
||||
'trlib_quadratic_zero.c', 'trlib_tri_factor.c'],
|
||||
include_dirs=[get_include(), lib_inc, 'trlib'],
|
||||
extra_info=lapack_opt,
|
||||
)
|
||||
return config
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from numpy.distutils.core import setup
|
||||
setup(**configuration(top_path='').todict())
|
||||
Reference in New Issue
Block a user