|
I still haven't understood the [INLINE] square brackets thing (yet) but I've begun to understand the templates concept amongst all the syntax MUCH better when I found this Article here on Code Project.
An Idiots Guide to C++ Templates-Part-1
So I guess I'm an idiot since that page helped me more than any I've read previous. A happy idiot now.
|
|
|
|
|
If it's any consolation I have been writing (sort of) C++ code for more than 20 years and still struggle with templates and lambdas. 
|
|
|
|
|
Totally agree!
And I still avoid using lambdas as well.
|
|
|
|
|
Thanks Richard and Victor for the consolations. This is a much nicer forum than some. I do try to research before posting but sometimes without help I get stumped.
|
|
|
|
|
Rw237 wrote: (c) It appears to be a scope resolution :: to the member function c_str() but what is the [inline] bracket syntax?
Where did you get this template example from? The only place I've found the [inline] syntax is here (gcc 4.6.3 api docs). That syntax does not show up in the current API docs, nor does it show up in the libstdc++ sources for gcc 4.6.3 or gcc 8.2. It is also not described in the the MS c++ template docs or the template docs at cpprefereence.com. I'm thinking that's a documentation note that c_str() may be declared as an inline function, much the same as the man page for a utility might show optional parameters e.g. find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]
modified 8-Mar-19 13:02pm.
|
|
|
|
|
Thanks k5054, that must be it. Probably only novice learning dummies like me fail to ascertain that. You have cleared up my confusion and I can stop searching for this new mysterious syntax that I've never seen before.
|
|
|
|
|
I managed to get MDI tear off functionality into my app, like VS does. I placed the teared off view window to a dockable pane.
Now I would like to get the Aero Snap (Dragging caption with mouse to monitor top, corners, etc.) functionality for the teared off window.
Someone out there to get me into the right direction?
Regards,
Franz
|
|
|
|
|
This behaviour is MFC native .. your app is a MFC/MDI app ?
|
|
|
|
|
My app is MFC, yes. Found out that snap functionality works only with CFrameWnd inherited windows and not with CDockablePane, as they do not have a DWM caption bar.
|
|
|
|
|
We have a C++ MFC MDI application with a very heavy computational part.
And we want to run it on HPC cluster. Do we need to rewrite the application some specific way to do it? If yes, then what needs to be changed. What the simplest Windows cluster could look like and configured? How to deploy the app and distribute the job?
Thanks.
modified 7-Mar-19 10:16am.
|
|
|
|
|
oleg63 wrote: And we want to run it on cluster. The cluster web site (https://cluster.co/), or one of the mobile apps?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Sorry David,
It's not what I meant.
Question was about the HPC cluster.
|
|
|
|
|
Perhaps this instead?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes. If you have some expertise, please share.
|
|
|
|
|
I don't. I was just trying to clarify (for others) exactly what you were asking.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
Cause you have to reprogram a lot of code with the CUDA, and our program is already parallelized with the OpenMP.
|
|
|
|
|
Hi,
We have lot of modules to handle with for big applications. So, how will we understand the dependencies?I mean if to compile program using make file, how can I know which all modules to compile with?
|
|
|
|
|
Does your IDE support compiling and linking?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
You are (or, at least, should be) the author of the makefile, hence it is up to you to specify the correct dependencies in it.
|
|
|
|
|
The overriding concept of makefiles is the ability to specify the dependencies in a simple tree. But since you are the one who knows which module(s) depend on which, you are the person who will need to create the tree.
|
|
|
|
|
Hello, there is a pseudocode for recursive radix 2 DIT Fast Fourier Transform(page 11,12) at this link.
I have written a code in c++ which does the same, but it doesn't work properly.
For example when I take 1024 datapoints of sin(0.1*x) where x={0,1,...1023}, I get this.
Reverse transform inserted for this gives initial function multiplied by 1024, so it works.
What could be wrong? I tried with value dir and dir/2 inside "Shift" function too.
Here is the code:
Notation: E2-even part, E3-odd part
I work without complex numbers library, so there are both "_re" and "_im" tables.
void FFT(double *tab_re, double *tab_im, double *results_re, double *results_im, int n, int dir) {
if(n==1)
{results_re[0]=tab_re[0]; results_im[0]=tab_im[0]; return;}
int nh=n/2;
double *E2_re=new double [nh];
double *E3_re=new double [nh];
double *E2_im=new double [nh];
double *E3_im=new double [nh];
double *F2_re=new double [nh];
double *F3_re=new double [nh];
double *F2_im=new double [nh];
double *F3_im=new double [nh];
for(int k=0;k<nh;++k) {E2_re[k]=tab_re[2*k];
E2_im[k]=tab_im[2*k];
E3_re[k]=tab_re[2*k+1];
E3_im[k]=tab_im[2*k+1];}
FFT(E2_re,E2_im,F2_re,F2_im,nh,dir);
FFT(E3_re,E3_im,F3_re,F3_im,nh,dir);
Shift(F3_re,F3_im,nh,dir);
for(int k=0;k<nh;++k)
{
results_re[k]=F2_re[k]+F3_re[k];
results_im[k]=F2_im[k]+F3_im[k];
results_re[k+nh]=F2_re[k]-F3_re[k];
results_im[k+nh]=F2_im[k]-F3_im[k];}}
void Shift(double *tab_re, double *tab_im, int n, int v)
{double re,im;
double pi=3.14159265359;
double arg;
for(int i=0;i<n;++i)
{re=tab_re[i];
im=tab_im[i];
arg=v*2.0*pi*i/n;
tab_re[i]=re*cos(arg)-im*sin(arg);
tab_im[i]=re*sin(arg)+im*cos(arg);}}
|
|
|
|
|
If you get the original function back after the reverse, you have probably coded the transform correctly.
The problem is likely to be that your sampling rate is not a multiple of the basic frequency of sin(0.1*x). This means that you get a large FFT component close to the frequency, but you also get "noise" throughout the range, due to the fact that the residues do not cancel out.
I would try taking an FFT of sin(x), sin(2*x), etc., and see if these functions give the expected values.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Thank You for the hint. I have tried with sin(nx), sin(2pi*x/n) and sin(2pi*x*n) too, but results were similar.
The most promising result was for the option with sin(2pi*x*n): here is a result with n=10. Values for x>270 are 0.
I used decimation in frequency FFT instead of decimation in time version, but it still doesn't show good values.
|
|
|
|
|
You lost me with your translation of the code .. page 11 & 12 have the exp function which doesn't appear in your code?
In vino veritas
|
|
|
|