Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Disruptive

    Simple Perl script

    Hi I am having trouble trying to read in name, value pair data from a text file. I want each name and value on each line and be able to check the value of each name or value indepently (stored in sep varables). I seem to have tied myself in knots trying to get this working. #!/usr/bin/perl...
  2. Disruptive

    Quick algorithm wanted

    not suitable...prob too slow! I am dealing with real numbers.
  3. Disruptive

    Timing a loop in microseconds

    Just to follow up, I managed to play around and replace the fmod with a floor function with modifications. This seems to run a little quicker. I guess it is much easier to calculate than fmod or so it would seem! Thanks again guys!
  4. Disruptive

    Quick algorithm wanted

    Hi In my efforts to speed things up somewhat I would like to output an integer (1) if x > Xmax or x < 0, but if x is between the limits 0 to Xmax then will return. Obviously I can write withif then and have done so, but as this routine is being called billions of times any potential time saving...
  5. Disruptive

    fmod quick?

    Typical length of time is 1 week. Complex simulation, so you can imagine the typical time saving that removing a slow expression. I might be called fmod 1 Billion times so if I can avoid using it and replace with something quicker than that would be an advantage. As for processing power, we...
  6. Disruptive

    Timing a loop in microseconds

    Using gcc on a linux box, debian base
  7. Disruptive

    Timing a loop in microseconds

    How can I introduce timing for a routine/loop in C, I seem to see so many conflicting and not working examples on the web. I can time in seconds but some of these processes are lasting less than a second so it does not help with my optimisation. Could some point to some useful code that will...
  8. Disruptive

    Fast 2D array copy

    Aha yes, I forgot about that, so is there a way of using memcpy or something faster that will perform the copying?
  9. Disruptive

    Fast 2D array copy

    I have the for loop working just fine and hence the copying function works fine. However the memcpy function causes a segmentation fault and I just cannot see from where it would occur, the sizes should be ok.
  10. Disruptive

    fmod quick?

    1. yes of course I can change the code, but there are limits to what I can do. Integrity of data remains at the foremost. This is a well used funtion in the program which is why I am udertaking the speed analysis. The code is for a numerical simuation and hence at every move the mod has the...
  11. Disruptive

    Fast 2D array copy

    I have explicitly listed how the arrays have been defined below. the source array is passed to the function handling the opy with the following form: void cop_fun (double ***ptrBeadArray) ptrBeadArrayOld = (double **)malloc(BeadTotal * sizeof(double *)); for (i = 0; i< BeadTotal; i++)...
  12. Disruptive

    Real array in UNIX script

    Thats great! Sorted out for the time being. Thanks Guys!
  13. Disruptive

    Real array in UNIX script

    do u have aby examples for ksh?
  14. Disruptive

    Real array in UNIX script

    I am using the script to run through a series of combinations which will be inserted into files and then run using awk for example. However I have a complicated range of numbers and have listed them in an array which I can loop through. I can think of a better or smarter way to do it, I just...
  15. Disruptive

    Real array in UNIX script

    Hi I am keen to create an array which stores real numbers which I can then loop through. I have tried using the bash script, but I cant see any literature which states whether I can actually get real numbers into the arrays. The sort of code I have put together is: #!/bin/bash KT[1]= 1.0 or...
  16. Disruptive

    fmod quick?

    It might be micro-optimisation, but faced with limited scope for changing the code, it makes sense to try particularly with repeated commands as a small time saving is multiplied. How do you suggest placing timers into the code to time execution of certain elements?
  17. Disruptive

    fmod quick?

    Is there a quicker alternative that someone knows about? is it quicker in peoples experience to use ifs? fmod((xpos + Xbox), Xbox) ALSO I am toggling between 0 and 1, I use the following code (currenttoggle + 1) % 2; which works fine, however I am looking for speed-up. Any ideas? Cheers
  18. Disruptive

    Speed and array passing

    Hi I have some simulation code which passes all arrays by reference to the required function block. I have avoided global variables even though this would be the easiest method and therefore I have functions which are being send maybe 10-15 arrays and the headers are quite cumbersome. However...
  19. Disruptive

    Fast 2D array copy

    Hi I am repeatedly copying the array elements from old array to new array, performing operations on the new array (changing) in the process and then determining whether or not use the new array values or the old ones. To speed things up what I do is create a new array and using pointers...
  20. Disruptive

    Sed and regular expression

    Hi I wish to alternately change some of the data in the following way. For example I wish to switch all species from their current value to their binary opposite. I.e. from 1 -> 0 and from 0 -> 1 when the LIPID number is even. Now the data is on the file such that the LIPID number is before the...

Part and Inventory Search

Back
Top