MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
exception.hpp
1#ifndef MPQC_MATH_TENSOR_EXCEPTION_HPP
2#define MPQC_MATH_TENSOR_EXCEPTION_HPP
3
4#include "mpqc/utility/string.hpp"
5#include <util/misc/scexception.h>
6
7namespace mpqc {
8
11
13 template<typename Rank, typename Dim1, typename Dim2>
14 TensorDimensionsException(Rank rank, Dim1 dim1, Dim2 dim2)
15 : sc::SCException(("rank<" + string_cast(rank) + "> " +
16 "dimensions mismatch (" +
17 string_cast(dim1) + " != " + string_cast(dim2) +
18 ")").c_str())
19 {}
20 template<typename Rank1, typename Rank2, typename Dim1, typename Dim2>
21 TensorDimensionsException(Rank1 rank1, Rank2 rank2, Dim1 dim1, Dim2 dim2)
22 : sc::SCException(("rank<" + string_cast(rank1) + "> and" +
23 "rank<" + string_cast(rank2) + "> " +
24 "dimensions mismatch (" +
25 string_cast(dim1) + " != " + string_cast(dim2) +
26 ")").c_str())
27 {}
28 };
29
31 template<typename Rank, typename Index, typename Begin, typename End>
32 TensorIndexException(Rank rank, Index index, Begin begin, End end)
33 : sc::SCException(("rank<" + string_cast(rank) + "> " +
34 "index=" + string_cast(index) + " " +
35 "outside the dimensions [" +
36 string_cast(begin) + ":" + string_cast(end) + ")").c_str())
37 {}
38 };
39
41 template<typename Rank, typename Range, typename Begin, typename End>
42 TensorRangeException(Rank rank, Range range, Begin begin, End end)
43 : sc::SCException(("rank<" + string_cast(rank) + "> " +
44 "range=" + string_cast(range) + " " +
45 "outside the dimensions [" +
46 string_cast(begin) + ":" + string_cast(end) + ")").c_str())
47 {}
48 };
49
51
52}
53
54
55#endif /* MPQC_MATH_TENSOR_EXCEPTION_HPP */
This is a sc::Exception specialization that keeps track of the ClassDesc for the MPQC object from whi...
Definition scexception.h:43
std::string string_cast(const T &value)
cast type T to string
Definition string.hpp:14
Contains new MPQC code since version 3.
Definition integralenginepool.hpp:37
Definition range.hpp:144
Definition exception.hpp:12
Definition exception.hpp:30
Definition exception.hpp:40
Definition range.hpp:25

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.