Skip to content

Commit 932e1dc

Browse files
committed
Avoid duplicate args in cgtsv
1 parent da86c7c commit 932e1dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Photonic/Utils.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ sub vectors2Dlist { #2D vector fields ready for gnuploting
351351
sub cgtsv {
352352
confess "Wrong number of arguments" unless @_ == 4;
353353
my ($c, $d, $e, $b) = map $_->new_or_inplace, @_;
354+
$e=$e->copy if $e->address==$c->address; # Avoid duplicate arguments, as they are modified below
354355
my $i = PDL::LinearAlgebra::Complex::cgtsv($c, $d, $e, $b);
355356
confess "Error solving tridiag system: info=$i" if $i->any;
356357
$b;

0 commit comments

Comments
 (0)