Localized Orbital Scaling Correction (LOSC) C library
LoscCurvatureBase Struct Reference

The C interface for LOSC curvature base class. More...

#include <curvature.h>

Public Attributes

size_t(* nlo )(const LoscCurvatureBase *self)
 Return the number of LOs. More...
 
size_t(* nfitbasis )(const LoscCurvatureBase *self)
 Return the number of nfitbasis. More...
 
size_t(* npts )(const LoscCurvatureBase *self)
 Return the number of grid points. More...
 
void(* kappa )(const LoscCurvatureBase *self, losc_matrix *K)
 Compute the LOSC curvature matrix with an in-out way. More...
 

Detailed Description

The C interface for LOSC curvature base class.

Note
This struct exports all the functions for LOSC curvature base class. This struct servers as helper class to avoid code duplication for the implementation of C interface. There is no need for C users to create a such struct in practice.

Member Data Documentation

void(* LoscCurvatureBase::kappa) (const LoscCurvatureBase *self, losc_matrix *K)

Compute the LOSC curvature matrix with an in-out way.

Parameters
[in,out]Kcurvature matrix with dimension [nlo, nlo].
Note
The curvature matrix should be allocated in advance with an expected dimension. Otherwise, it will throw an exception.
Example
// Assume `pbase` is a existing variable with type `LoscCurvatureBase *`.
// Demo: calculate curvature matrix.
nlo = pbase->nlo(pbase);
losc_matrix *K = losc_create_matrix(nlo, nlo);
pbase->kappa(pbase, K);
size_t(* LoscCurvatureBase::nfitbasis) (const LoscCurvatureBase *self)

Return the number of nfitbasis.

Example
// Assume `pbase` is a existing variable with type `LoscCurvatureBase *`.
// Demo: get the number of fit basis.
size_t n = pbase->nfitbasis(pbase);
size_t(* LoscCurvatureBase::nlo) (const LoscCurvatureBase *self)

Return the number of LOs.

Example
// Assume `pbase` is a existing variable with type `LoscCurvatureBase *`.
// Demo: get the number of LOs.
size_t n = pbase->nlo(pbase);
size_t(* LoscCurvatureBase::npts) (const LoscCurvatureBase *self)

Return the number of grid points.

Example
// Assume `pbase` is a existing variable with type `LoscCurvatureBase *`.
// Demo: get the number of grid points.
size_t n = pbase->npts(pbase);