[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN/internal reference.hh foreign_matrix.hh
From: |
Tom Drummond |
Subject: |
[Toon-members] TooN/internal reference.hh foreign_matrix.hh |
Date: |
Sun, 12 Apr 2009 01:25:11 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Tom Drummond <twd20> 09/04/12 01:25:11
Added files:
internal : reference.hh
Removed files:
internal : foreign_matrix.hh
Log message:
renamed foreign_matrix.hh -> reference.hh
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/reference.hh?cvsroot=toon&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/foreign_matrix.hh?cvsroot=toon&r1=1.4&r2=0
Patches:
Index: reference.hh
===================================================================
RCS file: reference.hh
diff -N reference.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ reference.hh 12 Apr 2009 01:25:11 -0000 1.1
@@ -0,0 +1,79 @@
+// -*- c++ -*-
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper classes for matrices constructed as references to foreign data
+//
+
+struct Reference
+{
+
+ template<int Size, typename Precision>
+ struct VLayout
+ : public Internal::GenericVBase<Size, Precision, 1,
Internal::VectorSlice<Size, Precision> >
+ {
+
+ VLayout(Precision* p, int sz=0)
+ : Internal::GenericVBase<Size, Precision, 1,
Internal::VectorSlice<Size, Precision> >(p, sz, 0)
+ {}
+ };
+
+
+ struct RowMajor
+ {
+ template<int Rows, int Cols, class Precision>
+ struct MLayout
+ : public Internal::GenericMBase<Rows, Cols, Precision,
(Cols==-1?-2:Cols), 1, Internal::MatrixSlice<Rows, Cols, Precision> >
+ {
+ MLayout(Precision* p, int r=0, int c=0)
+ : Internal::GenericMBase<Rows,Cols,Precision,
(Cols==-1?-2:Cols), 1, Internal::MatrixSlice<Rows, Cols, Precision> > (p, r, c,
0, 0)
+ {}
+ };
+ };
+
+ struct ColMajor
+ {
+ template<int Rows, int Cols, class Precision> struct MLayout:
public Internal::GenericMBase<Rows, Cols, Precision, 1, (Rows==-1?-2:Rows),
Internal::MatrixSlice<Rows, Cols, Precision> >
+ {
+ MLayout(Precision* p, int r=0, int c=0)
+ : Internal::GenericMBase<Rows, Cols, Precision,
1, (Rows==-1?-2:Rows), Internal::MatrixSlice<Rows, Cols, Precision> >(p, r, c,
0, 0)
+ {}
+ };
+ };
+};
+
+template<int R, int C, typename Precision=double, class
Type=Reference::RowMajor> struct Wrap
+{
+ static Matrix<R, C, Precision, Type> wrap(Precision* p)
+ {
+ return Matrix<R, C, Precision, Type>(p);
+ }
+};
+
+
+template<int R, typename Precision, class Type> struct Wrap<R, Dynamic,
Precision, Type>
+{
+ static Matrix<R, Dynamic, Precision, Type> wrap(Precision* p, int cols)
+ {
+ return Matrix<R, Dynamic, Precision, Type>(p, 0, cols);
+ }
+};
+
+
+template<int C, typename Precision, class Type> struct Wrap<Dynamic, C,
Precision, Type>
+{
+ static Matrix<Dynamic, C, Precision, Type> wrap(Precision* p, int rows)
+ {
+ return Matrix<Dynamic, C, Precision, Type>(p, rows, 0);
+ }
+};
+
+
+template<typename Precision, class Type> struct Wrap<Dynamic, Dynamic,
Precision, Type>
+{
+ static Matrix<Dynamic, Dynamic, Precision, Type> wrap(Precision* p, int
rows, int cols)
+ {
+ return Matrix<Dynamic, Dynamic, Precision, Type>(p, rows, cols);
+ }
+};
+
Index: foreign_matrix.hh
===================================================================
RCS file: foreign_matrix.hh
diff -N foreign_matrix.hh
--- foreign_matrix.hh 12 Apr 2009 01:23:46 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,79 +0,0 @@
-// -*- c++ -*-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Helper classes for matrices constructed as references to foreign data
-//
-
-struct Reference
-{
-
- template<int Size, typename Precision>
- struct VLayout
- : public Internal::GenericVBase<Size, Precision, 1,
Internal::VectorSlice<Size, Precision> >
- {
-
- VLayout(Precision* p, int sz=0)
- : Internal::GenericVBase<Size, Precision, 1,
Internal::VectorSlice<Size, Precision> >(p, sz, 0)
- {}
- };
-
-
- struct RowMajor
- {
- template<int Rows, int Cols, class Precision>
- struct MLayout
- : public Internal::GenericMBase<Rows, Cols, Precision,
(Cols==-1?-2:Cols), 1, Internal::MatrixSlice<Rows, Cols, Precision> >
- {
- MLayout(Precision* p, int r=0, int c=0)
- : Internal::GenericMBase<Rows,Cols,Precision,
(Cols==-1?-2:Cols), 1, Internal::MatrixSlice<Rows, Cols, Precision> > (p, r, c,
0, 0)
- {}
- };
- };
-
- struct ColMajor
- {
- template<int Rows, int Cols, class Precision> struct MLayout:
public Internal::GenericMBase<Rows, Cols, Precision, 1, (Rows==-1?-2:Rows),
Internal::MatrixSlice<Rows, Cols, Precision> >
- {
- MLayout(Precision* p, int r=0, int c=0)
- : Internal::GenericMBase<Rows, Cols, Precision,
1, (Rows==-1?-2:Rows), Internal::MatrixSlice<Rows, Cols, Precision> >(p, r, c,
0, 0)
- {}
- };
- };
-};
-
-template<int R, int C, typename Precision=double, class
Type=Reference::RowMajor> struct Wrap
-{
- static Matrix<R, C, Precision, Type> wrap(Precision* p)
- {
- return Matrix<R, C, Precision, Type>(p);
- }
-};
-
-
-template<int R, typename Precision, class Type> struct Wrap<R, Dynamic,
Precision, Type>
-{
- static Matrix<R, Dynamic, Precision, Type> wrap(Precision* p, int cols)
- {
- return Matrix<R, Dynamic, Precision, Type>(p, 0, cols);
- }
-};
-
-
-template<int C, typename Precision, class Type> struct Wrap<Dynamic, C,
Precision, Type>
-{
- static Matrix<Dynamic, C, Precision, Type> wrap(Precision* p, int rows)
- {
- return Matrix<Dynamic, C, Precision, Type>(p, rows, 0);
- }
-};
-
-
-template<typename Precision, class Type> struct Wrap<Dynamic, Dynamic,
Precision, Type>
-{
- static Matrix<Dynamic, Dynamic, Precision, Type> wrap(Precision* p, int
rows, int cols)
- {
- return Matrix<Dynamic, Dynamic, Precision, Type>(p, rows, cols);
- }
-};
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN/internal reference.hh foreign_matrix.hh,
Tom Drummond <=