Commit e825bf4a by Gabriel Dos Reis Committed by Gabriel Dos Reis

valarray_meta.h (_Expr<>::shift, [...]): Implement.

	* bits/valarray_meta.h (_Expr<>::shift, _Expr::cshift,
	_Expr<>::apply): Implement.

From-SVN: r35785
parent 2ae7bada
2000-08-18 Gabriel Dos Reis <gdr@codesourcery.com> 2000-08-18 Gabriel Dos Reis <gdr@codesourcery.com>
* bits/valarray_meta.h (_Expr<>::shift, _Expr::cshift,
_Expr<>::apply): Implement.
2000-08-18 Gabriel Dos Reis <gdr@codesourcery.com>
* bits/valarray_meta.h (_Expr<>::min, _Expr<>::max): Implement. * bits/valarray_meta.h (_Expr<>::min, _Expr<>::max): Implement.
* bits/valarray_array.h (__valarray_min, __valarray_max): New * bits/valarray_array.h (__valarray_min, __valarray_max): New
......
...@@ -672,10 +672,9 @@ namespace std { ...@@ -672,10 +672,9 @@ namespace std {
value_type min() const; value_type min() const;
value_type max() const; value_type max() const;
// _Meta<_ApplyFunctionWithValue<_Expr>, value_type>
// apply (value_type _M_func (value_type)) const; valarray<value_type> apply(value_type (*) (const value_type&)) const;
// _Meta<_ApplyFunctionWithConstRef<_Expr>, value_type> valarray<value_type> apply(value_type (*) (value_type)) const;
// apply (value_type _M_func (const value_type&)) const;
private: private:
const _Clos _M_closure; const _Clos _M_closure;
...@@ -718,7 +717,27 @@ namespace std { ...@@ -718,7 +717,27 @@ namespace std {
template<class _Clos, typename _Tp> template<class _Clos, typename _Tp>
inline size_t inline size_t
_Expr<_Clos,_Tp>::size () const { return _M_closure.size (); } _Expr<_Clos,_Tp>::size () const { return _M_closure.size (); }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::shift(int __n) const
{ return valarray<_Tp>(_M_closure).shift(__n); }
template<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::cshift(int __n) const
{ return valarray<_Tp>(_M_closure).cshift(__n); }
ttemplate<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(const _Tp&)) const
{ return valarray<_Tp>(_M_closure).apply(__f); }
ttemplate<class _Clos, typename _Tp>
inline valarray<_Tp>
_Expr<_Clos, _Tp>::apply(_Tp __f(_Tp)) const
{ return valarray<_Tp>(_M_closure).apply(__f); }
// XXX: replace this with a more robust summation algorithm. // XXX: replace this with a more robust summation algorithm.
template<class _Clos, typename _Tp> template<class _Clos, typename _Tp>
inline _Tp inline _Tp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment