The C interface for LOSC localizer base.
More...
#include <localization.h>
The C interface for LOSC localizer base.
- Note
- This struct exports all the functions for LOSC localization 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.
void(* LoscLocalizerBase::lo_U) (const LoscLocalizerBase *self, losc_matrix *L, losc_matrix *U) |
Calculate the LOs and the unitary.
- Parameters
-
[in,out] | L | A matrix with dimension of [nbasis, nlo] . The data of L is ignored at entrace. At exit, it stores the LO coefficient matrix. |
[in,out] | U | A matrix with dimension of [nlo, nlo] . At entrance, it stores a unitary matrix as the initial guess for the localization. The unitarity of the input U matrix is not verified. At exit, it is updated by the localization process. |
- Note
- The dimensions of input matrices will be check. It will throw an exception if they do not match the expectation.
-
The relation between the LOs and AOs is \( \displaystyle \psi_i = \sum_\mu C_{\mu i} \phi_{\mu}, \) in which \( \psi_i \) is the LO, \( C_{\mu i} \) is the LO coefficient matrix and \( \phi_i \) is the AO. The dimension of LO coefficient matrix is
[nbasis, nlo]
. The relation between the LOs and LO basis is \( \displaystyle \psi_i = \sum_j U_{\mu i} \phi_\mu, \) in which \( \psi_i \) is the LO, \( U_{\mu i} \) is the U matrix and \( \phi_\mu \) is the LO basis. The dimension of the U matrix is [nlo, nlo]
.
void(* LoscLocalizerBase::set_convergence) (const LoscLocalizerBase *self, double tol) |
Set the convergence of localization.
- Parameters
-
[in] | tol | The localization convergence tolerance. |
- Example
pbase->set_convergence(pbase, 1.0e-6);
void(* LoscLocalizerBase::set_max_iter) (const LoscLocalizerBase *self, size_t max_iter) |
Set the maximum iteration number for localization.
- Parameters
-
[in] | max_iter | The maximum number of iteration. |
- Example
pbase->set_max_iter(pbase, 100);
void(* LoscLocalizerBase::set_random_permutation) (const LoscLocalizerBase *self, bool flag) |
Set flag for doing random permutation or not for Jacobi-Sweep algorithm.
- Parameters
-
[in] | flag | True for doing random permutation False otherwise. |
- Example
pbase->set_random_permutation(pbase, false);