Raising Matrix to Negative Power

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gingerphil
    New Member
    • Nov 2007
    • 1

    Raising Matrix to Negative Power

    I am having problems raising a matrix to a negative power. I am relatively new to Ruby, so please forgive me if I have missed something obvious.

    The software I am using is basically a GIS-type that allows ruby coded interrogation/assignment of its input. It has a class called OtMatrix that seems to be preventing me from applying a negative power to it, by saying that it cannot be coerced to a fixnum.

    Here is the basic code...

    elas = 0.24 # I have stored it as a positive and used as denominator
    matrix2 = 1/matrix**(elas)


    All ideas gratefully recieved!
  • brendanriley
    New Member
    • Sep 2008
    • 1

    #2
    You cannot multiply a matrix to a negative power.

    Comment

    • Airslash
      New Member
      • Nov 2007
      • 221

      #3
      Originally posted by brendanriley
      You cannot multiply a matrix to a negative power.
      what about the Unity Matrix then? Isn't that the original matrix to power -1 ?

      Comment

      • hamartrom
        New Member
        • Sep 2009
        • 1

        #4
        Actually, the unity matrix should not be seen as the matrix to power (-1), as the (-1) is only a representation for the inverse matrix, similarly to the the inverse of other things, such as f^(-1). It is therefore not raised to any power, it is just a way of notation.

        Comment

        Working...