Hello Wolfgang,

Here is the patch. I added one more change in functions 
Vector<Number>::reinit:
   if (omit_zeroing_entries == false)
    *this = static_cast<Number>(0);
The line above fails if the Number type is not primitive. If it is a class 
it can't cast. So it could be:
   if (omit_zeroing_entries == false)
    *this = Number(0);
Therefore it will call a constructor or simply create a primitive type. I 
do not know if there are some ramifications of changing that line.
Please have a look.

Dragan


On Saturday, September 10, 2016 at 8:30:42 PM UTC+1, Wolfgang Bangerth 
wrote:
>
> On 09/10/2016 11:22 AM, [email protected] <javascript:> wrote: 
> > Yes, no problem. I see those files changed a lot since the 8.4.1 
> release. 
> > Anyway, I see the two spots are the same as in 8.4.1. I'll send you the 
> patch. 
>
> Fantastic, thanks! 
> W. 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 [email protected] 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
>From e5f7343bd5e39ade4ec8923a735fd6444bdd0c62 Mon Sep 17 00:00:00 2001
From: ciroki <ciroki@debian>
Date: Sat, 10 Sep 2016 19:44:03 +0100
Subject: [PATCH 1/2] Moved explicit instantiations from lac/vector.templates.h
 to lac/vector.cc.

---
 include/deal.II/lac/vector.templates.h | 17 ++---------------
 source/lac/vector.cc                   | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h
index ce2a228..6861b4f 100644
--- a/include/deal.II/lac/vector.templates.h
+++ b/include/deal.II/lac/vector.templates.h
@@ -386,16 +386,7 @@ Vector<Number>::operator= (const Number s)
 #ifdef DEAL_II_BOOST_BIND_COMPILER_BUG
 template <>
 Vector<std::complex<float> > &
-Vector<std::complex<float> >::operator= (const std::complex<float> s)
-{
-  AssertIsFinite(s);
-  if (s != std::complex<float>())
-    Assert (vec_size!=0, ExcEmptyObject());
-  if (vec_size!=0)
-    std::fill (begin(), end(), s);
-
-  return *this;
-}
+Vector<std::complex<float> >::operator= (const std::complex<float> s);
 #endif
 
 
@@ -606,11 +597,7 @@ Vector<Number>::lp_norm (const real_type p) const
 
 template <>
 Vector<int>::real_type
-Vector<int>::lp_norm (const real_type) const
-{
-  Assert(false, ExcMessage("No lp norm for integer vectors"));
-  return -1;
-}
+Vector<int>::lp_norm (const real_type) const;
 
 
 
diff --git a/source/lac/vector.cc b/source/lac/vector.cc
index 4f23c08..852d4c9 100644
--- a/source/lac/vector.cc
+++ b/source/lac/vector.cc
@@ -66,4 +66,27 @@ TEMPL_OP_EQ(std::complex<float>,std::complex<double>);
 
 #undef TEMPL_OP_EQ
 
+#ifdef DEAL_II_BOOST_BIND_COMPILER_BUG
+template <>
+Vector<std::complex<float> > &
+Vector<std::complex<float> >::operator= (const std::complex<float> s)
+{
+    AssertIsFinite(s);
+    if (s != std::complex<float>())
+        Assert (vec_size!=0, ExcEmptyObject());
+    if (vec_size!=0)
+        std::fill (begin(), end(), s);
+    
+    return *this;
+}
+#endif
+
+template <>
+Vector<int>::real_type
+Vector<int>::lp_norm (const real_type) const
+{
+    Assert(false, ExcMessage("No lp norm for integer vectors"));
+    return -1;
+}
+
 DEAL_II_NAMESPACE_CLOSE
-- 
2.1.4


>From 023d5a137b164c27b9157dc73500033497ae1e2b Mon Sep 17 00:00:00 2001
From: ciroki <ciroki@debian>
Date: Mon, 12 Sep 2016 14:45:24 +0100
Subject: [PATCH 2/2] Fixed Vector::reinit: static_cast<Number>(0) replaced
 with Number(0).

---
 include/deal.II/lac/vector.templates.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h
index 6861b4f..2c5482e 100644
--- a/include/deal.II/lac/vector.templates.h
+++ b/include/deal.II/lac/vector.templates.h
@@ -304,7 +304,7 @@ void Vector<Number>::reinit (const size_type n,
     }
 
   if (omit_zeroing_entries == false)
-    *this = static_cast<Number>(0);
+    *this = Number(0);
 }
 
 
@@ -332,7 +332,7 @@ void Vector<Number>::reinit (const Vector<Number2> &v,
     };
   vec_size = v.vec_size;
   if (omit_zeroing_entries == false)
-    *this = static_cast<Number>(0);
+    *this = Number(0);
 }
 
 
-- 
2.1.4

Reply via email to