ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: rafael.soares81@yahoo.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:75394] [Ruby trunk Bug#12356] Vector covector incorrect multiplication with another vector.
Date: Fri, 06 May 2016 23:51:54 +0000	[thread overview]
Message-ID: <redmine.issue-12356.20160506235154.24127da423693aee@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-12356.20160506235154@ruby-lang.org

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/

       reply	other threads:[~2016-05-06 23:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-12356.20160506235154@ruby-lang.org>
2016-05-06 23:51 ` rafael.soares81 [this message]
2019-08-23 22:35 ` [ruby-core:94513] [Ruby master Bug#12356] Vector covector incorrect multiplication with another vector merch-redmine
2019-08-26 14:54 ` [ruby-core:94568] " ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-12356.20160506235154.24127da423693aee@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).