Comments (2)
It would be nice to maintain interoperability with Eigen. Eigen uses std::complex
as a type for complex arrays (https://eigen.tuxfamily.org/dox/classEigen_1_1ComplexEigenSolver.html#a3604c99a69fac3bee42c88cb2b589143), while matio
has its own type: https://github.com/tbeu/matio/blob/master/src/matio.h#L164-L167.
Moreover, the data in the matvar_t
is not stored as an array of a pair of numbers, but rather the real and imaginary parts are two separate vectors. Hence, I think we cannot have matioCpp::Vector<std::complex<double>>
since we cannot cast the internal data to std::complex<double>*
as it would be required by data()
.
An alternative might be to specialize all the code relative to Element
, Vector
, VectorIterator
and MultiDimensionalArray
just for complex types, but this would require reimplementing (and testing) basically half of the codebase.
Still investigating possible alternatives.
from matio-cpp.
I just spotted this from https://en.cppreference.com/w/cpp/numeric/complex:
In order to satisfy the requirements of array-oriented access, an implementation is constrained to store the real and imaginary components of a std::complex specialization in separate and adjacent memory locations. Possible declarations for its non-static data members include:
- an array of type value_type[2], with the first element holding the real component and the second element holding the imaginary component (e.g. Microsoft Visual Studio)
Hence, I wonder if is possible to convert a mat_complex_split_t
to a std::complex<T*>
. In this case, the pointer
type of Vector
would be std::complex<T*>*
. Nevertheless, I would still need some ad-hoc element accessors for retrieving a specific element or reference, and an ad-hoc iterator, but the code of Vector
, Element
and MultiDimensionalArray
might remain the same.
from matio-cpp.
Related Issues (20)
- Test issue for auto assignement HOT 1
- Yet another test issue HOT 1
- Some tests failed after new matio release HOT 1
- String16 and String32 do not have the assignement operator from the corresponding strings HOT 1
- Add path/name of the file that matio-cpp failed to create HOT 1
- Reading in sparse matrix HOT 1
- Missing deduction guides for Span object HOT 10
- Generated matfile are not hdf5 compatible HOT 7
- Investigate the possibility of automatically converting a struct into a matioCpp struct using reflection HOT 1
- Add system tests for reading/writing in matlab HOT 1
- *.tpp files throw syntax error HOT 16
- Build errors with MSVC /permissive- flag HOT 2
- Problem with linking library HOT 13
- Memory problem HOT 3
- Test #11 failing HOT 2
- Thread Safety HOT 3
- Tests fail on Windows HOT 2
- Cannot read mat files saved from Python with `7.3` format HOT 15
- CI Failure April 2024 HOT 4
- Compilation failure with matio 1.5.27 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matio-cpp.