1function install_SJget
2%INSTALL_SJGET sets the MATLAB path to include a path to SJget
3% Sets the MATLAB path to include the interface to the SJSU Singular Matrix
4% Collection
5%
6% Example
7%   install_SJget
8%
9% See also gallery.
10
11% Copyright 2012, Leslie Foster and Timothy A Davis
12
13% This is the file spqr_rank/private/install_SJget.m.  The SJget toolbox
14% is in spqr_rank/SJget.
15
16if ( exist ('SJget', 'file') ~= 2)
17    here = mfilename ('fullpath') ;
18    k = strfind (here, 'private') ;
19    SJgetpath = [here(1:k-1) 'SJget'] ;
20    fprintf ('Adding SJget to your path:\n%s\n', SJgetpath) ;
21    addpath(SJgetpath)
22    disp (' ') ;
23    disp ('Saving the current MATLAB path so that access to matrices') ;
24    disp ('from the SJSU singular matrix collection is available when') ;
25    disp ('restarting MATLAB.') ;
26    lastwarn ('') ;
27    try
28        savepath    % comment out this line to avoid saving the path
29        err = lastwarn ;
30    catch me
31        err = me.message ;
32    end
33    if (~isempty (err))
34        fprintf ('error: %s\n', err) ;
35        fprintf ('unable to save path, see ''doc pathdef'' for more info\n') ;
36    end
37    disp (' ') ;
38    disp (' ') ;
39end
40
41