https://github.com/daskol/libmatfile
Library to load and create mat-files.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.9%) to scientific vocabulary
Keywords
Repository
Library to load and create mat-files.
Basic Info
- Host: GitHub
- Owner: daskol
- License: gpl-3.0
- Language: C
- Default Branch: master
- Size: 524 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
libmatfile
load from and save to mat-files
Overview
libmatfile is C library which allow to load array and matrices from or store them into mat-file. This library was separated as isolated module during cutt project development. It is implemented specification of MAT-file format according to documentation.
At the moment all features are not implemented yet. The list of capabilities and their readiness is placed bellow.
- [x] Simple file loader.
- [ ] Streaming file loading.
- [ ] Simple file saver.
- [ ] Streaming file saving.
- [ ] Memory map support for large files.
- [ ] C++ wrapper and bindings to other languages if needed.
- [ ] MAT-file Level 4 support.
- [ ] Coverage and unit testing.
The list is not filled completely yet since library is under development and not all API routines are stable.
Usage
Suppose there is a mat-file which contains at least one matrix. The matrix is The matrix is Hilbert if the following holds.

Maybe the matrix is adjacency matrix of social graph or item-feature matrix of recommender system. In either case, we need to load the matrix and perform some calculations. There is an example of how to archive these things below.
```c
include
matfilet *mat = matfileread("arrays.mat"); const char **varnames = matfile_who(mat);
for (unsigned i = 0; varnames + i != NULL; ++i) { printf("[%03d] variable %s\n", varnames + i); }
free((void *)varnames);
matfilearrayt *array = matfilegetarray(mat, "hilbert"); matfile_destroy(mat); ```
Assembling
The build system used by libmatfile is CMake which is natural for C/C++ projects. In order to build release version one should run the following commands in shell.
bash
mkdir build
cd build
cmake ..
make
After compilation libmatfile.a or libmatfile.so depending on desired
linking mechanism appears in build directory. Moreover, there is doxygen
documentation in doc/html/index.html relative to build directory as well.
See details in CMakeLists.txt.
Documentation
On default documentation is built with library. One can control doc generation
on uild with DOXYGEN_HTML. The following code snippet shows how to disable
HTML documentation output.
bash
cmake .. -DDOXYGEN_HTML=OFF
The latest documentation is already generated and the online version is provided here.
Testing
Similar to documentation generation tests are built on default. There is
built-in option BUILD_TESTING which controls adding testing targets to
global target.
bash
cmake .. -DBUILD_TESTING=ON
ctest # or for more verbosity ./matfile-test
The previous commands force building tests and run ctest for brief output.
The testing is based on top of Google Test framework so executable
matfile-test produces more detailed output that could be usefull for
developers.
Credits
© Daniel Bershatsky <daniel.bershatsky@skolkovotech.ru>, 2018
Owner
- Name: Daniel Bershatsky
- Login: daskol
- Kind: user
- Location: Russia, Moscow
- Company: @skoltech-ai
- Website: https://daskol.xyz
- Repositories: 11
- Profile: https://github.com/daskol
GitHub Events
Total
Last Year
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Bershatsky | d****y@s****u | 9 |
| Daniel Bershatsky | d****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 2 days
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- tbeu (1)