NEML2 2.1.0
Loading...
Searching...
No Matches

3-vector. More...

Detailed Description

3-vector.

The storage space is (3).

#include <Vec.h>

Inheritance diagram for Vec:

Public Member Functions

 Vec (const Rot &r)
Vec transform (const R2 &op) const override
 apply a transformation operator
Public Member Functions inherited from VecBase< Vec >
Vec rotate (const Rot &r) const
 Rotate using a Rodrigues vector.
R2 drotate (const Rot &r) const
 Derivative of the rotated vector w.r.t. the Rodrigues vector.
Public Member Functions inherited from PrimitiveTensor< Vec, 3 >
 PrimitiveTensor ()=default
 Special member functions.
 operator neml2::Tensor () const
 Implicit conversion to a Tensor (discards information on the fixed base shape).
Scalar operator() (Args... i) const
 Single-element accessor.
Public Member Functions inherited from TensorBase< Vec >
 TensorBase ()=default
 Default constructor.
Vec variable_data () const
 Variable data without function graph.
Vec contiguous () const
Vec clone () const
 Clone (take ownership).
Vec detach () const
 Discard function graph.
Vec to (const TensorOptions &options) const
 Change tensor options.
Vec operator- () const
 Negation.
Size batch_dim () const
Size base_dim () const
Size dynamic_dim () const
Size static_dim () const
Size intmd_dim () const
TraceableTensorShape batch_sizes () const
TensorShapeRef base_sizes () const
const TraceableTensorShapedynamic_sizes () const
TensorShapeRef static_sizes () const
TensorShapeRef intmd_sizes () const
TraceableSize batch_size (Size i) const
Size base_size (Size i) const
const TraceableSizedynamic_size (Size i) const
Size static_size (Size i) const
Size intmd_size (Size i) const
Vec dynamic_index (indexing::TensorIndicesRef indices) const
Vec intmd_index (indexing::TensorIndicesRef indices) const
neml2::Tensor base_index (indexing::TensorIndicesRef indices) const
Vec batch_index (indexing::TensorIndicesRef indices) const
Vec dynamic_slice (Size d, const indexing::Slice &index) const
Vec intmd_slice (Size d, const indexing::Slice &index) const
neml2::Tensor base_slice (Size d, const indexing::Slice &index) const
Vec batch_slice (Size d, const indexing::Slice &index) const
void dynamic_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void intmd_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void base_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
void batch_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
Vec dynamic_expand (const TraceableTensorShape &shape) const
Vec intmd_expand (TensorShapeRef shape) const
neml2::Tensor base_expand (TensorShapeRef shape) const
Vec batch_expand (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}) const
neml2::Tensor static_expand (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
Vec dynamic_expand_as (const neml2::Tensor &other) const
Vec intmd_expand_as (const neml2::Tensor &other) const
neml2::Tensor base_expand_as (const neml2::Tensor &other) const
Vec batch_expand_as (const neml2::Tensor &other) const
neml2::Tensor static_expand_as (const neml2::Tensor &other) const
Vec dynamic_reshape (const TraceableTensorShape &shape) const
Vec intmd_reshape (TensorShapeRef shape) const
neml2::Tensor base_reshape (TensorShapeRef shape) const
Vec batch_reshape (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}) const
neml2::Tensor static_reshape (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
Vec dynamic_squeeze (Size d) const
Vec intmd_squeeze (Size d) const
neml2::Tensor base_squeeze (Size d) const
Vec batch_squeeze (Size d) const
Vec dynamic_unsqueeze (Size d, Size n=1) const
Vec intmd_unsqueeze (Size d, Size n=1) const
neml2::Tensor base_unsqueeze (Size d, Size n=1) const
Vec batch_unsqueeze (Size d, Size n=1) const
Vec dynamic_transpose (Size d1, Size d2) const
Vec intmd_transpose (Size d1, Size d2) const
neml2::Tensor base_transpose (Size d1, Size d2) const
Vec batch_transpose (Size d1, Size d2) const
Vec dynamic_movedim (Size old_dim, Size new_dim) const
Vec intmd_movedim (Size old_dim, Size new_dim) const
neml2::Tensor base_movedim (Size old_dim, Size new_dim) const
Vec batch_movedim (Size old_dim, Size new_dim) const
Vec dynamic_flatten (Size start_dim=0, Size end_dim=-1) const
Vec intmd_flatten (Size start_dim=0, Size end_dim=-1) const
neml2::Tensor base_flatten (Size start_dim=0, Size end_dim=-1) const
Vec batch_flatten () const
 Flatten batch dimensions.
neml2::Tensor static_flatten () const
 Flatten static dimensions.
Public Member Functions inherited from Transformable< Vec >
 Transformable ()=default
Transformableoperator= (const Transformable &)=default
virtual ~Transformable ()=default

Additional Inherited Members

Public Types inherited from PrimitiveTensor< Vec, 3 >
using base_sizes_sequence
 Base shape sequence.
Static Public Member Functions inherited from PrimitiveTensor< Vec, 3 >
static Vec create (const TensorDataContainer &data, Size intmd_dim=0, const TensorOptions &options=default_tensor_options())
 Arbitrary tensor from a nested container with inferred batch dimension.
static Vec einsum (c10::string_view equation, TensorList tensors)
 Einstein summation along base dimensions.
static Vec empty (const TensorOptions &options=default_tensor_options())
static Vec zeros (const TensorOptions &options=default_tensor_options())
static Vec ones (const TensorOptions &options=default_tensor_options())
static Vec full (const CScalar &init, const TensorOptions &options=default_tensor_options())
static Vec rand (const TensorOptions &options=default_tensor_options())
static Vec fill (Args &&... args)
Static Public Member Functions inherited from TensorBase< Vec >
static Vec empty_like (const Vec &other)
static Vec zeros_like (const Vec &other)
 Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc.
static Vec ones_like (const Vec &other)
 Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc.
static Vec full_like (const Vec &other, const CScalar &init)
static Vec rand_like (const Vec &other)
Static Public Attributes inherited from PrimitiveTensor< Vec, 3 >
static const TensorShape const_base_sizes
 The base shape.
static constexpr Size const_base_dim
 The base dim.
static constexpr Size const_base_numel
 The base numel.
Protected Member Functions inherited from PrimitiveTensor< Vec, 3 >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.
Protected Member Functions inherited from TensorBase< Vec >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.

Constructor & Destructor Documentation

◆ Vec()

Vec ( const Rot & r)

Member Function Documentation

◆ transform()

Vec transform ( const R2 & op) const
overridevirtual

apply a transformation operator

Parameters
opthe transformation operator
Returns
an instance of the Derived type that has been transform

Implements Transformable< Vec >.