Fix in dos_tetra_weights_3d: return array<..> instead of array_view<..>

-In triqs version 2.2 array_views no longer own the memory they point to
 This means that array variables that are local to a function should always
 be returned as arrray and never as an array_view
This commit is contained in:
Nils Wentzell 2019-07-02 10:49:35 -04:00
parent f0f998616e
commit 3807534ef8
3 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ static const double small = 2.5e-2, tol = 1e-8;
Returns corner contributions to the DOS of a band
*/
#ifdef __TETRA_ARRAY_VIEW
array_view<double, 2> dos_tetra_weights_3d(array_view<double, 1> eigk, double en, array_view<long, 2> itt)
array<double, 2> dos_tetra_weights_3d(array_view<double, 1> eigk, double en, array_view<long, 2> itt)
#else
array<double, 2> dos_tetra_weights_3d(array<double, 1> eigk, double en, array<long, 2> itt)
#endif

View File

@ -28,7 +28,7 @@ using triqs::arrays::array_view;
/// DOS of a band by analytical tetrahedron method
///
/// Returns corner weights for all tetrahedra for a given band and real energy.
array_view<double, 2>
array<double, 2>
dos_tetra_weights_3d(array_view<double, 1> eigk, /// Band energies for each k-point
double en, /// Energy at which DOS weights are to be calculated
array_view<long, 2> itt /// Tetrahedra defined by k-point indices

View File

@ -15,6 +15,6 @@ module.add_preamble("""
#include <triqs/cpp2py_converters/arrays.hpp>
""")
module.add_function ("array_view<double,2> dos_tetra_weights_3d (array_view<double,1> eigk, double en, array_view<long,2> itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""")
module.add_function ("array<double,2> dos_tetra_weights_3d (array_view<double,1> eigk, double en, array_view<long,2> itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""")
module.generate_code()