Home > matpower7.1 > mips > lib > have_feature_pardiso_legacy.m

have_feature_pardiso_legacy

PURPOSE ^

HAVE_FEATURE_PARDISO_LEGACY Detect availability/version info for PARDISO (legacy interface)

SYNOPSIS ^

function [TorF, vstr, rdate] = have_feature_pardiso_legacy()

DESCRIPTION ^

HAVE_FEATURE_PARDISO_LEGACY  Detect availability/version info for PARDISO (legacy interface)

   Feature detection function implementing 'pardiso_legacy' tag for
   HAVE_FEATURE to detect support for the legacy (v5.x) PARDISO interface,
   with individual MEX files for factor, solve, etc.

   See also HAVE_FEATURE, HAVE_FEATURE_PARDISO, HAVE_FEATURE_PARDISO_OBJECT.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [TorF, vstr, rdate] = have_feature_pardiso_legacy()
0002 %HAVE_FEATURE_PARDISO_LEGACY  Detect availability/version info for PARDISO (legacy interface)
0003 %
0004 %   Feature detection function implementing 'pardiso_legacy' tag for
0005 %   HAVE_FEATURE to detect support for the legacy (v5.x) PARDISO interface,
0006 %   with individual MEX files for factor, solve, etc.
0007 %
0008 %   See also HAVE_FEATURE, HAVE_FEATURE_PARDISO, HAVE_FEATURE_PARDISO_OBJECT.
0009 
0010 %   MIPS
0011 %   Copyright (c) 2004-2020, Power Systems Engineering Research Center (PSERC)
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %
0014 %   This file is part of MIPS.
0015 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0016 %   See https://github.com/MATPOWER/mips for more info.
0017 
0018 TorF = exist('pardisoinit', 'file') == 3 && ...
0019         exist('pardisoreorder', 'file') == 3 && ...
0020         exist('pardisofactor', 'file') == 3 && ...
0021         exist('pardisosolve', 'file') == 3 && ...
0022         exist('pardisofree', 'file') == 3;
0023 rdate = '';
0024 if TorF
0025     vstr = '6.x+';
0026     try
0027         A = sparse([1 2; 3 4]);
0028         b = [1;1];
0029         info = pardisoinit(11, 0);
0030         info = pardisoreorder(A, info, false);
0031 %         % Summary PARDISO 5.1.0: ( reorder to reorder )
0032 %         pat = 'Summary PARDISO (\.*\d)+:';
0033 %         [s,e,tE,m,t] = regexp(evalc('info = pardisoreorder(A, info, true);'), pat);
0034 %         if ~isempty(t)
0035 %             vstr = t{1}{1};
0036 %         end
0037         info = pardisofactor(A, info, false);
0038         [x, info] = pardisosolve(A, b, info, false);
0039         pardisofree(info);
0040         if any(x ~= [-1; 1])
0041             TorF = 0;
0042         end
0043     catch
0044         TorF = 0;
0045     end
0046 else
0047     vstr = '';
0048 end

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005