EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
evsl_direct_f90.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include <string.h>
5 #include "def.h"
6 #include "struct.h"
7 #include "internal_proto.h"
8 #include "evsl_direct.h"
19 void EVSLFORT(setup_bsol_direct)(uintptr_t *Bf90,
20  uintptr_t *Bsoldataf90) {
21  /* cast csr pointer of B */
22  csrMat *B = (csrMat *) (*Bf90);
23  void *Bsol;
24  /* setup B sol and LT sol*/
25  SetupBSolDirect(B, &Bsol);
26  SetBSol(BSolDirect, Bsol);
27  SetLTSol(LTSolDirect, Bsol);
28  /* cast pointer for output */
29  *Bsoldataf90 = (uintptr_t) Bsol;
30 }
31 
33 void EVSLFORT(free_bsol_direct)(uintptr_t *Bsolf90) {
34  /* cast pointer */
35  void *Bsol = (void *) (*Bsolf90);
36  FreeBSolDirectData(Bsol);
37 }
38 
46 void EVSLFORT(setup_asigmabsol_direct)(uintptr_t *Af90,
47  int *flagB,
48  uintptr_t *Bf90,
49  uintptr_t *ratf90,
50  uintptr_t *solshiftf90) {
51  /* cast csr pointer of A */
52  csrMat *A = (csrMat *) (*Af90);
53  /* cast csr pointer of B */
54  csrMat *B = (*flagB) ? (csrMat *) (*Bf90) : NULL;
55  /* cast pointer */
56  ratparams *rat = (ratparams *) (*ratf90);
57  /* allocate and setup solshiftdata */
58  void **solshiftdata = (void **) malloc(rat->num*sizeof(void *));
59  SetupASIGMABSolDirect(A, B, rat->num, rat->zk, solshiftdata);
60  /* cast pointer for output */
61  *solshiftf90 = (uintptr_t) solshiftdata;
62 }
63 
68 void EVSLFORT(set_asigmabsol_direct)(uintptr_t *ratf90,
69  uintptr_t *solshiftf90) {
70  /* cast pointers */
71  ratparams *rat = (ratparams *) (*ratf90);
72  void **solshiftdata = (void **) (*solshiftf90);
73 
74  SetASigmaBSol(rat, NULL, ASIGMABSolDirect, solshiftdata);
75 }
76 
81 void EVSLFORT(free_asigmabsol_direct)(uintptr_t *ratf90,
82  uintptr_t *solshiftf90) {
83  /* cast pointers */
84  ratparams *rat = (ratparams *) (*ratf90);
85  void **solshiftdata = (void **) (*solshiftf90);
86  FreeASIGMABSolDirect(rat->num, solshiftdata);
87  free(solshiftdata);
88 }
89 
void ASIGMABSolDirect(int n, double *br, double *bi, double *xr, double *xz, void *data)
complex linear solver routine passed to evsl
complex double * zk
Definition: struct.h:126
int num
Definition: struct.h:114
void EVSLFORT() setup_asigmabsol_direct(uintptr_t *Af90, int *flagB, uintptr_t *Bf90, uintptr_t *ratf90, uintptr_t *solshiftf90)
Fortran interface for SetupASIGMABSolDirect.
defs in EVSL
int SetupASIGMABSolDirect(csrMat *A, csrMat *BB, int num, complex double *zk, void **data)
setup CXsparse solver for A - SIGMA B
void EVSLFORT() setup_bsol_direct(uintptr_t *Bf90, uintptr_t *Bsoldataf90)
Fortran interface for SetupBSolDirect and also SetBsol and SetLTSol.
int SetupBSolDirect(csrMat *B, void **data)
Setup the B-sol by computing the Cholesky factorization of B.
Definition: evsl_cxsparse.c:57
#define EVSLFORT(name)
Definition: def.h:66
void FreeASIGMABSolDirect(int num, void **data)
free the data needed by CXSparse
void EVSLFORT() free_bsol_direct(uintptr_t *Bsolf90)
Fortran interface for FreeBSolDirectData.
void FreeBSolDirectData(void *data)
Free solver data.
This file contains function prototypes and constant definitions internally used in EVSL...
structs used in evsl
int SetLTSol(SolFuncR func, void *data)
Set the solve routine for LT.
Definition: evsl.c:185
sparse matrix format: the compressed sparse row (CSR) format, 0-based
Definition: struct.h:31
void LTSolDirect(double *b, double *x, void *data)
Solver function of L^{T} x = L^{-T}*b.
int SetBSol(SolFuncR func, void *data)
Set the solve routine and the associated data for B.
Definition: evsl.c:132
void EVSLFORT() free_asigmabsol_direct(uintptr_t *ratf90, uintptr_t *solshiftf90)
Fortran interface for FreeASIGMABSolDirect.
int SetASigmaBSol(ratparams *rat, SolFuncC *func, SolFuncC allf, void **data)
Set the solve routine and the associated data for A-SIGMA*B if func == NULL, set all functions to be ...
Definition: evsl.c:168
void BSolDirect(double *b, double *x, void *data)
Solver function of B.
Definitions used for direct solver interface.
void EVSLFORT() set_asigmabsol_direct(uintptr_t *ratf90, uintptr_t *solshiftf90)
Fortran interface for SetASigmaBSol with Direct solve.
parameters for rational filter
Definition: struct.h:112