Search:

Type: Posts; User: lawrenced

Search: Search took 0.01 seconds.

  1. all, have figured out how to do this with out...

    all, have figured out how to do this with out containers or vectorizations is significantly faster than with vectors~ x2.
  2. tabstop, i am able to perform the above loop...

    tabstop, i am able to perform the above loop without any if statements - this should run signifcantly faster than using if statements correct?
  3. can anyone think of the best way to do that while...

    can anyone think of the best way to do that while running the loop? i think the code:



    double sum = 0;
    int j = 0;
    int k = 0;
    for(int i =0; i<vals.size(); ++i)
    {
    k += -(vals[i]-1);
  4. yes, i will have a series of true values (not...

    yes, i will have a series of true values (not necessarily just 3) and i want to pull the 1st true value and then the next true value to give A(1st,2nd) on the last true value in the list, I want to...
  5. best way to run through loop and perform operation

    I have a vector of bools that looks like

    vector<bool> vals
    position: 0 1 2 3 4 5
    bool val: 0 1 0 0 1 1

    the bool val indexes to a 6x6 matrix A where i have random values stored.
    in my...
  6. Replies
    5
    Views
    1,200

    I don't even know how to do bottleneck testing,...

    I don't even know how to do bottleneck testing, was just wondering if someone had some insight. how can i do that?
  7. Replies
    5
    Views
    1,200

    bool variables

    I have a vector of bool vals;
    V1 = [0,1,0,1]
    V2 = [1,0,0,1]
    V3 = [1,1,1,1]
    V4 = [0,0,0,1]

    V1*V2 = [0,0,0,0]
    V1*V3 = [0,1,0,1]
    V1*V4 = [0,0,0,1]
  8. Replies
    5
    Views
    1,883

    increment iterator after loop

    I have a list interator



    list<ClassA*>::iterator it;
    for(it = list1.begin(); it != list1.end(); ++it)
    {
    if( (*it)->itsvalB == myvalB)
    {
    break;
  9. Replies
    8
    Views
    1,377

    because I don't know how to do this? is there a...

    because I don't know how to do this? is there a way?
  10. Replies
    8
    Views
    1,377

    how to declare it as external? do you have code...

    how to declare it as external? do you have code example of declare?
  11. Replies
    8
    Views
    1,377

    loading vectors and data before main

    I have a series of datasets that I load like this:

    ifstream code that looks like this in the beginning of main


    int main
    {
    vector<vector<bool >> setbool;
    ifstream setboolCSV...
  12. Replies
    9
    Views
    5,840

    many thanks for the help. it is enough to use if,...

    many thanks for the help. it is enough to use if, else if , else statement
  13. Replies
    9
    Views
    5,840

    switch case with dynamic

    i am trying to use switch case with a variable and was wondering if some help could be offered

    error I get is: error C2051: case expression not constant

    I have the code:




    for(int i = 0;...
  14. Replies
    23
    Views
    3,126

    brewbuck can you expand further? this is closer...

    brewbuck can you expand further? this is closer to what I am looking to do and your comments seem insightful
  15. Replies
    10
    Views
    1,224

    iterators & lists

    if I am running through a list

    list<Class A*> lclassA;
    list<Class A*>::iterator = iter;

    for(iter = lclassA.begin(); iter!=lclassA.end(); ++iter)
    {
    var1 = (*iter)->Getabba();
    var2 =...
  16. Replies
    23
    Views
    3,126

    how much time will this impact my code if i may...

    how much time will this impact my code if i may be doing multi millions of loops?
  17. Elysia - thank you very much for suggestion -...

    Elysia - thank you very much for suggestion - Reservation will grown to have many characteristics - very large class with many private data members - i think i will want to keep it as pointer for...
  18. Replies
    23
    Views
    3,126

    accessing private class data low overhead

    currently I am using pointers and functions to access private class date

    in

    ptrClassA->Setval;
    void setval(double val) {itsval = val;}
    ptrClassA->Getval
    double Getval() {return itsval;}
    ...
  19. i am confused on syntax. may you offer some...

    i am confused on syntax. may you offer some example code as help please?
  20. c++ does not have an STL that will find the best...

    c++ does not have an STL that will find the best place to insert the object in a list based on some sortable criteria? i was originally going to use list, and run through the list comparing dates,...
  21. I am new to c++ so I don't fully understand - ...

    I am new to c++ so I don't fully understand -

    I will be creating set<Reservations*> restaurant1;
    I want to randomly allocate

    vector<Reservations*> reservationsmade;

    to set<Reservations*>...
  22. using set of class obj to sort by obj member

    hi,

    I have a Class which one of its attributes is a date -

    Class reservations
    members - name
    - date

    lets say I have multiple restaurants and want to insert class...
  23. Replies
    3
    Views
    2,516

    transform the strings into indices? is this...

    transform the strings into indices? is this convert the position into an integer and then use that integer wherever i would've had the string before?
  24. Replies
    3
    Views
    2,516

    set find

    hi,
    I am new to c++ -

    there may be a better way to do this but I have a CSV file with column names on top and row names along the left side. and the matrix contains double values.

    i...
Results 1 to 24 of 24