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