comparison liboctave/MSparse.h @ 9812:f80c566bc751

improve unary mapper system
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 12 Nov 2009 15:47:58 +0100
parents eb63fbe60fab
children 4c0cdbe0acca
comparison
equal deleted inserted replaced
9811:c657c056240d 9812:f80c566bc751
115 MSparse<T> diag (octave_idx_type k = 0) const 115 MSparse<T> diag (octave_idx_type k = 0) const
116 { 116 {
117 return Sparse<T>::diag (k); 117 return Sparse<T>::diag (k);
118 } 118 }
119 119
120 template <class U, class F> 120 // FIXME: should go away.
121 MSparse<U> map (F fcn) const 121 template <class U>
122 { 122 MSparse<U>
123 return Sparse<T>::template map<U> (fcn); 123 map (U (&fcn) (T)) const
124 } 124 { return Sparse<T>::template map<U> (fcn); }
125
126 template <class U>
127 MSparse<U>
128 map (U (&fcn) (const T&)) const
129 { return Sparse<T>::template map<U> (fcn); }
125 130
126 // Currently, the OPS functions don't need to be friends, but that 131 // Currently, the OPS functions don't need to be friends, but that
127 // may change. 132 // may change.
128 133
129 // SPARSE_OPS_FRIEND_DECLS (MSparse, MArray2) 134 // SPARSE_OPS_FRIEND_DECLS (MSparse, MArray2)