2 #ifndef vnl_sparse_matrix_h_ 3 #define vnl_sparse_matrix_h_ 58 # include <vcl_msvc_warnings.h> 61 #include "vnl/vnl_export.h" 112 typedef std::vector < pair_t >
row;
131 void mult(
unsigned int n,
unsigned int m, T
const* p, T* q)
const;
137 T& operator()(
unsigned int row,
unsigned int column);
140 T operator()(
unsigned int row,
unsigned int column)
const;
144 T get(
unsigned int row,
unsigned int column)
const;
147 void put(
unsigned int row,
unsigned int column, T value);
155 std::vector<int>
const& cols,
156 std::vector<T>
const& vals);
166 unsigned int rows()
const {
return rs_; }
172 unsigned int cols()
const {
return cs_; }
175 bool empty_row(
unsigned int r)
const {
return elements[r].empty(); }
178 T sum_row(
unsigned int r);
187 void set_size(
int r,
int c );
190 void resize(
int r,
int c );
204 int getcolumn()
const;
316 #endif // vnl_sparse_matrix_h_ std::vector< pair_t > row
unsigned int columns() const
Get the number of columns in the matrix.
row::const_iterator itr_cur
vnl_sparse_matrix< T > operator *(T const &value, vnl_sparse_matrix< T > const &m)
unsigned int cols() const
Get the number of columns in the matrix.
void add(const vnl_bignum &b1, const vnl_bignum &b2, vnl_bignum &sum)
add two non-infinite vnl_bignum values and save their sum.
vnl_sparse_matrix_pair< T > & operator=(vnl_sparse_matrix_pair const &o)
void clear()
Set all elements to null.
vnl_sparse_matrix_elements elements
bool empty_row(unsigned int r) const
Return whether a given row is empty.
void subtract(const vnl_bignum &bmax, const vnl_bignum &bmin, vnl_bignum &diff)
subtract bmin from bmax (unsigned, non-infinite), result in diff.
vnl_bignum operator-(vnl_bignum const &r1, vnl_bignum const &r2)
Returns the difference of two bignum numbers.
std::vector< row > vnl_sparse_matrix_elements
vnl_sparse_matrix_pair(const vnl_sparse_matrix_pair< T > &o)
unsigned int rows() const
Get the number of rows in the matrix.
vnl_sparse_matrix_pair()
Constructs a pair with null values.
vnl_sparse_matrix_pair(unsigned int const &a, T const &b)
Constructs a pair with position a and value b.
Mathematical vector class, templated by type of element.
vnl_bignum operator+(vnl_bignum const &r1, long r2)
Returns the sum of two bignum numbers.
row & get_row(unsigned int r)
Return row as vector of pairs.
bool operator==(const vnl_amoeba_SimplexCorner &a, const vnl_amoeba_SimplexCorner &b)
Stores elements of sparse matrix.
vnl_bignum operator/(vnl_bignum const &r1, vnl_bignum const &r2)
Returns the division of two bignum numbers.
bool operator!=(vnl_sparse_matrix< T > const &rhs) const
Inequality.
vnl_bignum operator *(vnl_bignum const &r1, vnl_bignum const &r2)
Returns the product of two bignum numbers.
vnl_sparse_matrix_pair< T > pair_t