]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / math / example / daubechies_wavelets / daubechies_scaling_memory_occupation.cpp
diff --git a/ceph/src/boost/libs/math/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp b/ceph/src/boost/libs/math/example/daubechies_wavelets/daubechies_scaling_memory_occupation.cpp
new file mode 100644 (file)
index 0000000..43ae807
--- /dev/null
@@ -0,0 +1,59 @@
+#include <iostream>
+#include <boost/math/special_functions/daubechies_scaling.hpp>
+#include <boost/core/demangle.hpp>
+#include <boost/hana/for_each.hpp>
+#include <boost/hana/ext/std/integer_sequence.hpp>
+
+int main()
+{
+    boost::hana::for_each(std::make_index_sequence<18>(),
+    [](auto i) {
+        std::cout << std::right;
+        auto daub = boost::math::daubechies_scaling<float, i+2>();
+        std::cout << "The Daubechies " << std::setw(2) <<  i + 2 << " scaling function occupies " 
+                  << std::setw(12) << daub.bytes()/1000.0 << " kilobytes in relative accuracy mode in "
+                  << boost::core::demangle(typeid(float).name()) << " precision\n";
+    });
+
+    std::cout << std::endl;
+    std::cout << std::endl;
+    std::cout << std::endl;
+
+    boost::hana::for_each(std::make_index_sequence<18>(),
+    [](auto i) {
+        std::cout << std::right;
+        auto daub = boost::math::daubechies_scaling<float, i+2>(-2);
+        std::cout << "The Daubechies " << std::setw(2) <<  i + 2 << " scaling function occupies " 
+                  << std::setw(12) << daub.bytes()/1000.0 << " kilobytes in absolute accuracy mode in "
+                  << boost::core::demangle(typeid(float).name()) << " precision\n";
+    });
+
+    std::cout << std::endl;
+    std::cout << std::endl;
+    std::cout << std::endl;
+
+
+    boost::hana::for_each(std::make_index_sequence<18>(),
+    [](auto i) {
+        std::cout << std::right;
+        auto daub = boost::math::daubechies_scaling<double, i+2>();
+        std::cout << "The Daubechies " << std::setw(2) <<  i + 2 << " scaling function occupies " 
+                  << std::setw(12) << daub.bytes()/1000.0 << " kilobytes in relative accuracy mode in "
+                  << boost::core::demangle(typeid(double).name()) << " precision\n";
+    });
+
+    std::cout << std::endl;
+    std::cout << std::endl;
+    std::cout << std::endl;
+
+    boost::hana::for_each(std::make_index_sequence<18>(),
+    [](auto i) {
+        std::cout << std::right;
+        auto daub = boost::math::daubechies_scaling<double, i+2>(-2);
+        std::cout << "The Daubechies " << std::setw(2) <<  i + 2 << " scaling function occupies " 
+                  << std::setw(12) << daub.bytes()/1000.0 << " kilobytes in absolute accuracy mode in "
+                  << boost::core::demangle(typeid(double).name()) << " precision\n";
+    });
+
+
+}