calculate rank of matrix

Z

zhouxn

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)
{
//???
}
 
V

Victor Bazarov

zhouxn said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top