Sundry questions on composing and solving equations with TAUCS

109 views
Skip to first unread message

Olumide

unread,
Feb 21, 2009, 3:36:08 PM2/21/09
to matrixprogramming
Hi,

I'm still very new to TAUCS and I'm trying to get it to work within my
application by writing matrices generated by my app to a file and then
trying to solve them in a standalone application, in order to find the
source of the the errors I'm getting i.e. have I misformed the TAUCS
(CCS) matrix, or am I misconfiguring the solver (the standalone TAUCS
solver keeps telling me that my matrix is not positive definite).

In order to check if the problem is the latter, I created a small
example, using the matrix on this page http://www.cs.utk.edu/~dongarra/etemplates/node373.html#sparseA,
and the rhs vector [1 2 3 4 5 6]. Using scilab, I've checked that the
solution to this system is:
[ 0.28632 , 0.64530 , -1.32473 , 1.29725 , 0.93162 , -1.55556 ].
Unfortunately, I cannot get TAUCS to solve this equation. I've
included the relevant portion of code below. I keep getting all sorts
of errors, especially regarding the non-symmetric nature of the
matrix. I've tried a number of other options, but TAUCS still
complains about the non-symmetric nature of the matrix.

Thanks,

- Olumide


/////////////////////////// code ///////////////////////////

double val[19] = { 10 , 3 , 3 ,
9 , 7, 8, 4,
8 , 8 ,
7 , 7, 9 ,
-2, 5 , 9 , 2,
3 , 13, -1
};

int rowId[19] = { 0 , 1 , 3 ,
1 , 2, 4, 5,
2 , 3 ,
2 , 3, 4 ,
0, 3 , 4 , 5,
1 , 4, 5
};

int colPtr[7] = {0 , 3 , 7 , 9 , 12, 16, 19};
double data[6] = {1, 2, 3, 4, 5, 6};

taucs_ccs_matrix A;
A.n = 6;
A.m = 6;
A.flags = TAUCS_DOUBLE;
A.colptr = colPtr;
A.rowind = rowId;
A.values.d = val;

double xv[6];
taucs_double* x = xv;
taucs_double* b = data;

// solve the linear system
void* F = NULL;
char* options[] = {"taucs.factor.LLT=true" , NULL}; //
void* opt_arg[] = { NULL };

taucs_logfile("stdout");
//cout << "Begin ..." << endl;
int stat = taucs_linsolve(&A, &F, 1, x, b, options, opt_arg);

Olumide

unread,
Feb 21, 2009, 8:39:31 PM2/21/09
to matrixprogramming
'Still trying to figure out why I'm getting errors in my code, I
created the following small, sparse, symmetric matrix (because TAUCS
insists on them)

[10 3 0 3 0 0 ]
[ 3 9 7 0 8 4 ]
[ 0 7 8 8 0 0 ]
[ 3 0 8 7 9 0 ]
[ 0 8 0 9 9 2 ]
[ 0 4 0 0 2 -1 ]

This matrix is invertible, I've checked it in scilab.

Accordingly, I've made the following change to my code:

double val[22] = { 10 , 3 , 3 , 3 , 9 , 7 , 8 , 4 , 7 , 8 , 8 , 3 ,
8 , 7 , 9 , 8 , 9 , 9 , 2 , 4 , 2 ,-1 };
int rowId[22] = { 0 , 1 , 3 , 0 , 1 , 2 , 4 , 5 , 1 , 2 , 3 , 0 ,
2 , 3 , 4 , 1 , 2 , 3 , 4 , 1 , 4 , 5 };
int colPtr[7] = { 0 , 3 , 8 , 11 , 15 , 19, 22};
double data[6] = {1, 2, 3, 4, 5, 6}; // unchanged

the test of the code is the same as above. However, I keep getting the
error message:

taucs_linsolve: preparing to factor
taucs_linsolve: ordering (llt=1, lu=0, ordering=metis)
taucs_ccs_treeorder: METIS ordering only works on symmetric matrices.
taucs_factor: ordering failed
taucs_linsolve: an error occured, releasing resources and bailing out
Solution error.
NOMEM error.

Olumide

unread,
Feb 21, 2009, 10:05:14 PM2/21/09
to matrixprogramming
I've just tried to solve a lower triangular version of this matrix,
but TAUCS reports that the matrix is not positive-definite. I've
confirmed this in Scilab (ignorant me ... I thought all invertible
matrices had to be positive definite).

Question is, can TAUCS solve a matrix that is not positive definite?

Here is the relevant part of my code -- the matrix is now in lower
triangular form:

double val[14] = { 10, 3, 3, 9 , 7 , 8 , 4, 8 , 8, 7, 9, 9, 2, -1 };
int rowId[14] = { 0, 1, 3, 1 , 2 , 4 , 5, 2 , 3, 3, 4, 4, 5, 5 };
int colPtr[7] = {0, 3, 7, 9, 11, 13, 14};
double data[6] = {1, 2, 3, 4, 5, 6};

taucs_ccs_matrix A;
A.n = 6;
A.m = 6;
A.flags = TAUCS_DOUBLE | TAUCS_SYMMETRIC | TAUCS_LOWER;

Evgenii Rudnyi

unread,
Feb 22, 2009, 2:40:56 AM2/22/09
to matrixpr...@googlegroups.com
Olumide schrieb:

> I've just tried to solve a lower triangular version of this matrix,
> but TAUCS reports that the matrix is not positive-definite. I've
> confirmed this in Scilab (ignorant me ... I thought all invertible
> matrices had to be positive definite).
>
> Question is, can TAUCS solve a matrix that is not positive definite?

TAUCS has LDL^t decomposition for indefinite matrices -
taucs_ccs_factor_ldlt - but this routine is not multifrontal and as a
results it is very slow.

TAUCS has also LU for asymmetric matrices - taucs_ooc_factor_lu - only
out-of-core - but the performance also is not that good.

So, basically TAUCS is very good for symmetric positive definite
matrices only (you must specify only a half of the matrix). If this is
not the case, I would recommend UMFPACK.

Olumide

unread,
Feb 22, 2009, 2:23:25 PM2/22/09
to matrixprogramming
> So, basically TAUCS is very good for symmetric positive definite
> matrices only (you must specify only a half of the matrix). If this is
> not the case, I would recommend UMFPACK.

Thanks.

Actually, the matrices I would like to solve are positive definite,
and are constructed from Wendland's compactly supported RBFs (CSRBFs).
However, for some reason, TAUCS is reporting that the matrices are not
positive definite.

One quick question (for anyone that knows about Wendland's CSRBFs): is
the value of this RBF 1 at r = 0? (I think it is).

One other question: I'd like to export some large matrices constructed
by my primary application (a Maya plugin) so that I can run tests on
them in standalone applications or scilab. However, the only matrix
write/export option available is taucs_ccs_write_ijv. None others
appear to exist in taucs_private.h. This makes it almost impossible to
run tests on my matrices in external applications that do not support
the ijv format.

Olumide

unread,
Feb 22, 2009, 2:40:43 PM2/22/09
to matrixprogramming
> So, basically TAUCS is very good for symmetric positive definite
> matrices only (you must specify only a half of the matrix). If this is
> not the case, I would recommend UMFPACK.

Evgenii, I hope you don't mind suggesting this, but it would be nice
if you prepared a sort of table, listing the features/strength of each
sparse matrix library, e.g. positive definiteness, distributed
computation, out of core. Such a table would help novices like myself
make an informed choice about which library to use.

Mark Hoemmen

unread,
Feb 22, 2009, 8:27:08 PM2/22/09
to matrixpr...@googlegroups.com
On Sun, Feb 22, 2009 at 11:23, Olumide <50...@web.de> wrote:
> One other question: I'd like to export some large matrices constructed
> by my primary application (a Maya plugin) so that I can run tests on
> them in standalone applications or scilab. However, the only matrix
> write/export option available is taucs_ccs_write_ijv. None others
> appear to exist in taucs_private.h. This makes it almost impossible to
> run tests on my matrices in external applications that do not support
> the ijv format.

I wrote the BeBOP Sparse Matrix Converter:

http://bebop.cs.berkeley.edu/smc/

specifically to do these kinds of format conversions -- you are
welcome to use it.

mfh

Olumide

unread,
Feb 22, 2009, 8:42:05 PM2/22/09
to matrixprogramming
> Actually, the matrices I would like to solve are positive definite,
> and are constructed from Wendland's compactly supported RBFs (CSRBFs).
> However, for some reason, TAUCS is reporting that the matrices are not
> positive definite.
>
> One quick question (for anyone that knows about Wendland's CSRBFs): is
> the value of this RBF 1 at r = 0? (I think it is).

This is the paper I'm trying to implement http://www.cs.umbc.edu/~rheingan/pubs/smi2001.pdf
. The authors mention on page 5 that they use a "direct sparse solver
to find a solution to the system of equations".

PeterHost.Ru User

unread,
Feb 23, 2009, 7:06:31 AM2/23/09
to matrixpr...@googlegroups.com

This would be a
good idea. However, please note that the sparse matrices are very
different, so this should be considered as a very rought estimate. My
experience is with matrices from FEM - if your matrices are different,
then the answer could differ.

Briefly. TAUCS is for positive
definite. MUMPS (not UMFPACK) for the rest. At present I use basically
MUMPS only, as for positive definite it is comparable with TAUCS. Yet,
there was a discussion on the MUMPS list that for some matrix, UMFPACK was
better than MUMPS. In my experience for FEM, MUMPS is better.

This week I am on vacation, so my activity on this list will be
small. 


Olumide

unread,
Feb 23, 2009, 11:36:55 PM2/23/09
to matrixprogramming
> > Actually, the matrices I would like to solve are positive definite,
> > and are constructed from Wendland's compactly supported RBFs (CSRBFs).
> > However, for some reason, TAUCS is reporting that the matrices are not
> > positive definite.
>
> > One quick question (for anyone that knows about Wendland's CSRBFs): is
> > the value of this RBF 1 at r = 0? (I think it is).
>
> This is the paper I'm trying to implementhttp://www.cs.umbc.edu/~rheingan/pubs/smi2001.pdf
> . The authors mention on page 5 that they use a "direct sparse solver
> to find a solution to the system of equations".

I''ve just posted the following question on comp.grapics.algorithms
(thread url http://tinyurl.com/dg3xfd ) as well as a number of other
forums:

I am trying to construct a matrix using Wendland's Compact-Support RBF
as described in the following the paper, http://www.cs.umbc.edu/~rheingan/pubs/smi2001.pdf
. In particular, I'm using the C2, d = 3 RBF: (1 - r)^4*(4r + 1). It
seems quite simple enough, but none of the matrices I've constructed
are positive definite, although Wendland's RBFs guarantee positive
definite matrices -- the sparse solver I intend to use requires
positive definite matrices.

Below are the relevant portions of my code in which I initialize my
matrix. Is there anything I'm doing wrong?

PS: the matrix format used in the code sample below is not the same
one I use in my TAUCS solver

//////////////////////////// code ////////////////////////////


for( unsigned i = 0; i < constraintCount; ++i )
{
for( unsigned j = 0; j < i; ++j )
{
rbfMatrix[i][j] = rbfMatrix[j][i] = computeRBF( j , i );
}

rbfMatrix[i][i] = 1.0;
rbfMatrix[constraintCount+0][i]= rbfMatrix[i][constraintCount+0] =
constraint[i].x;
rbfMatrix[constraintCount+1][i]= rbfMatrix[i][constraintCount+1] =
constraint[i].y;
rbfMatrix[constraintCount+2][i]= rbfMatrix[i][constraintCount+2] =
constraint[i].z;
rbfMatrix[constraintCount+3][i]= rbfMatrix[i][constraintCount+3] =
1.0;
}

double computeRBF( unsigned i, unsigned j )
{
double radius2 = ( constraint[i].x - constraint[j].x )*( constraint
[i].x - constraint[j].x ) + ( constraint[i].y - constraint[j].y )*
( constraint[i].y - constraint[j].y ) + ( constraint[i].z - constraint
[j].z )*( constraint[i].z - constraint[j].z );
double radius = sqrt(radius2);

double r = radius/alpha;
return ( r < 1.0 ) ? pow( (1 - r) , 4 ) * (4*r + 1) : 0;
}

Mark Hoemmen

unread,
Feb 24, 2009, 12:09:27 AM2/24/09
to matrixpr...@googlegroups.com
I recommend using a service such as paste.org if you plan to post
source code. E-mail tends to mess up the formatting of your source
code, making it an illegible mess. "Paste bin" services like
paste.org do automatic formatting of your source code. They also let
us look it up as a URL, rather than filling our e-mail inboxes with a
lot of source code.

mfh

Evgenii Rudnyi

unread,
Feb 24, 2009, 1:48:03 AM2/24/09
to matrixpr...@googlegroups.com
> trying to construct a matrix using Wendland's Compact-Support RBF
> as described in the following the paper,
> http://www.cs.umbc.edu/~rheingan/pubs/smi2001.pdf
> . In particular, I'm using the C2, d = 3 RBF: (1 - r)^4*(4r + 1). It
> seems quite simple enough, but none of the matrices I've constructed
> are positive definite, although Wendland's RBFs guarantee positive
> definite matrices -- the sparse solver I intend to use requires
> positive definite matrices.

It would be good to find some example, that is, a matrix that one has
already made. Alternatively to use Mathematica or Matlab to construct such
a matrix by hand. This would help a lot to develop a code. To debug a code
without having an example/benchmark is hard.

I would advise first prototyping with something like Mathematica/Matlab -
producing examples - and only then programming in C/C++ and using examples
from the previous step for debugging.

Olumide

unread,
Feb 25, 2009, 1:17:42 PM2/25/09
to matrixprogramming
> I would advise first prototyping with something like Mathematica/Matlab -
> producing examples - and only then programming in C/C++ and using examples
> from the previous step for debugging.

I've spent the day doing this. And I can now confirm that only the
upper left portion of my matrix is indeed positive definite as
Wendland guarantees. However, when I add the remaining constraint and
zero blocks, the whole matrix ceased to be positive definite; i.e.

[ R C ]
[ C' 0 ]

R by itself is positive definite, but the entire matrix isn't positive
definite. Can TAUCS still handle a matrix like this? If not, which
solver do you recommend? The authors of the paper claimed to use a
"direct (LU) sparse matrix solver", which I suspect TAUCS implements
(not sure tho').

Thanks.

Mark Hoemmen

unread,
Feb 25, 2009, 1:53:54 PM2/25/09
to matrixpr...@googlegroups.com
On Wed, Feb 25, 2009 at 10:17, Olumide <50...@web.de> wrote:
>> I would advise first prototyping with something like Mathematica/Matlab -
>> producing examples - and only then programming in C/C++ and using examples
>> from the previous step for debugging.
>
> I've spent the day doing this. And I can now confirm that only the
> upper left portion of my matrix is indeed positive definite as
> Wendland guarantees. However, when I add the remaining constraint and
> zero blocks, the whole matrix ceased to be positive definite; i.e.
>
> [ R  C ]
> [ C' 0 ]
>
> R by itself is positive definite, but the entire matrix isn't positive
> definite.

That's right, any matrix with that structure is not positive definite.
Suppose a vector x has the block structure

x = [ 0
x_2 ]

where x_2 is nonzero. Then if A is your matrix, x^T A x = 0. That
means A can't be positive definite.

> Can TAUCS still handle a matrix like this? If not, which
> solver do you recommend? The authors of the paper claimed to use a
> "direct (LU) sparse matrix solver", which I suspect TAUCS implements
> (not sure tho').

You can use LU, or a symmetric indefinite solver (LDL^T factorization).

mfh

Olumide

unread,
Feb 25, 2009, 7:29:21 PM2/25/09
to matrixprogramming
> You can use LU, or a symmetric indefinite solver (LDL^T factorization).

I've tried the ldlt as well as all three llt direct solvers, but for
some reason they all conk out with the error message:
Assertion failed: i >= j, file src\taucs_ccs_factor_llt.c, line 77

I've uploaded the m-file (matrix_builder.m) with which I constructed
the matrix, first in full then converted to ccs format. This m-file
reads the file PolySphereConstraints.txt (also uploaded) and writes
out the binary ccs file 'sparse_matrix', which I attempt to factorize
with the following lines of C++ code:

taucs_ccs_matrix *A = taucs_ccs_read_binary("C:/tmp2/sparse_matrix" );

taucs_ccs_factor_ldlt( A );
// taucs_ccs_factor_llt_ll( A );
// taucs_ccs_factor_llt_ll_ll( A );
// taucs_ccs_factor_llt_ll_mf( A );


Note: data reads and writes are to/from the directory 'C:/tmp2'

Olumide

unread,
Feb 26, 2009, 1:27:18 PM2/26/09
to matrixprogramming
On 26 Feb, 00:29, Olumide <50...@web.de> spake forth:
I've also uploaded the binary sparse matrix (url http://tinyurl.com/bxvwd5
-- file name 'sparse_matrix'). Can someone please help check if the
assert error is caused by my data, or if my attempt at factorizing the
matrix is wrong.

Thanks.

Olumide

unread,
Feb 26, 2009, 1:52:43 PM2/26/09
to matrixprogramming
On 26 Feb, 00:29, Olumide <50...@web.de> spake forth:

Olumide

unread,
Feb 27, 2009, 12:42:52 PM2/27/09
to matrixprogramming
> Evgenii, I hope you don't mind suggesting this, but it would be nice
> if you prepared a sort of table, listing the features/strength of each
> sparse matrix library, e.g. positive definiteness, distributed
> computation, out of core. Such a table would help novices like myself
> make an informed choice about which library to use.

I've just found one such table:
http://www.cise.ufl.edu/research/sparse/codes/

Olumide

unread,
Feb 27, 2009, 6:07:14 PM2/27/09
to matrixprogramming
> > > You can use LU, or a symmetric indefinite solver (LDL^T factorization).
>
> > I've tried the ldlt as well as all three llt direct solvers, but for
> > some reason they all conk out with the error message:
> > Assertion failed: i >= j, file src\taucs_ccs_factor_llt.c, line 77
>
> > I've uploaded the m-file (matrix_builder.m) with which I constructed
> > the matrix, first in full then converted to ccs format. This m-file
> > reads the file PolySphereConstraints.txt (also uploaded) and writes
> > out the binary ccs file 'sparse_matrix', which I attempt to factorize
> > with the following lines of C++ code:
>
> > taucs_ccs_matrix *A = taucs_ccs_read_binary("C:/tmp2/sparse_matrix" );
>
> > taucs_ccs_factor_ldlt( A );
> > // taucs_ccs_factor_llt_ll( A );
> > // taucs_ccs_factor_llt_ll_ll( A );
> > // taucs_ccs_factor_llt_ll_mf( A );
>
> I've also uploaded the binary sparse matrix (urlhttp://tinyurl.com/bxvwd5
> -- file name 'sparse_matrix'). Can someone please help check if the
> assert error is caused by my data, or if my attempt at factorizing the
> matrix is wrong.

I've also tried to reorder my matrix but the function taucs_ccs_order
fails for all permulation types except identity. Does this mean
something is wrong with the composition of my matrix?

BTW, the reordering works with the builtin matrix generator
taucs_ccs_mesh2d_generate.

Evgenii Rudnyi

unread,
Feb 28, 2009, 11:18:04 AM2/28/09
to matrixpr...@googlegroups.com
Olumide schrieb:

You may also want to look at

FREELY AVAILABLE SOFTWARE FOR LINEAR ALGEBRA ON THE WEB (September 2006)

http://www.netlib.org/utk/people/JackDongarra/la-sw.html

Recently on NA Digest he has promised to update this table.

Evgenii Rudnyi

unread,
Feb 28, 2009, 2:01:12 PM2/28/09
to matrixpr...@googlegroups.com
Olumide schrieb:
...

> R by itself is positive definite, but the entire matrix isn't positive
> definite. Can TAUCS still handle a matrix like this? If not, which
> solver do you recommend? The authors of the paper claimed to use a
> "direct (LU) sparse matrix solver", which I suspect TAUCS implements
> (not sure tho').

TAUCS implements Cholesky decomposition. One can consider it as a
special case of LU for a symmetric positive definite matrix. But it is
applicable only for a symmetric positive definite matrix.

Evgenii Rudnyi

unread,
Feb 28, 2009, 2:08:02 PM2/28/09
to matrixpr...@googlegroups.com
Olumide schrieb:

I do not have MATLAB and to check what you have done I would prefer to
have a matrix in the Matrix Market format. Could you please save it in
MATLAB in the Matrix Market format? The code to do it is at

http://math.nist.gov/MatrixMarket/formats.html#MMformat

Then if this works with the Matrix Market - I can check it quickly, then
something is wrong with the matrix.

Olumide

unread,
Feb 28, 2009, 10:57:23 PM2/28/09
to matrixprogramming
> I do not have MATLAB and to check what you have done I would prefer to
> have a matrix in the Matrix Market format. Could you please save it in
> MATLAB in the Matrix Market format?

I've uploaded the matrix in the MM format. Please refer to the file
ConstraintMatrix.mmf .

I took your advise about prototyping in Matlab and I was able to
factor and solve the linear system in Octave with the LU decomposition
technique/functions. This proves that the problem is with TAUCS and
not really my Matrix. My Matrix though symmetric is not positive
definite. I think it is either indefinite or semidefinite.

So I've all but given up on TAUCS and I'm now searching for a new
library to use. I may consider MUMPS as per your recent threads.

Evgenii Rudnyi

unread,
Mar 1, 2009, 4:11:10 AM3/1/09
to matrixpr...@googlegroups.com
Olumide schrieb:

>> I do not have MATLAB and to check what you have done I would prefer to
>> have a matrix in the Matrix Market format. Could you please save it in
>> MATLAB in the Matrix Market format?
>
> I've uploaded the matrix in the MM format. Please refer to the file
> ConstraintMatrix.mmf .

Please note that you file contains not a half but the full matrix. I
have not found what TAUCS does in this case but the code enclosed
(test_mtx.cpp) is working by me. I have used taucs_ccs_read_ijv -
taucs_ccs_read_mtx was giving the wrong number of columns. The output is
as follows

10
taucs_ccs_read_ijv: allocating 12500 ijv's
taucs_ccs_read_ijv: allocating 15625 ijv's
taucs_ccs_read_ijv: read ConstraintMatrix.mmf, n=428
428 428
20
30
40
Elimination tree depth is 217
Symbolic Analysis of LL^T: 4.10e+004 nonzeros,
4.79e+006 flops, 4.39e+005 bytes in L
Relaxed Analysis of LL^T: 5.03e+004 nonzeros,
7.12e+006 flops, 5.63e+005 bytes in L
Symbolic Analysis = 0.000 seconds
(0.000 cpu)
sivan 110 94
LL^T Factorization: Matrix is not positive definite.
nonpositive pivot in column 423
Supernodal Multifrontal LL^T = 0.015 seconds
(0.000 cpu)
50
taucs_ccs_factor_ldlt: starting n=428
taucs_ccs_factor_ldlt: done; nnz(L) = 4.10e+004, flops=9.57e+006
60

That is, Cholesky fails but LDL^T seems to work. It would be safer to
feed not the full matrix but only its half but hopefully TAUCS ignores
exra matrix components. But I do not know - have never done it.

test_mtx.cpp

Olumide

unread,
Mar 1, 2009, 9:48:12 AM3/1/09
to matrixprogramming
> [test_mtx.cpp< 1K ]#include <iostream>

I'm having difficulty compiling this program within MSVS .NET 2003.
I'm getting the following error message:

libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__malloc_dbg referenced in function "void * __cdecl operator new
(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??
2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol
__malloc_dbg
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol
__free_dbg referenced in function "void __cdecl operator delete(void
*,struct std::_DebugHeapTag_t const &,char *,int)" (??
3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)

The libraries I've included are:

blas_win32.lib
libatlas.lib
libf77blas.lib
libmetis.lib
vcf2c.lib
lapack_win32.lib
libcblas.lib
liblapack.lib
libtaucs.lib

Olumide

unread,
Mar 1, 2009, 10:00:37 AM3/1/09
to matrixprogramming
On 1 Mar, 14:48, Olumide <50...@web.de> wrote:
> > [test_mtx.cpp< 1K ]#include <iostream>
>
> I'm having difficulty compiling this program within MSVS .NET 2003.
> I'm getting the following error message:

I've also tried compiling and linking on the command line, using the
VS.NET command prompt, but I got the following error message:
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
LIBC.lib(printf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _rand already defined in
LIBC.lib(rand.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fflush already defined in
LIBC.lib(fflush.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _vfprintf already defined
in LIBC.lib(vfprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _exit already defined in
LIBC.lib(crt0dat.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fprintf already defined in
LIBC.lib(fprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fopen already defined in
LIBC.lib(fopen.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _sprintf already defined in
LIBC.lib(sprintf.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _floor already defined in
LIBC.lib(floor_pentium4.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _malloc already defined in
LIBC.lib(malloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _calloc already defined in
LIBC.lib(calloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _realloc already defined in
LIBC.lib(realloc.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _free already defined in
LIBC.lib(free.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _fclose already defined in
LIBC.lib(fclose.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info
const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC.lib
(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator
=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already
defined in LIBC.lib(typinfo.obj)

MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: __close already defined in
LIBC.lib(close.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: __read already defined in
LIBC.lib(read.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: __open already defined in
LIBC.lib(open.obj)
MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: __write already defined in
LIBC.lib(write.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of
other libs; use /NODEFAULTLIB:lib
rary
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of
other libs; use /NODEFAULTLIB:libr
ary
TaucsFactor.exe : fatal error LNK1169: one or more multiply defined
symbols found

Evgenii Rudnyi

unread,
Mar 1, 2009, 10:25:15 AM3/1/09
to matrixpr...@googlegroups.com
Olumide schrieb:

> On 1 Mar, 14:48, Olumide <50...@web.de> wrote:
>>> [test_mtx.cpp< 1K ]#include <iostream>
>> I'm having difficulty compiling this program within MSVS .NET 2003.
>> I'm getting the following error message:
>
> I've also tried compiling and linking on the command line, using the
> VS.NET command prompt, but I got the following error message:
> MSVCRTD.lib(MSVCR71D.dll) : error LNK2005: _printf already defined in
> LIBC.lib(printf.obj)
...

> LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of
> other libs; use /NODEFAULTLIB:lib
> rary
> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of
> other libs; use /NODEFAULTLIB:libr
> ary
> TaucsFactor.exe : fatal error LNK1169: one or more multiply defined
> symbols found

This is a conflict between two different runtime libraries. Presumably
the code and libraries are compiled with different switches. Have you
compiled the code with /MD?

Was you able to compile other test TAUCS programs previously? This code
should be compiled the same way as samples at

http://matrixprogramming.com/TAUCS/

I thought that you have managed to compile them. Haven't you?

Olumide

unread,
Mar 1, 2009, 10:55:30 AM3/1/09
to matrixprogramming
> This is a conflict between two different runtime libraries. Presumably
> the code and libraries are compiled with different switches. Have you
> compiled the code with /MD?

No, I compiled the program in the IDE with the /MT switch.

> Was you able to compile other test TAUCS programs previously?
> ...
> I thought that you have managed to compile them. Haven't you?

Yes I have compiled test_taucs.cpp via command line in the past. Today
however, the process failed to compile, and spat out an error message
similar to the one above. It appears I've tampered with my Makefile
while trying to produce an /Md version of the library. I'll take a
look ...

Olumide

unread,
Mar 1, 2009, 12:02:35 PM3/1/09
to matrixprogramming
> Yes I have compiled test_taucs.cpp via command line in the past. Today
> however, the process failed to compile, and spat out an error message
> similar to the one above. It appears I've tampered with my Makefile
> while trying to produce an /Md version of the library. I'll take a
> look ...

Yes I did tamper with the makefile but now that's been corrected both
test_taucs.cpp and test_mtx.cpp now compile on command line, but still
not in the IDE.

Fortunately, I had the good sense to copy the lib file I've been using
to another from \lib to another directory where it was safe from all
the changes I was making to the makefile, so the problem was not due
to the fact that I;d tampered with the makefile.

The problem was the iostream cout statements used by test_mtx.cpp.
Upon commenting them out, the test_mtx.cpp compiled in the IDE.

Olumide

unread,
Mar 1, 2009, 2:31:33 PM3/1/09
to matrixprogramming
> The problem was the iostream cout statements used by test_mtx.cpp.
> Upon commenting them out, the test_mtx.cpp compiled in the IDE.

I've now resumed trying out bits of TAUCS code in my (Maya) DLL
project. Here are my observations:

1. For some unknown reason, the function taucs_logfile("stdout")
compiles fine, but halts the execution of my plugin when executed.

2. The output of the file written by taucs_ccs_write_ijv cannot be
read back by taucs_ccs_read_ijv. I had to manually type in the matrix
dimensions and the number of non zeros into the first line of the
file. Furthermore, the ccs, and mtx writers advertised in the docs are
not available.

Mark Hoemmen

unread,
Mar 1, 2009, 7:35:16 PM3/1/09
to matrixpr...@googlegroups.com
On Sun, Mar 1, 2009 at 11:31, Olumide <50...@web.de> wrote:
> 2. The output of the file written by taucs_ccs_write_ijv cannot be
> read back by taucs_ccs_read_ijv. I had to manually type in the matrix
> dimensions and the number of non zeros into the first line of the
> file. Furthermore, the ccs, and mtx writers advertised in the docs are
> not available.

Woah, that's broken.

The Sparse Matrix Converter has both read and write routines, if
you're interested.

mfh

Olumide

unread,
Mar 1, 2009, 8:56:58 PM3/1/09
to matrixprogramming
Thanks.

I'm aware of BeBOP. I compiled it over the weekend, and used it to
convert a few MatrixMarket matrices. I meant to ask you a few
questions about the Cygwin compilation, but I can't seem to find the
piece of paper on which I wrote them ...

Olumide

unread,
Mar 1, 2009, 9:11:58 PM3/1/09
to matrixprogramming
I believe I've found the original problem with my program. It has to
do with the format of the taucs_ccs_matrix constructed in runtime.
I've written a simple test program (Debug_ccs_matrixBuilder.cpp --
uploaded) to illustrate what I think the problem is. (This program
requires a list of points, Constraints.txt -- also uploaded.)

Debug_ccs_matrixBuilder.cpp builds a taucs_ccs_matrix A from the data
in Constraints.txt. However, the program crashes when it attempts to
operate on the matrix A, with any of TAUCS' functions. (See line 117
of Debug_ccs_matrixBuilder.cpp. Oddly, taucs_ccs_write_ijv works fine
-- see line 116)

Is there something wrong with my formatting of the matrix A?

Note: A is supposed to have the form:

[R C']
[C 0 ]

where R is a sparse submatrix initialized by the function computeRBF
(), and C is 3 rows of coordinates (x,y, and z's) and a row of 1's.
(C' is the transpose of C).

Mark Hoemmen

unread,
Mar 1, 2009, 11:33:58 PM3/1/09
to matrixpr...@googlegroups.com
Olumide wrote:
> I'm aware of BeBOP. I compiled it over the weekend, and used it to
> convert a few MatrixMarket matrices. I meant to ask you a few
> questions about the Cygwin compilation, but I can't seem to find the
> piece of paper on which I wrote them ...

btw if you have questions specific to the Sparse Matrix Converter,
please e-mail them to me directly, rather than to this list -- I don't
want to distract the ever-diligent Evgenii from his work :)

mfh

Olumide

unread,
Mar 2, 2009, 9:34:01 AM3/2/09
to matrixprogramming
> I believe I've found the original problem with my program. It has to
> do with the format of the taucs_ccs_matrix constructed in runtime.
> I've written a simple test program (Debug_ccs_matrixBuilder.cpp --
> uploaded) to illustrate what I think the problem is. (This program
> requires a list of points, Constraints.txt -- also uploaded.)
>
> Debug_ccs_matrixBuilder.cpp builds a taucs_ccs_matrix A from the data
> in Constraints.txt. However, the program crashes when it attempts to
> operate on the matrix A, with any of TAUCS' functions. (See line 117
> of Debug_ccs_matrixBuilder.cpp. Oddly, taucs_ccs_write_ijv works fine
> -- see line 116)

I'm taking a look at taucs_ccs_io.c hoping to discover how a reader
builds a TAUCS matrix, and of course the functions(s) perform memory
allocation with taucs_malloc. However, I'm getting the linker error:

Debug_ccs_matrixBuilder.obj : error LNK2019: unresolved external
symbol _taucs_malloc referenced in function "void __cdecl _Test_
(void)" (?_Test_@@YAXXZ)

I've changed the previous references to realloc and free to
taucs_realloc and taucs_free, but I'm still getting the above linker
error.

:(


Evgenii Rudnyi

unread,
Mar 2, 2009, 3:40:24 PM3/2/09
to matrixpr...@googlegroups.com
Olumide schrieb:

>> The problem was the iostream cout statements used by test_mtx.cpp.
>> Upon commenting them out, the test_mtx.cpp compiled in the IDE.
>
> I've now resumed trying out bits of TAUCS code in my (Maya) DLL
> project. Here are my observations:
>
> 1. For some unknown reason, the function taucs_logfile("stdout")
> compiles fine, but halts the execution of my plugin when executed.

Try to use some file name, say ttt. If this helps, then it is necessary
to learn how in your settings to write to stdout. Or just check this
file after the run.

Evgenii Rudnyi

unread,
Mar 2, 2009, 3:44:01 PM3/2/09
to matrixpr...@googlegroups.com
Mark Hoemmen schrieb:

Do not worry. It is a fun for me to answer questions from the list, when
I have time. For the last two years I am working as a sales engineer
multiphysics and I miss programming a bit.

Olumide

unread,
Mar 2, 2009, 8:29:50 PM3/2/09
to matrixprogramming
> That is, Cholesky fails but LDL^T seems to work. It would be safer to
> feed not the full matrix but only its half but hopefully TAUCS ignores
> exra matrix components. But I do not know - have never done it.
>
> [test_mtx.cpp< 1K ]#include <iostream>
> ...
>         F = taucs_ccs_factor_llt_mf(Aod);      
>         F = taucs_ccs_factor_ldlt(Aod);

In light of my recent troubles with TAUCS, I reluctantly took the
advise of a colleague and proceed by first manually writing the matrix
data to file in the mtx format and read it back in the same program,
to enable TAUCS set up the matrix. Although this worked, and LDLT
factoring routine ran succesfully, both supernodal factoring routines
taucs_ccs_factor_llt_mf and taucs_ccs_factor_llt_ll fail i.e. return
NULL.

I'm starting to wonder if TAUCS is broken!

Evgenii Rudnyi

unread,
Mar 3, 2009, 4:08:04 PM3/3/09
to matrixpr...@googlegroups.com
Olumide schrieb:

>> I believe I've found the original problem with my program. It has to
>> do with the format of the taucs_ccs_matrix constructed in runtime.
>> I've written a simple test program (Debug_ccs_matrixBuilder.cpp --
>> uploaded) to illustrate what I think the problem is. (This program
>> requires a list of points, Constraints.txt -- also uploaded.)
>>
>> Debug_ccs_matrixBuilder.cpp builds a taucs_ccs_matrix A from the data
>> in Constraints.txt. However, the program crashes when it attempts to
>> operate on the matrix A, with any of TAUCS' functions. (See line 117
>> of Debug_ccs_matrixBuilder.cpp. Oddly, taucs_ccs_write_ijv works fine
>> -- see line 116)
>
> I'm taking a look at taucs_ccs_io.c hoping to discover how a reader
> builds a TAUCS matrix, and of course the functions(s) perform memory
> allocation with taucs_malloc. However, I'm getting the linker error:
>
> Debug_ccs_matrixBuilder.obj : error LNK2019: unresolved external
> symbol _taucs_malloc referenced in function "void __cdecl _Test_
> (void)" (?_Test_@@YAXXZ)
>

I believe that this is NET specific. You have written that you were able
to compile the original example. You have to find out when you start
receiving this message.

I have heard that in NET there are two type of functions - internal and
external. Is it correct? I guess that TAUCS should be an external
application.

Evgenii Rudnyi

unread,
Mar 3, 2009, 4:18:56 PM3/3/09
to matrixpr...@googlegroups.com
Olumide schrieb:

I have not seen problems with taucs_ccs_factor_llt_mf and
taucs_ccs_factor_llt_ll. They can fail if

1) The matrix is not positive definite,
2) There is not enough memory

Please try to make working

taucs_logfile("filename")

Then you should see in the filename some information from which you will
see the reason.

Olumide

unread,
Mar 3, 2009, 8:21:26 PM3/3/09
to matrixprogramming
> > I'm starting to wonder if TAUCS is broken!
>
> I have not seen problems with taucs_ccs_factor_llt_mf and
> taucs_ccs_factor_llt_ll. They can fail if
>
> 1) The matrix is not positive definite,

Its got to be that. My Matrix is not positive definite.

Evgenii Rudnyi

unread,
Mar 7, 2009, 1:49:00 PM3/7/09
to matrixpr...@googlegroups.com
Olumide schrieb:

> I believe I've found the original problem with my program. It has to
> do with the format of the taucs_ccs_matrix constructed in runtime.
> I've written a simple test program (Debug_ccs_matrixBuilder.cpp --
> uploaded) to illustrate what I think the problem is. (This program
> requires a list of points, Constraints.txt -- also uploaded.)
>
> Debug_ccs_matrixBuilder.cpp builds a taucs_ccs_matrix A from the data
> in Constraints.txt. However, the program crashes when it attempts to
> operate on the matrix A, with any of TAUCS' functions. (See line 117
> of Debug_ccs_matrixBuilder.cpp. Oddly, taucs_ccs_write_ijv works fine
> -- see line 116)
>
> Is there something wrong with my formatting of the matrix A?

Yes, you prepare your matrix wrong. From the TAUCS manual

"In symmetric and hermitian matrices we store only one triangle,
normally the lower one. Most of the routines fail if their argument
contain the upper triangle of a symmetric/hermitian matrix."

In you case you use correct attributes

A.flags = (TAUCS_DOUBLE | TAUCS_SYMMETRIC | TAUCS_LOWER);

but in the matrix there are triples where i < j. This is the beginning
of your matrix

1 1 1
426 1 0.949684
427 1 -4.89074
428 1 -0.422826
429 1 1
2 2 1
426 2 1.05071
427 2 -5.37836
428 2 -0.467804
429 2 1
3 3 1
2 3 0.451894

and the last entry is wrong. It should be

3 2 0.451894

And there are many such wrong entries. So you have a crash, as promised.

Reply all
Reply to author
Forward
0 new messages