Package de.linusdev.lutils.math.vector
Interface Vector
- All Known Subinterfaces:
Float1,Float2,Float3,Float4,FloatN,Int1,Int2,Int3,Int4,IntN,Long1,Long2,Long3,Long4,LongN,Vector1,Vector2,Vector3,Vector4
- All Known Implementing Classes:
ABFloat1,ABFloat2,ABFloat3,ABFloat4,ABFloatN,BBFloat1,BBFloat2,BBFloat3,BBFloat4,BBFloatN,BBInt1,BBInt2,BBInt3,BBInt4,BBIntN,BBLong1,BBLong2,BBLong3,BBLong4,BBLongN,BBVector,Float2.View,Float3.View,Float4.View,FloatN.View,Vector.View
public interface Vector
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault int @NotNull []The returned mapping must always map to a non view vector.intCount of components in this vector.default @NotNull Vectordefault @NotNull StructurebooleanWhether this vector is array backed.booleanWhether this vector is buffer backed.booleanisView()Whether this vector is only a view onto another vector.static int @NotNull []recalculateMappingToOriginal(@NotNull Vector view, int @NotNull [] mapping) Used byview vectorsto calculate the mapping directly to the original vectors if a view of a view vector is created.toString(T vector, @NotNull String elementTypeName, @NotNull BiFunction<T, Integer, Object> getter) toString()method forVectorsubclasses.
-
Method Details
-
recalculateMappingToOriginal
static int @NotNull [] recalculateMappingToOriginal(@NotNull @NotNull Vector view, int @NotNull [] mapping) Used byview vectorsto calculate the mapping directly to the original vectors if a view of a view vector is created.- Parameters:
view- the view vector, which the view should be created uponmapping- the mapping on the view vector- Returns:
- mapping directly to the original vector
-
toString
@NotNull static <T extends Vector> @NotNull String toString(@NotNull T vector, @NotNull @NotNull String elementTypeName, @NotNull @NotNull BiFunction<T, Integer, Object> getter) toString()method forVectorsubclasses. -
getMemberCount
int getMemberCount()Count of components in this vector.- Returns:
- float count in this vector
-
isArrayBacked
boolean isArrayBacked()Whether this vector is array backed.- Returns:
trueif this vector is array backed.
-
isBufferBacked
boolean isBufferBacked()Whether this vector is buffer backed. If this method returnstrue,getStructure()will not throw anUnsupportedOperationException.- Returns:
trueif this vector is buffer backed.
-
getStructure
- Returns:
- this vector as
Structure - Throws:
UnsupportedOperationException- if this vector is notbuffer backed.
-
isView
boolean isView()Whether this vector is only a view onto another vector.- Returns:
trueif this vector is a view.
-
getOriginal
- Returns:
- the original vector this vector views to
- Throws:
UnsupportedOperationException- if this vector is nota view on another vector.
-
getMapping
default int @NotNull [] getMapping()The returned mapping must always map to a non view vector.- Returns:
- the mapping to the original vector
- Throws:
UnsupportedOperationException- if this vector is nota view on another vector.
-