naushad-rahman / ellipsoids

Automatically exported from code.google.com/p/ellipsoids
0 stars 0 forks source link

Implement tests of certain ellipsoid class methods, part3 #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following methods of @ellipsoid class need to be covered with the unit 
tests. If you discover any bugs - fix them.

% -----------------------------------
%  eq      - Checks if two ellipsoids are equal.
%  ne      - The opposite of 'eq'.
%  gt, ge  - E1 > E2 (E1 >= E2) checks if, given the same center ellipsoid E1
%            contains E2.
%  lt, le  - E1 < E2 (E1 <= E2) checks if, given the same center ellipsoid E2
%            contains E1.
%  mtimes  - Given matrix A in R^(mxn) and ellipsoid E in R^n, returns (A * E).
%  minkdiff_ea        - Computes the external ellipsoidal approximation of
%                       geometric difference of two ellipsoids in given 
direction.
%  minkdiff_ia        - Computes the internal ellipsoidal approximation of
%                       geometric difference of two ellipsoids in given 
direction.
%  minkpm_ea          - Computes the external ellipsoidal approximation of
%                       the geometric difference of a geometric sum of 
ellipsoids
%                       and a single ellipsoid in given direction.
%  minkpm_ia          - Computes the internal ellipsoidal approximation of
%                       the geometric difference of a geometric sum of 
ellipsoids
%                       and a single ellipsoid in given direction.

Original issue reported on code.google.com by heartofm...@gmail.com on 11 Oct 2012 at 7:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The tests should be implemented within
elltool.core.test.mlunit.EllipsoidTestCase class 
(elltool in r25 of trunk is located within 
[https://ellipsoids.googlecode.com/svn/trunk/products/+elltool]

run_tests function should be in elltool.core.test package. 

[https://ellipsoids.googlecode.com/svn/trunk/products/+elltool/+test/run_tests] 
function should call your function.

Please read [MLUNITEXT_unit_testing_framework_description], 
[Toolbox_installation_instructions], [Issues_workflow_and_branching_policy]
wiki pages before you start.

Original comment by heartofm...@gmail.com on 12 Oct 2012 at 9:10

GoogleCodeExporter commented 9 years ago
Work has begun

Original comment by N.Aushkap@gmail.com on 22 Oct 2012 at 12:26

GoogleCodeExporter commented 9 years ago
I have a question about gt, ge, lt, le.
These functions don't check the centers coincide or not. How the tests should 
react to it?

Original comment by N.Aushkap@gmail.com on 23 Oct 2012 at 8:39

GoogleCodeExporter commented 9 years ago
It is ok because all these functions are based on isbigger function

% ISBIGGER - checks if one ellipsoid would contain the other if their centers
%            would coincide.

please pay attention to "would coincide". 

In your tests just consider different combinations with both different centers 
and same centers. 

Original comment by heartofm...@gmail.com on 23 Oct 2012 at 2:28

GoogleCodeExporter commented 9 years ago
I've checked your example - if we consider Q_1=[4 0;0 1]; and Q_2=[1 0;0 1]; 
then internal approximation exists only for l=[0;1] and it is as empty 
ellipsoid, not a span as you told me. For other directions internal ellipsoid 
is degenerate (see Lemma 2.2.2 in "Ellipsoidal Calculus for Estimation and 
Control" by Kurzhanskiy A.B.

Original comment by heartofm...@gmail.com on 24 Oct 2012 at 10:46

GoogleCodeExporter commented 9 years ago
Please do the merge.

Original comment by heartofm...@gmail.com on 17 Nov 2012 at 9:05

GoogleCodeExporter commented 9 years ago
I mean merge, NOT REINTEGRATE!

Original comment by heartofm...@gmail.com on 17 Nov 2012 at 9:07

GoogleCodeExporter commented 9 years ago
You can reintegrate. Please follow the procedure described at 
http://code.google.com/p/ellipsoids/wiki/Issues_workflow_and_branching_policy. 

Be very careful.

Original comment by heartofm...@gmail.com on 19 Nov 2012 at 5:55

GoogleCodeExporter commented 9 years ago
I have problem with tests ( elltool.test.run_tests() ).
if I test just a trunk (without my changes), result is 3 failures.
After reintegrate, result is 2 failures.
For example failure (without my changes):

2133015 [main] INFO mlunit.logprintf  - FAIL: 
elltool.core.test.mlunit.EllipsoidIntUnionTC('testEllunionEa')

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - expectedValue <1>, but was <0>.

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - expectedValue <1>, but was <0>.
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\+mlu
nit\EllipsoidIntUnionTC.m at line 23
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\+mlu
nit\EllipsoidIntUnionTC.m at line 448
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_case.m 
at line 141
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunitext\test_case
.m at line 88
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_suite.m
 at line 251
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\text_test_ru
nner.m at line 73
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\run_
tests.m at line 11
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+test\run_tests.
m at line 5

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - Test case(s): 
elltool.core.test.mlunit.EllipsoidIntUnionTC/testContains
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEllintersectionIa
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEllunionEa
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEq
elltool.core.test.mlunit.EllipsoidIntUnionTC/testHpIntersection
elltool.core.test.mlunit.EllipsoidIntUnionTC/testIntersect
elltool.core.test.mlunit.EllipsoidIntUnionTC/testIsInternal
elltool.core.test.mlunit.EllipsoidIntUnionTC/testPolar
elltool.core.test.mlunit.EllipsoidTestCase/testDistance
elltool.core.test.mlunit.EllipsoidTestCase/testPropertyGetters
elltool.core.test.mlunit.HyperplaneTestCase/testContains
elltool.core.test.mlunit.HyperplaneTestCase/testDimensions
elltool.core.test.mlunit.HyperplaneTestCase/testDisplay
elltool.core.test.mlunit.HyperplaneTestCase/testEqAndNe
elltool.core.test.mlunit.HyperplaneTestCase/testGetAbsTol
elltool.core.test.mlunit.HyperplaneTestCase/testHyperplaneAndDouble
elltool.core.test.mlunit.HyperplaneTestCase/testIsEmpty
elltool.core.test.mlunit.HyperplaneTestCase/testIsParallel
elltool.core.test.mlunit.HyperplaneTestCase/testPlot
elltool.core.test.mlunit.HyperplaneTestCase/testUminus
elltool.core.test.mlunit.HyperplaneTestCase/testWrongInput,
 ran 21 test(s) in 59.695s(0.995m)

2133046 [main] INFO mlunit.logprintf  - FAILED (errors=0, failures=1)

Original comment by N.Aushkap@gmail.com on 19 Nov 2012 at 8:42

GoogleCodeExporter commented 9 years ago
Hold on with the reintegration.

Can you please specify all 3 failures in trunk? thanks.

Original comment by heartofm...@gmail.com on 19 Nov 2012 at 9:09

GoogleCodeExporter commented 9 years ago

Original comment by heartofm...@gmail.com on 19 Nov 2012 at 9:09

GoogleCodeExporter commented 9 years ago
I started the test of trunk (Revision: 436) six times. 
Always there was failures:
2133015 [main] INFO mlunit.logprintf  - FAIL: 
elltool.core.test.mlunit.EllipsoidIntUnionTC('testEllunionEa')

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - expectedValue <1>, but was <0>.

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - expectedValue <1>, but was <0>.
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\+mlu
nit\EllipsoidIntUnionTC.m at line 23
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\+mlu
nit\EllipsoidIntUnionTC.m at line 448
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_case.m 
at line 141
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunitext\test_case
.m at line 88
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_suite.m
 at line 251
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\text_test_ru
nner.m at line 73
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+core\+test\run_
tests.m at line 11
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+test\run_tests.
m at line 5

2133015 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2133015 [main] INFO mlunit.logprintf  - Test case(s): 
elltool.core.test.mlunit.EllipsoidIntUnionTC/testContains
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEllintersectionIa
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEllunionEa
elltool.core.test.mlunit.EllipsoidIntUnionTC/testEq
elltool.core.test.mlunit.EllipsoidIntUnionTC/testHpIntersection
elltool.core.test.mlunit.EllipsoidIntUnionTC/testIntersect
elltool.core.test.mlunit.EllipsoidIntUnionTC/testIsInternal
elltool.core.test.mlunit.EllipsoidIntUnionTC/testPolar
elltool.core.test.mlunit.EllipsoidTestCase/testDistance
elltool.core.test.mlunit.EllipsoidTestCase/testPropertyGetters
elltool.core.test.mlunit.HyperplaneTestCase/testContains
elltool.core.test.mlunit.HyperplaneTestCase/testDimensions
elltool.core.test.mlunit.HyperplaneTestCase/testDisplay
elltool.core.test.mlunit.HyperplaneTestCase/testEqAndNe
elltool.core.test.mlunit.HyperplaneTestCase/testGetAbsTol
elltool.core.test.mlunit.HyperplaneTestCase/testHyperplaneAndDouble
elltool.core.test.mlunit.HyperplaneTestCase/testIsEmpty
elltool.core.test.mlunit.HyperplaneTestCase/testIsParallel
elltool.core.test.mlunit.HyperplaneTestCase/testPlot
elltool.core.test.mlunit.HyperplaneTestCase/testUminus
elltool.core.test.mlunit.HyperplaneTestCase/testWrongInput,
 ran 21 test(s) in 59.695s(0.995m)

2133046 [main] INFO mlunit.logprintf  - FAILED (errors=0, failures=1)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%

There was a failure twice:

...Warning: test message 
> In throwwarn at 29
  In mlunit_test_common>mlunit_test_common.testThrowWarn/check at 24
  In mlunit_test_common>mlunit_test_common.testThrowWarn at 15
  In test_case>test_case.run at 141
  In test_case>test_case.run at 88
  In test_suite>test_suite.run at 251
  In auxdfeval at 223
  In auxdfeval at 12
  In test_suite>test_suite.run at 155
  In text_test_runner>text_test_runner.run at 73
  In run_tests at 10
  In run_public_tests at 5
  In lib_run_tests at 2
  In run_tests at 3 
Warning: test \ message C:\SomeFolder\sdf/sdf/sdfsdf 
> In throwwarn at 29
  In mlunit_test_common>mlunit_test_common.testThrowWarn/check at 24
  In mlunit_test_common>mlunit_test_common.testThrowWarn at 16
  In test_case>test_case.run at 141
  In test_case>test_case.run at 88
  In test_suite>test_suite.run at 251
  In auxdfeval at 223
  In auxdfeval at 12
  In test_suite>test_suite.run at 155
  In text_test_runner>text_test_runner.run at 73
  In run_tests at 10
  In run_public_tests at 5
  In lib_run_tests at 2
  In run_tests at 3 
..............F...................
2627360 [main] INFO mlunit.logprintf  - 
======================================================================

2627360 [main] INFO mlunit.logprintf  - FAIL: 
modgen.common.test.mlunit_test_common('test_ismemberjoint_performance')

2627360 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2627360 [main] INFO mlunit.logprintf  - Ratio error 0.276632 between chosen and 
mininal exceeds maximal one 0.250000
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\+modgen\+common\+test\mlunit_t
est_common.m at line 1423
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\+modgen\+common\+test\mlunit_t
est_common.m at line 1398
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_case.m 
at line 141
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunitext\test_case
.m at line 88
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\test_suite.m
 at line 251
in C:\Users\Николай\Desktop\PROIZV\trunk2\lib\+modgen\+pcalc\auxdfeval.m 
at line 223
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunitext\+pcalc\au
xdfeval.m at line 12
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunitext\test_suit
e.m at line 155
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\mlunitext\+mlunit\text_test_ru
nner.m at line 73
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\+modgen\+common\+test\run_test
s.m at line 10
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\lib\+modgen\+test\run_public_tests
.m at line 5
in C:\Users\Николай\Desktop\PROIZV\trunk2\lib\lib_run_tests.m at line 2
in 
C:\Users\Николай\Desktop\PROIZV\trunk2\products\+elltool\+test\run_tests.
m at line 3

2627360 [main] INFO mlunit.logprintf  - 
----------------------------------------------------------------------

2627370 [main] INFO mlunit.logprintf  - Test case(s): 
modgen.common.test.mlunit_test_common/testGenFileName
modgen.common.test.mlunit_test_common/testInd2SubMat
modgen.common.test.mlunit_test_common/testThrowError
modgen.common.test.mlunit_test_common/testThrowWarn
modgen.common.test.mlunit_test_common/test_auxchecksize
modgen.common.test.mlunit_test_common/test_cat
modgen.common.test.mlunit_test_common/test_cell2sepstr
modgen.common.test.mlunit_test_common/test_cellfunallelem
modgen.common.test.mlunit_test_common/test_error
modgen.common.test.mlunit_test_common/test_getcallernameext
modgen.common.test.mlunit_test_common/test_getfirstdimsize
modgen.common.test.mlunit_test_common/test_iscelllogical
modgen.common.test.mlunit_test_common/test_iscellnumeric
modgen.common.test.mlunit_test_common/test_ismembercellstr
modgen.common.test.mlunit_test_common/test_ismemberjoint
modgen.common.test.mlunit_test_common/test_ismemberjoint_empty
modgen.common.test.mlunit_test_common/test_ismemberjoint_enum
modgen.common.test.mlunit_test_common/test_ismemberjoint_performance
modgen.common.test.mlunit_test_common/test_ismemberjoint_simple
modgen.common.test.mlunit_test_common/test_ismemberjointwithnulls
modgen.common.test.mlunit_test_common/test_ismemberjointwithnulls_enum
modgen.common.test.mlunit_test_common/test_isunique
modgen.common.test.mlunit_test_common/test_isvec
modgen.common.test.mlunit_test_common/test_num2cell
modgen.common.test.mlunit_test_common/test_num2cell_empty
modgen.common.test.mlunit_test_common/test_parseparams
modgen.common.test.mlunit_test_common/test_parseparams_negative
modgen.common.test.mlunit_test_common/test_parseparext_obligprop
modgen.common.test.mlunit_test_common/test_parseparext_simple
modgen.common.test.mlunit_test_common/test_parseparext_touch
modgen.common.test.mlunit_test_common/test_subreffrontdim
modgen.common.test.mlunit_test_common/test_uniquejoint
modgen.common.test.mlunit_test_common/test_uniquejoint_empty
modgen.common.test.mlunit_test_common/test_uniquejoint_enum
modgen.common.test.mlunit_test_common/test_uniquejoint_ext
modgen.common.test.mlunit_test_common/test_uniquejoint_funchandle
modgen.common.test.mlunit_test_common/test_uniquejoint_performance,
 ran 37 test(s) in 66.589s(1.110m)

2627370 [main] INFO mlunit.logprintf  - FAILED (errors=0, failures=1)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Also There was only warning without failures twice.

I do not understand where the mistake.

Original comment by N.Aushkap@gmail.com on 20 Nov 2012 at 12:58

GoogleCodeExporter commented 9 years ago
A failure in 
modgen.common.test.mlunit_test_common('test_ismemberjoint_performance') is not 
a problem, I'll fix it.

You've said that there were failures in 
elltool.core.test.mlunit.EllipsoidIntUnionTC

Do you still have them?

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 1:12

GoogleCodeExporter commented 9 years ago
I checked again. Yes, I still have this failure.

Original comment by N.Aushkap@gmail.com on 20 Nov 2012 at 2:16

GoogleCodeExporter commented 9 years ago
Does a number of failed tests increase after reintegration?

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 2:42

GoogleCodeExporter commented 9 years ago
If the number of failed tests in your branch is the same - then you can 
reintegrate. Vadim will take care of 
elltool.core.test.mlunit.EllipsoidIntUnionTC('testEllunionEa') failure.

A fix for 
modgen.common.test.mlunit_test_common('test_ismemberjoint_performance') has 
just been committed to the trunk.

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 3:25

GoogleCodeExporter commented 9 years ago

Original comment by N.Aushkap@gmail.com on 20 Nov 2012 at 4:26

GoogleCodeExporter commented 9 years ago
You haven't answered my question... 

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 4:28

GoogleCodeExporter commented 9 years ago
The number of failed test is the same. I can do commit in the trunk or first 
commit all changes (trunk with my changes) in my branch?

Original comment by N.Aushkap@gmail.com on 20 Nov 2012 at 4:29

GoogleCodeExporter commented 9 years ago
If you have uncommitted changes - you need to commit them to the branch

if you haven't performed merge - you need to merge and commit into your branch.

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 4:33

GoogleCodeExporter commented 9 years ago
You can reintegrate.

Original comment by heartofm...@gmail.com on 20 Nov 2012 at 4:38

GoogleCodeExporter commented 9 years ago

Original comment by heartofm...@gmail.com on 21 Nov 2012 at 6:35