Naming Conventions
In general, MIRP uses the following naming convention
- All C functions are prefixed with
mirp_
(except local, static functions)
- All C++ functions are within the namespace
mirp
and (and therefore lacking the mirp_
prefix) (except for functions in an anonymous namespace)
- Inputs for creating test files are given a
.inp
extension, while files with generated data are given a .dat
extension.
- Reference files have a
.ref
extension.
Integral Names
- Integral names are all lower case (ie, eri)
- Where appropriate, integrals that compute single cartesian components should be available and suffixed with an underscore (ie, eri_single)
Passing Data to/from Functions
- In general, functions do not pass data via
return
(except for small math functions). Functions may return some sort of status.
- Data is output to pointers passed in as arguments rather than through the return value.
- Documentation should be explicit about the size of arrays passed into functions
- Single objects of type
arb_t
can be passed as output references without a pointer
arb_t
contains an internal pointer, and structures are pass-by-copy. This is how the arblib library works, so that convention was adopted by MIRP
- Arrays should always be passed by pointer, of course
- Arrays of interval arithmetic types should be passed as
arb_ptr
or arb_srcptr
- All output variables passed to a function MUST be initialized first
- Then there is a clear, consistent location for
clear
ing an object (within the same function that init
ialized it).
- They should not be required to be zeroed, except in rare cases
Indexing
- Indexing of coefficient arrays for general contractions: the index of the primitive/exponent is the fastest index. (The index is
[g*nprim+p]
where g
is the index of the general contraction and p
the index of the primitive).
- Indexing of the output of integrals for generally contracted shells: The cartesian index is the fastest index, followed by the general contraction indicies (from right to left).