You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
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 is an important merge as it provides a convenient and efficient way to convert tensor expressions into numerical functions that can be used in algorithms like Runge-Kutta.
I defined a new class called NumericalArray which has two important attributes. The first is an attribute called _lambda which is the lambdified function for the entire array. The second is _generator which is an array where each individual component is a lambda function for that specific component. This is an important distinction since this allows for calculating single components without having to do calculations for every other component as well (which is what _lambda does).
These attributes are accessed very easily by defining the __call__ and __getitem__ attributes. Calling an instance of NumericalArray is equivalent to calling it's _lambda argument while accessing a component like an array returns a lambda for that component, which can be subsequently called just the same.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #3
This is an important merge as it provides a convenient and efficient way to convert tensor expressions into numerical functions that can be used in algorithms like Runge-Kutta.
I defined a new class called
NumericalArray
which has two important attributes. The first is an attribute called_lambda
which is the lambdified function for the entire array. The second is_generator
which is an array where each individual component is a lambda function for that specific component. This is an important distinction since this allows for calculating single components without having to do calculations for every other component as well (which is what_lambda
does).These attributes are accessed very easily by defining the
__call__
and__getitem__
attributes. Calling an instance ofNumericalArray
is equivalent to calling it's_lambda
argument while accessing a component like an array returns a lambda for that component, which can be subsequently called just the same.Note: The changes currently lack test cases unfortunately.