From jrheinlaender at gmx.de Sat Nov 2 12:11:06 2024 From: jrheinlaender at gmx.de (=?UTF-8?Q?Jan_Rheinl=C3=A4nder?=) Date: Sat, 2 Nov 2024 12:11:06 +0100 Subject: [GiNaC-devel] Find length of a vector Message-ID: <3529e995-0b49-4dcd-9737-ee4aed545cd2@gmx.de> Hi, trying to find the length of a vector by taking the square root of the scalar product, I get this (in ginsh): > v = [[a,b]]; [[a,b]] > r = sqrt(v * transpose(v)); sqrt([[a,b]]*[[a],[b]]) > evalm(r); matrix::pow(): don't know how to handle exponent The reason is that the scalar product evaluates to a matrix with a single element, not to a numeric. Is that intended? Thanks, Jan Rheinl?nder -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 321 bytes Desc: OpenPGP digital signature URL: From kreckel at in.terlu.de Sat Nov 2 12:31:21 2024 From: kreckel at in.terlu.de (Richard B. Kreckel) Date: Sat, 2 Nov 2024 12:31:21 +0100 Subject: [GiNaC-devel] Find length of a vector In-Reply-To: <3529e995-0b49-4dcd-9737-ee4aed545cd2@gmx.de> References: <3529e995-0b49-4dcd-9737-ee4aed545cd2@gmx.de> Message-ID: <08bd21ec-56a1-47e8-b0e4-b816b32903be@in.terlu.de> Hi, On 11/2/24 12:11 PM, Jan Rheinl?nder via GiNaC-devel wrote: > trying to find the length of a vector by taking the square root of the > scalar product, I get this (in ginsh): > >> v = [[a,b]]; > [[a,b]] > > r = sqrt(v * transpose(v)); > sqrt([[a,b]]*[[a],[b]]) > > evalm(r); > matrix::pow(): don't know how to handle exponent > > The reason is that the scalar product evaluates to a matrix with a > single element, not to a numeric. There are just matrix products evaluating to matrices. There is no special case for scalar products (apart from the quite special stuff in indexed.h). > Is that intended? Well, it's the way it is designed. ;-) -richy. -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: From git at ginac.de Tue Nov 26 00:33:47 2024 From: git at ginac.de (git service) Date: Tue, 26 Nov 2024 00:33:47 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch master updated. release_1-4-0-779-g32702f84 Message-ID: <20241125233347.D0379D81824@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 32702f847fb49da649f4362b0de3084890ac8129 (commit) from 0aa0a0c6fe7d24fdc41af01581e8728054393740 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 32702f847fb49da649f4362b0de3084890ac8129 Author: Richard Kreckel Date: Tue Nov 26 00:21:28 2024 +0100 Avoid "expression with side effects..." warning using ex_to(). Clang++ warns that instantiations of this inline template function ex_to(const ex &) are "expression with side effects [that] will be evaluated despite being used as an operand to 'typeid'". Let's declare this ex_to() as a pure function (i.e. having no side effects) for compilers which support __attribute__((__pure__)). GCC seems to support this attribute since more than ten years. ----------------------------------------------------------------------- Summary of changes: ginac/compiler.h | 2 ++ ginac/ex.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations