how to intialized class constructor with boost::matrix in header file and class c++

i'm stuck for two days at trying to figure out how to initialize and use boost::matrix in my class file. I had several error like unitialized reference or no matching for call. So can you tell wath's wrong in the way i used and declare my class?

here are my files:

i have a myclass.h

#include <boost/numeric/ublas> #include <string> myclass{ private: string word1 boost::numeric::ublas::matrix<string> tab_word1 public: myclass (const string wd="", const boost::numeric::ublas::matrix<string> t_wd1=boost::numeric::ublas::matrix<string>()); void set_myclass (const string wd, const boost::numeric::ublas::matrix<string> t_wd1); void do_things (string word1, boost::numeric::ublas<string>&tab_word1) }

And myclass.cpp

#include <boost/numeric/ublas> #include <string> myclass::myclass (string wd1, boost::numeric::ublas<string>t_wd1) : word1(wd1), tab_word1(t_wd1) {} myclass::set_myclass(string wd1, boost::numeric::ublas<string>t_wd1) { word1=wd1; tab_word1=t_wd1 } myclass::do_things (string word1, boost::numeric::ublas<string>&tab_word1){ tab_word1.resize(1,2); tab_word1(1,1)=0; tab_word1(1,2)=word1; }

And in the main i use in this way

int main() { string a="hello"; boost::numeric::ublass<string>tab1, tab1_returned; myclass mc1(a, tab1); mc1.set_myclass tab1_returned=mc1.do_things; }

in that situation i get this error:

default argument missing for parameter 2 of 'myclass::myclass(std::string, boost::numeric::ublas::matrix<std::basic_string<char>)'

i really tried different solution like declaring t_wd1 in myclass.cpp and use extern in my .h file but nothing solved my problem.

I'm sorry if i did simple error but i'm not really used to do that and that's my first programme that i split in header files.

thank you in advance for the time you take to read my question

Category:class Views:0 Time:2016-02-12

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.080 (s). 11 q(s)