You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In raw_to_polyvector with sign symmetry, I think that line 41 does a matrix multiplication that fails an assertion in Debug due to incompatible dimensions and leads to some undefined behavior in a Release build.
I think the line can be changed to something like actualRoots = actualRoots.array().square() to calculate the element-wise square of the roots (if I understand the logic correctly...).
Thanks in advance for looking into it,
Aviv
The text was updated successfully, but these errors were encountered:
I think that there might also be an issue with the calculation of the polyvector coefficients later in this function:
I think that the "root polynomials" should be initialized to -actualRoots.col(i) (since they correspond to (z - u_i)) instead of actualRoots.col(i) in lines 52 & 54.
I think the code for multiplying polynomials doesn't consider the biggets power of the polynomials (which is omitted from the representation since the coefficients is always 1).
I think adding something like:
for (int i =0; i < p1.cols(); i++) {
newp.col(i + p2.cols()) += p1.col(i);
}
for (int i =0; i < p2.cols(); i++) {
newp.col(i + p1.cols()) += p2.col(i);
}
Yep both comments are true, thanks. It currently doesn't reproduce a polyvector_to_raw(raw_to_polyvector()) test.
Honestly, I don't think this function is actually being used within Directional tutorial. I think I translated it from another project, but I see the code there is very different from this one, so I might have stopped before finishing the entire work. It also doesn't have the new Directional class wrapper of directional::CartesianField like polyvector_to_raw() does, so I'm guessing I just haven't been there yet.
Do you want to try and fix it and submit a pull request? should test the above polyvector_to_raw(raw_to_polyvector()) to see it's an identity (up to small numerics).
Hi,
In raw_to_polyvector with sign symmetry, I think that line 41 does a matrix multiplication that fails an assertion in Debug due to incompatible dimensions and leads to some undefined behavior in a Release build.
I think the line can be changed to something like actualRoots = actualRoots.array().square() to calculate the element-wise square of the roots (if I understand the logic correctly...).
Thanks in advance for looking into it,
Aviv
The text was updated successfully, but these errors were encountered: