00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef OLENA_CORE_GENERATE_HH
00029 # define OLENA_CORE_GENERATE_HH
00030
00031 # include <mlc/is_a.hh>
00032
00033 # include <mlc/contract.hh>
00034 # include <oln/core/abstract/image.hh>
00035 # include <oln/core/abstract/image_size.hh>
00036 # include <oln/core/abstract/iter.hh>
00037 # include <oln/core/macros.hh>
00038
00039 namespace oln {
00040
00041
00042 #if 0
00043
00044
00045
00046 template<class AdaptableGen, class I>
00047 inline typename image_for_dim<mlc::exact<I>::ret::dim>::with_type<typename AdaptableGen::result_type>::ret
00048 generate(AdaptableGen f, const image_size<I>& size)
00049 {
00050 typename image_for_dim<mlc::exact<I>::ret::dim>::with_type<typename AdaptableGen::result_type>::ret output(size.exact());
00051 oln_iter_type(typename image_for_dim<mlc::exact<I>::ret::dim>::with_type<typename AdaptableGen::result_type>::ret) p(output);
00052 for_all(p) output[p] = f();
00053 return output;
00054 }
00055
00056 template<class AdaptableGen, class I>
00057 inline abstract::image<I>
00058 generate(AdaptableGen f, abstract::image<I>& input)
00059 {
00060 oln_iter_type(I) p(input);
00061 for_all(p) input[p] = f();
00062 return input;
00063 }
00064 #endif
00065
00066 }
00067
00068 #endif // OLENA_CORE_GENERATE_HH