Skip to content
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

Comparison of ellipsoidal objects is done only based on relative precision, absolute precision is ignored #14

Closed
pgagarinov opened this issue Mar 5, 2015 · 82 comments

Comments

@pgagarinov
Copy link
Member

Deadline - 28th of October, by that time all changes and tests should be merged into "master" branch.

Comparison of ellipsoid objects doesn't take into account an absolute precision, see elltool.core.AGenEllipsoid.isEqualInternal:

Line 31: [~, tolerance] = ellFirstArr.getRelTol;

Line 60-62:

            [isEqualArr, reportStr] =...
                modgen.struct.structcomparevec(SEll1Array,...
                SEll2Array, tolerance);

This needs to be fixed by using absolute precision along with relative precision (modgen.struct.structcomparevec can actually accept both).

The first step should be writing the tests that "capture" this incorrect behavior. To do that study modgen.common.absrelcompare function and the way it works. The best ways to do that - study its code and the tests for the function (look at "testAbsRelCompare" test in modgen.common.test.mlunit.mlunit_test_common test case).

Once you understand the way absrelcompare works you can create tests by constructing ellipsoids with different precisions of calculation (this can be done via passing additional properties to "ellipsoid" constructor like this ellObj=ellipsoid(centVec,shapeMat,'absTol',1e-4,'relTol',1-3')) and calling isEqual to compare the constructed ellipsoid objects. The tests should be constructed in a such way that they would pass if the logic were correct.
The tests should be put into elltool.core.test.mlunit.EllipsoidTestCase. All the tests should fail.

After that you make the fix to isEqualInternal method and make sure that all the tests start to pass. If you change the tests to make them pass - roll back the change in isEqualInternal and make sure once again that they fail prior to the change. Thus the tests should all fail prior the change and should all pass after the change.

@pgagarinov pgagarinov assigned ghost Oct 15, 2015
@pgagarinov pgagarinov modified the milestone: Autumn-Winter 2015 Oct 15, 2015
@ghost
Copy link

ghost commented Nov 10, 2015

Hellow. I right understand, that I should write tests fo protected method elltool.core.AGenEllipsoid.isEqualInternal? Shoud I create new class heir in my test for access this metod?

@pgagarinov
Copy link
Member Author

No, isEqual calls isEqualinternal so you should write tests for isEqual. Just study the source code of ellipsoid.isEqual and everything will become clear.

@ghost
Copy link

ghost commented Nov 10, 2015

Good evening, I'm analyzed elltool.core.AGenEllipsoid.isEqualInternal, and understanded, that in this function variable tollerance = ell1Obj.RelTol, and than it pass in function absrelcompare like AbsTol, if I write test like this
cv1 = [0;0];
cv2 = [0;0];
Q1 = eye(2);
Q2 = eye(2);
Q2(1,1)=Q2(1,1)+1e-4;
absTol1=1e-3;
ell1Obj = ellipsoid(cv1,Q1,'absTol',absTol1);
ell2Obj = ellipsoid(cv2,Q2);
it answer that ellipsoid dosen't equal, (becase standart value (in constructor) relTol fo first ellipsoid = 1e-5). This is dosen't right. Should I write any others fail test? Es example the test which demonstrated the opposite situation or one test will be enougth? Because, I cant't understand what anothers test will be really usefull.

@ghost
Copy link

ghost commented Nov 10, 2015

Also i think it's better in function elltool.core.AGenEllipsoid.isEqualInternal selected absTol=min(ell1Obj.absTol,ell2Obj.absTol) and relTol = min(ell1Obj.relTol, ell2Obj.relTol). Because now the elementary property of symmetric (isEqual(ell1Obj,ell2Obj))=isEqual(ell2Obj,ell1Obj). dosen't. work The function work so wrong (in my opinion) that i can write a lot of fail tests but its won't be real usefull.

@pgagarinov
Copy link
Member Author

  1. The test you suggested is ok (apart from terribly wrong variable names). But I think we will need at least the following tests:
    a) The one that checks a comparison of ellipsoidal arrays created via ellipsoid.fromRepMat method. This test should check that isEqual for arrays works consistently with absTol and relTol specified in fromRepMat method.
    b) Same as a) but for arrays of ellipsoids consisting of elements with different values of absTol and relTol. You can create such arrays manually like this:

ell1=ellipsoid(..., precision 1)
ell2=ellipsoid(...., precision 2)
ellVec=[ell1,ell2]

or like this

ell1Vec=ellipsoid.fromRepMat( precision 1)
ell2Vec=ellipsoid.fromRepMat( precision 2)
ellMat=[ell1Vec;ell2Vec]

  1. The more tests you write - the better. The one checks that isEqual(ell1Obj,ell2Obj))=isEqual(ell2Obj,ell1Obj) is great, you should write it. Also please check a symmetry of isEqual for ellipsoidal arrays as well. In general what matters is not the number of tests but a total test coverage i.e. your tests should test as much code as possible with minimum overlapping between each other. For instance the test that usees

Q2(1,1)=Q2(1,1)+1e-4;
absTol1=1e-3;

doesn't check for symmetry of isEqual so you cannot skip the symmetry test, it should be there as well. Please think of other cases of incorrect behavior of isEqual and see if they all are covered by your tests. If not - you need to write more tests before fixing isEqual.

@ghost
Copy link

ghost commented Nov 12, 2015

Hellow, i have question about how should works isEqual an ideal, if we have two Vecs of Ells like this
Ell1Vec = [Ell11Obj(absTol11,relTol11); Ell12Obj(absTol12,relTol12)]
Ell2Vec = [Ell21Obj(absTol21,relTol21); Ell22Obj(absTol22,relTol22)]
when we call isEqual(Ell1Vec,Ell2Vec) we compare Ell11Obj with Ell21Obj and Ell12Obj with Ell22Obj, as result we have a ResVec dim (1,2); The quastion is follow: when we compare Ell11Obj with Ell12Obj we should use as absTol the min_{i=1,2,j=1,2}(absTol(i,j)) and relTol is the min_{i=1,2,j=1,2}(relTol(i,j)), i.e we have the same relTol and absTol for all pairs

or we should use as absTol1 the min_{i=1,2}(absTol(i)1) and relTol1 is the min_{i=1,2}(relTol(i)1) i.e. we have in common case we should use diffrent absTol and relTol for coporation the first pair and the second

@pgagarinov
Copy link
Member Author

absTol and relTol should be calculated for each pair separately i.e.

abs1Tol=min(abs11Tol,abs21Tol) - absolute tolerance for comparing Ell1Vec(1) and Ell2Vec(1)
abs2Tol=min(abs12Tol,abs22Tol) - absolute tolerance for comparing Ell1Vec(2) and Ell2Vec(2)

The same rule should be used for relative tolerance. Thus each pair is compared independently of other pairs.

Just in case - Ell1Vec is a bad name - see our naming convention.

@ghost
Copy link

ghost commented Dec 7, 2015

Hello, I decided restart my work. I did clone last master version and when i tried install toolbox there was one problem...

adding
[C:\ellipsoids\lib\jmodgen\FileUtils\bin\modgenfileutils.jar]
to C:\ellipsoids\install\javaclasspath.txt :done


Warning: files
[C:\ellipsoids\lib\jmodgen\FileUtils\bin\modgenfileutils.jar]
have been added to Java static class path,
files
[]
have been deleted from Java static class path,
<<<<------ PLEASE RESTART MATLAB ------->>>>

In modgen.common.throwwarn (line 26)
In modgen.java.AJavaStaticPathMgr/setUp (line 90)
In s_setjavapath (line 6)
In s_install (line 7)
Undefined variable "modgen" or class "modgen.io.FileUtils.isDirectory".

Error in modgen.io.isdir (line 16)
isPositive=modgen.io.FileUtils.isDirectory(dirName);

Error in modgen.system.ExistanceChecker.isDir (line 38)
isPositive=modgen.io.isdir(nameStr);

Error in modgen.containers.ondisk.AHashMap (line 97)
if ~ExistanceChecker.isDir(self.storageLocation)

Error in modgen.containers.ondisk.HashMapXMLMetaData (line 35)
self=self@modgen.containers.ondisk.AHashMap(regArgList{:},...

Error in modgen.configuration.ConfRepoManager (line 86)
storage=modgen.containers.ondisk.HashMapXMLMetaData(...

Error in modgen.configuration.AdaptiveConfRepoManager (line 59)
self=self@modgen.configuration.ConfRepoManager(...

Error in elltool.conf.ConfRepoMgr (line 17)
self=self@modgen.configuration.AdaptiveConfRepoManager(varargin{:});

Error in elltool.conf.Properties.init (line 47)
confRepoMgr=elltool.conf.ConfRepoMgr();

Error in ellipsoidsinit (line 7)
Properties.init();

Error in s_install (line 11)
ellipsoidsinit();

is it important?

@ghost
Copy link

ghost commented Dec 7, 2015

I'm restarted matlab. And all things are OK. Sorry, for last comment

@pgagarinov
Copy link
Member Author

This is a normal behavior - see installation instructions in Wiki. The reason you need to restart Matlab is to add jar (Java archives) to a static java path of Matlab.

@ghost
Copy link

ghost commented Dec 17, 2015

Hello. I already asked this question, but I want to clarify.
You sad, that, if we have two arrays of ellipsoids, where different ellipsoids has different value absTol and relTol, then "absTol and relTol should be calculated for each pair separately", but structcomparevec (also as in absrelcompare) suppose, that we have union absTol and relTol for comparing all array's ellements.

Should I change stucture of function and compare each pairs
separately?

Or should I select union absTol and relTol and compare arrays?

Now i write tests and want understand how isEqual should work.

@pgagarinov
Copy link
Member Author

Yes, you need to change isEqualInternal a little bit - you should use the first output arguments of getAbsTol and getRelTol methods i.e. arrays of absTol and relTol instead of second outputs that are scalar values of these properties (see help headers of getAbsTol and getRelTol for more details).

This way you will be able to use the tolerances as I described above in my comment on Nov 12.

@ghost
Copy link

ghost commented Dec 23, 2015

Hello, I updated to actual master. And, if I riqht understand, I shoud correct function isEqualInternal now.

I have an question about an function.

function SComp=formCompStruct(SEll,SFieldNiceNames,...
absTol,isPropIncluded) %#ok
if (~isempty(SEll.QMat))
SComp.(SFieldNiceNames.QMat)=SEll.QMat;
else
SComp.(SFieldNiceNames.QMat)=[];
end
SComp.(SFieldNiceNames.centerVec)=SEll.centerVec;
if (~isempty(SEll.QInfMat))
SComp.(SFieldNiceNames.QInfMat)=SEll.QInfMat;
else
SComp.(SFieldNiceNames.QInfMat)=[];
end
if (isPropIncluded)
SComp.(SFieldNiceNames.absTol)=SEll.absTol;
end
end

If I correct understand, now in function isEqualInternal it use for rename struct fields to NiceNames,
but

  1. for what this function requires argument absTol?
  2. why field relTol (it is in structure returned by toStruct, if isPropInclude==true (now it is false)) is descriminated, also as fields nPlot2dPoints , nPlot3dPoints?
  3. what this function shoud do really?

@pgagarinov
Copy link
Member Author

Please have a look at #42 (comment) - I expect Alexander to fix this problem tomorrow.

Anyways,

  1. absTol is not required

  2. same reason as absTol - if isPropIncluded =true then all properties should go to SComp, otherwise - only centerVec and shapeMat for ellipsoid class (and some others for hyperplane and GenEllipsoid 3) see 2 above.

@ghost
Copy link

ghost commented Dec 24, 2015

Last comment, I asked about method formCompStruct(), but I looked formCompStruct() in class GenEllipsoid, and in real formCompStruct() from class ellipsoid work. Sorry for my mistake. Nonetheless I have some questions about formCompStruct() from class ellipsoid.

methods (Static)
function SComp = formCompStruct(SEll, SFieldNiceNames, absTol, isPropIncluded)
if (~isempty(SEll.shapeMat))
SComp.(SFieldNiceNames.shapeMat) = gras.la.sqrtmpos(SEll.shapeMat, absTol);
else
SComp.(SFieldNiceNames.shapeMat) = [];
end
SComp.(SFieldNiceNames.centerVec) = SEll.centerVec;
if (isPropIncluded)
SComp.(SFieldNiceNames.absTol) = SEll.absTol;
SComp.(SFieldNiceNames.relTol) = SEll.relTol;
SComp.(SFieldNiceNames.nPlot2dPoints) = SEll.nPlot2dPoints;
SComp.(SFieldNiceNames.nPlot3dPoints) = SEll.nPlot3dPoints;
end
end
end

  1. Why is it so different from GenEllipsoid's method?
  2. For what we take sqrtm from ShapeMat?
    SComp.(SFieldNiceNames.shapeMat) = gras.la.sqrtmpos(SEll.shapeMat, absTol)?

Can I deleted commands
SEll1Array = arrayfun(@(SEll)ellFirstArr.formCompStruct(SEll,...
SFieldNiceNames, absTol, isPropIncluded), SEll1Array);
SEll2Array = arrayfun(@(SEll)ellSecArr.formCompStruct(SEll,...
SFieldNiceNames, absTol, isPropIncluded), SEll2Array);
because they work very strange, and write normal fail test for the rest of the code?

In real it doesn't matter how the structure's field are named for their comparations, becase in structcomparevec() the command fieldnames() is using.

@ghost
Copy link

ghost commented Dec 24, 2015

I of course can try to write adequat test for full code, that check diffence between absTol and relTol, but extract the matrix root from two ShapeMatrixs before compare them..., can I delete this command?

@pgagarinov
Copy link
Member Author

Can you please name all your questions with sequential numbers, not always 1,2 in each comment. Otherwise it is hard to refer to specific points in your comments. Anyways, please have a look at #42 (comment)

  1. you should not delete these lines, you should concentrate on the tests while Alexander fixes the implementation
  2. we need these lines for two reasons
    a) isEqual method returns two output arguments, the second is "reportStr" which is supposed to be human-readable. The idea is to have matrix "shapeMat" referred to in this report as "Q" because it is more familiar (actually it should be QSqrt because actually it is a square root of Q, not just Q
    c) we cannot just compare shapeMat because of the way we treat precision. Let us consider 2-dimensional ellipsoid in axes x and y and units of x and y are centimeters. Then If you want to represent this 2-dimensional ellipsoid as a matrix transformation of circle with radius=1 you use sqrt(Q), not Q because "units" of Q squared centimeters. Units of absTol are centimeters and we cannot compare something that is measured in squared centimeters with something that is just in centimiters. That is what we compare sqrt(Q_1)-sqrt(Q_2) (in centimiters) with absTol (also in centimiters).

Does it make sense?

@ghost
Copy link

ghost commented Dec 24, 2015

Yes, thank you.

@ghost
Copy link

ghost commented Dec 27, 2015

I added some fail tests
text_test_result with properties:

    textOutFid: 1
verbosityLevel: 1
 isDotDispMode: 1
    isAllShown: 0
        errors: {}
      failures: {'elltool.core.test.mlunit.EllipsoidTestCase/testIsEqual'  [1x2073 char]}
   should_stop: 0

+--------------------------------------------------------------------------------+
| << FAILED >> || TESTS: 197, FAILURES: 1, ERRORS: 0, RUN TIME(sec.): 1945.9 |
+--------------------------------------------------------------------------------+

And I hope they are right.

However the question of creartion some test for repMat method rest, because I don't understand what test should I do? Of corse all test that right for two ells, have analogues for repMat array, but I don't want copypaste. And more logical test, in my opinion, is cheking that: if smth right for ell1 and ell2, then the same right for repMat(ell1), repMat(ell2), but these test don't fail now.

Should I do any another test?

@ghost
Copy link

ghost commented Dec 28, 2015

Sorry, I forgot add issue number in my commit message. Is this very bad?

@pgagarinov
Copy link
Member Author

I will review your changes tomorrow, yes, it is not a good thing - if you can - please revert changes made in your branch and make a new commit with a corrected commit message, this is easy to do.

@ghost
Copy link

ghost commented Dec 29, 2015

I reverted changes and made new commit, but I'm not sure, that I did all right.

@pgagarinov
Copy link
Member Author

  1. You should always use an issue number preceded with # sign in your commit messages - see https://github.com/SystemAnalysisDpt-CMC-MSU/ellipsoids/wiki/Issue-workflow-policy-with-GIT for more details

Please revert your commit and make it again with a correct commit message this time.

  1. Please define constants like 1e-5, 1e-6 as separate constant variables (capital letters with underscores).

  2. Get rid of copy-pasting by placing repeating blocks of code into nested functions

  3. Always use a second output of isEqual like this:
    [isOk,reportStr]=a.isEqual(b)...
    mlunitext.assert(isOk,reportStr);

if such asset fails a content of reportStr is displayed making it possible to understand why the test failed.

  1. make sure you do not use assert on vectors or matrices like this

mlunitext.assert(all(aMat==bMat));

because all((aMat==bMat) returns a logical vector while assert expects a scalar. You should use all(aMat(:)==bMat(:))

  1. As for sufficiency of these tests - first of all you need to write tests that "prove" that absTol is not used. For that purpose you need to write tests that should pass if absTol were taken into account but fail in our case. Then, after fixing the bug in isEqualInternal you will make sure that these tests pass. I.e. tests should fail with the current (incorrect) implementation and should pass with the correct implementation (when absTol is not ignored).

  2. Please do rebase on latest changes in master.

@ghost
Copy link

ghost commented Dec 30, 2015

  1. Sorry, I'm not understand what you mean.
    Now, in function isEqualInternal the value absTol is really ignored, but it is replaced by value relTol taken by first ellipsoid
    [25] [~, tolVal] = ellFirstArr.getRelTol();
    [55-56] modgen.struct.structcomparevec(SEll1Array,...
    SEll2Array, tolVal); % the tolVal give to func like absTol
    If relTol doesn't set clearly then absTol replaced by default value relTol, as I understand. So now
    the ellipsoids are allways compared with absTol, but with wrong value absTol.

And I wrote one test that chek this situation.
testEll1 = ellipsoid([0;0],eye(2),'absTol',1e-6,'relTol',1e-4);
testEll2 = ellipsoid([1e-5;1e-5],eye(2),...
'absTol',1e-6,'reltol',1e-4);
mlunitext.assert(isEqual(testEll1,testEll2),false);

Also there is an test thet chek situation when ellipsoids aren't equal if we use only absTol but should be equal when we use two presision parametrs. The case when relTol is really important.

Can you clarify what another test should I add?

@ghost
Copy link

ghost commented Dec 30, 2015

  1. This is comment for my code or this is answer for my question:
    "However the question of creartion some test for repMat method rest, because I don't understand what test should I do? Of corse all test that right for two ells, have analogues for repMat array, but I don't want copypaste."

@ghost
Copy link

ghost commented Dec 30, 2015

  1. In any case, I don't understand what block are repeating.
    Because every test consists two logical part
    first : creation of ellipsoids % different for different test
    second: comparations % one command
    and mluninttextassert % different for different test

When I asked about copy past I mean logical copypast, i.e.
if test like
testEll1=ellipsoid();
testEll2 = ellipsoid()
is fail test, then test like
testEll1Mat = repMat(testEll1,sizeVec)
testEll2Mat = repMat(testEll2, sizeVec)
is fail test too. And I'm not sure that it is useful.

@pgagarinov
Copy link
Member Author

  1. Thanks for explanation, I believe that the tests you already have are just enough. Now is the time to fix the implementation (once you are done with 1-7 of course)

  2. Well, in your example
    testEll1=ellipsoid();
    testEll1Mat = repMat(testEll1,sizeVec)
    should be placed into a nested/sub function if you are going to use the same logic more than once.

Another example of copy-pasting is

        testEll1 = ellipsoid([0;0],eye(2),'absTol',1e-4,'relTol',1e-4);
        testEll2 = ellipsoid([0;0],eye(2),'absTol',1e-5,'relTol',1e-5);
        testEll3 = ellipsoid([0;0],eye(2),'absTol',1e-6,'relTol',1e-6);

the only difference between these 3 lines are values of absTol and relTol. If create a nested
function ellObj=create(absTol,relTol)
ellObj = ellipsoid([0;0],eye(2),'absTol',absTol,'relTol',relTol);
end

then the block above will be transformed into

testEll1=create(1e-4,1e-4);
testEll2=create(...
testEll3=create(...)

which is much more compact but not compact enough. Thus the text step would be creating one more nested function which will accept a list of absTol,relTol pairs and produce a vector of ellipsoid objects. I.e. testEll1, ... , testEll6 should be returned by this function as testEllVec.

  1. permsTestEllPairMat is a logical variable with incorrect name - please see our coding policy to figure out a correct name.

@pgagarinov
Copy link
Member Author

When I mentioned issue #44 I thought that you fixed all the tests. Since this is not the case you need to fully complete this task first and only then move to issue #44. Thanks.

ghost pushed a commit that referenced this issue Feb 17, 2016
Enhancement: Fixed IsEqualInternal.m
Enhancement: Replaced the code from run_param_test.m to run_tests.m and deleted run_param_test.m
ghost pushed a commit that referenced this issue Feb 17, 2016
BugFix: fixed run_tests (add runner)
@ghost
Copy link

ghost commented Feb 17, 2016

I corrected the function. But the code is still unstabel. There is 6 failures, but I don't know what was failed,because error_fail_list.txt is empty?

@pgagarinov
Copy link
Member Author

It is not empty, please be more attentive: https://groups.google.com/forum/#!topic/ellipsoids-tests-notification/ae6TiIeNmf8

@ghost
Copy link

ghost commented Feb 18, 2016

I looked the test that was failed. I'm afraid that all of them had been written, such way, that all of them passed with wrong isEqual. Because in all test the relTol are used, as the shift parametr). (Expcept may be testEllunionEa, I dont't really understand what's happend in this test yet)

@pgagarinov
Copy link
Member Author

Right. You need to figure out how these tests work and modify them so that they pass keeping in mind that now isEqual accounts for relTol as well.

@ghost
Copy link

ghost commented Feb 18, 2016

Ok
18 Фев 2016 г. 13:15 пользователь "Peter Gagarinov" <
notifications@github.com> написал:

Right. You need to figure out how these tests work and modify them so that
they pass keeping in mind that now isEqual accounts for relTol as well.


Reply to this email directly or view it on GitHub
#14 (comment)
.

ghost pushed a commit that referenced this issue Feb 18, 2016
BugFix: Fix IsEqual tests
@ghost
Copy link

ghost commented Feb 18, 2016

EllTbx_Win64_2015b » issue_14_IvanovaElena - Build # 12 - Fixed: I right understand, that all tests pass now?

@ghost
Copy link

ghost commented Feb 18, 2016

What should I do now?

@pgagarinov
Copy link
Member Author

  1. Please make getTol function

function tolVec=getTol(ellFirstArr,ellSecArr)
ellArr=[ellFirstArr(:);ellSecArr(:)];
[,tolVec(1)]=ellArr.getAbsTol();
[
,tolVec(2)]=ellArr.getRelTol();
end

return absTol and relTol separately instead of tolVec vector. All this is to make
our source code more readable.

  1. In hyp function you created please use more meaningful names based on our
    naming convention instead of just x and y:
function res = hyp(x,y,varargin)
    res = hyperplane(x,y(1),varargin{:});
end
  1. In the following code please also pass absTol and relTol as separate input arguments:

classdef PrameterizedTC < mlunitext.test_case
properties (Access=private)
fCreateObj;
end
methods (Access=private)
function objCVec = createObjCVec(self,centCVec,varargin)
matCVec=repmat(num2cell(eye(numel(centCVec{1})),...
[1,2]),1,numel(centCVec));
if numel(varargin)==0
fCrObVec = @(cent,mat,tol) self.fCreateObj(cent,mat);
objCVec=cellfun(fCrObVec,centCVec,matCVec,...
'UniformOutput',false);
else
fCrObVec = @(cent,mat,tol) self.fCreateObj(cent,mat,...
'absTol',tol(1),'relTol',tol(2));
objCVec=cellfun(fCrObVec,centCVec,matCVec,varargin{:},...
'UniformOutput',false);
end
end
end

Also, in the same code
objCVec=cellfun(fCrObVec,centCVec,matCVec,varargin{:},...
'UniformOutput',false);

should be outside of if else then because it will always work even when nargin(varargin)==0

  1. in
        tolCVec=num2cell([10*defTol,100*defTol,defTol;10*defTol,...
            100*defTol,defTol],1);

num2cell is not necessary, jus use {} like this {1,2;3,4}

Same goes for

        matCVec=repmat(num2cell(eye(numel(centCVec{1})),...
            [1,2]),1,numel(centCVec));
  1. In
    function set_up_param(self, varargin)
        import modgen.common.throwerror;
        nArgs = numel(varargin);
        if nArgs == 1
            self.fCreateObj=varargin{1};
        elseif nArgs > 1
            throwerror('wrongInput','Too many parameters');
        end
    end

insted of
nArgs = numel(varargin);
if nArgs == 1
please use

if nargin==2
....

  1. Please make all lines shorter than 74 by using "..."
  2. Logical variables should always have "is" or "has" prefix
  • see our coding convention
  1. In
            fCrObVec = @(cent,mat,tol) self.fCreateObj(cent,mat,...
                'absTol',tol(1),'relTol',tol(2));

cent,mat are incorrect names - where are suffices for matrices and vectors?
tol needs to be replaced with separate absTol and relTol inputs

  1. In HyperplaneTestCase removing checks for the output message is not a good idea,

all you need to do is to replace replace the expected messages with the correct ones

Same goes for all other places that contained checks for expected messages. You cannot
remove such checks, you can only replace the expected message with a correct one.

ghost pushed a commit that referenced this issue Feb 23, 2016
BugFix: Fix the tests for isEqual
BugFix: Fix the isEqualInternal
@ghost
Copy link

ghost commented Feb 24, 2016

I did 24)-32)

@pgagarinov
Copy link
Member Author

You can merge to master now, please follow these steps:

  1. Rebase against the latest master and wait for the test results
  2. Switch to master
  3. Merge -> from -> origin/remotes/your branch (using local branch can dangerous because it can contain unpushed changes)
  4. Important !!! Set "no fast forward flag". Press OK
  5. DO NOT PUSH JUST YET. Right click and open log. It should look like "petlya".
  6. If eveything is ok - press push.

While you wait for the test results you can start working on your next task: #44

ghost pushed a commit that referenced this issue Feb 24, 2016
Enchachment: some fail tests for isEqual
ghost pushed a commit that referenced this issue Feb 24, 2016
Enhancement: fix the tests for isEqual
ghost pushed a commit that referenced this issue Feb 24, 2016
BugFix: fix the bad names in tests for isEqual
BugFix: fix the copypast problem in tests for isEqual
ghost pushed a commit that referenced this issue Feb 24, 2016
Enhancement: Add paramtrisated tests for isEqual
ghost pushed a commit that referenced this issue Feb 24, 2016
BugFix: deleted not actual tests from EllipsoidTC
BugFix: fix the tests runner
ghost pushed a commit that referenced this issue Feb 24, 2016
Enhancement: Fixed IsEqualInternal.m
Enhancement: Replaced the code from run_param_test.m to run_tests.m and deleted run_param_test.m
ghost pushed a commit that referenced this issue Feb 24, 2016
BugFix: fixed run_tests (add runner)
ghost pushed a commit that referenced this issue Feb 24, 2016
BugFix: Fix IsEqual tests
ghost pushed a commit that referenced this issue Feb 24, 2016
BugFix: Fix the tests for isEqual
BugFix: Fix the isEqualInternal
@ghost
Copy link

ghost commented Feb 24, 2016

Sorry, I have a probllem with merge?

git.exe merge --no-ff remotes/origin/issue_14_IvanovaElena

error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@ABasicEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+elltool/+core/@AEllipsoid': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachplain/+probdef/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachplain/+probdef/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachplain/+probdyn/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachplain/+probdyn/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachuncert/+probdef/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachuncert/+probdyn/+test/+mlunit': Permission denied
error: cannot stat 'products/+gras/+ellapx/+lreachuncert/+probdyn/+test/+mlunit': Permission denied

git did not exit cleanly (exit code 128) (375 ms @ 24.02.2016 23:42:55)

@pgagarinov
Copy link
Member Author

I think this is because you didn't close matlab or some other app is blocking those files.

Please reboot your pc just in case. Then switch/checkout to origin/master with checkbox "recreate branch if exisits". This will create a fresh copy of local master. Then switch to this local restored master and run merge again.

@ghost
Copy link

ghost commented Feb 24, 2016

thanks, but there is another question. I look test results in test group
image

and build #15 Failure in the same time build #17 Succseful, but the message about build #15 is upper than build #17? Test are fail or no?

@pgagarinov
Copy link
Member Author

You should always look at the latest build, no matter when you receive emails. You tests have passed.

@TYXDG
Copy link

TYXDG commented Sep 13, 2021

Hello! Sorry to bother you. I use Matlab 2018a. Please allow me to explain my installation process to you first. When I installed ET-2.1 in MATLAB 2018a, start_matlab2015b_win64 did not work; So I run s_install.m and the result is as follows:
-------------------elltool.deploy.JavaStaticPathMgr-------------------
adding
[D:\Software\Research_Software\ellipsoids-2.1\lib\jmodgen\FileUtils\bin\modgenfileutils.jar]
to D:\Software\Research_Software\ellipsoids-2.1\install\javaclasspath.txt :done

Warning: files
[D:\Software\Research_Software\ellipsoids-2.1\lib\jmodgen\FileUtils\bin\modgenfileutils.jar]
have been added to Java static class path,
files
[]
have been deleted from Java static class path,
<<<<------ PLEASE RESTART MATLAB ------->>>>

In modgen.common.throwwarn (line 26)
In modgen.java.AJavaStaticPathMgr/setUp (line 90)
In s_setjavapath (line 6)
In s_install (line 7)
Undefined variable "modgen" or class "modgen.io.FileUtils.isDirectory".
Error in modgen.io.isdir (line 16)
isPositive=modgen.io.FileUtils.isDirectory(dirName);
Error in modgen.system.ExistanceChecker.isDir (line 38)
isPositive=modgen.io.isdir(nameStr);
Error in modgen.containers.ondisk.AHashMap (line 97)
if ~ExistanceChecker.isDir(self.storageLocation)
Error in modgen.containers.ondisk.HashMapXMLMetaData (line 35)
self=self@modgen.containers.ondisk.AHashMap(regArgList{:},...
Error in modgen.configuration.ConfRepoManager (line 86)
storage=modgen.containers.ondisk.HashMapXMLMetaData(...
Error in modgen.configuration.AdaptiveConfRepoManager (line 59)
self=self@modgen.configuration.ConfRepoManager(...
Error in elltool.conf.ConfRepoMgr (line 17)
self=self@modgen.configuration.AdaptiveConfRepoManager(varargin{:});
Error in elltool.conf.Properties.init (line 47)
confRepoMgr=elltool.conf.ConfRepoMgr();
Error in ellipsoidsinit (line 7)
Properties.init();
Error in s_install (line 11)
ellipsoidsinit();
……………………………………………………………………
I closed MATLAB, re-opened it, and ran s_install.m again, there is a new problem:
…………………………………………………….
files
[]
are in current static path but not
in D:\Software\Research_Software\ellipsoids-2.1\install\javaclasspath.txt while files
[D:\Software\Research_Software\ellipsoids-2.1\lib\jmodgen\FileUtils\bin\modgenfileutils.jar]
are in D:\Software\Research_Software\ellipsoids-2.1\install\javaclasspath.txt but not in
current static path.
It can be that C:\Users\DG\AppData\Roaming\MathWorks\MATLAB\R2018a\javaclasspath.txt file contains the same entries
as D:\Software\Research_Software\ellipsoids-2.1\install\javaclasspath.txt.
If that is the case please remove those entries and restart Matlab!
…………………………………………………………………………………………………….
Then I deleted D:\Software\Research_Software\ellipsoids-2.1\install\javaclasspath.txt. Close MATLAB, re-open it, and run s_install.m again. The same results appear as in the beginning. Now I have no idea about this. I would be very grateful if you could give me some advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants