Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 75EFC200BEF for ; Wed, 4 Jan 2017 15:56:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 74516160B3A; Wed, 4 Jan 2017 14:56:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BE89B160B39 for ; Wed, 4 Jan 2017 15:56:20 +0100 (CET) Received: (qmail 16832 invoked by uid 500); 4 Jan 2017 14:56:19 -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 16819 invoked by uid 99); 4 Jan 2017 14:56:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2017 14:56:19 +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 CF1631804AE for ; Wed, 4 Jan 2017 14:56:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=scarlet.be Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5sYJQPYDBumc for ; Wed, 4 Jan 2017 14:56:17 +0000 (UTC) Received: from hel.is.scarlet.be (hel.is.scarlet.be [193.74.71.26]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 76A725F24E for ; Wed, 4 Jan 2017 14:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1483541776; bh=YBB8wwfy/ieCTaXLutaNNwFIJSOD2gsWoLVP5Q/5g0w=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Subject:In-Reply-To:References:Message-ID; b=rMfyuOeIkAWGel+YRNH5rC7LbjuK9EGkKT7YWbFKTEyyfQFYWIoiwV2JHpOn2GdBo z4fQ6s0ed+qI8C43/QXNFfN7SA/9LPt81ZoM9KR/uQ35kIeDYJIf+2noVX/qKUhr7x goOjSLQtznul26kpDHTWD8tvrLsprshXotk6WmM0= Received: from webmail.scarlet.be (gresham.is.scarlet.be [193.74.71.215]) by hel.is.scarlet.be (8.14.9/8.14.9) with ESMTP id v04EuFFP014654 for ; Wed, 4 Jan 2017 15:56:16 +0100 X-Scarlet: d=1483541776 c=193.74.71.215 Received: from ip-213-49-227-218.dsl.scarlet.be ([213.49.227.218]) via ip-213-49-227-218.dsl.scarlet.be ([213.49.227.218]) by webmail.scarlet.be with HTTP (HTTP/1.1 POST); Wed, 04 Jan 2017 15:56:15 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 04 Jan 2017 15:56:15 +0100 From: Gilles To: Subject: [complex] Re: First commit to commons-complex git page In-Reply-To: References: Message-ID: <72c1d86dd7533b9356c12c54b6e640de@scarlet.be> X-Sender: gilles@harfang.homelinux.org User-Agent: Scarlet Webmail X-DCC-scarlet.be-Metrics: hel; whitelist X-Virus-Scanned: clamav-milter 0.98.1-exp at hel X-Virus-Status: Clean archived-at: Wed, 04 Jan 2017 14:56:21 -0000 Hi Eric. On Wed, 4 Jan 2017 11:14:40 +0100, Eric Barnhill wrote: > To enable others to work on the code, I have posted the first commit > to > commons-complex. Thanks. > > Please note that the code compiles but does not yet pass mvn test. > This is > what I am working on right now. > > Between replacing Precision.equals() type methods with private local > equals() methods for each class, and also replacing the customized > math > exceptions with more generic ones (such as IllegalStateException) and > only > using custom strings, I have apparently created a library that does > not > handle null very well. You also did what Gary warned against; see e.g. "ComplexUtils" (line 1406). > I am happy to keep plugging away on these testing issues as they help > me > learn more about the math library as currently structured; Better to let us know what you plan to do; thus others can work on other things. Also, now is a good time to change whatever needs to (rather than only port code from one repository to the other). > however the > learning curve gets a little steep at times Perhaps a sign that the design is not as simple as it could (?). > so I am not going very quickly. > > These issues shouldn't interfere with anyone who wants to make more > substantial changes to the complex library at this time. A quick (and partial) browse turned up many probably[1] inefficient methods in "ComplexUtils": e.g. ---CUT--- d = new double[width][2 * height][depth]; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { for (int z = 0; z < depth; z++) { d[x][y * 2][z] = c[x][y][z].getReal(); d[x][y * 2 + 1][z] = c[x][y][z].getImaginary(); } } } ---CUT--- The above should rather be: ---CUT--- d = new double[width][2 * height][depth]; for (int x = 0; x < width; x++) { final double[][] cX = c[x]; final double[][] dX = d[x]; for (int y = 0; y < height; y++) { final double[] cXY = cX[y]; final int twoY = y * 2; final double[] dXY0 = dX[twoY]; final double[] dXY1 = dX[twoY + 1]; for (int z = 0; z < depth; z++) { final Complex cXYZ = cXY[z]; dXY0[z] = cXYZ.getReal(); dXY1[z] = cXYZ.getImaginary(); } } } ---CUT--- Best regards, Gilles [1] Unless the JIT compiler is now able to do the right thing... > > Best, > Eric --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org