File: tutorial_fwd.qbk

package info (click to toggle)
boost1.88 1.88.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 576,932 kB
  • sloc: cpp: 4,149,234; xml: 136,789; ansic: 35,092; python: 33,910; asm: 5,698; sh: 4,604; ada: 1,681; makefile: 1,633; pascal: 1,139; perl: 1,124; sql: 640; yacc: 478; ruby: 271; java: 77; lisp: 24; csh: 6
file content (248 lines) | stat: -rw-r--r-- 11,482 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
[/
  Copyright 2011 - 2020 John Maddock.
  Copyright 2013 - 2019 Paul A. Bristow.
  Copyright 2013 Christopher Kormanyos.

  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]

[section:fwd Forward Declarations]

The header `<boost/multiprecision/fwd.hpp>` contains forward declarations for class `number` plus all of the
available backends in the this library:

   namespace boost {
   namespace multiprecision {

      enum expression_template_option
      {
         et_off = 0,
         et_on = 1
      };

      template <class Backend>
      struct expression_template_default { /*details*/ };

      template <class Backend, expression_template_option ExpressionTemplates = expression_template_default<Backend>::value>
      class number;

      template <class T>
      struct is_number;

      enum cpp_integer_type
      {
         signed_magnitude = 1,
         unsigned_magnitude = 0,
         signed_packed = 3,
         unsigned_packed = 2
      };

      enum cpp_int_check_type
      {
         checked = 1,
         unchecked = 0
      };

      enum mpfr_allocation_type
      {
         allocate_stack,
         allocate_dynamic
      };
      //
      // Logging functions for lagged_adaptor:
      //
      template <class Backend>
      void log_postfix_event(const Backend&, const char* /*event_description*/);
      template <class Backend, class T>
      void log_postfix_event(const Backend&, const T&, const char* /*event_description*/);
      template <class Backend>
      void log_prefix_event(const Backend&, const char* /*event_description*/);
      template <class Backend, class T>
      void log_prefix_event(const Backend&, const T&, const char* /*event_description*/);
      template <class Backend, class T, class U>
      void log_prefix_event(const Backend&, const T&, const U&, const char* /*event_description*/);
      template <class Backend, class T, class U, class V>
      void log_prefix_event(const Backend&, const T&, const U&, const V&, const char* /*event_description*/);

      namespace backends {

         template <class Backend>
         struct debug_adaptor;

         template <class Backend>
         struct logged_adaptor;

         template <class Backend>
         struct complex_adaptor;

         enum digit_base_type
         {
            digit_base_2 = 2,
            digit_base_10 = 10
         };

         template <unsigned Digits, digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
         class cpp_bin_float;

         template <unsigned Digits10, class ExponentType = std::int32_t, class Allocator = void>
         class cpp_dec_float;

         template <std::size_t MinBits = 0, std::size_t MaxBits = 0, boost::multiprecision::cpp_integer_type SignType = signed_magnitude, cpp_int_check_type Checked = unchecked, class Allocator = typename std::conditional<MinBits && (MinBits == MaxBits), void, std::allocator<limb_type> >::type>
         struct cpp_int_backend;

         struct float128_backend;

         struct gmp_int;
         struct gmp_rational;

         template <unsigned digits10>
         struct gmp_float;

         template <unsigned digits10>
         struct mpc_complex_backend;

         template <unsigned digits10>
         struct mpfi_float_backend;

         template <unsigned digits10, mpfr_allocation_type AllocationType = allocate_dynamic>
         struct mpfr_float_backend;

         template <>
         struct mpfr_float_backend<0, allocate_stack>;

         template <class Backend>
         struct rational_adaptor;

         struct tommath_int;
      }
      //
      // All the backends are imported into boost::multiprecision:
      //
      using boost::multiprecision::backends::complex_adaptor;
      using boost::multiprecision::backends::debug_adaptor;
      using boost::multiprecision::backends::logged_adaptor;
      using backends::cpp_bin_float;
      using backends::digit_base_10;
      using backends::digit_base_2;
      using boost::multiprecision::backends::cpp_dec_float;
      using boost::multiprecision::backends::cpp_int_backend;
      using boost::multiprecision::backends::float128_backend;
      using boost::multiprecision::backends::gmp_float;
      using boost::multiprecision::backends::gmp_int;
      using boost::multiprecision::backends::gmp_rational;
      using boost::multiprecision::backends::mpc_complex_backend;
      using boost::multiprecision::backends::mpfi_float_backend;
      using boost::multiprecision::backends::mpfr_float_backend;
      using boost::multiprecision::backends::rational_adaptor;
      using boost::multiprecision::backends::tommath_int;

      //
      // convenience typedefs:
      //

      using cpp_bin_float_50 = number<backends::cpp_bin_float<50> >;
      using cpp_bin_float_100 = number<backends::cpp_bin_float<100> >;

      using cpp_bin_float_single = number<backends::cpp_bin_float<24, backends::digit_base_2, void, std::int16_t, -126, 127>, et_off>;
      using cpp_bin_float_double = number<backends::cpp_bin_float<53, backends::digit_base_2, void, std::int16_t, -1022, 1023>, et_off>;
      using cpp_bin_float_double_extended = number<backends::cpp_bin_float<64, backends::digit_base_2, void, std::int16_t, -16382, 16383>, et_off>;
      using cpp_bin_float_quad = number<backends::cpp_bin_float<113, backends::digit_base_2, void, std::int16_t, -16382, 16383>, et_off>;
      using cpp_bin_float_oct = number<backends::cpp_bin_float<237, backends::digit_base_2, void, std::int32_t, -262142, 262143>, et_off>;

      template <unsigned Digits, backends::digit_base_type DigitBase = backends::digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0>
      using cpp_complex_backend = complex_adaptor<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent> >;

      template <unsigned Digits, backends::digit_base_type DigitBase = digit_base_10, class Allocator = void, class Exponent = int, Exponent MinExponent = 0, Exponent MaxExponent = 0, expression_template_option ExpressionTemplates = et_off>
      using cpp_complex = number<complex_adaptor<cpp_bin_float<Digits, DigitBase, Allocator, Exponent, MinExponent, MaxExponent> >, ExpressionTemplates>;

      using cpp_complex_50 = cpp_complex<50>;
      using cpp_complex_100 = cpp_complex<100>;

      using cpp_complex_single = cpp_complex<24, backends::digit_base_2, void, std::int16_t, -126, 127>;
      using cpp_complex_double = cpp_complex<53, backends::digit_base_2, void, std::int16_t, -1022, 1023>;
      using cpp_complex_extended = cpp_complex<64, backends::digit_base_2, void, std::int16_t, -16382, 16383>;
      using cpp_complex_quad = cpp_complex<113, backends::digit_base_2, void, std::int16_t, -16382, 16383>;
      using cpp_complex_oct = cpp_complex<237, backends::digit_base_2, void, std::int32_t, -262142, 262143>;

      using cpp_dec_float_50 = number<cpp_dec_float<50> >;
      using cpp_dec_float_100 = number<cpp_dec_float<100> >;

      using cpp_int = number<cpp_int_backend<> >;
      using cpp_rational_backend = rational_adaptor<cpp_int_backend<> >;
      using cpp_rational = number<cpp_rational_backend>;

      // Fixed precision unsigned types:
      using uint128_t = number<cpp_int_backend<128, 128, unsigned_magnitude, unchecked, void> >;
      using uint256_t = number<cpp_int_backend<256, 256, unsigned_magnitude, unchecked, void> >;
      using uint512_t = number<cpp_int_backend<512, 512, unsigned_magnitude, unchecked, void> >;
      using uint1024_t = number<cpp_int_backend<1024, 1024, unsigned_magnitude, unchecked, void> >;

      // Fixed precision signed types:
      using int128_t = number<cpp_int_backend<128, 128, signed_magnitude, unchecked, void> >;
      using int256_t = number<cpp_int_backend<256, 256, signed_magnitude, unchecked, void> >;
      using int512_t = number<cpp_int_backend<512, 512, signed_magnitude, unchecked, void> >;
      using int1024_t = number<cpp_int_backend<1024, 1024, signed_magnitude, unchecked, void> >;

      // Over again, but with checking enabled this time:
      using checked_cpp_int = number<cpp_int_backend<0, 0, signed_magnitude, checked> >;
      using checked_cpp_rational_backend = rational_adaptor<cpp_int_backend<0, 0, signed_magnitude, checked> >;
      using checked_cpp_rational = number<checked_cpp_rational_backend>;
      // Fixed precision unsigned types:
      using checked_uint128_t = number<cpp_int_backend<128, 128, unsigned_magnitude, checked, void> >;
      using checked_uint256_t = number<cpp_int_backend<256, 256, unsigned_magnitude, checked, void> >;
      using checked_uint512_t = number<cpp_int_backend<512, 512, unsigned_magnitude, checked, void> >;
      using checked_uint1024_t = number<cpp_int_backend<1024, 1024, unsigned_magnitude, checked, void> >;

      // Fixed precision signed types:
      using checked_int128_t = number<cpp_int_backend<128, 128, signed_magnitude, checked, void> >;
      using checked_int256_t = number<cpp_int_backend<256, 256, signed_magnitude, checked, void> >;
      using checked_int512_t = number<cpp_int_backend<512, 512, signed_magnitude, checked, void> >;
      using checked_int1024_t = number<cpp_int_backend<1024, 1024, signed_magnitude, checked, void> >;

      template <class Number>
      using debug_adaptor_t = number<debug_adaptor<typename Number::backend_type>, Number::et>;
      template <class Number>
      using logged_adaptor_t = number<logged_adaptor<typename Number::backend_type>, Number::et>;

      using float128 = number<float128_backend, et_off>;
      using complex128 = number<complex_adaptor<float128_backend>, et_off>;

      using mpf_float_50 = number<gmp_float<50> >;
      using mpf_float_100 = number<gmp_float<100> >;
      using mpf_float_500 = number<gmp_float<500> >;
      using mpf_float_1000 = number<gmp_float<1000> >;
      using mpf_float = number<gmp_float<0> >;
      using mpz_int = number<gmp_int>;
      using mpq_rational = number<gmp_rational>;

      using mpc_complex_50 = number<mpc_complex_backend<50> >;
      using mpc_complex_100 = number<mpc_complex_backend<100> >;
      using mpc_complex_500 = number<mpc_complex_backend<500> >;
      using mpc_complex_1000 = number<mpc_complex_backend<1000> >;
      using mpc_complex = number<mpc_complex_backend<0> >;

      using mpfi_float_50 = number<mpfi_float_backend<50> >;
      using mpfi_float_100 = number<mpfi_float_backend<100> >;
      using mpfi_float_500 = number<mpfi_float_backend<500> >;
      using mpfi_float_1000 = number<mpfi_float_backend<1000> >;
      using mpfi_float = number<mpfi_float_backend<0> >;

      using mpfr_float_50 = number<mpfr_float_backend<50> >;
      using mpfr_float_100 = number<mpfr_float_backend<100> >;
      using mpfr_float_500 = number<mpfr_float_backend<500> >;
      using mpfr_float_1000 = number<mpfr_float_backend<1000> >;
      using mpfr_float = number<mpfr_float_backend<0> >;

      using static_mpfr_float_50 = number<mpfr_float_backend<50, allocate_stack> >;
      using static_mpfr_float_100 = number<mpfr_float_backend<100, allocate_stack> >;

      using tom_int = number<tommath_int>;
      using tommath_rational = rational_adaptor<tommath_int>;
      using tom_rational = number<tommath_rational>;

    } }


[endsect] [/section]