473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PEANO order

mia023
89
hello everyone I have a project and just need ideas about it. This is the documentation:

[FONT=Calibri][SIZE=3][FONT=Calibri][SIZE=3]
Develop the code for matrix multiplication in Peano[/SIZE][/FONT][/SIZE][/FONT][FONT=Calibri][SIZE=3][FONT=Calibri][SIZE=3]‐[/SIZE][/FONT][/SIZE][/FONT][FONT=Calibri][SIZE=3][FONT=Calibri][SIZE=3]Order and another one in roworder.
The program should be able to read two matrices from a file, and output the
multiplication of these two matrices using both orders. Use PAPI (Performance
Application Programming Interface) to instrument your code. Your code should monitor
the following: L1 cache misses, L2 cache misses, number of FLOPS and total time.
Present these results in a table for different sizes of the matrices, analyze and justify
these results.
[/SIZE][/FONT][/SIZE][/FONT]
Jan 17 '09 #1
13 2802
donbock
2,426 Expert 2GB
Are you using the Haskell language?
Jan 17 '09 #2
mia023
89
actually no i am using C language
Jan 17 '09 #3
Hi Dear,

just refer the book
C++ Projects
by Reeta Sahoo
publisher: khanna book publishing co. (p) Ltd

there is a project in this book with respect to matrix manipulation he/she demonstrated all basic operation with respect to matrix... !

It will help u alot... !

:) pray for me if my sugesstion works for u.. !
Jan 17 '09 #4
mia023
89
you should buy the book or it is free
Jan 17 '09 #5
mia023
89
it isn't working out need some hepl please
Jan 17 '09 #6
mia023
89
I want to write a C++ program regarding matrix multiplication using Peano order can you please help
Jan 18 '09 #7
JosAH
11,448 Expert 8TB
I merged your two threads: they're both about the same problem. A question for you: what have you done so far?

kind regards,

Jos (moderator)
Jan 18 '09 #8
mia023
89
this is my code but i think there is a problem in it


#include <iostream>
#include <string>
#include <vector>
#include <sstream>

using namespace std;
// NOTE: CHANGE THESE VARIABLES TO MEET THE REQUIREMENTS OF YOUR TESTCASE!!!!
#define numRowsA 3
#define numColumnsA 3
#define numRowsB numColumnsA
#define numColumnsB 3
static double toDouble ( string s);
static long toLong ( string s);
static int toInteger ( string s);

int MatrixA[9] = {1,2,3,4,5,6,7,8,9};
int MatrixB[9]= {10,11,12,13,14,15,16,17,18};
int MatrixMult[9];
int a = 0;
int b = 0;
int c = 0;
void peanomult(int phsA, int phsB, int phsC, int dim);
int main()
{
for (int i =0; i < 9; i++)
{
cout << MatrixA[i];
cout << " ";
}
cout << endl;
cout << endl;
for (int i =0; i < 9; i++)
{
cout << MatrixB[i];
cout << " ";
}
cout << endl;
cout << endl;

peanomult(0, 0, 0, 9);
for (int i =0; i < 9; i++)
{
cout << MatrixMult[i];
cout << " ";
}
cout << endl;
cout << endl;


return 1;
}


//void peanomult(int MatrixA, int MatrixB, int MatrixMult, int dim)
void peanomult(int phsA, int phsB, int phsC, int dim)
{
if (dim == 1)
{
MatrixMult[c] += MatrixA[a] * MatrixB[b];
}
else
{
peanomult( phsA, phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); a += phsA; b += phsB;
peanomult( phsA, phsB, -phsC, dim/3); a += phsA; c -= phsC;
peanomult( phsA, -phsB, -phsC, dim/3); a += phsA; c -= phsC;
peanomult( phsA, phsB, -phsC, dim/3); a += phsA; b += phsB;
peanomult( phsA, phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); b += phsB; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); a -= phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a -= phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); a -= phsA; b += phsB;
peanomult( phsA, phsB, -phsC, dim/3); a -= phsA; c -= phsC;
peanomult( phsA, -phsB, -phsC, dim/3); a -= phsA; c -= phsC;
peanomult( phsA, phsB, -phsC, dim/3); a -= phsA; b += phsB;
peanomult( phsA, phsB, phsC, dim/3); a -= phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a -= phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); b += phsB; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3); a += phsA; b += phsB;
peanomult( phsA, phsB, -phsC, dim/3); a += phsA; c -= phsC;
peanomult( phsA, -phsB, -phsC, dim/3); a += phsA; c -= phsC;
peanomult( phsA, phsB, -phsC, dim/3); a += phsA; b += phsB;
peanomult( phsA, phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, -phsB, phsC, dim/3); a += phsA; c += phsC;
peanomult( phsA, phsB, phsC, dim/3);
};
}
Jan 18 '09 #9
mia023
89
could anyone respond as soon as possible because the due date is real soon
Jan 18 '09 #10
JosAH
11,448 Expert 8TB
Wouldn't it be a good idea to at least supply a link about what that 'Peano order' is all about? Showing a piece of badly formatted code that doesn't work is not the way to go. Help us to help you.

kind regards,

Jos
Jan 18 '09 #11
JosAH
11,448 Expert 8TB
@mia023
So you simply copied that function from page #12 of that (interesting) article and you expect everything to automagically work? That is not much of a scientific attitude: read and understand that article; draw the trace of that curve on paper and step through that algorithm and see if the two follow the same trace.

kind regards,

Jos
Jan 18 '09 #13
mia023
89
I really don't know C++ well nor C the teacher asked us to do it and I read the article and found this code only so I figured it would be of help. I haven't taken Peano order before and therefore I didn't really understand the article well so please can you help me alittle bit at least.
Jan 18 '09 #14

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

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
9
by: Steven T. Hatton | last post by:
The following works: template <typename T> struct ID3M{ static const T ID; }; template <typename T> const T ID3M<T>::ID = {{1,0,0},{0,1,0},{0,0,1}};
15
by: | last post by:
The data file is a simple Unicode file with lines of text. BCP apparently doesn't guarantee this ordering, and neither does the import tool. I want to be able to load the data either sequentially...
27
by: Abdullah Kauchali | last post by:
Hi folks, Can one rely on the order of keys inserted into an associative Javascript array? For example: var o = new Object(); o = "Adam"; o = "Eve";
8
by: kaosyeti | last post by:
i have a (hopefully) small problem. i have created a system where a user enters customer information into a table through a form. this table has no primary key. there are 9 fields on the form to...
104
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
13
by: bevanward | last post by:
Hi All I am finding unexpected results when inserted into a newly created table that has a field of datatype int identity (1,1). Basically the order I sort on when inserting into the table is...
4
by: babyinc | last post by:
Please help me. I am totally beginner of C++ and my tutor give us these huge program to solve within 20 days. As a MSc student I am really gonna cry. Please anyone can help me. sumon1in1@yahoo.com ...
25
by: DanicaDear | last post by:
Hello again Bytes...I missed you! First, background: In a hotstick lab, we ship orders every two years. We ship a new order and the customer uses the new box to return the previous year's order....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.