thanks quzah :)
Yeah I was worried about that... I had even tried casting NULL to electron but of course it didn't let me do that - but I had considered that even if it did it would still evaluate...
Type: Posts; User: eccles
thanks quzah :)
Yeah I was worried about that... I had even tried casting NULL to electron but of course it didn't let me do that - but I had considered that even if it did it would still evaluate...
Hi there,
I'm sorry if this has already been discussed ad nauseum, but a quick search I did turned up 500 results and none of them seemed to be what I wanted ( imagine searching for 'null struct'...
ok this is *very* scary.
with -O3:
<Eloc> = -7.478(5)
t = 114s
with -O2:
<Eloc> = -7.478(5)
t = 113.8s
thanks for telling me that!
C++ has suddenly lost a lot of its appeal (for this task anyway).
Odd thing is, I tried compiling with -O2 instead of -O3 and I got a 'variable might be used...
Hi Salem!
thank you *so* much for your helpful and constructive comments.
There's no real reason for me to keep the profiling options in the makefile by default, since the number of times I have...
Hi there,
I am keen to get my C program to compile under C++ because then I can experiment with using some C++ features to optimise the code (and yes unfortunately I do need to optimise, it's a...
Hi there,
I am trying to compile a C program that I am working on into C++...
the compiler version I am using is:
gcc version 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)
yay! I can't get over how elegant this solution is. I love it. thank you all so much once more :D
aaahhh wait a sec - now I get what you mean...
hehe I had been trying to put an include statement in the ifndef...
cool! so once it's loaded once, any further attempts will do nothing. brilliant...
does that pragma statement only apply to the line directly beneath it?
oh! I actually tried that but it didn't seem to help - I got the exact same error message :confused:
Perhaps I did it wrong somehow...
cheers for the help :D
Hi there,
here's a really quick question:
say I have some files:
linalg.h
typedef struct {
...
thanks for mentioning that :)
I think I read that function variables are stored on the heap and globals on the stack - is that what you are referring to?
the annoying thing RE time spent calling...
thanks so much for all your helpful comments and examples (and that excellent link!) and in particular the warnings about macros. I should probably stay away from them at this stage... I am going to...
hi there,
this is a subject that i know almost nothing about and I was hoping to gain enlightenment from some of you who are far more versed in the ways of C.
I have read references to...
so do you have any thoughts then on the relative virtues of C/C++ in scientific computing applications?
Prelude:
RE your signature... I just compiled it and got a Bus error... is that the intended outcome?
well that sounds rather appealing...
then perhaps I should look into that way of doing it... or perhaps I am looking to hard to save myself 2 extra lines of code that overall probably keep things...
ahh cheers, that makes perfect sense.
so there is no way to fiddle with this to make it work?:
typedef struct {
double energy1;
double energy2;
void...
ahh fair enough (re the commenting out of constpart * electrons)
I have only found this board in the last few days (mainly because I have only been learning C the last few days/week) - so just as an...
out of interest Dave, why did you comment out 'constpart * electrons' ?
it's just a pointer to an array of constpart structs...
something like:
typedef struct {
evector r; //...
ok in that case my next question must be (and as you may have gathered from some of the variable names that this is a scientific computing application, and one that does not scale well with system...
ooh thankyou :) I didn't expect a reply this fast!
to turn your example around a bit, would this be possible?:
typedef struct tag_diffuser
{
//constpart * electrons;
double energy;
...
well of course I could do that... but... I had hoped that there might be a way to package the function up into the struct as part of its definition, so it could be called like:
diffuser walker;...
Hi there,
I am rather new to C, and I am having a bit of trouble finding information on this thing that I want to do (damn google is good - but it's a shame that the creator of C didn't know about...