<div>Sorry, it was my fault. Now it works fine after correct compiling. Thank you for maintenance.</div><div> </div><div>07.01.2020, 18:21, "Smith, Barry F." <bsmith@mcs.anl.gov>:</div><blockquote><p><br /> </p><blockquote> On Jan 7, 2020, at 8:59 AM, Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br /><br />  I’m not sure what the compilers, and C++ are doing here<br /><br /> On Tue, Jan 7, 2020 at 9:17 AM Кудров Илья <<a href="mailto:ilyakudrov@yandex.ru">ilyakudrov@yandex.ru</a>> wrote:<br /> However, after configuring<br /><br /> cout<<1. + 1.*PETSC_i<<endl;<br /><br /> outputs (1, 0) instead of (1, 1).</blockquote><p><br />   Where after configure? PETSC_i is not defined until after PetscInitialize() is called. Send full example.<br /><br />   Here is the code that defines it<br /><br />  /*<br />     Initialized the global complex variable; this is because with<br />     shared libraries the constructors for global variables<br />     are not called; at least on IRIX.<br />  */<br />#if defined(PETSC_HAVE_COMPLEX)<br />  {<!-- --><br />#if defined(PETSC_CLANGUAGE_CXX) && !defined(PETSC_USE_REAL___FLOAT128)<br />    PetscComplex ic(0.0,1.0);<br />    PETSC_i = ic;<br />#else<br />    PETSC_i = _Complex_I;<br />#endif<br />  }<br /><br />Perhaps it is problematic in C++? With single precision? Try PetscComplex ic(0.0,1.0); and see what ic is<br /><br />   Barry<br /> </p><blockquote><br /> 07.01.2020, 16:01, "Mark Adams" <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>>:<br /> yes, configure with<br /><br /> --with-precision=single<br /> --with-scalar-type=complex<br /><br /><br /> On Tue, Jan 7, 2020 at 7:49 AM Кудров Илья <<a href="mailto:ilyakudrov@yandex.ru">ilyakudrov@yandex.ru</a>> wrote:<br /> Good day! Is it possible to use complex numbers in single precision in linear solvers? I'd like to decrease time and memory needed for calculation.<br /><br /> Best regards, Ilya Kudrov!</blockquote><p> </p></blockquote>