[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN TooN.h internal/vbase.hh
From: |
Edward Rosten |
Subject: |
[Toon-members] TooN TooN.h internal/vbase.hh |
Date: |
Mon, 02 Nov 2009 16:26:55 +0000 |
CVSROOT: /cvsroot/toon
Module name: TooN
Changes by: Edward Rosten <edrosten> 09/11/02 16:26:55
Modified files:
. : TooN.h
internal : vbase.hh
Log message:
Removed End<> and all wierd variants.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/TooN.h?cvsroot=toon&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/vbase.hh?cvsroot=toon&r1=1.42&r2=1.43
Patches:
Index: TooN.h
===================================================================
RCS file: /cvsroot/toon/TooN/TooN.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- TooN.h 28 Sep 2009 08:31:58 -0000 1.56
+++ TooN.h 2 Nov 2009 16:26:55 -0000 1.57
@@ -241,65 +241,6 @@
static const int Dynamic = -1;
static const int Resizable = -0x7fffffff;
- namespace Internal
- {
- ///@internal
- ///@brief Used to mark slice to some offset before the end of a
vector.
- ///The offset is known at compile time.
- ///@ingroup gInternal
- template<int I> struct StaticEndMarker
- {
- static const int End=I;
- };
-
- ///@internal
- ///@brief Used to mark slice to some offset before the end of a
vector.
- ///The offset is known at run time.
- ///@ingroup gInternal
- struct DynamicEndMarker
- {
- DynamicEndMarker(int e_)
- :e(e_){}
- int e;
- };
- };
-
- ///Used for slicing relative to the end, rather than with a known size.
- ///For example:
- ///@code
- /// Vector<3> v = makeVector(6,5,4,3,2);
- /// v.slice<1, End<0> >(); //5 4 3 2
- /// v.slice<0, End<-1> >(); //6 5 4 3
- ///@endcode
- ///See also ``\ref sElemOps''.
- ///@ingroup gLinAlg
- template<int I> Internal::StaticEndMarker<I> End();
-
- ///Used for slicing relative to the end, rather than with a known size.
- ///For example:
- ///@code
- /// Vector<> v = makeVector(6,5,4,3,2);
- /// v.slice(1, End); //5 4 3 2
- ///@endcode
- ///See also ``\ref sElemOps''.
- ///@ingroup gLinAlg
- inline Internal::DynamicEndMarker End()
- {
- return 0;
- }
-
- ///Used for slicing relative to the end, rather than with a known size.
- ///For example:
- ///@code
- /// Vector<> v = makeVector(6,5,4,3,2);
- /// v.slice(1, End(-1)); //5 4 3
- ///@endcode
- ///See also ``\ref sElemOps''.
- ///@ingroup gLinAlg
- inline Internal::DynamicEndMarker End(int e)
- {
- return e;
- }
///All TooN classes default to using this precision for computations
and storage.
typedef double DefaultPrecision;
Index: internal/vbase.hh
===================================================================
RCS file: /cvsroot/toon/TooN/internal/vbase.hh,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- internal/vbase.hh 1 Nov 2009 15:33:39 -0000 1.42
+++ internal/vbase.hh 2 Nov 2009 16:26:55 -0000 1.43
@@ -153,68 +153,6 @@
return slice<Dynamic, Dynamic>(start, length);
}
- //Static slicing with End
- #define TOON_INTERNAL_MAKE_END(X)\
- template<int Start, StaticEndMarker<(X)>(*End)()> \
- Vector<(Size==Dynamic?Dynamic:Size-Start+(X)), Precision,
SliceVBase<Stride> > slice(){\
- static const int Len = (Size==Dynamic?Dynamic:Size-Start+(X));\
- return slice<Start, Len>(Start, size() - Start + (X));\
- }\
- template<int Start, StaticEndMarker<(X)>(*End)()> \
- const Vector<(Size==Dynamic?Dynamic:Size-Start+(X)), Precision,
SliceVBase<Stride> > slice() const {\
- static const int Len = (Size==Dynamic?Dynamic:Size-Start+(X));\
- return slice<Start, Len>(Start, size() - Start + (X));\
- }
-
- #define TOON_INTERNAL_MAKE_END_99(D0)\
- TOON_INTERNAL_MAKE_END(D0##0);\
- TOON_INTERNAL_MAKE_END(D0##1);\
- TOON_INTERNAL_MAKE_END(D0##2);\
- TOON_INTERNAL_MAKE_END(D0##3);\
- TOON_INTERNAL_MAKE_END(D0##4);\
- TOON_INTERNAL_MAKE_END(D0##5);\
- TOON_INTERNAL_MAKE_END(D0##6);\
- TOON_INTERNAL_MAKE_END(D0##7);\
- TOON_INTERNAL_MAKE_END(D0##8);\
- TOON_INTERNAL_MAKE_END(D0##9);
-
-#ifndef WIN32
- TOON_INTERNAL_MAKE_END_99(-0x);
- TOON_INTERNAL_MAKE_END_99(-1);
- TOON_INTERNAL_MAKE_END_99(-2);
- TOON_INTERNAL_MAKE_END_99(-3);
- TOON_INTERNAL_MAKE_END_99(-4);
- TOON_INTERNAL_MAKE_END_99(-5);
- TOON_INTERNAL_MAKE_END_99(-6);
- TOON_INTERNAL_MAKE_END_99(-7);
- TOON_INTERNAL_MAKE_END_99(-8);
- TOON_INTERNAL_MAKE_END_99(-9);
-#endif
- #undef TOON_INTERNAL_MAKE_END
- #undef TOON_INTERNAL_MAKE_END99
-
- //Dynamic slicing with End
- Vector<Dynamic, Precision, SliceVBase<Stride> > slice(int i,
Internal::DynamicEndMarker e)
- {
- return slice(i, size()-i+e.e);
- }
-
- const Vector<Dynamic, Precision, SliceVBase<Stride> > slice(int i,
Internal::DynamicEndMarker e) const
- {
- return slice(i, size()-i+e.e);
- }
-
- //Alternate form of dynamic slicing with End:
- Vector<Dynamic, Precision, SliceVBase<Stride> > slice(int i,
Internal::DynamicEndMarker(*)())
- {
- return slice(i, size()-i);
- }
-
- const Vector<Dynamic, Precision, SliceVBase<Stride> > slice(int i,
Internal::DynamicEndMarker(*)()) const
- {
- return slice(i, size()-i);
- }
-
//Other slices below
const Matrix<1, Size, Precision, Slice<1,Stride> > as_row() const{
return Matrix<1, Size, Precision, Slice<1,Stride>
>(const_cast<Precision*>(data()), 1, size(), 1, stride(), Slicing());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN TooN.h internal/vbase.hh,
Edward Rosten <=