diagonal is a good case in point. When you do help diagonal in the
perldl shell you will be told that it is defined in Core.pm. This is in
Basic/Core/Core.pm in the PDL source tree. A lot of key functionality
is defined there. However the diagonal (and some other routines) are
defined as simple wrappers around a different function, namely
diagonalI. Here then comes the tricky part.. where is this.

Searching blindly will get you there (something like find . -name
'*.pd' -exec grep -i -H 'diagonalI' {}\;) but who wants to do that each
time. Anyway, first priority is to find a .pd file because these are
the ones that contain the PP definitions you want. And I find that
unless I want to do something hairy I tend to only need to look at two
files for core functionality: Basic/Primitive/primitive.pd and
Basic/Slices/slices.pd - these define many of the most basic functions
and are useful to browse to get some information.

That said, diagonalI is _not_ the function I'd start with if I were
you... In fact, it does sound like given your problem that what you
really want to do is to look at the routines in Image2D/image2d.pd and
ImageND/imagend.pd and get a feel for what you need from these.

Thanks, I did a bunch of fgreps for diagonal but never figured out
exactly where I was supposed to be looking before your comment.  Next
time, I'll use find.

I think the code I'm trying to write might actually be very simple,
something like
pp_def('line_project',
                Pars => 'a(l),float b(), [o]c(l,l);',
                Code => '    int x,y,i;
                                for (i=0;i<$SIZE(l);i++){
                                            y=i*sin(b); x=i*cos(b);
                       $c(x,y)=$a();
                                }'
                                )

probably ought to work, though I don't really know what happens when
you do something like "integer = integer * float" - I'm hoping I get
lucky and it just rounds off nicely =).  I don't know if sin and cos
work that easily.  There's also probably more to be added here
(setting other values to zero, perhaps), but this is a start.

However, I'm having trouble with the Makefile.  When I try to run it,
I get the following error:
Unable to determine UNINSTALLED directory path to PDL::Core::Dev module
but my path to Dev.pm is /usr/local/lib/perl/5.8.8/PDL/Core/Dev.pm .
Was there something I was supposed to do at install time to get this
working that I left out?

Thanks,
Adam

p.s. sorry about the subject of the last post - I'll be more careful
about replying to digests in the future.  I still can't switch out of
digest mode, though.

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to