Mercurial > repos > public > sbplib
comparison +grid/evalOnTest.m @ 707:0de70ec8bf60 feature/quantumTriangles
merge with feature/optim
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Fri, 10 Nov 2017 14:22:56 +0100 |
parents | 190941ec12d8 |
children |
comparison
equal
deleted
inserted
replaced
696:7c16b5af8d98 | 707:0de70ec8bf60 |
---|---|
29 % the number of dimensions of the grid. | 29 % the number of dimensions of the grid. |
30 function testNumberOfInputs(testCase) | 30 function testNumberOfInputs(testCase) |
31 cases = { | 31 cases = { |
32 {getTestGrid('1d'), @(x,y)x-y}, | 32 {getTestGrid('1d'), @(x,y)x-y}, |
33 {getTestGrid('2d'), @(x)x }, | 33 {getTestGrid('2d'), @(x)x }, |
34 } | 34 }; |
35 | 35 |
36 for i = 1:length(cases) | 36 for i = 1:length(cases) |
37 g = cases{i}{1}; | 37 g = cases{i}{1}; |
38 f = cases{i}{2}; | 38 f = cases{i}{2}; |
39 testCase.verifyError(@()grid.evalOn(g, f),'grid:evalOn:WrongNumberOfInputs',sprintf('in(%d) = %s',i,toString(f))); | 39 testCase.verifyError(@()grid.evalOn(g, f),'grid:evalOn:WrongNumberOfInputs',sprintf('in(%d) = %s',i,toString(f))); |
109 testCase.verifyEqual(gf, out); | 109 testCase.verifyEqual(gf, out); |
110 end | 110 end |
111 | 111 |
112 | 112 |
113 function testInputErrorVectorValued(testCase) | 113 function testInputErrorVectorValued(testCase) |
114 in = { | 114 in = { |
115 [1,2,3], | 115 [1,2,3], |
116 @(x,y)[x,-y]; | 116 @(x,y)[x,-y], |
117 }; | 117 }; |
118 | 118 |
119 g = getTestGrid('2d'); | 119 g = getTestGrid('2d'); |
120 | 120 |
121 for i = 1:length(in) | 121 for i = 1:length(in) |