Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB31F7712 for ; Thu, 28 Jul 2011 16:24:41 +0000 (UTC) Received: (qmail 49387 invoked by uid 500); 28 Jul 2011 16:24:41 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 49108 invoked by uid 500); 28 Jul 2011 16:24:40 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 49100 invoked by uid 99); 28 Jul 2011 16:24:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2011 16:24:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Yannick.Tanguy@cnes.fr designates 132.149.22.2 as permitted sender) Received: from [132.149.22.2] (HELO chappe.cnes.fr) (132.149.22.2) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 28 Jul 2011 16:24:32 +0000 Received: from cnes.fr by cnes.fr; Thu, 28 Jul 2011 18:24:11 +0200 (CEST) Received: from cnes.fr by cnes.fr; Thu, 28 Jul 2011 18:24:11 +0200 Received: from cnes.fr by cnes.fr; Thu, 28 Jul 2011 18:24:11 +0200 (CEST) Received: from cnes.fr by cnes.fr; Thu, 28 Jul 2011 18:23:51 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: [math] Adding a new class to handle Matrix with 3 columns/rows Date: Thu, 28 Jul 2011 18:23:50 +0200 Message-ID: <361FC7914008804ABCF286A3B003D0F6201219@cst-xch-004.cnesnet.ad.cnes.fr> In-reply-to: <4E303441.5070906@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [math] Adding a new class to handle Matrix with 3 columns/rows Thread-Index: AcxMdUkGEkGPTTfHQ9mfR9W90mzHHgAypSfQ References: <361FC7914008804ABCF286A3B003D0F6201121@cst-xch-004.cnesnet.ad.cnes.fr> <4E2FB7D3.3070507@free.fr> <361FC7914008804ABCF286A3B003D0F6201181@cst-xch-004.cnesnet.ad.cnes.fr> <20110727143005.GN2590@dusk.harfang.homelinux.org> <4E303441.5070906@gmail.com> From: "Tanguy Yannick" To: "Commons Developers List" X-OriginalArrivalTime: 28 Jul 2011 16:23:51.0643 (UTC) FILETIME=[BCBAA2B0:01CC4D42] X-Virus-Checked: Checked by ClamAV on apache.org On 7/27/11 7:30 AM, Gilles Sadowski wrote: >> Hello. >> >>>>> In project SIRIUS (CNES), we have some need for a Matrix33 (3=20 >>>>> columns, >>>>> 3 >>>>> rows) object. It is very common to use this kind of matrix to apply=20 >>>>> rotation to a position vector (vector3D). >>>>> >>>>> The incompatibility between the Vector3D of geometry package and=20 >>>>> the matrix/vectors of the linear package is a lack that we propose >>>>> to fill by creating a "Matrix33" in the geometry.threed package. >>>> Looks finie to me. >> Except for the name: "Matrix33" -> "Matrix3D". +1 : ok to call it Matrix3D. >> >>> [...] >>> >>>>> We will also propose some new constructors to build gaps between=20 >>>>> this new matrix and the matrix of linear package. >>>> Yes, having a way to change from one view to the other is a clear need. >>> Yes, we prefer to add a constructor from Array2DRowRealMatrix and a=20 >>> getter (that returns a Array2DRowRealMatrix) than to implement the=20 >>> whole interface RealMatrix >> There are not that many methods. It's preferable to implement "RealMatrix" >> lest there will be two API eveolving independently. > >+1 The key point here is that the matrix from linear package are not compatible with Vector3D.=20 -> This is the main point we wanted to solve by creating a new matrix class. So we have imagined three solutions :=20 a) inherit the RealMatrix, but we need to add a multiply(Vector3D v) method and some other methods b) create an adapter class which contains an Array2DRealMatrix : this may be heavy because we need to implement other methods c) create a rather small class with only a few methods that answer our needs (multiplication with Vector3D, transposition, ...). This class should also implement a specific constructor and a specific getter to fill the gap with the RealMatrix. =20 The other advantage of the c) solution is that it allows to implement faster operations.=20 Yannick > >> I'm sure that somebody will help implement the missing bits if necessary. >> >>> (or inherit the AbstractMatrix). >> At the moment, I tend to agree on this point, given what I've just=20 >> observed with this benchmark: > >+1 - the difference is expected, since AbstractRealMatrix has to use >getters/setters and Array2DRowRealMatrix can do direct array access. I guess to maximize reuse a) the array-based operations could be extracted into a static utils class somewhere and used by both impls or b) the new class could extend Array2DRowRealMatrix. > >Phil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org