CUSP
Loading...
Searching...
No Matches
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
28namespace cusp
29{
30namespace io
31{
32
68template <typename Matrix>
69::cuda::std::tuple<typename Matrix::index_type, typename Matrix::index_type>
70read_dimacs_file(Matrix& mtx, const std::string& filename);
71
103template <typename Matrix, typename Stream>
104::cuda::std::tuple<typename Matrix::index_type, typename Matrix::index_type>
105read_dimacs_stream(Matrix& mtx, Stream& input);
106
107
145template <typename Matrix>
146void write_dimacs_file(const Matrix& mtx,
147 const ::cuda::std::tuple<typename Matrix::index_type,typename Matrix::index_type>& t,
148 const std::string& filename);
149
185template <typename Matrix, typename Stream>
186void write_dimacs_stream(const Matrix& mtx,
187 const ::cuda::std::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
void write_dimacs_file(const Matrix &mtx, const ::cuda::std::tuple< typename Matrix::index_type, typename Matrix::index_type > &t, const std::string &filename)
Write a Dimacs file.
::cuda::std::tuple< typename Matrix::index_type, typename Matrix::index_type > read_dimacs_file(Matrix &mtx, const std::string &filename)
Read a Dimacs file.
::cuda::std::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_stream(const Matrix &mtx, const ::cuda::std::tuple< typename Matrix::index_type, typename Matrix::index_type > &t, Stream &output)
Write Dimacs data to a stream.