Fix logic - we want real OR imaginary part of X to be nonzero here

This commit is contained in:
Martin Kroeker 2023-04-01 00:02:54 +02:00 committed by GitHub
parent d708951375
commit 36fcb52094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ int CNAME(BLASLONG m, FLOAT alpha_r, FLOAT alpha_i,
for (i = 0; i < m; i++){
#ifndef LOWER
if ((X[i * 2 + 0] != ZERO) && (X[i * 2 + 1] != ZERO)) {
if ((X[i * 2 + 0] != ZERO) || (X[i * 2 + 1] != ZERO)) {
AXPYU_K(i + 1, 0, 0,
alpha_r * X[i * 2 + 0] - alpha_i * X[i * 2 + 1],
alpha_i * X[i * 2 + 0] + alpha_r * X[i * 2 + 1],
@ -61,7 +61,7 @@ int CNAME(BLASLONG m, FLOAT alpha_r, FLOAT alpha_i,
}
a += (i + 1) * 2;
#else
if ((X[i * 2 + 0] != ZERO) && (X[i * 2 + 1] != ZERO)) {
if ((X[i * 2 + 0] != ZERO) || (X[i * 2 + 1] != ZERO)) {
AXPYU_K(m - i, 0, 0,
alpha_r * X[i * 2 + 0] - alpha_i * X[i * 2 + 1],
alpha_i * X[i * 2 + 0] + alpha_r * X[i * 2 + 1],