Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axkr/symja_tensor
Converter for tensor to Symja objects
https://github.com/axkr/symja_tensor
Last synced: about 1 month ago
JSON representation
Converter for tensor to Symja objects
- Host: GitHub
- URL: https://github.com/axkr/symja_tensor
- Owner: axkr
- Created: 2023-04-03T23:19:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-12T18:34:20.000Z (over 1 year ago)
- Last Synced: 2024-10-15T19:44:44.330Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.84 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Converter for [tensor](https://github.com/datahaki/tensor) to [Symja](https://github.com/axkr/symja_android_library) objects.
```java
package org.matheclipse.tensor.system;import org.matheclipse.core.expression.F;
import org.matheclipse.core.interfaces.IExpr;
import org.matheclipse.tensor.ConvertTensor;
import ch.alpine.tensor.Tensor;public class TensorTest extends AbstractTestCase {
public TensorTest(String name) {
super(name);
}public void testConvert() {
Tensor tensor = ConvertTensor.expr2Tensor(
F.List(F.C0, F.CD1, F.C1D2, F.CI, F.CNI, F.CDI, F.CDNI, F.stringx("Hello World")));
assertEquals(//
"{0, 1.0, 1/2, I, -I, 1.0*I, -1.0*I, Hello World}", //
tensor.toString());
IExpr expr = ConvertTensor.tensor2Expr(tensor);
assertEquals(//
"{0,1.0,1/2,I,-I,I*1.0,I*(-1.0),Hello World}", //
expr.toString());
}
}
```