]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adolc/Symengine: always instantiate complex valued variants
authorMatthias Maier <tamiko@43-1.org>
Tue, 13 Aug 2024 19:41:11 +0000 (14:41 -0500)
committerMatthias Maier <tamiko@43-1.org>
Tue, 13 Aug 2024 21:27:12 +0000 (16:27 -0500)
source/differentiation/ad/adolc_number_types.inst.in
source/differentiation/ad/sacado_number_types.inst1.in
source/differentiation/ad/sacado_number_types.inst2.in
source/differentiation/sd/symengine_number_visitor_internal.inst.in
source/differentiation/sd/symengine_optimizer.inst.in

index ce17589e31cf6d5ed9e09b0b444414a8ff495554..bb3b795787483617774cfe863ac157213edb5727 100644 (file)
@@ -32,19 +32,10 @@ for (Number : REAL_SCALARS)
       \{
         template struct NumberTraits<Number, NumberTypes::adolc_taped>;
         template struct NumberTraits<Number, NumberTypes::adolc_tapeless>;
-      \}
-    \}
-  }
-
-
-for (Number : COMPLEX_SCALARS)
-  {
-    namespace Differentiation
-    \{
-      namespace AD
-      \{
-        template struct NumberTraits<Number, NumberTypes::adolc_taped>;
-        template struct NumberTraits<Number, NumberTypes::adolc_tapeless>;
+        template struct NumberTraits<std::complex<Number>,
+                                     NumberTypes::adolc_taped>;
+        template struct NumberTraits<std::complex<Number>,
+                                     NumberTypes::adolc_tapeless>;
       \}
     \}
   }
index a80d8e70b7f374eff24dec5bbe9f2ba3c1bb1462..6093495bfcef2968b70e3aa9edd23d1bf5f8fe2c 100644 (file)
@@ -32,21 +32,10 @@ for (Number : REAL_SCALARS)
     \{
     template struct NumberTraits<Number,NumberTypes::sacado_dfad>;
     template struct NumberTraits<Number,NumberTypes::sacado_dfad_dfad>;
+    template struct NumberTraits<std::complex<Number>,NumberTypes::sacado_dfad>;
+    template struct NumberTraits<std::complex<Number>,NumberTypes::sacado_dfad_dfad>;
     template struct NumberTraits<Number,NumberTypes::sacado_rad>;
     template struct NumberTraits<Number,NumberTypes::sacado_rad_dfad>;
     \}
     \}
 }
-
-
-for (Number : COMPLEX_SCALARS)
-{
-    namespace Differentiation
-    \{
-    namespace AD
-    \{
-    template struct NumberTraits<Number,NumberTypes::sacado_dfad>;
-    template struct NumberTraits<Number,NumberTypes::sacado_dfad_dfad>;
-    \}
-    \}
-}
index 31bbc8ed3e65a40108f7c1796bab8f5f86702b0a..659c5dba578c85e340f09deb3d1a6e738a701b84 100644 (file)
 // ------------------------------------------------------------------------
 
 
-for (Number : COMPLEX_SCALARS)
+for (Number : REAL_SCALARS)
 {
     namespace Differentiation
     \{
     namespace AD
     \{
-    template struct NumberTraits<Number,NumberTypes::sacado_rad>;
-    template struct NumberTraits<Number,NumberTypes::sacado_rad_dfad>;
+    template struct NumberTraits<std::complex<Number>,NumberTypes::sacado_rad>;
+    template struct NumberTraits<std::complex<Number>,NumberTypes::sacado_rad_dfad>;
     \}
     \}
 }
index e0c22e38b219dea0e613e91dc5b81f1ce2b419f6..b037b9935d82e972d63e0ab4721e06f0bb2da4b7 100644 (file)
@@ -24,23 +24,10 @@ for (number : REAL_SCALARS)
 
           template class CSEDictionaryVisitor<number, SD::Expression>;
           template class DictionarySubstitutionVisitor<number, SD::Expression>;
-
-        \}
-      \}
-    \}
-  }
-
-for (number : COMPLEX_SCALARS)
-  {
-    namespace Differentiation
-    \{
-      namespace SD
-      \{
-        namespace internal
-        \{
-
-          template class CSEDictionaryVisitor<number, SD::Expression>;
-          template class DictionarySubstitutionVisitor<number, SD::Expression>;
+          template class CSEDictionaryVisitor<std::complex<number>,
+                                              SD::Expression>;
+          template class DictionarySubstitutionVisitor<std::complex<number>,
+                                                       SD::Expression>;
 
         \}
       \}
index d0052de4bcecaacdca90b0e4ec3c416a9abef700..51a8363536dd5b7ddc1f587326545b72bb40b861 100644 (file)
@@ -21,19 +21,7 @@ for (number : REAL_SCALARS)
       \{
 
         template class BatchOptimizer<number>;
-
-      \}
-    \}
-  }
-
-for (number : COMPLEX_SCALARS)
-  {
-    namespace Differentiation
-    \{
-      namespace SD
-      \{
-
-        template class BatchOptimizer<number>;
+        template class BatchOptimizer<std::complex<number>>;
 
       \}
     \}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.