all, have figured out how to do this with out containers or vectorizations is significantly faster than with vectors~ x2.
Type: Posts; User: lawrenced
all, have figured out how to do this with out containers or vectorizations is significantly faster than with vectors~ x2.
tabstop, i am able to perform the above loop without any if statements - this should run signifcantly faster than using if statements correct?
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);
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...
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...
I don't even know how to do bottleneck testing, was just wondering if someone had some insight. how can i do that?
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]
I have a list interator
list<ClassA*>::iterator it;
for(it = list1.begin(); it != list1.end(); ++it)
{
if( (*it)->itsvalB == myvalB)
{
break;
because I don't know how to do this? is there a way?
how to declare it as external? do you have code example of declare?
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...
many thanks for the help. it is enough to use if, else if , else statement
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;...
brewbuck can you expand further? this is closer to what I am looking to do and your comments seem insightful
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 =...
how much time will this impact my code if i may be doing multi millions of loops?
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...
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;}
...
i am confused on syntax. may you offer some example code as help please?
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,...
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*>...
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...
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?
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...