Important alert: (current site time 7/15/2013 9:17:57 AM EDT)
 

winzip icon

Matrix Operations Library .NET

Email
Submitted on: 1/18/2003 10:13:52 PM
By: Anas S. A. 
Level: Intermediate
User Rating: By 21 Users
Compatibility: VB.NET
Views: 42147
 
     About a year ago, I was working on a project. The project required many matrix operations, that time I really wished that I would find a class or a library with ready functions for matrix manipulations (like addition, inverse, multiplication, etc…) to use in Visual Basic. Unfortunately I could not find such a class, so I decided to write my own class, I called it "cMathLib" . This class gives the user the flexibility to work with matrices and do operations on them. The dimensions of the matrices are neither pre-specified nor limited. The code is highly optimized for fast operation. The code attached contains the class file called with a demonstration on how to use it. Opperations included in the class are : Add, Subtract, Determinant, Inverse, Transpose, Multiply, Print, MultiplyVectors,Magnitude of a Vector, scalar multiply, and scalar divide. I posted a similar code in Visual Basic 6 Zone two days ago and the reaction was too good to imagine, so I decided to post the VB.NET version of the code here. I really hope this class would be of any help to any of you who needs to work with matrix operations.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/19/2003 4:55:12 AM

It is a great work.
(If this comment was disrespectful, please report it.)

 
1/19/2003 11:28:22 AMSub-Zero

Hi, I voted 5 in VB and I add to vote here too, if only I had that when I was in university
(If this comment was disrespectful, please report it.)

 
1/19/2003 4:06:23 PM

Great work! i give you 5 star.
(If this comment was disrespectful, please report it.)

 
1/19/2003 4:23:47 PM

I gave u 5 in vb 6 section and i suppose u deserve 5 here too, very good work man, thanx for sharing !!
(If this comment was disrespectful, please report it.)

 
1/20/2003 10:41:05 AMJoseph Hicks

I wonder how easy it would be to modify this to return DirectX v9 matrices?
(If this comment was disrespectful, please report it.)

 
1/23/2003 1:52:06 PMAli Osman BOYACI

Dear Mr. Coding Genius Anas Buddy!!
How come you write such excellent code man!! I am going to use it in doing my scientific project. Thank you very much.
Perfect code. I am not surprised if it is from you. Take care. I am happy to see your name on the planet. Share more treasures with us.
(If this comment was disrespectful, please report it.)

 
2/24/2003 2:37:49 PMnfs

WOW !

Hi,
Do you want to make money with your programming skills ?

Software Objects provide following services :

1)Sell your software.
2)Post a software to be done.
3)Bid on the software projects.
4)Buy software

Thanks and have a nice day.

Software Objects

http://www.thesoftwareobjects.com

(If this comment was disrespectful, please report it.)

 
3/13/2003 9:18:58 PMThe New iSoftware Company!

I hope you dont mind if I use this in my own math library!
(If this comment was disrespectful, please report it.)

 
5/27/2003 7:56:43 AM

all i can say is: great work..!
(If this comment was disrespectful, please report it.)

 
9/3/2003 10:06:32 AM

can i give input ordo matrix or element to tour program?
(If this comment was disrespectful, please report it.)

 
6/14/2004 6:00:13 AM

Hi, i think there is a flaw in the transpose function.

it should state:
Tr_Mat(i, j) = Mat(j, i)

instead of:
Tr_Mat(j, i) = Mat(i, j)

Your examples work because they are of n*n format but it they are n*m it won't work any longer.

Great code anyway!!

(If this comment was disrespectful, please report it.)

 
2/4/2005 2:58:56 AM

Where can I get one like this for C#??
Thank you!
My email:::
04900158r@polyu.edu.hk
(If this comment was disrespectful, please report it.)

 
2/26/2005 4:11:06 AM

Yes, there is an error with transpose...should be for i = 0 to rows and j = 0 to cols...

I suggest using overloaded functions to accept vectors and/or matrices as arguments

thanks for the great work, this has saved me some major time...
(If this comment was disrespectful, please report it.)

 
4/30/2005 6:31:19 AM

Thanks for the code, it help me a lot in my project
(If this comment was disrespectful, please report it.)

 
9/12/2006 2:04:31 AMFirahs

Thank you so much Mr Anas. I was really in a dire need of such code for solving equations of planes in my project. This is really great work.
(If this comment was disrespectful, please report it.)

 
12/1/2008 9:28:19 AMqantum

You're just a coding genius, you diserve it great job......ow and now i'm gonna be peacefully calculating PDE's for a long long while yah haaaaaaa
(If this comment was disrespectful, please report it.)

 
8/9/2011 12:58:59 PMMike

I second the previous comment:

"
Hi, i think there is a flaw in the transpose function.

it should state:
Tr_Mat(i, j) = Mat(j, i)

instead of:
Tr_Mat(j, i) = Mat(i, j)
"

Otherwise, I'm very grateful. Super helpful.
(If this comment was disrespectful, please report it.)

 
11/15/2011 3:43:56 PMWilly

Good job!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.