home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,509 of 33,346   
   nmm1@cam.ac.uk to ulrich.eckhardt@dominalaser.com   
   Re: Using the STL for scientific program   
   30 Sep 11 18:21:35   
   
   In article ,   
   Ulrich Eckhardt   wrote:   
   >   
   >> Does anyone use the STL (and I mean the STL, not BOOST) for scientific   
   >> programming and, if so, what parts and for what?   
   >   
   >The STL has not been actively developed for something like a decade, but   
   >large parts of it have been incorporated into the C++ standard library.   
   >The question now is what exactly you mean, I'll assume that you mean the   
   >C++ standard library (CSL).   
      
   Of course - but I SPECIFICALLY mean the parts of that inherited   
   from the old STL, and not the C library or for miscellaneous   
   purposes.  The term STL is widely used within WG23, incidentally.   
      
   >Of the CSL, the most important parts to me are IOStreams and   
   >containers/iterators/algorithms. In particular the latter are pretty   
   >much used anywhere where sequences or mappings are handled in memory.   
      
   The question is how much advantage they give (in the first case   
   over ).   
      
   >Why would you write your own? Getting things correct is a non-trivial   
   >task. Getting optional diagnostics for undefined behaviour requires even   
   >more work, work that has already been done in most implementations.   
      
   The question is whether it is simpler and more reliable to start   
   from scratch than to write the extra function needed, and defend   
   oneself against the STL's serious ambiguities and lack of checking.   
   I wrote a few test cases both ways, and it was marginal.   
      
   Incidentally, I am not writing as a tyro - I am writing as someone   
   who might teach this use.  I have spoken to a far number of people   
   who use C++ for scientific programming, and many use boost, but   
   few use the STL.   
      
   >What do you mean with "array support"? In C++ an array is a   
   >fixed-length, contiguous sequence of objects, like "char x[42]". In the   
   >old C++ standard, they are a somehow unwanted child, in particular since   
   >they don't provide any STL interfaces. Boost.Array has been written to   
   >make up for this lack. If you mean a dynamically resizable array,   
   >vector<> is what you are looking for.   
      
   I mean array as in mathematics, science or Fortran, not simple   
   vectors as in 'computer science' or C.  Try boost::multi_array,   
   Fortran or Matlab.   
      
      
   Regards,   
   Nick Maclaren.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca