By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,148 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,148 IT Pros & Developers. It's quick & easy.

calculate rank of matrix

P: n/a

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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.