1 /******************************************************************************
2  * Copyright 1998-2019 Lawrence Livermore National Security, LLC and other
3  * HYPRE Project Developers. See the top-level COPYRIGHT file for details.
4  *
5  * SPDX-License-Identifier: (Apache-2.0 OR MIT)
6  ******************************************************************************/
7 
8 #ifndef LOBPCG_INTERFACE_INTERPRETER
9 #define LOBPCG_INTERFACE_INTERPRETER
10 
11 #include "HYPRE_utilities.h"
12 
13 typedef struct
14 {
15   /* vector operations */
16   void*  (*CreateVector)  ( void *vector );
17   HYPRE_Int    (*DestroyVector) ( void *vector );
18 
19   HYPRE_Real   (*InnerProd)     ( void *x, void *y );
20   HYPRE_Int    (*CopyVector)    ( void *x, void *y );
21   HYPRE_Int    (*ClearVector)   ( void *x );
22   HYPRE_Int    (*SetRandomValues)   ( void *x, HYPRE_Int seed );
23   HYPRE_Int    (*ScaleVector)   ( HYPRE_Complex alpha, void *x );
24   HYPRE_Int    (*Axpy)          ( HYPRE_Complex alpha, void *x, void *y );
25   HYPRE_Int    (*VectorSize)    (void * vector);
26 
27   /* multivector operations */
28   /* do we need the following entry? */
29   void*  (*CreateMultiVector)  ( void*, HYPRE_Int n, void *vector );
30   void*  (*CopyCreateMultiVector)  ( void *x, HYPRE_Int );
31   void    (*DestroyMultiVector) ( void *x );
32 
33   HYPRE_Int    (*Width)  ( void *x );
34   HYPRE_Int    (*Height) ( void *x );
35 
36   void   (*SetMask) ( void *x, HYPRE_Int *mask );
37 
38   void   (*CopyMultiVector)    ( void *x, void *y );
39   void   (*ClearMultiVector)   ( void *x );
40   void   (*SetRandomVectors)   ( void *x, HYPRE_Int seed );
41   void   (*MultiInnerProd)     ( void *x, void *y, HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Real* );
42   void   (*MultiInnerProdDiag) ( void *x, void *y, HYPRE_Int*, HYPRE_Int, HYPRE_Real* );
43   void   (*MultiVecMat)        ( void *x, HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Complex*, void *y );
44   void   (*MultiVecMatDiag)    ( void *x, HYPRE_Int*, HYPRE_Int, HYPRE_Complex*, void *y );
45   void   (*MultiAxpy)          ( HYPRE_Complex alpha, void *x, void *y );
46 
47   /* do we need the following 2 entries? */
48   void   (*MultiXapy)          ( void *x, HYPRE_Int, HYPRE_Int, HYPRE_Int, HYPRE_Complex*, void *y );
49   void   (*Eval)               ( void (*f)( void*, void*, void* ), void*, void *x, void *y );
50 
51 } mv_InterfaceInterpreter;
52 
53 #endif
54