Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cgo/clapack/clapack.go
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,8 @@ func Slacpy(ul blas.Uplo, m int, n int, a []float32, lda int, b []float32, ldb i
ul = 'U'
case blas.Lower:
ul = 'L'
case blas.All:
ul = 'A'
default:
panic("lapack: illegal triangle")
}
Expand All @@ -2930,6 +2932,8 @@ func Dlacpy(ul blas.Uplo, m int, n int, a []float64, lda int, b []float64, ldb i
ul = 'U'
case blas.Lower:
ul = 'L'
case blas.All:
ul = 'A'
default:
panic("lapack: illegal triangle")
}
Expand All @@ -2943,6 +2947,8 @@ func Clacpy(ul blas.Uplo, m int, n int, a []complex64, lda int, b []complex64, l
ul = 'U'
case blas.Lower:
ul = 'L'
case blas.All:
ul = 'A'
default:
panic("lapack: illegal triangle")
}
Expand All @@ -2956,6 +2962,8 @@ func Zlacpy(ul blas.Uplo, m int, n int, a []complex128, lda int, b []complex128,
ul = 'U'
case blas.Lower:
ul = 'L'
case blas.All:
ul = 'A'
default:
panic("lapack: illegal triangle")
}
Expand Down
24 changes: 23 additions & 1 deletion cgo/clapack/genLapack.pl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ package clapack
"double_return" => "float64"
);

# allUplo is a list of routines that allow 'A' for their uplo argument.
# The list keys are truncated by one character to cover all four numeric types.
our %allUplo = (
"lacpy" => undef
);

foreach my $line (@lines) {
process($line);
}
Expand Down Expand Up @@ -225,7 +231,22 @@ sub processParamToGo {
};
$var eq "uplo" && do {
$var = "ul";
my $bp = << "EOH";
my $bp;
if (exists $allUplo{substr($func, 1)}) {
$bp = << "EOH";
switch $var {
case blas.Upper:
$var = 'U'
case blas.Lower:
$var = 'L'
case blas.All:
$var = 'A'
default:
panic("lapack: illegal triangle")
}
EOH
} else {
$bp = << "EOH";
switch $var {
case blas.Upper:
$var = 'U'
Expand All @@ -235,6 +256,7 @@ sub processParamToGo {
panic("lapack: illegal triangle")
}
EOH
}
push @boilerplate, $bp;
push @processed, $var." blas.Uplo"; next;
};
Expand Down