Commits

Peter Brune committed 6bd8ea9

PCGAMG_Classical: Fix for Windows complex build errors

classical.c
C:\cygwin\home\sbalay\PETSC~2.CLO\src\ksp\pc\impls\gamg\classical.c(639) : error C2784: '_Ty __cdecl std::abs(const class std::complex<_Ty> &)' : could not deduce template argument for 'const class std::complex<_Ty> &' from 'double'
C:\cygwin\home\sbalay\PETSC~2.CLO\src\ksp\pc\impls\gamg\classical.c(640) : error C2784: '_Ty __cdecl std::abs(const class std::complex<_Ty> &)' : could not deduce template argument for 'const class std::complex<_Ty> &' from 'double'
C:\cygwin\home\sbalay\PETSC~2.CLO\src\ksp\pc\impls\gamg\classical.c(1127) : error C2440: '=' : cannot convert from 'int (__cdecl *)(struct _p_PC *,struct _p_Mat *,struct _p_Mat ** )' to 'int (__cdecl *)(struct _p_PC *,struct _p_Mat *const ,struct _p_Mat ** )'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
gmakefile:135: recipe for target 'arch-mswin-cxx-cmplx/obj/src/ksp/pc/impls/gamg/classical.o' failed

Reported-by: Satish Balay <balay@mcs.anl.gov>

Comments (0)

Files changed (1)

src/ksp/pc/impls/gamg/classical.c

         ptot_neg += PetscRealPart(pval[j]);
       }
     }
-    if (PetscAbsScalar(pthresh_pos) > 0.) ptot_pos /= pthresh_pos;
-    if (PetscAbsScalar(pthresh_neg) > 0.) ptot_neg /= pthresh_neg;
+    if (PetscAbsReal(pthresh_pos) > 0.) ptot_pos /= pthresh_pos;
+    if (PetscAbsReal(pthresh_neg) > 0.) ptot_neg /= pthresh_neg;
     idx=0;
     for (j=0;j<ncols;j++) {
       if (PetscRealPart(pval[j]) >= pmax_pos*cls->interp_threshold) {
 
 #undef __FUNCT__
 #define __FUNCT__ "PCGAMGOptProl_Classical_Jacobi"
-PetscErrorCode PCGAMGOptProl_Classical_Jacobi(PC pc,Mat A,Mat *P)
+PetscErrorCode PCGAMGOptProl_Classical_Jacobi(PC pc,const Mat A,Mat *P)
 {
 
   PetscErrorCode    ierr;