Skip to content

Commit

Permalink
Add function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Oct 5, 2019
1 parent 549a32e commit bdf84cf
Show file tree
Hide file tree
Showing 6 changed files with 1,103 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ endif()
target_link_libraries(cint "-lm")

install(TARGETS cint DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
install(FILES ${PROJECT_BINARY_DIR}/include/cint.h DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(CintHeaders
${PROJECT_SOURCE_DIR}/include/cint_funcs.h
${PROJECT_BINARY_DIR}/include/cint.h)
install(FILES ${CintHeaders} DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})

if(ENABLE_EXAMPLE)
enable_language(Fortran)
Expand Down
15 changes: 15 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ Installation
make install


Available Integrals
-------------------

The available integrals can be found in the header file cint_funcs.h. A simple
expression for each integral is also listed in the header file. The integral
function names and integral expressions correspond to the lisp symbol notations
in scripts/auto_intor.cl

All integral functions have the same function signature

```
function_name(double *out, int *dims, int *shls, int *atm, int natm, int *bas, int nbas, double *env, CINTOpt *opt, double *cache);
```


Known problems
--------------

Expand Down
20 changes: 20 additions & 0 deletions doc/program_ref.tex
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,26 @@ \subsection{C routine}\label{c-routine}
CINTdel_optimizer(&opt);
\end{verbatim}

In libcint-3 or above, new integral function signature are provided.
\begin{verbatim}
int1e_xxx(buf, dims, shls, atm, natm, bas, nbas, env, opt, cache);
int2e_xxx(buf, dims, shls, atm, natm, bas, nbas, env, opt, cache);
\end{verbatim}
In the new
function signature, the shape of output buffer (in column-major order) can be
specified. It's the second argument \verb$dims$. Integrals can be written
to the sub-block or the output buffer according to the information of
\verb$dims$. Another change is the runtime \verb$cache$ for integral
intermediates, which comes as the last arguments of the new signature. If
\verb$cache$ is specified, all integral intermediates will be put in the
\verb$cache$. The library will not use extra main memory during computatin. The
size of cache can be determined by the function if the first argument is set to
\verb$NULL$
\begin{verbatim}
int cache_size = int1e_xxx(NULL, dims, shls, atm, natm, bas, nbas, env, opt, NULL);
\end{verbatim}


\subsection{Fortran routine}\label{fortran-routine}

\begin{verbatim}
Expand Down
2 changes: 1 addition & 1 deletion include/cint.h.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2013- Qiming Sun <[email protected]>
*
* Parameters and function prototypes for libcint.
* Parameters and function signature for libcint.
*/

#define CINT_VERSION @cint_VERSION@
Expand Down
Loading

0 comments on commit bdf84cf

Please sign in to comment.