• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

Arcane Computer Help Needed Desperately

There is a setting for the for loop scope conformance in 6.0, if I remember correctly, but when it is set it alters more than just that, often causing other problems.

Newer versions of VC++ has this solved correctly. You may want to upgrade.
 
voticity,

The documentation of TNT and JAMA are fine. It's your knowledge that is substandard. I'm not saying that to be mean, but to point out that you seriously lack C++ knowledge if you can't get anywhere with this package. Perhaps I was wrong to recommend it. But in general you seem to be trying to bite off more than you can chew. If you can't figure this stuff out, how can you guarantee that your results are correct? All your research will be tainted if you program by "magic" (a term referring to somebody who programs by tinkering with a program until it seems to work).

In any case, I just downloaded both to my hard drive, wrote a program and compiled it in Visual Studio .NET in about 5 minutes. Here's the process.

1) download both tnt and JAMA. I put them both in c:\tnt.

2) create a project in c:\tnt. (not a good idea, you should keep your code separate from TNT, but I'm trying to keep things simple). I made it a console application since there is no need for windows for this.

3) put the following code in the the main function:
Code:
#include "stdafx.h"
#include "tnt.h"
#include "jama_eig.h"

int _tmain(int argc, _TCHAR* argv[])
{
    TNT::Array2D<double> Data;
    TNT::Array1D<double> Result;

    //assign values to Data here ... (not shown)


   // create an Eigenvalue object
    JAMA::Eigenvalue<double> E (Data);

   // compute the Eigenvalues
    E.getRealEigenvalues (Result);


   return 0;
}

If you don't get how this follows from the documentation, you need to learn C++. You're basically asking us to teach you C++ via a bulletin board. Not gonna happen. Not because I'm being willful, the code above shows I'm trying to help, but because there is just so much for you to learn. Look at it this way - imagine trying to do your research by posting to a bulletin board "I don't know what an Eigenvalue is, or a matrix, but I've gotta compute some to solve my problem. Can someone tell me how." The question, while it may sound straightforward, indicates that the person does not have the math skills to solve the problem. A definition of what a matrix and eigenvalue is really isn't going to be much help. They need to take a course in linear algerbra. Your C/C++ questions are along the same lines.
 
roger said:
voticity,

The documentation of TNT and JAMA are fine. It's your knowledge that is substandard...
Thanks for all the advice but as I noted above, I've gotten TNT and JAMA to work fine. As I eventually found out, the problem was that my compiler and some of the .h files that were included were incompatible. So I solved this by going into each of the header files I needed and changing the way it initiated variables. It took me a long time to figure this out. The code example you posted would not have worked on my compiler before I changed the headers. Bad Microsoft!

Now it all works, I can compute eigenvalues and do Cholesky decompositions, etc. (I checked that the results were correct by comparing to Mathematica, which is much slower).

My only remaining probem is that the JAMA package, as it stands, is sorely lacking. It has no routine for computing the eigenvalues alone without also finding the eigenvectors. If all you need are the eigenvalues, then this is extremely inefficient for a large matrix. So I'm looking around online for some utility that will just calculate the eigenvalues...
 
It's really not fair of you to say "Bad Microsoft" for implementing non-ANSI behaviour in VC++ 6.0 -- which was released before the standard was finalized.

You should get a modern compiler. minGW is a port of gcc for windows that is free in every sense. If you don't mind things that are only free-as-in-cost, Microsoft also gives the VC++ compiler (minus the IDE) for free on their website. Finally, it's widely held that Intel's compiler, also free for download from their site, is the bomb for x86 compiling. I wouldn't know, I'm a gcc man.

If you feel the need to use an IDE, there are many free IDEs that work with minGW - such as Dev-C++ at www.bloodshed.net. That IDE is a little buggy, but the compiler is rock-solid. If you hit mingw's webpage, you can download mingw, msys, and the msys utilities and have all the parts of unix you need to make most things work just like in the unix docs.

Just some ideas.
 
scribble said:
It's really not fair of you to say "Bad Microsoft" for implementing non-ANSI behaviour in VC++ 6.0 -- which was released before the standard was finalized.
But I like saying "Bad Microsoft"! :D

I have a little picture of Bill Gates taped to my wall here next to the computer. That one of him getting his mugshot taken in the '70's, you know the one. I like to shake my fist at it when my machine misbehaves.


You should get a modern compiler. minGW is a port of gcc for windows that is free in every sense. If you don't mind things that are only free-as-in-cost, Microsoft also gives the VC++ compiler (minus the IDE) for free on their website. Finally, it's widely held that Intel's compiler, also free for download from their site, is the bomb for x86 compiling. I wouldn't know, I'm a gcc man.
Like a familiar armchair with a painful bump in it that you keep just because you are used to it, I'll stick with my steam-powered Visual Studio for now. After all, I did finally find what was making things go wrong, and fixed it.

What's an "IDE"?
If you feel the need to use an IDE, there are many free IDEs that work with minGW - such as Dev-C++ at www.bloodshed.net. That IDE is a little buggy, but the compiler is rock-solid. If you hit mingw's webpage, you can download mingw, msys, and the msys utilities and have all the parts of unix you need to make most things work just like in the unix docs.
If I ever have to do any more Unix-y things, and I'm sure I will, I'll probably do that.
Just some ideas.
Thanks!
 
I can vauch for MinGW under Dev-Cpp. I've been using it for all of my programming for about a year now. It's nice to finally have a compiler that is compatible with the C++ standard.

One of these days I am going to have to get around to making my Vector-Matrix software working with TNT.


Dr. Stupid
 

Back
Top Bottom