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 EC234188D5 for ; Wed, 30 Dec 2015 21:28:26 +0000 (UTC) Received: (qmail 87863 invoked by uid 500); 30 Dec 2015 21:28:26 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 87718 invoked by uid 500); 30 Dec 2015 21:28:26 -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 87706 invoked by uid 99); 30 Dec 2015 21:28:26 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2015 21:28:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 98EB418050A for ; Wed, 30 Dec 2015 21:28:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.655 X-Spam-Level: X-Spam-Status: No, score=-0.655 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.554, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=spaceroots.org Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id YDYe7Csjn_Uf for ; Wed, 30 Dec 2015 21:28:23 +0000 (UTC) Received: from smtp.spaceroots.org (smtp.spaceroots.org [80.67.176.229]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id EBA65429C4 for ; Wed, 30 Dec 2015 21:28:22 +0000 (UTC) Received: from [192.168.163.2] (lehrin.spaceroots.org [192.168.163.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.spaceroots.org (Postfix) with ESMTPSA id 3CFF7540A0 for ; Wed, 30 Dec 2015 22:28:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spaceroots.org; s=mail; t=1451510899; bh=/YMrqFWYjzSFPT3eJHODF97wbSY4VQX+7u3O0Iehd18=; h=Subject:To:References:From:Date:In-Reply-To; b=q7iRVdQ73OcdovVai5MtSj3Yvi8RDxVDVbLC6V5JqiThWGtSe6iZCqS5ZlCll2EKr CkMvQhV05X2VcBx82cQ9WgKL1y3+DaouEj4zIpJhhOCrSoRBKC3meVjiMulTstP5Pf bfNGJh1DxIx/m5JZdFdQ6WnqlQpgT45IuNFPrq4I= Subject: Re: [math] RealMatrixPreservingVisitor and RealMatrixChangingVisitor the same? To: Commons Developers List References: <56836911.7060905@gmail.com> <5683AA20.8020003@spaceroots.org> <56842E08.7020302@gmail.com> From: Luc Maisonobe X-Enigmail-Draft-Status: N1110 Message-ID: <56844C72.8070401@spaceroots.org> Date: Wed, 30 Dec 2015 22:28:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.4.0 MIME-Version: 1.0 In-Reply-To: <56842E08.7020302@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Le 30/12/2015 20:18, Ole Ersoy a écrit : > Hi Luc, > > On 12/30/2015 03:55 AM, Luc Maisonobe wrote: >> Le 30/12/2015 06:18, Ole Ersoy a écrit : >>> Hi, >> Hi Ole, >> >>> RealMatrixPreservingVisitor and RealMatrixChangingVisitor files look >>> identical with the exception of a single @see Default... annotation >>> (Which I think is redundant...same as > All known implementing >>> classes...?). Would it make sense to remove the annotation and have ons >>> RealMatrixChangingVisitor extend RealMatrixPreservingVisitor? >> No. They are different and used for different things. >> The visit method returns void in one case and double in another >> case. When it returns double, this double is used to update >> the matrix that is visited, hence the "Changing" nature of the >> visitor. > Aha - Figured I was missing something - thanks for explaining. What do > you think about removing the @see annotation (IIUC javadoc generates a > link to implementing classes) and having the changing visitor extend the > preserving one while overriding `visit()`? This would defeat the purpose of the overloaded signatures for the various walk methods in RealMatrix. There would also be an ambiguity when calling visit and ignoring the returned value: would it be a call to the void method in the super interface or a call to the new method in the lower interface? I don't even think it is possible to override something based only on the return type. > > Also could you help me understand what the start() and() end methods are > for? Is there some test code I can look at (I did scan > BlockRealMatrixTest)? These methods are used before and after the walk. They are typically used for initialization for the first one and to gather some results for the second one. You can see an exemple in the Adams-Moulton ODE integrator (package org.apache.commons.math[34].ode.nonstiff. There is an internal class named Corrector that implements RealMatrixPreservingVisitor. best regards, Luc > > Cheers, > Ole > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org