@@ -36,13 +36,23 @@ class DiagoDavid : public DiagH<T, Device>
3636 * This function type is used to define a matrix-blockvector operator H.
3737 * For eigenvalue problem HX = λX or generalized eigenvalue problem HX = λSX,
3838 * this function computes the product of the Hamiltonian matrix H and a blockvector X.
39+ *
40+ * Called as follows:
41+ * hpsi(X, HX, nvec, dim, id_start, id_end)
42+ * Result is stored in HX.
43+ * HX = H * X[id_start:id_end]
3944 *
40- * @param[out] X Pointer to input blockvector of type `T*`.
41- * @param[in] HX Pointer to output blockvector of type `T*`.
45+ * @param[out] X Head address of input blockvector of type `T*`.
46+ * @param[in] HX Where to write output blockvector of type `T*`.
4247 * @param[in] nvec Number of eigebpairs, i.e. number of vectors in a block.
4348 * @param[in] dim Dimension of matrix.
4449 * @param[in] id_start Start index of blockvector.
4550 * @param[in] id_end End index of blockvector.
51+ *
52+ * @warning HX is the exact address to store output H*X[id_start:id_end];
53+ * @warning while X is the head address of input blockvector, \b without offset.
54+ * @warning Calling function should pass X and HX[offset] as arguments,
55+ * @warning where offset is usually id_start * leading dimension.
4656 */
4757 using HPsiFunc = std::function<void (T*, T*, const int , const int , const int , const int )>;
4858
0 commit comments