Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
9ee4c83
mtx writer init
denizumuteser Dec 3, 2022
ed2a2e1
mtx writer tests init
denizumuteser Dec 3, 2022
e829285
notes
denizumuteser Dec 6, 2022
7f9e7e1
fixed mtxwriter.cc, added todo
denizumuteser Dec 27, 2022
2c40ce2
added WriteCSR for mtx_writer
denizumuteser Mar 3, 2023
a9f7e8a
mtx_writer parameters and exception handling
denizumuteser Mar 7, 2023
1955501
fixed some issues with mtx_writer
denizumuteser Mar 7, 2023
d41f335
mtx_writer handling of different parameters
denizumuteser Mar 10, 2023
2caaa6e
added some mtx_writer tests
denizumuteser Mar 11, 2023
926aa92
mtx writer init
denizumuteser Dec 3, 2022
4f3a5ec
mtx writer tests init
denizumuteser Dec 3, 2022
0fb769b
notes
denizumuteser Dec 6, 2022
8143968
fixed mtxwriter.cc, added todo
denizumuteser Dec 27, 2022
e32222d
added WriteCSR for mtx_writer
denizumuteser Mar 3, 2023
433771e
mtx_writer parameters and exception handling
denizumuteser Mar 7, 2023
aab927f
fixed some issues with mtx_writer
denizumuteser Mar 7, 2023
9d8c10c
mtx_writer handling of different parameters
denizumuteser Mar 10, 2023
faa52f1
added some mtx_writer tests
denizumuteser Mar 11, 2023
eb5079d
Merge branch 'feature/mtx_writer' of https://github.com/sparcityeu/sp…
denizumuteser Mar 11, 2023
b6b27b9
fixed nnz for symmetric matrixes
denizumuteser Mar 11, 2023
b82beec
added tests for pattern and skew-symmetric
denizumuteser Mar 12, 2023
4799f47
Patohreader header and cc files created, some features added
alikorayy Mar 12, 2023
b4c071d
Fixed bug reading skew-symmetric MTX
AmroAlJundi Mar 12, 2023
e5f9ee2
Fixed bug reading arrays in MTX
AmroAlJundi Mar 12, 2023
3b47a9b
Fixed bug skew-symmetric coordinate MTX
AmroAlJundi Mar 12, 2023
82ab354
changed mtx_writers array writing order
denizumuteser Mar 13, 2023
c6b0a0b
fixed an issue with sorting order in mtx_writer
denizumuteser Mar 13, 2023
394c8b4
Transform hypergraph input file into pins and xpins arrays
alikorayy Mar 13, 2023
b2e488c
fixed bug reading file to arrays
alikorayy Mar 13, 2023
e0b28e8
added writeCOOToMTX and writeCSRToMTX to iobase
denizumuteser Mar 13, 2023
a45d24e
add feature for reading hypergraphs which has weights on nets
alikorayy Mar 18, 2023
d83c880
added WriteArray to MTX
denizumuteser Mar 19, 2023
661d3b1
Fixed CUDA option in readme build command
AmroAlJundi Mar 23, 2023
b5d709d
Checked matrix structures of MTX tests with Scipy
AmroAlJundi Mar 25, 2023
19d11a9
Implemented MetisGraphReader
EnverAtahan Mar 30, 2023
0892cbe
add some optimizations in reading
alikorayy Mar 30, 2023
3ecedb0
Implement PatohHyperGraph Reader
alikorayy Apr 3, 2023
13752b8
Merge pull request #248 from sparcityeu/feature/docs_gpu_fix
AmroAlJundi Apr 4, 2023
7a2d53e
handling mtx headers of PigoMtxReader
denizumuteser Apr 5, 2023
5d766ec
fixed log message
denizumuteser Apr 5, 2023
f42493c
Implemented MetisGraphWriter
EnverAtahan Apr 6, 2023
5a6550d
Merge branch 'develop' into feature/MetisGraphReader
EnverAtahan Apr 6, 2023
4df9229
fixed majority of requested review changes
denizumuteser Apr 7, 2023
4ebd714
Merge branch 'feature/mtx_writer' of https://github.com/sparcityeu/sp…
denizumuteser Apr 7, 2023
ac6980d
İmplemented HyperGraph PatohReader
alikorayy Apr 12, 2023
aa75962
mtx_writer resolved review comments
denizumuteser Apr 21, 2023
140648d
mtx_writer resolved further comments
denizumuteser Apr 25, 2023
3590540
add BaseType information to HyperGraph
alikorayy May 13, 2023
94eaaa1
add PatohWriter header
alikorayy May 13, 2023
60373a7
add PatohWriter implementation
alikorayy May 13, 2023
8e68f8f
fixed some bugs in PatohWriter
alikorayy May 13, 2023
5c393d7
Add 2 tests for PatohWriter
alikorayy May 16, 2023
11eaad1
finish implementation of PatohWriter
alikorayy May 16, 2023
85e305a
Implemented OffDiagBlockNNZ and Profile Features
EnverAtahan May 24, 2023
e3b2908
Implemented TriangleCountFeature
EnverAtahan May 25, 2023
7de317e
Bandwidth feature is implemented.
barisyakar May 31, 2023
34ac412
Tests
EnverAtahan Jun 1, 2023
a08ea9d
EnverAtahan Jun 1, 2023
c88500c
EnverAtahan Jun 1, 2023
4620be7
EnverAtahan Jun 1, 2023
afb3c7b
added detailed comments to mtx_writer.cc
denizumuteser Jun 5, 2023
292468a
Tests are added
barisyakar Jun 9, 2023
4808a84
Merge pull request #247 from sparcityeu/feature/mtx_writer
SinanEkm Jul 1, 2023
e6b5528
Merge remote-tracking branch 'origin/develop' into feature/MetisGraph…
Jul 2, 2023
2acce63
Merge pull request #249 from sparcityeu/feature/MetisGraphReader
SinanEkm Jul 3, 2023
d263fad
Merge pull request #252 from sparcityeu/feature/OffDiagBlockNNZ-Profi…
SinanEkm Jul 5, 2023
41f0cd0
Merge remote-tracking branch 'origin/develop' into feature/bandwidth
Jul 7, 2023
39e7b20
Merge branch 'develop' into feature/bandwidth
SinanEkm Jul 7, 2023
12cae1e
Merge pull request #255 from sparcityeu/feature/bandwidth
SinanEkm Jul 7, 2023
ea9040d
Merge remote-tracking branch 'origin/develop' into feature/patoh_reader
Jul 17, 2023
f58e334
Merge pull request #251 from sparcityeu/feature/patoh_reader
SinanEkm Jul 17, 2023
67bb1b3
Merge remote-tracking branch 'origin/develop' into feature/TriangleCount
Jul 17, 2023
bf6ca73
Merge pull request #253 from sparcityeu/feature/TriangleCount
SinanEkm Jul 17, 2023
2feb670
Merge pull request #250 from sparcityeu/feature/PigoMtxReaderOptions
SinanEkm Jul 18, 2023
81e1895
Fix to RCM reordering
santialf Aug 12, 2023
50116c4
changes made to grey code
santialf Aug 29, 2023
64c5329
update of the gray_reorder.h file
santialf Aug 29, 2023
e422869
referencing abs function
santialf Aug 29, 2023
8f60793
change abs function that was giving error in mac
santialf Aug 29, 2023
594e010
changes made to grey code, now it supports non square matrices
santialf Oct 24, 2023
4d650c6
implementation of slashburn ordering algorithm
santialf Oct 27, 2023
26f0c97
removed 1 lost printf in the code
santialf Oct 27, 2023
9c27ddb
implementation of BOBA ordering algorithm
santialf Oct 27, 2023
77da83c
correction made to the count of nodes in a connected component
santialf Oct 28, 2023
b31beb6
change of the diagonal value 'b', now is correct according to the paper
santialf Nov 2, 2023
ada595c
avg degree for column
Nov 6, 2023
7dac69f
fixed a issue
Nov 6, 2023
1f8b810
max degree column for sparse matrix features
Nov 7, 2023
45b5fc3
fixed a typo
Nov 7, 2023
e9887dc
initial commit
Nov 7, 2023
d7cd34c
fixed a typo
Nov 7, 2023
29857c7
fixed a typo
Nov 7, 2023
d02c923
min degree column feature tests
Nov 7, 2023
9ce3e75
fix made to degree ordering
santialf Nov 9, 2023
6239c64
fixing test error 1
santialf Nov 9, 2023
0d46092
fixing test error 2
santialf Nov 9, 2023
433c84a
fixing test error 3
santialf Nov 10, 2023
15f316b
fixing test error 4
santialf Nov 10, 2023
a388f34
fixing test error 5
santialf Nov 10, 2023
d39d2a6
fixing test error 6
santialf Nov 10, 2023
1242e91
fixing test error 7
santialf Nov 10, 2023
6f2635c
fixing test error 8
santialf Nov 10, 2023
27b90a8
fixing test error 9
santialf Nov 14, 2023
a023e9a
improvement to algorithm's efficiency
santialf Nov 14, 2023
d38caee
median degree for column
Nov 14, 2023
e4401f8
standard deviation degree column
Nov 14, 2023
56d969a
coefficient of variation degree column
Nov 14, 2023
41a863c
geometric avg degree column
Nov 14, 2023
a9529d3
added implementation of parallel BOBA
santialf Dec 4, 2023
16e4b2b
Merge pull request #261 from sparcityeu/feature/slashburn_reorder
santialf Dec 4, 2023
2659891
update to json file
santialf Dec 4, 2023
6dc6518
Merge pull request #270 from sparcityeu/feature/geometric_avg_degree_…
kamerkaya Dec 5, 2023
7cbe871
changes to json file
santialf Dec 5, 2023
2d8b8b5
changes to json file 2
santialf Dec 5, 2023
5251335
Merge branch 'develop' into feature/boba_reorder
santialf Dec 5, 2023
018db18
Merge pull request #262 from sparcityeu/feature/boba_reorder
kamerkaya Dec 8, 2023
4f3f4ce
Merge pull request #259 from sparcityeu/fix/greycode
kamerkaya Dec 8, 2023
e48a6e6
fixed a typo
Dec 8, 2023
945ce7a
Merge branch 'develop' into feature/median_degree_column
SinanEkm Dec 8, 2023
5db00e8
Update CMakeLists.txt
SinanEkm Dec 8, 2023
9fec761
Update median_degree_column_tests.cc
SinanEkm Dec 8, 2023
93265dd
Merge branch 'develop' into feature/standard_deviation_degree_column
SinanEkm Dec 8, 2023
8e3f5e3
Rename standard_deviation_degree_column.cc to standard_deviation_degr…
SinanEkm Dec 8, 2023
27e35b8
Update standard_deviation_degree_column_tests.cc
SinanEkm Dec 8, 2023
d07db93
Update standard_deviation_degree_column_tests.cc
SinanEkm Dec 8, 2023
3517b25
change
Dec 8, 2023
074876b
Update functionality_common.inc
SinanEkm Dec 8, 2023
e2af9b9
Merge branch 'develop' into feature/coefficient_of_variation_degree_c…
SinanEkm Dec 8, 2023
fa9daa4
Update standard_deviation_degree_column.h
SinanEkm Dec 8, 2023
1477941
changed the tests
Dec 8, 2023
bfdcd72
Merge pull request #269 from sparcityeu/feature/coefficient_of_variat…
kamerkaya Dec 12, 2023
f4cfb4c
Merge branch 'develop' into feature/median_degree_column
kamerkaya Dec 12, 2023
d93bfc8
Merge branch 'develop' into feature/standard_deviation_degree_column
kamerkaya Dec 12, 2023
aa37f70
Merge branch 'develop' into feature/min_degree_column
kamerkaya Dec 12, 2023
fcc1078
Merge branch 'develop' into feature/max_degree_column
kamerkaya Dec 12, 2023
d5187c2
Merge pull request #268 from sparcityeu/feature/standard_deviation_de…
kamerkaya Dec 12, 2023
bc96d9a
Merge branch 'develop' into feature/median_degree_column
kamerkaya Dec 12, 2023
3aff229
Merge branch 'develop' into feature/min_degree_column
kamerkaya Dec 12, 2023
2a8477b
Merge branch 'develop' into feature/avgDegreeColumn
kamerkaya Dec 12, 2023
3eafb24
Merge pull request #265 from sparcityeu/feature/min_degree_column
kamerkaya Dec 20, 2023
72d27de
Merge branch 'develop' into feature/avgDegreeColumn
kamerkaya Dec 20, 2023
ba548f7
Merge branch 'develop' into feature/max_degree_column
kamerkaya Dec 20, 2023
511d569
Merge pull request #263 from sparcityeu/feature/avgDegreeColumn
kamerkaya Dec 20, 2023
e1be981
Merge branch 'develop' into feature/median_degree_column
kamerkaya Dec 20, 2023
413ac3f
Merge pull request #266 from sparcityeu/fix/degree_reorder
kamerkaya Dec 20, 2023
d1ee838
Merge branch 'develop' into feature/max_degree_column
kamerkaya Dec 20, 2023
b63a0e3
Merge pull request #267 from sparcityeu/feature/median_degree_column
kamerkaya Dec 20, 2023
e93fcde
Merge branch 'develop' into feature/max_degree_column
kamerkaya Dec 20, 2023
79c2285
Update testing.yml
SinanEkm Feb 17, 2024
e043274
Merge pull request #264 from sparcityeu/feature/max_degree_column
SinanEkm Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,6 @@ env:

jobs:

test_win:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: MSYS2 Setup
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-python mingw-w64-x86_64-ninja mingw-w64-x86_64-lld

- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_FLAGS="-fuse-ld=lld" -DRUN_TESTS=ON

- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config ${{env.BUILD_TYPE}} -j 2

- name: Run Examples
working-directory: ${{github.workspace}}/build/examples
run: python3 run_all_examples.py

- name: Run Tests
working-directory: ${{github.workspace}}/build
run: ctest -V

test_mac:
runs-on: macos-latest

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/getting_started/installation_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ We suggest using the most recent versions when possible.

```bash
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=CUDA ..
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=OFF ..
make
```
Where `CUDA` is `ON` if CUDA support is needed and `OFF` otherwise.
This will build the library without CUDA support. If CUDA support is needed, then replace `-DUSE_CUDA=OFF` with `-DUSE_CUDA=ON`.

```{warning}
If the library is installed with cuda support, the user code must be compiled using `nvcc`.
Expand Down
133 changes: 133 additions & 0 deletions src/class_instantiation_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
"folder": null,
"exceptions": null
},
{
"template": "class HyperGraph<$id_type, $nnz_type, $value_type>",
"filename": "object.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class ConverterOrderOne<$value_type>",
"filename": "converter_order_one.inc",
Expand Down Expand Up @@ -224,6 +231,27 @@
"folder": null,
"exceptions": null
},
{
"template": "class MetisGraphReader<$id_type, $nnz_type, $value_type>",
"filename": "metis_graph_reader.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MetisGraphWriter<$id_type, $nnz_type, $value_type>",
"filename": "metis_graph_writer.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MTXWriter<$id_type, $nnz_type, $value_type>",
"filename": "mtx_writer.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class PigoEdgeListReader<$id_type, $nnz_type, $value_type>",
"filename": "pigo_edge_list_reader.inc",
Expand All @@ -238,6 +266,20 @@
"folder": null,
"exceptions": null
},
{
"template": "class PatohReader<$id_type, $nnz_type, $value_type>",
"filename": "patoh_reader.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class PatohWriter<$id_type, $nnz_type, $value_type>",
"filename": "patoh_writer.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class BinaryReaderOrderTwo<$id_type, $nnz_type, $value_type>",
"filename": "binary_reader_order_two.inc",
Expand Down Expand Up @@ -343,6 +385,13 @@
"folder": null,
"exceptions": null
},
{
"template": "class Bandwidth<$id_type, $nnz_type, $value_type>",
"filename": "bandwidth.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class RCMReorder<$id_type, $nnz_type, $value_type>",
"filename": "rcm_reorder.inc",
Expand All @@ -364,6 +413,20 @@
"folder": null,
"exceptions": null
},
{
"template": "class SlashburnReorder<$id_type, $nnz_type, $value_type>",
"filename": "slashburn_reorder.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class BOBAReorder<$id_type, $nnz_type, $value_type>",
"filename": "boba_reorder.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class GenericReorder<$id_type, $nnz_type, $value_type>",
"filename": "generic_reorder.inc",
Expand Down Expand Up @@ -469,27 +532,97 @@
"folder": null,
"exceptions": null
},
{
"template": "class MinDegreeColumn<$id_type, $nnz_type, $value_type>",
"filename": "min_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MaxDegree<$id_type, $nnz_type, $value_type>",
"filename": "max_degree.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MaxDegreeColumn<$id_type, $nnz_type, $value_type>",
"filename": "max_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class AvgDegree<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "avg_degree.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class AvgDegreeColumn<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "avg_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class StandardDeviationDegreeColumn<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "standard_deviation_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class CoefficientOfVariationDegreeColumn<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "coefficient_of_variation_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class GeometricAvgDegreeColumn<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "geometric_avg_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MinMaxAvgDegree<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "min_max_avg_degree.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class MedianDegreeColumn<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "median_degree_column.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class OffDiagBlockNNZ<$id_type, $nnz_type, $value_type>",
"filename": "off_diag_block_nnz.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class Profile<$id_type, $nnz_type, $value_type>",
"filename": "profile.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class TriangleCount<$id_type, $nnz_type, $value_type>",
"filename": "triangle_count.inc",
"ifdef": null,
"folder": null,
"exceptions": null
},
{
"template": "class JaccardWeights<$id_type, $nnz_type, $value_type, $float_type>",
"filename": "jaccard_weights.inc",
Expand Down
97 changes: 97 additions & 0 deletions src/sparsebase/bases/iobase.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "sparsebase/io/binary_writer_order_two.h"
#include "sparsebase/io/edge_list_reader.h"
#include "sparsebase/io/mtx_reader.h"
#include "sparsebase/io/mtx_writer.h"
#include "sparsebase/io/pigo_edge_list_reader.h"
#include "sparsebase/io/pigo_mtx_reader.h"
#include "sparsebase/io/reader.h"
Expand Down Expand Up @@ -290,6 +291,102 @@ class IOBase {
io::BinaryWriterOrderOne<ValueType> writer(filename);
return writer.WriteArray(array);
}
//! Write a CSR object to a matrix market file
/*!
* Write a CSR object to a matrix market file.
* @tparam IDType type to represent the number of rows and columns in the
* object.
* @tparam NNZType type to represent the number of non-zeros in the object.
* @tparam ValueType type to represent the data inside the matrix (vertex
* weights in the case of a graph).
* @param csr a pointer at the `CSR<IDType, NNZType, ValueType>` object to write.
* @param filename path to write the file.
* @param object is either matrix or vector.
* @param format is either coordinate or array.
* @param field is either real, double, complex, integer or pattern.
* @param symmetry is either general (legal for real, complex,
integer or pattern fields), symmetric (real, complex, integer or pattern),
skew-symmetric (real, complex or integer), or hermitian (complex only).
*/
template <typename IDType, typename NNZType, typename ValueType>
static void WriteCSRToMTX(
format::CSR<IDType, NNZType, ValueType>* csr,
std::string filename,
std::string object = "matrix",
std::string format = "coordinate",
std::string field = "real",
std::string symmetry = "general") {
io::MTXWriter<IDType, NNZType, ValueType> writer(filename,
object,
format,
field,
symmetry);
return writer.WriteCSR(csr);
}
//! Write a COO object to a matrix market file
/*!
* Write a COO object to a matrix market file.
* @tparam IDType type to represent the number of rows and columns in the
* object.
* @tparam NNZType type to represent the number of non-zeros in the object.
* @tparam ValueType type to represent the data inside the matrix (vertex
* weights in the case of a graph).
* @param coo a pointer at the `COO<IDType, NNZType, ValueType>` object to write.
* @param filename path to write the file.
* @param object is either matrix or vector.
* @param format is either coordinate or array.
* @param field is either real, double, complex, integer or pattern.
* @param symmetry is either general (legal for real, complex,
integer or pattern fields), symmetric (real, complex, integer or pattern),
skew-symmetric (real, complex or integer), or hermitian (complex only).
*/
template <typename IDType, typename NNZType, typename ValueType>
static void WriteCOOToMTX(
format::CSR<IDType, NNZType, ValueType>* coo,
std::string filename,
std::string object = "matrix",
std::string format = "coordinate",
std::string field = "real",
std::string symmetry = "general") {
io::MTXWriter<IDType, NNZType, ValueType> writer(filename,
object,
format,
field,
symmetry);
return writer.WriteCOO(coo);
}
//! Write an Array object to a matrix market file
/*!
* Write an Array object to a matrix market file.
* @tparam IDType type to represent the number of rows and columns in the
* object.
* @tparam NNZType type to represent the number of non-zeros in the object.
* @tparam ValueType type to represent the data inside the array (vertex
* weights in the case of a graph).
* @param arr a pointer at the `Array<ValueType>` object to write.
* @param filename path to write the file.
* @param object is either matrix or vector.
* @param format is either coordinate or array.
* @param field is either real, double, complex, integer or pattern.
* @param symmetry is either general (legal for real, complex,
integer or pattern fields), symmetric (real, complex, integer or pattern),
skew-symmetric (real, complex or integer), or hermitian (complex only).
*/
template <typename IDType, typename NNZType, typename ValueType>
static void WriteArrayToMTX(
format::Array<ValueType>* arr,
std::string filename,
std::string object = "matrix",
std::string format = "coordinate",
std::string field = "real",
std::string symmetry = "general") {
io::MTXWriter<IDType, NNZType, ValueType> writer(filename,
object,
format,
field,
symmetry);
return writer.WriteArray(arr);
}
};
} // namespace sparsebase::bases
#endif // SPARSEBASE_PROJECT_IOBASE_H
Loading
Loading