xref: /petsc/src/ksp/ksp/impls/gmres/pgmres/pgmresimpl.h (revision 9dd11ecf0918283bb567d8b33a92f53ac4ea7840)
1 #pragma once
2 
3 #define KSPGMRES_NO_MACROS
4 #include <../src/ksp/ksp/impls/gmres/gmresimpl.h>
5 
6 typedef struct {
7   KSPGMRESHEADER
8 } KSP_PGMRES;
9 
10 #define HH(a, b) (pgmres->hh_origin + (b) * (pgmres->max_k + 2) + (a))
11 /* HH will be size (max_k+2)*(max_k+1)  -  think of HH as being stored columnwise for access purposes. */
12 #define HES(a, b) (pgmres->hes_origin + (b) * (pgmres->max_k + 1) + (a))
13 /* HES will be size (max_k + 1) * (max_k + 1) -  again, think of HES as being stored columnwise */
14 #define CC(a) (pgmres->cc_origin + (a)) /* CC will be length (max_k+1) - cosines */
15 #define SS(a) (pgmres->ss_origin + (a)) /* SS will be length (max_k+1) - sines */
16 #define RS(a) (pgmres->rs_origin + (a)) /* RS will be length (max_k+2) - rt side */
17 
18 /* vector names */
19 #define VEC_OFFSET     2
20 #define VEC_TEMP       pgmres->vecs[0]              /* work space */
21 #define VEC_TEMP_MATOP pgmres->vecs[1]              /* work space */
22 #define VEC_VV(i)      pgmres->vecs[VEC_OFFSET + i] /* use to access othog basis vectors */
23 
24 #define PGMRES_DELTA_DIRECTIONS 10
25 #define PGMRES_DEFAULT_MAXK     30
26