Download src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml from sysmlv2research/source_raw: direct link, hf CLI and curl.
- Browser
- Download file 2.44 kB
-
https://huggingface.co/datasets/sysmlv2research/source_raw/resolve/main/src/sysml.library/Domain%20Libraries/Quantities%20and%20Units/TensorCalculations.sysml
- Command line
-
hf download 'hf://datasets/sysmlv2research/source_raw/src/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml'
-
curl -L -o TensorCalculations.sysml https://huggingface.co/datasets/sysmlv2research/source_raw/resolve/main/src/sysml.library/Domain%20Libraries/Quantities%20and%20Units/TensorCalculations.sysml
2.44 kB
| standard library package TensorCalculations { | |
| doc | |
| /* | |
| * This package package defines calculations for the construction of and computations on TensorQuantityValues. | |
| */ | |
| private import ScalarValues::Boolean; | |
| private import ScalarValues::Number; | |
| private import Quantities::ScalarQuantityValue; | |
| private import Quantities::VectorQuantityValue; | |
| private import Quantities::TensorQuantityValue; | |
| private import MeasurementReferences::TensorMeasurementReference; | |
| private import MeasurementReferences::CoordinateTransformation; | |
| calc def '[' specializes BaseFunctions::'[' { | |
| in elements: Number[1..n] ordered; | |
| in mRef: TensorMeasurementReference[1]; | |
| return quantity: TensorQuantityValue[1]; | |
| private attribute n = mRef.flattenedSize; | |
| } | |
| calc def isZeroTensorQuantity { | |
| in x : TensorQuantityValue[1]; | |
| return : Boolean[1]; | |
| } | |
| calc def isUnitTensorQuantity { | |
| in x : TensorQuantityValue[1]; | |
| return : Boolean[1]; | |
| } | |
| /* Addition and subtraction */ | |
| calc def '+' :> DataFunctions::'+' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| calc def '-' :> DataFunctions::'-' { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| /* Multiplication and division */ | |
| calc def scalarTensorMult { in : Number[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| calc def TensorScalarMult { in : TensorQuantityValue[1]; in : Number[1]; return : TensorQuantityValue[1]; } | |
| calc def scalarQuantityTensorMult { in : ScalarQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| calc def TensorScalarQuantityMult { in : TensorQuantityValue[1]; in : ScalarQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| calc def tensorVectorMult { in : TensorQuantityValue[1]; in : VectorQuantityValue[1]; return : VectorQuantityValue[1]; } | |
| calc def vectorTensorMult { in : VectorQuantityValue[1]; in : TensorQuantityValue[1]; return : VectorQuantityValue[1]; } | |
| calc def tensorTensorMult { in : TensorQuantityValue[1]; in : TensorQuantityValue[1]; return : TensorQuantityValue[1]; } | |
| /* Tensor transformation */ | |
| calc def transform { | |
| in transformation : CoordinateTransformation; | |
| in sourceTensor : TensorQuantityValue; | |
| return targetTensor : TensorQuantityValue; | |
| } | |
| } |