Mercurial > repos > public > sbplib
comparison +scheme/Beam.m @ 1046:19ed046aec52 feature/getBoundaryOp
Clean up getBoundaryOps for a few schemes
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Jan 2019 17:37:07 +0100 |
parents | dc1bcbef2a86 |
children | 0c504a21432d |
comparison
equal
deleted
inserted
replaced
1045:dc1bcbef2a86 | 1046:19ed046aec52 |
---|---|
247 | 247 |
248 % Returns the boundary operator op for the boundary specified by the string boundary. | 248 % Returns the boundary operator op for the boundary specified by the string boundary. |
249 % op -- string | 249 % op -- string |
250 % boundary -- string | 250 % boundary -- string |
251 function o = getBoundaryOperator(obj, op, boundary) | 251 function o = getBoundaryOperator(obj, op, boundary) |
252 assertIsMember(op, {'e', 'd1', 'd2', 'd3'}) | |
252 assertIsMember(boundary, {'l', 'r'}) | 253 assertIsMember(boundary, {'l', 'r'}) |
253 | 254 |
254 switch op | 255 o = obj.([op, '_', boundary]); |
255 case 'e' | |
256 switch boundary | |
257 case 'l' | |
258 e = obj.e_l; | |
259 case 'r' | |
260 e = obj.e_r; | |
261 end | |
262 o = e; | |
263 | |
264 case 'd1' | |
265 switch boundary | |
266 case 'l' | |
267 d1 = obj.d1_l; | |
268 case 'r' | |
269 d1 = obj.d1_r; | |
270 end | |
271 o = d1; | |
272 end | |
273 | |
274 case 'd2' | |
275 switch boundary | |
276 case 'l' | |
277 d2 = obj.d2_l; | |
278 case 'r' | |
279 d2 = obj.d2_r; | |
280 end | |
281 o = d2; | |
282 end | |
283 | |
284 case 'd3' | |
285 switch boundary | |
286 case 'l' | |
287 d3 = obj.d3_l; | |
288 case 'r' | |
289 d3 = obj.d3_r; | |
290 end | |
291 o = d3; | |
292 end | |
293 end | 256 end |
294 | 257 |
295 % Returns the boundary sign. The right boundary is considered the positive boundary | 258 % Returns the boundary sign. The right boundary is considered the positive boundary |
296 % boundary -- string | 259 % boundary -- string |
297 function s = getBoundarySign(obj, boundary) | 260 function s = getBoundarySign(obj, boundary) |