exporter and squarematrix class for c++ version