44template <
typename Scalar_T>
56template<
typename Index_Set_T>
59 std::ostringstream os;
60 os <<
"index_set(" << ist <<
")";
65template<
typename Index_Set_T>
68 std::ostringstream os;
74template<
typename Multivector_T>
77 using scalar_t =
typename Multivector_T::scalar_t;
78 std::ostringstream os;
79 os << std::setprecision(std::numeric_limits<scalar_t>::digits10 + 1);
80 os <<
"clifford(\"" << mv <<
"\")";
85template<
typename Multivector_T>
88 using scalar_t =
typename Multivector_T::scalar_t;
89 std::ostringstream os;
90 if (
abs(mv) < std::numeric_limits<scalar_t>::epsilon())
93 os << std::setprecision(4) << mv.truncated(
scalar_t(1.0e-4));
102 template<
typename Multivector_T>
103 inline Multivector_T
cga3(
const Multivector_T& x)
105 using cl = Multivector_T;
106 using ist =
typename cl::index_set_t;
107 static const cl ninf3 = cl(ist(4)) + cl(ist(-1));
109 return (cl(ist(4)) - x) * ninf3 * (x - cl(ist(4)));
113 template<
typename Multivector_T>
114 inline Multivector_T
cga3std(
const Multivector_T& X)
116 using cl = Multivector_T;
117 using ist =
typename cl::index_set_t;
118 using scalar_t =
typename cl::scalar_t;
119 static const cl ninf3 = cl(ist(4)) + cl(ist(-1));
121 return scalar_t(-2.0) * X / (X & ninf3);
125 template<
typename Multivector_T>
126 inline Multivector_T
agc3(
const Multivector_T& X)
128 using cl = Multivector_T;
129 using ist =
typename cl::index_set_t;
130 using scalar_t =
typename cl::scalar_t;
132 const cl& cga3stdX =
cga3std(X);
133 return (cl(ist(1))*cga3stdX[ist(1)] +
134 cl(ist(2))*cga3stdX[ist(2)] +
135 cl(ist(3))*cga3stdX[ist(3)]) /
scalar_t(2.0);
154#pragma GCC diagnostic ignored "-Wunused-value"
156#if defined(__clang__)
159# pragma clang diagnostic ignored "-Wunused-function"
163# pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
String clifford_to_str(const Multivector_T &mv)
The "informal" string representation of Multivector_T mv.
String glucat_package_version
String clifford_to_repr(const Multivector_T &mv)
The “official” string representation of Multivector_T mv.
String index_set_to_str(const Index_Set_T &ist)
The "informal" string representation of Index_Set_T ist.
String index_set_to_repr(const Index_Set_T &ist)
The “official” string representation of Index_Set_T ist.
PyObject * PyFloat_FromDouble(Scalar_T v)
Index set class based on std::bitset<> in Gnu standard C++ library.
A matrix_multi<Scalar_T,LO,HI,Tune_P> is a matrix approximation to a multivector.
Extra traits which extend numeric limits.
#define GLUCAT_PACKAGE_VERSION
Definitions for 3D Conformal Geometric Algebra [DL].
Multivector_T cga3std(const Multivector_T &X)
Convert CGA3 null vector to standard Conformal Geometric Algebra null vector [DL (10....
Multivector_T agc3(const Multivector_T &X)
Convert CGA3 null vector to Euclidean 3D vector [DL (10.50)].
int index_t
Size of index_t should be enough to represent LO, HI.
auto abs(const Multivector< Scalar_T, LO, HI, Tune_P > &val) -> Scalar_T
Absolute value == sqrt(norm)
const index_t DEFAULT_HI
Default highest index in an index set.