Skip to content

Commit

Permalink
Merge pull request #17 from bowenszhu/PolyChaos-eval-bump_degree
Browse files Browse the repository at this point in the history
Generate code of `bump_degree` for AbstractOrthoPoly subtypes
  • Loading branch information
FHoltorf authored Oct 28, 2022
2 parents 6908335 + 2ff6379 commit 96b9082
Showing 1 changed file with 8 additions and 63 deletions.
71 changes: 8 additions & 63 deletions src/PCE/PCE_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -292,69 +292,14 @@ function bump_degree(op::OrthoPoly, deg::Int)
return OrthoPoly(op.name, deg, op.measure)
end

function bump_degree(op::JacobiOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return JacobiOrthoPoly(deg, ps...)
end

function bump_degree(op::genLaguerreOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return genLaguerreOrthoPoly(deg, ps...)
end

function bump_degree(op::MeixnerPollaczekOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return MeixnerPollaczekOrthoPoly(deg, ps...)
end

function bump_degree(op::Beta01OrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return Beta01OrthoPoly(deg, ps...)
end

function bump_degree(op::GammaOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return GammaOrthoPoly(deg, ps...)
end

function bump_degree(op::genHermiteOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return genHermiteOrthoPoly(deg, ps...)
end

function bump_degree(op::HermiteOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return HermiteOrthoPoly(deg, ps...)
end

function bump_degree(op::LaguerreOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return LaguerreOrthoPoly(deg, ps...)
end

function bump_degree(op::Uniform01OrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return Uniform01OrthoPoly(deg, ps...)
end

function bump_degree(op::Uniform_11OrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return Uniform_11OrthoPoly(deg, ps...)
end

function bump_degree(op::GaussOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return GaussOrthoPoly(deg, ps...)
end

function bump_degree(op::LegendreOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return LegendreOrthoPoly(deg, ps...)
end

function bump_degree(op::LogisticOrthoPoly, deg::Int)
ps = measure_parameters(op.measure)
return LogisticOrthoPoly(deg, ps...)
for OrthoPolyT in (JacobiOrthoPoly, genLaguerreOrthoPoly, MeixnerPollaczekOrthoPoly,
Beta01OrthoPoly, GammaOrthoPoly, genHermiteOrthoPoly, HermiteOrthoPoly,
LaguerreOrthoPoly, Uniform01OrthoPoly, Uniform_11OrthoPoly,
GaussOrthoPoly, LegendreOrthoPoly, LogisticOrthoPoly)
@eval begin function bump_degree(op::$OrthoPolyT, deg::Integer)
ps = measure_parameters(op.measure)
return $OrthoPolyT(deg, ps...)
end end
end

function bump_degree(op::MultiOrthoPoly, deg::Int)
Expand Down

0 comments on commit 96b9082

Please sign in to comment.