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 4551F51CF for ; Tue, 10 May 2011 15:19:07 +0000 (UTC) Received: (qmail 46352 invoked by uid 500); 10 May 2011 15:19:06 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 46273 invoked by uid 500); 10 May 2011 15:19:06 -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 46265 invoked by uid 99); 10 May 2011 15:19:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 May 2011 15:19:06 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 129.104.30.34 is neither permitted nor denied by domain of sebastien.brisard@m4x.org) Received: from [129.104.30.34] (HELO mx1.polytechnique.org) (129.104.30.34) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 May 2011 15:19:00 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Org-Mail: sebastien.brisard.1997@polytechnique.org From: "Sebastien Brisard" Subject: Re: [math] Exceptions for matrix operations To: dev@commons.apache.org Message-Id: <20110510151838.0292C14059823@svoboda.polytechnique.org> Date: Tue, 10 May 2011 17:18:37 +0200 (CEST) > [...] > The question is thus: Is it OK to provide pointless methods? > I also wonder whether it is reasonable to _generate_ state variables just > so that the accessors can return them. > Usually, when a exception is constructed, it is _passed_ data that provide > the context of the failure (i.e. the vectors or the indices that show the > problem). > In this case, if the test (that triggered the exception) was not performed > using vectors, it looks quite strange to be able to retrieve vectors... > > > Gilles > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > OK, Gilles, sorry, I do not want to offend anyone, nor do I think I'm the best judge of all solutions proposed so far. I agree that constructing vectors just for the sake of having one exception inherit from another is far-fetched. I'm actually impressed by the depth of the discussions! You all DO think a lot about the overall design of this library (well, I guess you have too, but still). So if I understand correctly, we are back to one base classe which does pretty much nothing, and two derived exceptions 1. one raised when coefficients of the matrix are accessible, and a(i,j) != a(j,i) (within a specified tolerance), 2. one raised when coefficients of the matrix are not accessible, and x'.A.y != y'.A.x So we still need a little bit of terminology there... For your information, I've decided to call (for lack of a better name) LargeRealMatrix the interface corresponding to matrices defined only by their matrix-vector product y = A.x. These objects are the basic brick of the iterative solvers I'm implementing. If we agree that a LargeRealMatrix is only defined by this product, then a symmetric, large matrix must be defined as x'.A.y = y'.A.x. (This is actually the mathematical definition of an adjoint operator). Then, it would be logical to call the corresponding exception NotASymmetricLargeMatrix, would it not? Alternatives might be LinearMap, LinearOperator, since we actually define the matrix A as a function x\mapsto y = A.x, here. So, it's pretty much your call. You tell me, and I'll update my sources before comitting them. You can then decide wether it's worth including in commons-math. Best regards for now, Sébastien --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org