Solving Hermitian matricies in C/C++

  • Context: C/C++ 
  • Thread starter Thread starter Pozarnik
  • Start date Start date
  • Tags Tags
    Hermitian Matricies
Click For Summary

Discussion Overview

The discussion revolves around challenges faced by participants in solving problems related to programming with C/C++, specifically in the context of using libraries for numerical computations, debugging code, and understanding different development environments. Topics include linking issues with libraries, navigating complex IDEs, and troubleshooting errors in neural network implementations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant reports a linking problem while using CLAPACK, encountering unresolved external symbols and conflicts with default libraries when attempting to compile code.
  • Another participant expresses difficulty in adapting to a new RAD environment (C++ Builder 2010) after having experience with simpler programming languages and environments, seeking advice on improving programming proficiency.
  • A third participant describes their struggle with calculating errors in a back propagation neural network, detailing their current calculations and asking for help in identifying potential mistakes in their approach.
  • A fourth participant shares frustrations with installation issues related to MinGW and subsequent errors encountered when trying to compile code in Dev-C++, despite the same code working on another computer.

Areas of Agreement / Disagreement

Participants express individual challenges and seek assistance, but there is no consensus or agreement on solutions or approaches to the problems presented. Each issue appears to be distinct and unresolved.

Contextual Notes

Participants mention specific libraries and environments, but there are limitations in the information provided, such as missing details on configurations, dependencies, and the specific nature of errors encountered.

Who May Find This Useful

Individuals working with C/C++ programming, particularly those dealing with numerical libraries, neural networks, or transitioning between different development environments may find this discussion relevant.

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 environment.

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
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
5
Views
8K
  • · Replies 13 ·
Replies
13
Views
4K
Replies
5
Views
16K
Replies
4
Views
3K
  • · Replies 20 ·
Replies
20
Views
4K