glucat  0.8.4
clifford_algebra.h
Go to the documentation of this file.
1 #ifndef _GLUCAT_CLIFFORD_ALGEBRA_H
2 #define _GLUCAT_CLIFFORD_ALGEBRA_H
3 /***************************************************************************
4  GluCat : Generic library of universal Clifford algebra templates
5  clifford_algebra.h : Declare the operations of a Clifford algebra
6  -------------------
7  begin : Sun 2001-12-09
8  copyright : (C) 2001-2016 by Paul C. Leopardi
9  ***************************************************************************
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published
13  by the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public License
22  along with this library. If not, see <http://www.gnu.org/licenses/>.
23 
24  ***************************************************************************
25  This library is based on a prototype written by Arvind Raja and was
26  licensed under the LGPL with permission of the author. See Arvind Raja,
27  "Object-oriented implementations of Clifford algebras in C++: a prototype",
28  in Ablamowicz, Lounesto and Parra (eds.)
29  "Clifford algebras with numeric and symbolic computations", Birkhauser, 1996.
30  ***************************************************************************
31  See also Arvind Raja's original header comments in glucat.h
32  ***************************************************************************/
33 
34 #include <string>
35 #include <utility>
36 #include <vector>
37 
38 namespace glucat
39 {
41  template< typename Scalar_T, typename Index_Set_T, typename Multivector_T>
42  class clifford_algebra
43  {
44  public:
45  typedef Scalar_T scalar_t;
46  typedef Index_Set_T index_set_t;
47  typedef Multivector_T multivector_t;
48  typedef std::pair< const index_set_t, Scalar_T > pair_t;
49  typedef std::vector<Scalar_T> vector_t;
50 
51  static const std::string classname();
52 
53  virtual ~clifford_algebra() {};
54 
55  // clifford_algebra operations
57  virtual bool operator== (const multivector_t& val) const = 0;
59  virtual bool operator== (const Scalar_T& scr) const =0;
61  virtual multivector_t& operator+= (const multivector_t& rhs) =0;
63  virtual multivector_t& operator+= (const Scalar_T& scr) =0;
65  virtual multivector_t& operator-= (const multivector_t& rhs) =0;
67  virtual const multivector_t operator- () const =0;
69  virtual multivector_t& operator*= (const Scalar_T& scr) =0;
71  virtual multivector_t& operator*= (const multivector_t& rhs) =0;
73  virtual multivector_t& operator%= (const multivector_t& rhs) =0;
75  virtual multivector_t& operator&= (const multivector_t& rhs) =0;
77  virtual multivector_t& operator^= (const multivector_t& rhs) =0;
79  virtual multivector_t& operator/= (const Scalar_T& scr) =0;
81  virtual multivector_t& operator/= (const multivector_t& rhs) =0;
83  virtual multivector_t& operator|= (const multivector_t& rhs) =0;
85  virtual const multivector_t inv () const =0;
87  virtual const multivector_t pow (int m) const =0;
89  virtual const multivector_t outer_pow (int m) const =0;
91  virtual const index_set_t frame() const =0;
93  virtual index_t grade() const =0;
95  virtual Scalar_T operator[] (const index_set_t ist) const =0;
97  virtual const multivector_t operator() (index_t grade) const =0;
99  virtual Scalar_T scalar() const =0;
101  virtual const multivector_t pure() const =0;
103  virtual const multivector_t even() const =0;
105  virtual const multivector_t odd() const =0;
107  virtual const vector_t vector_part () const = 0;
109  virtual const vector_t vector_part (const index_set_t frm, const bool prechecked) const = 0;
111  virtual const multivector_t involute() const =0;
113  virtual const multivector_t reverse() const =0;
115  virtual const multivector_t conj() const =0;
117  virtual Scalar_T quad() const =0;
119  virtual Scalar_T norm() const =0;
121  virtual Scalar_T max_abs() const =0;
123  virtual const multivector_t truncated
124  (const Scalar_T& limit = Scalar_T(DEFAULT_TRUNCATION)) const =0;
126  virtual bool isnan() const =0;
128  virtual void write (const std::string& msg="") const =0;
130  virtual void write (std::ofstream& ofile, const std::string& msg="") const =0;
131  };
132 
133 #ifndef _GLUCAT_CLIFFORD_ALGEBRA_OPERATIONS
134 #define _GLUCAT_CLIFFORD_ALGEBRA_OPERATIONS \
135  bool operator== (const multivector_t& val) const; \
136  bool operator== (const Scalar_T& scr) const; \
137  multivector_t& operator+= (const multivector_t& rhs); \
138  multivector_t& operator+= (const Scalar_T& scr); \
139  multivector_t& operator-= (const multivector_t& rhs); \
140  const multivector_t operator- () const; \
141  multivector_t& operator*= (const Scalar_T& scr); \
142  multivector_t& operator*= (const multivector_t& rhs); \
143  multivector_t& operator%= (const multivector_t& rhs); \
144  multivector_t& operator&= (const multivector_t& rhs); \
145  multivector_t& operator^= (const multivector_t& rhs); \
146  multivector_t& operator/= (const Scalar_T& scr); \
147  multivector_t& operator/= (const multivector_t& rhs); \
148  multivector_t& operator|= (const multivector_t& rhs); \
149  const multivector_t inv () const; \
150  const multivector_t pow (int m) const; \
151  const multivector_t outer_pow (int m) const; \
152  const index_set_t frame() const; \
153  index_t grade() const; \
154  Scalar_T operator[] (const index_set_t ist) const; \
155  const multivector_t operator() (index_t grade) const; \
156  Scalar_T scalar() const; \
157  const multivector_t pure() const; \
158  const multivector_t even() const; \
159  const multivector_t odd() const; \
160  const vector_t vector_part() const; \
161  const vector_t vector_part \
162  (const index_set_t frm, const bool prechecked = false) const;\
163  const multivector_t involute() const; \
164  const multivector_t reverse() const; \
165  const multivector_t conj() const; \
166  Scalar_T quad() const; \
167  Scalar_T norm() const; \
168  Scalar_T max_abs() const; \
169  const multivector_t truncated \
170  (const Scalar_T& limit = Scalar_T(DEFAULT_TRUNCATION)) const;\
171  bool isnan () const; \
172  void write (const std::string& msg="") const;\
173  void write (std::ofstream& ofile, const std::string& msg="") const;
174 #endif // _GLUCAT_CLIFFORD_ALGEBRA_OPERATIONS
175 
177  template
178  <
179  template<typename, const index_t, const index_t> class Multivector,
180  template<typename, const index_t, const index_t> class RHS,
181  typename Scalar_T, const index_t LO, const index_t HI
182  >
183  bool
184  operator!= (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
185 
187  template
188  <
189  template<typename, const index_t, const index_t> class Multivector,
190  typename Scalar_T, const index_t LO, const index_t HI
191  >
192  bool
193  operator!= (const Multivector<Scalar_T,LO,HI>& lhs, const Scalar_T& scr);
194 
196  template
197  <
198  template<typename, const index_t, const index_t> class Multivector,
199  typename Scalar_T, const index_t LO, const index_t HI
200  >
201  bool
202  operator!= (const Scalar_T& scr, const Multivector<Scalar_T,LO,HI>& rhs);
203 
205  template
206  <
207  template<typename, const index_t, const index_t> class Multivector,
208  typename Scalar_T, const index_t LO, const index_t HI
209  >
210  const Multivector<Scalar_T,LO,HI>
211  operator+ (const Multivector<Scalar_T,LO,HI>& lhs, const Scalar_T& scr);
212 
214  template
215  <
216  template<typename, const index_t, const index_t> class Multivector,
217  typename Scalar_T, const index_t LO, const index_t HI
218  >
219  const Multivector<Scalar_T,LO,HI>
220  operator+ (const Scalar_T& scr, const Multivector<Scalar_T,LO,HI>& rhs);
221 
223  template
224  <
225  template<typename, const index_t, const index_t> class Multivector,
226  template<typename, const index_t, const index_t> class RHS,
227  typename Scalar_T, const index_t LO, const index_t HI
228  >
229  const Multivector<Scalar_T,LO,HI>
230  operator+ (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
231 
233  template
234  <
235  template<typename, const index_t, const index_t> class Multivector,
236  typename Scalar_T, const index_t LO, const index_t HI
237  >
238  const Multivector<Scalar_T,LO,HI>
239  operator- (const Multivector<Scalar_T,LO,HI>& lhs, const Scalar_T& scr);
240 
242  template
243  <
244  template<typename, const index_t, const index_t> class Multivector,
245  typename Scalar_T, const index_t LO, const index_t HI
246  >
247  const Multivector<Scalar_T,LO,HI>
248  operator- (const Scalar_T& scr, const Multivector<Scalar_T,LO,HI>& rhs);
249 
251  template
252  <
253  template<typename, const index_t, const index_t> class Multivector,
254  template<typename, const index_t, const index_t> class RHS,
255  typename Scalar_T, const index_t LO, const index_t HI
256  >
257  const Multivector<Scalar_T,LO,HI>
258  operator- (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
259 
261  template
262  <
263  template<typename, const index_t, const index_t> class Multivector,
264  typename Scalar_T, const index_t LO, const index_t HI
265  >
266  const Multivector<Scalar_T,LO,HI>
267  operator* (const Multivector<Scalar_T,LO,HI>& lhs, const Scalar_T& scr);
268 
270  template
271  <
272  template<typename, const index_t, const index_t> class Multivector,
273  typename Scalar_T, const index_t LO, const index_t HI
274  >
275  const Multivector<Scalar_T,LO,HI>
276  operator* (const Scalar_T& scr, const Multivector<Scalar_T,LO,HI>& rhs);
277 
279  template
280  <
281  template<typename, const index_t, const index_t> class Multivector,
282  template<typename, const index_t, const index_t> class RHS,
283  typename Scalar_T, const index_t LO, const index_t HI
284  >
285  const Multivector<Scalar_T,LO,HI>
286  operator* (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
287 
289  template
290  <
291  template<typename, const index_t, const index_t> class Multivector,
292  template<typename, const index_t, const index_t> class RHS,
293  typename Scalar_T, const index_t LO, const index_t HI
294  >
295  const Multivector<Scalar_T,LO,HI>
296  operator^ (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
297 
299  template
300  <
301  template<typename, const index_t, const index_t> class Multivector,
302  template<typename, const index_t, const index_t> class RHS,
303  typename Scalar_T, const index_t LO, const index_t HI
304  >
305  const Multivector<Scalar_T,LO,HI>
306  operator& (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
307 
309  template
310  <
311  template<typename, const index_t, const index_t> class Multivector,
312  template<typename, const index_t, const index_t> class RHS,
313  typename Scalar_T, const index_t LO, const index_t HI
314  >
315  const Multivector<Scalar_T,LO,HI>
316  operator% (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
317 
319  template
320  <
321  template<typename, const index_t, const index_t> class Multivector,
322  template<typename, const index_t, const index_t> class RHS,
323  typename Scalar_T, const index_t LO, const index_t HI
324  >
325  Scalar_T
326  star (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
327 
329  template
330  <
331  template<typename, const index_t, const index_t> class Multivector,
332  typename Scalar_T, const index_t LO, const index_t HI
333  >
334  const Multivector<Scalar_T,LO,HI>
335  operator/ (const Multivector<Scalar_T,LO,HI>& lhs, const Scalar_T& scr);
336 
338  template
339  <
340  template<typename, const index_t, const index_t> class Multivector,
341  typename Scalar_T, const index_t LO, const index_t HI
342  >
343  const Multivector<Scalar_T,LO,HI>
344  operator/ (const Scalar_T& scr, const Multivector<Scalar_T,LO,HI>& rhs);
345 
347  template
348  <
349  template<typename, const index_t, const index_t> class Multivector,
350  template<typename, const index_t, const index_t> class RHS,
351  typename Scalar_T, const index_t LO, const index_t HI
352  >
353  const Multivector<Scalar_T,LO,HI>
354  operator/ (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
355 
357  template
358  <
359  template<typename, const index_t, const index_t> class Multivector,
360  template<typename, const index_t, const index_t> class RHS,
361  typename Scalar_T, const index_t LO, const index_t HI
362  >
363  const Multivector<Scalar_T,LO,HI>
364  operator| (const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
365 
367  template
368  <
369  template<typename, const index_t, const index_t> class Multivector,
370  typename Scalar_T, const index_t LO, const index_t HI
371  >
372  const Multivector<Scalar_T,LO,HI>
373  inv(const Multivector<Scalar_T,LO,HI>& val);
374 
376  template
377  <
378  template<typename, const index_t, const index_t> class Multivector,
379  typename Scalar_T, const index_t LO, const index_t HI
380  >
381  const Multivector<Scalar_T,LO,HI>
382  pow(const Multivector<Scalar_T,LO,HI>& lhs, int rhs);
383 
385  template
386  <
387  template<typename, const index_t, const index_t> class Multivector,
388  template<typename, const index_t, const index_t> class RHS,
389  typename Scalar_T, const index_t LO, const index_t HI
390  >
391  const Multivector<Scalar_T,LO,HI>
392  pow(const Multivector<Scalar_T,LO,HI>& lhs, const RHS<Scalar_T,LO,HI>& rhs);
393 
395  template< template<typename, const index_t, const index_t> class Multivector,
396  typename Scalar_T, const index_t LO, const index_t HI >
397  const Multivector<Scalar_T,LO,HI>
398  outer_pow(const Multivector<Scalar_T,LO,HI>& lhs, int rhs);
399 
401  template
402  <
403  template<typename, const index_t, const index_t> class Multivector,
404  typename Scalar_T, const index_t LO, const index_t HI
405  >
406  Scalar_T
407  scalar(const Multivector<Scalar_T,LO,HI>& val);
408 
410  template
411  <
412  template<typename, const index_t, const index_t> class Multivector,
413  typename Scalar_T, const index_t LO, const index_t HI
414  >
415  Scalar_T
416  real(const Multivector<Scalar_T,LO,HI>& val);
417 
419  template
420  <
421  template<typename, const index_t, const index_t> class Multivector,
422  typename Scalar_T, const index_t LO, const index_t HI
423  >
424  Scalar_T
425  imag(const Multivector<Scalar_T,LO,HI>& val);
426 
428  template
429  <
430  template<typename, const index_t, const index_t> class Multivector,
431  typename Scalar_T, const index_t LO, const index_t HI
432  >
433  const Multivector<Scalar_T,LO,HI>
434  pure(const Multivector<Scalar_T,LO,HI>& val);
435 
437  template
438  <
439  template<typename, const index_t, const index_t> class Multivector,
440  typename Scalar_T, const index_t LO, const index_t HI
441  >
442  const Multivector<Scalar_T,LO,HI>
443  even(const Multivector<Scalar_T,LO,HI>& val);
444 
446  template
447  <
448  template<typename, const index_t, const index_t> class Multivector,
449  typename Scalar_T, const index_t LO, const index_t HI
450  >
451  const Multivector<Scalar_T,LO,HI>
452  odd(const Multivector<Scalar_T,LO,HI>& val);
453 
455  template
456  <
457  template<typename, const index_t, const index_t> class Multivector,
458  typename Scalar_T, const index_t LO, const index_t HI
459  >
460  const std::vector<Scalar_T>
461  vector_part(const Multivector<Scalar_T,LO,HI>& val);
462 
464  template
465  <
466  template<typename, const index_t, const index_t> class Multivector,
467  typename Scalar_T, const index_t LO, const index_t HI
468  >
469  const Multivector<Scalar_T,LO,HI>
470  involute(const Multivector<Scalar_T,LO,HI>& val);
471 
473  template
474  <
475  template<typename, const index_t, const index_t> class Multivector,
476  typename Scalar_T, const index_t LO, const index_t HI
477  >
478  const Multivector<Scalar_T,LO,HI>
479  reverse(const Multivector<Scalar_T,LO,HI>& val);
480 
482  template
483  <
484  template<typename, const index_t, const index_t> class Multivector,
485  typename Scalar_T, const index_t LO, const index_t HI
486  >
487  const Multivector<Scalar_T,LO,HI>
488  conj(const Multivector<Scalar_T,LO,HI>& val);
489 
491  template
492  <
493  template<typename, const index_t, const index_t> class Multivector,
494  typename Scalar_T, const index_t LO, const index_t HI
495  >
496  Scalar_T
497  quad(const Multivector<Scalar_T,LO,HI>& val);
498 
500  template
501  <
502  template<typename, const index_t, const index_t> class Multivector,
503  typename Scalar_T, const index_t LO, const index_t HI
504  >
505  Scalar_T
506  norm(const Multivector<Scalar_T,LO,HI>& val);
507 
509  template
510  <
511  template<typename, const index_t, const index_t> class Multivector,
512  typename Scalar_T, const index_t LO, const index_t HI
513  >
514  Scalar_T
515  abs(const Multivector<Scalar_T,LO,HI>& val);
516 
518  template
519  <
520  template<typename, const index_t, const index_t> class Multivector,
521  typename Scalar_T, const index_t LO, const index_t HI
522  >
523  Scalar_T
524  max_abs(const Multivector<Scalar_T,LO,HI>& val);
525 
527  template
528  <
529  template<typename, const index_t, const index_t> class Multivector,
530  typename Scalar_T, const index_t LO, const index_t HI
531  >
532  const Multivector<Scalar_T,LO,HI>
533  complexifier(const Multivector<Scalar_T,LO,HI>& val);
534 
537  template
538  <
539  template<typename, const index_t, const index_t> class Multivector,
540  typename Scalar_T, const index_t LO, const index_t HI
541  >
542  const Multivector<Scalar_T,LO,HI>
543  elliptic(const Multivector<Scalar_T,LO,HI>& val);
544 
546  template
547  <
548  template<typename, const index_t, const index_t> class Multivector,
549  typename Scalar_T, const index_t LO, const index_t HI
550  >
551  const Multivector<Scalar_T,LO,HI>
552  sqrt(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
553 
555  template
556  <
557  template<typename, const index_t, const index_t> class Multivector,
558  typename Scalar_T, const index_t LO, const index_t HI
559  >
560  const Multivector<Scalar_T,LO,HI>
561  sqrt(const Multivector<Scalar_T,LO,HI>& val);
562 
563  // Transcendental functions
564 
566  template
567  < template<typename, const index_t, const index_t> class Multivector,
568  typename Scalar_T, const index_t LO, const index_t HI
569  >
570  const Multivector<Scalar_T,LO,HI>
571  clifford_exp(const Multivector<Scalar_T,LO,HI>& val);
572 
574  template
575  <
576  template<typename, const index_t, const index_t> class Multivector,
577  typename Scalar_T, const index_t LO, const index_t HI
578  >
579  const Multivector<Scalar_T,LO,HI>
580  log(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
581 
583  template
584  <
585  template<typename, const index_t, const index_t> class Multivector,
586  typename Scalar_T, const index_t LO, const index_t HI
587  >
588  const Multivector<Scalar_T,LO,HI>
589  log(const Multivector<Scalar_T,LO,HI>& val);
590 
592  template
593  <
594  template<typename, const index_t, const index_t> class Multivector,
595  typename Scalar_T, const index_t LO, const index_t HI
596  >
597  const Multivector<Scalar_T,LO,HI>
598  cos(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
599 
601  template
602  <
603  template<typename, const index_t, const index_t> class Multivector,
604  typename Scalar_T, const index_t LO, const index_t HI
605  >
606  const Multivector<Scalar_T,LO,HI>
607  cos(const Multivector<Scalar_T,LO,HI>& val);
608 
610  template
611  <
612  template<typename, const index_t, const index_t> class Multivector,
613  typename Scalar_T, const index_t LO, const index_t HI
614  >
615  const Multivector<Scalar_T,LO,HI>
616  acos(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
617 
619  template
620  <
621  template<typename, const index_t, const index_t> class Multivector,
622  typename Scalar_T, const index_t LO, const index_t HI
623  >
624  const Multivector<Scalar_T,LO,HI>
625  acos(const Multivector<Scalar_T,LO,HI>& val);
626 
628  template
629  <
630  template<typename, const index_t, const index_t> class Multivector,
631  typename Scalar_T, const index_t LO, const index_t HI
632  >
633  const Multivector<Scalar_T,LO,HI>
634  cosh(const Multivector<Scalar_T,LO,HI>& val);
635 
637  template
638  <
639  template<typename, const index_t, const index_t> class Multivector,
640  typename Scalar_T, const index_t LO, const index_t HI
641  >
642  const Multivector<Scalar_T,LO,HI>
643  acosh(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
644 
646  template
647  <
648  template<typename, const index_t, const index_t> class Multivector,
649  typename Scalar_T, const index_t LO, const index_t HI
650  >
651  const Multivector<Scalar_T,LO,HI>
652  acosh(const Multivector<Scalar_T,LO,HI>& val);
653 
655  template
656  <
657  template<typename, const index_t, const index_t> class Multivector,
658  typename Scalar_T, const index_t LO, const index_t HI
659  >
660  const Multivector<Scalar_T,LO,HI>
661  sin(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
662 
664  template
665  <
666  template<typename, const index_t, const index_t> class Multivector,
667  typename Scalar_T, const index_t LO, const index_t HI
668  >
669  const Multivector<Scalar_T,LO,HI>
670  sin(const Multivector<Scalar_T,LO,HI>& val);
671 
673  template
674  <
675  template<typename, const index_t, const index_t> class Multivector,
676  typename Scalar_T, const index_t LO, const index_t HI
677  >
678  const Multivector<Scalar_T,LO,HI>
679  asin(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
680 
682  template
683  <
684  template<typename, const index_t, const index_t> class Multivector,
685  typename Scalar_T, const index_t LO, const index_t HI
686  >
687  const Multivector<Scalar_T,LO,HI>
688  asin(const Multivector<Scalar_T,LO,HI>& val);
689 
691  template
692  <
693  template<typename, const index_t, const index_t> class Multivector,
694  typename Scalar_T, const index_t LO, const index_t HI
695  >
696  const Multivector<Scalar_T,LO,HI>
697  sinh(const Multivector<Scalar_T,LO,HI>& val);
698 
700  template
701  <
702  template<typename, const index_t, const index_t> class Multivector,
703  typename Scalar_T, const index_t LO, const index_t HI
704  >
705  const Multivector<Scalar_T,LO,HI>
706  asinh(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
707 
709  template
710  <
711  template<typename, const index_t, const index_t> class Multivector,
712  typename Scalar_T, const index_t LO, const index_t HI
713  >
714  const Multivector<Scalar_T,LO,HI>
715  asinh(const Multivector<Scalar_T,LO,HI>& val);
716 
718  template
719  <
720  template<typename, const index_t, const index_t> class Multivector,
721  typename Scalar_T, const index_t LO, const index_t HI
722  >
723  const Multivector<Scalar_T,LO,HI>
724  tan(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
725 
727  template
728  <
729  template<typename, const index_t, const index_t> class Multivector,
730  typename Scalar_T, const index_t LO, const index_t HI
731  >
732  const Multivector<Scalar_T,LO,HI>
733  tan(const Multivector<Scalar_T,LO,HI>& val);
734 
736  template
737  <
738  template<typename, const index_t, const index_t> class Multivector,
739  typename Scalar_T, const index_t LO, const index_t HI
740  >
741  const Multivector<Scalar_T,LO,HI>
742  atan(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
743 
745  template
746  <
747  template<typename, const index_t, const index_t> class Multivector,
748  typename Scalar_T, const index_t LO, const index_t HI
749  >
750  const Multivector<Scalar_T,LO,HI>
751  atan(const Multivector<Scalar_T,LO,HI>& val);
752 
754  template
755  <
756  template<typename, const index_t, const index_t> class Multivector,
757  typename Scalar_T, const index_t LO, const index_t HI
758  >
759  const Multivector<Scalar_T,LO,HI>
760  tanh(const Multivector<Scalar_T,LO,HI>& val);
761 
763  template
764  <
765  template<typename, const index_t, const index_t> class Multivector,
766  typename Scalar_T, const index_t LO, const index_t HI
767  >
768  const Multivector<Scalar_T,LO,HI>
769  atanh(const Multivector<Scalar_T,LO,HI>& val, const Multivector<Scalar_T,LO,HI>& i, const bool prechecked = false);
770 
772  template
773  <
774  template<typename, const index_t, const index_t> class Multivector,
775  typename Scalar_T, const index_t LO, const index_t HI
776  >
777  const Multivector<Scalar_T,LO,HI>
778  atanh(const Multivector<Scalar_T,LO,HI>& val);
779 }
780 #endif // _GLUCAT_CLIFFORD_ALGEBRA_H
glucat::vector_part
const std::vector< Scalar_T > vector_part(const Multivector< Scalar_T, LO, HI > &val)
Vector part of multivector, as a vector_t with respect to frame()
Definition: clifford_algebra_imp.h:472
glucat::inv
const Multivector< Scalar_T, LO, HI > inv(const Multivector< Scalar_T, LO, HI > &val)
Geometric multiplicative inverse.
Definition: clifford_algebra_imp.h:350
glucat::operator%
const Multivector< Scalar_T, LO, HI > operator%(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Left contraction.
Definition: clifford_algebra_imp.h:272
glucat::clifford_algebra::scalar_t
Scalar_T scalar_t
Definition: clifford_algebra.h:103
glucat::clifford_algebra::norm
virtual Scalar_T norm() const =0
Scalar_T norm == sum of norm of coordinates.
glucat::asin
const Multivector< Scalar_T, LO, HI > asin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse sine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:934
glucat::clifford_algebra::involute
virtual const multivector_t involute() const =0
Main involution, each {i} is replaced by -{i} in each term, eg. {1} -> -{1}.
glucat::clifford_algebra::pair_t
std::pair< const index_set_t, Scalar_T > pair_t
Definition: clifford_algebra.h:106
glucat::clifford_algebra::scalar
virtual Scalar_T scalar() const =0
Scalar part.
glucat::operator+
const Multivector< Scalar_T, LO, HI > operator+(const Multivector< Scalar_T, LO, HI > &lhs, const Scalar_T &scr)
Geometric sum of multivector and scalar.
Definition: clifford_algebra_imp.h:131
glucat::clifford_algebra::operator-
virtual const multivector_t operator-() const =0
Unary -.
glucat::clifford_algebra::inv
virtual const multivector_t inv() const =0
Geometric multiplicative inverse.
glucat::scalar
Scalar_T scalar(const Multivector< Scalar_T, LO, HI > &val)
Scalar part.
Definition: clifford_algebra_imp.h:421
glucat::atan
const Multivector< Scalar_T, LO, HI > atan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse tangent of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:1034
glucat::clifford_algebra
clifford_algebra<> declares the operations of a Clifford algebra
Definition: clifford_algebra.h:72
glucat::operator|
const Multivector< Scalar_T, LO, HI > operator|(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Transformation via twisted adjoint action.
Definition: clifford_algebra_imp.h:339
glucat::complexifier
const Multivector< Scalar_T, LO, HI > complexifier(const Multivector< Scalar_T, LO, HI > &val)
Square root of -1 which commutes with all members of the frame of the given multivector.
Definition: clifford_algebra_imp.h:535
PyClical.i
i
Definition: PyClical.pyx:1541
PyClical.ist
ist
Definition: PyClical.pyx:1878
glucat::involute
const Multivector< Scalar_T, LO, HI > involute(const Multivector< Scalar_T, LO, HI > &val)
Main involution, each {i} is replaced by -{i} in each term, eg. {1}*{2} -> (-{2})*(-{1})
Definition: clifford_algebra_imp.h:480
glucat::clifford_algebra::reverse
virtual const multivector_t reverse() const =0
Reversion, eg. {1}*{2} -> {2}*{1}.
glucat::tan
const Multivector< Scalar_T, LO, HI > tan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Tangent of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:1006
glucat::index_t
int index_t
Size of index_t should be enough to represent LO, HI.
Definition: global.h:106
glucat::real
Scalar_T real(const Multivector< Scalar_T, LO, HI > &val)
Real part: synonym for scalar part.
Definition: clifford_algebra_imp.h:429
glucat::clifford_algebra::operator&=
virtual multivector_t & operator&=(const multivector_t &rhs)=0
Inner product.
glucat::acos
const Multivector< Scalar_T, LO, HI > acos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse cosine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:827
glucat::clifford_algebra::operator==
virtual bool operator==(const multivector_t &val) const =0
Test for equality of multivectors.
glucat::operator!=
bool operator!=(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Test for inequality of multivectors.
Definition: clifford_algebra_imp.h:107
glucat::asinh
const Multivector< Scalar_T, LO, HI > asinh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic sine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:874
glucat::operator-
const Multivector< Scalar_T, LO, HI > operator-(const Multivector< Scalar_T, LO, HI > &lhs, const Scalar_T &scr)
Geometric difference of multivector and scalar.
Definition: clifford_algebra_imp.h:167
glucat::even
const Multivector< Scalar_T, LO, HI > even(const Multivector< Scalar_T, LO, HI > &val)
Even part.
Definition: clifford_algebra_imp.h:456
glucat::DEFAULT_TRUNCATION
const double DEFAULT_TRUNCATION
Default for truncation.
Definition: global.h:143
glucat::max_abs
Scalar_T max_abs(const Multivector< Scalar_T, LO, HI > &val)
Maximum of absolute values of components of multivector: multivector infinity norm.
Definition: clifford_algebra_imp.h:528
glucat::clifford_algebra::quad
virtual Scalar_T quad() const =0
Scalar_T quadratic form == (rev(x)*x)(0)
glucat::clifford_algebra::operator%=
virtual multivector_t & operator%=(const multivector_t &rhs)=0
Contraction.
glucat::pure
const Multivector< Scalar_T, LO, HI > pure(const Multivector< Scalar_T, LO, HI > &val)
Pure part.
Definition: clifford_algebra_imp.h:448
glucat::cosh
const Multivector< Scalar_T, LO, HI > cosh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic cosine of multivector.
Definition: clifford_algebra_imp.h:749
glucat::star
Scalar_T star(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Hestenes scalar product.
Definition: clifford_algebra_imp.h:287
glucat::clifford_algebra::outer_pow
virtual const multivector_t outer_pow(int m) const =0
Outer product power.
glucat::clifford_algebra::pure
virtual const multivector_t pure() const =0
Pure part.
glucat::acosh
const Multivector< Scalar_T, LO, HI > acosh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic cosine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:767
glucat::clifford_algebra::operator[]
virtual Scalar_T operator[](const index_set_t ist) const =0
Subscripting: map from index set to scalar coordinate.
glucat::clifford_algebra::operator|=
virtual multivector_t & operator|=(const multivector_t &rhs)=0
Transformation via twisted adjoint action.
glucat::operator/
const Multivector< Scalar_T, LO, HI > operator/(const Multivector< Scalar_T, LO, HI > &lhs, const Scalar_T &scr)
Quotient of multivector and scalar.
Definition: clifford_algebra_imp.h:298
glucat::clifford_algebra::max_abs
virtual Scalar_T max_abs() const =0
Maximum of absolute values of components of multivector: multivector infinity norm.
glucat::sinh
const Multivector< Scalar_T, LO, HI > sinh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic sine of multivector.
Definition: clifford_algebra_imp.h:855
glucat::clifford_algebra::even
virtual const multivector_t even() const =0
Even part of multivector, sum of even grade terms.
glucat::clifford_algebra::operator/=
virtual multivector_t & operator/=(const Scalar_T &scr)=0
Quotient of multivector and scalar.
glucat::clifford_algebra::odd
virtual const multivector_t odd() const =0
Odd part of multivector, sum of odd grade terms.
glucat::abs
Scalar_T abs(const Multivector< Scalar_T, LO, HI > &val)
Absolute value == sqrt(norm)
Definition: clifford_algebra_imp.h:520
glucat::sqrt
const Multivector< Scalar_T, LO, HI > sqrt(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Square root of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:618
glucat::clifford_algebra::isnan
virtual bool isnan() const =0
Check if a multivector contains any IEEE NaN values.
glucat::norm
Scalar_T norm(const Multivector< Scalar_T, LO, HI > &val)
Scalar_T norm == sum of norm of coordinates.
Definition: clifford_algebra_imp.h:512
glucat::clifford_algebra::operator*=
virtual multivector_t & operator*=(const Scalar_T &scr)=0
Product of multivector and scalar.
glucat::log
const Multivector< Scalar_T, LO, HI > log(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Natural logarithm of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:733
glucat::operator*
const Multivector< Scalar_T, LO, HI > operator*(const Multivector< Scalar_T, LO, HI > &lhs, const Scalar_T &scr)
Product of multivector and scalar.
Definition: clifford_algebra_imp.h:201
glucat::clifford_algebra::operator-=
virtual multivector_t & operator-=(const multivector_t &rhs)=0
Geometric difference.
glucat::quad
Scalar_T quad(const Multivector< Scalar_T, LO, HI > &val)
Scalar_T quadratic form == (rev(x)*x)(0)
Definition: clifford_algebra_imp.h:504
glucat::odd
const Multivector< Scalar_T, LO, HI > odd(const Multivector< Scalar_T, LO, HI > &val)
Odd part.
Definition: clifford_algebra_imp.h:464
glucat::operator&
const Multivector< Scalar_T, LO, HI > operator&(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Inner product.
Definition: clifford_algebra_imp.h:257
glucat::conj
const Multivector< Scalar_T, LO, HI > conj(const Multivector< Scalar_T, LO, HI > &val)
Conjugation, rev o invo == invo o rev.
Definition: clifford_algebra_imp.h:496
glucat::clifford_algebra::vector_part
virtual const vector_t vector_part() const =0
Vector part of multivector, as a vector_t with respect to frame()
glucat::clifford_exp
const Multivector< Scalar_T, LO, HI > clifford_exp(const Multivector< Scalar_T, LO, HI > &val)
Exponential of multivector.
Definition: clifford_algebra_imp.h:633
glucat::clifford_algebra::pow
virtual const multivector_t pow(int m) const =0
*this to the m
glucat
Definition: clifford_algebra.h:39
glucat::clifford_algebra::frame
virtual const index_set_t frame() const =0
Subalgebra generated by all generators of terms of given multivector.
glucat::clifford_algebra::write
virtual void write(const std::string &msg="") const =0
Write formatted multivector to output.
glucat::clifford_algebra::operator^=
virtual multivector_t & operator^=(const multivector_t &rhs)=0
Outer product.
glucat::clifford_algebra::multivector_t
Multivector_T multivector_t
Definition: clifford_algebra.h:105
glucat::clifford_algebra::truncated
virtual const multivector_t truncated(const Scalar_T &limit=Scalar_T(DEFAULT_TRUNCATION)) const =0
Remove all terms with relative size smaller than limit.
glucat::pow
const Multivector< Scalar_T, LO, HI > pow(const Multivector< Scalar_T, LO, HI > &lhs, int rhs)
Integer power of multivector.
Definition: clifford_algebra_imp.h:357
glucat::clifford_algebra::index_set_t
Index_Set_T index_set_t
Definition: clifford_algebra.h:104
glucat::sin
const Multivector< Scalar_T, LO, HI > sin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Sine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:901
glucat::clifford_algebra::operator()
virtual const multivector_t operator()(index_t grade) const =0
Pure grade-vector part.
glucat::atanh
const Multivector< Scalar_T, LO, HI > atanh(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse hyperbolic tangent of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:981
glucat::clifford_algebra::classname
static const std::string classname()
Definition: clifford_algebra_imp.h:95
glucat::clifford_algebra::~clifford_algebra
virtual ~clifford_algebra()
Definition: clifford_algebra.h:111
glucat::reverse
const Multivector< Scalar_T, LO, HI > reverse(const Multivector< Scalar_T, LO, HI > &val)
Reversion, eg. {1}*{2} -> {2}*{1}.
Definition: clifford_algebra_imp.h:488
glucat::clifford_algebra::vector_t
std::vector< Scalar_T > vector_t
Definition: clifford_algebra.h:107
glucat::cos
const Multivector< Scalar_T, LO, HI > cos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Cosine of multivector with specified complexifier.
Definition: clifford_algebra_imp.h:794
glucat::imag
Scalar_T imag(const Multivector< Scalar_T, LO, HI > &val)
Imaginary part: deprecated (always 0)
Definition: clifford_algebra_imp.h:440
glucat::tanh
const Multivector< Scalar_T, LO, HI > tanh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic tangent of multivector.
Definition: clifford_algebra_imp.h:962
glucat::clifford_algebra::grade
virtual index_t grade() const =0
Maximum of the grades of each term.
glucat::clifford_algebra::conj
virtual const multivector_t conj() const =0
Conjugation, reverse o involute == involute o reverse.
glucat::clifford_algebra::operator+=
virtual multivector_t & operator+=(const multivector_t &rhs)=0
Geometric sum.
glucat::operator^
const Multivector< Scalar_T, LO, HI > operator^(const Multivector< Scalar_T, LO, HI > &lhs, const RHS< Scalar_T, LO, HI > &rhs)
Outer product.
Definition: clifford_algebra_imp.h:242
glucat::outer_pow
const Multivector< Scalar_T, LO, HI > outer_pow(const Multivector< Scalar_T, LO, HI > &lhs, int rhs)
Outer product power of multivector.
Definition: clifford_algebra_imp.h:413
glucat::elliptic
const Multivector< Scalar_T, LO, HI > elliptic(const Multivector< Scalar_T, LO, HI > &val)
Definition: clifford_algebra_imp.h:586