From kreckel at thep.physik.uni-mainz.de Tue Feb 1 00:03:03 2005 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Tue Feb 1 00:03:03 2005 Subject: [GiNaC-devel] Crash during startup In-Reply-To: Message-ID: Dear Chris, On Mon, 24 Jan 2005, Chris Dams wrote: [...] > inside the libary_init constructor to produces usable exes. Then, when the > time comes that utils.o gets initialized, it would be best if these exes > were not touched. I do this by the dirty trick of self-asignment (or > rather, construction from self) as in > > const ex _ex120 = _ex120 Hmm, so this is not DR 363 because _ex120 has been initialized before? . Anyway, I'm getting convinced that your code is valid... Regards -richy. -- Richard B. Kreckel From C.Dams at science.ru.nl Tue Feb 1 11:00:04 2005 From: C.Dams at science.ru.nl (Chris Dams) Date: Tue Feb 1 11:00:04 2005 Subject: [GiNaC-devel] Crash during startup In-Reply-To: Message-ID: Dear Richy, On Tue, 1 Feb 2005, Richard B. Kreckel wrote: > > const ex _ex120 = _ex120 > > Hmm, so this is not DR 363 because _ex120 has been initialized before? Well it looks like this "DR 363" to me. With the small detail that _ex120 has sneakily been initialized before... ;-). > . > Anyway, I'm getting convinced that your code is valid... Well, I had some doubts about const ex _ex120 = _ex120; myself but the compiler did not mind. Now looking at this link, it appears that even the standardization committee likes it :-). Best wishes, Chris From C.Dams at science.ru.nl Wed Feb 2 16:04:08 2005 From: C.Dams at science.ru.nl (Chris Dams) Date: Wed Feb 2 16:04:08 2005 Subject: [GiNaC-devel] patch for integral::series. Message-ID: Dear developers, We, of course, do not want zero as a coefficient in a power series. However, my integral::series can give such a result. Here is a patch. Best wishes, Chris -------------- next part -------------- Index: ginac/pseries.cpp =================================================================== RCS file: /home/cvs/GiNaC/ginac/pseries.cpp,v retrieving revision 1.83 diff -c -r1.83 pseries.cpp *** ginac/pseries.cpp 29 Oct 2004 11:11:39 -0000 1.83 --- ginac/pseries.cpp 2 Feb 2005 14:55:19 -0000 *************** *** 1100,1111 **** fexpansion.reserve(fseries.nops()); for (size_t i=0; i(fseries).coeffop(i); ! fexpansion.push_back(expair( ! currcoeff == Order(_ex1) ! ? currcoeff ! : integral(x, a.subs(r), b.subs(r), currcoeff), ! ex_to(fseries).exponop(i) ! )); } // Expanding lower boundary --- 1100,1111 ---- fexpansion.reserve(fseries.nops()); for (size_t i=0; i(fseries).coeffop(i); ! currcoeff=(currcoeff == Order(_ex1)) ! ? currcoeff ! : integral(x, a.subs(r), b.subs(r), currcoeff); ! if(currcoeff!=0) ! fexpansion.push_back( ! expair(currcoeff,ex_to(fseries).exponop(i))); } // Expanding lower boundary From kisilv at maths.leeds.ac.uk Thu Feb 3 18:53:04 2005 From: kisilv at maths.leeds.ac.uk (Vladimir Kisil) Date: Thu Feb 3 18:53:04 2005 Subject: [GiNaC-devel] A patch to Clifford Message-ID: Hi, I am wondering is my patch submitted here on (Thu Dec 2 16:22:03 2004) was lost or rejected.... Best, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ From vollinga at thep.physik.uni-mainz.de Fri Feb 4 09:47:03 2005 From: vollinga at thep.physik.uni-mainz.de (Jens Vollinga) Date: Fri Feb 4 09:47:03 2005 Subject: [GiNaC-devel] A patch to Clifford In-Reply-To: References: Message-ID: <20050204084604.GA21110@thep.physik.uni-mainz.de> Hi, On Thu, Feb 03, 2005 at 05:48:29PM +0000, Vladimir Kisil wrote: > Hi, > > I am wondering is my patch submitted here on (Thu Dec 2 16:22:03 > 2004) was lost or rejected.... sorry, that patch got lost somehow. It will be applied soon and be part of the forthcoming 1.31 bux-fix release! Regards, Jens From Christian.Bauer at uni-mainz.de Sun Feb 6 14:26:04 2005 From: Christian.Bauer at uni-mainz.de (Christian Bauer) Date: Sun Feb 6 14:26:04 2005 Subject: [GiNaC-devel] patch for integral::series. In-Reply-To: References: Message-ID: <20050206132540.GE5621@thep.physik.uni-mainz.de> Hi! On Wed, Feb 02, 2005 at 03:55:53PM +0100, Chris Dams wrote: > We, of course, do not want zero as a coefficient in a power series. > However, my integral::series can give such a result. Here is a patch. Yup. Thanks! Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/ From kisilv at maths.leeds.ac.uk Mon Feb 7 12:37:03 2005 From: kisilv at maths.leeds.ac.uk (Vladimir Kisil) Date: Mon Feb 7 12:37:03 2005 Subject: [GiNaC-devel] Clifford patch (cumulative) Message-ID: Hi, I discovered that clifford_moebius_map() function was ignorant of representative labels for Clifford numbers, which generates misbehaviour. I include the cumulative patch which this issue along with the previous one. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ Index: doc/tutorial/ginac.texi =================================================================== RCS file: /home/cvs/GiNaC/doc/tutorial/ginac.texi,v retrieving revision 1.159 diff -r1.159 ginac.texi 3179,3180c3179,3181 < @samp{e~i e~j + e~j e~i = B(i, j)} for some symmetric matrix (@code{metric}) < @math{B(i, j)}. Such generators are created by the function --- > @samp{e~i e~j + e~j e~i = B(i, j)} for some matrix (@code{metric}) > @math{B(i, j)}, which may be non-symmetric. Such generators are created > by the function 3194a3196,3204 > If the matrix @math{B(i, j)} is in fact symmetric you may prefer to create > the Clifford algebra units with a call like that > > @example > ex e = clifford_unit(mu, indexed(B, sy_symm(), i, j)); > @end example > > since this may yield some further automatic simplifications. > 3336c3346,3347 < const ex & d, const ex & v, const ex & G); --- > const ex & d, const ex & v, const ex & G, unsigned char rl = 0); > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); 3341c3352 < (av+b)/(cv+d)} defined by the matrix @samp{[[a, b], [c, d]]}. The last --- > (av+b)/(cv+d)} defined by the matrix @samp{M = [[a, b], [c, d]]}. The Index: ginac/clifford.h =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.h,v retrieving revision 1.53 diff -r1.53 clifford.h 318,319c318,320 < * @param G Metric of the surrounding space */ < ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G); --- > * @param G Metric of the surrounding space > * @param rl Representation label*/ > ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl = 0); 326,327c327,329 < * @param G Metric of the surrounding space */ < ex clifford_moebius_map(const ex & M, const ex & v, const ex & G); --- > * @param G Metric of the surrounding space > * @param rl Representation label*/ > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); Index: ginac/clifford.cpp =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.cpp,v retrieving revision 1.82 diff -r1.82 clifford.cpp 1163c1163 < ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G) --- > ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl) 1178c1178 < x = lst_to_clifford(v, mu, G); --- > x = lst_to_clifford(v, mu, G, rl); 1184c1184 < ex clifford_moebius_map(const ex & M, const ex & v, const ex & G) --- > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G,unsigned char rl) 1188c1188 < ex_to(M)(1,0), ex_to(M)(1,1), v, G); --- > ex_to(M)(1,0), ex_to(M)(1,1), v, G, rl); From kreckel at thep.physik.uni-mainz.de Mon Feb 7 21:55:04 2005 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Mon Feb 7 21:55:04 2005 Subject: [GiNaC-devel] Clifford patch (cumulative) In-Reply-To: Message-ID: Dear Vladimir, On Mon, 7 Feb 2005, Vladimir Kisil wrote: > I discovered that clifford_moebius_map() function was ignorant > of representative labels for Clifford numbers, which generates > misbehaviour. I include the cumulative patch which this issue along > with the previous one. Your patch introduces an additional integer parameter to the two free functions GiNaC::clifford_moebius_map(..). As such, it changes the signature of the two functions and also the mangled name, rendering the library binary-incompatible. For this reason, your patch cannot be applied to the GiNaC-1.3 tree, where we strive for binary compatibility. It can, however, be applied to the GiNaC-1.4 tree, where binary compatibility to GiaC-1.3 is not a goal. Notice, that the additional integer parameter is really part of the mangled name and there is only one mangled name. The default value is inserted by the compiler, not the linker. You can, however, prepare another equivalent patch for inclusion in the GiNaC-1.3 tree by providing an additional function that has the additional parameter (without default). That would just add another signature, and not break binary compatibility. The library would then provide both the function ex clifford_moebius_map(const ex&, const ex&, const ex&, const ex&, const ex&, const ex&) as well as ex clifford_moebius_map(const ex&, const ex&, const ex&, const ex&, const ex&, const ex&, unsigned char) and similar for the other signature. Internally, you may implement the first function by delegating to the second function, if that is what you want to do. If you agree, could you send such a patch to the list, please? Best wishes -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Tue Feb 8 12:34:03 2005 From: kisilv at maths.leeds.ac.uk (Vladimir Kisil) Date: Tue Feb 8 12:34:03 2005 Subject: [GiNaC-devel] Clifford patch (cumulative) In-Reply-To: Your message of "Mon, 07 Feb 2005 21:53:21 +0100." Message-ID: Hi, I afraid that did not understand everything from the Richard email (since my programming skill are very weak) but here is the new patch. How could I know when v1.4 is out in order to revert to the first more natural solution? Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ Index: doc/tutorial/ginac.texi =================================================================== RCS file: /home/cvs/GiNaC/doc/tutorial/ginac.texi,v retrieving revision 1.159 diff -r1.159 ginac.texi 3179,3180c3179,3181 < @samp{e~i e~j + e~j e~i = B(i, j)} for some symmetric matrix (@code{metric}) < @math{B(i, j)}. Such generators are created by the function --- > @samp{e~i e~j + e~j e~i = B(i, j)} for some matrix (@code{metric}) > @math{B(i, j)}, which may be non-symmetric. Such generators are created > by the function 3194a3196,3204 > If the matrix @math{B(i, j)} is in fact symmetric you may prefer to create > the Clifford algebra units with a call like that > > @example > ex e = clifford_unit(mu, indexed(B, sy_symm(), i, j)); > @end example > > since this may yield some further automatic simplifications. > 3336c3346,3347 < const ex & d, const ex & v, const ex & G); --- > const ex & d, const ex & v, const ex & G, unsigned char rl = 0); > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl = 0); 3341c3352 < (av+b)/(cv+d)} defined by the matrix @samp{[[a, b], [c, d]]}. The last --- > (av+b)/(cv+d)} defined by the matrix @samp{M = [[a, b], [c, d]]}. The Index: ginac/clifford.h =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.h,v retrieving revision 1.53 diff -r1.53 clifford.h 318c318,320 < * @param G Metric of the surrounding space */ --- > * @param G Metric of the surrounding space > * @param rl Representation label*/ > ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl); 326c328,330 < * @param G Metric of the surrounding space */ --- > * @param G Metric of the surrounding space > * @param rl Representation label*/ > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl); Index: ginac/clifford.cpp =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.cpp,v retrieving revision 1.82 diff -r1.82 clifford.cpp 1163c1163 < ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G) --- > ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G, unsigned char rl) 1178c1178 < x = lst_to_clifford(v, mu, G); --- > x = lst_to_clifford(v, mu, G, rl); 1184c1184 < ex clifford_moebius_map(const ex & M, const ex & v, const ex & G) --- > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G,unsigned char rl) 1188c1188 < ex_to(M)(1,0), ex_to(M)(1,1), v, G); --- > ex_to(M)(1,0), ex_to(M)(1,1), v, G, rl); 1191a1192,1196 > > ex clifford_moebius_map(const ex & M, const ex & v, const ex & G) { > return clifford_moebius_map(M, v, G, 0); } > ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d, const ex & v, const ex & G) { > return clifford_moebius_map(a, b, c, d, v, G, 0); } From kreckel at thep.physik.uni-mainz.de Thu Feb 10 01:10:03 2005 From: kreckel at thep.physik.uni-mainz.de (Richard B. Kreckel) Date: Thu Feb 10 01:10:03 2005 Subject: [GiNaC-devel] Clifford patch (cumulative) In-Reply-To: Message-ID: Hi, On Tue, 8 Feb 2005, Vladimir Kisil wrote: > I afraid that did not understand everything from the Richard > email (since my programming skill are very weak) but here is the new > patch. That patch forgot to declare the functions without the representation labels, thus breaking the API: You won't be able to compile a program omitting rl. I've added the two signatures. This way, binary compatibility should be preserved. > How could I know when v1.4 is out in order to revert to the first > more natural solution? Don't worry. I've applied your original patch with rl = 0 to HEAD and the modified patch with the added signatures to the 1.3 branch. This way, the more natural solution will eventually be there when GiNaC-1.4 comes out while a simple recompile of applications should suffice, since the programming interface is the same. Oh, you'll know when 1.4 is out when you see a grand announcemnt. ;-) Regards -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Wed Feb 23 12:19:32 2005 From: kisilv at maths.leeds.ac.uk (Vladimir Kisil) Date: Wed, 23 Feb 2005 11:19:32 +0000 Subject: [GiNaC-devel] clifford patch Message-ID: Dear All, I propose some further patches related to Clifford numbers. They are 1. LaTeX printing of Clifford object includes the command \clifford[rl] which make a use of the representation labels for separation of different algebras. 2. Alternative forms for functions lst_to_clifford() and clifford_moebius_map() which may got the structure of Clifford algebra out of a sample Clifford unit. The changes are reflected in documentation (which also slightly polished) and in the exam_clifford.cpp. All the best, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ Index: doc/tutorial/ginac.texi =================================================================== RCS file: /home/cvs/GiNaC/doc/tutorial/ginac.texi,v retrieving revision 1.161 diff -r1.161 ginac.texi 3178,3179c3178,3188 < generators @samp{e~k} satisfying the identities < @samp{e~i e~j + e~j e~i = B(i, j)} for some matrix (@code{metric}) --- > generators > @tex $e_k$ > @end tex > satisfying the identities > @tex > $e_i e_j + e_j e_i = B(i, j) $ > @end tex > @ifnottex > e~i e~j + e~j e~i = B(i, j) > @end ifnottex > for some matrix (@code{metric}) 3223a3233,3236 > @tex > $e_0^2=1 $, $e_1^2=-1$ and $e_2^2=0$. > @end tex > @ifnottex 3224a3238 > @end ifnottex 3231a3246 > ex lst_to_clifford(const ex & v, const ex & e); 3234,3237c3249,3268 < which converts a list or vector @samp{v = (v~0, v~1, ..., v~n)} into < the Clifford number @samp{v~0 e.0 + v~1 e.1 + ... + v~n e.n} with @samp{e.k} < being created by @code{clifford_unit(mu, metr, rl)}. The previous code < may be rewritten with the help of @code{lst_to_clifford()} as follows --- > which converts a list or vector > @tex > $v = (v^0, v^1, ..., v^n)$ > @end tex > @ifnottex > @samp{v = (v~0, v~1, ..., v~n)} > @end ifnottex > into the > Clifford number > @tex > $v^0 e_0 + v^1 e_1 + ... + v^n e_n$ > @end tex > @ifnottex > @samp{v~0 e.0 + v~1 e.1 + ... + v~n e.n} > @end ifnottex > with @samp{e.k} > directly supplied in the second form of the procedure. In the first form > the Clifford unit @samp{e.k} is generated by the call of > @code{clifford_unit(mu, metr, rl)}. The previous code may be rewritten > with the help of @code{lst_to_clifford()} as follows 3261,3262c3292,3305 < @samp{v = (v~0, v~1, ..., v~n)} such that @samp{e = v~0 c.0 + v~1 c.1 + ... < + v~n c.n} with respect to the given Clifford units @code{c} and none of --- > @tex > $v = (v^0, v^1, ..., v^n)$ > @end tex > @ifnottex > @samp{v = (v~0, v~1, ..., v~n)} > @end ifnottex > such that > @tex > $e = v^0 c_0 + v^1 c_1 + ... + v^n c_n$ > @end tex > @ifnottex > @samp{e = v~0 c.0 + v~1 c.1 + ... + v~n c.n} > @end ifnottex > with respect to the given Clifford units @code{c} and none of 3266c3309,3315 < @samp{(e c.k + c.k e)/pow(c.k, 2)}. If @samp{pow(c.k, 2) = 0} for some @samp{k} --- > @tex > $(e c_k + c_k e)/c_k^2$. If $c_k^2=0$ > @end tex > @ifnottex > @samp{(e c.k + c.k e)/pow(c.k, 2)}. If @samp{pow(c.k, 2) = 0} > @end ifnottex > for some @samp{k} 3292a3342,3344 > @ifnottex > e* > @end ifnottex 3296a3349,3351 > @ifnottex > @code{\bar@{e@}} > @end ifnottex 3309c3364 < $||e||^2 = e\overline{e}$ --- > $||e||^2 = e\overline{e}$. 3311,3312c3366,3369 < . The inverse of a Clifford expression is returned < by the function --- > @ifnottex > @code{||e||^2 = e \bar@{e@}} > @end ifnottex > The inverse of a Clifford expression is returned by the function 3320c3377 < $e^{-1} = e/||e||^2$ --- > $e^{-1} = \overline{e}/||e||^2$. 3322c3379,3382 < . If --- > @ifnottex > @math{e^@{-1@} = \bar@{e@}/||e||^2} > @end ifnottex > If 3325a3386,3388 > @ifnottex > @math{||e||=0} > @end ifnottex 3350,3354c3413,3418 < It takes a list or vector @code{v} and makes the Moebius < (conformal or linear-fractional) transformation @samp{v -> < (av+b)/(cv+d)} defined by the matrix @samp{M = [[a, b], [c, d]]}. The < parameter @code{G} defines the metric of the surrounding < (pseudo-)Euclidean space. The returned value of this function is a list --- > It takes a list or vector @code{v} and makes the Moebius (conformal or > linear-fractional) transformation @samp{v -> (av+b)/(cv+d)} defined by > the matrix @samp{M = [[a, b], [c, d]]}. The parameter @code{G} defines > the metric of the surrounding (pseudo-)Euclidean space. This can be a > matrix or a Clifford unit, in the later case the parameter @code{rl} is > ignored even if supplied. The returned value of this function is a list 3356a3421,3453 > LaTeX output for Clifford units looks like @code{\clifford[1]@{e@}^@{@{\nu@}@}}, > where @code{1} is the @code{representation_label} and @code{\nu} is the > index of the corresponding unit. This provides a flexible typesetting > with a suitable defintion of the @code{\clifford} command. For example, the > definition > @example > \newcommand@{\clifford@}[1][]@{@} > @end example > typesets all Clifford units identically, while the alternative definition > @example > \newcommand@{\clifford@}[2][]@{\ifcase #1 #2\or \tilde@{#2@} \or \breve@{#2@} \fi@} > @end example > prints units with @code{representation_label=0} as > @tex > $e$, > @end tex > @ifnottex > @code{e}, > @end ifnottex > with @code{representation_label=1} as > @tex > $\tilde{e}$ > @end tex > @ifnottex > @code{\tilde@{e@}} > @end ifnottex > and with @code{representation_label=2} as > @tex > $\breve{e}$. > @end tex > @ifnottex > @code{\breve@{e@}}. > @end ifnottex Index: ginac/clifford.h =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.h,v retrieving revision 1.55 diff -r1.55 clifford.h 292a293 > * @param e Clifford unit object 294a296 > ex lst_to_clifford(const ex & v, const ex & e); 304c306,307 < * @param algebraic Use algebraic or symbolic algorithm for extractions */ --- > * @param algebraic Use algebraic or symbolic algorithm for extractions > * @return List of components of a Clifford vector*/ 318,319c321,323 < * @param G Metric of the surrounding space < * @param rl Representation label */ --- > * @param G Metric of the surrounding space, may be a Clifford unit then the next parameter is ignored > * @param rl Representation label > * @return List of components of the transformed vector*/ 327,328c331,333 < * @param G Metric of the surrounding space < * @param rl Representation label */ --- > * @param G Metric of the surrounding space, may be a Clifford unit then the next parameter is ignored > * @param rl Representation label > * @return List of components of the transformed vector*/ Index: ginac/clifford.cpp =================================================================== RCS file: /home/cvs/GiNaC/ginac/clifford.cpp,v retrieving revision 1.84 diff -r1.84 clifford.cpp 216c216,217 < } else --- > } else { > c.s << "\\clifford[" << int(representation_label) << "]"; 217a219 > } 227c229 < DEFAULT_PRINT_LATEX(diracone, "ONE", "\\mathbb{1}") --- > DEFAULT_PRINT_LATEX(diracone, "ONE", "\\mathbf{1}") 1046d1047 < unsigned min, max; 1049,1050c1050,1052 < unsigned dim = (ex_to(ex_to(mu).get_dim())).to_int(); < ex c = clifford_unit(mu, metr, rl); --- > ex e = clifford_unit(mu, metr, rl); > return lst_to_clifford(v, e); > } 1052,1063c1054,1071 < if (is_a(v)) { < if (ex_to(v).cols() > ex_to(v).rows()) { < min = ex_to(v).rows(); < max = ex_to(v).cols(); < } else { < min = ex_to(v).cols(); < max = ex_to(v).rows(); < } < if (min == 1) { < if (dim == max) < if (is_a(mu)) // need to swap variance < return indexed(v, ex_to(mu).toggle_variance()) * c; --- > ex lst_to_clifford(const ex & v, const ex & e) { > unsigned min, max; > > if (is_a(e)) { > varidx mu = ex_to(e.op(1)); > unsigned dim = (ex_to(mu.get_dim())).to_int(); > > if (is_a(v)) { > if (ex_to(v).cols() > ex_to(v).rows()) { > min = ex_to(v).rows(); > max = ex_to(v).cols(); > } else { > min = ex_to(v).cols(); > max = ex_to(v).rows(); > } > if (min == 1) { > if (dim == max) > return indexed(v, ex_to(mu).toggle_variance()) * e; 1065c1073,1078 < return indexed(v, mu) * c; --- > throw(std::invalid_argument("Dimensions of vector and clifford unit mismatch")); > } else > throw(std::invalid_argument("First argument should be a vector vector")); > } else if (is_a(v)) { > if (dim == ex_to(v).nops()) > return indexed(matrix(dim, 1, ex_to(v)), ex_to(mu).toggle_variance()) * e; 1067c1080 < throw(std::invalid_argument("Dimensions of vector and clifford unit mismatch")); --- > throw(std::invalid_argument("List length and dimension of clifford unit mismatch")); 1069,1074c1082 < throw(std::invalid_argument("First argument should be a vector vector")); < } else if (is_a(v)) { < if (dim == ex_to(v).nops()) < return indexed(matrix(dim, 1, ex_to(v)), ex_to(mu).toggle_variance()) * c; < else < throw(std::invalid_argument("List length and dimension of clifford unit mismatch")); --- > throw(std::invalid_argument("Cannot construct from anything but list or vector")); 1076c1084 < throw(std::invalid_argument("Cannot construct from anything but list or vector")); --- > throw(std::invalid_argument("The second argument should be a Clifford unit")); 1165,1171c1173 < ex x, D; < if (is_a(G)) < D = ex_to(G.op(1)).get_dim(); < else if (is_a(G)) < D = ex_to(G).rows(); < else < throw(std::invalid_argument("metric should be an indexed object or matrix")); --- > ex x, D, cu; 1173,1174d1174 < varidx mu((new symbol)->setflag(status_flags::dynallocated), D); < 1176a1177,1189 > > if (is_a(G)) { > cu = G; > } else { > if (is_a(G)) > D = ex_to(G.op(1)).get_dim(); > else if (is_a(G)) > D = ex_to(G).rows(); > else throw(std::invalid_argument("metric should be an indexed object, matrix, or a Clifford unit")); > > varidx mu((new symbol)->setflag(status_flags::dynallocated), D); > cu = clifford_unit(mu, G, rl); > } 1178c1191 < x = lst_to_clifford(v, mu, G, rl); --- > x = lst_to_clifford(v, cu); 1180d1192 < ex cu = clifford_unit(mu, G); Index: check/exam_clifford.cpp =================================================================== RCS file: /home/cvs/GiNaC/check/exam_clifford.cpp,v retrieving revision 1.23 diff -r1.23 exam_clifford.cpp 344c344,345 < e = lst_to_clifford(lst(t, x, y, z), mu, G) * lst_to_clifford(lst(1, 2, 3, 4), nu, G); --- > ex c = clifford_unit(nu, G, 1); > e = lst_to_clifford(lst(t, x, y, z), mu, G, 1) * lst_to_clifford(lst(1, 2, 3, 4), c); 346c347 < result += check_equal((e*e1).simplify_indexed().normal(), dirac_ONE()); --- > result += check_equal((e*e1).simplify_indexed().normal(), dirac_ONE(1));