]> https://gitweb.dealii.org/ - dealii.git/commitdiff
vector2d for LAPACK enhancement
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 21 May 2001 21:17:35 +0000 (21:17 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 21 May 2001 21:17:35 +0000 (21:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@4684 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/full_matrix.double.cc

index 0b6cfca695026122e31eacf8a98af2d89a9e963b..15986ce5bd920c5e3206a64d8f73641d94b8a562 100644 (file)
@@ -91,13 +91,18 @@ template<>
 void
 FullMatrix<double>::invert (const FullMatrix<double> &M)
 {
+  double* val = const_cast<double*> (data());
+
   Assert (val != 0, ExcEmptyMatrix());
   
+  unsigned int dim_range = n_cols ();
+  unsigned int dim_image = n_rows ();
+  
   Assert (dim_range == dim_image, ExcNotQuadratic());
-  Assert (dim_range == M.dim_range,
-          ExcDimensionMismatch(dim_range,M.dim_range));
-  Assert (dim_image == M.dim_image,
-         ExcDimensionMismatch(dim_image,M.dim_image));
+  Assert (dim_range == M.n_cols(),
+          ExcDimensionMismatch(dim_range,M.n_cols()));
+  Assert (dim_image == M.n_rows(),
+         ExcDimensionMismatch(dim_image,M.n_rows()));
 
   clear();
   diagadd(1.);
@@ -112,7 +117,7 @@ FullMatrix<double>::invert (const FullMatrix<double> &M)
   double* s = new double[dim_range];
   
   double* matrix = new double[dim_range*dim_range];
-  std::copy (&M.val[0], &M.val[dim_image*dim_range], matrix);
+  std::copy (M.data(), M.data()+dim_image*dim_range, matrix);
   
 
   int erg = dgelss_ (&dim_range, &dim_range, &dim_range,

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.