Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

MakeRandom.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_MakeRandom_h
00002 #define Impala_Core_Array_MakeRandom_h
00003 
00004 
00005 #include "Core/Array/Arrays.h"
00006 #include "Core/Array/Trait/InOutSetRandom.h"
00007 #include "Core/Array/Pattern/PatInOutOp.h"
00008 
00009 namespace Impala
00010 {
00011 namespace Core
00012 {
00013 namespace Array
00014 {
00015 
00022 template<class ArrayT>
00023 inline ArrayT*
00024 MakeRandom(Int64 width, Int64 height, typename ArrayT::StorType maxVal,
00025            Util::Random& rng = Util::Random::GetGlobal())
00026 {
00027     ArrayT* a = new ArrayT(width, height, 0, 0);
00028     Trait::InOutSetRandom<ArrayT> inout(maxVal, rng);
00029     Pattern::PatInOutOp(a, inout);
00030     return a;
00031 }
00032 
00033 Array2dScalarReal64*
00034 MakeRandomScalarReal64(Int64 width, Int64 height, double maxVal,
00035                        Util::Random& rng = Util::Random::GetGlobal())
00036 {
00037     return MakeRandom<Array2dScalarReal64>(width, height, maxVal, rng);
00038 }
00039    
00040 } // namespace Array
00041 } // namespace Core
00042 } // namespace Impala
00043 
00044 #endif

Generated on Thu Jan 13 09:04:08 2011 for ImpalaSrc by  doxygen 1.5.1