Click to See Complete Forum and Search --> : General data structure ?


jla2w2
March 4th, 2003, 04:10 PM
I am writing a statistics type of application (using MFC incidentally), and I have kind of hit a wall. Right now I use the standard streams, containers, etc. from the STL to get my data in from text files, write them to other files in particular formats, and run FORTRAN routines expecting those other files to be prepared in a particular way. I'd like to clean this process up, but I have a few questions I need answered before I get started. Generally speaking, in data analysis or stat apps, it seems like the programs have very sophistocated data matrices, which they can transpose and operate on. Is it reasonable to assume they have written matrix classes from scratch, or do they use the STL, inherit from the STL? Second, the process of getting data from files seems very error prone ( ifstream, fin >> float, etc.). Where might I find info on getting data in from files more cleanly, importing non ASCII files (Like Excel), etc? I know these are broad questions, but this is a non-expert programmer attempting to make the transition from somewhat hack program to well-written program, object oriented and all. I'm reading up on the STL and the Design Patterns book by Gamma, so hopefully I'll get some ideas. Thoughts?

jfaust
March 4th, 2003, 04:34 PM
The boost libraries provide more data structures that may be of interest. I don't know of what would be immediately useful, but like the STL, they are very general-purpose. I use it daily.

The uBLAS library was recently added. It is a linear algebra library. I only bring this up because it contains matrices. I don't know how useful it would be to you, but it might be worth checking out.

You might want to take a peek at what else is available. It's completely free to use and distribute. You can find it at:

http://www.boost.org/

Jeff

dude_1967
March 5th, 2003, 08:06 AM
Here are some other resources.

The matrix Template Library (MTL), a well-written and well-optimized template library for matrix operations.

http://www.osl.iu.edu/research/mtl/

Some books:

STL:

http://www.amazon.com/exec/obidos/ASIN/0201379260/qid%3D1046873103/sr%3D2-1/ref%3Dsr%5F2%5F1/103-1351438-8529439

IO-Streams:

http://www.amazon.com/exec/obidos/ASIN/0201183951/qid%3D1046873136/sr%3D11-1/ref%3Dsr%5F11%5F1/103-1351438-8529439

Another great book on object oriented numerical and scientific programming with a lot of simple matrix operations is:

http://www.amazon.com/exec/obidos/ASIN/0387989900/qid%3D1046873071/sr%3D11-1/ref%3Dsr%5F11%5F1/104-0999700-4315924

Sincerely, Chris

:)