ivl 679
ivl/details/array_2d/functions/array_2d_operators.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_2D_DETAILS_ARRAY_2D_OPERATORS_HPP
00025 #define IVL_ARRAY_2D_DETAILS_ARRAY_2D_OPERATORS_HPP
00026 
00027 #if 0
00028 namespace ivl {
00029 /*
00030 template<class T1, class S1, class T2, class S2>
00031 inline
00032 array_nd<T1> operator |(
00033         const array<T1, S1>& l, const array<T1, S1>* r)
00034 {
00035 
00036 }
00037 
00038 template<class T1, class S1, class T2, class S2>
00039 inline
00040 array_nd<T1> operator |(
00041         const array_nd<T1, S1>& l, const array<T1, S1>* r)
00042 {
00043 
00044 }
00045 
00046 template<class T1, class S1, class T2, class S2>
00047 inline
00048 array_nd<T1> operator |(
00049         const array<T1, S1>& l, const array_nd<T1, S1>* r)
00050 {
00051 
00052 }
00053 */
00054 
00055 
00056 template<class T1, class S1, class T2, class S2>
00057 inline
00058 array_nd<T1, data::catarray<
00059         const array_nd<T1, S1>, const array_nd<T2, S2>, 1> > operator |(
00060         const array_nd<T1, S1>& l, const array_nd<T1, S1>* r)
00061 {
00062         array_nd<T1, data::catarray<
00063         const array_nd<T1, S1>, const array_nd<T2, S2>, 1> > rv;
00064         rv.init(l, r);
00065         return rv;
00066 }
00067 // ----------------------------------------------------------------------------
00068 /*
00069 
00070 template<class T1, class S1, class T2, class S2>
00071 inline
00072 array_nd<T1> operator -(
00073         const array<T1, S1>& l, const array<T1, S1>* r)
00074 {
00075 
00076 }
00077 
00078 template<class T1, class S1, class T2, class S2>
00079 inline
00080 array_nd<T1> operator -(
00081         const array_nd<T1, S1>& l, const array<T1, S1>* r)
00082 {
00083 
00084 }
00085 
00086 template<class T1, class S1, class T2, class S2>
00087 inline
00088 array_nd<T1> operator -(
00089         const array<T1, S1>& l, const array_nd<T1, S1>* r)
00090 {
00091 
00092 }
00093 */
00094 
00095 template<class T1, class S1, class T2, class S2>
00096 inline
00097 array_nd<T1, data::catarray<
00098         const array_nd<T1, S1>, const array_nd<T2, S2>, 0> > operator -(
00099         const array_nd<T1, S1>& l, const array_nd<T1, S1>* r)
00100 {
00101         array_nd<T1, data::catarray<
00102         const array_nd<T1, S1>, const array_nd<T2, S2>, 0> > rv;
00103         rv.init(l, r);
00104         return rv;
00105 }
00106 /*
00107 template<class T1, class S1, class T2, class S2>
00108 inline
00109 array_nd<T1> operator -(
00110         const array_nd<T1, S1>& l, const array_nd<T1, S1>* r)
00111 {
00112 
00113 }*/
00114 
00115 
00116 } /* namespace ivl */
00117 
00118 // TODO: please remove this file. or not.
00119 #if 0
00120 
00121 namespace ivl {
00122 
00123 //--------------------------------------------------------------
00124 // array_nd SUBSCRIPTION OPERATORS
00125 
00126 template<class T, class D, class P>
00127 inline
00128 typename array_nd<T, D, P>::derived_type& array_nd<T, D, P>::operator=(const T& s)
00129 {
00130         this->assign(s);
00131 /*
00132         array<T, D, P>::operator=(s);
00133         ndim = 1;
00134         sizes = size_array(1, 1);
00135         strides = size_array(1,1);
00136 */
00137         return derived();
00138 }
00139 
00140 template<class T, class D, class P>
00141 inline
00142 array_nd<T, D, P>& array_nd<T, D, P>::operator=(const array_nd<T, D, P>& a)
00143 {
00144         this->assign(a);
00145 /*
00146         base_class::operator=(a);
00147 
00148         ndim = a.ndims();
00149         sizes = a.size_nd();
00150         strides = a.stride();
00151 */
00152         return *this;
00153 }
00154 
00155 template<class T, class D, class P>
00156 template<class S, class K>
00157 inline
00158 typename array_nd<T, D, P>::derived_type& array_nd<T, D, P>::operator=(const array_nd<T, S, K>& a)
00159 {
00160         this->assign(a);
00161 /*
00162         array<T, D>::operator=(a);
00163 
00164         ndim = a.ndims();
00165         sizes = a.size_nd();
00166         strides = a.stride();
00167 */
00168         return derived();
00169 }
00170 
00171 } // namespace ivl
00172 
00173 #endif
00174 
00175 #endif
00176 
00177 #endif // IVL_ARRAY_2D_DETAILS_ARRAY_2D_OPERATORS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations