New Vector and Matrix classes...


Kevin Dolan
02-03-2003, 04:30 AM
I have written some C++ Vector and Matrix classes that can be used with NR C++, as well as some supporting functions. These classes provide most of the basic functionality of the valarray standard template library class, but also provide a view-based data model, which can eliminate a lot of unnecessary copying, and provides for very easy manipulation of slices of data. The software also provides wrappers for using the FFTW C libraries.

The software is available on my homepage here,

http://neurodyn.umsl.edu/~kevin/software.html

and is also mirrored on the NR User Contributions page here.

http://www.nr.com/contrib/

If you are interested, check it out, and let me know what you think.

kevin Dolan

Kevin Dolan
09-09-2003, 04:54 AM
If anybody is interested, I have updated my software. This update includes several improvements, not the least of which is the ability to view any block of data, no matter how it was allocated, as a vector or matrix. This means that you can call the NR in C++ routines with arrays which are statically allocated, or with arrays that are allocated by other software, such as the FFTW-3 memory allocation routines. The software has also been updated to support FFTW-3. In addition, support for frequency domain digital filtering has also been added.

Check it out and let me know what you think.

Kevin Dolan
kdolan@mailaps.org

vivekjoshi
12-21-2006, 10:41 AM
Hi Kevin,

I downloaded your VecMat software and tried to compile it with Gcc 4.1, but it does not work. Is it possible to compile it with gcc 4.1 and create a shared library. I have also tried to email you but never got a reply. Just by the looks of the code it seems that your library is optimized and would be usefull for me.

Vivek

Kevin Dolan
03-09-2007, 06:21 AM
Sorry that I did not respond to this sooner.

The website that my software used to be hosted on is gone, and the version hosted here is very old. The latest version is available at my new web site here.

http://kdolan1973.mine.nu/vecmat/software.htm

It should work with gcc 4.1. I will very soon be uploading a major update which also works with VC++.NET 2005.

My email has also changed. The email in my profile should be correct now. You can also email me from my website.

Kevin

fastNR
03-11-2007, 12:05 PM
Some vector class as arrays class you can found of www.alglib.net site

http://www.alglib.net/translator/aplib.zip

KPerkins
10-29-2007, 10:12 AM
Kevin,
Thanks for the vector/matrix classes. I appreciate both the code as well as the documentation. I am trying to learn C++ by studying working code, including yours and the NR routines. Sadly my knowledge is still lacking in figuring out the syntax when it gets to template definitions. I'm working in MSVC 6.0, and created a console app to get started. I included <nr.h>, and the propagated includes that follow. The compiler flags line 150 in your "traits.h" file with

...include\vm\traits.h(150) : error C2989: 'Traits<class ?? ::T *>' : template class has already been defined as a non-template class
...include\vm\traits.h(150) : error C2988: unrecognizable template declaration/definition

Since I haven't actually written anything the compiler has gotten to yet, I'm stumped.
Many thanks to any advisors...

Kevin Dolan
10-29-2007, 12:18 PM
That version of MSVC does not support partial template specialization, which my Traits class uses. I gave up on trying to support non-standards compliant compilers a couple of years ago. Fortunately the latest versions of Visual C++ are more compliant, and I currently use Visual Studio .NET 2005 with no problems.

Ironically, I no longer have the Numerical Recipes software (my license was through my former job), so I'm not even sure whether the latest versions of my library work properly with it. I would be interested in knowing if anybody has had any problems in that respect. And of course I haven't even looked into making it work with version 3 of NR yet.

Kevin