Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 9th, 2008, 05:01 AM
KingCarlos KingCarlos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 5 KingCarlos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 34 sec
Reputation Power: 0
Best Way to Use Variable Dimension Array Multiplier

Hi guys,

New to the forum, but have a few issues at the moment with Delphi Pascal.

Start off with one which probably has an easy answer.

I want to create just one proceudre to handle variously sized arrays and multiply them.

The arrays are currently variables within a record and of user defined type i.e.

d46_mat : array[1..4,1..6] of double;

matrices = record

G : d46_mat;
H : d38_mat;

end;

I tried to use dynamic arrays of pass pointers but i'm either doing something wrong or i need a different approach.

Thanks.

Reply With Quote
  #2  
Old April 9th, 2008, 06:42 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 681 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 14 h 23 m 2 sec
Reputation Power: 12
Can you be a bit more specific?

What are you trying to do and what are the error messages?

Can you post the code you have written so that we can see the issues?

Clive

Reply With Quote
  #3  
Old April 10th, 2008, 03:05 AM
KingCarlos KingCarlos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 5 KingCarlos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 34 sec
Reputation Power: 0
I'm more concerned with the view of programmers that understand Delphi Pascal (maybe this is more of a pascal question) as to what is the advised way to write a 2D array (matrix) multiplier procedure.

This is a standard procedure for any language, the question is not really what i'm doing wrong but more what expert programmers would use to write a flexible procedure which accepts two matrices of arbitary dimensions and computes their product.

I could write a procedure for each possible matrix combination but this would be extremely inefficient.

Thanks

Reply With Quote
  #4  
Old April 10th, 2008, 12:49 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 681 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 14 h 23 m 2 sec
Reputation Power: 12
Quote:
I'm more concerned with the view of programmers that understand Delphi Pascal

Some would say that might include me

However, I am not familiar with what you mean by a "2D array (matrix) multiplier" or what it is suppose to do.

I will assume it is suppose to create a third array where:
C[0,0] := A[0,0] * B[0,0]; etc.

I suspect the piece you are missing is that you can loop from "low" to "high" in an array
without knowing what low and high represent.

Other things to bear in mind are that array access is more efficient traversing the elements in each row
rather than each column and dynamic arrays are generally faster than static arrays.

Again though, if you posted your code attempts, it would be much easier to see what you are doing wrong.

Clive

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Best Way to Use Variable Dimension Array Multiplier


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway