Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_BigUIntDecl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_BIG_UINT_DECL_HPP
11#define TEUCHOS_BIG_UINT_DECL_HPP
12
13#include <iosfwd>
14#include <cstdint>
15
20namespace Teuchos {
21
33template <int n>
34class BigUInt {
35 private:
36 std::uint32_t x[n];
37 public:
38 BigUInt();
39 BigUInt(std::uint64_t v);
40 BigUInt(std::string const& s);
41 explicit operator bool() const noexcept;
42 std::uint32_t& operator[](int i);
43 std::uint32_t const& operator[](int i) const;
44 BigUInt& operator+=(std::uint32_t b);
45 BigUInt& operator+=(BigUInt const& b);
46 BigUInt& operator-=(std::uint32_t b);
47 BigUInt& operator-=(BigUInt const& b);
48 BigUInt& operator*=(std::uint32_t b);
49 BigUInt& operator<<=(std::uint32_t b);
50 BigUInt& operator>>=(std::uint32_t b);
51};
52
53template <int n>
54std::ostream& operator<<(std::ostream& os, BigUInt<n> a);
55template <int n>
56BigUInt<n> operator+(BigUInt<n> const& a, BigUInt<n> const& b);
57template <int n>
58BigUInt<n> operator-(BigUInt<n> const& a, BigUInt<n> const& b);
59template <int n>
60BigUInt<n> operator*(BigUInt<n> const& a, BigUInt<n> const& b);
61template <int n>
62BigUInt<n> operator/(BigUInt<n> const& a, std::uint32_t const& b);
63template <int n>
64BigUInt<n> operator/(BigUInt<n> const& a, BigUInt<n> const& b);
65template <int n>
66int comp(BigUInt<n> const& a, BigUInt<n> const& b);
67template <int n>
68bool operator>=(BigUInt<n> const& a, BigUInt<n> const& b);
69template <int n>
70bool operator<=(BigUInt<n> const& a, BigUInt<n> const& b);
71template <int n>
72bool operator<(BigUInt<n> const& a, BigUInt<n> const& b);
73template <int n>
74bool operator>(BigUInt<n> const& a, BigUInt<n> const& b);
75template <int n>
76bool operator==(BigUInt<n> const& a, BigUInt<n> const& b);
77template <int n>
78void divmod(BigUInt<n>& quotient, BigUInt<n>& x, std::uint32_t const& b);
79
80}
81
82#endif
Arbitrary-precision unsigned integer class.
Smart reference counting pointer class for automatic garbage collection.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...