Interface TensorFactory
-
- All Known Implementing Classes:
- ArcCos.ArcCosFactory, ArcCot.ArcCotFactory, ArcSin.ArcSinFactory, ArcTan.ArcTanFactory, Cos.CosFactory, Cot.CotFactory, Exp.ExpFactory, ExpressionFactory, Log.LogFactory, PowerFactory, ProductFactory, Sin.SinFactory, SumFactory, Tan.TanFactory
public interface TensorFactoryAll tensors in the system are reduced to the general form. For example: if there are several numerical factors in the product they will be multiplied and only one resulting numerical factor will be in the resulting product. To maintain this reduced form of expressions, specific infrastructure for tensor creation is provided. All creations of tensors are performed using this infrastructure and explicit tensor creation is architecturally forbidden for the user. Tensor creation infrastructure consists of two functionally redundant but optimized for different usage strategies interfaces:
TensorBuilderandTensorFactory. In fact TensorBuilder and TensorFactory returned by one particular tensor will produce exactly the same result for the same input sub-tensor sequence.This class determines the common interface for tensor factories. Objects of this type are produced by
Tensor.getFactory()method.Main contract for the factory infrastructure could be expressed in the following code:
Tensor tensor = ....; TensorFactory factory = tensor.getFactory(); Tensor createdTensor = factory.create(tensor.getRange(0, tensor.size())); assert TensorUtils.compare(createdTensor,tensor);So, using a tensor factory of any tensor you can rebuild it into the equivalent tensor.
Behavior of TensorFactory is fully consistent with TensorBuilder, see
TensorBuilderfor more information. For general tensor creation use factory methods inTensorsclass.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Tensorcreate(Tensor... tensors)Creates tensor with provided array of sub-tensors.
-
DataMelt 3.0 © DataMelt by jWork.ORG