Main Menu

Tip jar

If you like CaB and wish to support it, you can use PayPal or KoFi. Thank you, and I hope you continue to enjoy the site - Neil.

Buy Me a Coffee at ko-fi.com

Support CaB

Recent

Welcome to Cook'd and Bomb'd. Please login or sign up.

April 26, 2024, 10:52:41 AM

Login with username, password and session length

More C++ help

Started by BlodwynPig, April 04, 2012, 02:03:31 PM

Previous topic - Next topic

BlodwynPig

Further to my previous thread on C++ and the complete lack of C++ support at the University, I turn to you, knowledgeable people, for more help.

i have managed to translate most of the C++ code to Matlab script, but am getting some inconsistencies with results and want to output some intermediate results from C++ to the command line. However, the code is not spitting out these results when i have printf or fprintf in the code. I suspect it may be to do with the void entry before the function ? I note that using double function for other functions and then embedding a printf, will produce the desired output.

Here is the function in the c file

http://pastebin.com/f7DSfNuL

This is matched by a line in the header file, thus

void mcmc(t_Params *ptParams, t_Data *ptData, gsl_vector* ptX);

Help very much appreciated

Mary is not amused

It's not because of the 'void'.  (That just means the function does not return a value.)

It's more likely that mcmc() is, in fact, not being called.

BlodwynPig

Quote from: Mary is not amused on April 04, 2012, 02:07:10 PM
It's not because of the 'void'.  (That just means the function does not return a value.)

It's more likely that mcmc() is, in fact, not being called.

i have been thinking that too - and this could be true - i have noticed that the outputs are not being created. However, originally they were - I don't know why this function is now not being called if the code is identical.

BlodwynPig

got it, i needed to specify a specific output stub for the output name!

Jamie Oliver is fat

it could also be the lack of a cosine output stub affecting the input strings

BlodwynPig

Quote from: Jamie Oliver is fat on April 05, 2012, 01:05:42 PM
it could also be the lack of a cosine output stub affecting the input strings

Yes, not sure what that means - but I think it is correct ;)

Adding the flag -s 1000, for example, solves the problem when running the function. However, I am not generating the output folder (MCMCSamples) and will have to look at why that is the case, as this worked previously.

i am 95% of the way there now - just looking at output generation code and how that compiles the results into a sample file.

cheers for the help.