Go to the documentation of this file.
2 #include <Eigen/Sparse>
34 Scalar v = (internal::random<float>(0,1) <
density) ? internal::random<Scalar>() : 0;
49 for(
int i = 0;
i < nnzPerCol;
i++)
51 int k = internal::random<int>(0,
rows-1);
52 while (aux.find(k)!=aux.end())
53 k = internal::random<int>(0,
rows-1);
56 dst.
insert(k,
j) = internal::random<Scalar>();
65 for (
int j=0;
j<src.
cols(); ++
j)
67 dst(it.index(),
j) = it.value();
77 for (
int j=0;
j<src.
cols(); ++
j)
79 tmp(it.index(),
j) = it.value();
85 #include <boost/numeric/mtl/mtl.hpp>
86 typedef mtl::compressed2D<Scalar, mtl::matrix::parameters<mtl::tag::col_major> >
MtlSparse;
87 typedef mtl::compressed2D<Scalar, mtl::matrix::parameters<mtl::tag::row_major> >
MtlSparseRowMajor;
90 mtl::matrix::inserter<MtlSparse> ins(dst);
91 for (
int j=0;
j<src.
cols(); ++
j)
93 ins[it.index()][
j] = it.value();
103 cs* aux = cs_spalloc (0, 0, 1, 1, 1);
104 for (
int j=0;
j<src.
cols(); ++
j)
106 if (!cs_entry(aux, it.index(),
j, it.value()))
108 std::cout <<
"cs_entry error\n";
111 dst = cs_compress(aux);
117 #include <boost/numeric/ublas/vector.hpp>
118 #include <boost/numeric/ublas/matrix.hpp>
119 #include <boost/numeric/ublas/io.hpp>
120 #include <boost/numeric/ublas/triangular.hpp>
121 #include <boost/numeric/ublas/vector_sparse.hpp>
122 #include <boost/numeric/ublas/matrix_sparse.hpp>
123 #include <boost/numeric/ublas/vector_of_vector.hpp>
124 #include <boost/numeric/ublas/operation.hpp>
126 typedef boost::numeric::ublas::compressed_matrix<Scalar,boost::numeric::ublas::column_major>
UBlasSparse;
130 dst.resize(src.
rows(), src.
cols(),
false);
131 for (
int j=0;
j<src.
cols(); ++
j)
133 dst(it.index(),
j) = it.value();
136 template <
typename EigenType,
typename UblasType>
139 dst.resize(src.size());
140 for (
int j=0;
j<src.size(); ++
j)
141 dst[
j] = src.coeff(
j);
147 #include <oski/oski.h>
Namespace containing all symbols from the Eigen library.
mtl::compressed2D< Scalar, mtl::matrix::parameters< mtl::tag::col_major > > MtlSparse
void eiToDense(const EigenSparseMatrix &src, DenseMatrix &dst)
void fillMatrix(float density, int rows, int cols, EigenSparseMatrix &dst)
int EIGEN_BLAS_FUNC() copy(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
void eiToMtl(const EigenSparseMatrix &src, MtlSparse &dst)
void eiToUblasVec(const EigenType &src, UblasType &dst)
gmm::col_matrix< gmm::wsvector< Scalar > > GmmDynSparse
void eiToUblas(const EigenSparseMatrix &src, UBlasSparse &dst)
void reserve(Index reserveSize)
Matrix< Scalar, Dynamic, 1 > DenseVector
Base::InnerIterator InnerIterator
Scalar & insert(Index row, Index col)
gmm::csc_matrix< Scalar > GmmSparse
Array< int, Dynamic, 1 > v
SparseMatrix< Scalar > EigenSparseMatrix
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
void eiToGmm(const EigenSparseMatrix &src, GmmSparse &dst)
boost::numeric::ublas::compressed_matrix< Scalar, boost::numeric::ublas::column_major > UBlasSparse
mtl::compressed2D< Scalar, mtl::matrix::parameters< mtl::tag::row_major > > MtlSparseRowMajor
void fillMatrix2(int nnzPerCol, int rows, int cols, EigenSparseMatrix &dst)
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:11