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: iqn.m
    path of file: ./repos/SGDLibrary/sgd_solver
    
    the code of the file until where you have to start completion: function [w, infos] = iqn(problem, in_options)
% Incremental quasi-Newton method algorithm (IQN).
%
% Inputs:
%       problem     function (cost/grad/hess)
%       in_options  options
% Output:
%       w           solution of w
%       infos       information
%
% References:

    
function [w, infos] = iqn(problem, in_options)
% Incremental quasi-Newton method algorithm (IQN).
%
% Inputs:
%       problem     function (cost/grad/hess)
%       in_options  options
% Output:
%       w           solution of w
%       infos       information
%
% References:
%       A. Mokhtari, M. Eisen, and A. Ribeiro, 
%       "An Incremental Quasi-Newton Method with a Local Superlinear Convergence Rate,"
%       ICASSP, 2017.
% 
% This file is part of SGDLibrary.
%
% Originally created by A. Mokhtari
% Modified by H.Kasai on Mar. 25, 2018


    % set dimensions and samples
    d = problem.dim();
    n = problem.samples();
    
    % set local options 
    local_options.step_init = 1;
    
    % merge options
    options = mergeOptions(get_default_options(d), local_options);   
    options = mergeOptions(options, in_options);     

    % initialize
    total_iter = 0;
    epoch = 0;
    grad_calc_count = 0;
    w = options.w_init; 
    step = options.step_init;
    
    %x_0 = zeros(d,1);
    %rng('default')
    %x = x_0+1*normrnd(0,1e-5,[d,1]); 
    x = randn(d,1);
  
    % store first infos
    clear infos;    
    [infos, f_val, optgap] = store_infos(problem, w, options, [], epoch, grad_calc_count, 0);
    
    
    % prepare arrays 
    t = zeros(d,n);
    y = zeros(d,n);    
    Q = zeros(d,d,n);
    
    % initialize arrays
    for i=1:n
        t(:,i) = x;
        y(:,i) = problem.grad(x,i);
        
        for j=1:d
            Q(j,j,i)=1;
        end