|
| 1 | +////////////////////////////////////////////////////////////////////////////////////// |
| 2 | +// This file is distributed under the University of Illinois/NCSA Open Source License. |
| 3 | +// See LICENSE file in top directory for details. |
| 4 | +// |
| 5 | +// Copyright (c) 2025 QMCPACK developers. |
| 6 | +// |
| 7 | +// File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory |
| 8 | +// |
| 9 | +// File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory |
| 10 | +////////////////////////////////////////////////////////////////////////////////////// |
| 11 | + |
| 12 | + |
| 13 | +#include "MultiBspline.hpp" |
| 14 | + |
| 15 | +namespace qmcplusplus |
| 16 | +{ |
| 17 | +template<typename T> |
| 18 | +typename MultiBsplineBase<T>::SplineType* MultiBspline<T>::createImpl(const Ugrid grid[3], |
| 19 | + const typename Base::BoundaryCondition bc[3], |
| 20 | + int num_splines) |
| 21 | +{ |
| 22 | + static_assert(std::is_same<T, typename Alloc::value_type>::value, "MultiBspline and Alloc data types must agree!"); |
| 23 | + if (getAlignedSize<T, Alloc::alignment>(num_splines) != num_splines) |
| 24 | + throw std::runtime_error("When creating the data space of MultiBspline, num_splines must be padded!\n"); |
| 25 | + return myAllocator.allocateMultiBspline(grid[0], grid[1], grid[2], bc[0], bc[1], bc[2], num_splines); |
| 26 | +} |
| 27 | + |
| 28 | +template<typename T> |
| 29 | +MultiBspline<T>::MultiBspline() = default; |
| 30 | + |
| 31 | +template<typename T> |
| 32 | +MultiBspline<T>::~MultiBspline() |
| 33 | +{ |
| 34 | + if (Base::spline_m != nullptr) |
| 35 | + myAllocator.destroy(Base::spline_m); |
| 36 | +} |
| 37 | + |
| 38 | +template class MultiBspline<float>; |
| 39 | +template class MultiBspline<double>; |
| 40 | +} // namespace qmcplusplus |
0 commit comments