11/*
2- For more information, please see: http://software.sci.utah.edu
3-
4- The MIT License
5-
6- Copyright (c) 2009 Scientific Computing and Imaging Institute,
7- University of Utah.
8-
9-
10- Permission is hereby granted, free of charge, to any person obtaining a
11- copy of this software and associated documentation files (the "Software"),
12- to deal in the Software without restriction, including without limitation
13- the rights to use, copy, modify, merge, publish, distribute, sublicense,
14- and/or sell copies of the Software, and to permit persons to whom the
15- Software is furnished to do so, subject to the following conditions:
16-
17- The above copyright notice and this permission notice shall be included
18- in all copies or substantial portions of the Software.
19-
20- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26- DEALINGS IN THE SOFTWARE.
2+ For more information, please see: http://software.sci.utah.edu
3+
4+ The MIT License
5+
6+ Copyright (c) 2009 Scientific Computing and Imaging Institute,
7+ University of Utah.
8+
9+
10+ Permission is hereby granted, free of charge, to any person obtaining a
11+ copy of this software and associated documentation files (the "Software"),
12+ to deal in the Software without restriction, including without limitation
13+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+ and/or sell copies of the Software, and to permit persons to whom the
15+ Software is furnished to do so, subject to the following conditions:
16+
17+ The above copyright notice and this permission notice shall be included
18+ in all copies or substantial portions of the Software.
19+
20+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+ DEALINGS IN THE SOFTWARE.
2727*/
2828
2929
3333
3434
3535/*
36- * FILE: matlabfile.h
37- * AUTH: Jeroen G Stinstra
38- * DATE: 16 MAY 2005
39- */
40-
36+ * FILE: matlabfile.h
37+ * AUTH: Jeroen G Stinstra
38+ * DATE: 16 MAY 2005
39+ */
40+
4141
4242/*
43- * CLASS DESCRIPTION
44- * This class is an interface to a matfile and handles the importing and exporting
45- * matlabarray objects. The latter represent the full complexity of a matlab array.
46- *
47- * MEMORY MODEL
48- * The class maintains its own copies of the data. Each vector, string and other
49- * data unit is copied.
50- * Large quantities of data are shipped in and out as matlabarray objects. These
51- * objects are handles to complex structures in memory and maintain their own data integrity.
52- * When copying a matfiledata object only pointers are copied, however all information
53- * for freeing the object is stored inside and no memory losses should occur.
54- *
55- * ERROR HANDLING
56- * All errors are reported as exceptions described in the matfilebase class.
57- * Errors of external c library functions are caught and forwarded as exceptions.
58- *
59- * COPYING/ASSIGNMENT
60- * Do not copy the object, this will lead to errors (NEED TO FIX THIS)
61- *
62- * RESOURCE ALLOCATION
63- * Files are closed by calling close() or by destroying the object
64- *
65- */
66-
67-
68- #ifndef JGS_MATLABIO_MATLABFILE_H
69- #define JGS_MATLABIO_MATLABFILE_H 1
43+ * CLASS DESCRIPTION
44+ * This class is an interface to a matfile and handles the importing and exporting
45+ * matlabarray objects. The latter represent the full complexity of a matlab array.
46+ *
47+ * MEMORY MODEL
48+ * The class maintains its own copies of the data. Each vector, string and other
49+ * data unit is copied.
50+ * Large quantities of data are shipped in and out as matlabarray objects. These
51+ * objects are handles to complex structures in memory and maintain their own data integrity.
52+ * When copying a matfiledata object only pointers are copied, however all information
53+ * for freeing the object is stored inside and no memory losses should occur.
54+ *
55+ * ERROR HANDLING
56+ * All errors are reported as exceptions described in the matfilebase class.
57+ * Errors of external c library functions are caught and forwarded as exceptions.
58+ *
59+ * COPYING/ASSIGNMENT
60+ * Do not copy the object, this will lead to errors (NEED TO FIX THIS)
61+ *
62+ * RESOURCE ALLOCATION
63+ * Files are closed by calling close() or by destroying the object
64+ *
65+ */
66+
67+
68+ #ifndef CORE_MATLABIO_MATLABFILE_H
69+ #define CORE_MATLABIO_MATLABFILE_H 1
7070
7171
7272#include " matfilebase.h"
7777#include < vector>
7878#include < string>
7979#include < iostream>
80-
80+
8181#include " share.h"
8282
8383namespace MatlabIO {
8484
8585 class SCISHARE matlabfile : public matfile {
86-
86+
8787 private:
8888 // matrixaddress is a vector of offsets
8989 // where the different matrices are stored
9090 // matrixname is a vector of the same length
9191 // storing the name of these matrices
92-
92+
9393 // NOTE: These fields are only available for
9494 // read access
9595 std::vector<int > matrixaddress_;
9696 std::vector<std::string> matrixname_;
97-
97+
9898 private:
9999 void importmatlabarray (matlabarray& ma,int mode);
100100 void exportmatlabarray (matlabarray& ma);
101101 mitype converttype (mxtype type);
102102 mxtype convertclass (mlclass mclass,mitype type);
103-
103+
104104 public:
105105 // constructors
106106 matlabfile ();
107107 matlabfile (const std::string& filename, const std::string& accessmode);
108108 virtual ~matlabfile ();
109-
109+
110110 // open and close a file (not needed at this point)
111111 // access mode is "r" or "w", a combination is not supported yet
112112 void open (const std::string& filename, const std::string& accessmode);
@@ -125,7 +125,7 @@ namespace MatlabIO {
125125
126126 matlabarray getmatlabarrayinfo (int matrixindex);
127127 matlabarray getmatlabarrayinfo (const std::string& name);
128-
128+
129129 // function reading matrices
130130 matlabarray getmatlabarray (int matrixindex);
131131 matlabarray getmatlabarray (const std::string& name);
@@ -135,7 +135,7 @@ namespace MatlabIO {
135135 // A matrix name needs to be added. This the name of the object
136136 // as it appears in matlab
137137 void putmatlabarray (matlabarray& ma, const std::string& matrixname);
138-
138+
139139 };
140140
141141} // end namespace MatlabIO
0 commit comments