Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo authored May 14, 2019
1 parent 47d85a1 commit bdeee9f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,32 @@

[![Build Status](https://travis-ci.com/lssc-team/TensorValues.jl.svg?branch=master)](https://travis-ci.com/lssc-team/TensorValues.jl)
[![Codecov](https://codecov.io/gh/lssc-team/TensorValues.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/lssc-team/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 produc, outer product, etc.)

## Why

The main feature of the **TensorValues** package is that the provided types `VectorValue`, `TensorValue`, and `MultiValue` do not extend from `AbstractArray`, but from `Number`!

This allows one to work with them as if they were scalar values, which is specially usefull, when using broadcasted operations on arrays of `VectorValue` or `TensorValue` objects. For instance, one can perform the folowing 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)
```

0 comments on commit bdeee9f

Please sign in to comment.