[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN linoperators.hh
From: |
Edward Rosten |
Subject: |
[Toon-members] TooN linoperators.hh |
Date: |
Thu, 24 Jul 2008 19:46:41 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 08/07/24 19:46:41
Modified files:
. : linoperators.hh
Log message:
Operatror += for RefSkipMatrixRM, which makes a copy of the reference.
This has
to be done since the RefSkipMatrixRM from .slice() is a temporary can
only be
used as a const& or copied. For mutating operations like +=, a copy has
to be
used.
The earlier permissivity of gcc allowed to code to get away without
this.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/linoperators.hh?cvsroot=toon&r1=1.20&r2=1.21
Patches:
Index: linoperators.hh
===================================================================
RCS file: /cvsroot/toon/TooN/linoperators.hh,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- linoperators.hh 24 Jan 2008 15:07:41 -0000 1.20
+++ linoperators.hh 24 Jul 2008 19:46:41 -0000 1.21
@@ -850,6 +850,22 @@
return lhs;
}
+template <int Rows, int Cols, class MAccessor> inline
+RefSkipMatrixRM operator += (RefSkipMatrixRM lhs, const
FixedMatrix<Rows,Cols,MAccessor>& rhs)
+{
+ assert(lhs.num_rows() == Rows && lhs.num_cols() == Cols);
+ for(int r=0; r<Rows; r++)
+ for(int c=0; c<Cols; c++)
+ lhs[r][c] += rhs[r][c];
+
+ return lhs;
+}
+
+
+
+
+
+
/////////////////////
// operator - //
// Matrix - Matrix //
- [Toon-members] TooN linoperators.hh,
Edward Rosten <=