pairinteraction
A Rydberg Interaction Calculator
eigen_assertion.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Pairinteraction Developers
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4#pragma once
5
6#include <cpptrace/cpptrace.hpp>
7
8#ifdef eigen_assert
9#error "'utils/eigen_assertion.hpp' must be included before any Eigen header"
10#else
11#define eigen_assert(X) \
12 if (!(X)) { \
13 throw cpptrace::runtime_error("<EIGEN> Assertion " EIGEN_MAKESTRING( \
14 X) " failed at " __FILE__ ":" EIGEN_MAKESTRING(__LINE__)); \
15 }
16#endif