Search:

Type: Posts; User: violatro

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    1,262

    Thank you very much! In fact the trouble was...

    Thank you very much! In fact the trouble was between malloc() and free()!
  2. Replies
    4
    Views
    1,262

    I tried the following inside "func" (hence...

    I tried the following inside "func" (hence wothout using the function matrix)


    double func()
    {
    int n=1;
    double **P;
    P = (double **) malloc((n + 1)*sizeof(double *));
    for (i =...
  3. Replies
    4
    Views
    1,262

    Memory usage blows up

    Hi guys,
    I am using some a piece of code that blows up the memory usage. The function is the following


    static double ** matrix(int nrh, int nch)
    {
    int i;
    double **m;

    m =...
  4. Replies
    15
    Views
    2,436

    In real data sets it takes about 2 minutes (the...

    In real data sets it takes about 2 minutes (the number of operations is about 10^10). I sharpened a lot the origininal Fortran code (written not by me) and I cutted down a lot the time. Now I am...
  5. Replies
    15
    Views
    2,436

    I compiled it by hand and I gained 3-4 seconds!...

    I compiled it by hand and I gained 3-4 seconds! Thank you!
  6. Replies
    15
    Views
    2,436

    I am aware of this. I tried to find out some...

    I am aware of this. I tried to find out some optimized function for computing the exp(x), but I only fond some approximation to exp(x) (that indeed speed up the code). As far as you know, is there...
  7. Replies
    15
    Views
    2,436

    Thank you gusy for the quick and interesting...

    Thank you gusy for the quick and interesting replies.
    I will try to answer to all of you.

    I tried the "pointer" trick, i.e. *f++=s but it did not improve the speed at all.
    As I told in the first...
  8. Replies
    15
    Views
    2,436

    Code optimization

    I guys, I have this function that computes the kernel density estimate. Since both *neval and *nx are O(n^4) I am trying to optimize the function but up to now I did not get better results (for...
  9. Replies
    2
    Views
    2,080

    awesome! Now the code takes half of the time. I...

    awesome! Now the code takes half of the time. I did not put the inline function in the header, but after your advise I did it and it works! Thank you!
  10. Replies
    2
    Views
    2,080

    Function call: how does it cost?

    Hi guys,
    I have a bigger function that calls, in mean 1000-2000 times, a smaller function. I "discover" that calling the smaller function make the code very slow. Is there any hint to fix it? I read...
  11. Replies
    11
    Views
    8,891

    I have fixed it editing the source code. I...

    I have fixed it editing the source code. I thought that it was a reliable source, but it was not!
    ok, thank you guys for the lectures and the suggestions!
  12. Replies
    11
    Views
    8,891

    ok, that was my guess...but it works in C....

    ok, that was my guess...but it works in C. Calling the shared library in R causes this. Ok, for the moment forget about this...
    The point is that I can't allocate in this way


    static struct...
  13. Replies
    11
    Views
    8,891

    Thank you guys...This is a new "topic" for me...

    Thank you guys...This is a new "topic" for me because, up to now, I took care about my segmentation faults..
    I compile with this string in order to create an executable to run in gdb: gcc...
  14. Replies
    11
    Views
    8,891

    glibc detected: what can I do?

    Hi guys...another "bad new"...I was compiling some code and checking it within C and everithing was ok...but when I compile the code in order to use it inside R there something wrong.
    This is what I...
  15. Replies
    12
    Views
    1,672

    indeed, they are (at least after running the...

    indeed, they are (at least after running the sample program above).
    This is a very good remark, to keep in mind (at least for me)
    Thanks!
  16. Replies
    12
    Views
    1,672

    very wise suggestion! int main() { int...

    very wise suggestion!


    int main()
    {

    int array[2], scalar;
    printf("%p %p\n",&array,&array[0]);
    printf("%p %p\n",array,&array);
    }
  17. Replies
    12
    Views
    1,672

    indeed..I have changed it with foo(array) :-)

    indeed..I have changed it with foo(array) :-)
  18. Replies
    12
    Views
    1,672

    oh, now is very clear why this "trick" is not...

    oh, now is very clear why this "trick" is not working with scalars :-) (but actually they also have a memory address...). Thanks a lot! Now I can save a lot of lines in my codes
  19. Replies
    12
    Views
    1,672

    mmmhh, actually if I put array the program is...

    mmmhh, actually if I put array the program is working (with std=gnu99)...well I have discovered something new.
    Thanks a lot!
  20. Replies
    12
    Views
    1,672

    solved! Usually I compile with this gcc...

    solved! Usually I compile with this
    gcc -std=gnu99 -shared ...
    but keeping the default standard
    gcc -shared ...
    the compiler does not complain anymore
    Actually I do not know what is the...
  21. Replies
    12
    Views
    1,672

    pointers and arrays: my compiler complains

    Hi guys...as you can see I have a lot of questions about C...
    Today I was changing my functions and I got complains from the compiler. This is the question: I have a function that takes one...
  22. Replies
    22
    Views
    3,114

    Thank you guys for the support. now all is...

    Thank you guys for the support. now all is working. I have to change a bit something into my functions in order to do all the heavy "work" inside them.
  23. Replies
    22
    Views
    3,114

    with this "minor" modification the function is...

    with this "minor" modification the function is working well (I add loops to fill the arrays)


    void cb_WLS(double *res, double *y, double *X, double *W, int *length_y, int *length_beta)
    {
    int...
  24. Replies
    22
    Views
    3,114

    memset() is very interesting and solves some of...

    memset() is very interesting and solves some of the problems that I had some time ago! Thanks...
    no I am saying that I am wasting in speed. To fill up arrays for, say, 1000 iterations is time...
  25. Replies
    22
    Views
    3,114

    it is about 20 seconds...but with wrong results

    it is about 20 seconds...but with wrong results
Results 1 to 25 of 50
Page 1 of 2 1 2