Repository: JuliaManifolds/ManifoldsBase.jl (julia)

Issue:
Should representation_size return nothing by default?
As in the title, I think this would allow for better support of manifolds that don't have `representation_size`.

Pull request description:
Resolves #34 and #41

Patch:
diff --git a/Project.toml b/Project.toml
index c2981bb9a..e1fc239bd 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "ManifoldsBase"
 uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
 authors = ["Seth Axen <seth.axen@gmail.com>", "Mateusz Baran <mateuszbaran89@gmail.com>", "Ronny Bergmann <manopt@ronnybergmann.net>", "Antoine Levitt <antoine.levitt@gmail.com>"]
-version = "0.8.3"
+version = "0.9.0"
 
 [deps]
 LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
diff --git a/src/ManifoldsBase.jl b/src/ManifoldsBase.jl
index 17580e199..6e305fe28 100644
--- a/src/ManifoldsBase.jl
+++ b/src/ManifoldsBase.jl
@@ -217,8 +217,7 @@ Return type of element of the array that will represent the result of function `
 [`Manifold`](@ref) `M` on given arguments `args` (passed as a tuple).
 """
 function allocate_result_type(M::Manifold, f, args::NTuple{N,Any}) where {N}
-    T = typeof(reduce(+, one(number_eltype(eti)) for eti ∈ args))
-    return T
+    return typeof(mapreduce(eti -> one(number_eltype(eti)), +, args))
 end
 
 """
@@ -579,12 +578,10 @@ To be used in conjuntion with [`allocate`](@ref) or [`allocate_result`](@ref).
 """
 number_eltype(x) = eltype(x)
 function number_eltype(x::AbstractArray)
-    T = typeof(reduce(+, one(number_eltype(eti)) for eti ∈ x))
-    return T
+    return typeof(mapreduce(eti -> one(number_eltype(eti)), +, x))
 end
 function number_eltype(x::Tuple)
-    T = typeof(reduce(+, one(number_eltype(eti)) for eti ∈ x))
-    return T
+    return typeof(mapreduce(eti -> one(number_eltype(eti)), +, x))
 end
 
 """
@@ -664,9 +661,11 @@ end
     representation_size(M::Manifold)
 
 The size of an array representing a point on [`Manifold`](@ref) `M`.
+Returns `nothing` by default indicating that points are not represented using an
+`AbstractArray`.
 """
 function representation_size(M::Manifold)
-    error(manifold_function_not_implemented_message(M, representation_size))
+    return nothing
 end
 
 """


Test patch:
diff --git a/test/empty_manifold.jl b/test/empty_manifold.jl
index 33c86b25a..e99a4aa98 100644
--- a/test/empty_manifold.jl
+++ b/test/empty_manifold.jl
@@ -11,9 +11,9 @@ struct NonCoTVector <: CoTVector end
     M = NonManifold()
     p = NonMPoint()
     v = NonTVector()
-    @test base_manifold(M) == M
-    @test number_system(M) == ℝ
-    @test_throws ErrorException ManifoldsBase.representation_size(M)
+    @test base_manifold(M) === M
+    @test number_system(M) === ℝ
+    @test representation_size(M) === nothing
 
     @test_throws ErrorException manifold_dimension(M)