Skip to content

Commit

Permalink
XS inplace - #451
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Feb 17, 2024
1 parent 0129b99 commit a696aae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 0 additions & 10 deletions Basic/Core/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2587,16 +2587,6 @@ operate array element by array element like C<log10>).
pdl> p $x
[-inf 0 0.30103 0.47712125 0.60205999 0.69897 0.77815125 0.84509804 0.90308999 0.95424251]
=cut

# Flag pdl for in-place operations

sub PDL::inplace {
my $pdl = PDL->topdl(shift); $pdl->set_inplace(1); return $pdl;
}

# Copy if not inplace

=head2 is_inplace
=for ref
Expand Down
9 changes: 9 additions & 0 deletions Basic/Core/Core.xs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ topdl(klass, arg1, ...)
OUTPUT:
RETVAL

pdl *
inplace(self)
pdl *self
CODE:
self->state |= PDL_INPLACE;
RETVAL = self;
OUTPUT:
RETVAL

# Return the transformation object or an undef otherwise.
pdl_trans *
trans_parent(self)
Expand Down

0 comments on commit a696aae

Please sign in to comment.