Rout.pm (PDL-2.077) | : | Rout.pm (PDL-2.078) | ||
---|---|---|---|---|
skipping to change at line 58 | skipping to change at line 58 | |||
Combine x, y and z to a single ndarray the first dimension | Combine x, y and z to a single ndarray the first dimension | |||
of which is 3. This routine does dataflow automatically. | of which is 3. This routine does dataflow automatically. | |||
=for bad | =for bad | |||
combcoords does not process bad values. | combcoords does not process bad values. | |||
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 79 "Rout.pm" | #line 78 "Rout.pm" | |||
#line 1060 "../../../blib/lib/PDL/PP.pm" | #line 1060 "../../../blib/lib/PDL/PP.pm" | |||
*combcoords = \&PDL::combcoords; | *combcoords = \&PDL::combcoords; | |||
#line 86 "Rout.pm" | #line 85 "Rout.pm" | |||
#line 1058 "../../../blib/lib/PDL/PP.pm" | #line 1058 "../../../blib/lib/PDL/PP.pm" | |||
=head2 repulse | =head2 repulse | |||
=for sig | =for sig | |||
Signature: (coords(nc,np); | Signature: (coords(nc,np); | |||
[o]vecs(nc,np); | [o]vecs(nc,np); | |||
int [t]links(np);; | int [t]links(np);; | |||
skipping to change at line 97 | skipping to change at line 97 | |||
a repulsive force that vanishes at infinity for many | a repulsive force that vanishes at infinity for many | |||
objects. For use by the module L<PDL::Graphics::TriD::MathGraph>. | objects. For use by the module L<PDL::Graphics::TriD::MathGraph>. | |||
For definition of the potential, see the actual function. | For definition of the potential, see the actual function. | |||
=for bad | =for bad | |||
repulse does not process bad values. | repulse does not process bad values. | |||
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 128 "Rout.pm" | #line 126 "Rout.pm" | |||
#line 1060 "../../../blib/lib/PDL/PP.pm" | #line 1060 "../../../blib/lib/PDL/PP.pm" | |||
*repulse = \&PDL::repulse; | *repulse = \&PDL::repulse; | |||
#line 135 "Rout.pm" | #line 133 "Rout.pm" | |||
#line 1058 "../../../blib/lib/PDL/PP.pm" | #line 1058 "../../../blib/lib/PDL/PP.pm" | |||
=head2 attract | =head2 attract | |||
=for sig | =for sig | |||
Signature: (coords(nc,np); | Signature: (coords(nc,np); | |||
int from(nl); | int from(nl); | |||
int to(nl); | int to(nl); | |||
skipping to change at line 136 | skipping to change at line 136 | |||
like molecular bonds). | like molecular bonds). | |||
For use by the module L<PDL::Graphics::TriD::MathGraph>. | For use by the module L<PDL::Graphics::TriD::MathGraph>. | |||
For definition of the potential, see the actual function. | For definition of the potential, see the actual function. | |||
=for bad | =for bad | |||
attract does not process bad values. | attract does not process bad values. | |||
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 177 "Rout.pm" | #line 174 "Rout.pm" | |||
#line 1060 "../../../blib/lib/PDL/PP.pm" | #line 1060 "../../../blib/lib/PDL/PP.pm" | |||
*attract = \&PDL::attract; | *attract = \&PDL::attract; | |||
#line 184 "Rout.pm" | #line 181 "Rout.pm" | |||
#line 1058 "../../../blib/lib/PDL/PP.pm" | #line 1058 "../../../blib/lib/PDL/PP.pm" | |||
=head2 vrmlcoordsvert | =head2 vrmlcoordsvert | |||
=for sig | =for sig | |||
Signature: (vertices(n=3); char* space; PerlIO *fp) | Signature: (vertices(n=3); char* space; PerlIO *fp) | |||
=for ref | =for ref | |||
info not available | info not available | |||
=for bad | =for bad | |||
vrmlcoordsvert does not process bad values. | vrmlcoordsvert does not process bad values. | |||
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | |||
=cut | =cut | |||
#line 211 "Rout.pm" | #line 208 "Rout.pm" | |||
#line 1060 "../../../blib/lib/PDL/PP.pm" | #line 1060 "../../../blib/lib/PDL/PP.pm" | |||
*vrmlcoordsvert = \&PDL::vrmlcoordsvert; | *vrmlcoordsvert = \&PDL::vrmlcoordsvert; | |||
#line 218 "Rout.pm" | #line 215 "Rout.pm" | |||
#line 227 "rout.pd" | #line 214 "rout.pd" | |||
=head2 contour_segments | =head2 contour_segments | |||
=for ref | =for ref | |||
This is the interface for the pp routine contour_segments_internal | This is the interface for the pp routine contour_segments_internal | |||
- it takes 3 ndarrays as input | - it takes 3 ndarrays as input | |||
C<$c> is a contour value (or a list of contour values) | C<$c> is a contour value (or a list of contour values) | |||
skipping to change at line 207 | skipping to change at line 207 | |||
right y-segment and finally across to the next x-segment. Once we find one in a | right y-segment and finally across to the next x-segment. Once we find one in a | |||
box (two on a point) we can quit because there can only be one. After we are do ne | box (two on a point) we can quit because there can only be one. After we are do ne | |||
with a given x-segment, we look to the leftover possibilities for the adjoining y-segment. | with a given x-segment, we look to the leftover possibilities for the adjoining y-segment. | |||
Thus the contours are built as a collection of line segments rather than a set o f closed | Thus the contours are built as a collection of line segments rather than a set o f closed | |||
polygons. | polygons. | |||
=back | =back | |||
=cut | =cut | |||
use strict; | ||||
sub PDL::Graphics::TriD::Contours::contour_segments { | sub PDL::Graphics::TriD::Contours::contour_segments { | |||
my($this,$c,$data,$points) = @_; | my($this,$c,$data,$points) = @_; | |||
# pre compute space for output of pp routine | # pre compute space for output of pp routine | |||
my $segdim = ($data->getdim(0)-1)*($data->getdim(1)-1)*4; | my $segdim = ($data->getdim(0)-1)*($data->getdim(1)-1)*4; | |||
# print "segdim = $segdim\n"; | ||||
my $segs = zeroes(3,$segdim,$c->nelem); | my $segs = zeroes(3,$segdim,$c->nelem); | |||
my $cnt = zeroes($c->nelem); | my $cnt = zeroes($c->nelem); | |||
contour_segments_internal($c,$data,$points,$segs,$cnt); | contour_segments_internal($c,$data,$points,$segs,$cnt); | |||
# print "contour segments done ",$points->info,"\n"; | ||||
$this->{Points} = pdl->null; | $this->{Points} = pdl->null; | |||
my $pcnt=0; | my $pcnt=0; | |||
my $ncnt; | my $ncnt; | |||
for(my $i=0; $i<$c->nelem; $i++){ | for(my $i=0; $i<$c->nelem; $i++){ | |||
$ncnt = $cnt->slice("($i)"); | $ncnt = $cnt->slice("($i)"); | |||
next if($ncnt==-1); | next if($ncnt==-1); | |||
$pcnt = $pcnt+$ncnt; | $pcnt = $pcnt+$ncnt; | |||
$this->{ContourSegCnt}[$i] = $pcnt; | $this->{ContourSegCnt}[$i] = $pcnt; | |||
$pcnt=$pcnt+1; | $pcnt=$pcnt+1; | |||
$this->{Points} = $this->{Points}->append($segs->slice(":,0:$ncnt ,($i)")->transpose); | $this->{Points} = $this->{Points}->append($segs->slice(":,0:$ncnt ,($i)")->transpose); | |||
} | } | |||
$this->{Points} = $this->{Points}->transpose; | $this->{Points} = $this->{Points}->transpose; | |||
} | } | |||
#line 292 "Rout.pm" | #line 280 "Rout.pm" | |||
#line 1060 "../../../blib/lib/PDL/PP.pm" | #line 1060 "../../../blib/lib/PDL/PP.pm" | |||
*contour_segments_internal = \&PDL::contour_segments_internal; | *contour_segments_internal = \&PDL::contour_segments_internal; | |||
#line 299 "Rout.pm" | #line 287 "Rout.pm" | |||
#line 469 "rout.pd" | #line 436 "rout.pd" | |||
=head1 AUTHOR | =head1 AUTHOR | |||
Copyright (C) 2000 James P. Edwards | Copyright (C) 2000 James P. Edwards | |||
Copyright (C) 1997 Tuomas J. Lukka. | Copyright (C) 1997 Tuomas J. Lukka. | |||
All rights reserved. There is no warranty. You are allowed | All rights reserved. There is no warranty. You are allowed | |||
to redistribute this software / documentation under certain | to redistribute this software / documentation under certain | |||
conditions. For details, see the file COPYING in the PDL | conditions. For details, see the file COPYING in the PDL | |||
distribution. If this file is separated from the PDL distribution, | distribution. If this file is separated from the PDL distribution, | |||
the copyright notice should be included in the file. | the copyright notice should be included in the file. | |||
=cut | =cut | |||
#line 319 "Rout.pm" | #line 307 "Rout.pm" | |||
# Exit with OK status | # Exit with OK status | |||
1; | 1; | |||
End of changes. 20 change blocks. | ||||
22 lines changed or deleted | 13 lines changed or added |