Opened 15 years ago

Closed 15 years ago

#361 closed enhancement (fixed)

Averager class does not support removal of data

Reported by: Jari Häkkinen Owned by: Jari Häkkinen
Priority: major Milestone: yat 0.5
Component: statistics Version: trunk
Keywords: Cc:

Description

The 'weight' for Averager::add is an unsigned long and there is no remove function. Either we need to change unsigned long to signed long or add a remove function.

Change History (11)

comment:1 Changed 15 years ago by Jari Häkkinen

Status: newassigned

comment:2 Changed 15 years ago by Peter

Ok, I think changing unsigned long to long is preferable. I think we can keep the member variable n_ unsigned.

We should also change AveragerPair? so it have the same interface.

comment:3 Changed 15 years ago by Jari Häkkinen

I have already fixed Averager (needed it urgently). I'll check in Averager and work on AveragerPair.

comment:4 Changed 15 years ago by Jari Häkkinen

changeset:1290: Averager accepts negative n for removal of data from the Averager.

comment:5 Changed 15 years ago by Jari Häkkinen

Resolution: fixed
Status: assignedclosed

changeset:1291: AveragerPair accepts negative n for removal of data.

comment:6 Changed 15 years ago by Jari Häkkinen

Milestone: yat 0.4.1yat 0.5
Priority: criticalmajor
Resolution: fixed
Status: closedreopened
Version: 0.4trunk

This change breaks rules for interface changes in a stable branch, moved to next minor release.

comment:7 Changed 15 years ago by Jari Häkkinen

changeset:1294 reverts 0.4-stable to state before changes related to this ticket.

comment:8 Changed 15 years ago by Jari Häkkinen

Resolution: fixed
Status: reopenedclosed

changest:1295 resolves this ticket.

comment:9 Changed 15 years ago by Peter

Resolution: fixed
Status: closedreopened

./averager_test -v results in

testing Averager
lt-averager_test: Averager.cc:54: void theplu::yat::statistics::Averager::add(double, long int): Assertion `n>-1' failed.
Aborted

comment:10 in reply to:  9 Changed 15 years ago by Jari Häkkinen

Replying to peter:

./averager_test -v results in

testing Averager
lt-averager_test: Averager.cc:54: void theplu::yat::statistics::Averager::add(double, long int): Assertion `n>-1' failed.
Aborted

I cannot reproduce this error. 'make check' works fine and so do './averager_test -v'. I am on a MacOSX Leopard with Intel processors ... reading the code I realize that the assert should react ... there is a test for n==-2 that is supposed to return true! Ah, I have no debug options to my compiler. Sorry about that, I'll rewrite the test.

comment:11 Changed 15 years ago by Jari Häkkinen

Resolution: fixed
Status: reopenedclosed

changeset:1297 resolves the assert() issue.

Note: See TracTickets for help on using tickets.