Date: 2020-01-13T12:02:24+00:00

Actual source code: slepcbv.h
slepc-3.12.2 2020-01-13
Report Typos and Errors

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-2019, 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 the basis vectors object in SLEPc
     12: */

     14: #if !defined(SLEPCBV_H)
     15: #define SLEPCBV_H
     16:  #include <slepcsys.h>

     18: SLEPC_EXTERN PetscErrorCode BVInitializePackage(void);

     20: /*S
     21:     BV - Basis vectors, SLEPc object representing a collection of vectors
     22:     that typically constitute a basis of a subspace.

     24:     Level: beginner

     26: .seealso:  BVCreate()
     27: S*/
     28: typedef struct _p_BV* BV;

     30: /*J
     31:     BVType - String with the name of the type of BV. Each type differs in
     32:     the way data is stored internally.

     34:     Level: beginner

     36: .seealso: BVSetType(), BV
     37: J*/
     38: typedef const char* BVType;
     39: #define BVMAT        "mat"
     40: #define BVSVEC       "svec"
     41: #define BVVECS       "vecs"
     42: #define BVCONTIGUOUS "contiguous"
     43: #define BVTENSOR     "tensor"

     45: /* Logging support */
     46: SLEPC_EXTERN PetscClassId BV_CLASSID;

     48: /*E
     49:     BVOrthogType - Determines the method used in the orthogonalization
     50:     of vectors

     52:     Level: advanced

     54: .seealso: BVSetOrthogonalization(), BVGetOrthogonalization(), BVOrthogonalizeColumn(), BVOrthogRefineType
     55: E*/
     56: typedef enum { BV_ORTHOG_CGS,
     57:                BV_ORTHOG_MGS } BVOrthogType;
     58: SLEPC_EXTERN const char *BVOrthogTypes[];

     60: /*E
     61:     BVOrthogRefineType - Determines what type of refinement to use
     62:     during orthogonalization of vectors

     64:     Level: advanced

     66: .seealso: BVSetOrthogonalization(), BVGetOrthogonalization(), BVOrthogonalizeColumn()
     67: E*/
     68: typedef enum { BV_ORTHOG_REFINE_IFNEEDED,
     69:                BV_ORTHOG_REFINE_NEVER,
     70:                BV_ORTHOG_REFINE_ALWAYS } BVOrthogRefineType;
     71: SLEPC_EXTERN const char *BVOrthogRefineTypes[];

     73: /*E
     74:     BVOrthogBlockType - Determines the method used in block
     75:     orthogonalization (simultaneous orthogonalization of a set of vectors)

     77:     Level: advanced

     79: .seealso: BVSetOrthogonalization(), BVGetOrthogonalization(), BVOrthogonalize()
     80: E*/
     81: typedef enum { BV_ORTHOG_BLOCK_GS,
     82:                BV_ORTHOG_BLOCK_CHOL,
     83:                BV_ORTHOG_BLOCK_TSQR,
     84:                BV_ORTHOG_BLOCK_TSQRCHOL,
     85:                BV_ORTHOG_BLOCK_SVQB     } BVOrthogBlockType;
     86: SLEPC_EXTERN const char *BVOrthogBlockTypes[];

     88: /*E
     89:    BVMatMultType - Different ways of performing the BVMatMult() operation

     91:    Notes:
     92:    Allowed values are
     93: +  BV_MATMULT_VECS - perform a matrix-vector multiply per each column
     94: .  BV_MATMULT_MAT - carry out a MatMatMult() product with a dense matrix
     95: -  BV_MATMULT_MAT_SAVE - this case is deprecated

     97:    The default is BV_MATMULT_MAT except in the case of BVVECS.

     99:    Level: advanced

    101: .seealso: BVSetMatMultMethod(), BVMatMult()
    102: E*/
    103: typedef enum { BV_MATMULT_VECS,
    104:                BV_MATMULT_MAT,
    105:                BV_MATMULT_MAT_SAVE } BVMatMultType;
    106: SLEPC_EXTERN const char *BVMatMultTypes[];

    108: SLEPC_EXTERN PetscErrorCode BVCreate(MPI_Comm,BV*);
    109: SLEPC_EXTERN PetscErrorCode BVDestroy(BV*);
    110: SLEPC_EXTERN PetscErrorCode BVSetType(BV,BVType);
    111: SLEPC_EXTERN PetscErrorCode BVGetType(BV,BVType*);
    112: SLEPC_EXTERN PetscErrorCode BVSetSizes(BV,PetscInt,PetscInt,PetscInt);
    113: SLEPC_EXTERN PetscErrorCode BVSetSizesFromVec(BV,Vec,PetscInt);
    114: SLEPC_EXTERN PetscErrorCode BVGetSizes(BV,PetscInt*,PetscInt*,PetscInt*);
    115: SLEPC_EXTERN PetscErrorCode BVResize(BV,PetscInt,PetscBool);
    116: SLEPC_EXTERN PetscErrorCode BVSetFromOptions(BV);
    117: SLEPC_EXTERN PetscErrorCode BVView(BV,PetscViewer);
    118: PETSC_STATIC_INLINE PetscErrorCode BVViewFromOptions(BV bv,PetscObject obj,const char name[]) {return PetscObjectViewFromOptions((PetscObject)bv,obj,name);}

    120: SLEPC_EXTERN PetscErrorCode BVGetColumn(BV,PetscInt,Vec*);
    121: SLEPC_EXTERN PetscErrorCode BVRestoreColumn(BV,PetscInt,Vec*);
    122: SLEPC_EXTERN PetscErrorCode BVGetSplit(BV,BV*,BV*);
    123: SLEPC_EXTERN PetscErrorCode BVRestoreSplit(BV,BV*,BV*);
    124: SLEPC_EXTERN PetscErrorCode BVGetArray(BV,PetscScalar**);
    125: SLEPC_EXTERN PetscErrorCode BVRestoreArray(BV,PetscScalar**);
    126: SLEPC_EXTERN PetscErrorCode BVGetArrayRead(BV,const PetscScalar**);
    127: SLEPC_EXTERN PetscErrorCode BVRestoreArrayRead(BV,const PetscScalar**);
    128: SLEPC_EXTERN PetscErrorCode BVCreateVec(BV,Vec*);
    129: SLEPC_EXTERN PetscErrorCode BVSetActiveColumns(BV,PetscInt,PetscInt);
    130: SLEPC_EXTERN PetscErrorCode BVGetActiveColumns(BV,PetscInt*,PetscInt*);
    131: SLEPC_EXTERN PetscErrorCode BVInsertVec(BV,PetscInt,Vec);
    132: SLEPC_EXTERN PetscErrorCode BVInsertVecs(BV,PetscInt,PetscInt*,Vec*,PetscBool);
    133: SLEPC_EXTERN PetscErrorCode BVInsertConstraints(BV,PetscInt*,Vec*);
    134: SLEPC_EXTERN PetscErrorCode BVSetNumConstraints(BV,PetscInt);
    135: SLEPC_EXTERN PetscErrorCode BVGetNumConstraints(BV,PetscInt*);
    136: SLEPC_EXTERN PetscErrorCode BVDuplicate(BV,BV*);
    137: SLEPC_EXTERN PetscErrorCode BVDuplicateResize(BV,PetscInt,BV*);
    138: SLEPC_EXTERN PetscErrorCode BVCopy(BV,BV);
    139: SLEPC_EXTERN PetscErrorCode BVCopyVec(BV,PetscInt,Vec);
    140: SLEPC_EXTERN PetscErrorCode BVCopyColumn(BV,PetscInt,PetscInt);
    141: SLEPC_EXTERN PetscErrorCode BVSetMatrix(BV,Mat,PetscBool);
    142: SLEPC_EXTERN PetscErrorCode BVGetMatrix(BV,Mat*,PetscBool*);
    143: SLEPC_EXTERN PetscErrorCode BVApplyMatrix(BV,Vec,Vec);
    144: SLEPC_EXTERN PetscErrorCode BVApplyMatrixBV(BV,BV);
    145: SLEPC_EXTERN PetscErrorCode BVGetCachedBV(BV,BV*);
    146: SLEPC_EXTERN PetscErrorCode BVSetSignature(BV,Vec);
    147: SLEPC_EXTERN PetscErrorCode BVGetSignature(BV,Vec);
    148: SLEPC_EXTERN PetscErrorCode BVSetBufferVec(BV,Vec);
    149: SLEPC_EXTERN PetscErrorCode BVGetBufferVec(BV,Vec*);

    151: SLEPC_EXTERN PetscErrorCode BVMult(BV,PetscScalar,PetscScalar,BV,Mat);
    152: SLEPC_EXTERN PetscErrorCode BVMultVec(BV,PetscScalar,PetscScalar,Vec,PetscScalar*);
    153: SLEPC_EXTERN PetscErrorCode BVMultColumn(BV,PetscScalar,PetscScalar,PetscInt,PetscScalar*);
    154: SLEPC_EXTERN PetscErrorCode BVMultInPlace(BV,Mat,PetscInt,PetscInt);
    155: SLEPC_EXTERN PetscErrorCode BVMultInPlaceTranspose(BV,Mat,PetscInt,PetscInt);
    156: SLEPC_EXTERN PetscErrorCode BVMatMult(BV,Mat,BV);
    157: SLEPC_EXTERN PetscErrorCode BVMatMultHermitianTranspose(BV,Mat,BV);
    158: SLEPC_EXTERN PetscErrorCode BVMatMultColumn(BV,Mat,PetscInt);
    159: SLEPC_EXTERN PetscErrorCode BVMatProject(BV,Mat,BV,Mat);
    160: SLEPC_EXTERN PetscErrorCode BVDot(BV,BV,Mat);
    161: SLEPC_EXTERN PetscErrorCode BVDotVec(BV,Vec,PetscScalar*);
    162: SLEPC_EXTERN PetscErrorCode BVDotVecBegin(BV,Vec,PetscScalar*);
    163: SLEPC_EXTERN PetscErrorCode BVDotVecEnd(BV,Vec,PetscScalar*);
    164: SLEPC_EXTERN PetscErrorCode BVDotColumn(BV,PetscInt,PetscScalar*);
    165: SLEPC_EXTERN PetscErrorCode BVDotColumnBegin(BV,PetscInt,PetscScalar*);
    166: SLEPC_EXTERN PetscErrorCode BVDotColumnEnd(BV,PetscInt,PetscScalar*);
    167: SLEPC_EXTERN PetscErrorCode BVScale(BV,PetscScalar);
    168: SLEPC_EXTERN PetscErrorCode BVScaleColumn(BV,PetscInt,PetscScalar);
    169: SLEPC_EXTERN PetscErrorCode BVNorm(BV,NormType,PetscReal*);
    170: SLEPC_EXTERN PetscErrorCode BVNormVec(BV,Vec,NormType,PetscReal*);
    171: SLEPC_EXTERN PetscErrorCode BVNormVecBegin(BV,Vec,NormType,PetscReal*);
    172: SLEPC_EXTERN PetscErrorCode BVNormVecEnd(BV,Vec,NormType,PetscReal*);
    173: SLEPC_EXTERN PetscErrorCode BVNormColumn(BV,PetscInt,NormType,PetscReal*);
    174: SLEPC_EXTERN PetscErrorCode BVNormColumnBegin(BV,PetscInt,NormType,PetscReal*);
    175: SLEPC_EXTERN PetscErrorCode BVNormColumnEnd(BV,PetscInt,NormType,PetscReal*);
    176: SLEPC_EXTERN PetscErrorCode BVSetRandom(BV);
    177: SLEPC_EXTERN PetscErrorCode BVSetRandomColumn(BV,PetscInt);
    178: SLEPC_EXTERN PetscErrorCode BVSetRandomCond(BV,PetscReal);
    179: SLEPC_EXTERN PetscErrorCode BVSetRandomContext(BV,PetscRandom);
    180: SLEPC_EXTERN PetscErrorCode BVGetRandomContext(BV,PetscRandom*);

    182: SLEPC_EXTERN PetscErrorCode BVSetOrthogonalization(BV,BVOrthogType,BVOrthogRefineType,PetscReal,BVOrthogBlockType);
    183: SLEPC_EXTERN PetscErrorCode BVGetOrthogonalization(BV,BVOrthogType*,BVOrthogRefineType*,PetscReal*,BVOrthogBlockType*);
    184: SLEPC_EXTERN PetscErrorCode BVOrthogonalize(BV,Mat);
    185: SLEPC_EXTERN PetscErrorCode BVOrthogonalizeVec(BV,Vec,PetscScalar*,PetscReal*,PetscBool*);
    186: SLEPC_EXTERN PetscErrorCode BVOrthogonalizeColumn(BV,PetscInt,PetscScalar*,PetscReal*,PetscBool*);
    187: SLEPC_EXTERN PetscErrorCode BVOrthonormalizeColumn(BV,PetscInt,PetscBool,PetscReal*,PetscBool*);
    188: SLEPC_EXTERN PetscErrorCode BVOrthogonalizeSomeColumn(BV,PetscInt,PetscBool*,PetscScalar*,PetscReal*,PetscBool*);
    189: SLEPC_EXTERN PetscErrorCode BVBiorthogonalizeColumn(BV,BV,PetscInt);
    190: SLEPC_EXTERN PetscErrorCode BVBiorthonormalizeColumn(BV,BV,PetscInt,PetscReal*);
    191: SLEPC_EXTERN PetscErrorCode BVSetMatMultMethod(BV,BVMatMultType);
    192: SLEPC_EXTERN PetscErrorCode BVGetMatMultMethod(BV,BVMatMultType*);

    194: SLEPC_EXTERN PetscErrorCode BVCreateFromMat(Mat,BV*);
    195: SLEPC_EXTERN PetscErrorCode BVCreateMat(BV,Mat*);
    196: SLEPC_EXTERN PetscErrorCode BVGetMat(BV,Mat*);
    197: SLEPC_EXTERN PetscErrorCode BVRestoreMat(BV,Mat*);

    199: SLEPC_EXTERN PetscErrorCode BVCreateTensor(BV,PetscInt,BV*);
    200: SLEPC_EXTERN PetscErrorCode BVTensorBuildFirstColumn(BV,PetscInt);
    201: SLEPC_EXTERN PetscErrorCode BVTensorCompress(BV,PetscInt);
    202: SLEPC_EXTERN PetscErrorCode BVTensorGetDegree(BV,PetscInt*);
    203: SLEPC_EXTERN PetscErrorCode BVTensorGetFactors(BV,BV*,Mat*);
    204: SLEPC_EXTERN PetscErrorCode BVTensorRestoreFactors(BV,BV*,Mat*);

    206: SLEPC_EXTERN PetscErrorCode BVSetOptionsPrefix(BV,const char*);
    207: SLEPC_EXTERN PetscErrorCode BVAppendOptionsPrefix(BV,const char*);
    208: SLEPC_EXTERN PetscErrorCode BVGetOptionsPrefix(BV,const char*[]);

    210: SLEPC_EXTERN PetscFunctionList BVList;
    211: SLEPC_EXTERN PetscErrorCode BVRegister(const char[],PetscErrorCode(*)(BV));

    213: #endif