I have some issues with this code:
std::vector< std::array<std::complex<float>,3> > &hexWaves;
...
std::vector< std::pair< int, std::array<std::complex<float>,3> > > boundary;
// nothing works, results are always (0,0):
std::array< std::complex<float>, 3 > b {(boundaryStrength, 0.f), (boundaryStrength, 0.f), (boundaryStrength, 0.f)};
//std::array< std::complex<float>, 3 > b { {(boundaryStrength, 0.f), (boundaryStrength, 0.f), (boundaryStrength, 0.f)} };
//std::array< std::complex<float>, 3 > b = {(boundaryStrength, 0.f), (boundaryStrength, 0.f), (boundaryStrength, 0.f)};
// this would work, resulting in (boundaryStrength, 0):
//std::array< std::complex<float>, 3 > b {(0.f, boundaryStrength), (0.f, boundaryStrength), (0.f, boundaryStrength)};
for (int vI=0; vI<mesh.GetVertexCount(); vI++) if (vertexSingularityValence[vI] != 6)
{
boundary.push_back(std::make_pair(vI, b));
hexWaves[vI] = b;
ImGui::Text("Baoundary wave [%i][0]: %f %f", vI, hexWaves[vI][0].real(), hexWaves[vI][1].imag());
}
Only with wrong syntax i get the expected result of setting the real part to given number, and imaginary part to zero.
I have used similar code quite often like in the first uncommented line, but now i guess there is some catch. What is it?
The last commented line works, but it's clearly wrong.
I'm very confused...