25#include "neml2/tensors/Quaternion.h"
27#include "neml2/tensors/R2.h"
28#include "neml2/tensors/Scalar.h"
38 const torch::TensorOptions & options)
66 2 * (
q(1) *
q(2) -
q(3) *
q(0)),
67 2 * (
q(1) *
q(3) +
q(2) *
q(0)),
68 2 * (
q(1) *
q(2) +
q(3) *
q(0)),
70 2 * (
q(2) *
q(3) -
q(1) *
q(0)),
71 2 * (
q(1) *
q(3) -
q(2) *
q(0)),
72 2 * (
q(2) *
q(3) +
q(1) *
q(0)),
BatchTensor base_index(const TorchSlice &indices) const
Return an index sliced on the base dimensions.
Definition BatchTensorBase.cxx:193
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
A batched quaternion.
Definition Quaternion.h:44
Scalar operator()(TorchSize i) const
Accessor.
Definition Quaternion.cxx:51
static Quaternion fill(const Scalar &s, const Scalar &q1, const Scalar &q2, const Scalar &q3)
fill with four scalars
Definition Quaternion.cxx:45
R2 to_R2() const
Convert to R2.
Definition Quaternion.cxx:57
static R2 fill(const Real &a, const torch::TensorOptions &options=default_tensor_options())
Fill the diagonals with a11 = a22 = a33 = a.
Definition R2Base.cxx:40
A basic R2.
Definition R2.h:42
The (logical) scalar.
Definition Scalar.h:38
Definition CrossRef.cxx:32
int64_t TorchSize
Definition types.h:35
double Real
Definition types.h:33