mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-23 14:53:13 +08:00
Remove more DynamicSparseMatrix references.
Also fixed some typos in SparseExtra/MarketIO.h.
This commit is contained in:
parent
3b48a3b964
commit
eea2a3385c
@ -147,7 +147,7 @@ inline bool getMarketHeader(const std::string& filename, int& sym, bool& iscompl
|
|||||||
* @tparam SparseMatrixType to read into, symmetries are not supported
|
* @tparam SparseMatrixType to read into, symmetries are not supported
|
||||||
* @param mat SparseMatrix to read into, current values are overwritten
|
* @param mat SparseMatrix to read into, current values are overwritten
|
||||||
* @param filename to parse matrix from
|
* @param filename to parse matrix from
|
||||||
* @return returns true if file exists. Returns false if the parsing did not suceed.
|
* @return returns true if file exists. Returns false if the parsing did not succeed.
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixType>
|
template<typename SparseMatrixType>
|
||||||
bool loadMarket(SparseMatrixType& mat, const std::string& filename)
|
bool loadMarket(SparseMatrixType& mat, const std::string& filename)
|
||||||
@ -227,7 +227,7 @@ bool loadMarket(SparseMatrixType& mat, const std::string& filename)
|
|||||||
* @tparam DenseMatrixType to read into
|
* @tparam DenseMatrixType to read into
|
||||||
* @param mat DenseMatrix to read into, current values are overwritten, symmetries are not supported
|
* @param mat DenseMatrix to read into, current values are overwritten, symmetries are not supported
|
||||||
* @param filename to parse matrix from
|
* @param filename to parse matrix from
|
||||||
* @return true if parsing was successful. Returns false if the parsing did not suceed.
|
* @return true if parsing was successful. Returns false if the parsing did not succeed.
|
||||||
*/
|
*/
|
||||||
template<typename DenseType>
|
template<typename DenseType>
|
||||||
bool loadMarketDense(DenseType& mat, const std::string& filename)
|
bool loadMarketDense(DenseType& mat, const std::string& filename)
|
||||||
@ -303,7 +303,7 @@ bool loadMarketVector(VectorType& vec, const std::string& filename)
|
|||||||
* @param mat matrix to write to file
|
* @param mat matrix to write to file
|
||||||
* @param filename filename to write to
|
* @param filename filename to write to
|
||||||
* @param sym at the moment no symmetry operations are supported
|
* @param sym at the moment no symmetry operations are supported
|
||||||
* @return true if writing suceeded
|
* @return true if writing succeeded
|
||||||
*/
|
*/
|
||||||
template<typename SparseMatrixType>
|
template<typename SparseMatrixType>
|
||||||
bool saveMarket(const SparseMatrixType& mat, const std::string& filename, int sym = 0)
|
bool saveMarket(const SparseMatrixType& mat, const std::string& filename, int sym = 0)
|
||||||
@ -339,7 +339,7 @@ bool saveMarket(const SparseMatrixType& mat, const std::string& filename, int sy
|
|||||||
* @tparam DenseMatrixType to write to file
|
* @tparam DenseMatrixType to write to file
|
||||||
* @param mat matrix to write to file
|
* @param mat matrix to write to file
|
||||||
* @param filename filename to write to
|
* @param filename filename to write to
|
||||||
* @return true if writing suceeded
|
* @return true if writing succeeded
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename DenseType>
|
template<typename DenseType>
|
||||||
|
@ -7,24 +7,6 @@
|
|||||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
|
||||||
// import basic and product tests for deprecated DynamicSparseMatrix
|
|
||||||
#if 0 // sparse_basic(DynamicSparseMatrix) does not compile at all -> disabled
|
|
||||||
static long g_realloc_count = 0;
|
|
||||||
#define EIGEN_SPARSE_COMPRESSED_STORAGE_REALLOCATE_PLUGIN g_realloc_count++;
|
|
||||||
|
|
||||||
static long g_dense_op_sparse_count = 0;
|
|
||||||
#define EIGEN_SPARSE_ASSIGNMENT_FROM_DENSE_OP_SPARSE_PLUGIN g_dense_op_sparse_count++;
|
|
||||||
#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN g_dense_op_sparse_count+=10;
|
|
||||||
#define EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN g_dense_op_sparse_count+=20;
|
|
||||||
|
|
||||||
#define EIGEN_SPARSE_TEST_INCLUDED_FROM_SPARSE_EXTRA 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EIGEN_NO_DEPRECATED_WARNING
|
|
||||||
// Disable counting of temporaries, since sparse_product(DynamicSparseMatrix)
|
|
||||||
// has an extra copy-assignment.
|
|
||||||
#define EIGEN_SPARSE_PRODUCT_IGNORE_TEMPORARY_COUNT
|
|
||||||
#include "sparse_product.cpp"
|
#include "sparse_product.cpp"
|
||||||
|
|
||||||
#ifdef min
|
#ifdef min
|
||||||
@ -55,21 +37,6 @@ bool test_random_setter(SparseMatrix<Scalar,Options>& sm, const DenseType& ref,
|
|||||||
return sm.isApprox(ref);
|
return sm.isApprox(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename SetterType,typename DenseType, typename T>
|
|
||||||
bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const std::vector<Vector2i>& nonzeroCoords)
|
|
||||||
{
|
|
||||||
sm.setZero();
|
|
||||||
std::vector<Vector2i> remaining = nonzeroCoords;
|
|
||||||
while(!remaining.empty())
|
|
||||||
{
|
|
||||||
int i = internal::random<int>(0,static_cast<int>(remaining.size())-1);
|
|
||||||
sm.coeffRef(remaining[i].x(),remaining[i].y()) = ref.coeff(remaining[i].x(),remaining[i].y());
|
|
||||||
remaining[i] = remaining.back();
|
|
||||||
remaining.pop_back();
|
|
||||||
}
|
|
||||||
return sm.isApprox(ref);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& ref)
|
template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& ref)
|
||||||
{
|
{
|
||||||
const Index rows = ref.rows();
|
const Index rows = ref.rows();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user