#include <mlab_getproblem.ci>
#include <mlab_mypcg.ci>
#include <client.h>

int main (int argc, char **argv)
{
	const char *loc0 = "mlab_getproblem.exe", *loc1 = "mlab_mypcg.exe";
	ctl::link lnk0(loc0), lnk1(loc1);
	try
	{
		myMatrix A;
		myVector b;

		Matlabprob::use(lnk0);
		A = Matlabprob::getproblem<myMatrix, int, myVector>(21, b);
		
		Matlab::use(lnk1);
		myVector x = Matlab::mypcg<myVector, myMatrix, myVector>(A, b);
		std::cout << "Result obtained by pcg():\n" << x << "\n";
	}
	catch (ctl::exception &e)
	{
		std::cerr << e << "\n";
	}
	return 0;
}
