Search:

Type: Posts; User: waterborne

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,281

    Help with const

    I am working on a program in which I have the struct

    struct molecule {
    double x;
    double y;
    double z;
    double const radius = .05;
    };

    When I compile with g++ without the pedantic flag...
  2. Replies
    2
    Views
    1,614

    Mathematical concepts used in programming is a...

    Mathematical concepts used in programming is a very vague statement. What kind of programming do you have in mind? The kind of work I do is very math intensive while the programming a graphics person...
  3. Replies
    5
    Views
    19,486

    The problem was using setprecision on a char...

    The problem was using setprecision on a char array. I changed the trouble line to:


    outfile << std::setprecision(4) << atof(holder) << " ";

    and that fixed the problem. Thanks for the help.
  4. Replies
    5
    Views
    19,486

    I tried that earlier (outfile.precision(4)) and...

    I tried that earlier (outfile.precision(4)) and it didn't work. I'll give fixed a shot.

    EDIT:That didn't work either. I had this thought though. I read the data into holder which is a character...
  5. Replies
    5
    Views
    19,486

    I could have sworn I tried that earlier and it...

    I could have sworn I tried that earlier and it didn't work but sure enough that fixed the error. However, although it is running, it doesn't look like it is working correctly. My output is;


    ATOM...
  6. Replies
    5
    Views
    19,486

    Can someone help me with setprecision?

    I am trying to use setprecision but I keep getting the error


    RasMolMaker.cpp:124: error: ‘precision’ was not declared in this scope

    I don't understand why I am getting this error when I...
  7. Replies
    1
    Views
    772

    Weird file position

    What kind of errors would cause tellg() to give a position of -1? I've tried searching for this on Google but didn't have much luck. I know a value of -1 means failure but I don't know what are the...
  8. Replies
    5
    Views
    1,379

    Thanks for the clarification - that makes a lot...

    Thanks for the clarification - that makes a lot of sense.
  9. Replies
    5
    Views
    1,379

    I guess I meant along the lines of opening a file...

    I guess I meant along the lines of opening a file and checking to make sure it actually opened. Things of that nature. It seems like there are a lot of different ways to do that but I have a feeling...
  10. Replies
    5
    Views
    1,379

    How do you deal with run-time errors?

    I was just curious what the recommended practice is when it comes to dealing with run-time errors. I have seen assert() used but I thought I read that it is not good practice to use assertions...
  11. Replies
    3
    Views
    1,360

    Thanks for the input! I looked up get() and...

    Thanks for the input! I looked up get() and getline() and made some changes. Now the code compiles and runs but ends after incorrectly reading 1 line. The new code is:



    #include <fstream>...
  12. Replies
    3
    Views
    1,360

    Trouble with eof()

    I am writing a program that reads in a file and converts the data to a different format. I am having issues with using the end of file function. The program compiles with out any error but when I run...
  13. Replies
    0
    Views
    1,135

    Help with Undefined symbols error

    I am using a fairly large software package (that presumably worked for the creator). I am getting an Undefined symbols error and all the files are object files. I don't know where to start with...
  14. Replies
    3
    Views
    1,255

    I don't understand what you said. Is that a...

    I don't understand what you said. Is that a comment or advice? This isn't a question on which function I should use but more of a best approach to this problem. Right now my solution is to have all...
  15. Replies
    3
    Views
    1,255

    MPI communication question

    I am having trouble finding a way to implement communication between processes using MPI. I have a cube split up into sub-cubes and each process is in charge of calculations over a certain subset of...
  16. Replies
    31
    Views
    4,897

    Since you have no math background or experience I...

    Since you have no math background or experience I would strongly recommend getting a tutor or taking some classes at a community college. My experience as a mathematician is that non-math people...
  17. Replies
    6
    Views
    1,063

    Using %02d did exactly what I was looking for. ...

    Using %02d did exactly what I was looking for.

    There is no error in my program - I just did not post my program's output. I just put one column of numbers because those were the only ones I cared...
  18. Replies
    6
    Views
    1,063

    Quick printf question

    I think this is a very simple question but I haven't been able to find the answer in my book.

    This is how I want the output to look


    00
    01
    02
    03
    ....
  19. Replies
    4
    Views
    880

    Ahh I just realized I don't need to allocate all...

    Ahh I just realized I don't need to allocate all that memory. Since I am doing this in parallel I only need to allocate memory for (2304/max_process_count)x(304/max_process_count) matrix, which in...
  20. Replies
    4
    Views
    880

    Segmentation fault question

    I am working on some code that multiplies 2 matrices in parallel. I statically allocate memory for the matrices so that each matrix has the memory to be 2304x2304. When I compile and run I get a...
  21. Replies
    5
    Views
    1,157

    I suppose if it were so obvious I wouldn't have...

    I suppose if it were so obvious I wouldn't have asked the question in the first place. Either way, I appreciate the condescension.
  22. Replies
    5
    Views
    1,157

    That did the trick. I guess I was changing the...

    That did the trick. I guess I was changing the value of the pointer in the original code and what I should have been doing is changing to value at the address the pointer points to (by using the...
  23. Replies
    5
    Views
    1,157

    Help with assignment error

    I am modifying some code (which I did not originally code) and have come in to this error upon compiling:


    Lvalue required as left operand of assignment

    The problem occurs here:


    temp +...
  24. Replies
    5
    Views
    3,652

    Here is my two cents. I would start over from...

    Here is my two cents.

    I would start over from scratch. Your code is incredibly difficult to read without any indentation and it will probably be faster to just rewrite your code than get the...
  25. Replies
    2
    Views
    1,471

    If "return I_2" is executed it returns the I_2...

    If "return I_2" is executed it returns the I_2 value to the I_1a or I_1b from the previous else loop that called SimpsonQuad right? Then that else section returns a value to its previous else section...
Results 1 to 25 of 41
Page 1 of 2 1 2