Skip to content
Snippets Groups Projects
Commit 425df354 authored by Markus Blatt's avatar Markus Blatt
Browse files

Merged latest patches from the trunk

[[Imported from SVN: r1719]]
parents b1b6e414 ef7b99c7
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ namespace Dune {
* @param y other (compatible) vector
* @return
*/
template<class OtherB, class OtherA=std::allocator<OtherB> >
template<class OtherB, class OtherA>
typename PromotionTraits<field_type,typename OtherB::field_type>::PromotedType operator* (const block_vector_unmanaged<OtherB,OtherA>& y) const
{
typedef typename PromotionTraits<field_type,typename OtherB::field_type>::PromotedType PromotedType;
......@@ -147,7 +147,7 @@ namespace Dune {
* @param y other (compatible) vector
* @return
*/
template<class OtherB, class OtherA=std::allocator<OtherB> >
template<class OtherB, class OtherA>
typename PromotionTraits<field_type,typename OtherB::field_type>::PromotedType dot(const block_vector_unmanaged<OtherB,OtherA>& y) const
{
typedef typename PromotionTraits<field_type,typename OtherB::field_type>::PromotedType PromotedType;
......@@ -879,7 +879,7 @@ namespace Dune {
{
typename V::ConstIterator e=this->end();
for (size_type i=0; i<y.n; i++)
if (find(y.j[i])==e)
if (this->find(y.j[i])==e)
return false;
return true;
}
......
This diff is collapsed.
......@@ -15,9 +15,9 @@
#include "istlexception.hh"
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
#include <dune/istl/matrix.hh>
#include <dune/istl/diagonalmatrix.hh>
#include <dune/istl/scaledidmatrix.hh>
#include "bcrsmatrix.hh"
......
......@@ -9,7 +9,7 @@
#include <dune/common/typetraits.hh>
#include <dune/common/static_assert.hh>
#include <dune/common/fmatrix.hh>
#include <dune/istl/diagonalmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
#include <dune/istl/scaledidmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>
#include "istlexception.hh"
......
......@@ -397,13 +397,13 @@ namespace Dune
typedef typename Matrix::ConstColIterator ColIter;
typedef typename Matrix::block_type Block;
Block zero;
Block diagonal;
zero=typename Matrix::field_type();
const Matrix& mat=matrices_->matrices().finest()->getmat();
for(RowIter row=mat.begin(); row!=mat.end(); ++row) {
bool isDirichlet = true;
bool hasDiagonal = false;
Block diagonal;
for(ColIter col=row->begin(); col!=row->end(); ++col) {
if(row.index()==col.index()) {
diagonal = *col;
......@@ -413,7 +413,7 @@ namespace Dune
isDirichlet = false;
}
}
if(isDirichlet)
if(isDirichlet && hasDiagonal)
diagonal.solve(x[row.index()], b[row.index()]);
}
......
......@@ -15,7 +15,7 @@
#include <iostream>
#include <dune/common/exceptions.hh>
#include <dune/common/fmatrix.hh>
#include <dune/istl/diagonalmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
namespace Dune {
......
......@@ -4,7 +4,6 @@ Makefile.in
.libs
semantic.cache
complexrhstest
diagonalmatrixtest
dotproducttest
bvectortest
matrixutilstest
......
......@@ -21,7 +21,6 @@ NORMALTESTS = basearraytest \
bcrsbuildtest \
bvectortest \
complexrhstest \
diagonalmatrixtest \
dotproducttest \
iotest \
matrixiteratortest \
......@@ -88,8 +87,6 @@ complexrhstest_LDADD= $(SUPERLU_LIBS)
complexrhstest_LDFLAGS= $(AM_LDFLAGS) $(SUPERLU_LDFLAGS)
complexrhstest_CPPFLAGS=$(AM_CPPFLAGS) $(SUPERLU_CPPFLAGS) -DSUPERLU_NTYPE=3
diagonalmatrixtest_SOURCES = diagonalmatrixtest.cc
dotproducttest_SOURCES = dotproducttest.cc
vbvectortest_SOURCES = vbvectortest.cc
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#include "config.h"
#include <dune/istl/diagonalmatrix.hh>
#include <iostream>
#include <algorithm>
#include <dune/common/fvector.hh>
#include <dune/common/exceptions.hh>
using namespace Dune;
template<class K, int n>
void test_matrix()
{
typedef typename DiagonalMatrix<K,n>::size_type size_type;
DiagonalMatrix<K,n> A(1);
FieldVector<K,n> f;
FieldVector<K,n> v;
// assign matrix
A=2;
// assign vector
f = 1;
v = 2;
// matrix vector product
A.umv(v,f);
// test norms
A.frobenius_norm();
A.frobenius_norm2();
A.infinity_norm();
A.infinity_norm_real();
std::sort(v.begin(), v.end());
// print matrix
std::cout << A << std::endl;
// print vector
std::cout << f << std::endl;
// assign to FieldMatrix
FieldMatrix<K,n,n> AFM = FieldMatrix<K,n,n>(A);
}
int main()
{
try {
test_matrix<float, 1>();
test_matrix<double, 1>();
test_matrix<double, 5>();
}
catch (Dune::Exception & e)
{
std::cerr << "Exception: " << e << std::endl;
}
}
......@@ -2,7 +2,7 @@
// vi: set et ts=4 sw=2 sts=2:
#include "config.h"
#include <dune/common/fmatrix.hh>
#include <dune/istl/diagonalmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
#include <dune/istl/scaledidmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dune/istl/io.hh>
......
......@@ -8,12 +8,12 @@
#include <fenv.h>
#include <dune/common/fmatrix.hh>
#include <dune/common/diagonalmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dune/istl/matrix.hh>
#include <dune/istl/bdmatrix.hh>
#include <dune/istl/btdmatrix.hh>
#include <dune/istl/scaledidmatrix.hh>
#include <dune/istl/diagonalmatrix.hh>
using namespace Dune;
......@@ -197,7 +197,7 @@ void testMatrix(MatrixType& matrix, X& x, Y& y)
matrix = 0;
// The copy constructor
MatrixType thirdMatrix(matrix);
DUNE_UNUSED MatrixType thirdMatrix(matrix);
// ///////////////////////////////////////////////////////
// Test component-wise operations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment