multidimensional arrays in nr C/C++


xplorer0nr
02-03-2007, 01:01 PM
Hi everyone, I 'd like to convert some F90 code to NR-C or NR-C++ , but I found that NR-F90 provides nice tools for array manipulation that I cannot find in NR-C or NR-C++; eg. 1) arrays of dimension>3, 2) tools like minloc/maxloc(array), 3) dot and outer product, 4) assigning a=b where a,b are conformable vectors or matrices, also using the sub-array notation like a(n1:n2), etc, many other operations... All these handy tools are provided in NR-F90 and make life easy, but I cannot find their counterparts in NR-C or NR-C++. I checked out the VecMat utilities but they do not address my needs. Anyone know where to find these nice tools for download? Any info on this is appreciated, and can be helpful to everyone in the forum. Thank you very much...
/xplorer

Kevin Dolan
03-09-2007, 05:07 AM
I don't know of any C++ libraries that provide all of that functionality. My VecMat software provides some of it, such as accessing ranges (through the slice and submatrix functions), and some of the other features are present in the C++ standard template library, as generic algorithms which can operate on any class which has iterators (including the VecMat classes).

If there is something specific you are looking for that VecMat doesn't have, let me know, and maybe I can implement it. I am always looking for new things to add to it. Right now it pretty much just does the types of things that I typically need to do.

Kevin