Feature #2266

Matrix and Complex [patch]

Added by marcandre (Marc-Andre Lafortune) over 2 years ago. Updated about 1 year ago.

[ruby-core:26285]
Status:Closed Start date:10/25/2009
Priority:Normal Due date:
Assignee:marcandre (Marc-Andre Lafortune) % Done:

100%

Category:lib
Target version:1.9.2

Description

Now that Ruby 1.9 has Complex as a builtin type, it would be interesting if Matrix provided the following instance methods:
#conj, alias conjugate
#imag, alias imaginary
#real, 
#real?, 
#rect, alias rectangular

Corresponding patch attached.

This patch could also be part of mathn in the ruby 1.8 branch.

matrix_complex.diff (3.3 kB) marcandre (Marc-Andre Lafortune), 10/25/2009 07:36 am

Associated revisions

Revision 27159
Added by marcandre (Marc-Andre Lafortune) about 2 years ago

* lib/matrix.rb: New Complex instance methods: conjugate, conj, imaginary, imag, real, real?, rectangular, rect [ruby-core:26285]

History

Updated by marcandre (Marc-Andre Lafortune) over 2 years ago

  • Subject changed from Matrix and Complex to Matrix and Complex [patch]

Updated by marcandre (Marc-Andre Lafortune) about 2 years ago

  • Assignee changed from keiju (Keiju Ishitsuka) to marcandre (Marc-Andre Lafortune)
  • Target version set to 1.9.2

Updated by marcandre (Marc-Andre Lafortune) about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
This issue was solved with changeset r27159.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Also available in: Atom PDF