-
Notifications
You must be signed in to change notification settings - Fork 1
/
Result.m
140 lines (127 loc) · 4.09 KB
/
Result.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
classdef Result
%RESULT Summary of this class goes here
% Detailed explanation goes here
properties
% function data
name
dim
lb
ub
fbst
xbst
smooth
convex
unimodal
% algorithm data
alg
x0
maxFunEvals
% results
fval
x
funEvals
time
flag_time
flag_fevals
fval_trace
end
methods
function obj = Result(name,dim,lb,ub,fbst,xbst,smooth,convex,unimodal,...
alg,x0,maxFunEvals,...
fval,x,funEvals,time,flag_time,flag_fevals,fval_trace)
obj.name = name;
obj.dim = dim;
obj.lb = lb;
obj.ub = ub;
obj.fbst = fbst;
obj.xbst = xbst;
obj.smooth = smooth;
obj.convex = convex;
obj.unimodal = unimodal;
obj.alg = alg;
obj.x0 = x0;
obj.maxFunEvals = maxFunEvals;
obj.fval = fval;
obj.x = x;
obj.funEvals = funEvals;
obj.time = time;
obj.flag_time = flag_time;
obj.flag_fevals = flag_fevals;
obj.fval_trace = fval_trace;
end
function printTiny(obj)
fprintf('%12s \t|\t %d\t|\t %12s \t|\t %d \t|\t %d \t|\t %.15f\n',obj.name,obj.dim,obj.alg,obj.funEvals,obj.time,obj.fval);
end
end
methods (Static)
function tab = cell_to_table( cell_results )
nResults = length(cell_results);
name = cell(nResults,1);
dim = cell(nResults,1);
lb = cell(nResults,1);
ub = cell(nResults,1);
fbst = cell(nResults,1);
xbst = cell(nResults,1);
smooth = cell(nResults,1);
unimodal = cell(nResults,1);
alg = cell(nResults,1);
x0 = cell(nResults,1);
tolX = cell(nResults,1);
tolFun = cell(nResults,1);
maxIter = cell(nResults,1);
maxFunEvals = cell(nResults,1);
fval = cell(nResults,1);
x = cell(nResults,1);
iter = cell(nResults,1);
funEvals = cell(nResults,1);
time = cell(nResults,1);
exitflag = cell(nResults,1);
comment = cell(nResults,1);
for j=1:nResults
name{j} = cell_results{j}.name;
dim{j} = cell_results{j}.dim;
lb{j} = cell_results{j}.lb;
ub{j} = cell_results{j}.ub;
fbst{j} = cell_results{j}.fbst;
xbst{j} = cell_results{j}.xbst;
smooth{j} = cell_results{j}.smooth;
unimodal{j} = cell_results{j}.unimodal;
alg{j} = cell_results{j}.alg;
x0{j} = cell_results{j}.x0;
tolX{j} = cell_results{j}.tolX;
tolFun{j} = cell_results{j}.tolFun;
maxIter{j} = cell_results{j}.maxIter;
maxFunEvals{j} = cell_results{j}.maxFunEvals;
fval{j} = cell_results{j}.fval;
x{j} = cell_results{j}.x;
iter{j} = cell_results{j}.iter;
funEvals{j} = cell_results{j}.funEvals;
time{j} = cell_results{j}.time;
exitflag{j} = cell_results{j}.exitflag;
comment{j} = cell_results{j}.comment;
end
tab = table(...
name,...
dim,...
lb,...
ub,...
fbst,...
xbst,...
smooth,...
unimodal,...
alg,...
x0,...
tolX,...
tolFun,...
maxIter,...
maxFunEvals,...
fval,...
x,...
iter,...
funEvals,...
time,...
exitflag,...
comment);
end
end
end