Skip to content

Commit 80eb4b3

Browse files
authored
Merge pull request #93 from JuliaAlgebra/name_base_indices
Add name_base_indices function
2 parents 518eda6 + efc514e commit 80eb4b3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/src/types.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CurrentModule = MultivariatePolynomials
1010
AbstractVariable
1111
variable
1212
name
13+
name_base_indices
1314
similarvariable
1415
@similarvariable
1516
```

src/variable.jl

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export name, similarvariable, @similarvariable
1+
export name, name_base_indices, similarvariable, @similarvariable
22

33
Base.copy(x::AbstractVariable) = x
44

@@ -56,6 +56,14 @@ Returns the name of a variable.
5656
"""
5757
function name end
5858

59+
"""
60+
name_base_indices(v::AbstractVariable)
61+
62+
Returns the name of the variable (as a `String` or `Symbol`) and its indices
63+
as a `Vector{Int}` or tuple of `Int`s.
64+
"""
65+
function name_base_indices end
66+
5967
"""
6068
similarvariable(p::AbstractPolynomialLike, variable::Type{Val{V}})
6169

0 commit comments

Comments
 (0)