-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a few methods of "ellipsoid" class in "GenEllipsoid" class #42
Comments
Do I understand right, methods inv and checkBigger existing in GenEllipsoid path - right, and I don't ave to implement these methods? |
Yes, inv doesn't have to be implemented since it already exists in GenEllipsoid. checkBigger does exist but not isbigger. You need to provide a wrapper implementation of isbigger so that it calls checkBigger internally. The whole idea is to make GenEllipsoid provide exactly the same methods as "ellipsoid" class (with the same names and format of input/output arguments). |
I can't find the ellipsoid.empty implementation, where is it? |
empty is a built-in static method, it is implemented for all classes including double, int32 etc. Its implementation is hidden. |
|
|
I had a look at the tests you added - this is definitely good as the first step but please
Apart from that the test looks good. |
nFields=numel(fieldNameList); Please verify what I write and say, do not just copy my code blindly. Anyways, tests fail not because of this problem - the reason they fail is because Q in SFieldNiceNames = struct('shapeMat', 'Q', 'centerVec', 'q'); is actually a square root of shapeMat. This is because when we compare matrices via structcompare we want to compare something that depends on precision linearly, not quadratically. The way to fix this is a) Introduce an additional output to toStruct function that returns a structure with a transformation function for each field, for ellipsoid it will be SFieldTransformFunc = struct('shapeMat', @(x)gras.la.sqrtmpos(x, absTol), 'centerVec', @(x)x); b) make isEqualInternal pass this structure into formCompStruct fTransfomr=SFieldTransformFunc.(fieldName); instead of just SComp.(SFieldNiceNames.(fieldName))=SEll.(fieldName); Also please rename Q in SFieldNiceNames = struct('shapeMat', 'Q', 'centerVec', 'q'); to "QSqrt" because Q is a square root of shapeMat. For GenEllipsoid QInf and Q should also be renamed and please use correct transformation functions in GenEllipsoid as well. Thus test tests do not pass because right now you compare shapeMat's, not sqrtm(shapeMat); |
|
|
absTol from isEqualInternal |
Ok.
In EllipsoidBasicSecondTC/testGetProjection lines Now it's failing, because dimVec contains zeros. function resArr=repMat(self,varargin) And test passed. |
Where did the new implementation of repMat come from? |
in 39) You said rename fromRepMatInternal to repMat. I looked at these two functions and decided they are similar. So I deleted old repMat and replaced it with fromRepMatInternal renamed to repMat. |
I'm not in front of a computer right now - will take a look later today or tomorrow. But presumably all we need to do is to allow zeros in sizeVec, in which case the result should be the same as built-in "empty" method returns. |
- isEqualInternal fixed - some methods in ellipsoid, which called repMat fixed - some tests fixed - repMat fixed
|
|
- projection method moved to AEllipsoid - test for projection method in GenEllipsoid added
Btw - looking at your changes right now.... |
just call [email protected](self) and that is it.
% sizeVec: double[1,n] - vector of size, have should look like % sizeVec: double[1,n] - vector of size, have i.e. lines that follow the line with a parameter name should have an additional leading tabulation. Also please avoid using "n" to denote sizes of input arguments, Compare % Case3: and % Case3: the latter example is much more readable.
Can you please fix all the problems above, merge to master and only then proceed with implementation of the rest of the methods? Thanks. |
- cosmetic and structured problems fixed - some small bugs fixed
49-51, 53-55, 58) Done. Can you please look at Jenkins - test of my branch didn't start after today's commits. |
|
qMat calculated in toStruct is actually a configuration matrix of E in G=E+L representation while qInfMat something like a configuration matrix of L. Both volume and trace for non-empty L should return If so I do not see why we should not use getShapeMat's impementation, we just need to override the implementation of tracer and volume from AEllipsoid class like this: volumeVal = [email protected](self); because in theory the only case when we get Nan is when L is not empty. But please make sure in the tests that you cannot get Nan for a degenerate ellipsoid for instance, we do not want volume return Inf volume for an empty-interior set. Same goes for trace method. |
Please note that it is better to merge to master a partial implementation than have an incomplete implementation not merged. |
Yes, sure. |
- tests for trace method added - TestPolarEllipsoid fixed - volume and trace methods of GenEllipsoid fixed - test for isdegenerate method added
I hope I did every item 49-58) Can you please have a look again to Jenkins, my branch didn't start to test. |
Done except for polar and hpintersect methods. These methods will be implemented as part of issue #46 |
Deadline: end of this semester
The goal of this task is to implement a few methods of "ellipsoid" class for "GenEllipsoid" class.
A generalized ellipsoid is a set that can be represented as sum E+L, where L - a subspace of R^n and E is some (may be degenerate) ellipsoid in
an orthogonal complement to L. A generalized ellipsoid doesn't have a configuration matrix in a common sense (by construction) but it does have
a) a basis in L and its complement.
b) a configuration matrix of E (ellipsoid in the orthogonal complement to L).
You will have to refer to the generalized ellipsoid class implementation (elltool.core.GenEllipsoid class)
and its tests in
for a better understanding of how this class works.
Once you gain a sufficient level of confidence in your understanding of GenEllipsoid class please
implement the following methods of ellipsoid class in GenEllipsoid class.
Method names, format of input and output arguments should not be changed.
isbigger
trace
shape
getShape
mtimes
parameters
plus
minus
polar
projection
fromRepMat
volume
maxeig
mineig
empty
trace
toStruct
hpintersect
All these methods should be covered with all kinds of tests that you need to put into
elltool.core.test.mlunit.GenEllipsoidSecTC class. The test coverage should
be very dense (different dimensions, all kinds of generalized ellipsoids, different combinations of
input parameters, both negative and positive tests).
The text was updated successfully, but these errors were encountered: