Пример #1
0
	/// resize
	void resize(size_t nr, size_t nc, size_t nnz)
	{	nr_ = nr;
		nc_ = nc;
		nnz_ = nnz;
		row_.resize(nnz);
		col_.resize(nnz);
	}
Пример #2
0
	/// assignment
	void operator=(const sparse_rc& pattern)
	{	nr_  = pattern.nr_;
		nc_  = pattern.nc_;
		nnz_ = pattern.nnz_;
		// simple vector assignment requires vectors to have same size
		row_.resize(nnz_);
		col_.resize(nnz_);
		row_ = pattern.row_;
		col_ = pattern.col_;
	}
Пример #3
0
	/// sizing constructor
	/// Eigen vector is ambiguous for row_(0), col_(0) so use default ctor
	sparse_rc(size_t nr, size_t nc, size_t nnz)
	: nr_(nr), nc_(nc), nnz_(nnz)
	{	row_.resize(nnz);
		col_.resize(nnz);
	}