-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqpBoxFcnTest.m
36 lines (29 loc) · 908 Bytes
/
qpBoxFcnTest.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
classdef qpBoxFcnTest < qpBox
%An example for a constant QP problem
properties(Nontunable)
N = 10;
end
methods
function obj = qpBoxFcnTest(varargin)
setProperties(obj,nargin,varargin{:});
end
function H = hCalc(obj,a,~)
H = a * eye(obj.N) -diag(ones(obj.N-1,1),1) -diag(ones(obj.N-1,1),-1);
end
function f = fCalc(obj,a,b)
f = b*sin(a*(1:obj.N)');
end
end
methods (Access=protected)
function num = getNumInputsImpl(~)
num = 2;
end
function validatePropertiesImpl(obj)
superValidate(obj) %must be called to set up qpBox
%now add things specific to this instance
if obj.N ~= 10
disp('warning: demo won''t work')
end
end
end
end