RTK  2.6.0
Reconstruction Toolkit
rtkMatlabSparseMatrix.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkMatlabSparseMatrix_h
20 #define rtkMatlabSparseMatrix_h
21 
22 #include <vnl/vnl_sparse_matrix.h>
23 
24 namespace rtk
25 {
35 {
36 public:
37  template <class TOutputImage>
38  MatlabSparseMatrix(const vnl_sparse_matrix<double> & sparseMatrix, TOutputImage * output);
39  void
40  Save(std::ostream & out);
41  void
42  Print();
43 
45  {
46  unsigned char s_headerMatlab[116];
47  unsigned char s_headerOffset[8];
48  unsigned short int s_headerVersion;
49  unsigned char s_headerEndian[2];
50  unsigned long int s_mainTag;
51  unsigned long int s_dataLength;
52  unsigned long int s_arrayTag;
53  unsigned long int s_arrayLength;
54  unsigned short int s_arrayUndefined;
55  unsigned char s_arrayFlags;
56  unsigned char s_arrayClass;
57  unsigned long int s_arrayNzmax;
58  unsigned long int s_dimensionTag;
59  unsigned long int s_dimensionLength;
60  unsigned long int s_dimensionNbRow;
61  unsigned long int s_dimensionNbColumn;
62  unsigned short int s_nameLength;
63  unsigned short int s_nameTag;
64  unsigned char s_nameChar;
65  unsigned char s_namePadding[3];
66  unsigned long int s_rowIndexTag;
67  unsigned long int s_rowIndexLength;
68  unsigned long int * s_rowIndex;
69  unsigned long int s_rowIndexPadding;
70  unsigned long int s_columnIndexTag;
71  unsigned long int s_columnIndexLength;
72  unsigned long int * s_columnIndex;
73  unsigned long int s_columnIndexPadding;
74  unsigned long int s_valueTag;
75  unsigned long int s_valueLength;
76  double * s_value;
77  };
78 
79 protected:
81 };
82 } // namespace rtk
83 
84 #ifndef ITK_MANUAL_INSTANTIATION
85 # include "rtkMatlabSparseMatrix.hxx"
86 #endif
87 
88 #endif
void Save(std::ostream &out)
MatlabSparseMatrix(const vnl_sparse_matrix< double > &sparseMatrix, TOutputImage *output)
MatlabSparseMatrixStruct m_MatlabSparseMatrix