From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 7286F1A2005F for ; Sat, 7 May 2016 08:15:39 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 7C719B5D861 for ; Sat, 7 May 2016 08:52:01 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 9C68718CC810 for ; Sat, 7 May 2016 08:52:01 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 771D9120421; Sat, 7 May 2016 08:52:01 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 32059120400 for ; Sat, 7 May 2016 08:51:58 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=vihPm7EHsZpQd5SPWWbKeIgSH+8=; b=zYPheaLAqSPEp9x1Yr WofT3LcVB1ywNt2bQBzOO8LifRCwhHtYz04QbMgnKRsgPuoRN6mf2DpZb+hJe0zs LDot/G1vycjDY+yCuvNDClOEz8n/QW7UF0asFgGw5ANoFU6RFaUKR5QFqqxLHhEJ EcerCaFsE1KLIzLCuwDx7DtTE= Received: by filter0915p1mdw1.sendgrid.net with SMTP id filter0915p1mdw1.25344.572D2E1AF 2016-05-06 23:51:54.433139687 +0000 UTC Received: from herokuapp.com (ec2-54-196-131-123.compute-1.amazonaws.com [54.196.131.123]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id 34xJDnauSGyBM5wD9T1oDw for ; Fri, 06 May 2016 23:51:54.679 +0000 (UTC) Date: Fri, 06 May 2016 23:51:54 +0000 From: rafael.soares81@yahoo.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 50067 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12356 X-Redmine-Issue-Author: edmorte X-Redmine-Sender: edmorte X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5B1nE3atTOIX8o0hA0zK6c2gywqYBr/Tz/FZ 73nlmB40jPjLjddTLunRdyOstY9rHTp5dAlQQfO6axLKnHOdXxHnmEHy9JGr54LRmTpqtK4biHmrBb FX84BflygKecB8lQpvdXgXVPV/HxuUug2qchn+0YnzCE2NVozlyT9A68hw== X-ML-Name: ruby-core X-Mail-Count: 75394 Subject: [ruby-core:75394] [Ruby trunk Bug#12356] Vector covector incorrect multiplication with another vector. X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #12356 has been reported by Rafael Silva. ---------------------------------------- Bug #12356: Vector covector incorrect multiplication with another vector. https://bugs.ruby-lang.org/issues/12356 * Author: Rafael Silva * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Version 2.2.4 v1 = Vector[2,3,4] v2 = Vector[4,5,6] v1.covector.row_size #1 v1.covector.column_size #3 v2.covector.row_size #1 v2.covector.column_size #3 Vector does not have distinction between row and column, there's no column vector notion in the language. v1 * v2.covector #Matrix[[8,10,12],[12,15,18],[16,20,24]] # Should be illegal. But works like if v2.covector is transposed / column vector which it's clearly not. v1.covector * v2.covector #ExceptionForMatrix::ErrDimensionMismatch: Matrix dimension mismatch # Expected v1 * v2 #ExceptionForMatrix::ErrOperationNotDefined: Operation(*) can't be defined: Vector op Vector # No comments, see my observation below. v1.covector * v2 #Vector[47] #Again covector treated like transposed / column vector. Personal observation: Terrible choice to represent Vector like an Array, Vector should be a shortcut to Matrix. -- https://bugs.ruby-lang.org/