Home || Architecture || Video Search || Visual Search || Scripts || Applications || 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 "Util/Random.h"
00007 #include "Core/Array/Trait/InOutSetRandom.h"
00008 #include "Core/Array/Pattern/PatInOutOp.h"
00009 
00010 namespace Impala
00011 {
00012 namespace Core
00013 {
00014 namespace Array
00015 {
00016 
00023 template<class ArrayT>
00024 inline ArrayT*
00025 MakeRandom(Int64 width, Int64 height, typename ArrayT::StorType maxVal)
00026 {
00027     ArrayT* a = new ArrayT(width, height, 0, 0);
00028     Trait::InOutSetRandom<ArrayT> inout(maxVal);
00029     Pattern::PatInOutOp(a, inout);
00030     return a;
00031 }
00032 
00033 Array2dScalarReal64*
00034 MakeRandomScalarReal64(Int64 width, Int64 height, double maxVal)
00035 {
00036     return MakeRandom<Array2dScalarReal64>(width, height, maxVal);
00037 }
00038    
00039 } // namespace Array
00040 } // namespace Core
00041 } // namespace Impala
00042 
00043 #endif

Generated on Fri Mar 19 09:30:48 2010 for ImpalaSrc by  doxygen 1.5.1