Skip to content
Snippets Groups Projects
Commit a2b4ce60 authored by Oliver Sander's avatar Oliver Sander
Browse files

operator* and mult_vector are const now

[[Imported from SVN: r1133]]
parent 2de2a21f
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ namespace Dune {
FieldVector<T,n>& operator[] (int j) {return a[j];}
//! matrix/vector multiplication
FieldVector<T,n> operator* (const FieldVector<T,m>& x)
FieldVector<T,n> operator* (const FieldVector<T,m>& x) const
{
FieldVector<T,n> z(0.0);
for (int j=0; j<m; j++)
......@@ -65,7 +65,7 @@ namespace Dune {
}
//! matrix/vector multiplication with vector stored in matrixform
Mat<n,1,T> mult_vector (const Mat<n,1,T>& x)
Mat<n,1,T> mult_vector (const Mat<n,1,T>& x) const
{
Mat<n,1,T> z(0.0);
for (int j=0; j<m; j++)
......@@ -126,6 +126,8 @@ namespace Dune {
return s;
}
// can't overload operator* twice
#if 0
//! scalar product of two vectors; one of them stored in matrixform
T operator* (const FieldVector<T,n>& b) const
{
......@@ -136,6 +138,7 @@ namespace Dune {
for (int i=0; i<n; i++) s += this->operator()(i,0) * b[i];
return s;
}
#endif
private:
//! built-in array to hold the data
......
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