Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:16

0001 #include "OPTICKS_LOG.hh"
0002 #include "NP.hh"
0003 #include "SDigest.hh"
0004 #include "SDigestNP.hh"
0005 
0006 int main(int argc, char** argv)
0007 {
0008     OPTICKS_LOG(argc, argv); 
0009 
0010     const char* h = "hello" ; 
0011     std::string xdig = SDigest::Buffer( h, 5 ); 
0012 
0013     std::cout 
0014         << " i " << std::setw(4) << -1 
0015         << " xdig " << xdig 
0016         << std::endl
0017         ; 
0018 
0019 
0020     NP* a = NP::Make<char>(3,5) ;
0021     char* aa = a->values<char>(); 
0022     memcpy( aa+0  , h, 5 );  
0023     memcpy( aa+5  , h, 5 );  
0024     memcpy( aa+10 , h, 5 );  
0025 
0026     for(int i=0 ; i < a->shape[0] ; i++)
0027     {
0028         std::string dig = SDigestNP::Item( a, i ); 
0029         std::cout 
0030             << " i " << std::setw(4) << i 
0031             << "  dig " << dig
0032             << std::endl 
0033             ;
0034 
0035         assert( strcmp( dig.c_str(), xdig.c_str() ) == 0 ); 
0036     }
0037 
0038     return 0 ; 
0039 }
0040 
0041