SparseLibrary  Version 1.6.0
FileToVT.hpp
1 /*
2  * Copyright (c) 2007-2014, A. N. Yzelman, Utrecht University 2007-2011;
3  * KU Leuven 2011-2014.
4  * R. H. Bisseling, Utrecht University 2007-2014.
5  *
6  * This file is part of the Sparse Library.
7  *
8  * This library was developed under supervision of Prof. dr. Rob H. Bisseling at
9  * Utrecht University, from 2007 until 2011. From 2011-2014, development continued
10  * at KU Leuven, where Prof. dr. Dirk Roose contributed significantly to the ideas
11  * behind the newer parts of the library code.
12  *
13  * The Sparse Library is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by the
15  * Free Software Foundation, either version 3 of the License, or (at your
16  * option) any later version.
17  *
18  * The Sparse Library is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with the Sparse Library. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 
28 /*
29  * File created by:
30  * A. N. Yzelman, Dept. of Mathematics, Utrecht University, 2008.
31  */
32 
33 
34 #ifndef _H_FTVT
35 #define _H_FTVT
36 
37 #include <cstdlib>
38 #include <iostream>
39 #include <vector>
40 
41 #include "mmio.h"
42 #include "Triplet.hpp"
43 
44 // Flag indicating if we support cache-simulated triplets, as defined in the CACHE_SIM library.
45 #ifdef _SUPPORT_CS
46  #include "CS_Triplet.hpp"
47 #endif
48 
50 class FileToVT {
51 
52  public:
53 
55  static std::vector< Triplet< double > > parse( std::string filename );
57  static std::vector< Triplet< double > > parse( std::string filename, ULI &m, ULI &n );
59  static std::vector< Triplet< double > > parse( std::string filename, ULI &m, ULI &n, unsigned long int &nnz );
60 
61 #ifdef _SUPPORT_CS
62 
63  static std::vector< CS_Triplet< double > > cs_parse( std::string filename );
65  static std::vector< CS_Triplet< double > > cs_parse( std::string filename, ULI &m, ULI &n );
67  static std::vector< CS_Triplet< double > > cs_parse( std::string filename, ULI &m, ULI &n, unsigned long int &nnz );
68 #endif
69 
70 };
71 
72 #endif //_H_FTVT
73 
static std::vector< Triplet< double > > parse(std::string filename)
Parses a matrix-market input file.
Definition: FileToVT.cpp:36
Class responsible for reading in matrix market files and converting them to vector< Triplet > format...
Definition: FileToVT.hpp:50