On 17/06/10 14:23, Florian Rathgeber wrote:
Hi,
I was wondering why +=, *=, etc. are overloaded in the Vector class, but
not addition of Vectors and multiplication of Vectors by scalars.
Hence I tried the following:
namespace dolfin
{
Vector operator*( double a, const Vector& v )
{
Florian!
I cannot really follow your implementation of the binary addition operator.
See
http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
For an extensive discussion of the subject.
But yes, the binary linear algebra operators were not implemented in C++
because of of
Hi,
I was wondering why +=, *=, etc. are overloaded in the Vector class, but
not addition of Vectors and multiplication of Vectors by scalars.
Hence I tried the following:
namespace dolfin
{
Vector operator*( double a, const Vector& v )
{
Vector res( v );
res *= a;
return res;
3 matches
Mail list logo