]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a nasty bug.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Apr 2004 02:33:12 +0000 (02:33 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Apr 2004 02:33:12 +0000 (02:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@8976 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/vector.templates.h

index 4912173dbf2622b16ba885046aa40a2852d24a47..07ea7fd246731ef392ea11aa144d2059ebda9a39 100644 (file)
@@ -51,7 +51,7 @@ Vector<Number>::Vector (const Vector<Number>& v)
                maxdim(v.size()),
                val(0)
 {
-  if (dim)
+  if (dim != 0)
     {
       val = new Number[maxdim];
       Assert (val != 0, ExcOutOfMemory());
@@ -69,7 +69,7 @@ Vector<Number>::Vector (const Vector<Number>& v)
 //             maxdim(v.size()),
 //             val(0)
 // {
-//   if (dim)
+//   if (dim != 0)
 //     {
 //       val = new Number[maxdim];
 //       Assert (val != 0, ExcOutOfMemory());
@@ -87,7 +87,7 @@ Vector<Number>::Vector (const PETScWrappers::Vector &v)
                maxdim(v.size()),
                val(0)
 {
-  if (dim)
+  if (dim != 0)
     {
       val = new Number[maxdim];
       Assert (val != 0, ExcOutOfMemory());
@@ -112,11 +112,11 @@ Vector<Number>::Vector (const PETScWrappers::Vector &v)
 template <typename Number>
 Vector<Number>::Vector (const PETScWrappers::MPI::Vector &v)
                 :
-               dim(v.size()),
-               maxdim(v.size()),
+               dim(0),
+               maxdim(0),
                val(0)
 {
-  if (dim)
+  if (v.size() != 0)
     {
                                        // do this in a two-stage process:
                                        // first convert to a sequential petsc
@@ -638,7 +638,7 @@ Vector<Number>::operator = (const PETScWrappers::Vector &v)
 {
   if (v.size() != dim)
     reinit (v.size(), true);
-  if (dim)
+  if (dim != 0)
     {
                                        // get a representation of the vector
                                        // and copy it

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.