(c++) sparse matrix creation

classic Classic list List threaded Threaded
2 messages Options
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

(c++) sparse matrix creation

Hello all,

After searching in sparse.hxx and sparse.cpp I didn' find a method in
class Sparse:: allowing to create a matrix of given dimensions with
preallocation of memory for an initial number of non-zero terms, i.e.
such as

Sparse(int rows, int cols, int nnz, bool cplx = false);

Does such a mehtod exist ?

S.

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: (c++) sparse matrix creation

Le 28/09/2018 à 10:21, Stéphane Mottelet a écrit :

> Hello all,
>
> After searching in sparse.hxx and sparse.cpp I didn' find a method in
> class Sparse:: allowing to create a matrix of given dimensions with
> preallocation of memory for an initial number of non-zero terms, i.e.
> such as
>
> Sparse(int rows, int cols, int nnz, bool cplx = false);
>
> Does such a mehtod exist ?
>
> S.
>
maybe

types::Sparse* pS : new Sparse(rows, cols)

pS->matrixReal->reserve(nnz)

?

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
dev mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/dev