#include <iostream> #include <fstream> #include <vector> #include <list> #include <algorithm> #include <string.h> #include <sstream> #include <math.h> #include <stdio.h> //#include <bitset> #include <boost/dynamic_bitset.hpp> #include "boost/multi_array.hpp" using namespace std; #include "stringtoken_class.h" //------------------------------------------------------------ class orand { public: int numxor; int numand; int numlit; }; orand ornd; orand ifcontains(string func); //---------------------------------------------------------- int main(int argc,char *argv[]) { orand ob; ob=ifcontains("f21=x0+x2x6x9x10x13+x2x9x10x12+x2x12+x6"); cout<<"Number of XOR= "<<ob.numxor<<endl; cout<<"Number of AND= "<<ob.numand<<endl; cout<<"Number of LIT= "<<ob.numlit<<endl; return 0; } orand ifcontains(string func) { //-------------------------------------------------------- //variables int degree,count_plus=0,count_x=0,nextint=0; int i,j; string st1,st2; vector<bool>bl; //-------------------------------------------------------- StringTokenizer stk1(func,"f"); degree=stk1.nextIntToken(); boost::dynamic_bitset<> product_value(degree); StringTokenizer stk2(func,"="); stk2.nextToken(); st1=stk2.nextToken(); StringTokenizer stk3(st1,"+"); count_plus=stk3.countTokens(); for(i=0;i<count_plus;i++) { StringTokenizer stk4(stk3.nextToken(),"x"); count_x=stk4.countTokens(); for(j=0;j<count_x;j++) { nextint=stk4.nextIntToken(); product_value[nextint]=1; } cout<<product_value<<endl; // bl.push_back(product_value); error at this point please tell me the solution, i dont want to covert this data to Integers i want them in Ints. product_value.reset(); } }
Member 4409383 wrote:the problem with my code is that i cannot make arrays of the dynamic_bitset
Member 4409383 wrote:vector<bool>bl;
bl
vector
dynamic_bitset
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)