Subject: | Can't call method "flat" on unblessed reference |
Date: | Mon, 26 Oct 2015 12:16:58 +0300 |
To: | bug-PDL-Fit-Levmar [...] rt.cpan.org |
From: | Phil Oleynik <phirippu [...] gmail.com> |
Dear Mr. Lapeyre
I try to start up with Levmar using a basic example and get the error
Can't call method "flat" on unblessed reference at
/usr/local/lib/x86_64-linux-gnu/perl/5.20.2/PDL/Fit/Levmar.pm line 1550.
My intention is to use the UB and LB constraints. The code is (this is an
example code supplied with the library except for FIXB, UB and LB
definitions) :
use PDL::LiteF;
use PDL::Fit::Levmar;
use PDL::NiceSlice;
$n = 100;
$t = 10 * (sequence($n)/$n -1/2);
$x = 3 * exp(-$t*$t * .3 );
$p = pdl [ 1, 0.35 ]; # initial parameter guesses
$h = levmar($p,$x,$t, FIXB=> [0,1], UB=> [1,0.33], LB =>[1,0.31], FUNC =>
' function
x = p0 * exp( -t*t * p1);
');
print levmar_report($h);
offending line is the first one, the second should call the same error I
suppose.
$h->{UB}->flat->index($fi) .= $p->flat->index($fi);
$h->{LB}->flat->index($fi) .= $p->flat->index($fi);
May I ask you to fix the problem?
Sincerely, Philipp