Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
dimacs.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 NVIDIA Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
21 #pragma once
22 
23 #include <cusp/detail/config.h>
24 #include <thrust/tuple.h>
25 
26 #include <string>
27 
28 namespace cusp
29 {
30 namespace io
31 {
32 
68 template <typename Matrix>
69 thrust::tuple<typename Matrix::index_type, typename Matrix::index_type>
70 read_dimacs_file(Matrix& mtx, const std::string& filename);
71 
103 template <typename Matrix, typename Stream>
104 thrust::tuple<typename Matrix::index_type, typename Matrix::index_type>
105 read_dimacs_stream(Matrix& mtx, Stream& input);
106 
107 
145 template <typename Matrix>
146 void write_dimacs_file(const Matrix& mtx,
147  const thrust::tuple<typename Matrix::index_type,typename Matrix::index_type>& t,
148  const std::string& filename);
149 
185 template <typename Matrix, typename Stream>
186 void write_dimacs_stream(const Matrix& mtx,
187  const thrust::tuple<typename Matrix::index_type,typename Matrix::index_type>& t,
188  Stream& output);
189 
193 } //end namespace io
194 } //end namespace cusp
195 
196 #include <cusp/io/detail/dimacs.inl>
197 
thrust::tuple< typename Matrix::index_type, typename Matrix::index_type > read_dimacs_stream(Matrix &mtx, Stream &input)
Read Dimacs data from a stream.
void write_dimacs_file(const Matrix &mtx, const thrust::tuple< typename Matrix::index_type, typename Matrix::index_type > &t, const std::string &filename)
Write a Dimacs file.
void write_dimacs_stream(const Matrix &mtx, const thrust::tuple< typename Matrix::index_type, typename Matrix::index_type > &t, Stream &output)
Write Dimacs data to a stream.
thrust::tuple< typename Matrix::index_type, typename Matrix::index_type > read_dimacs_file(Matrix &mtx, const std::string &filename)
Read a Dimacs file.