24 template <
class PtrType>
25 PtrType* ComputePtrBasedOnOffsetInOtherBuffer(PtrType* bufBStart,
size_t bufBLength, PtrType* bufAStart,
size_t bufALength, PtrType* ptrInA)
27 if (bufAStart ==
nullptr || bufBStart ==
nullptr || ptrInA ==
nullptr) {
28 throw std::invalid_argument(
"ComputePtrBasedOnOffsetInOtherBuffer: One or more input pointers are null.");
31 auto offset = ptrInA - bufAStart;
33 if (offset < 0 ||
static_cast<size_t>(offset) >= bufALength) {
34 throw std::out_of_range(
"ComputePtrBasedOnOffsetInOtherBuffer: Pointer into A is out of range.");
37 auto res = bufBStart + offset;
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30