Skip to content

Commit

Permalink
Internal scalar_product_function
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 28, 2023
1 parent 2aeb23f commit c9059ad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/chebyshev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function degree_one_univariate_polynomial(
MA.@rewrite(variable + 0)
end

function scalar_product_function(::Type{<:ChebyshevBasisFirstKind}, i::Int)
function _scalar_product_function(::Type{<:ChebyshevBasisFirstKind}, i::Int)
if i == 0
return π
elseif isodd(i)
Expand Down Expand Up @@ -57,7 +57,7 @@ function degree_one_univariate_polynomial(
MA.@rewrite(2variable + 0)
end

function scalar_product_function(::Type{<:ChebyshevBasisSecondKind}, i::Int)
function _scalar_product_function(::Type{<:ChebyshevBasisSecondKind}, i::Int)
if i == 0
return π / 2
elseif isodd(i)
Expand Down
4 changes: 2 additions & 2 deletions src/hermite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function degree_one_univariate_polynomial(
MA.@rewrite(1variable)
end

function scalar_product_function(::Type{<:ProbabilistsHermiteBasis}, i::Int)
function _scalar_product_function(::Type{<:ProbabilistsHermiteBasis}, i::Int)
if i == 0
return (2 * π)
elseif isodd(i)
Expand Down Expand Up @@ -60,7 +60,7 @@ function degree_one_univariate_polynomial(
MA.@rewrite(2variable)
end

function scalar_product_function(::Type{<:PhysicistsHermiteBasis}, i::Int)
function _scalar_product_function(::Type{<:PhysicistsHermiteBasis}, i::Int)
if i == 0
return (π)
elseif isodd(i)
Expand Down
2 changes: 1 addition & 1 deletion src/laguerre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ function degree_one_univariate_polynomial(
MA.@rewrite(1 - variable)
end

function scalar_product_function(::Type{<:LaguerreBasis}, i::Int)
function _scalar_product_function(::Type{<:LaguerreBasis}, i::Int)
return factorial(i)
end
2 changes: 1 addition & 1 deletion src/legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function degree_one_univariate_polynomial(
MA.@rewrite(variable + 0)
end

function scalar_product_function(::Type{<:LegendreBasis}, i::Int)
function _scalar_product_function(::Type{<:LegendreBasis}, i::Int)
if isodd(i)
return 0
else
Expand Down
8 changes: 4 additions & 4 deletions src/orthogonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function basis_covering_monomials(
)
end

function scalar_product_function(
function _scalar_product_function(
::Type{<:AbstractMultipleOrthogonalBasis},
i::Int,
) end
Expand All @@ -176,22 +176,22 @@ function _integral(
p::Number,
basis_type::Type{<:AbstractMultipleOrthogonalBasis},
)
return p * scalar_product_function(basis_type, 0)
return p * _scalar_product_function(basis_type, 0)
end

function _integral(
p::MP.AbstractVariable,
basis_type::Type{<:AbstractMultipleOrthogonalBasis},
)
return scalar_product_function(basis_type, 1)
return _scalar_product_function(basis_type, 1)
end

function _integral(
p::MP.AbstractMonomial,
basis_type::Type{<:AbstractMultipleOrthogonalBasis},
)
return prod([
scalar_product_function(basis_type, i) for i in MP.exponents(p)
_scalar_product_function(basis_type, i) for i in MP.exponents(p)
])
end

Expand Down

0 comments on commit c9059ad

Please sign in to comment.