https://github.com/gridap/tensorvalues.jl
++REPO NOT MAINTAINED++ Tensor values that behave like numbers in broadcasted operations
https://github.com/gridap/tensorvalues.jl
Last synced: 3 months ago
JSON representation
++REPO NOT MAINTAINED++ Tensor values that behave like numbers in broadcasted operations
- Host: GitHub
- URL: https://github.com/gridap/tensorvalues.jl
- Owner: gridap
- License: mit
- Created: 2019-05-14T06:40:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T17:17:45.000Z (over 6 years ago)
- Last Synced: 2025-01-20T22:51:14.697Z (over 1 year ago)
- Language: Julia
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TensorValues
[](https://travis-ci.com/gridap/TensorValues.jl)
[](https://codecov.io/gh/gridap/TensorValues.jl)
If you ❤️ this project, give us a ⭐️!
**TensorValues** provides the types `VectorValue` (a 1-st order tensor), `TensorValue` (a 2-nd order tensor) and `MultiValue` (a generalization of `VectorValue` and `TensorValue`) and common tensor operations defined on these types (e.g., dot product, inner product, outer product, etc.)
## Why
The main feature of the **TensorValues** package is that the provided types do not extend from `AbstractArray`, but from `Number`!
This allows one to work with them as if they were scalar values in broadcasted operations on arrays of `VectorValue` objects (also for `TensorValue` or `MultiValue` objects). For instance, one can perform the following manipulations:
```julia
# Assing a VectorValue to all the entries of an Array of VectorValues
A = zeros(VectorValue{2,Int}, (4,5))
v = VectorValue(12,31)
A .= v # This is posible since VectorValue <: Number
# Broatcasing of tensor operations in arrays of TensorValues
t = TensorValue(13,41,53,17) # creates a 2x2 TensorValue
g = TensorValue(32,41,3,14) # creates another 2x2 TensorValue
B = fill(t,(1,5))
C = inner.(g,B) # inner product of g against all TensorValues in the array B
@show C
# C = [2494 2494 2494 2494 2494]
```
## Installation
```julia
Pkg.add("TensorValues")
```