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

onBasis gets the matrix equivalent of the Transformation #36

Merged
merged 2 commits into from Mar 22, 2013

Conversation

Projects
None yet
2 participants
@bergey
Member

bergey commented Mar 22, 2013

closes #22

This is a helper function to avoid writing the same code for every backend and every vector space. It makes a couple of assumptions about HasBasis implementations, which are true of the instances in Data.Basis and Diagrams, but might not be true in general:

  • that decompose returns all basis functions, not just those with non-zero coefficients
  • that the basis functions are returned in a meaningful order

The new function onBasis returns a list of vectors. The length of the list should be the same as the number of components in each vector, but that is not explicit in the type. The specialized version in TwoD.Transform returns a pair of vectors, instead of a list. (See next pull request, against diagrams-lib.)

This code ended up being identical to that in Diagrams.Backend.Show renderTransf. The diagrams-lib pull request modifies that function to use the new onBasis function.

@bergey bergey referenced this pull request Mar 22, 2013

Merged

Matrix basis rep #78

@byorgey

View changes

Show outdated Hide outdated src/Diagrams/Core/Transform.hs
@byorgey

This comment has been minimized.

Show comment
Hide comment
@byorgey

byorgey Mar 22, 2013

Member

Looks good, thanks!

Member

byorgey commented Mar 22, 2013

Looks good, thanks!

byorgey added a commit that referenced this pull request Mar 22, 2013

Merge pull request #36 from bergey/matrix-basis-rep
onBasis gets the matrix equivalent of the Transformation

@byorgey byorgey merged commit c7c69b8 into diagrams:master Mar 22, 2013

1 check failed

default The Travis build could not complete due to an error
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment