Mercurial > repos > public > sbplib
annotate isAnyOf.m @ 1037:2d7ba44340d0 feature/burgers1d
Pass scheme specific parameters as cell array. This will enabale constructDiffOps to be more general. In addition, allow for schemes returning function handles as diffOps, which is currently how non-linear schemes such as Burgers1d are implemented.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 18 Jan 2019 09:02:02 +0100 |
parents | 75f9b7a80f28 |
children |
rev | line source |
---|---|
583
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
1 % Returns true of obj is any of he types in the cell array types |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
2 % b = isAnyOf(obj, types) |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
3 function b = isAnyOf(obj, types) |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
4 for i = 1:length(types) |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
5 if isa(obj, types{i}); |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
6 b = true; |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
7 return |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
8 end |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
9 end |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
10 b = false; |
75f9b7a80f28
Allow more than one type in type assertion
Jonatan Werpers <jonatan@werpers.com>
parents:
diff
changeset
|
11 end |