From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 7E45F1F461 for ; Mon, 26 Aug 2019 14:54:31 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 35391120B78; Mon, 26 Aug 2019 23:54:24 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5353A120B70 for ; Mon, 26 Aug 2019 23:54:19 +0900 (JST) Received: by filter0024p3iad2.sendgrid.net with SMTP id filter0024p3iad2-1020-5D63F29F-14 2019-08-26 14:54:23.230792571 +0000 UTC m=+915012.480215369 Received: from herokuapp.com (unknown [3.82.112.209]) by ismtpd0030p1iad2.sendgrid.net (SG) with ESMTP id 8lOdnn5WQu6Ty39NREmc_g for ; Mon, 26 Aug 2019 14:54:23.170 +0000 (UTC) Date: Mon, 26 Aug 2019 14:54:23 +0000 (UTC) From: ruby-core@marc-andre.ca Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70120 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12356 X-Redmine-Issue-Author: edmorte X-Redmine-Issue-Assignee: marcandre X-Redmine-Sender: marcandre 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: =?us-ascii?Q?jp+swDN4yjawvlS938eDTV7AcuBgTjW2xvQn0nZL4RC6E1yhi+dJkon+s1rEg4?= =?us-ascii?Q?r9q84lDxoQ1ZRi9k4PHu0Q+anp=2Fg6os8nnbUYJO?= =?us-ascii?Q?4dhgQX7is8lQ2MyVDE4Aroj1THDETrtEUm0lPLq?= =?us-ascii?Q?h9vpQinxmF65DN+mSOyT2wnvotqSbz0Jyjy8XQk?= =?us-ascii?Q?CMEQuqcbaCEE09SWxExQlI3QxJKbXEgnXhg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94568 Subject: [ruby-core:94568] [Ruby master 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 updated by marcandre (Marc-Andre Lafortune). Status changed from Assigned to Rejected Thanks Jeremy for updating this issue. I double checked and never received the original email notification... > `Vector` does not have distinction between row and column, there's no column vector notion in the language. Actually, in the library `Vector` is a column vector. You can see this for example with: ``` Vector[1, 2].to_matrix # => Matrix[[1], [2]] ``` So I believe that it is correct that `v.covector * v` or `v * v.covector` returns some result while other combinations should raise. I'll close this but will reopen if there's more discussion to be had. ---------------------------------------- Bug #12356: Vector covector incorrect multiplication with another vector. https://bugs.ruby-lang.org/issues/12356#change-81025 * Author: edmorte (Rafael Silva) * Status: Rejected * Priority: Normal * Assignee: marcandre (Marc-Andre Lafortune) * Target version: * 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/