- java.lang.Object
-
- swim.structure.Form<T>
-
- swim.math.TensorForm<T>
-
- swim.math.TensorArrayForm<T,V>
-
public abstract class TensorArrayForm<T,V> extends TensorForm<T>
-
-
Constructor Summary
Constructors Constructor Description TensorArrayForm()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
cast(Item item)
Converts a structurally typeditem
into a nominally typed Java object.void
castTensor(Item item, TensorDims vd, double[] vs, int vi)
void
castTensor(Item item, TensorDims vd, float[] vs, int vi)
static <V> TensorArrayForm<V[],V>
create(TensorForm<V> next)
abstract T
fromArray(Object... array)
T
fromTensor(TensorDims vd, double[] vs, int vi)
T
fromTensor(TensorDims vd, float[] vs, int vi)
Item
mold(T tensor)
Converts a nominally typed Javaobject
into its structurally typed equivalent.Item
moldTensor(TensorDims vd, double[] vs, int vi)
Item
moldTensor(TensorDims vd, float[] vs, int vi)
protected Object[]
newArray(int length)
abstract TensorForm<V>
next()
String
tag()
Returns the key of the tag attribute that distinguishes structures of thisForm
; returnsnull
if thisForm
has no distinguishing tag attribute.abstract Object[]
toArray(T tensor)
void
toTensor(T u, TensorDims vd, double[] vs, int vi)
void
toTensor(T u, TensorDims vd, float[] vs, int vi)
-
Methods inherited from class swim.structure.Form
cast, forArray, forBigInteger, forBoolean, forBuiltin, forByte, forByteBuffer, forCharacter, forClass, forClass, forCollection, forDouble, forFloat, forInteger, forItem, forList, forLong, forMap, forMap, forNumber, forSet, forShort, forString, forValue, isBuiltin, mold, tag, type, unit, unit
-
-
-
-
Method Detail
-
next
public abstract TensorForm<V> next()
-
newArray
protected Object[] newArray(int length)
-
tag
public String tag()
Description copied from class:Form
Returns the key of the tag attribute that distinguishes structures of thisForm
; returnsnull
if thisForm
has no distinguishing tag attribute. Used to accelerate distrcrimination of polymorphic structural types with nominal type hints.
-
mold
public Item mold(T tensor)
Description copied from class:Form
Converts a nominally typed Javaobject
into its structurally typed equivalent. The returnedItem
must never benull
.
-
cast
public T cast(Item item)
Description copied from class:Form
Converts a structurally typeditem
into a nominally typed Java object. The passed-initem
is assumed to be non-null
.
-
fromTensor
public T fromTensor(TensorDims vd, float[] vs, int vi)
- Specified by:
fromTensor
in classTensorForm<T>
-
fromTensor
public T fromTensor(TensorDims vd, double[] vs, int vi)
- Specified by:
fromTensor
in classTensorForm<T>
-
toTensor
public void toTensor(T u, TensorDims vd, float[] vs, int vi)
- Specified by:
toTensor
in classTensorForm<T>
-
toTensor
public void toTensor(T u, TensorDims vd, double[] vs, int vi)
- Specified by:
toTensor
in classTensorForm<T>
-
moldTensor
public Item moldTensor(TensorDims vd, float[] vs, int vi)
- Overrides:
moldTensor
in classTensorForm<T>
-
moldTensor
public Item moldTensor(TensorDims vd, double[] vs, int vi)
- Overrides:
moldTensor
in classTensorForm<T>
-
castTensor
public void castTensor(Item item, TensorDims vd, float[] vs, int vi)
- Overrides:
castTensor
in classTensorForm<T>
-
castTensor
public void castTensor(Item item, TensorDims vd, double[] vs, int vi)
- Overrides:
castTensor
in classTensorForm<T>
-
create
public static <V> TensorArrayForm<V[],V> create(TensorForm<V> next)
-
-