Search:

Type: Posts; User: cybernike

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    15,422

    Adding int to long long

    Supposed I do the following:

    b= b + a;

    , where b is a long long variable and a is an int variable


    Will the compiler do any type casting which is expensive? Does this depend on the...
  2. Replies
    2
    Views
    1,661

    input/output streams

    Why when we pass output/input streams to functions, we have to pass by reference?

    Thanks.
  3. Replies
    2
    Views
    2,779

    I just checked. It is 3.4.6 .

    I just checked. It is 3.4.6 .
  4. Replies
    2
    Views
    2,779

    g++ compile options

    if I am using an intel Core 2 Duo CPU, what would be my cpu match for the optimization option [-march= ??????] ?
  5. Replies
    10
    Views
    1,488

    For now, I don't need 4294967295 elements for a...

    For now, I don't need 4294967295 elements for a class or data type. The question was hypothetical. I know declaring a 3D array does not change the memory usage. What I was trying to say is the...
  6. Replies
    10
    Views
    1,488

    What if I ever need more than 4294967295 (max of...

    What if I ever need more than 4294967295 (max of unsighed long int) elements in an array?
    My compiler wouldn't recognize an integer larger than 4294967295.
  7. Replies
    10
    Views
    1,488

    Thanks.

    Thanks.
  8. Replies
    43
    Views
    5,233

    bool Set(int element, bool value) { if...

    bool Set(int element, bool value)
    {
    if (element > elementCount)
    return false;

    int ed32 = element / 32;
    int em32 = element % 32;
    unsigned int modValue;

    if (value)
  9. Replies
    10
    Views
    1,488

    Thanks. I should be more specific; I also want...

    Thanks.

    I should be more specific; I also want to use the memory in the heap by using the new operator to declare the 3D array and instantiate it using the constructor.

    How may I do that?
  10. Replies
    10
    Views
    1,488

    Syntax: 3D array of a class

    Say I have a class:


    class foo()
    {
    public:
    foo(int n){
    x=n;
    }
  11. Replies
    43
    Views
    5,233

    How could I make the syntax look similar to a 3D...

    How could I make the syntax look similar to a 3D array so that I can put x,y,z coordinates to the bitsets?

    Thanks.
  12. Replies
    43
    Views
    5,233

    Yep..still too large. Does the "long long"...

    Yep..still too large.

    Does the "long long" definition only work for a 64-bit OS?
  13. Replies
    43
    Views
    5,233

    for the line: modValue = 4294967296 - (1

    for the line:
    modValue = 4294967296 - (1 << em32);

    my compiler, g++, is saying the number is larger than the max of long.

    what should I do? I tried to use "long long" to define modValue. Same...
  14. Replies
    43
    Views
    5,233

    That was me. Thanks a lot. I'm currently testing...

    That was me. Thanks a lot. I'm currently testing another structure written by another user. I will definitely try your code and let you know the speed too.

    Thanks again.
  15. Replies
    2
    Views
    1,012

    Template class with variable parameters.

    Suppose I have a template class:


    template<class A, int B>
    class foo
    {
    .....
    }

    is it possible to instantiate the template class with a variable in the second paramter?
  16. Replies
    37
    Views
    5,182

    Thanks to Budda, David, and everyone else. I will...

    Thanks to Budda, David, and everyone else. I will incorporate your ideas and run empirical tests to compare the speeds.

    I'll let you all know the results.
  17. Replies
    37
    Views
    5,182

    Let me state the problem more clearly. In a...

    Let me state the problem more clearly. In a 1000x1000x1000 space, there are 1000 particles. We can only move one particle at a time, and the particle can move in one of the six directions by 1 unit...
  18. Replies
    37
    Views
    5,182

    Thanks, I will definitely try to get some ideas...

    Thanks, I will definitely try to get some ideas from game programming.

    If I have to choose between memory and speed, speed is definitely more important.


    I have not specified the time scale;...
  19. Replies
    37
    Views
    5,182

    Doing a search for a few points through a vector?...

    Doing a search for a few points through a vector? why only a few points? do you mean you have done some kind of sorting that would tell us the nearest neighbors of a particular particle?
    I really...
  20. Replies
    37
    Views
    5,182

    With what you said, let the radius be 1. I'd...

    With what you said, let the radius be 1.
    I'd like to know if a point with coordinates (1,1,1) has any particles right next to it. I would have to check if any particle would have the coordinates...
  21. Replies
    37
    Views
    5,182

    I was thinking to let my program only represent...

    I was thinking to let my program only represent points that exist in the 3D space, since there are many more slots than the number of the points in the 3D space. However, if I declare a struct like...
  22. Replies
    37
    Views
    5,182

    It is a matrix that represents a 3D space. If...

    It is a matrix that represents a 3D space. If that point is true, that means something is on that space. Any better idea than using a matrix? Speed is very important.
  23. Replies
    37
    Views
    5,182

    You are right that it is for voxel data (I had to...

    You are right that it is for voxel data (I had to look up what voxel means). I am writing a Monte Carlo program that describes brownian motions.
    I will definitely look into RLE, if it could reduce...
  24. You're the man. Thanks.

    You're the man. Thanks.
  25. I really meant "initialize", i.e., assigning a...

    I really meant "initialize", i.e., assigning a value to the variable when declaring the variable.

    I should have mentioned that the global variable is also a constant variable; therefore, I need...
Results 1 to 25 of 30
Page 1 of 2 1 2