Skip to content

Commit e068ef3

Browse files
committed
Reformat
1 parent 3b08080 commit e068ef3

File tree

3 files changed

+86
-91
lines changed

3 files changed

+86
-91
lines changed

src/Core/Matlab/matfile.h

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828

2929
// NOTE: This MatlabIO file is used in different projects as well. Please, do not
30-
// make it depend on other scirun code. This way it is easier to maintain matlabIO
30+
// make it depend on other Scirun code. This way it is easier to maintain matlabIO
3131
// code among different projects. Thank you.
3232

3333
/*
@@ -36,20 +36,20 @@
3636
* DATE: 5 JAN 2004
3737
*/
3838

39-
#ifndef JGS_MATLABIO_MATFILE_H
40-
#define JGS_MATLABIO_MATFILE_H 1
39+
#ifndef CORE_MATLABIO_MATFILE_H
40+
#define CORE_MATLABIO_MATFILE_H 1
4141

4242
/*
4343
* The matfile class is the basic interface for reading and
44-
* writing .mat files (matlab files). This class currently
45-
* only supports the so called matlab version 5 file format
44+
* writing .mat files (Matlab files). This class currently
45+
* only supports the so called Matlab version 5 file format
4646
* which is used from version 5.0 to version 6.5, currently
47-
* the lastest version of matlab available. Matlab V4 files
48-
* should be converted using matlab into the newer file format.
47+
* the latest version of Matlab available. Matlab V4 files
48+
* should be converted using Matlab into the newer file format.
4949
*
5050
* This class handles the following aspects:
5151
* - opening and closing .mat files
52-
* - handling byteswapping
52+
* - handling byte swapping
5353
* - reading/writing the file header
5454
* - reading/writing the tags in the .mat file
5555
*
@@ -58,15 +58,15 @@
5858

5959
/*
6060
* CLASS DESCRIPTION
61-
* This class is an interface to a matfile and handles the raw fileformat
62-
* it deals with headers, byteswapping and reading and writing tags and the
61+
* This class is an interface to a matfile and handles the raw file format
62+
* it deals with headers, byte swapping and reading and writing tags and the
6363
* associated data
6464
*
6565
* MEMORY MODEL
6666
* The class maintains its own copies of the data. Each vector, string and other
6767
* data unit is copied.
6868
* Large quantities of data are shipped in and out in matfiledata objects. These
69-
* objects are handles to memoryblockss and maintain their own data integrity.
69+
* objects are handles to memory blocks and maintain their own data integrity.
7070
* When copying a matfiledata object only pointers are copied, however all information
7171
* for freeing the object is stored inside and no memory losses should occur.
7272
*
@@ -82,19 +82,13 @@
8282
*
8383
*/
8484

85-
#include <stdio.h>
85+
#include <Core/Matlab/matfiledata.h>
86+
#include <Core/Matlab/share.h>
8687

87-
#include <string>
88-
#include <stack>
89-
#include <iostream>
90-
91-
92-
#include "matfilebase.h"
93-
#include "matfiledata.h"
94-
95-
#include "share.h"
96-
97-
namespace MatlabIO {
88+
namespace SCIRun
89+
{
90+
namespace MatlabIO
91+
{
9892

9993
class SCISHARE matfile : public matfilebase {
10094

@@ -282,5 +276,6 @@ class SCISHARE matfile : public matfilebase {
282276
bool iswriteaccess();
283277
};
284278

285-
} // end namespace
279+
}}
280+
286281
#endif

src/Core/Matlab/matlabfile.h

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
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

@@ -33,40 +33,40 @@
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"
@@ -77,36 +77,36 @@
7777
#include <vector>
7878
#include <string>
7979
#include <iostream>
80-
80+
8181
#include "share.h"
8282

8383
namespace 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

src/Modules/Legacy/Matlab/DataIO/ImportDatatypesFromMatlab.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#include <Core/Datatypes/Legacy/Field/Field.h>
3434

3535
#include <Core/Matlab/matlabfile.h>
36-
#include <Core/Matlab/matlabarray.h>
37-
#include <Core/Matlab/matlabconverter.h>
36+
//#include <Core/Matlab/matlabarray.h>
37+
//#include <Core/Matlab/matlabconverter.h>
3838

3939
using namespace SCIRun::Modules::Matlab::DataIO;
4040
//using namespace SCIRun::Core::Algorithms;

0 commit comments

Comments
 (0)