You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: subsamp_tr.m
    path of file: ./repos/SGDLibrary/sgd_solver
    
    the code of the file until where you have to start completion: function [w, infos] = subsamp_tr(problem, in_options)

% Trust Region Method 
% Authors: Jonas Kohler and Aurelien Lucchi, 2017

% Minimize a continous, unconstrained function using the Trust Region method.
% 
% References
% ----------
% Conn, A. R., Gould, N. I., & Toint, P. L. (2000). Trust region methods. Society for Industrial and Applied Mathematics.
% 
%
% Original Python code was created by J. M. Kohler and A. Lucchi (https://github.com/dalab/subsampled_cubic_regularization)

    
function [w, infos] = subsamp_tr(problem, in_options)

% Trust Region Method 
% Authors: Jonas Kohler and Aurelien Lucchi, 2017

% Minimize a continous, unconstrained function using the Trust Region method.
% 
% References
% ----------
% Conn, A. R., Gould, N. I., & Toint, P. L. (2000). Trust region methods. Society for Industrial and Applied Mathematics.
% 
%
% Original Python code was created by J. M. Kohler and A. Lucchi (https://github.com/dalab/subsampled_cubic_regularization)
%
%
% This file is part of SGDLibrary.
%
% Ported to MATLAB code by K.Yoshikawa and H.Kasai on March, 2018.
% Modified by H.Kasai on Apr. 17, 2018         


    % set dimensions and samples
    d = problem.dim();
    n = problem.samples();   
    
    %% set local options 
    local_options.sampling_scheme = 'exponential'; % 'linear', 'exponential'
    local_options.penalty_increase_multiplier = 2;  % multiply by..
    local_options.penalty_derease_multiplier = 2;  % divide by..
    local_options.initial_tr_radius = 1;
    local_options.successful_treshold = 0.1;
    local_options.very_successful_treshold = 0.9;
    local_options.grad_tol = 1e-9;
    local_options.max_trust_radius = 1e4;

    % sampling
    local_options.Hessian_sampling = 1;
    local_options.gradient_sampling = 0;
    local_options.initial_sample_size_Hessian = 0.025;
    local_options.initial_sample_size_gradient = 0.25;

    % subproblem
    local_options.subproblem_solver = 'GLTR'; 


    local_options.krylov_tol = 1e-1;
    local_options.exact_tol = 1e-2;
    
    % merge options
    options = mergeOptions(get_default_options(d), local_options);   
    options = mergeOptions(options, in_options); 
    
    if options.verbose > 1
        fprintf('- Subproblem_solver:%s\n', options.subproblem_solver)
        fprintf('- Hessian_sampling:%d\n', options.Hessian_sampling)
        fprintf('- Gradient_sampling:%d\n', options.gradient_sampling)
        fprintf('- Sampling_scheme:%s\n\n', options.sampling_scheme)
    end