glucat 0.12.0
glucat.pxd
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2# cython: language_level=3
3#
4# PyClical: Python interface to GluCat:
5# Generic library of universal Clifford algebra templates
6#
7# glucat.pxd: Basic Cython definitions
8# corresponding to C++ definitions from PyClical.h.
9# Kept as a separate module from PyClical.pxd to avoid namespace clashes.
10#
11# copyright : (C) 2008-2012 by Paul C. Leopardi
12#
13# This library is free software: you can redistribute it and/or modify
14# it under the terms of the GNU Lesser General Public License as published
15# by the Free Software Foundation, either version 3 of the License, or
16# (at your option) any later version.
17#
18# This library is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU Lesser General Public License for more details.
22#
23# You should have received a copy of the GNU Lesser General Public License
24# along with this library. If not, see <http://www.gnu.org/licenses/>.
25
26from libcpp.vector cimport vector
27
28cdef extern from "PyClical.h":
29
30 cdef cppclass String:
31 char* c_str()
32
33 cdef cppclass IndexSet:
34 IndexSet ()
35 IndexSet (IndexSet Ist) except+
36 IndexSet (int idx) except+
37 IndexSet (char* str) except+
38 inline bint operator==(IndexSet Rhs)
39 inline bint operator!=(IndexSet Rhs)
40 inline bint operator<(IndexSet Rhs)
41 inline IndexSet invert "operator~"()
42 inline bint getitem "operator[]"(int idx)
43 inline IndexSet set()
44 inline IndexSet set(int idx) except+
45 inline IndexSet set(int idx, int val) except+
46 inline IndexSet reset()
47 inline IndexSet reset(int idx) except+
48 int count()
49 int count_pos()
50 int count_neg()
51 int min()
52 int max()
53 int sign_of_mult(IndexSet Rhs)
54 int sign_of_square()
55 int hash_fn()
56
57 int compare(IndexSet Lhs, IndexSet Rhs)
58 int min_neg(IndexSet Ist)
59 int max_pos(IndexSet Ist)
60
61 ctypedef double scalar_t
62
63 cdef cppclass Clifford:
64 Clifford ()
65 Clifford (Clifford Clf) except+
66 Clifford (Clifford Clf, IndexSet ist) except+
67 Clifford (scalar_t scr) except+
68 Clifford (char* str) except+
69 Clifford (IndexSet ist, scalar_t scr) except+
70 Clifford (vector[scalar_t] vec, IndexSet ist) except+
71 bint operator==(Clifford Rhs)
72 bint operator!=(Clifford Rhs)
73 Clifford neg "operator-"()
74 scalar_t getitem "operator[]"(IndexSet Ist)
75 Clifford call "operator()"(int grade)
76 scalar_t scalar()
77 Clifford pure()
78 Clifford even()
79 Clifford odd()
80 vector[scalar_t] vector_part()
81 vector[scalar_t] vector_part(IndexSet frm) except+
82 Clifford involute()
83 Clifford reverse()
84 Clifford conj()
85 Clifford random(IndexSet Ist, scalar_t fill)
86 scalar_t norm()
87 scalar_t quad()
88 IndexSet frame()
89 scalar_t max_abs()
90 Clifford inv()
91 Clifford pow(int m)
92 Clifford outer_pow(int m)
93 Clifford truncated(scalar_t limit)
94 bint isinf()
95 bint isnan()
96 void write(char* msg)
97
98 scalar_t error_squared_tol(Clifford Clf)
99 scalar_t error_squared(Clifford Lhs, Clifford Rhs, scalar_t threshold)
100 bint approx_equal(Clifford Lhs, Clifford Rhs, scalar_t threshold, scalar_t tol)
101 scalar_t scalar(Clifford Clf)
102 scalar_t real(Clifford Clf)
103 scalar_t imag(Clifford Clf)
104 Clifford pure(Clifford Clf)
105 Clifford even(Clifford Clf)
106 Clifford odd(Clifford Clf)
107 Clifford involute(Clifford Clf)
108 Clifford reverse(Clifford Clf)
109 Clifford conj(Clifford Clf)
110 scalar_t norm(Clifford Clf)
111 scalar_t abs(Clifford Clf)
112 scalar_t max_abs(Clifford Clf)
113 scalar_t quad(Clifford Clf)
114 Clifford inv(Clifford Clf)
115 Clifford pow(Clifford Clf,int m)
116 Clifford outer_pow(Clifford Clf,int m)
117
118 Clifford complexifier(Clifford Clf)
119 Clifford sqrt(Clifford Clf, Clifford I) except+
120 Clifford sqrt(Clifford Clf)
121 Clifford exp(Clifford Clf)
122 Clifford log(Clifford Clf, Clifford I) except+
123 Clifford log(Clifford Clf)
124 Clifford cos(Clifford Clf, Clifford I) except+
125 Clifford cos(Clifford Clf)
126 Clifford acos(Clifford Clf, Clifford I) except+
127 Clifford acos(Clifford Clf)
128 Clifford cosh(Clifford Clf)
129 Clifford acosh(Clifford Clf, Clifford I) except+
130 Clifford acosh(Clifford Clf)
131 Clifford sin(Clifford Clf, Clifford I) except+
132 Clifford sin(Clifford Clf)
133 Clifford asin(Clifford Clf, Clifford I) except+
134 Clifford asin(Clifford Clf)
135 Clifford sinh(Clifford Clf)
136 Clifford asinh(Clifford Clf, Clifford I) except+
137 Clifford asinh(Clifford Clf)
138 Clifford tan(Clifford Clf, Clifford I) except+
139 Clifford tan(Clifford Clf)
140 Clifford atan(Clifford Clf, Clifford I) except+
141 Clifford atan(Clifford Clf)
142 Clifford tanh(Clifford Clf)
143 Clifford atanh(Clifford Clf, Clifford I) except+
144 Clifford atanh(Clifford Clf)
145
146cdef extern from "PyClical.h" namespace "cga3":
147 Clifford agc3(Clifford Clf)
148 Clifford cga3(Clifford Clf)
149 Clifford cga3std(Clifford Clf)
Definitions for 3D Conformal Geometric Algebra [DL].
Definition: PyClical.h:100