Actual source code: zpolygon.c

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: #include <petsc/private/ftnimpl.h>
     12: #include <slepcrg.h>

     14: #if defined(PETSC_HAVE_FORTRAN_CAPS)
     15: #define rgpolygongetvertices0_ RGPOLYGONGETVERTICES0
     16: #define rgpolygongetvertices1_ RGPOLYGONGETVERTICES1
     17: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
     18: #define rgpolygongetvertices0_ rgpolygongetvertices0
     19: #define rgpolygongetvertices1_ rgpolygongetvertices1
     20: #endif

     22: SLEPC_EXTERN void rgpolygongetvertices_(RG *rg,PetscInt *n,PetscScalar *vr,PetscScalar *vi,PetscErrorCode *ierr)
     23: {
     24:   PetscScalar *ovr,*ovi;
     25:   PetscInt    n_;

     27:   CHKFORTRANNULLINTEGER(n);
     28:   CHKFORTRANNULLSCALAR(vr);
     29:   CHKFORTRANNULLSCALAR(vi);
     30:   *ierr = RGPolygonGetVertices(*rg,&n_,&ovr,&ovi); if (*ierr) return;
     31:   if (vr && ovr) { *ierr = PetscArraycpy(vr,ovr,n_); if (*ierr) return; }
     32:   if (vi && ovi) { *ierr = PetscArraycpy(vi,ovi,n_); if (*ierr) return; }
     33:   if (n) *n = n_;
     34:   *ierr = PetscFree(ovr); if (*ierr) return;
     35:   *ierr = PetscFree(ovi);
     36: }

     38: SLEPC_EXTERN void rgpolygongetvertices0_(RG *rg,PetscInt *n,PetscScalar *vr,PetscScalar *vi,PetscErrorCode *ierr)
     39: {
     40:   rgpolygongetvertices_(rg,n,vr,vi,ierr);
     41: }

     43: SLEPC_EXTERN void rgpolygongetvertices1_(RG *rg,PetscInt *n,PetscScalar *vr,PetscScalar *vi,PetscErrorCode *ierr)
     44: {
     45:   rgpolygongetvertices_(rg,n,vr,vi,ierr);
     46: }