-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detach Tensor3D from MATLAB #290
Conversation
035a439
to
d80c252
Compare
821f1ab
to
d4d0cfd
Compare
280e910
to
e224a3a
Compare
05ef9fc
to
30899d5
Compare
e224a3a
to
3699aaf
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## hdf5-cleaner-helper-methods #290 +/- ##
============================================================
Coverage ? 27%
============================================================
Files ? 75
Lines ? 3699
Branches ? 0
============================================================
Hits ? 992
Misses ? 2707
Partials ? 0 ☔ View full report in Codecov by Sentry. |
3699aaf
to
cf942fa
Compare
Can this be targetted at |
cf942fa
to
a058433
Compare
a058433
to
de956a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V. minor suggestions: a bit more docs and one thing you might want to rename.
- Remove the old method - Replace references with new syntax and calls to overloaded read()
… and IncidentField classes into it
Looks like some field components aren't even being initialised, or set, since the Fro norms all come back as 0 before seg-faulting on double free.
- Tensor3D wraps a vector<T> member rather than directly inheriting from the class - Fixes a typo in the field tests when converting old -> new syntax for accessing Tensor3Ds
Co-authored-by: Sam Cunliffe <samcunliffe@users.noreply.github.com>
bb6bc0d
to
c849ebe
Compare
Context/Description
Detaches
Tensor3D
class from MATLAB. This class is now robust enough to read from either standardC++
buffers or fromMATLAB
data of the appropriate shape. We also no longer need to usemalloc
for memory management.The dependant classes still depend on MATLAB for reading/writing from the input file, which can be addressed in another pull request.
Tensor3D
task and addresses dependant classes.DispersiveMultiLayer
no longer uses MATLAB #324 : This will targetmain
once this goes in.More details
Tensor3D
wraps astd::vector
.operator()
is used to index/reference the data with three indices.operator[]
since this can only take 1 argument unless we up ourC++
standard to23
.operator[]
can still be invoked if passed anijk
struct
fromcell_coordinate.h
, but this simply unpacks and passes the information tooperator()
.Tensor3D
members or parents.Data is stored as a strided vector
C
andhdf5
use this convention. IE Later dimensions have faster-varying indices.zero()
,frobenius()
, and any other all-element operations can be carried out usingstd::vector
methods.Reading 3D buffers
Tensor3D::initialise
allows us to read from***T
buffers.std::vector
ownership laws and avoid memory leaks, data is copied intoTensor3D
s storage rather than reassigning the underlying pointer.File restructuring
In an attempt to curb the rampant expansion of the
arrays.h
file,class
es andstruct
s within this file have begun to be broken out into separate files within thearrays
directory.Testing
Unit tests for
Tensor3D
,DTilde
, andIncidentField
have been preserved, and continue to pass.Tensor3D
unit tests have been updated slightly to reflect the new call syntax.