ivl 679
ivl/details/array_nd/impl/cat_array.hpp
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>.
00002    A C++ template library extending syntax towards mathematical notation.
00003 
00004    Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr>
00005    Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr>
00006 
00007    ivl is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU Lesser General Public License 
00009    version 3 as published by the Free Software Foundation.
00010 
00011    Alternatively, you can redistribute it and/or modify it under the terms 
00012    of the GNU General Public License version 2 as published by the Free 
00013    Software Foundation.
00014 
00015    ivl is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00018    See the GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License 
00021    and a copy of the GNU Lesser General Public License along 
00022    with ivl. If not, see <http://www.gnu.org/licenses/>. */
00023 
00024 #ifndef IVL_ARRAY_ND_DETAILS_CAT_ARRAY_HPP
00025 #define IVL_ARRAY_ND_DETAILS_CAT_ARRAY_HPP
00026 
00027 namespace ivl {
00028 
00029 //TODO: please wipe this file
00030 #if 0
00031 
00032 template <class T>
00033 class cat_array : public array_nd<T, cat_array<T> >
00034 {
00035 
00036 public:
00037 
00038         // Constructors
00039         cat_array() : array_nd<T, cat_array<T> >(0) { };
00040 
00041         template<class S>
00042         cat_array(const array_nd<T, S>& a) : array_nd<T, cat_array<T> >(a) { };
00043         template<class S, bool C>
00044         cat_array(const sub_array<T, S, C>& a) : array_nd<T,  cat_array<T> >(a) { };
00045         cat_array(const array<T>& a) : array_nd<T, cat_array<T> >(idx(a.length()), a) { };
00046         cat_array(const T& s) : array_nd<T, cat_array<T> >(1,s) { };
00047         cat_array(const range<T>& ra) : array_nd<T, cat_array<T> >(ra.length())
00048         {
00049                 size_t i = 0;
00050                 for (T j = ra.first; j <= ra.last; j += ra.step)
00051                         (*this)[i++] = j;
00052         };
00053 };
00054 
00056 template <class T>
00057 std::ostream& operator<<(std::ostream& os, const cat_array<T>& a)
00058 {
00059         os << "[" << array_nd<T>(a) << "]";
00060         return os;
00061 }
00062 
00063 #endif
00064 } // namespace ivl
00065 
00066 #endif // IVL_ARRAY_ND_DETAILS_CAT_ARRAY_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations