-
Notifications
You must be signed in to change notification settings - Fork 13
Multivariate functions #185
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
9199067
first version for multivariate functions of type trivialtensorizer
benjione 4e6a8ab
performance improvements
benjione 00c8118
added simple test cases
benjione bb0f8f6
fix test and extension
benjione 2758897
comment broken test out for old Julia versions
benjione 568c3f5
fixed ordering of tensorization
benjione 00d75e3
simd change and vector type
benjione a821c96
small changes
benjione 9263003
enabled broken test
benjione 03e123a
u
benjione 2f23248
fixed unbound parameters
benjione 775ace3
type fix
benjione 64c9b54
Merge branch 'master' of github.com:JuliaApproximation/ApproxFunBase.jl
benjione 2d61874
type fixes
benjione 2cfe115
add Polynomials for testing in Project toml
benjione e9a0032
Merge branch 'JuliaApproximation:master' into master
benjione 236eab4
invoked 2D case
benjione 98eaa53
move multivariate tests to orthogonal polynomial repository
benjione c9430a8
Merge branch 'master' of github.com:benjione/ApproxFunBase.jl
benjione f25efa7
Merge branch 'JuliaApproximation:master' into master
benjione 2033c82
delete multivariate
benjione effb5a4
Merge branch 'master' of github.com:benjione/ApproxFunBase.jl
benjione 582c232
Merge branch 'master' into master
jishnub 5adac34
fixed block type and rewritten trivialtensor iterator
benjione d08dcb8
Merge branch 'master' of github.com:benjione/ApproxFunBase.jl
benjione dd3cb6b
remove Orthogonal polynomials from Project toml
benjione d7313fc
adding TensorIteratorFun
benjione e1fb701
changed project toml
benjione 6640875
rename TrivialTensorFun and add check if all spaces in Tensorspace ar…
benjione 656a717
performance optimization
benjione 36d9411
added ProductFun which is not working as a comment
benjione File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
|
|
||
|
|
||
|
|
||
| struct TrivialTensorFun{d, SS<:TensorSpaceND{d}, T<:Number} <: MultivariateFun{T, d} | ||
| space::SS | ||
| coefficients::Vector{T} | ||
| iterator::TrivialTensorizer{d} | ||
| orders::Block{1, Int} | ||
| end | ||
|
|
||
|
|
||
| function TrivialTensorFun(iter::TrivialTensorizer{d},cfs::Vector{T},blk::Block, sp::TensorSpaceND{d}) where {T<:Number,d} | ||
| if any(map(dimension, sp.spaces).!=ℵ₀) | ||
| error("This Space is not a Trivial Tensor space!") | ||
| end | ||
| TrivialTensorFun(sp, cfs, iter, blk) | ||
| end | ||
|
|
||
| (f::TrivialTensorFun)(x...) = evaluate(f, x...) | ||
|
|
||
| # TensorSpace evaluation | ||
| function evaluate(f::TrivialTensorFun{d, SS, T},x...) where {d, SS, T} | ||
| highest_order = f.orders.n[1] | ||
| n = length(f.coefficients) | ||
|
|
||
| # this could be lazy evaluated for the sparse case | ||
| A = T[Fun(f.space.spaces[i], [zeros(T, k);1])(x[i]) for k=0:highest_order, i=1:d] | ||
| result::T = 0 | ||
| coef_counter::Int = 1 | ||
| for i in f.iterator | ||
| tmp = f.coefficients[coef_counter] | ||
| if tmp != 0 | ||
| tmp_res = 1 | ||
| for k=1:d | ||
| tmp_res *= A[i[k], k] | ||
| end | ||
| result += tmp * tmp_res | ||
| end | ||
| coef_counter += 1 | ||
| if coef_counter > n | ||
| break | ||
| end | ||
| end | ||
| return result | ||
| end |
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.
Uh oh!
There was an error while loading. Please reload this page.