Hi Karl,
Maybe if we had a test for threaded fitpoly1d we would have caught this 4.5
years ago!
Looks like the problem is with the change from PDL::Slatec::matinv to
PDL::MatrixOps::inv [8adb0b]
<http://sourceforge.net/p/pdl/code/ci/8adb0b9e6e88ded9153563509794ed253d4f50e1/>.
Running your example through the debugger I get:
DB<34> p inv($C)
[
[ 0.168 -0.064]
[ -0.32 0.16]
]
DB<35> p matinv($C)
[
[
[ 0.6 -0.4]
[-0.4 0.4]
]
[
[ 0.6 -0.4]
[-0.4 0.4]
]
]
Wolfram Alpha suggests that matinv is correct. When running your
single-dimension example through, inv and matinv return identical results.
My guess is PDL::MatrixOps::inv is not threadable. It certainly isn't
advertised as such in the docs, though other subs in MatrixOps are advertised
as such.
cheers,
Derek
> On Mar 4, 2015, at 12:59 AM, Karl Glazebrook <karlglazebr...@mac.com> wrote:
>
> fitpoly1d() no longer seems to thread over extra dimensions:
>
> pdl> $x = pdl( [101,103,104,102,109] )
>
> pdl> p $x
> [101 103 104 102 109]
> pdl> ($xf, $c) = fitpoly1d($x, 2)
>
> pdl> p $xf
> [100.8 102.3 103.8 105.3 106.8]
> pdl>
> pdl> $x = pdl( [101,103,104,102,109],[101,103,104,102,109] )
>
> pdl> p $x
>
> [
> [101 103 104 102 109]
> [101 103 104 102 109]
> ]
>
> pdl> ($xf, $c) = fitpoly1d($x, 2)
>
> pdl> p $xf # WTF?!
>
> [
> [ 53.496 12.576 -28.344 -69.264 -110.184]
> [ 53.496 12.576 -28.344 -69.264 -110.184]
> ]
>
>
> I took a look at the Polynomial.pm and could no longer figure it out! I swear
> it used to work - anyone have any ideas?
>
> Karl
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now.
> http://goparallel.sourceforge.net/_______________________________________________
> pdl-devel mailing list
> pdl-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pdl-devel
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel