Class NativeTensor<T>
java.lang.Object
org.episteme.nativ.mathematics.linearalgebra.tensors.NativeTensor<T>
- Type Parameters:
T- the element type (must be Float or Double for native storage)
- All Implemented Interfaces:
Serializable, Tensor<T>
Tensor implementation backed by native memory (off-heap).
Supports hardware acceleration via FFM (Project Panama). Currently optimized for Float and Double types.
- Since:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionElement-wise addition.broadcast(int... newShape) Broadcasts this tensor to a new shape.copy()Returns a copy of this tensor.get(int... indices) Gets the element at the specified indices.Applies a function to each element of the tensor.Element-wise multiplication (Hadamard product).intrank()Returns the rank (number of dimensions) of this tensor.reshape(int... newShape) Reshapes this tensor to a new shape.Scalar multiplication.voidSets the element at the specified indices.int[]shape()Returns the shape of this tensor.intsize()Returns the total number of elements.slice(int[] starts, int[] sizes) Returns a slice (sub-tensor) of this tensor.Element-wise subtraction.sum()Sums all elements.sum(int axis) Sums along the specified axis.toArray()Converts this tensor to a multidimensional array.transpose(int... permutation) Transposes dimensions according to the given permutation.
-
Constructor Details
-
NativeTensor
-
-
Method Details
-
shape
-
rank
-
size
-
get
-
set
-
add
-
subtract
-
multiply
-
scale
-
reshape
-
broadcast
Description copied from interface:TensorBroadcasts this tensor to a new shape.Follows standard broadcasting rules (dimensions of size 1 can be expanded).
-
transpose
Description copied from interface:TensorTransposes dimensions according to the given permutation.For a matrix (rank 2), transpose() swaps rows and columns. For higher-rank tensors, specify the permutation explicitly.
-
slice
Description copied from interface:TensorReturns a slice (sub-tensor) of this tensor. -
map
-
sum
-
sum
-
copy
-
toArray
-
getSegment
-