-
Notifications
You must be signed in to change notification settings - Fork 30
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
New types for ARTS-3 #612
Comments
Hej, As usual, we approach things from different ends. I care more about the user perspective. Will this make ARTS easier to use? That said, there could be competing aspects. Maybe a more clear definition, but makes things more complicated practically. |
Yes, we do have a different approaches. I disagree with what I get from your comment, which is that you seem to think that we have so much technical debt in ARTS that we cannot make these improvements to user-space. It is pretty obvious to me that an error in I don't think we have a user-facing Other than that, it is pretty trivial to do template <Index N> using FixedVector = matpack::matpack_constant_data<Numeric, N>;
template <Index N>
void linspace(Array<FixedVector<N>>& arr, FixedVector<N>&& pl, FixedVector<N>&& ph, Index n) {
ARTS_USER_ERROR_IF(n < 2, "Must have more than 1 entry")
arr.resize(n);
FixedVector<N> dp{ph};
dp -= pl;
dp /= static_cast<Numeric>(n - 1);
std::generate(arr.begin(), arr.end() - 1,
[x = pl, dx = dp]() mutable {
FixedVector<N> out{x};
x += dx;
return out;
});
arr.back() = ph;
} (And since it is a template, you can use it with |
I want to offer a bold sugguestion, why not use Julia language to develop a brand new RTM for microwave region? |
Is it posssible to change all the xml I/O files to json format? |
Hi all,
We should decide the future of the use of a type system in ARTS. There's numerous ideas of how to improve it in a few PRs so I thought we gather those here.
I will present only the problem I have with some of our use of matrices and vectors here, but I know @erikssonpatrick also is considering exposing
Complex
(and perhaps a few multi-dimensional access to it?) as yet-another-type for the users.But we should also decide if we want the solution below, or if it would be better for LOS and POS to be the types, and
Ppath
to contain lists of these.Vector and Matrix Limitations
The problem:
The propagation matrix calculations requires an
Agenda
call, so its input line-of-sight has to be aVector
today. ButPpath
can only giveVectorView
from theMatrix
it holds, so the data has to be copied.VectorView
is not and should not be a user type. On the other hand, usingArrayOfVector
inPpath
would make the data non-exhaustive (aVector
has a pointer, so it is effectively anArray<>
of pointers) which means it would be less efficient to work withPpath
. It must have been decided in the past that this is not a good trade-off to make and thatPpath
must have exhaustive data.The suggested solution:
Expose some fixed-size multidimensional arrays to the user. Most notably,
Vector2
andVector3
, which can be used asArrayOfVector2
andArrayOfVector3
inPpath
. These can then be accessed without the need of copying, and the data will be exhaustive inArray<>
form because aVectorX
does not need a pointer if implemented asmatpack::matpack_constant_data<Numeric, X>
.New user types:
Vector2
;Vector3
;ArrayOfVector2
;ArrayOfVector3
The text was updated successfully, but these errors were encountered: