0001 function display(om)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if om.var.NS
0019 fprintf('\n%-17s %12s %8s %8s %8s\n', 'VARIABLES', 'name', 'i1', 'iN', 'N');
0020 fprintf('%-17s %12s %8s %8s %8s\n', '=========', '------', '-----', '-----', '------');
0021 idx = om.var.idx;
0022 for k = 1:om.var.NS
0023 name = om.var.order(k).name;
0024 if isempty(om.var.order(k).idx)
0025 fprintf('%10d:%19s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0026 else
0027 vsidx = om.var.order(k).idx;
0028 str = '%d'; for m = 2:length(vsidx), str = [str ',%d']; end
0029 s = substruct('.', name, '()', vsidx);
0030 nname = sprintf(['%s(' str, ')'], name, vsidx{:});
0031 fprintf('%10d:%19s %8d %8d %8d\n', k, nname, ...
0032 subsref(idx.i1, s), subsref(idx.iN, s), subsref(idx.N, s));
0033 end
0034 end
0035 fprintf('%10d = var.NS%29d = var.N\n', om.var.NS, om.var.N);
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 fprintf('\n');
0057 else
0058 fprintf('%s : <none>\n', 'VARIABLES');
0059 end
0060 if om.nln.NS
0061 fprintf('\n%-17s %12s %8s %8s %8s\n', 'NON-LINEAR CONSTRAINTS', 'name', 'i1', 'iN', 'N');
0062 fprintf('%-17s %12s %8s %8s %8s\n', '======================', '------', '-----', '-----', '------');
0063 idx = om.nln.idx;
0064 for k = 1:om.nln.NS
0065 name = om.nln.order(k).name;
0066 fprintf('%15d:%12s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0067 end
0068 fprintf('%10d = nln.NS%29d = nln.N\n', om.nln.NS, om.nln.N);
0069 fprintf('\n');
0070 else
0071 fprintf('%s : <none>\n', 'NON-LINEAR CONSTRAINTS');
0072 end
0073 if om.lin.NS
0074 fprintf('\n%-17s %12s %8s %8s %8s\n', 'LINEAR CONSTRAINTS', 'name', 'i1', 'iN', 'N');
0075 fprintf('%-17s %12s %8s %8s %8s\n', '==================', '------', '-----', '-----', '------');
0076 idx = om.lin.idx;
0077 for k = 1:om.lin.NS
0078 name = om.lin.order(k).name;
0079 if isempty(om.lin.order(k).idx)
0080 fprintf('%10d:%19s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0081 else
0082 vsidx = om.lin.order(k).idx;
0083 str = '%d'; for m = 2:length(vsidx), str = [str ',%d']; end
0084 s = substruct('.', name, '()', vsidx);
0085 nname = sprintf(['%s(' str, ')'], name, vsidx{:});
0086 fprintf('%10d:%19s %8d %8d %8d\n', k, nname, ...
0087 subsref(idx.i1, s), subsref(idx.iN, s), subsref(idx.N, s));
0088 end
0089 end
0090 fprintf('%10d = lin.NS%29d = lin.N\n', om.lin.NS, om.lin.N);
0091 fprintf('\n');
0092 else
0093 fprintf('%s : <none>\n', 'LINEAR CONSTRAINTS');
0094 end
0095 if om.cost.NS
0096 fprintf('\n%-17s %12s %8s %8s %8s\n', 'COSTS', 'name', 'i1', 'iN', 'N');
0097 fprintf('%-17s %12s %8s %8s %8s\n', '=====', '------', '-----', '-----', '------');
0098 idx = om.cost.idx;
0099 for k = 1:om.cost.NS
0100 name = om.cost.order(k).name;
0101 if isempty(om.cost.order(k).idx)
0102 fprintf('%10d:%19s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0103 else
0104 vsidx = om.cost.order(k).idx;
0105 str = '%d'; for m = 2:length(vsidx), str = [str ',%d']; end
0106 s = substruct('.', name, '()', vsidx);
0107 nname = sprintf(['%s(' str, ')'], name, vsidx{:});
0108 fprintf('%10d:%19s %8d %8d %8d\n', k, nname, ...
0109 subsref(idx.i1, s), subsref(idx.iN, s), subsref(idx.N, s));
0110 end
0111 end
0112 fprintf('%10d = cost.NS%28d = cost.N\n', om.cost.NS, om.cost.N);
0113 fprintf('\n');
0114 else
0115 fprintf('%s : <none>\n', 'COSTS');
0116 end
0117
0118 fprintf(' userdata = ');
0119 if ~isempty(fieldnames(om.userdata))
0120 fprintf('\n');
0121 end
0122 if have_fcn('octave')
0123 fprintf(' <scalar struct>\n');
0124 else
0125 display(om.userdata);
0126 end