https://github.com/chakravala/staticvectors.jl

Statically sized tuple vectors for Julia

https://github.com/chakravala/staticvectors.jl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Statically sized tuple vectors for Julia

Basic Info
  • Host: GitHub
  • Owner: chakravala
  • License: mit
  • Language: Julia
  • Default Branch: master
  • Homepage:
  • Size: 104 KB
Statistics
  • Stars: 8
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 9
Created about 3 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

StaticVectors.jl

Statically sized tuple vectors for Julia

Subtypes of TupleVector are provided as a light weight alternative to StaticArrays.jl. This package was created for use in AbstractTensors.jl, Grassmann.jl, FieldAlgebra.jl, Similitude.jl, Geophysics.jl, and various other related repositories developed by chakravala.

TupleVector provides a framework for implementing statically sized tuple vectors in Julia, using the abstract type TupleVector{N,T} <: AbstractVector{T}. Subtypes of TupleVector will provide fast implementations of common array and linear algebra operations. Note that here "statically sized" means that the size can be determined from the type, and "static" does not necessarily imply immutable.

The package also provides some concrete static vector types: Values which may be used as-is (or else embedded in your own type). Mutable versions Variables are also exported, as well as FixedVector for annotating standard Vectors with static size information.

If the environment variable STATICJL is set, then StaticArrays is loaded instead.

Quick start

Add StaticVectors from the Pkg REPL, i.e., pkg> add StaticVectors. Then: ```julia using StaticVectors

Create Values using various forms, using constructors, functions or macros

v1 = Values(1, 2, 3) v1.v === (1, 2, 3) # Values uses a tuple for internal storage v2 = Values{3,Float64}(1, 2, 3) # length 3, eltype Float64 v5 = zeros(Values{3}) # defaults to Float64 v7 = Values{3}([1, 2, 3]) # Array conversions must specify size

Can get size() from instance or type

size(v1) == (3,) size(typeof(v1)) == (3,)

Supports all the common operations of AbstractVector

v7 = v1 + v2 v8 = sin.(v2)

Indexing can also be done using static vectors of integers

v1[1] === 1 v1[:] === v1 typeof(v1[[1,2,3]]) <: Vector # Can't determine size from the type of [1,2,3] ```

Approach

The package provides a range of different useful built-in TupleVector types, which include mutable and immutable vectors based upon tuples, vectors based upon structs, and wrappers of Vector. There is a relatively simple interface for creating your own, custom TupleVector types, too.

This package also provides methods for a wide range of AbstractVector functions, specialized for (potentially immutable) TupleVectors. Many of Julia's built-in method definitions inherently assume mutability, and further performance optimizations may be made when the size of the vector is known to the compiler. One example of this is by loop unrolling, which has a substantial effect on small arrays and tends to automatically trigger LLVM's SIMD optimizations. In combination with intelligent fallbacks to the methods in Base, we seek to provide a comprehensive support for statically sized vectors, large or small, that hopefully "just works".

TupleVector is directly inspired from StaticArrays.jl.

Owner

  • Name: Dream Scatter
  • Login: chakravala
  • Kind: user

computational language algeber 🧐 abstract research mathematician

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Reed"
  given-names: "Michael"
  orcid: "https://orcid.org/0000-0002-8006-7816"
title: "StaticVectors.jl"
version: 1.0.8
doi: 10.5281/zenodo.15059066
date-released: 2024-03-20
url: "https://github.com/chakravala/StaticVectors.jl"

GitHub Events

Total
  • Create event: 3
  • Commit comment event: 3
  • Release event: 2
  • Push event: 4
Last Year
  • Create event: 3
  • Commit comment event: 3
  • Release event: 2
  • Push event: 4

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: 25 days
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 6.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • matthias314 (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 70 total
  • Total dependent packages: 3
  • Total dependent repositories: 0
  • Total versions: 10
juliahub.com: StaticVectors

Statically sized tuple vectors for Julia

  • Versions: 10
  • Dependent Packages: 3
  • Dependent Repositories: 0
  • Downloads: 70 Total
Rankings
Dependent repos count: 9.8%
Average: 37.5%
Dependent packages count: 38.6%
Stargazers count: 46.7%
Forks count: 55.0%
Last synced: 6 months ago