Click here to Skip to main content
16,005,290 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: how to share a class with string member in managed and Unmanaged C++ Pin
Nish Nishant14-Nov-05 4:08
sitebuilderNish Nishant14-Nov-05 4:08 
GeneralRe: how to share a class with string member in managed and Unmanaged C++ Pin
dummy80814-Nov-05 9:44
dummy80814-Nov-05 9:44 
QuestionHow to force the .NET version in a managed C++ DLL? Pin
Kubla Khan13-Nov-05 14:28
Kubla Khan13-Nov-05 14:28 
AnswerRe: How to force the .NET version in a managed C++ DLL? Pin
Nish Nishant14-Nov-05 4:10
sitebuilderNish Nishant14-Nov-05 4:10 
GeneralRe: How to force the .NET version in a managed C++ DLL? Pin
Kubla Khan14-Nov-05 5:21
Kubla Khan14-Nov-05 5:21 
QuestionDeleting from a binary search tree Pin
darylesha12-Nov-05 17:48
darylesha12-Nov-05 17:48 
AnswerRe: Deleting from a binary search tree Pin
Nish Nishant14-Nov-05 4:10
sitebuilderNish Nishant14-Nov-05 4:10 
Questionrandom number generation problem in C++ Pin
amarsankar11-Nov-05 18:07
amarsankar11-Nov-05 18:07 
Could some one please help out with this?

We generate random numbers using the random no generator code given below. We generate these random numbers for several applications (up to 200). This means that every application runs this function with different seeds.

long node :: RandomNo(long m)
{
long double k, temp ;
long z;

k = Congruential.Seed / 53668;
Congruential.Seed = 40014 *(Congruential.Seed - k *53668) - k*12211 ;
if (Congruential.Seed < 0)
Congruential.Seed = Congruential.Seed + 2147483563;

k = Congruential.Seed2 / 52774;
Congruential.Seed2 = 40692 *(Congruential.Seed2 - k *52774) - k*3791 ;
if (Congruential.Seed2 < 0)
Congruential.Seed2 = Congruential.Seed2 + 2147483399;

z = Congruential.Seed - Congruential.Seed2 ;
if(z < 1)
z = (long) (z +2147483562) ;
temp = (z * 4.656613) / (10000000000);
z = (long)(temp * 10000000);
z = long( z % long(m+1));

return (z);
}

The seeds are got as per the application number through the function shown below

void node :: SetLinearCongruential(int nno)
{
unsigned long g_lSeed[2]={12345678,23456789};
Congruential.Seed = (g_lSeed[0])*nno;
Congruential.Seed2 = (g_lSeed[1])*nno;
return;
}

The problem is that the random number stop for certain application after a certain point of time.
Example

Average no of application runs - 300,000

Application no runs

35553
46 57889
57 123435
87 67345

This example shows that applications 31,46,57 & 87 have much lower average applications runs as compared to the rest.

These values how ever change when the seed (g_lSeed[i]) value is changed.

We need to ensure that all applications have the same number of runs.
Can some one pls help out?

Thanks in advance

when goin' gets tough, tough gets goin'
amarLaugh | :laugh:
QuestionValues of 5.1 soundcard and graphic equlizer Pin
werner2711-Nov-05 1:50
werner2711-Nov-05 1:50 
AnswerRe: Values of 5.1 soundcard and graphic equlizer Pin
mikanu15-Nov-05 8:35
mikanu15-Nov-05 8:35 
QuestionHelp with connect 4 AI Pin
daham0810-Nov-05 13:26
daham0810-Nov-05 13:26 
AnswerRe: Help with connect 4 AI Pin
Jeremy Thornton12-Nov-05 14:24
Jeremy Thornton12-Nov-05 14:24 
Questionfstreaming a whole object (pointer) Pin
Hmmkk10-Nov-05 11:56
Hmmkk10-Nov-05 11:56 
AnswerRe: fstreaming a whole object (pointer) Pin
Christian Graus10-Nov-05 12:49
protectorChristian Graus10-Nov-05 12:49 
GeneralRe: fstreaming a whole object (pointer) Pin
Hmmkk10-Nov-05 19:29
Hmmkk10-Nov-05 19:29 
GeneralRe: fstreaming a whole object (pointer) Pin
Christian Graus13-Nov-05 9:53
protectorChristian Graus13-Nov-05 9:53 
QuestionReading/editing registry on different .dat file? Pin
LordZoster9-Nov-05 11:40
LordZoster9-Nov-05 11:40 
Questionbinary hex conversion using stacks Pin
OttawaSenator9-Nov-05 6:57
OttawaSenator9-Nov-05 6:57 
AnswerRe: binary hex conversion using stacks Pin
mikanu9-Nov-05 7:12
mikanu9-Nov-05 7:12 
GeneralRe: binary hex conversion using stacks Pin
OttawaSenator9-Nov-05 11:10
OttawaSenator9-Nov-05 11:10 
GeneralRe: binary hex conversion using stacks Pin
mikanu10-Nov-05 16:32
mikanu10-Nov-05 16:32 
Question&quot;please help assignment due soon&quot; Pin
da_comp_learner7-Nov-05 16:07
da_comp_learner7-Nov-05 16:07 
AnswerRe: &amp;quot;please help assignment due soon&amp;quot; Pin
Christian Graus7-Nov-05 16:26
protectorChristian Graus7-Nov-05 16:26 
Questionmemory leak Pin
nineofhearts7-Nov-05 11:37
nineofhearts7-Nov-05 11:37 
AnswerRe: memory leak Pin
Christian Graus7-Nov-05 12:25
protectorChristian Graus7-Nov-05 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.