-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #2
- Loading branch information
Showing
8 changed files
with
694 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Blaze (blaze-lib) Matrix Market | ||
|
||
`fast_matrix_market` provides read/write methods for [Blaze](https://bitbucket.org/blaze-lib/blaze) sparse and dense matrices and vectors. | ||
|
||
# Usage | ||
|
||
```c++ | ||
#include <fast_matrix_market/app/Blaze.hpp> | ||
``` | ||
|
||
```c++ | ||
blaze::CompressedMatrix<double> A; | ||
// or | ||
blaze::DynamicMatrix<double> A; | ||
// or | ||
blaze::CompressedVector<double> A; | ||
// or | ||
blaze::DynamicVector<double> A; | ||
``` | ||
### Reading | ||
```c++ | ||
std::ifstream f("input.mtx"); | ||
|
||
fast_matrix_market::read_matrix_market_blaze(f, A); | ||
``` | ||
**Note:** if `A` is a Vector type then the Matrix Market file must be either a vector or a | ||
1-by-N row or M-by-1 column matrix. Any other matrix will cause an exception to be thrown. | ||
### Writing | ||
```c++ | ||
std::ofstream f("output.mtx"); | ||
fast_matrix_market::write_matrix_market_blaze(f, A); | ||
``` | ||
|
||
|
||
**Compatibility Note:** Blaze Vector objects are written as vector Matrix Market files. | ||
Many MatrixMarket loaders cannot read vector files. If this is a problem write the vector | ||
as a 1-by-N or M-by-1 matrix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Fetch from git | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
blaze | ||
GIT_REPOSITORY https://bitbucket.org/blaze-lib/blaze.git | ||
GIT_TAG v3.8.1 | ||
GIT_SHALLOW TRUE) | ||
|
||
FetchContent_MakeAvailable(blaze) |
Oops, something went wrong.