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=-4.1 required=3.0 tests=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 14A131F462 for ; Thu, 23 May 2019 19:57:37 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C20E11208FE; Fri, 24 May 2019 04:57:30 +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 ACE111208FE for ; Fri, 24 May 2019 04:57:28 +0900 (JST) Received: by filter0102p3iad2.sendgrid.net with SMTP id filter0102p3iad2-9567-5CE6FB29-2E 2019-05-23 19:57:29.910697943 +0000 UTC m=+8413.408279422 Received: from herokuapp.com (unknown [184.73.130.48]) by ismtpd0031p1mdw1.sendgrid.net (SG) with ESMTP id q1DOBoN3Qoue2JQhP0OhZw for ; Thu, 23 May 2019 19:57:29.760 +0000 (UTC) Date: Thu, 23 May 2019 19:57:29 +0000 (UTC) From: ruby@fernandobona.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68287 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15869 X-Redmine-Issue-Author: bonafernando X-Redmine-Sender: bonafernando 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?t75sNISz4yeW6N6fCC+pxcNdM0ZHaUWW0Jvyjbj7Z3H4s1hf6ZdIP=2F3g=2Ffajht?= =?us-ascii?Q?wUXWsHp9YtEVSaiZ7wzir8cx8awTTa8UZYAqfwD?= =?us-ascii?Q?Iq4uk9WP5vUKNFZscIKiMuhKgDTsBF3L4f4aCda?= =?us-ascii?Q?A6qvh4so4MuJrc0QZ0QyiD7j6v7s4ggEc4dY8X3?= =?us-ascii?Q?EfzF5pdbP823xV9QOUD5uZt5Ghabksqad2Q=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92803 Subject: [ruby-core:92803] [Ruby trunk Bug#15869] Add abs to Matrix 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 #15869 has been reported by bonafernando (Fernando Wolf Bona). ---------------------------------------- Bug #15869: Add abs to Matrix https://bugs.ruby-lang.org/issues/15869 * Author: bonafernando (Fernando Wolf Bona) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- While I was studying Markov Chain I had to find the maximum absolute value of the Matrix to divide the matrix in numbers from 0 to 1 to be able to make further analysis. Like this: ``` q = Matrix[ ... ] max = q.to_a.flatten.map { |e| e.abs }.max q = q / max ``` So this is the first of two features that I would like to contribute. 1. Matrix.abs 2. Matrix.max -- https://bugs.ruby-lang.org/