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