.. Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht Distributed under the terms of the BSD 3-Clause License. The full license is in the file LICENSE, distributed with this software. Basic types =========== xbasic_fixed_string ------------------- TODO xcomplex -------- `xcomplex` is the equivalent to `std::complex`, where the real ang imaginary part can be stored either as values, or as references. Therefore, it can be used as a proxy on real values already initialized. This is particularly interesting for storing real and imaginary parts in different containers, and gather them as complex values for computation. This allows optimzations (such as vectorization) on the real and imgaginary values. .. code:: #include #include #include "xtl/xcomplex.hpp" std::vector arg1_real = { 1., 2.}; std::vector arg1_imag = { 3., 4.}; std::vector arg2_real = { 2., 4.}; std::vector arg2_real = { 1., 3.}; std::vector res_real(2); std::vector res_imag(2); using complex = xtl::xcomplex; using const_complex = xtl::xcomplex; for (size_t i = 0; i < 2; ++i) { complex res(res_real[i], res_img[i]); res = const_complex(arg1_real, arg1_imag) * const_complex(arg2_real, arg2_imag); std::cout << "res = (" << res.real(), << ", " << res.imag() << std::endl; } The API of `xtl::xcomplex` is the same as that of `std::complex`, with the ability to store values as references. Full documentation can be found on `cppreference `_. half_float ---------- The `half_float` class implements an IEEE-conformant half-precision floating-point type with the usual arithmetic operators and conversions. It is implicitly convertible from single-precision floating-point, which makes expressions and functions with mixed-type operands to be of the most precise operand type. .. code:: #include