#include <mlab_myhermite_triple_product.ci>
#include <client.h>

int main (int argc, char **argv)
{
	ctl::vector<ctl::location> loc = ctl::readLocation("locs.txt");
	if (loc.size() < 1)
	{
		std::cerr << "No valid location found.\n";
		return 1;
	}

	for(int P=0; P<loc.size(); P++)
	{
		try
		{
			ctl::link lnk(loc[P]);
			Matlab::use(lnk);
			double res;
			myVector arg1(3), arg2(3), arg3(3);
			double foo[3] = { 1, 0, 1 };
			for (int i=0;i<3;i++)
				arg1[i] = arg2[i] = arg3[i] = foo[i];

			res = Matlab::myhermite_triple_product<double,myVector,myVector,myVector>(arg1, 
				arg2, arg3);
			std::cout << "Voodoo result: " << res << "\n";
		}
		catch (ctl::exception &e)
		{
			std::cerr << e << "\n";
		}
	}

	return 0;
}
