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.

calculate rank of matrix


template <class T>
class matrix
{
public:
typedef int size_type;
typedef T data_type;
typedef T& reference;
typedef const T& const_reference;
typedef vector<T> row;
typedef vector<row> rows;

size_type rc_;
size_type cc_;
rows storage_;

inline matrix(size_type M, size_type N)
:rc_(M), cc_(N), storage_(M, vector<T>(N, T())){};
inline reference operator()(size_type r, size_type c) { return
storage_.at(r).at(c);}
inline const_reference operator()(size_type r, size_type c) const { return
storage_.at(r).at(c);}
}

template<class Matrix>
Matrix::size_type rank(Matrix M)
{
//???
}
Jul 22 '05 #1
1 5690
zhouxn wrote:
template <class T>
class matrix
{
public:
typedef int size_type;
typedef T data_type;
typedef T& reference;
typedef const T& const_reference;
typedef vector<T> row;
typedef vector<row> rows;

size_type rc_;
size_type cc_;
rows storage_;

inline matrix(size_type M, size_type N)
:rc_(M), cc_(N), storage_(M, vector<T>(N, T())){};
inline reference operator()(size_type r, size_type c) { return
storage_.at(r).at(c);}
inline const_reference operator()(size_type r, size_type c) const { return
storage_.at(r).at(c);}
}

template<class Matrix>
Matrix::size_type rank(Matrix M)
{
//???
}


We don't do homework. Please open your math textbook to learn what
'rank' is and then implement it. Once you have a _language_ question,
post again.

V
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Can | last post by:
I am creating an on-line survey. I want the user to have a list of choices of say 10 items that are radio buttons. They need to rank their preference. They click on preference 1, that option is...
3
by: dmkeith2 | last post by:
I'm in the military. I must create a report to track the number of personnel assigned. I have an Authorization table that has a Position. Each of these positions could be authorized any number...
2
by: dam_fool_2003 | last post by:
Just now I asked a question about signed char and unsigned char. I had the replay very fast by jens.torring and Tim prince. I post via google so now goes my thanking replay. (I must be more precise...
13
by: Steve Edwards | last post by:
Hi, Given a map: typedef map<long, string, greater<long> > mapOfFreq; Is there a quicker way to find the rank (i.e. index) of the elememt that has the long value of x? At the moment I'm...
5
by: kux | last post by:
Hello everyone, I hope someone is out here who can help me with a simple calculation... I have a sales data base in access with monthly sales history by product. to make future predictions I...
2
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
1
by: holla | last post by:
how to you write program that calculate the inverse of a matrix
3
by: codekhan | last post by:
Hi, Suppose I have a table with 5 rows (t1 - t5) and 6 columns (c1 - c6) and I run a select query on it using the where clause.. (specifying value of c1) and in the result I get two rows say...
0
by: shilpa.vastrad | last post by:
how to calculate rank in selected records in sql server 2000
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...
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.