"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Libtmp/GIS/Proj/Proj.pd" between
PDL-2.077.tar.gz and PDL-2.078.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

Proj.pd  (PDL-2.077):Proj.pd  (PDL-2.078)
skipping to change at line 100 skipping to change at line 100
/* Loop over the values converting as we go */ /* Loop over the values converting as we go */
broadcastloop %{ broadcastloop %{
EOF EOF
my $code_foot = <<'EOF'; my $code_foot = <<'EOF';
%} %}
proj_destroy(proj); proj_destroy(proj);
EOF EOF
sub wrap_code { sub wrap_code {
my ($name, $in, $out, $is_fwd) = @_; my ($name, $in, $out, $is_fwd) = @_;
my $setup = <<EOF; my $body = <<EOF;
PDL_IF_BAD(
if ( @{[ join '||', map "\$ISBAD($in(n=>$_))", 0,1 ]} )
{
@{[ join "\n", map "\$SETBAD($out(n=>$_));", 0,1 ]}
}
else,)
{
in.uv.u = \$$in(n=>0) @{[$is_fwd ? ' * DEG_TO_RAD' : '']}; in.uv.u = \$$in(n=>0) @{[$is_fwd ? ' * DEG_TO_RAD' : '']};
in.uv.v = \$$in(n=>1) @{[$is_fwd ? ' * DEG_TO_RAD' : '']}; in.uv.v = \$$in(n=>1) @{[$is_fwd ? ' * DEG_TO_RAD' : '']};
out = proj_trans(proj, PJ_@{[$is_fwd ? 'FWD' : 'INV']}, in); out = proj_trans(proj, PJ_@{[$is_fwd ? 'FWD' : 'INV']}, in);
if (out.uv.u == HUGE_VAL) if (out.uv.u == HUGE_VAL)
{ {
EOF PDL_IF_BAD(
my $save = <<EOF; @{[ join "\n", map "\$SETBAD($out(n=>$_));", 0,1 ]}
,
\$CROAK("%s: Projection conversion failed at (%f, %f): %s\\n",
func, \$$in(n=>0), \$$in(n=>1), proj_errno_string(proj_errno(pro
j)));
)
} }
\$$out(n=>0) = out.uv.u@{[$is_fwd ? '' : ' * RAD_TO_DEG']}; \$$out(n=>0) = out.uv.u@{[$is_fwd ? '' : ' * RAD_TO_DEG']};
\$$out(n=>1) = out.uv.v@{[$is_fwd ? '' : ' * RAD_TO_DEG']}; \$$out(n=>1) = out.uv.v@{[$is_fwd ? '' : ' * RAD_TO_DEG']};
EOF
my $body = $setup.<<EOF.$save;
\$CROAK("%s: Projection conversion failed at (%f, %f): %s\\n",
func, \$$in(n=>0), \$$in(n=>1), proj_errno_string(proj_errno(pro
j)));
EOF
my $code = join '', qq{char* func = "$name()";},
$code_head,
$body,
$code_foot,
;
my $badbody = <<EOF;
if ( @{[ join '||', map "\$ISBAD($in(n=>$_))", 0,1 ]} )
{
@{[ join "\n", map "\$SETBAD($out(n=>$_));", 0,1 ]}
}
else
{
$setup@{[ join "\n", map "\$SETBAD($out(n=>$_));", 0,1 ]}$save
} }
EOF EOF
my $badcode = join '', qq{char* func = "$name\[BADCODE]()";}, my $code = join '', qq{char* func = "$name" PDL_IF_BAD("[BADCODE]",) "()";},
$code_head, $code_head,
$badbody, $body,
$code_foot, $code_foot,
; ;
(Code => $code, BadCode => $badcode, (Code => $code,
GenericTypes => ['D'], GenericTypes => ['D'],
OtherPars => 'char* params;', OtherPars => 'char* params;',
HandleBad => 1, HandleBad => 1,
Inplace => 1, Inplace => 1,
); );
} }
# #
# Forward transformation: # Forward transformation:
# #
 End of changes. 6 change blocks. 
25 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)