close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 21 years ago

Closed 21 years ago

Last modified 18 years ago

#44 closed defect (fixed)

SubCol does not return the correct columns.

Reported by: asalafranca Owned by: danirus
Priority: high Milestone:
Component: Math Version: head
Severity: major Keywords:
Cc:

Description

When I run this peace of code very strange things happend.

Matrix k = ((1,2,3),(1,2,3),(1,2,3));
Set s = SetOfReal(4.02,4.03);
Matrix m = SetCol(s);
Matrix f = Floor(m);
Matrix d = m - f;
Matrix p = RProd(d, 100);
Set s2 = MatSet(p);
Set s3 = BinGroup("<<", s2);
Matrix r = SubCol(k,s3);
WriteLn ("Set s2 = \n"<<s2);
WriteLn ("Matrix r = \n"<<r);
Matrix r2 = SubCol(k, SetOfReal(2, 3));
WriteLn ("Matrix r2 = \n"<<r2);

If I ask about any of the auxliary variables Tol answers correctly, but it has
problems with the SubCol function. It sometimes throws
"
Warning: Intento de acceso no válido de la función SubCol(k,[[ 2.000000,
3.000000 ]] )
", and gives out the wrong columns. Try changing the initial values in the "Set s",
it is a lot of fun.

Change History (3)

comment:1 Changed 21 years ago by danirus

Status: newassigned

comment:2 Changed 21 years ago by danirus

Resolution: fixed
Status: assignedclosed

A solution for this problem has been deployed in Tol CVS.

The problem was a conversion to get column number in SubCol function. SubCol get
1.9999999999999574 as the first column, and after an Integer conversion it turns to 1.

The solution apply Round method of BDat class to get the correct column value.

comment:3 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000044
Note: See TracTickets for help on using tickets.