ViennaCL - The Vienna Computing Library  1.7.1
Free open-source GPU-accelerated linear algebra and solver library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viennacl::io Namespace Reference

Provides basic input-output functionality. More...

Namespaces

 detail
 Implementation details for IO functionality. Usually not of interest for a library user.
 
 tag
 Namespace holding the various XML tag definitions for the kernel parameter tuning facility.
 
 val
 Namespace holding the various XML strings for the kernel parameter tuning facility.
 

Functions

template<typename MatrixT >
long read_matrix_market_file_impl (MatrixT &mat, const char *file, long index_base)
 Reads a sparse or dense matrix from a file (MatrixMarket format) More...
 
template<typename MatrixT >
long read_matrix_market_file (MatrixT &mat, const char *file, long index_base=1)
 Reads a sparse matrix from a file (MatrixMarket format) More...
 
template<typename MatrixT >
long read_matrix_market_file (MatrixT &mat, const std::string &file, long index_base=1)
 
template<typename ScalarT >
long read_matrix_market_file (std::vector< std::map< unsigned int, ScalarT > > &mat, const char *file, long index_base=1)
 
template<typename ScalarT >
long read_matrix_market_file (std::vector< std::map< unsigned int, ScalarT > > &mat, const std::string &file, long index_base=1)
 
template<typename MatrixT >
void write_matrix_market_file_impl (MatrixT const &mat, const char *file, long index_base)
 
template<typename ScalarT >
void write_matrix_market_file (std::vector< std::map< unsigned int, ScalarT > > const &mat, const char *file, long index_base=1)
 
template<typename ScalarT >
void write_matrix_market_file (std::vector< std::map< unsigned int, ScalarT > > const &mat, const std::string &file, long index_base=1)
 
template<typename MatrixT >
void write_matrix_market_file (MatrixT const &mat, const std::string &file, long index_base=1)
 Writes a sparse matrix to a file (MatrixMarket format) More...
 

Detailed Description

Provides basic input-output functionality.

Function Documentation

template<typename MatrixT >
long viennacl::io::read_matrix_market_file ( MatrixT &  mat,
const char *  file,
long  index_base = 1 
)

Reads a sparse matrix from a file (MatrixMarket format)

Parameters
matThe matrix that is to be read (ublas-types and std::vector< std::map <unsigned int, ScalarT> > are supported)
fileThe filename
index_baseThe index base, typically 1
Template Parameters
MatrixTA generic matrix type. Type requirements: size1() returns number of rows, size2() returns number columns, operator() writes array entries, resize() allows resizing the matrix.
Returns
Returns nonzero if file is read correctly
Examples:
amg.cpp, iterative-armadillo.cpp, iterative-custom.cpp, iterative-eigen.cpp, iterative-ublas.cpp, iterative.cpp, lanczos.cpp, multithreaded_cg.cpp, power-iter.cpp, and spai.cpp.

Definition at line 339 of file matrix_market.hpp.

template<typename MatrixT >
long viennacl::io::read_matrix_market_file ( MatrixT &  mat,
const std::string &  file,
long  index_base = 1 
)

Definition at line 347 of file matrix_market.hpp.

template<typename ScalarT >
long viennacl::io::read_matrix_market_file ( std::vector< std::map< unsigned int, ScalarT > > &  mat,
const char *  file,
long  index_base = 1 
)

Definition at line 355 of file matrix_market.hpp.

template<typename ScalarT >
long viennacl::io::read_matrix_market_file ( std::vector< std::map< unsigned int, ScalarT > > &  mat,
const std::string &  file,
long  index_base = 1 
)

Definition at line 364 of file matrix_market.hpp.

template<typename MatrixT >
long viennacl::io::read_matrix_market_file_impl ( MatrixT &  mat,
const char *  file,
long  index_base 
)

Reads a sparse or dense matrix from a file (MatrixMarket format)

Note: If the matrix in the MatrixMarket file is complex, only the real-valued part is loaded!

Parameters
matThe matrix that is to be read
fileFilename from which the matrix should be read
index_baseThe index base, typically 1
Template Parameters
MatrixTA generic matrix type. Type requirements: size1() returns number of rows, size2() returns number columns, operator() writes array entries, resize() allows resizing the matrix.
Returns
Returns nonzero if file is read correctly

Definition at line 102 of file matrix_market.hpp.

template<typename ScalarT >
void viennacl::io::write_matrix_market_file ( std::vector< std::map< unsigned int, ScalarT > > const &  mat,
const char *  file,
long  index_base = 1 
)

Definition at line 403 of file matrix_market.hpp.

template<typename ScalarT >
void viennacl::io::write_matrix_market_file ( std::vector< std::map< unsigned int, ScalarT > > const &  mat,
const std::string &  file,
long  index_base = 1 
)

Definition at line 412 of file matrix_market.hpp.

template<typename MatrixT >
void viennacl::io::write_matrix_market_file ( MatrixT const &  mat,
const std::string &  file,
long  index_base = 1 
)

Writes a sparse matrix to a file (MatrixMarket format)

Parameters
matThe matrix that is to be read (ublas-types and std::vector< std::map <unsigned int, ScalarT> > are supported)
fileThe filename
index_baseThe index base, typically 1
Template Parameters
MatrixTA generic matrix type. Type requirements: size1() returns number of rows, size2() returns number columns, operator() writes array entries, resize() allows resizing the matrix.
Returns
Returns nonzero if file is read correctly

Definition at line 429 of file matrix_market.hpp.

template<typename MatrixT >
void viennacl::io::write_matrix_market_file_impl ( MatrixT const &  mat,
const char *  file,
long  index_base 
)

Definition at line 375 of file matrix_market.hpp.