44#include " module_base/module_device/types.h"
55#include " module_base/module_device/memory_op.h"
66#include " module_hsolver/kernels/math_kernel_op.h"
7+
8+ // / @brief Preconditioner Function Library
9+ // / Users can add other types of operation than the following ones at one's need.
710namespace hsolver
811{
912 template <typename T>
@@ -19,10 +22,6 @@ namespace hsolver
1922 // / @brief Transform vectors
2023 namespace fvec
2124 {
22- // / @brief To be called in the iterative eigensolver.
23- // / Users can add other types of operation than the following ones at one's need.
24- // / fixed parameters: object vector, eigenvalue, leading dimension, number of vectors
25-
2625 // /---------------------------------------------------------------------------------------------
2726 // / type 1: directly divide each vector by the precondition vector
2827 // /---------------------------------------------------------------------------------------------
@@ -36,7 +35,7 @@ namespace hsolver
3635 vector_div_vector_op<T, Device>()({}, dim, ptr_m, ptr_m, pre );
3736 }
3837 }
39- // / calling intereface in the eigensolver
38+ // / Intereface to be called in the eigensolver
4039 template <typename T>
4140 using Div = std::function<void (T*, const size_t &, const size_t &)>;
4241 // Kernel function full of dependence
@@ -73,17 +72,18 @@ namespace hsolver
7372 }
7473 }
7574 }
76- // / calling intereface in the eigensolver
75+ // / Intereface to be called in the eigensolver
7776 template <typename T>
7877 using DivTransMinusEig = std::function<void (T*, const Real<T>*, const size_t &, const size_t &)>;
79- // Kernel function full of dependence
78+ // / Kernel function full of dependence
8079 template <typename T, typename Device = base_device::DEVICE_CPU>
8180 using DivTransMinusEigKernel = std::function<decltype (div_trans_prevec_minus_eigen<T, Device>)>;
8281 }
8382
8483 // / @brief A operator-like class of precondition function
8584 // / to encapsulate the pre-allocation of memory on different devices before starting the iterative eigensolver.
86- // / One can pass the operatr() function of this class, or other custom lambdas/functions to eigensolvers.
85+ // / One can use `.get()` interface to get the function to be called by the eigensovler,
86+ // / or pass a custom lambdas/function to replace the one returned by `.get()`.
8787 template <typename T, typename Device = base_device::DEVICE_CPU, typename Kernel_t = fvec::DivKernel<T, Device>>
8888 struct PreOP
8989 {
0 commit comments