NLToolbox
src/include/MatlabExporter.h
00001 /*
00002  * MatlabExporter.h
00003  *
00004  *  Created on: Nov 15, 2012
00005  *      Author: romain
00006  */
00007 
00008 #ifndef MATLABEXPORTER_H_
00009 #define MATLABEXPORTER_H_
00010 
00011 #include "PolynomialSystem.h"
00012 #include "Hpolyhedron.h"
00013 #include "iostream"
00014 #include "string"
00015 #include "fstream"
00016 #include "iomanip"
00017 #include "stdio.h"
00018 
00019 namespace nltool {
00020 
00021 class MatlabExporter {
00022 public:
00023         MatlabExporter(int dim, const string fname = "noname.m", stdVector bl =
00024                         stdVector(2, -2), stdVector bu = stdVector(2, 2));
00025         MatlabExporter(int dim, const string fname, stdVector bl, stdVector bu,
00026                         vector<int> projection);
00027         virtual ~MatlabExporter();
00028 
00029         void save(Hpolyhedron set, stdVector color = stdVector(3, 0.6));
00030         void save(std::vector<Hpolyhedron> sets,
00031                         stdVector color = stdVector(3, 0.6));
00032         void save(Simplex set);
00033         void saveVectorField(DynamicalSystem& sys);
00034         void drawTrajectory(DynamicalSystem& sys, Vector& init, Number maxT,
00035                         Number dt = 0.01);
00036 
00037         void findBounds(std::vector<Hpolyhedron>& sets);
00038 
00039         void setApproximationTemplate(const Template& approximationTemplate) {
00040                 this->approximationTemplate = approximationTemplate;
00041         }
00042 
00043 private:
00044         Template approximationTemplate;
00045         string filename;
00046         vector<int> projectedAxis;
00047         stdVector lBound;
00048         stdVector uBound;
00049         int displayEvery;
00050         int dimension;
00051 };
00052 
00053 }  // namespace nltool
00054 
00055 #endif /* MATLABEXPORTER_H_ */
 All Classes Namespaces Functions