0

So I am trying to use a really old library (last updated in 1999) that performs numerical integration over two-dimensional regions using cubature rules. The problem I'm encountering is that every single file in the library (both headers and source files, so probably 40 or more files) uses

#include <headerfile.h>

Instead of using

#include "headerfile.h"

Furthermore, it just uses

cout << "Whatever it is you want to print"

Instead of

std::cout << "Things for printing"

And finally when importing all the c++ standard library files it uses

#include <iostream.h>

Instead

#include <iostream>

Does anybody know of a convenient and efficient way of going through each file and changing this? Maybe some sort of shell script or something? I really do not want to go through all these files by hand. While we're on the topic, does anyone know of a good numerical integration package that isn't so ancient and integrates over any two-dimensional shape? I'm using this one because it handles integration over oddly shaped regions really well, and if I can get it to compile it will be perfect for my purposes. I looked at CUBA but their integration methods only integrate over the unit hypercube, and I need to integrate over triangles and rectangles and all sorts of strange shapes.

Thanks!!

Mr. Frobenius
  • 324
  • 2
  • 8
  • 3
    This sounds like simple trivial search and replace could do, google "search and replace multiple files" or such should give multiple options based on your operating system and environment. – johannes Sep 14 '14 at 01:00
  • 1
    "While we're on the topic, does anyone know of..." Two things: Stack Overflow is not for asking for outside resources; Stack Overflow questions should be about one thing only (to the extent possible). – Jeffrey Bosboom Sep 14 '14 at 01:02
  • 1
    If this is a library that you have full control over, you can make a backup then do a search-and-replace (possibly with regular expressions) over all the files. A proper code editor would make this problem relatively trivial. – In silico Sep 14 '14 at 01:05
  • I am not sure if #include would do anything. For cout, just add this after the include (using std::cout;). It does the same thing as changing it to std::cout, but only uses one line. – C_Plus_Plus_Programmer Sep 14 '14 at 02:02

0 Answers0