Repository navigation
Expand file tree
/
Copy pathtest.cpp
More file actions
44 lines (39 loc) · 1.96 KB
/
Copy pathtest.cpp
File metadata and controls
44 lines (39 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "SuiteSparseDownloader.hpp"
#include <iostream>
int main()
{
SuiteSparseDownloader downloader;
SuiteSparseDownloader::MatrixFilter filter;
filter.isSquare = false;
filter.minRows = 10;
filter.maxRows = 500;
filter.minAverageNonzeroPerRow = 5;
filter.maxAverageNonzeroPerRow = 10;
filter.minAverageNonzeroPerCol = 6;
filter.maxAverageNonzeroPerCol = 12;
std::vector<SuiteSparseDownloader::MatrixInfo> matrices = downloader.getMatrices(filter);
std::cout << "Number of matrices matching with your filter: " << matrices.size() << std::endl;
downloader.downloadMatrices("matrices/", matrices);
for (const auto& matrix: matrices)
{
if (!matrix.isValid) continue;
std::cout
<< "id: " << matrix.id << '\n'
<< "groupName: " << matrix.groupName << '\n'
<< "name: " << matrix.name << '\n'
<< "rows: " << matrix.rows << '\n'
<< "cols: " << matrix.cols << '\n'
<< "nonzeros: " << matrix.nonzeros << '\n'
<< "isReal: " << (matrix.isReal ? "true" : "false") << '\n'
<< "isBinary: " << (matrix.isBinary ? "true" : "false") << '\n'
<< "is2d3d: " << (matrix.is2d3d ? "true" : "false") << '\n'
<< "isPosDef: " << (matrix.isPosDef ? "true" : "false") << '\n'
<< "patternSymmetry: " << (matrix.patternSymmetry ? "true" : "false") << '\n'
<< "numericSymmetry: " << (matrix.numericSymmetry ? "true" : "false") << '\n'
<< "kind: " << matrix.kind << '\n'
<< "downloadLink: " << matrix.downloadLink << '\n'
<< "installationPath: " << matrix.installationPath << '\n'
<< "----------------------------------------" << std::endl;
}
return 0;
}