25#include "neml2/tensors/VecBase.h"
26#include "neml2/tensors/tensors.h"
27#include "neml2/tensors/macros.h"
31template <
class Derived>
36 const torch::TensorOptions & options)
41template <
class Derived>
48template <
class Derived>
55template <
class Derived>
59 return this->base_index({
i});
62template <
class Derived>
69template <
class Derived>
76template <
class Derived>
80 return this->rotate(
r.euler_rodrigues());
83template <
class Derived>
90template <
class Derived>
94 return torch::einsum(
"...ijk,...j", {
r.deuler_rodrigues(), *
this});
97template <
class Derived>
102 return torch::einsum(
"...ij,...k", {
I, *
this});
105#define VECBASE_INSTANTIATE(T) template class VecBase<T>
106FOR_ALL_VECBASE(VECBASE_INSTANTIATE);
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
static R2 identity(const torch::TensorOptions &options=default_tensor_options())
Identity.
Definition R2Base.cxx:170
A basic R2.
Definition R2.h:42
The (logical) full third order tensor.
Definition R3.h:41
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
The (logical) scalar.
Definition Scalar.h:38
Derived rotate(const Rot &r) const
Rotate using a Rodrigues vector.
Definition VecBase.cxx:78
Scalar operator()(TorchSize i) const
Accessor.
Definition VecBase.cxx:57
static R2 identity_map(const torch::TensorOptions &options=default_tensor_options())
The derivative of a vector with respect to itself.
Definition VecBase.cxx:50
Scalar norm_sq() const
Norm squared.
Definition VecBase.cxx:64
static Derived fill(const Real &v1, const Real &v2, const Real &v3, const torch::TensorOptions &options=default_tensor_options())
Definition VecBase.cxx:33
Scalar norm() const
Norm.
Definition VecBase.cxx:71
R2 drotate(const Rot &r) const
Derivative of the rotated vector w.r.t. the Rodrigues vector.
Definition VecBase.cxx:92
The (logical) vector.
Definition Vec.h:42
Derived sqrt(const Derived &a)
Definition BatchTensorBase.h:439
Definition CrossRef.cxx:32
double Real
Definition types.h:33