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: cod_qmult.m
    path of file: ./repos/SuiteSparse/MATLAB_Tools/Factorize
    
    the code of the file until where you have to start completion: function Y = cod_qmult (Q, X, method)
%COD_QMULT computes Q'*X, Q*X, X*Q', or X*Q with Q from COD_SPARSE.
% Q is a matrix or a struct representing the SPQR Householder form.  An
% additional column permutation matrix Q.Pc may be present in the Q struct.
%
% Usage: Y = cod_qmult (Q,X,method)
%
%   method = 0: Y = Q'*X    default if 3rd input argument is not present.
%   method = 1: Y = Q*X 
%   method = 2: Y = X*Q'
%   method = 3: Y = X*Q
%
% Example:
%
%   [U, R, V, r] = cod_sparse (A) ;
%   Y = cod_qmult (U, X, 0) ;                   % Y = U' * X
%   U = cod_qmult (U, speye (size (U.H,1)), 1)  % convert U to matrix form

    
function Y = cod_qmult (Q, X, method)
%COD_QMULT computes Q'*X, Q*X, X*Q', or X*Q with Q from COD_SPARSE.
% Q is a matrix or a struct representing the SPQR Householder form.  An
% additional column permutation matrix Q.Pc may be present in the Q struct.
%
% Usage: Y = cod_qmult (Q,X,method)
%
%   method = 0: Y = Q'*X    default if 3rd input argument is not present.
%   method = 1: Y = Q*X 
%   method = 2: Y = X*Q'
%   method = 3: Y = X*Q
%
% Example:
%
%   [U, R, V, r] = cod_sparse (A) ;
%   Y = cod_qmult (U, X, 0) ;                   % Y = U' * X
%   U = cod_qmult (U, speye (size (U.H,1)), 1)  % convert U to matrix form
%
% See also cod_sparse, spqr, spqr_qmult

% Factorize, Copyright (c) 2011-2012, Timothy A Davis. All Rights Reserved.
% SPDX-License-Identifier: BSD-3-clause

if (nargin < 3)
    method = 0 ;
end