map map2; int type (string r, char A[],int y ) { int t=0,h=0,d; int x = r.length()-1; for (int i=0;i::iterator name; name=map2.[Values[i]]; if(name!=map2.end()) { map::iterator it1; it1 =map2.find(Values[i]); double b=Values[j+1]=atof(values[j+1].c_str()); (it1->second).elepow(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; } } else { map::iterator it1; it1 =map2.find(Values[i+1]); double b =Values[j]=atof(values[j+1].c_str()); map2[CHAR]= (it1->second).elepow(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; } } } else if(typee==3) { Values[i]=atof(values[j].c_str()); Values[i+1]=atof(values[j].c_str()); values[i+1]= pow(Values[i],Values[i+1]); s1.replace(s1.find(r),r.length(),string(1, CHAR)); CMatrix M(values[i+1]); map2[CHAR] = M; break; /*if(i!=0) {arrayModification(i,j,Values); arrayModification(i,j,elements); arrayModification(i,j,places);}*/ }} if (elements[i]=='*') { r=Values[i]+string(1, elements[i])+Values[i+1]; int typee; typee= type ( r, A, y ); if(typee==1) { CMatrix M(); map::iterator it1; // iterator that iterates over the map to find the desired value(CMatrix) of a certain key(char) map::iterator it2; it1 =map2.find(Values[i]); //find the CMatrix of the first operand it2 =map2.find(Values[i+1]); map2[CHAR]= (it1->second) * (it2->second) ; s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*if(i!=0) {arrayModification(i,j,Values); arrayModification(i,j,elements); arrayModification(i,j,places); }*/ // mymap.insert( pair < char , CMatrix > (CHAR,CMatrix(M))); } else if(typee==2) { map::iterator name; name=map2.[Values[i]]; if(name !=mymap.end()) { map::iterator it1; it1 =map2.find(Values[i]); double b=Values[j+1]=atof(values[j+1].c_str()); //if(b==1) map2[CHAR]= (it1->second).elemul(b); //else mymap[CHAR]= (it1->second).elemul(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /* if(i!=0) {arrayModification(i,j,Values); arrayModification(i,j,elements); arrayModification(i,j,places);}*/ } else if(typee==3) { map::iterator it1; it1 =map2.find(Values[i+1]); double b =Values[j]=atof(values[j+1].c_str()); map2[CHAR]= (it1->second).elemul(b); //else mymap[CHAR]= (it1->second).elemul(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*if(i!=0) {arrayModification(i,j,Values); arrayModification(i,j,elements); arrayModification(i,j,places);}*/ } } else if(typee==3) { Values[i]=atof(values[j].c_str()); Values[i+1]=atof(values[j].c_str()); values[i+1]= Values[i]*Values[i+1]; s1.replace(s1.find(r),r.length(),string(1, CHAR)); CMatrix M(values[i+1]); map2[CHAR] = M; break; /* if (i!=0) arrayModification(i+1,j,Values); arrayModification(i+1,j,elements); arrayModification(i+1,j,places);}*/ }} if (elements[i]=='/') { r=Values[i]+string(1, elements[i])+Values[i+1]; int typee; typee= type ( r, A , y ); if(typee==1) { CMatrix M(); map::iterator it1; // iterator that iterates over the map to find the desired value(CMatrix) of a certain key(char) map::iterator it2; it1 =map2.find(Values[i]); //find the CMatrix of the first operand it2 =map2.find(Values[i+1]); map2[CHAR]= (it1->second) / (it2->second) ; s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*if(i!=0) {arrayModification(i,j,Values); arrayModification(i,j,elements); arrayModification(i,j,places); }*/ // mymap.insert( pair < char , CMatrix > (CHAR,CMatrix(M))); } else if(typee==2) { map::iterator name; name=map2.[Values[i]]; if(name !=map2.end()) { map::iterator it1; it1 =map2.find(Values[i]); double b=Values[j+1]=atof(values[j+1].c_str()); if(b==1) {map2[CHAR]= (it1->second).elediv(); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break;} else {map2[CHAR]= (it1->second).elediv(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*arrayModification(i+1,j,Values); arrayModification(i+1,j,elements); arrayModification(i+1,j,places);*/} } else { map::iterator it1; it1 =map2.find(Values[i+1]); double b =Values[j]=atof(values[j+1].c_str()); if(b==1) {map2[CHAR]= (it1->second).elediv(); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*arrayModification(i+1,j,Values); arrayModification(i+1,j,elements); arrayModification(i+1,j,places);*/} else{ map2[CHAR]= (it1->second).elediv(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*arrayModification(i+1,j,Values); arrayModification(i+1,j,elements); arrayModification(i+1,j,places);*/} } } else if(typee ==3) { Values[i]=atof(values[j].c_str()); Values[i+1]=atof(values[j].c_str()); values[i+1]= Values[i]/Values[i+1]; s1.replace(s1.find(r),r.length(),string(1, CHAR)); CMatrix M(values[i+1]); map2[CHAR] = M; break; }} if (elements[i]=='+') { r=Values[i]+string(1, elements[i])+Values[i+1]; int typee; typee= type ( r, A, y ); if(typee==1) { CMatrix M(); map::iterator it1; // iterator that iterates over the map to find the desired value(CMatrix) of a certain key(char) map::iterator it2; it1 =map2.find(Values[i]); //find the CMatrix of the first operand it2 =map2.find(Values[i+1]); map2[CHAR]= (it1->second) + (it2->second) ; s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; // mymap.insert( pair < char , CMatrix > (CHAR,CMatrix(M))); } else if(typee==2) { map::iterator name; name=map2.[Values[i]]; if(name !=map2.end()) { map::iterator it1; it1 =map2.find(Values[i]); double b=Values[j+1]=atof(values[j+1].c_str()); map2[CHAR]= (it1->second).eleadd(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*else { map::iterator it1; it1 =mymap.find(Values[i+1]); double b =Values[j]=atof(values[j+1].c_str()); mymap[CHAR]= (it1->second).eleadd(b); //else mymap[CHAR]= (it1->second).eleadd(b); }*/ } else if(typee==3) { Values[i]=atof(values[j].c_str()); Values[i+1]=atof(values[j].c_str()); values[i+1]= Values[i]+ Values[i+1]; s1.replace(s1.find(r),r.length(),string(1, CHAR)); CMatrix M(values[i+1]); map2[CHAR] = M; break; }} if (elements[i]=='-') { r=Values[i]+string(1, elements[i])+Values[i+1]; int typee; typee= type ( r, A, y ); if(typee==1) { CMatrix M(); map::iterator it1; // iterator that iterates over the map to find the desired value(CMatrix) of a certain key(char) map::iterator it2; it1 =map2.find(Values[i]); //find the CMatrix of the first operand it2 =map2.find(Values[i+1]); map2[CHAR]= (it1->second) - (it2->second) ; s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; // mymap.insert( pair < char , CMatrix > (CHAR,CMatrix(M))); } else if(typee==2) { map::iterator name; name=map2.[Values[i]]; if(name !=map2.end()) { map::iterator it1; it1 =map2.find(Values[i]); double b=Values[j+1]=atof(values[j+1].c_str()); //if(b==1) //mymap[CHAR]= (it1->second).eleadd(); map2[CHAR]= (it1->second).elesub(b); map2[CHAR]= (it1->second).eleadd(b); s1.replace(s1.find(r),r.length(),string(1, CHAR)); break; /*else { map::iterator it1; it1 =mymap.find(Values[i+1]); double b =Values[j]=atof(values[j+1].c_str()); //mymap[CHAR]= (it1->second).eleadd(); mymap[CHAR]= (it1->second).elesub(b); }*/ } else if(typee==3) { Values[i]=atof(values[j].c_str()); Values[i+1]=atof(values[j].c_str()); values[i+1]= Values[i]-Values[i+1]; s1.replace(s1.find(r),r.length(),string(1, CHAR)); CMatrix M(values[i+1]); map2[CHAR] = M; break; }} }