#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#include <fstream>
#include <cstdlib>
#include <complex>
#include <array>
#include <vector>
#include <iomanip>
#include <iostream>
#if HAVE_FILESYSTEM
#include <filesystem>
#endif
#include <string>
template <typename T>
size_t vecdump(std::ofstream &
ofs,
const std::vector<T> &
v) {
const size_t wb {
v.size()*
sizeof(
T)};
ofs.write(
reinterpret_cast<const char*
>(
v.data()),
wb);
}
template <typename IT, typename NT>
size_t coodump(std::ofstream &
ofs, std::vector<IT> &
ia,
const std::vector<IT> &
ja,
const std::vector<NT> &
va) {
}
template <typename IT, typename NT>
size_t mtxdump(std::ofstream &
ofs,
const std::string &
hdr, std::vector<IT> &
ia,
const std::vector<IT> &
ja,
const std::vector<NT> &
va) {
}
template <typename IT, typename NT>
const std::string
rsb_bin_tag {
"BINARY LIBRSB MATRIX MARKET EXTENSION COO FORMAT" };
const std::string
typstr{ std::is_scalar<NT>() ?
"real" :
"complex" };
oss <<
"%%MatrixMarket matrix coordinate " <<
typstr <<
" " <<
symstr <<
"\n";
oss <<
m <<
" " <<
k <<
" " << nnz <<
"\n";
}
template <typename nt_t>
std::vector<nt_t>
VA(
mtx.nnz());
std::vector<rsb_coo_idx_t>
IA(
mtx.nnz());
std::vector<rsb_coo_idx_t>
JA(
mtx.nnz());
}
#ifdef RSB_NUMERICAL_TYPE_PREPROCESSOR_SYMBOLS
#else
#endif
std::cout <<
"usage: " <<
argv0 <<
" matrix-input-file [matrix-output-file [type]]" << std::endl;
#if defined(RSB_BLAS_NUMERICAL_TYPE_PREPROCESSOR_SYMBOLS)
#endif
}
{
#if defined(HAVE_FILESYSTEM) && (__cplusplus >= 201703)
#else
#endif
{
default:
}
else
{
}
}
auto main() -> int
Definition assemble.cpp:38
void bench(const std::string filename, rsb_flags_t order)
Definition autotune.cpp:42
Class initializing/finalizing librsb state.
Definition rsb.hpp:272
Represent a sparse matrix in RSB format by means of librsb.
Definition rsb.hpp:532
size_t coodump(std::ofstream &ofs, std::vector< IT > &ia, const std::vector< IT > &ja, const std::vector< NT > &va)
Definition mtx2bin.cpp:57
size_t vecdump(std::ofstream &ofs, const std::vector< T > &v)
Definition mtx2bin.cpp:50
size_t mtxdump(std::ofstream &ofs, const std::string &hdr, std::vector< IT > &ia, const std::vector< IT > &ja, const std::vector< NT > &va)
Definition mtx2bin.cpp:66
const char dtypechar
Definition mtx2bin.cpp:107
void mtx2bin(const std::string ifilename, const std::string ofilename)
Definition mtx2bin.cpp:89
int err_msg(const std::string argv0)
Definition mtx2bin.cpp:110
#define RSB_FLAG_SYMMETRIC
Definition rsb.h:554
rsb_flags_t rsb_trans_t
Definition rsb.h:400
signed int rsb_flags_t
Definition rsb.h:373
#define RSB_FLAG_FORTRAN_INDICES_INTERFACE
Definition rsb.h:484
#define RSB_FLAG_HERMITIAN
Definition rsb.h:557
Classes RsbLib and RsbMatrix provide native C++ access to librsb.
#define RSB_TRANSPOSITION_N
N: Non transposed flag, valid for rsb_trans_t typed variables.
Definition rsb_types.h:138