Skip to content
Snippets Groups Projects
Commit da741084 authored by Martin Nolte's avatar Martin Nolte
Browse files

added vector space axpy to FieldMatrix

[[Imported from SVN: r5467]]
parent 57b24ffb
No related branches found
No related tags found
No related merge requests found
......@@ -277,6 +277,14 @@ namespace Dune {
return *this;
}
//! vector space axpy operation (*this += k y)
FieldMatrix &axpy ( const K &k, const FieldMatrix &y )
{
for( size_type i = 0; i < n; ++i )
p[ i ].axpy( k, y[ i ] );
return *this;
}
//===== linear maps
//! y = A x
......@@ -1033,6 +1041,13 @@ namespace Dune {
return *this;
}
//! vector space axpy operation (*this += a y)
FieldMatrix &axpy ( const K &k, const FieldMatrix &y )
{
a[ 0 ] += k * y.a[ 0 ];
return *this;
}
//===== linear maps
//! y = A x
......
......@@ -219,6 +219,8 @@ void test_matrix()
std::cout << A << std::endl;
// print vector
std::cout << f << std::endl;
A.axpy( K( 1 ), A );
}
int main()
......
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