
#include "../bdm/base/bdmbase.h"
#include "../bdm/math/square_mat.h"
#include "../bdm/math/chmat.h"

using namespace bdm;

//These lines are needed for use of cout and endl
using std::cout;
using std::endl;

int main()
{
	RV a = RV ( "{a }","3");
	RV b = RV ( "{b }","2");
	RV c = RV ( "{c }");
	RV ef = RV ("{e f }");
	
	cout << "Add a and b"<<endl;
	RV ab = a;
	ab.add(b);
	cout << ab <<endl;
	
	cout << "Concat a,b and c "<<endl;
	RV abc = concat(ab,c);
	cout << abc <<endl;
	cout << "Structure of a,b,c "<<endl;
	str s =abc.tostr();
	cout << s.ids <<endl;
	cout << s.times <<endl;
		
	cout << "Find a in abc "<<endl;
	cout << a.findself(abc)<<endl;
	cout << "Find abc in a "<<endl;
	cout << abc.findself(a)<<endl;
	
	cout << "Subtract b from abc"<<endl;
	RV ac = abc.subt(b);
	cout << ac <<endl;
	
	cout << "Data index of ac in abc"<<endl;
	cout << ac.dataind(abc) <<endl;
	
	cout<< "copy indeces between ba and ab" << endl;
	RV ba = b;
	ba.add(a);
	
	ivec ai;
	ivec bi;
	ba.dataind(ac,ai,bi);
	cout << "ba(" << ai <<")=ac(" << bi <<")"<<endl;
	
	//Exit program:
	
	//getchar();
	return 0;

}
