-
Notifications
You must be signed in to change notification settings - Fork 1
/
mpoption_info_yalmip.m
51 lines (49 loc) · 1.79 KB
/
mpoption_info_yalmip.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function opt = mpoption_info_yalmip(selector)
%MPOPTION_INFO_YALMIP Returns MATPOWER option info for YALMIP.
%
% DEFAULT_OPTS = MPOPTION_INFO_YALMIP('D')
% VALID_OPTS = MPOPTION_INFO_YALMIP('V')
% EXCEPTIONS = MPOPTION_INFO_YALMIP('E')
%
% Returns a structure for YALMIP options for MATPOWER containing ...
% (1) default options,
% (2) valid options, or
% (3) NESTED_STRUCT_COPY exceptions for setting options
% ... depending on the value of the input argument.
%
% This function is used by MPOPTION to set default options, check validity
% of option names or modify option setting/copying behavior for this
% subset of optional MATPOWER options.
%
% See also MPOPTION.
% MATPOWER
% Copyright (c) 2014-2019, Power Systems Engineering Research Center (PSERC)
% by Ray Zimmerman, PSERC Cornell
%
% This file is part of MATPOWER/mx-sdp_pf.
% Covered by the 3-clause BSD License (see LICENSE file for details).
% See https://github.com/MATPOWER/mx-sdp_pf/ for more info.
if nargin < 1
selector = 'D';
end
if have_feature('yalmip')
switch upper(selector)
case {'D', 'V'} %% default and valid options
opt = struct(...
'yalmip', struct(...
'opts', [], ...
'opt_fname', '' ...
) ...
);
case 'E' %% exceptions used by nested_struct_copy() for applying
opt = struct(...
'name', { 'yalmip.opts' }, ...
'check', 0 ...
);
% 'copy_mode', { @yalmip_options } ...
otherwise
error('mpoption_info_yalmip: ''%s'' is not a valid input argument', selector);
end
else
opt = struct([]); %% YALMIP is not available
end