Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Statistics::Burst

Status
Not open for further replies.

MacTommy

Programmer
Feb 26, 2007
116
NL
Hi all,

I just downloaded and installed the Statistics::Burst package without any problem.
When I run a test script that is just like the code in the example I get an error, saying:

Can't take log of 0 at blib\lib\Statistics\Burst.pm (autosplit into blib\lib\auto\Statistics\Burst\transistion.al) line 228.

So my question is: does anybody have experience with this module?
Or does anybody have any clue as to why I would get this error..?!?

Just for completeness sake, here is the listing of test script . It runs fine, until the process() call...

Thanks!

Code:
use strict;

use Statistics::Burst;

my $burstObj=Statistics::Burst::new();

$burstObj->generateStates(3,.111,2);

$burstObj->gamma(.5);

my @gap_space = (4,5,10);
$burstObj->setData(\@gap_space);

$burstObj->process();

my $statesUsed=$burstObj->getStatesUsed();
 
I still haven't got the tiniest clue as to what could the problem.
And I am totally out of ideas...
[sadeyes]

Could someone maybe try it and see if this is always the case.
If it is, we're no further really, but if it isn't then it might have something to do with my configuration or something...
 
I'm unable to install it. The remote testing machine I'm on only is perl 5.8.0. This module apparantly requires 5.8.4 for some reason.

I'll look into trying it again once I get into work.

- Miller
 
That's great. Thanks for trying!

I'm using Perl 5.8.7 by the way, on a Windows machine...
 
the error is generated by the log() function in perl:

print log(0);

you can email the author


seems the module has only been tested on linux.



------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Yes, I can see that the log() function is causing the error.
What is bugging me is why the module would cause such an error, while I am only trying to execute the code provided in the documentation.
I also tried messing with all the parameters, but it just seems that whatever you do, it tries to take the log of 0. And I somehow have the feeling that this shouldn't be the case...
 
Oh, and I did send the author a mail, but it bounced...
:-(
 
there are a lot of junk/outdated modules on CPAN. That module is poorly tested and obviously not be supported by the author. I see you posted on the CPAN forum. Don't hold you breath waiting for a response. [wink]

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Just in case anyone who is interested stumbles on this thread somewhere in the future...
I just found out that the code doesn't give the error with a longer array.

So this does works on my system (not sure yet if what the module does is actually correct, but at least it doesn't crash...):
Code:
$burstObj->setData([9,9,10,10,14,5,2,2,2,2,7,5]);

but cutting of, e.g, the last '5' will result in the aforementioned error...
 
OK, one last thing, for completeness sake, and then I am going to stop with this bl**dy module...

The example above features an input array with 12 elements.
If you provide a shorter array, the module crashes.
And also, if you provide a longer array, the elements after the first 12 will be neglected.

In other words, the module can only handle 12 intervals.
No more. No less.
 
I wonder if this has something to do with that:

Code:
sub process
{
	my ($self)=@_;
	my $result={};
	$self->calcCost(11);
}

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top