dftlibs / xcfun

XCFun: A library of exchange-correlation functionals with arbitrary-order derivatives
https://dftlibs.org/xcfun/
Mozilla Public License 2.0
58 stars 32 forks source link

Fix xcfun_get API function #113

Closed robertodr closed 4 years ago

robertodr commented 4 years ago

It was declared to accept an array of doubles, but the pointer type was really only meant as an in-out parameter.

The problem was caught when using it from Fortran (for the C/C++ type system a pointer as an in-out parameter or as an array is the same thing). I have thus edited the example to exercise the xcfun_get function as a test.

The proper solution would be to return the weight, rather than accept it as in-out parameter (with confusing semantics...) This requires rolling back the return for error codes in favor of just quitting on errors. I am working on it in another branch.

I'll mint a v2.0.0a4 as soon as this gets merged.

Types of changes

Status

codecov-io commented 4 years ago

Codecov Report

Merging #113 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #113   +/-   ##
=======================================
  Coverage   52.99%   52.99%           
=======================================
  Files          78       78           
  Lines        1970     1970           
=======================================
  Hits         1044     1044           
  Misses        926      926
Impacted Files Coverage Δ
src/XCFunctional.cpp 65.65% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 84814d2...0d4fee9. Read the comment docs.