Actual source code: slepcmat.h

  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:    User interface for various matrix operations added in SLEPc
 12: */

 14: #pragma once

 16: #include <petscmat.h>

 18: /* SUBMANSEC = Sys */

 20: SLEPC_EXTERN PetscErrorCode MatCreateTile(PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,PetscScalar,Mat,Mat*);
 21: SLEPC_EXTERN PetscErrorCode MatCreateVecsEmpty(Mat,Vec*,Vec*);

 23: /* Matrices for structured eigenproblems */
 24: SLEPC_EXTERN PetscErrorCode MatCreateBSE(Mat,Mat,Mat*);
 25: SLEPC_EXTERN PetscErrorCode MatCreateHamiltonian(Mat,Mat,Mat,Mat*);
 26: SLEPC_EXTERN PetscErrorCode MatCreateLREP(Mat,Mat,PetscBool,Mat*);

 28: /* Deprecated functions */
 29: PETSC_DEPRECATED_FUNCTION(3, 6, 0, "MatCreateRedundantMatrix() followed by MatConvert()", ) static inline PetscErrorCode SlepcMatConvertSeqDense(Mat mat,Mat *newmat)
 30: {
 31:   Mat Ar;

 33:   PetscFunctionBegin;
 34:   PetscCall(MatCreateRedundantMatrix(mat,0,PETSC_COMM_SELF,MAT_INITIAL_MATRIX,&Ar));
 35:   PetscCall(MatConvert(Ar,MATSEQDENSE,MAT_INITIAL_MATRIX,newmat));
 36:   PetscCall(MatDestroy(&Ar));
 37:   PetscFunctionReturn(PETSC_SUCCESS);
 38: }
 39: PETSC_DEPRECATED_FUNCTION(3, 8, 0, "MatCreateTile()", ) static inline PetscErrorCode SlepcMatTile(PetscScalar a,Mat A,PetscScalar b,Mat B,PetscScalar c,Mat C,PetscScalar d,Mat D,Mat *G) {return MatCreateTile(a,A,b,B,c,C,d,D,G);}
 40: PETSC_DEPRECATED_FUNCTION(3, 26, 0, "MatNormApproximate()", ) static inline PetscErrorCode MatNormEstimate(Mat A,PETSC_UNUSED Vec vrn,PETSC_UNUSED Vec w,PetscReal *nrm) {return MatNormApproximate(A,NORM_2,1,nrm);}