Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

symmetric-tensor-index

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symmetric-tensor-index

Index arithmetic for symmetric tensors

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

symmetric-tensor-index

Index operations for symmetric tensors (aka multinomials). In a r-th order symmetric tensor over a d-dimensional vector spaces, we can think of the indices in 3 different ways:

  • As a tensor index (ie an array of length r with values of length d)
  • As a polynomial degree (ie an array of length d with values up to r)
  • Or a flattened array index (a scalar number between 0 and (d + r - 1) choose r )

The code in this library can be used to convert between these indices. For more details see:

Install

npm install symmetric-tensor-index

API

var sym = require("symmetric-tensor-index")

sym.nextTensor(dimension, rank, seq[, index])

Finds the index of the next entry in the tensor.

  • dimension is the dimension of the tensor
  • rank is the rank of the tensor
  • seq is the tensor index
  • index is the array index (optional)

Returns The next array index. seq is updated in place.

sym.tensorToDegree(dimension, rank, seq[, result])

Converts a tensor index to a degree index

  • dimension dimension of vector space
  • rank rank of the tensor
  • seq is the tensor index
  • result (optional) gets the resulting computation

Returns result

sym.tensorToArray(dimension, rank, seq)

Converts a tensor index to an array index

  • dimension dimension of vector space
  • rank rank of the tensor
  • seq is the tensor index

Returns The array index of the tensor entry

sym.degreeToTensor(dimension, rank, degrees[, result])

Converts a degree index to a tensor index

  • dimension dimension of vector space
  • rank rank of the tensor
  • degrees is the degree index
  • result is the result (optional)

Returns result

sym.degreeToArray(dimension, rank, degrees)

Converts a degree index to an array index

  • dimension dimension of vector space
  • rank rank of the tensor
  • degrees is the degree index

Returns The array index of the degree sequence

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

FAQs

Package last updated on 09 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc