From c9059ad0e518f251e2bd682d6898ba525dae2c52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Legat?= <benoit.legat@gmail.com>
Date: Tue, 28 Nov 2023 15:00:34 +0100
Subject: [PATCH] Internal scalar_product_function

---
 src/chebyshev.jl  | 4 ++--
 src/hermite.jl    | 4 ++--
 src/laguerre.jl   | 2 +-
 src/legendre.jl   | 2 +-
 src/orthogonal.jl | 8 ++++----
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/chebyshev.jl b/src/chebyshev.jl
index b5d474e..83dac46 100644
--- a/src/chebyshev.jl
+++ b/src/chebyshev.jl
@@ -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)
@@ -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)
diff --git a/src/hermite.jl b/src/hermite.jl
index ea9109c..cf64476 100644
--- a/src/hermite.jl
+++ b/src/hermite.jl
@@ -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)
@@ -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)
diff --git a/src/laguerre.jl b/src/laguerre.jl
index 731bd56..fcec105 100644
--- a/src/laguerre.jl
+++ b/src/laguerre.jl
@@ -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
diff --git a/src/legendre.jl b/src/legendre.jl
index 936fc77..bb9b8e1 100644
--- a/src/legendre.jl
+++ b/src/legendre.jl
@@ -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
diff --git a/src/orthogonal.jl b/src/orthogonal.jl
index 3e5a3ed..c40eff6 100644
--- a/src/orthogonal.jl
+++ b/src/orthogonal.jl
@@ -159,7 +159,7 @@ function basis_covering_monomials(
     )
 end
 
-function scalar_product_function(
+function _scalar_product_function(
     ::Type{<:AbstractMultipleOrthogonalBasis},
     i::Int,
 ) end
@@ -176,14 +176,14 @@ 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(
@@ -191,7 +191,7 @@ function _integral(
     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