C/C++ Solving Hermitian matricies in C/C++

AI Thread Summary
The discussion revolves around issues faced while solving Hermitian matrices in C/C++, specifically using CLAPACK and C++ Builder 2010. The user encounters linking errors, such as LNK2019 and LNK4098, when trying to compile code, indicating unresolved external symbols and conflicts with default libraries. They express frustration with navigating the new RAD environment and seek guidance on error calculations in a backpropagation neural network, particularly for the hidden layer. Additionally, the user reports problems with their Dev-C++ setup after installing and uninstalling MinGW, resulting in linker errors. Overall, the thread highlights challenges in programming with C/C++ and a desire for resources to improve proficiency.
Pozarnik
Messages
1
Reaction score
0
I've been struggling for awhile, I've been trying to use CLAPACK to avoid learning Fortan. I think I've just a linking problem, since I've been testing code that's supposed to work.
in the VC command prompt i type

cl dgesv.c

and I get the error
LNK2019: unresolved external symbol _dgesv_ referenced in function _main

if I try to link the library
cl dgesv.c /link clapack.lib
then i get redundancy in some of the defaults like printf (alrady defined in LIBCMT.lib)
and i also get the error.

LNK4098 default lib 'MSVCRTD' conflicts with the use of other libs

Can someone help me fix this?
Otherwise I was trying to use seldon, but there seems to be very little information on how to use it.
 
Technology news on Phys.org
I am attempting to bolster my coding skills by working for a Professor who has a program that needs some bugs fixed and tweaks etc... In his advertisment he said he needed someone with C++ experience...

Now I have been a recreational programmer. I have learned basic and pascal as first languages and have worked a bit VBA prior to taking on C++. I am ok with object oriented stuff I felt I could work my way through anything if needed.

So I take on this gig and get the program source files and C++ Builder 2010. It seems like a very different environment from what I was accustomed too. (I used Visual C++ express) To test it out I did a quick hello world as a console app. What I typed was about 3 lines, what compiled was like 5000!. This RAD does a lot of stuff behind the scenese i guess. The program has whole bunch of libraries i never seen before. I am not sure how to naiviage them and see what I really need. I felt with the MS stuff (VBA with MS office and it was a zillion times simpler to manipulate the ojbects). Now the stuff is like greek.


So I am lost and up the creek with a broken paddle. I want to grow and tackle this task but its much harder than I anticipated. I am relearning C++ stuff in regards to classes and libraries but I feel even this will not get me to the point to handle this RAD enviroment.

What can one read to get to this final level of programming and proficency.

Any help would be much appreciated.
 
I am having trouble with calculating the error at the hidden layer in a back propagation network.

I have calculated the error at the output layer successfully (and verified against a working network) with the following:

Code:
for (int k=0;k<(layers[1]->n_neurons);k++) {
    //error = (desired - output) * f'(output)
    layers[1]->errors[k] = (desired[k] - layers[1]->outputs[k]) * (1 - (layers[1]->outputs[k] * layers[1]->outputs[k]));
}

Now with the information I've been given, the following (calculation of hidden layer errors) should be correct... could anyone shed some light on what I'm doing wrong?

Code:
for (int i=0;i<(layers[0]->n_neurons);i++) {
    //error[i] = f'(output[i]) * SUMMATION(outlayer_error[k] * outlayer_weights[k][i])
    sum = 0;
    for (int k=0;k<(layers[0+1]->n_neurons);k++) {
        sum += layers[0+1]->errors[k] * layers[0+1]->neurons[k]->weights[i];
    }
    layers[0]->errors[i] = (1 - (layers[0]->outputs[i] * layers[0]->outputs[i])) * sum;
}

Contextual information:

Code:
double *errors;
errors = new double[n_neurons];

Layer[0] is the hidden layer. Layer[1] is the output layer.

outputs[] is the results from the forward pass for each layer.

n_neurons is the number of neurons relative to that layer.

This is so far just the calculation of the errors. The activation function is tanh. I have a working ANN program (closed source) that I am comparing my results with, and how I am able to verify parts of the program. Including the correct output layer error calculations. They are also matching the information I was given.

I've spent about 6hours working on this so far, and I'm at the point of going crazy. So any help is really really appreciated.

Any help on adjusting the weights is also welcome, but priority is the error calculation.
 
Hello everyone, :smile:

Yesterday I downloaded MinGW compiler only to see how a standalone compiler looks. When it finished installing after many minutes I uninstalled it because I could not even understand how to open it!:mad:

I use Dev-C++. I also have CodeBlocks installed but don't want to use it. I like the Dev. But now the problem is whenever I try to compile any code it gives the below given errors. I don't know the reason because it was only MinGW which I installed and uninstalled yesterday. Nothing else. Now I have uninstalled and installed Dev twice but still the same errors. The code and portable Dev on my flash drive works fine on my friend's computer. But on my PC even the portable version gives the same errors. Help me out please. Much grateful for any help I can get.


Errors:
[Linker error] undefined reference to `__dyn_tls_init_callback'
[Linker error] undefined reference to `__cpu_features_init'
ld returned 1 exit status

Cheers
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top