473,799 Members | 3,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Raising Matrix to Negative Power

1 New Member
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!
Nov 19 '07 #1
3 8605
brendanriley
1 New Member
You cannot multiply a matrix to a negative power.
Sep 24 '08 #2
Airslash
221 New Member
You cannot multiply a matrix to a negative power.
what about the Unity Matrix then? Isn't that the original matrix to power -1 ?
Oct 13 '08 #3
hamartrom
1 New Member
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.
Sep 29 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3290
by: Jason Robertson | last post by:
Hi, I am using Web Matrix Project as .NET programming environment. Can you show me detailed steps how to import the .ocx library into the Web Matrix Project. I can't seem to be able to import other assembly than .dll, .exe or ..mcl . I am pretty new to the .NET programming environment, and may be missing something. I can see the file in C:\Program Files\Common Files\Tops\xyzxyz.ocx , but I can't find a way to import it into the Web...
14
6223
by: Paul McGuire | last post by:
I've posted a simple Matrix class on my website as a small-footprint package for doing basic calculations on matrices up to about 10x10 in size (no theoretical limit, but performance on inverse is exponential). Includes: - trace - transpose - conjugate - determinant - inverse - eigenvectors/values (for symmetric matrices)
23
4378
by: Hallvard B Furuseth | last post by:
As far as I can tell, (x & -1) is nonzero if the integer x is negative zero. So for signed types, x == 0 does not guarantee (x & foo) == 0. Is that right? (Not that I expect to ever encounter a non-two's-complement machine. Just wondering.) -- Hallvard
2
5845
by: Zhengzheng Pan | last post by:
Hi all, I'm trying to check whether a (stochastic/transition) matrix converges, i.e. a function/method that will return True if the input matrix sequence shows convergence and False otherwise. The background is a Markov progress, so the special thing about the transition matrix is the values of elements in each row add up to be 1. Fail to find any relevant build-in methods in Python... Currently the standard theorem on convergence in...
10
6935
by: thatwhiteguy | last post by:
I am trying to create a function that computes a negative exponent. This is what I have, but it is not returning the proper answer. I was wondering if anyone can see where I have gone wrong. Thanks //This function raises 1+AIR to a negative n power float power (int num_of_pay, float number) { float result; int i; double AIR;
7
2576
by: Mark | last post by:
I'm trying to figure out the best way to go about doing this. I have a "map" for a game, which I'd like to store in a matrix. Some cells will be empty (NULL), and some will hold objects. I need a matrix so that I can quickly find neighboring cells. However, when create this map, I don't know what size it is going to be, so it needs to be expandable. I also don't know which direction it's going to grow in, so starting at and expanding as...
8
3107
by: skanemupp | last post by:
how do i solve power(5,1.3)? def power(nbr, po): if po==0: return 1 if po>0: return nbr*power(nbr, po-1) if po<0: return 1/power(nbr, -1*po)
1
9170
by: Sozos | last post by:
Hi guys. I have a problem with writing the base case for the following matrix multiplication function I have implemented. Please help. #define index(i,j,power) (((i)<<(power))+(j)) void recMultiply(int i, int j, float a, int k, int l, float b, int x, int y, float c, int s); int i, j, k, s, matrixsize, blocksize, jj, kk, power, bsize; float sum, maxr, total=0.0, startmult, finishmult, multtime; float* A = NULL; float* B = NULL;
1
3113
by: almurph | last post by:
Hi everyone, Concerning the Needleman-Wunsch algorithm (cf. http://en.wikipedia.org/wiki/Needleman-Wunsch_algorithm) I have noticed a possible loop. Inside the algorithm there is an important decision making mechanism. Its a "if, else if, else if" structure like:
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.