Search:

Type: Posts; User: rcgldr

Page 1 of 20 1 2 3 4

Search: Search took 0.14 seconds; generated 55 minute(s) ago.

  1. If the the factors are all large prime numbers...

    If the the factors are all large prime numbers it's going to take quite a while, but for 2^512-1, one of the factors is a 62 digit prime, and that takes a fraction of a second.
  2. Here is a link to an online factoring program...

    Here is a link to an online factoring program that also includes source code, that finds the the factors for that large number in a fraction of a second.

    Integer factorization calculator

    The...
  3. Thread: what is goto?

    by rcgldr
    Replies
    3
    Views
    2,099

    Sometimes goto is useful as shown in the threads...

    Sometimes goto is useful as shown in the threads linked to below. The first is about a 4 way merge sort that doesn't use a min-heap. The second is a more generic question. Typically goto is useful...
  4. Replies
    2
    Views
    5,151

    Visual Studio is not running some type of virtual...

    Visual Studio is not running some type of virtual mode. Instead, it knows the acceptable syntax for C / C++ and also some common errors, so it will produce errors or warnings as you type in code.
  5. Replies
    6
    Views
    7,391

    I forgot to reply to this before. It's possible...

    I forgot to reply to this before. It's possible that the amount of sensitivity to alignment may be specific to the Intel 3770K or any of the third generation of processors known as "Ivy Bridge",...
  6. Replies
    6
    Views
    7,391

    Example C++ code for Windows. Converting the code...

    Example C++ code for Windows. Converting the code to C is simple, but more effort would be needed to convert to Posix semaphores and threads. This example takes about 0.4 seconds to sort 36 million...
  7. Replies
    6
    Views
    7,391

    I modded a radix sort for 36 million psuedo...

    I modded a radix sort for 36 million psuedo random 64 bit integers, using (8,8,8,8,8,8,8,8) bit fields (8 passes), to use 4 threads corresponding to the 4 cores on my processor (Intel 3770K). The...
  8. Replies
    6
    Views
    7,391

    The code in the prior thread could use some minor...

    The code in the prior thread could use some minor tweaks to make it a bit faster, but it's at a point of diminishing returns. As pointed out in the prior thread, if sorting 64 bit unsigned integers,...
  9. This is similar to john.c's answer, but only...

    This is similar to john.c's answer, but only checks for a == NULL or b == NULL as needed, instead of a while that checks both for every node moved.



    ListNode * MergeLists(ListNode *a, ListNode...
  10. Replies
    53
    Views
    43,248

    One issue with the suggested solutions is that...

    One issue with the suggested solutions is that the results will be slightly biased due to rand%(x), where x ranges from 49 to 44. For example, if using a 32 bit random number generator modulo 49,...
  11. Replies
    10
    Views
    7,791

    By older compilers, I meant ones that aren't c89...

    By older compilers, I meant ones that aren't c89 compliant. This would include most 16 bit compilers for X86 (like Microsoft (although the last 16 bit tool set was released in 1994, I don't think...
  12. Replies
    10
    Views
    7,791

    Depending on the compiler (usually older ones),...

    Depending on the compiler (usually older ones), global variables may not be initialized, unless explicitly initialized, while static variables are initialized to zero by default.
  13. Replies
    2
    Views
    12,216

    There are two types of LFSR, Fibonacci and...

    There are two types of LFSR, Fibonacci and Galois. The question doesn't specify which type. Wiki article:

    Linear-feedback shift register - Wikipedia
  14. Those are possible explanations for variations in...

    Those are possible explanations for variations in run time, but they don't explain a consistent difference in run time (1.465 seconds versus 2.000 seconds) due to location of code.
  15. Possibly, but Windows non-I/O thread switches...

    Possibly, but Windows non-I/O thread switches only occur on tick boundaries, and at 64 hz, 2 seconds, that is 128 possible thread switches out of 1048576 calls to fib(), or 8192 calls per possible...
  16. Replies
    15
    Views
    18,168

    I posted it in the tech board section: ...

    I posted it in the tech board section:

    https://cboard.cprogramming.com/tech-board/177912-intel-3770k-~35%-time-difference-tight-loop-depending-location-other-cpus.html#post1288661
  17. Intel 3770K ~35% time difference in tight loop depending on location - other cpus?

    The code below is X86 64 bit assembly code to calculate the sum of Fib(0) to Fib(93). It includes a conditional to use either a tight loop or an unfolded loop with a computed jump to enter the...
  18. Replies
    15
    Views
    18,168

    One issue I found with 3770K was an unusual...

    One issue I found with 3770K was an unusual sensitivity to code location in tight loops. I was comparing 64 bit assembly code for Fibonacci number using a tight loop versus an unfolded loop,...
  19. Replies
    15
    Views
    18,168

    My prior testing was wrong, on my 3770K at...

    My prior testing was wrong, on my 3770K at 3.5ghz, 64 bit mode, original takes ~1.18, alternate ~1.26 seconds, about 6.6% slower, not much of a difference.
  20. Replies
    15
    Views
    18,168

    Can't you use the code from your prior post? I...

    Can't you use the code from your prior post? I made a different version of main, calls rand() multiple times since VS rand() only returns 15 bits (it also matches some other old code used for...
  21. Replies
    15
    Views
    18,168

    This code is used to handle the case where a...

    This code is used to handle the case where a single sorted run is all that is remaining to the end of the array, so it just does a copy of that single run. Calling Merge201 after that looks like it...
  22. Replies
    15
    Views
    18,168

    I never got a reply about the call to Merge201...

    I never got a reply about the call to Merge201 after doing a MergeCopy10.

    I'm also wondering if the original version is easier to follow than the alternate version. The original version...
  23. Replies
    15
    Views
    18,168

    Thanks The code in main needs to check the...

    Thanks

    The code in main needs to check the array pointed to by the returned pointer in "result" (instead of dest or source). To end up with the sorted array in the original array (not the working...
  24. Replies
    15
    Views
    18,168

    ... and in 1974, Donald Knuth wrote "Structured...

    ... and in 1974, Donald Knuth wrote "Structured Programming with go to Statements" (you can do a web search to find copies of the original paper). The point of creating this thread is that I rarely...
  25. Replies
    15
    Views
    18,168

    Sometimes "goto" is useful

    Here is an example of a 4 way (no minheap) bottom up merge sort, which is about 15% faster than a 2 way merge sort and about as fast (sometimes a bit faster) than quick sort, on a processor with 16...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4