Date: 2022-03-31T15:29:05+00:00

Actual source code: test1.c
slepc-3.17.0 2022-03-31
Report Typos and Errors

      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: */
     10: /*
     11:    Demonstrates SlepcInitializeNoArguments()
     12: */

     14: #include <slepcsys.h>

     16: int main(int argc,char **argv)
     17: {
     18:   PetscBool      isInitialized,isFinalized;

     20:   SlepcInitialized(&isInitialized);
     21:   if (!isInitialized) {
     22:     SlepcInitializeNoArguments();
     23:     PetscPrintf(PETSC_COMM_WORLD,"Initialize SLEPc.\n");
     24:     SlepcInitialized(&isInitialized);
     25:     SlepcFinalized(&isFinalized);
     26:     PetscPrintf(PETSC_COMM_WORLD,"SlepcInitialized=%d, SlepcFinalized=%d.\n",(int)isInitialized,(int)isFinalized);
     27:   } else PetscPrintf(PETSC_COMM_WORLD,"SLEPc was already initialized.\n");
     28:   SlepcFinalize();
     29:   SlepcFinalized(&isFinalized);
     30:   if (!isFinalized) printf("Unexpected value: SlepcFinalized() returned False after SlepcFinalize()\n");
     31:   return 0;
     32: }

     34: /*TEST

     36:    test:
     37:       suffix: 1

     39: TEST*/