[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN internal/vbase.hh test/as_foo.cc
From: |
Edward Rosten |
Subject: |
[Toon-members] TooN internal/vbase.hh test/as_foo.cc |
Date: |
Thu, 16 Apr 2009 17:54:10 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 09/04/16 17:54:10
Modified files:
internal : vbase.hh
test : as_foo.cc
Log message:
Added .as_slice() to be used internally.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vbase.hh?cvsroot=toon&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/TooN/test/as_foo.cc?cvsroot=toon&r1=1.1&r2=1.2
Patches:
Index: internal/vbase.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vbase.hh,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- internal/vbase.hh 16 Apr 2009 17:51:54 -0000 1.25
+++ internal/vbase.hh 16 Apr 2009 17:54:10 -0000 1.26
@@ -156,6 +156,11 @@
Matrix<Size, 1, Precision, Slice<Stride,1> > as_col(){
return Matrix<Size, 1, Precision, Slice<Stride,1> >(my_data,
size(), 1, stride(), 1, Slicing());
}
+
+ //This is a hack for in-place functions, so a const version is never
required.
+ Vector<Size, Precision, SliceVBase<Stride> > as_slice(){
+ return Vector<Size, Precision, SliceVBase<Stride> >(my_data,
size(), stride(), Slicing());
+ }
};
}
Index: test/as_foo.cc
===================================================================
RCS file: /cvsroot/toon/TooN/test/as_foo.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- test/as_foo.cc 16 Apr 2009 17:51:54 -0000 1.1
+++ test/as_foo.cc 16 Apr 2009 17:54:10 -0000 1.2
@@ -8,11 +8,13 @@
cout << v.as_row() << endl;
cout << v.as_col() << endl;
+ cout << v.as_slice() << endl;
Vector<> u = makeVector(1, 2, 3);
cout << u.as_row() << endl;
cout << u.as_col() << endl;
+ cout << v.as_slice() << endl;
}