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 19 years ago

Last modified 18 years ago

#1 closed defect (fixed)

frecuency function looses a unit after second period.

Reported by: manuelb Owned by: Jorge
Priority: high Milestone:
Component: Math Version: 1.1.1
Severity: normal Keywords: TOL-Type TOL
Cc:

Description

The "frecuency" function does not have equal sizes. It looses a unit after the second period:

Matrix a = SetMat(Range(1, 100, 1)?);
Matrix b = Frequency(Tra(a), 10);

Change History (11)

comment:1 Changed 21 years ago by danirus

Status: newassigned

comment:2 Changed 21 years ago by danirus

Owner: changed from danirus to jsperez
Status: assignednew

There're more bugs waiting. Mathematicals errors are first assigned to Jorge.

comment:3 Changed 21 years ago by César Pérez Álvarez

Really the problem with this functions is that the upper limit is missing, and it seems
that Frecuency is leaving a unit in each interval.
The functions divides the interval (min, max) in m parts of size k = (max-min)/m
and then the functions only uses the intervals:
(min, min+k) --> Print min+k
(min+k, min+2k) --> Print min+2k
...
(min+(m-2)k, min+(m-1)k)--> Print min+(m-1)k
(min+(m-1)k, max)--> Is Missing

So, if you put an interval (min,max) that min+(m-1)k >= MaxMat(M) the problem
disapears.

comment:4 Changed 21 years ago by manuelb

Component: TOL FunctionsMatrix
Keywords: TOL-Type added; TOL removed
product: TOLTOL-Type

Reassign to the Tol-Type product.

comment:5 Changed 21 years ago by manuelb

Component: MatrixTYPE_Matrix
Keywords: Functions removed
product: TOL FunctionsTOL

Moved to the TOL product.

comment:6 Changed 21 years ago by Jorge

Status: newassigned

comment:7 Changed 21 years ago by Jorge

Owner: changed from jsperez to Jorge
Status: assignednew

Login changed

comment:8 Changed 21 years ago by Jorge

Owner: changed from jos1 to Jorge

new login

comment:9 Changed 21 years ago by Jorge

Status: newassigned

comment:10 Changed 19 years ago by Jorge

Resolution: fixed
Status: assignedclosed

See the results where all intervals have the same length = 9.9

Matrix a = SetMat(Range(1, 100, 1)?);
Matrix b = Frequency(Tra(a), 10, 1, 100);
Set lengths = For(1,10, Real (Real idx)
{If(idx==1,MatDat(b,1,1)-1,MatDat(b,idx,1)-MatDat(b,idx-1,1))});

comment:11 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_000001/
Note: See TracTickets for help on using tickets.