Localized Orbital Scaling Correction (LOSC) C library
curvature.h
Go to the documentation of this file.
1 
6 #ifndef _LOSC_INCLUDE_C_LOSC_CURVATURE_H_
7 #define _LOSC_INCLUDE_C_LOSC_CURVATURE_H_
8 
9 #include <c_losc/matrix.h>
10 #include <stddef.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 //**********************************************
17 // ==> Interface for `losc::DFAInfo`
18 //**********************************************
19 
27 typedef struct LoscDFAInfo LoscDFAInfo;
28 
56 LoscDFAInfo *losc_dfa_info_create(double gga_x, double hf_x, const char *name);
57 
63 #define losc_dfa_info_free(ptr) _losc_DFAInfo_free(&(ptr))
64 void _losc_dfa_info_free(LoscDFAInfo **pptr_m);
65 
66 //**********************************************
67 // ==> Interface for `losc::CurvatureBase`
68 //**********************************************
69 
70 // The incomplete struct in C-side that is `losc::CurvatureBase` in C++ side.
71 typedef struct _LoscCurvatureBase _LoscCurvatureBase;
72 
80 typedef struct LoscCurvatureBase {
81  // points to a real `losc::CurvatureBase` object.
82  _LoscCurvatureBase *_p_base;
83 
84  // List interface of methods exposed to C users bellow.
85 
95  size_t (*nlo)(const LoscCurvatureBase *self);
96 
106  size_t (*nfitbasis)(const LoscCurvatureBase *self);
107 
117  size_t (*npts)(const LoscCurvatureBase *self);
118 
133  void (*kappa)(const LoscCurvatureBase *self, losc_matrix *K);
135 
136 //**********************************************
137 // ==> Interface for `losc::CurvatureV1`
138 //**********************************************
139 
140 // The incomplete struct in C-side that is `losc::CurvatureV1` in C++-side.
141 typedef struct _LoscCurvatureV1 _LoscCurvatureV1;
142 
167 typedef struct LoscCurvatureV1 {
168  // points to a real `losc::CurvatureV1` object.
169  _LoscCurvatureV1 *_p_v1;
170 
180 
181  // Note:
182  // If `losc::CurvatureV1` has new public functions (new functions added in
183  // `losc::CurvatureV1` not in its base class) in the future, add the
184  // corresponding C interface with new function pointers below.
185 
196  void (*set_tau)(const LoscCurvatureV1 *self, double tau);
198 
228  const losc_matrix *df_pii,
229  const losc_matrix *df_Vpq_inv,
230  const losc_matrix *grid_lo,
231  const double *grid_weight);
232 
238 #define losc_curvature_v1_free(ptr) _losc_curvature_v1_free(&(ptr))
239 void *_losc_curvature_v1_free(LoscCurvatureV1 **pptr_self);
240 
241 //**********************************************
242 // ==> Interface for `losc::CurvatureV1`
243 //**********************************************
244 
245 // The incomplete struct in C-side that is `losc::CurvatureV2` in C++-side.
246 typedef struct _LoscCurvatureV2 _LoscCurvatureV2;
247 
255 typedef struct LoscCurvatureV2 {
256  // points to a real `losc::CurvatureV2` object.
257  _LoscCurvatureV2 *_p_v2;
258 
268 
269  // Note
270  // If `losc::CurvatureV2` has new public functions (new functions added in
271  // `losc::CurvatureV2` not in its base class) in the future, add the
272  // corresponding C interface with new function pointers below.
273 
283  void (*set_tau)(const LoscCurvatureV2 *self, double tau);
284 
294  void (*set_zeta)(const LoscCurvatureV2 *self, double zeta);
296 
304  const losc_matrix *df_pii,
305  const losc_matrix *df_Vpq_inv,
306  const losc_matrix *grid_lo,
307  const double *grid_weight);
308 
314 #define losc_curvature_v2_free(ptr) _losc_curvature_v2_free(&(ptr))
315 void *_losc_curvature_v2_free(LoscCurvatureV2 **pptr_self);
316 
317 #ifdef __cplusplus
318 }
319 #endif
320 
321 #endif
The C interface for LOSC curvature base class.
Definition: curvature.h:80
void(* kappa)(const LoscCurvatureBase *self, losc_matrix *K)
Compute the LOSC curvature matrix with an in-out way.
Definition: curvature.h:133
struct LoscCurvatureV1 LoscCurvatureV1
The C interface for LOSC curvature class of version 1.
LoscCurvatureBase * p_base
A pointer to a LoscCurvatureBase variable.
Definition: curvature.h:179
struct LoscDFAInfo LoscDFAInfo
The DFA information.
Definition: curvature.h:27
The C interface for LOSC curvature class of version 2.
Definition: curvature.h:255
LoscCurvatureV2 * losc_curvature_v2_create(const LoscDFAInfo *dfa, const losc_matrix *df_pii, const losc_matrix *df_Vpq_inv, const losc_matrix *grid_lo, const double *grid_weight)
Constructor of LoscCurvatureV2.
LoscDFAInfo * losc_dfa_info_create(double gga_x, double hf_x, const char *name)
Create a struct LoscDFAInfo.
LoscCurvatureV1 * losc_curvature_v1_create(const LoscDFAInfo *dfa, const losc_matrix *df_pii, const losc_matrix *df_Vpq_inv, const losc_matrix *grid_lo, const double *grid_weight)
Create a struct LoscCurvatureV1.
struct LoscCurvatureV2 LoscCurvatureV2
The C interface for LOSC curvature class of version 2.
size_t(* npts)(const LoscCurvatureBase *self)
Return the number of grid points.
Definition: curvature.h:117
The C interface for LOSC curvature class of version 1.
Definition: curvature.h:167
LoscCurvatureBase * p_base
A pointer to a LoscCurvatureBase variable.
Definition: curvature.h:267
The C interface of matrix used in LOSC.
size_t(* nfitbasis)(const LoscCurvatureBase *self)
Return the number of nfitbasis.
Definition: curvature.h:106
struct LoscCurvatureBase LoscCurvatureBase
The C interface for LOSC curvature base class.
size_t(* nlo)(const LoscCurvatureBase *self)
Return the number of LOs.
Definition: curvature.h:95