From dev-return-127164-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Fri Jul 1 23:54:02 2011 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 33C5A4144 for ; Fri, 1 Jul 2011 23:54:02 +0000 (UTC) Received: (qmail 95872 invoked by uid 500); 1 Jul 2011 23:54:01 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 95630 invoked by uid 500); 1 Jul 2011 23:54:00 -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 95622 invoked by uid 99); 1 Jul 2011 23:54:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2011 23:54:00 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ted.dunning@gmail.com designates 209.85.220.171 as permitted sender) Received: from [209.85.220.171] (HELO mail-vx0-f171.google.com) (209.85.220.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2011 23:53:53 +0000 Received: by vxh11 with SMTP id 11so3240098vxh.30 for ; Fri, 01 Jul 2011 16:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=E2B3mQR4xYM95JzS4yi0EierMG8ofyhJr7OuxendJKQ=; b=UtQ/+TjpsdwzgjjVsNiLIKUL3Ea9biRasKDKo5HwZseobymK3l1tifCp6U/UKsRHyY LKd3fUIuiuQ9IwsUGM9lQoQshgShT3ijifFV3iuMGxKPlBRVQ8FtnFGZaV+g79vd405r 7LZh01amGRxuqXdw+KWxMtqfjAdk2PyHCm22Q= Received: by 10.52.92.78 with SMTP id ck14mr1928060vdb.100.1309564412090; Fri, 01 Jul 2011 16:53:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.110.68 with HTTP; Fri, 1 Jul 2011 16:53:12 -0700 (PDT) In-Reply-To: References: <20110701232653.GC10648@dusk.harfang.homelinux.org> From: Ted Dunning Date: Fri, 1 Jul 2011 16:53:12 -0700 Message-ID: Subject: Re: (MATH-608) Remove methods from RealMatrix Interface To: Commons Developers List Content-Type: multipart/alternative; boundary=bcaec501676397d99c04a70ab9df X-Virus-Checked: Checked by ClamAV on apache.org --bcaec501676397d99c04a70ab9df Content-Type: text/plain; charset=UTF-8 Actually, the compiler can't do the dispatch correctly. For instance, given the following approximately real code: Matrix a = new SparseMatrix(...); Matrix b = new DiagonalMatrix(...); This line will not dispatch to a special case method for either SparseMatrix or DiagonalMatrix: MatrixOperator.times(a, b) This is because a and b are just Matrix objects according to the compiler. You have to invent a way to do runtime dispatching. On Fri, Jul 1, 2011 at 4:45 PM, Greg Sterijevski wrote: > There is no magic which will remove the elemental complexity of these > things. However, the complexity would be concentrated in the operator > classes, where it probably should be. Furthermore, the type matching would > be handled by compiler. Finally, the multiplication routines would grow as > a > need for those operations arises. > --bcaec501676397d99c04a70ab9df--