Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 385571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:29:34+00:00 2026-05-12T15:29:34+00:00

How come the Matrix class has no methods to edit its vectors and components?

  • 0

How come the Matrix class has no methods to edit its vectors and components? It seems like everything inside a matrix can be read but not written. Am I mistaken? Is there some third-party elegant Matrix-like class that would allow me to delete rows and intentionally edit them?

Please, notify me if there is no such class – I will stop searching.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:29:34+00:00Added an answer on May 12, 2026 at 3:29 pm

    The designer of class Matrix must have been a fan of immutable data structures and functional programming. Yes, you are correct.

    In any case, there is a simple solution for what you want. Use Matrix for what it can do, then, just use .to_a to get a real array.

    >> Matrix.identity(2).to_a
    => [[1, 0], [0, 1]]
    

    See also Numerical Ruby Narray. You could also monkeypatch the class to add more behavior. If you do this, please patch a subclass of Matrix. (There are Ruby library projects out there that want more behavior from required classes so they directly modify them, making their new files somewhat toxic. They could have so easily just patched a subclass or singleton class.)

    Oh, and khelll (:-) would probably like me to say that there is quite possibly a way for you to do what you want in a functional style. That is, by creating new objects rather than by modifying the old ones.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of my team has recently come across an interesting glitch in the matrix.
It seems that many projects slowly come upon a need to do matrix math,
I come from the Java world, where you can hide variables and functions and
I am trying to write a trivial Matrix class, using C++ templates in an
I have a class to parse a matrix that keeps the result in an
Greetings, I have three TS variables resembling something like the following: data <- read.csv(...)
I come from a Java background, where packages are used, not namespaces. I'm used
I come from the Microsoft world (and I come in peace). I want to
I come across this problem when i am writing an event handler in SharePoint.
How come this doesn't work (operating on an empty select list <select id=requestTypes></select> $(function()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.