[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #53179] Wrong result with bsxfun (single compl
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #53179] Wrong result with bsxfun (single complex argument) |
Date: |
Sun, 18 Feb 2018 20:08:19 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #2, bug #53179 (project octave):
This is almost certainly a bug in bsxfun.cc. The following is taken from
bsxfun.cc:
if (result_type == "double")
{
if (tmp(0).isreal ())
{
have_NDArray = true;
result_NDArray = tmp(0).array_value ();
result_NDArray.resize (dvc);
}
else
{
have_ComplexNDArray = true;
result_ComplexNDArray =
tmp(0).complex_array_value ();
result_ComplexNDArray.resize (dvc);
}
}
else if (result_type == "single")
{
if (tmp(0).isreal ())
{
have_FloatNDArray = true;
result_FloatNDArray
= tmp(0).float_array_value ();
result_FloatNDArray.resize (dvc);
}
else
{
have_ComplexNDArray = true;
result_ComplexNDArray =
tmp(0).complex_array_value ();
result_ComplexNDArray.resize (dvc);
}
Notice how when the result type is "single" and complex, a double complex
NDAarray is used. This may be a relatively simple fix.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?53179>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/