<div dir="ltr">On Wed, Apr 7, 2010 at 12:47 PM, Umut Tabak <span dir="ltr"><<a href="mailto:u.tabak@tudelft.nl">u.tabak@tudelft.nl</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear all,<br>
<br>
I am getting a compilation error from the sqrt(cmath header) function with PETSc 3.1, I configured PETSc with complex scalar type so I am suspecting that this is the source of the problem.<br>
<br>
Is there a simple workaround for this? And Is there an sqrt function for a 'PetscScalar', I could not find that in the documentation?<br>
<br>
PetscScalar xTMx;<br></blockquote><div><br></div><div>My guess is that you want</div><div><br></div><div>PetscReal xTMx;</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
...<br>
VecScale(x, 1/sqrt(xTMx));<br>
<br>
/home/utabak/thesis/C++/c++Projects/workDirectory/trunk/src/evpSolver1.cc:502: error: no match for ‘operator/’ in ‘1 / std::sqrt [with _Tp = double](((const std::complex<double>&)((const std::complex<double>*)(& xTMx))))’<br>
/usr/include/c++/4.3/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = std::complex<double>, _U2 = int, _T1 = const double, _T2 = int]’:<br>
<br>
<br>
Best regards,<br><font color="#888888">
Umut<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>
</div>