GithubHelp home page GithubHelp logo

standardgalactic / axisalgorithms.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timholy/axisalgorithms.jl

0.0 1.0 0.0 30 KB

Efficient filtering and linear algebra routines for multidimensional arrays

License: Other

Julia 100.00%

axisalgorithms.jl's Introduction

AxisAlgorithms

Build Status codecov

AxisAlgorithms is a collection of filtering and linear algebra algorithms for multidimensional arrays. For algorithms that would typically apply along the columns of a matrix, you can instead pick an arbitrary axis (dimension).

Note that all functions come in two variants, a ! version that uses pre-allocated output (where the output is the first argument) and a version that allocates the output. Below, the ! versions will be described.

Tridiagonal and Woodbury inversion

If F is an LU-factorization of a tridiagonal matrix, or a Woodbury matrix created from such a factorization, then A_ldiv_B_md!(dest, F, src, axis) will solve the equation F\b for 1-dimensional slices along dimension axis. Unlike many linear algebra algorithms, this one is safe to use as a mutating algorithm with dest=src. The tridiagonal case does not create temporaries, and it has excellent cache behavior.

Matrix multiplication

Multiply a matrix M to all 1-dimensional slices along a particular dimension. Here you have two algorithms to choose from:

  • A_mul_B_perm!(dest, M, src, axis) uses permutedims and standard BLAS-accelerated routines; it allocates temporary storage.
  • A_mul_B_md!(dest, M, src, axis) is a non-allocating naive routine. This also has optimized implementations for sparse M and 2x2 matrices.

In general it is very difficult to get efficient cache behavior for multidimensional multiplication, and often using A_mul_B_perm! is the best strategy. However, there are cases where A_mul_B_md! is faster. It's a good idea to time both and see which works better for your case.

axisalgorithms.jl's People

Contributors

carlobaldassi avatar chriselrod avatar juliatagbot avatar jw3126 avatar nhipsman avatar timholy avatar tkelman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.