Skip to content

Commit

Permalink
Split up API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Mar 23, 2024
1 parent 4d898c3 commit 6d1c554
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using CliffordNumbers
using Documenter

import CliffordNumbers.BaseNumber

DocMeta.setdocmeta!(CliffordNumbers, :DocTestSetup, :(using CliffordNumbers); recursive=true)

is_ci_env = (get(ENV, "CI", nothing) == true)
Expand All @@ -20,7 +22,13 @@ makedocs(;
"Home" => "index.md",
"Clifford number types" => "numeric.md",
"Operations" => "operations.md",
"API" => "api.md"
"API" => Any[
"CliffordNumbers" => "api/clifford.md",
"Indexing" => "api/indexing.md",
"Math" => "api/indexing.md",
"Quadratic forms" => "api/quadratic.md",
"Internals" => "api/internal.md",
]
],
)

Expand Down
37 changes: 37 additions & 0 deletions docs/src/api/clifford.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Clifford numbers

## Supertype and associated functions

```@docs
CliffordNumbers.AbstractCliffordNumber
CliffordNumbers.numeric_type
CliffordNumbers.similar_type
```

## Concrete types

```@docs
CliffordNumbers.CliffordNumber
CliffordNumbers.Z2CliffordNumber
CliffordNumbers.EvenCliffordNumber
CliffordNumbers.OddCliffordNumber
CliffordNumbers.KVector
CliffordNumbers.grade(::Type{<:KVector{K}}) where K
```

## Promotion and conversion

```@docs
CliffordNumbers.scalar_convert
CliffordNumbers.scalar_promote
Base.widen(::Type{<:AbstractCliffordNumber{Q,T}}) where {Q,T}
CliffordNumbers.widen_grade
```

## Scalar and pseudoscalar components

```@docs
CliffordNumbers.isscalar
CliffordNumbers.ispseudoscalar
CliffordNumbers.scalar
```
50 changes: 50 additions & 0 deletions docs/src/api/indexing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Grades and indices

## Grades

```@docs
CliffordNumbers.nonzero_grades
CliffordNumbers.has_grades_of
```

## `BitIndex`

```@docs
CliffordNumbers.BitIndex
CliffordNumbers.is_same_blade
```

### Special indices

```@docs
CliffordNumbers.scalar_index
CliffordNumbers.pseudoscalar_index
```

### Tools for implementing mathematical operations

```@docs
Base.reverse(::BitIndex)
CliffordNumbers.grade_involution(::BitIndex)
Base.conj(::BitIndex)
```

```@docs
CliffordNumbers.grade(::BitIndex)
CliffordNumbers.sign_of_square
CliffordNumbers.signbit_of_square
CliffordNumbers.nondegenerate_square
CliffordNumbers.sign_of_mult
CliffordNumbers.signbit_of_mult
CliffordNumbers.nondegenerate_mult
Base.:*(::T, ::T) where T<:BitIndex
CliffordNumbers.has_wedge
```

## `BitIndices` and related types

```@docs
CliffordNumbers.AbstractBitIndices
CliffordNumbers.BitIndices
CliffordNumbers.TransformedBitIndices
```
56 changes: 56 additions & 0 deletions docs/src/api/internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Internal methods

## Hamming weights and related operations

```@docs
CliffordNumbers.isevil
CliffordNumbers.isodious
CliffordNumbers.number_of_parity
CliffordNumbers.evil_number
CliffordNumbers.odious_number
CliffordNumbers.next_of_hamming_weight
CliffordNumbers.hamming_number
```

## Indexing

```@docs
CliffordNumbers.signmask
CliffordNumbers._sort_with_parity!
```

## Construction

```@docs
CliffordNumbers.zero_tuple
CliffordNumbers.check_element_count
```

## Multiplication kernels

```@docs
CliffordNumbers.mul
CliffordNumbers.GradeFilter
CliffordNumbers.nondegenerate_mask
CliffordNumbers.mul_mask
CliffordNumbers.bitindex_shuffle
CliffordNumbers.widen_grade_for_mul
```

## Taylor series exponential
```@docs
CliffordNumbers.exp_taylor
```

## Return types for operations

```@docs
CliffordNumbers.product_return_type
CliffordNumbers.exponential_type
```

## Unused features

```@docs
CliffordNumbers.RepresentedGrades
```
65 changes: 65 additions & 0 deletions docs/src/api/math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Mathematical operations

## Grade automorphisms

```@docs; canonical=false
Base.reverse(::BitIndex)
CliffordNumbers.grade_involution(::BitIndex)
Base.conj(::BitIndex)
```

## Duals and inverses

```@docs
CliffordNumbers.dual
CliffordNumbers.undual
CliffordNumbers.versor_inverse
```

## Addition and subtraction

Addition and subtraction integrate seamlessly with those of the Julia Base number types, and no
special documentation is included here.

## Products

### Products with scalars

The standard multiplication and division operations (`*`, `/`, `//`) between Clifford numbers and
scalars behave as expected. `Base.muladd` has been overloaded to take advantage of fma instructions
available on some hardware platforms.

```@docs
Base.muladd(x::BaseNumber, y::T, z::T) where T<:AbstractCliffordNumber
```

### Geometric products

```@docs
Base.:*(::AbstractCliffordNumber{Q}, ::AbstractCliffordNumber{Q}) where Q
CliffordNumbers.left_contraction
CliffordNumbers.right_contraction
CliffordNumbers.dot
CliffordNumbers.hestenes_product
CliffordNumbers.wedge(x::AbstractCliffordNumber{Q}, y::AbstractCliffordNumber{Q}) where Q
CliffordNumbers.commutator
CliffordNumbers.anticommutator
CliffordNumbers.sandwich
```

### Scalar products and normalization

```@docs
CliffordNumbers.scalar_product
Base.abs2(::AbstractCliffordNumber)
Base.abs(::AbstractCliffordNumber)
CliffordNumbers.normalize
```

## Exponentiation

```@docs
Base.exp(::AbstractCliffordNumber)
CliffordNumbers.exppi
CliffordNumbers.exptau
```
26 changes: 26 additions & 0 deletions docs/src/api/quadratic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Quadratic forms

## `QuadraticForm` type and aliases

```@docs
CliffordNumbers.QuadraticForm
CliffordNumbers.QFReal
CliffordNumbers.QFComplex
CliffordNumbers.QFPositiveDefinite
CliffordNumbers.QFNondegenerate
CliffordNumbers.QFExterior
CliffordNumbers.APS
CliffordNumbers.STA
CliffordNumbers.VGA
CliffordNumbers.PGA
CliffordNumbers.CGA
```

## Associated methods

```@docs
CliffordNumbers.dimension
CliffordNumbers.elements
CliffordNumbers.grades
Base.sign(::Type{QuadraticForm{P,Q,R}}, i::Integer) where {P,Q,R}
```

0 comments on commit 6d1c554

Please sign in to comment.