summaryrefslogtreecommitdiff
path: root/modules/sparse
diff options
context:
space:
mode:
authorShashank2017-05-29 12:40:26 +0530
committerShashank2017-05-29 12:40:26 +0530
commit0345245e860375a32c9a437c4a9d9cae807134e9 (patch)
treead51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/sparse
downloadscilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip
CMSCOPE changed
Diffstat (limited to 'modules/sparse')
-rwxr-xr-xmodules/sparse/.libs/libscisparse-algo.abin0 -> 1323630 bytes
l---------modules/sparse/.libs/libscisparse-algo.la1
-rwxr-xr-xmodules/sparse/.libs/libscisparse.abin0 -> 1991822 bytes
l---------modules/sparse/.libs/libscisparse.la1
-rwxr-xr-xmodules/sparse/Makefile2155
-rwxr-xr-xmodules/sparse/Makefile.am198
-rwxr-xr-xmodules/sparse/Makefile.in2155
-rwxr-xr-xmodules/sparse/etc/sparse.quit12
-rwxr-xr-xmodules/sparse/etc/sparse.start13
-rwxr-xr-xmodules/sparse/help/en_US/addchapter.sce11
-rwxr-xr-xmodules/sparse/help/en_US/chfact.xml82
-rwxr-xr-xmodules/sparse/help/en_US/chsolve.xml81
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/CHAPTER1
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/ludel.xml71
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/lufact.xml106
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/luget.xml106
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/lusolve.xml102
-rwxr-xr-xmodules/sparse/help/en_US/decomposition/spchol.xml108
-rwxr-xr-xmodules/sparse/help/en_US/iterativesolvers/CHAPTER1
-rwxr-xr-xmodules/sparse/help/en_US/iterativesolvers/conjgrad.xml406
-rwxr-xr-xmodules/sparse/help/en_US/iterativesolvers/gmres.xml252
-rwxr-xr-xmodules/sparse/help/en_US/iterativesolvers/qmr.xml374
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/CHAPTER1
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/issparse.xml70
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/nnz.xml62
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/speye.xml96
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/spones.xml76
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/sprand.xml190
-rwxr-xr-xmodules/sparse/help/en_US/matrixmanip/spzeros.xml99
-rwxr-xr-xmodules/sparse/help/en_US/ordmmd.xml232
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/CHAPTER1
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/adj2sp.xml230
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/full.xml68
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/mtlb_sparse.xml76
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/sp2adj.xml229
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/sparse.xml143
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/spcompack.xml107
-rwxr-xr-xmodules/sparse/help/en_US/sparseconvert/spget.xml86
-rwxr-xr-xmodules/sparse/help/fr_FR/addchapter.sce11
-rwxr-xr-xmodules/sparse/help/fr_FR/chfact.xml68
-rwxr-xr-xmodules/sparse/help/fr_FR/chsolve.xml82
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/CHAPTER1
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/ludel.xml58
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/lufact.xml109
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/luget.xml105
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/lusolve.xml99
-rwxr-xr-xmodules/sparse/help/fr_FR/decomposition/spchol.xml110
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/CHAPTER1
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/nnz.xml64
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/speye.xml84
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/spones.xml65
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/sprand.xml86
-rwxr-xr-xmodules/sparse/help/fr_FR/matrixmanip/spzeros.xml88
-rwxr-xr-xmodules/sparse/help/ja_JP/addchapter.sce11
-rwxr-xr-xmodules/sparse/help/ja_JP/chfact.xml148
-rwxr-xr-xmodules/sparse/help/ja_JP/chsolve.xml145
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/CHAPTER1
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/ludel.xml126
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/lufact.xml271
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/luget.xml202
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/lusolve.xml175
-rwxr-xr-xmodules/sparse/help/ja_JP/decomposition/spchol.xml173
-rwxr-xr-xmodules/sparse/help/ja_JP/iterativesolvers/CHAPTER1
-rwxr-xr-xmodules/sparse/help/ja_JP/iterativesolvers/conjgrad.xml402
-rwxr-xr-xmodules/sparse/help/ja_JP/iterativesolvers/gmres.xml406
-rwxr-xr-xmodules/sparse/help/ja_JP/iterativesolvers/qmr.xml490
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/CHAPTER1
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/issparse.xml69
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/nnz.xml111
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/speye.xml182
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/spones.xml137
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/sprand.xml332
-rwxr-xr-xmodules/sparse/help/ja_JP/matrixmanip/spzeros.xml100
-rwxr-xr-xmodules/sparse/help/ja_JP/ordmmd.xml388
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/CHAPTER1
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/adj2sp.xml384
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/full.xml125
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/mtlb_sparse.xml145
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/sp2adj.xml369
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/sparse.xml277
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/spcompack.xml165
-rwxr-xr-xmodules/sparse/help/ja_JP/sparseconvert/spget.xml87
-rwxr-xr-xmodules/sparse/help/pt_BR/addchapter.sce11
-rwxr-xr-xmodules/sparse/help/pt_BR/chfact.xml72
-rwxr-xr-xmodules/sparse/help/pt_BR/chsolve.xml82
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/CHAPTER1
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/ludel.xml60
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/lufact.xml136
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/luget.xml110
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/lusolve.xml100
-rwxr-xr-xmodules/sparse/help/pt_BR/decomposition/spchol.xml91
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/CHAPTER1
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/nnz.xml63
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/speye.xml97
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/spones.xml76
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/sprand.xml98
-rwxr-xr-xmodules/sparse/help/pt_BR/matrixmanip/spzeros.xml99
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/CHAPTER1
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/adj2sp.xml101
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/full.xml69
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/mtlb_sparse.xml75
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/sp2adj.xml100
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/sparse.xml122
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/spcompack.xml109
-rwxr-xr-xmodules/sparse/help/pt_BR/sparseconvert/spget.xml93
-rwxr-xr-xmodules/sparse/help/ru_RU/addchapter.sce11
-rwxr-xr-xmodules/sparse/includes/dynlib_sparse.h28
-rwxr-xr-xmodules/sparse/includes/gw_sparse.h51
-rwxr-xr-xmodules/sparse/includes/sp.h52
-rwxr-xr-xmodules/sparse/includes/spConfig.h549
-rwxr-xr-xmodules/sparse/includes/spDefs.h828
-rwxr-xr-xmodules/sparse/includes/spmalloc.h33
-rwxr-xr-xmodules/sparse/includes/spmatrix.h325
-rwxr-xr-xmodules/sparse/libscisparse-algo.la41
-rwxr-xr-xmodules/sparse/libscisparse.la41
-rwxr-xr-xmodules/sparse/license.txt32
-rwxr-xr-xmodules/sparse/locales/ca_ES.po453
-rwxr-xr-xmodules/sparse/locales/cs_CZ.po468
-rwxr-xr-xmodules/sparse/locales/de_DE.po443
-rwxr-xr-xmodules/sparse/locales/es_ES.po465
-rwxr-xr-xmodules/sparse/locales/fr_FR.po486
-rwxr-xr-xmodules/sparse/locales/it_IT.po504
-rwxr-xr-xmodules/sparse/locales/ja_JP.po560
-rwxr-xr-xmodules/sparse/locales/pl_PL.po465
-rwxr-xr-xmodules/sparse/locales/pt_BR.po469
-rwxr-xr-xmodules/sparse/locales/ru_RU.po469
-rwxr-xr-xmodules/sparse/locales/sparse.pot676
-rwxr-xr-xmodules/sparse/locales/uk_UA.po501
-rwxr-xr-xmodules/sparse/locales/zh_CN.po432
-rwxr-xr-xmodules/sparse/locales/zh_TW.po432
-rwxr-xr-xmodules/sparse/macros/%bicg.binbin0 -> 16544 bytes
-rwxr-xr-xmodules/sparse/macros/%bicg.sci189
-rwxr-xr-xmodules/sparse/macros/%bicgstab.binbin0 -> 18388 bytes
-rwxr-xr-xmodules/sparse/macros/%bicgstab.sci202
-rwxr-xr-xmodules/sparse/macros/%cgs.binbin0 -> 16840 bytes
-rwxr-xr-xmodules/sparse/macros/%cgs.sci194
-rwxr-xr-xmodules/sparse/macros/%pcg.binbin0 -> 10992 bytes
-rwxr-xr-xmodules/sparse/macros/%pcg.sci149
-rwxr-xr-xmodules/sparse/macros/adj2sp.binbin0 -> 14676 bytes
-rwxr-xr-xmodules/sparse/macros/adj2sp.sci97
-rwxr-xr-xmodules/sparse/macros/buildmacros.bat11
-rwxr-xr-xmodules/sparse/macros/buildmacros.sce15
-rwxr-xr-xmodules/sparse/macros/chfact.binbin0 -> 20232 bytes
-rwxr-xr-xmodules/sparse/macros/chfact.sci132
-rwxr-xr-xmodules/sparse/macros/chsolve.binbin0 -> 1580 bytes
-rwxr-xr-xmodules/sparse/macros/chsolve.sci22
-rwxr-xr-xmodules/sparse/macros/cleanmacros.bat13
-rwxr-xr-xmodules/sparse/macros/conjgrad.binbin0 -> 30240 bytes
-rwxr-xr-xmodules/sparse/macros/conjgrad.sci280
-rwxr-xr-xmodules/sparse/macros/gmres.binbin0 -> 33560 bytes
-rwxr-xr-xmodules/sparse/macros/gmres.sci308
-rwxr-xr-xmodules/sparse/macros/issparse.binbin0 -> 480 bytes
-rwxr-xr-xmodules/sparse/macros/issparse.sci16
-rwxr-xr-xmodules/sparse/macros/libbin0 -> 620 bytes
-rwxr-xr-xmodules/sparse/macros/names15
-rwxr-xr-xmodules/sparse/macros/qmr.binbin0 -> 58060 bytes
-rwxr-xr-xmodules/sparse/macros/qmr.sci491
-rwxr-xr-xmodules/sparse/macros/sp2adj.binbin0 -> 4892 bytes
-rwxr-xr-xmodules/sparse/macros/sp2adj.sci50
-rwxr-xr-xmodules/sparse/macros/speye.binbin0 -> 1192 bytes
-rwxr-xr-xmodules/sparse/macros/speye.sci16
-rwxr-xr-xmodules/sparse/macros/sprand.binbin0 -> 10408 bytes
-rwxr-xr-xmodules/sparse/macros/sprand.sci74
-rwxr-xr-xmodules/sparse/macros/spzeros.binbin0 -> 1392 bytes
-rwxr-xr-xmodules/sparse/macros/spzeros.sci21
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/.dirstamp0
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-gw_sparse.Plo281
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_bfinit.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkfc1i.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkslvi.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_fadj2sp.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_full.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_inpnvi.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ludel.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lufact.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_luget.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lusolve.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mfull.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_msparse.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mspget.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_nnz.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ordmmd.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sfinit.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sparse.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spchol.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spclean.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spcompa.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spget.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spmatrix.Plo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_symfcti.Plo11
-rwxr-xr-xmodules/sparse/sci_gateway/c/.dirstamp0
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-gw_sparse.obin0 -> 8344 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_bfinit.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkfc1i.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkslvi.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_fadj2sp.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_full.obin0 -> 3808 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_inpnvi.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ludel.obin0 -> 3816 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lufact.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_luget.obin0 -> 3816 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lusolve.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mfull.obin0 -> 3816 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_msparse.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mspget.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_nnz.obin0 -> 3808 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ordmmd.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sfinit.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sparse.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spchol.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spclean.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spcompa.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spget.obin0 -> 3816 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spmatrix.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_symfcti.obin0 -> 3832 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/c/gw_sparse.c61
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-gw_sparse.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_bfinit.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_blkfc1i.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_blkslvi.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_fadj2sp.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_full.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_inpnvi.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_ludel.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_lufact.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_luget.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_lusolve.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_mfull.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_msparse.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_mspget.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_nnz.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_ordmmd.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_sfinit.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_sparse.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_spchol.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_spclean.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_spcompa.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_spget.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_spmatrix.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/libscisparse_la-sci_symfcti.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_bfinit.c22
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_blkfc1i.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_blkslvi.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_fadj2sp.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_full.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_inpnvi.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_ludel.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_lufact.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_luget.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_lusolve.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_mfull.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_msparse.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_mspget.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_nnz.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_ordmmd.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_sfinit.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_sparse.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_spchol.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_spclean.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_spcompa.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_spget.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_spmatrix.c23
-rwxr-xr-xmodules/sparse/sci_gateway/c/sci_symfcti.c23
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.deps/.dirstamp0
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.dirstamp0
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_bfinit.obin0 -> 16296 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_blkfc1i.obin0 -> 18416 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_blkslvi.obin0 -> 15312 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_fadj2sp.obin0 -> 14248 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_full.obin0 -> 18872 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_inpnvi.obin0 -> 17656 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_ludel.obin0 -> 15416 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_lufact.obin0 -> 19232 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_luget.obin0 -> 17792 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_lusolve.obin0 -> 22728 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_nnz.obin0 -> 16664 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_ordmmd.obin0 -> 16456 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_sfinit.obin0 -> 18784 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_sparse.obin0 -> 31752 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_spchol.obin0 -> 28248 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_spclean.obin0 -> 19664 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_spcompa.obin0 -> 14584 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_spget.obin0 -> 22632 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_spmatrix.obin0 -> 24920 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_symfcti.obin0 -> 19544 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/sci_f_ta2lpd.obin0 -> 20440 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/.libs/spops.obin0 -> 155472 bytes
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_bfinit.f76
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_bfinit.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_blkfc1i.f82
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_blkfc1i.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_blkslvi.f70
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_blkslvi.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_fadj2sp.f65
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_fadj2sp.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_full.f106
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_full.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_inpnvi.f77
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_inpnvi.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ludel.f58
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ludel.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_lufact.f126
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_lufact.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_luget.f111
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_luget.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_lusolve.f149
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_lusolve.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_nnz.f71
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_nnz.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ordmmd.f91
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ordmmd.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_sfinit.f91
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_sfinit.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_sparse.f275
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_sparse.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spchol.f178
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spchol.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spclean.f89
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spclean.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spcompa.f66
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spcompa.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spget.f145
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spget.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spmatrix.f176
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_spmatrix.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_symfcti.f87
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_symfcti.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ta2lpd.f87
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/sci_f_ta2lpd.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/spops.f2278
-rwxr-xr-xmodules/sparse/sci_gateway/fortran/spops.lo12
-rwxr-xr-xmodules/sparse/sci_gateway/sparse_gateway.xml60
-rwxr-xr-xmodules/sparse/sparse.iss46
-rwxr-xr-xmodules/sparse/src/c/.deps/.dirstamp0
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-lu.Plo189
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-mspelm.Plo214
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spAllocate.Plo161
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spBuild.Plo164
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spFactor.Plo166
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spOutput.Plo218
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spSolve.Plo151
-rwxr-xr-xmodules/sparse/src/c/.deps/libscisparse_algo_la-spUtils.Plo163
-rwxr-xr-xmodules/sparse/src/c/.dirstamp0
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-lu.obin0 -> 28696 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-mspelm.obin0 -> 29584 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spAllocate.obin0 -> 21680 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spBuild.obin0 -> 29024 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spFactor.obin0 -> 72272 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spOutput.obin0 -> 56744 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spSolve.obin0 -> 18440 bytes
-rwxr-xr-xmodules/sparse/src/c/.libs/libscisparse_algo_la-spUtils.obin0 -> 63872 bytes
-rwxr-xr-xmodules/sparse/src/c/DllmainSparse.c34
-rwxr-xr-xmodules/sparse/src/c/core_Import.def19
-rwxr-xr-xmodules/sparse/src/c/elementary_functions_f_Import.def8
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-lu.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-mspelm.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spAllocate.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spBuild.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spFactor.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spOutput.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spSolve.lo12
-rwxr-xr-xmodules/sparse/src/c/libscisparse_algo_la-spUtils.lo12
-rwxr-xr-xmodules/sparse/src/c/lu.c497
-rwxr-xr-xmodules/sparse/src/c/lu.h44
-rwxr-xr-xmodules/sparse/src/c/mspelm.c497
-rwxr-xr-xmodules/sparse/src/c/spAllocate.c906
-rwxr-xr-xmodules/sparse/src/c/spAllocate.h22
-rwxr-xr-xmodules/sparse/src/c/spBuild.c1149
-rwxr-xr-xmodules/sparse/src/c/spBuild.h25
-rwxr-xr-xmodules/sparse/src/c/spFactor.c3469
-rwxr-xr-xmodules/sparse/src/c/spFortran.c1704
-rwxr-xr-xmodules/sparse/src/c/spFortran.h124
-rwxr-xr-xmodules/sparse/src/c/spOutput.c907
-rwxr-xr-xmodules/sparse/src/c/spSolve.c728
-rwxr-xr-xmodules/sparse/src/c/spUtils.c2344
-rwxr-xr-xmodules/sparse/src/c/spUtils.h20
-rwxr-xr-xmodules/sparse/src/c/sparse.rc95
-rwxr-xr-xmodules/sparse/src/c/sparse.vcxproj286
-rwxr-xr-xmodules/sparse/src/c/sparse.vcxproj.filters189
-rwxr-xr-xmodules/sparse/src/c/sparse_f_Import.def31
-rwxr-xr-xmodules/sparse/src/fortran/.deps/.dirstamp0
-rwxr-xr-xmodules/sparse/src/fortran/.dirstamp0
-rwxr-xr-xmodules/sparse/src/fortran/.libs/blkfc1.obin0 -> 6792 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/blkfct.obin0 -> 71488 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/blkslv.obin0 -> 6496 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dcompa.obin0 -> 3824 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dful2sp.obin0 -> 4712 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dij2sp.obin0 -> 8992 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dperm.obin0 -> 4032 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dsmsp.obin0 -> 6624 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dsosp.obin0 -> 13264 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspasp.obin0 -> 7656 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspcle.obin0 -> 6472 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspcsp.obin0 -> 8704 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspe2.obin0 -> 7624 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspful.obin0 -> 5560 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspis.obin0 -> 16096 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspisp.obin0 -> 14824 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspmat.obin0 -> 5680 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspms.obin0 -> 6208 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspmsp.obin0 -> 9616 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspos.obin0 -> 15864 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dsposp.obin0 -> 26680 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspssp.obin0 -> 7936 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspt.obin0 -> 6320 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspxs.obin0 -> 6848 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/dspxsp.obin0 -> 7376 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/findl.obin0 -> 3944 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/inpnv.obin0 -> 5952 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/iperm.obin0 -> 4064 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/isort1.obin0 -> 8208 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lcompa.obin0 -> 3560 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lful2sp.obin0 -> 4400 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lij2sp.obin0 -> 13648 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lsosp.obin0 -> 13200 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspasp.obin0 -> 6864 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspcsp.obin0 -> 7144 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspe2.obin0 -> 7000 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspful.obin0 -> 5360 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspis.obin0 -> 13104 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspisp.obin0 -> 13128 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspmat.obin0 -> 5616 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspops.obin0 -> 70200 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspos.obin0 -> 12728 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lsposp.obin0 -> 17480 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspt.obin0 -> 5536 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/lspxsp.obin0 -> 6840 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/ordmmd.obin0 -> 27240 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/sp2col.obin0 -> 5312 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spcho1.obin0 -> 10432 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spcho2.obin0 -> 9328 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spcompack.obin0 -> 7216 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spextr.obin0 -> 11384 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spextr1.obin0 -> 7992 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spif.obin0 -> 12504 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spif1b.obin0 -> 9880 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spifp.obin0 -> 6904 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spind.obin0 -> 3976 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spisp.obin0 -> 13840 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spord.obin0 -> 3264 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spreshape.obin0 -> 7312 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spsort.obin0 -> 9816 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/spt.obin0 -> 7160 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/sputil.obin0 -> 30416 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/symfct.obin0 -> 55536 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/sz2ptr.obin0 -> 3440 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/ta2lpd.obin0 -> 5744 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wcompa.obin0 -> 3848 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wful2sp.obin0 -> 5600 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wij2sp.obin0 -> 9160 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wperm.obin0 -> 4160 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/writebuf.obin0 -> 4800 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wsmsp.obin0 -> 8072 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wsosp.obin0 -> 17496 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspasp.obin0 -> 8696 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspcle.obin0 -> 6368 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspcsp.obin0 -> 11400 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspe2.obin0 -> 8536 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspful.obin0 -> 6256 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspis.obin0 -> 21872 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspisp.obin0 -> 19048 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspmat.obin0 -> 5712 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspms.obin0 -> 8480 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspmsp.obin0 -> 11432 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspos.obin0 -> 15872 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wsposp.obin0 -> 21936 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspssp.obin0 -> 8960 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspt.obin0 -> 7680 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspxs.obin0 -> 8752 bytes
-rwxr-xr-xmodules/sparse/src/fortran/.libs/wspxsp.obin0 -> 7856 bytes
-rwxr-xr-xmodules/sparse/src/fortran/Core_f_Import.def17
-rwxr-xr-xmodules/sparse/src/fortran/Elementary_functions_Import.def8
-rwxr-xr-xmodules/sparse/src/fortran/Elementary_functions_f_Import.def14
-rwxr-xr-xmodules/sparse/src/fortran/Output_stream_Import.def10
-rwxr-xr-xmodules/sparse/src/fortran/Sparse_Import.def12
-rwxr-xr-xmodules/sparse/src/fortran/blkfc1.f50
-rwxr-xr-xmodules/sparse/src/fortran/blkfc1.lo12
-rwxr-xr-xmodules/sparse/src/fortran/blkfct.f2098
-rwxr-xr-xmodules/sparse/src/fortran/blkfct.lo12
-rwxr-xr-xmodules/sparse/src/fortran/blkslv.f104
-rwxr-xr-xmodules/sparse/src/fortran/blkslv.lo12
-rwxr-xr-xmodules/sparse/src/fortran/core_Import.def32
-rwxr-xr-xmodules/sparse/src/fortran/dcompa.f41
-rwxr-xr-xmodules/sparse/src/fortran/dcompa.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dful2sp.f28
-rwxr-xr-xmodules/sparse/src/fortran/dful2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dij2sp.f108
-rwxr-xr-xmodules/sparse/src/fortran/dij2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dperm.f43
-rwxr-xr-xmodules/sparse/src/fortran/dperm.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dsmsp.f68
-rwxr-xr-xmodules/sparse/src/fortran/dsmsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dsosp.f166
-rwxr-xr-xmodules/sparse/src/fortran/dsosp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspasp.f127
-rwxr-xr-xmodules/sparse/src/fortran/dspasp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspcle.f46
-rwxr-xr-xmodules/sparse/src/fortran/dspcle.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspcsp.f79
-rwxr-xr-xmodules/sparse/src/fortran/dspcsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspe2.f66
-rwxr-xr-xmodules/sparse/src/fortran/dspe2.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspful.f27
-rwxr-xr-xmodules/sparse/src/fortran/dspful.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspis.f301
-rwxr-xr-xmodules/sparse/src/fortran/dspis.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspisp.f210
-rwxr-xr-xmodules/sparse/src/fortran/dspisp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspmat.f33
-rwxr-xr-xmodules/sparse/src/fortran/dspmat.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspms.f67
-rwxr-xr-xmodules/sparse/src/fortran/dspms.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspmsp.f138
-rwxr-xr-xmodules/sparse/src/fortran/dspmsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspos.f202
-rwxr-xr-xmodules/sparse/src/fortran/dspos.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dsposp.f357
-rwxr-xr-xmodules/sparse/src/fortran/dsposp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspssp.f126
-rwxr-xr-xmodules/sparse/src/fortran/dspssp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspt.f83
-rwxr-xr-xmodules/sparse/src/fortran/dspt.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspxs.f95
-rwxr-xr-xmodules/sparse/src/fortran/dspxs.lo12
-rwxr-xr-xmodules/sparse/src/fortran/dspxsp.f104
-rwxr-xr-xmodules/sparse/src/fortran/dspxsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/findl.f20
-rwxr-xr-xmodules/sparse/src/fortran/findl.lo12
-rwxr-xr-xmodules/sparse/src/fortran/inpnv.f72
-rwxr-xr-xmodules/sparse/src/fortran/inpnv.lo12
-rwxr-xr-xmodules/sparse/src/fortran/iperm.f43
-rwxr-xr-xmodules/sparse/src/fortran/iperm.lo12
-rwxr-xr-xmodules/sparse/src/fortran/isort1.f151
-rwxr-xr-xmodules/sparse/src/fortran/isort1.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lcompa.f29
-rwxr-xr-xmodules/sparse/src/fortran/lcompa.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lful2sp.f27
-rwxr-xr-xmodules/sparse/src/fortran/lful2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lij2sp.f125
-rwxr-xr-xmodules/sparse/src/fortran/lij2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/linpack_f_Import.def8
-rwxr-xr-xmodules/sparse/src/fortran/lsosp.f165
-rwxr-xr-xmodules/sparse/src/fortran/lsosp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspasp.f117
-rwxr-xr-xmodules/sparse/src/fortran/lspasp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspcsp.f72
-rwxr-xr-xmodules/sparse/src/fortran/lspcsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspe2.f63
-rwxr-xr-xmodules/sparse/src/fortran/lspe2.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspful.f26
-rwxr-xr-xmodules/sparse/src/fortran/lspful.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspis.f209
-rwxr-xr-xmodules/sparse/src/fortran/lspis.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspisp.f202
-rwxr-xr-xmodules/sparse/src/fortran/lspisp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspmat.f33
-rwxr-xr-xmodules/sparse/src/fortran/lspmat.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspops.f1165
-rwxr-xr-xmodules/sparse/src/fortran/lspops.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspos.f162
-rwxr-xr-xmodules/sparse/src/fortran/lspos.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lsposp.f256
-rwxr-xr-xmodules/sparse/src/fortran/lsposp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspt.f81
-rwxr-xr-xmodules/sparse/src/fortran/lspt.lo12
-rwxr-xr-xmodules/sparse/src/fortran/lspxsp.f102
-rwxr-xr-xmodules/sparse/src/fortran/lspxsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/ordmmd.f891
-rwxr-xr-xmodules/sparse/src/fortran/ordmmd.lo12
-rwxr-xr-xmodules/sparse/src/fortran/sp2col.f44
-rwxr-xr-xmodules/sparse/src/fortran/sp2col.lo12
-rwxr-xr-xmodules/sparse/src/fortran/sparse_f.rc96
-rwxr-xr-xmodules/sparse/src/fortran/sparse_f.vfproj224
-rwxr-xr-xmodules/sparse/src/fortran/sparse_f2c.vcxproj511
-rwxr-xr-xmodules/sparse/src/fortran/sparse_f2c.vcxproj.filters708
-rwxr-xr-xmodules/sparse/src/fortran/spcho1.f107
-rwxr-xr-xmodules/sparse/src/fortran/spcho1.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spcho2.f57
-rwxr-xr-xmodules/sparse/src/fortran/spcho2.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spcompack.f46
-rwxr-xr-xmodules/sparse/src/fortran/spcompack.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spextr.f156
-rwxr-xr-xmodules/sparse/src/fortran/spextr.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spextr1.f113
-rwxr-xr-xmodules/sparse/src/fortran/spextr1.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spif.f139
-rwxr-xr-xmodules/sparse/src/fortran/spif.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spif1b.f127
-rwxr-xr-xmodules/sparse/src/fortran/spif1b.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spifp.f69
-rwxr-xr-xmodules/sparse/src/fortran/spifp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spind.f22
-rwxr-xr-xmodules/sparse/src/fortran/spind.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spisp.f153
-rwxr-xr-xmodules/sparse/src/fortran/spisp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spord.f31
-rwxr-xr-xmodules/sparse/src/fortran/spord.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spreshape.f79
-rwxr-xr-xmodules/sparse/src/fortran/spreshape.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spsort.f153
-rwxr-xr-xmodules/sparse/src/fortran/spsort.lo12
-rwxr-xr-xmodules/sparse/src/fortran/spt.f63
-rwxr-xr-xmodules/sparse/src/fortran/spt.lo12
-rwxr-xr-xmodules/sparse/src/fortran/sputil.f735
-rwxr-xr-xmodules/sparse/src/fortran/sputil.lo12
-rwxr-xr-xmodules/sparse/src/fortran/symfct.f1911
-rwxr-xr-xmodules/sparse/src/fortran/symfct.lo12
-rwxr-xr-xmodules/sparse/src/fortran/sz2ptr.f15
-rwxr-xr-xmodules/sparse/src/fortran/sz2ptr.lo12
-rwxr-xr-xmodules/sparse/src/fortran/ta2lpd.f64
-rwxr-xr-xmodules/sparse/src/fortran/ta2lpd.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wcompa.f30
-rwxr-xr-xmodules/sparse/src/fortran/wcompa.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wful2sp.f29
-rwxr-xr-xmodules/sparse/src/fortran/wful2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wij2sp.f99
-rwxr-xr-xmodules/sparse/src/fortran/wij2sp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wperm.f47
-rwxr-xr-xmodules/sparse/src/fortran/wperm.lo12
-rwxr-xr-xmodules/sparse/src/fortran/writebuf.f19
-rwxr-xr-xmodules/sparse/src/fortran/writebuf.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wsmsp.f88
-rwxr-xr-xmodules/sparse/src/fortran/wsmsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wsosp.f202
-rwxr-xr-xmodules/sparse/src/fortran/wsosp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspasp.f153
-rwxr-xr-xmodules/sparse/src/fortran/wspasp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspcle.f47
-rwxr-xr-xmodules/sparse/src/fortran/wspcle.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspcsp.f99
-rwxr-xr-xmodules/sparse/src/fortran/wspcsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspe2.f70
-rwxr-xr-xmodules/sparse/src/fortran/wspe2.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspful.f30
-rwxr-xr-xmodules/sparse/src/fortran/wspful.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspis.f399
-rwxr-xr-xmodules/sparse/src/fortran/wspis.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspisp.f252
-rwxr-xr-xmodules/sparse/src/fortran/wspisp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspmat.f33
-rwxr-xr-xmodules/sparse/src/fortran/wspmat.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspms.f87
-rwxr-xr-xmodules/sparse/src/fortran/wspms.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspmsp.f159
-rwxr-xr-xmodules/sparse/src/fortran/wspmsp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspos.f199
-rwxr-xr-xmodules/sparse/src/fortran/wspos.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wsposp.f307
-rwxr-xr-xmodules/sparse/src/fortran/wsposp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspssp.f153
-rwxr-xr-xmodules/sparse/src/fortran/wspssp.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspt.f84
-rwxr-xr-xmodules/sparse/src/fortran/wspt.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspxs.f107
-rwxr-xr-xmodules/sparse/src/fortran/wspxs.lo12
-rwxr-xr-xmodules/sparse/src/fortran/wspxsp.f114
-rwxr-xr-xmodules/sparse/src/fortran/wspxsp.lo12
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_10126.dia.ref23
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_10126.tst27
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_10271.dia.ref22
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_10271.tst25
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_11612.dia.ref106
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_11612.tst128
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_11618.dia.ref30
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_11618.tst32
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2003.dia.ref35
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2003.tst41
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2277.dia.ref26
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2277.tst32
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2430.dia.ref18
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_2430.tst25
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3006.dia.ref26
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3006.tst32
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3025.dia.ref18
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3025.tst24
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3263.dia.ref27
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_3263.tst41
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_4654.dia.ref18
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_4654.tst22
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_4783.dia.ref27
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_4783.tst33
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_490.dia.ref18
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_490.tst23
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6401.dia.ref31
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6401.tst39
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6412.dia.ref19
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6412.tst22
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6427.dia.ref15
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6427.tst18
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6827.dia.ref30
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_6827.tst36
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_8511.dia.ref20
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_8511.tst23
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_9780.dia.ref23
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_9780.tst26
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_9999.dia.ref19
-rwxr-xr-xmodules/sparse/tests/nonreg_tests/bug_9999.tst21
-rwxr-xr-xmodules/sparse/tests/unit_tests/adj2sp.dia.ref57
-rwxr-xr-xmodules/sparse/tests/unit_tests/adj2sp.tst59
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad.dia.ref349
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad.tst368
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_function.dia.ref68
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_function.tst76
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_list.dia.ref103
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_list.tst76
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_numerical.dia.ref108
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_numerical.tst116
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_sparse.dia.ref65
-rwxr-xr-xmodules/sparse/tests/unit_tests/conjgrad_sparse.tst73
-rwxr-xr-xmodules/sparse/tests/unit_tests/lsparse.dia.ref382
-rwxr-xr-xmodules/sparse/tests/unit_tests/lsparse.tst391
-rwxr-xr-xmodules/sparse/tests/unit_tests/ordmmd.dia.ref21
-rwxr-xr-xmodules/sparse/tests/unit_tests/ordmmd.tst24
-rwxr-xr-xmodules/sparse/tests/unit_tests/qmr.dia.ref645
-rwxr-xr-xmodules/sparse/tests/unit_tests/qmr.tst772
-rwxr-xr-xmodules/sparse/tests/unit_tests/sp2adj.dia.ref65
-rwxr-xr-xmodules/sparse/tests/unit_tests/sp2adj.tst67
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparse-insert.dia.ref22
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparse-insert.tst27
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparse.dia.ref779
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparse.tst782
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparseBool.dia.ref92
-rwxr-xr-xmodules/sparse/tests/unit_tests/sparseBool.tst92
-rwxr-xr-xmodules/sparse/tests/unit_tests/spisp.dia.ref37
-rwxr-xr-xmodules/sparse/tests/unit_tests/spisp.tst51
-rwxr-xr-xmodules/sparse/tests/unit_tests/sprand.dia.ref90
-rwxr-xr-xmodules/sparse/tests/unit_tests/sprand.tst103
-rwxr-xr-xmodules/sparse/tests/unit_tests/spzeros.dia.ref18
-rwxr-xr-xmodules/sparse/tests/unit_tests/spzeros.tst25
729 files changed, 73878 insertions, 0 deletions
diff --git a/modules/sparse/.libs/libscisparse-algo.a b/modules/sparse/.libs/libscisparse-algo.a
new file mode 100755
index 000000000..99aa04b56
--- /dev/null
+++ b/modules/sparse/.libs/libscisparse-algo.a
Binary files differ
diff --git a/modules/sparse/.libs/libscisparse-algo.la b/modules/sparse/.libs/libscisparse-algo.la
new file mode 120000
index 000000000..377d43d41
--- /dev/null
+++ b/modules/sparse/.libs/libscisparse-algo.la
@@ -0,0 +1 @@
+../libscisparse-algo.la \ No newline at end of file
diff --git a/modules/sparse/.libs/libscisparse.a b/modules/sparse/.libs/libscisparse.a
new file mode 100755
index 000000000..ffe7f0494
--- /dev/null
+++ b/modules/sparse/.libs/libscisparse.a
Binary files differ
diff --git a/modules/sparse/.libs/libscisparse.la b/modules/sparse/.libs/libscisparse.la
new file mode 120000
index 000000000..7de2c23fd
--- /dev/null
+++ b/modules/sparse/.libs/libscisparse.la
@@ -0,0 +1 @@
+../libscisparse.la \ No newline at end of file
diff --git a/modules/sparse/Makefile b/modules/sparse/Makefile
new file mode 100755
index 000000000..5a9c154f6
--- /dev/null
+++ b/modules/sparse/Makefile
@@ -0,0 +1,2155 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# modules/sparse/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006 - INRIA - Sylvestre LEDRU
+#
+# This file is distributed under the same license as the Scilab package.
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+#
+# This file must be used under the terms of the CeCILL.
+# This source file is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at
+# http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+#
+
+##########
+### Makefile included stuff
+### Target, variable, suffixes which are supposed to be useful in every makefile.am
+##########
+
+
+
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/scilab
+pkgincludedir = $(includedir)/scilab
+pkglibdir = $(libdir)/scilab
+pkglibexecdir = $(libexecdir)/scilab
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
+DIST_COMMON = $(top_srcdir)/Makefile.incl.am $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am $(top_srcdir)/config/mkinstalldirs \
+ $(top_srcdir)/config/depcomp
+am__append_1 = java
+subdir = modules/sparse
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/backtrace.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/curl.m4 \
+ $(top_srcdir)/m4/docbook.m4 $(top_srcdir)/m4/doxygen.m4 \
+ $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \
+ $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/hdf5.m4 \
+ $(top_srcdir)/m4/intel_compiler.m4 \
+ $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \
+ $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \
+ $(top_srcdir)/m4/mpi.m4 $(top_srcdir)/m4/ocaml.m4 \
+ $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \
+ $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \
+ $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(pkglibdir)" \
+ "$(DESTDIR)$(libscisparse_la_etcdir)" \
+ "$(DESTDIR)$(libscisparse_la_rootdir)" \
+ "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)"
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
+libscisparse_algo_la_LIBADD =
+am__dirstamp = $(am__leading_dot)dirstamp
+am__objects_1 = src/c/libscisparse_algo_la-spUtils.lo \
+ src/c/libscisparse_algo_la-mspelm.lo \
+ src/c/libscisparse_algo_la-lu.lo \
+ src/c/libscisparse_algo_la-spFactor.lo \
+ src/c/libscisparse_algo_la-spBuild.lo \
+ src/c/libscisparse_algo_la-spOutput.lo \
+ src/c/libscisparse_algo_la-spAllocate.lo \
+ src/c/libscisparse_algo_la-spSolve.lo
+am__objects_2 = src/fortran/spcompack.lo src/fortran/wsposp.lo \
+ src/fortran/findl.lo src/fortran/spcho1.lo \
+ src/fortran/dspful.lo src/fortran/blkslv.lo \
+ src/fortran/wspcle.lo src/fortran/wspt.lo \
+ src/fortran/wspssp.lo src/fortran/lspmat.lo \
+ src/fortran/lsosp.lo src/fortran/blkfc1.lo \
+ src/fortran/wspxsp.lo src/fortran/lspful.lo \
+ src/fortran/blkfct.lo src/fortran/symfct.lo \
+ src/fortran/dspt.lo src/fortran/wspos.lo \
+ src/fortran/dful2sp.lo src/fortran/sputil.lo \
+ src/fortran/lspt.lo src/fortran/dspxs.lo src/fortran/sp2col.lo \
+ src/fortran/dcompa.lo src/fortran/sz2ptr.lo src/fortran/spt.lo \
+ src/fortran/lcompa.lo src/fortran/wspmat.lo \
+ src/fortran/iperm.lo src/fortran/wspful.lo \
+ src/fortran/spif1b.lo src/fortran/spextr.lo \
+ src/fortran/lful2sp.lo src/fortran/dspos.lo \
+ src/fortran/dspasp.lo src/fortran/inpnv.lo \
+ src/fortran/spreshape.lo src/fortran/spsort.lo \
+ src/fortran/wperm.lo src/fortran/dij2sp.lo \
+ src/fortran/dspcsp.lo src/fortran/spcho2.lo \
+ src/fortran/lspos.lo src/fortran/wspe2.lo src/fortran/spif.lo \
+ src/fortran/lspasp.lo src/fortran/dspisp.lo \
+ src/fortran/wful2sp.lo src/fortran/lij2sp.lo \
+ src/fortran/lspcsp.lo src/fortran/wspis.lo \
+ src/fortran/dspmsp.lo src/fortran/dsposp.lo \
+ src/fortran/wsmsp.lo src/fortran/wspms.lo \
+ src/fortran/lspisp.lo src/fortran/dspcle.lo \
+ src/fortran/wsosp.lo src/fortran/dspssp.lo \
+ src/fortran/lsposp.lo src/fortran/dspxsp.lo \
+ src/fortran/ordmmd.lo src/fortran/spextr1.lo \
+ src/fortran/wcompa.lo src/fortran/lspxsp.lo \
+ src/fortran/spisp.lo src/fortran/dperm.lo src/fortran/spind.lo \
+ src/fortran/dspe2.lo src/fortran/wspasp.lo \
+ src/fortran/wij2sp.lo src/fortran/wspcsp.lo \
+ src/fortran/lspops.lo src/fortran/spifp.lo \
+ src/fortran/isort1.lo src/fortran/dspis.lo \
+ src/fortran/wspxs.lo src/fortran/lspe2.lo \
+ src/fortran/wspisp.lo src/fortran/dsmsp.lo \
+ src/fortran/dspms.lo src/fortran/spord.lo src/fortran/dsosp.lo \
+ src/fortran/dspmat.lo src/fortran/wspmsp.lo \
+ src/fortran/lspis.lo src/fortran/writebuf.lo \
+ src/fortran/ta2lpd.lo
+am_libscisparse_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+libscisparse_algo_la_OBJECTS = $(am_libscisparse_algo_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__v_lt_1 =
+am_libscisparse_algo_la_rpath =
+#am_libscisparse_algo_la_rpath =
+libscisparse_la_DEPENDENCIES = libscisparse-algo.la
+am__objects_3 = sci_gateway/c/libscisparse_la-sci_spcompa.lo \
+ sci_gateway/c/libscisparse_la-sci_full.lo \
+ sci_gateway/c/libscisparse_la-sci_blkslvi.lo \
+ sci_gateway/c/libscisparse_la-sci_inpnvi.lo \
+ sci_gateway/c/libscisparse_la-sci_nnz.lo \
+ sci_gateway/c/libscisparse_la-sci_ludel.lo \
+ sci_gateway/c/libscisparse_la-sci_spmatrix.lo \
+ sci_gateway/c/libscisparse_la-sci_msparse.lo \
+ sci_gateway/c/libscisparse_la-sci_blkfc1i.lo \
+ sci_gateway/c/libscisparse_la-sci_bfinit.lo \
+ sci_gateway/c/libscisparse_la-sci_lufact.lo \
+ sci_gateway/c/libscisparse_la-sci_symfcti.lo \
+ sci_gateway/c/libscisparse_la-sci_mfull.lo \
+ sci_gateway/c/libscisparse_la-sci_luget.lo \
+ sci_gateway/c/libscisparse_la-sci_ordmmd.lo \
+ sci_gateway/c/libscisparse_la-sci_spget.lo \
+ sci_gateway/c/libscisparse_la-sci_spclean.lo \
+ sci_gateway/c/libscisparse_la-sci_spchol.lo \
+ sci_gateway/c/libscisparse_la-sci_lusolve.lo \
+ sci_gateway/c/libscisparse_la-sci_fadj2sp.lo \
+ sci_gateway/c/libscisparse_la-gw_sparse.lo \
+ sci_gateway/c/libscisparse_la-sci_sfinit.lo \
+ sci_gateway/c/libscisparse_la-sci_sparse.lo \
+ sci_gateway/c/libscisparse_la-sci_mspget.lo
+am__objects_4 = sci_gateway/fortran/sci_f_spcompa.lo \
+ sci_gateway/fortran/sci_f_sparse.lo \
+ sci_gateway/fortran/sci_f_full.lo \
+ sci_gateway/fortran/sci_f_blkslvi.lo \
+ sci_gateway/fortran/sci_f_inpnvi.lo \
+ sci_gateway/fortran/sci_f_nnz.lo \
+ sci_gateway/fortran/sci_f_ludel.lo \
+ sci_gateway/fortran/sci_f_bfinit.lo \
+ sci_gateway/fortran/spops.lo \
+ sci_gateway/fortran/sci_f_spmatrix.lo \
+ sci_gateway/fortran/sci_f_blkfc1i.lo \
+ sci_gateway/fortran/sci_f_lufact.lo \
+ sci_gateway/fortran/sci_f_symfcti.lo \
+ sci_gateway/fortran/sci_f_luget.lo \
+ sci_gateway/fortran/sci_f_ordmmd.lo \
+ sci_gateway/fortran/sci_f_spget.lo \
+ sci_gateway/fortran/sci_f_spclean.lo \
+ sci_gateway/fortran/sci_f_spchol.lo \
+ sci_gateway/fortran/sci_f_lusolve.lo \
+ sci_gateway/fortran/sci_f_fadj2sp.lo \
+ sci_gateway/fortran/sci_f_sfinit.lo \
+ sci_gateway/fortran/sci_f_ta2lpd.lo
+am_libscisparse_la_OBJECTS = $(am__objects_3) $(am__objects_4)
+libscisparse_la_OBJECTS = $(am_libscisparse_la_OBJECTS)
+am_libscisparse_la_rpath =
+#am_libscisparse_la_rpath = -rpath $(pkglibdir)
+AM_V_P = $(am__v_P_$(V))
+am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/modules/core/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
+LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
+AM_V_F77 = $(am__v_F77_$(V))
+am__v_F77_ = $(am__v_F77_$(AM_DEFAULT_VERBOSITY))
+am__v_F77_0 = @echo " F77 " $@;
+am__v_F77_1 =
+F77LD = $(F77)
+F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_F77LD = $(am__v_F77LD_$(V))
+am__v_F77LD_ = $(am__v_F77LD_$(AM_DEFAULT_VERBOSITY))
+am__v_F77LD_0 = @echo " F77LD " $@;
+am__v_F77LD_1 =
+SOURCES = $(libscisparse_algo_la_SOURCES) $(libscisparse_la_SOURCES)
+DIST_SOURCES = $(libscisparse_algo_la_SOURCES) \
+ $(libscisparse_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+DATA = $(libscisparse_la_etc_DATA) $(libscisparse_la_root_DATA) \
+ $(libscisparse_la_sci_gateway_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing aclocal-1.14
+ALL_LINGUAS = en_US fr_FR zh_CN zh_TW ru_RU ca_ES de_DE es_ES pt_BR ja_JP it_IT uk_UA pl_PL cs_CZ
+ALL_LINGUAS_DOC = en_US fr_FR pt_BR ja_JP ru_RU
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 1
+ANT = /usr/bin/ant
+ANTLR = /usr/share/java/antlr.jar
+AR = ar
+ARPACK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -larpack
+ASM3 = /usr/share/java/asm3-3.3.2.jar
+AUTOCONF = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing autoconf
+AUTOHEADER = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing autoheader
+AUTOMAKE = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing automake-1.14
+AVALON_FRAMEWORK = /home/shashank/scilab-master_5.5.2/thirdparty/avalon-framework.jar
+AWK = mawk
+BATIK = /home/shashank/scilab-master_5.5.2/thirdparty/batik-all-1.7.jar
+BLAS_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lblas
+CC = gcc
+CCACHE =
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CHECKSTYLE =
+COBERTURA = /usr/share/java/cobertura.jar
+COMMONS_BEANUTILS =
+COMMONS_IO = /home/shashank/scilab-master_5.5.2/thirdparty/commons-io.jar
+COMMONS_LOGGING = /home/shashank/scilab-master_5.5.2/thirdparty/commons-logging.jar
+CPP = gcc -E
+CPPFLAGS =
+CURL_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include
+CURL_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/curl-config
+CURL_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lcurl -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -lssl -lcrypto -lrt -lz
+CURL_VERSION = libcurl 7.19.7
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEMOTOOLS_ENABLE = yes
+DEPDIR = .deps
+DLLTOOL = false
+DOCBOOK_ROOT = /home/shashank/scilab-master_5.5.2/thirdparty/docbook/
+DOXYGEN_BIN =
+DSYMUTIL =
+DUMPBIN =
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+ECJ = /home/shashank/scilab-master_5.5.2/thirdparty/ecj.jar
+EGREP = /bin/grep -E
+EXEEXT =
+F77 = gfortran
+FFLAGS = -g -O2
+FFTW3_LIB = -L/home/shashank/scilab-master_5.5.2/usr/lib -lfftw3
+FFTW_ENABLE = yes
+FGREP = /bin/grep -F
+FLEXDOCK = /home/shashank/scilab-master_5.5.2/thirdparty/flexdock-1.2.4.jar
+FLIBS = -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lpthread -ldl -lcurses -lgfortran -lm -lquadmath
+FOP = /home/shashank/scilab-master_5.5.2/thirdparty/fop.jar
+FREEHEP_GRAPHICS2D = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphics2d.jar
+FREEHEP_GRAPHICSIO = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphicsio.jar
+FREEHEP_GRAPHICSIO_EMF = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphicsio-emf.jar
+FREEHEP_IO = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-io.jar
+FREEHEP_UTIL = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-util.jar
+GENHTML =
+GETTEXT_MACRO_VERSION = 0.19
+GIWS_BIN =
+GLUEGEN2_RT = /home/shashank/scilab-master_5.5.2/thirdparty/gluegen2-rt.jar
+GMSGFMT = /usr/bin/msgfmt
+GMSGFMT_015 = /usr/bin/msgfmt
+GRAPHICS_ENABLE = yes
+GREP = /bin/grep
+GUI_ENABLE = yes
+HDF5_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include
+HDF5_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lhdf5 -lhdf5_hl
+HELP_ENABLE = yes
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INTLLIBS =
+INTL_MACOSX_LIBS =
+JAR = /usr/lib/jvm/java-8-openjdk-amd64/bin/jar
+JAVA = /usr/lib/jvm/java-8-openjdk-amd64/bin/java
+JAVAC = /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
+JAVAC_DEBUG = off
+JAVADOC = /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc
+JAVAH = /usr/lib/jvm/java-8-openjdk-amd64/bin/javah
+JAVASCI_ENABLE = yes
+JAVA_ENABLE = yes
+JAVA_G = /usr/lib/jvm/java-8-openjdk-amd64/bin/java
+JAVA_HOME = /usr/lib/jvm/java-8-openjdk-amd64
+JAVA_JNI_INCLUDE = -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux
+JAVA_JNI_LIBS = -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 -ljava -lverify -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm
+JDB = /usr/lib/jvm/java-8-openjdk-amd64/bin/jdb
+JEUCLID_CORE = /home/shashank/scilab-master_5.5.2/thirdparty/jeuclid-core.jar
+JGRAPHX = /home/shashank/scilab-master_5.5.2/thirdparty/jgraphx.jar
+JHALL = /home/shashank/scilab-master_5.5.2/thirdparty/jhall.jar
+JLATEXMATH = /home/shashank/scilab-master_5.5.2/thirdparty/jlatexmath-1.0.3.jar
+JLATEXMATH_FOP = /home/shashank/scilab-master_5.5.2/thirdparty/jlatexmath-fop-1.0.3.jar
+JOGL2 = /home/shashank/scilab-master_5.5.2/thirdparty/jogl2.jar
+JROSETTA_API = /home/shashank/scilab-master_5.5.2/thirdparty/jrosetta-API.jar
+JROSETTA_ENGINE = /home/shashank/scilab-master_5.5.2/thirdparty/jrosetta-engine.jar
+JUNIT4 = /usr/share/java/junit4.jar
+LAPACK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -llapack
+LCOV =
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS = -Wl,--no-as-needed
+LIBICONV = -liconv
+LIBINTL =
+LIBM = -lm
+LIBOBJS =
+LIBS = -lpthread -ldl -lcurses -lm
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO =
+LN_S = ln -s
+LOGGING_LEVEL = SEVERE
+LOOKS = /home/shashank/scilab-master_5.5.2/thirdparty/looks-2.1.1.jar
+LTLIBICONV = -liconv
+LTLIBINTL =
+LTLIBOBJS =
+MAINT = #
+MAKEINFO = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing makeinfo
+MANIFEST_TOOL = :
+MATIO_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include
+MATIO_ENABLE = yes
+MATIO_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lm -lz -lmatio -lhdf5
+MKDIR_P = /bin/mkdir -p
+MPI_ENABLE = no
+MSGCAT = /usr/bin/msgcat
+MSGFMT = /usr/bin/msgfmt
+MSGFMT_015 = /usr/bin/msgfmt
+MSGMERGE = /usr/bin/msgmerge
+NM = nm
+NMEDIT =
+OBJDUMP = objdump
+OBJEXT = o
+OCAMLC = ocamlc
+OCAMLDEP = ocamldep
+OCAMLLEX = ocamllex
+OCAMLOPT = ocamlopt
+OCAMLYACC = ocamlyacc
+OPENMPI_CC =
+OPENMPI_CFLAGS =
+OPENMPI_CXX =
+OPENMPI_CXXFLAGS =
+OPENMPI_LIBS =
+OPENMP_CFLAGS = -fopenmp
+OPENMP_CXXFLAGS = -fopenmp
+OPENMP_ENABLE = yes
+OPENMP_LIBS = -lgomp -lstdc++
+OTOOL =
+OTOOL64 =
+PACKAGE = scilab
+PACKAGE_BUGREPORT = http://bugzilla.scilab.org/
+PACKAGE_NAME = Scilab
+PACKAGE_STRING = Scilab 5
+PACKAGE_TARNAME = scilab
+PACKAGE_URL =
+PACKAGE_VERSION = 5
+PATH_SEPARATOR = :
+PCRE_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include
+PCRE_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/pcre-config
+PCRE_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lpcreposix -lpcre
+PCRE_VERSION = 8.35
+PKG_CONFIG = /usr/bin/pkg-config
+POSUB = po
+POW_LIB =
+PYTHON =
+RANLIB = ranlib
+RELOCATABLE = no
+RT_LIB = -lrt
+SAXON = /home/shashank/scilab-master_5.5.2/thirdparty/saxon9he.jar
+SCILAB_BINARY_VERSION = 5.5.2
+SCILAB_LIBRARY_VERSION = 5:5:2
+SCILAB_VERSION_MAINTENANCE = 2
+SCILAB_VERSION_MAJOR = 5
+SCILAB_VERSION_MINOR = 5
+SCIRENDERER = ${modules.dir}/scirenderer/${build.jar.dir}/scirenderer.jar
+SCIRENDERER_CP = $SCILAB/modules/scirenderer/jar/scirenderer.jar
+SCI_CFLAGS = -D_LARGEFILE64_SOURCE -DNDEBUG -m64 -fno-stack-protector
+SCI_CXXFLAGS = -DNDEBUG -fno-stack-protector
+SCI_FFLAGS = -DNDEBUG -m64 -fPIC
+SCI_LDFLAGS =
+SED = /bin/sed
+SET_MAKE =
+SET_RELOCATABLE =
+SHELL = /bin/bash
+SKINLF = /home/shashank/scilab-master_5.5.2/thirdparty/skinlf.jar
+SPLINT = no
+STRIP = strip
+SWIG_BIN =
+SWIG_JAVA =
+SWIG_RUNTIME_LIBS_DIR =
+SWIG_SCILAB =
+TCLTK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -ltk8.5 -L/home/shashank/scilab-master_5.5.2/usr/lib -ltcl8.5 -ldl
+TCL_INC_PATH = -I/home/shashank/scilab-master_5.5.2/usr/include
+TK_INC_PATH = -I/home/shashank/scilab-master_5.5.2/usr/include
+UMFPACK_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include
+UMFPACK_ENABLE = yes
+UMFPACK_LIB = -L/home/shashank/scilab-master_5.5.2/usr/lib -lumfpack -lamd
+USE_NLS = yes
+VERSION = 5
+WITH_OCAML =
+WITH_TKSCI = yes
+XCOS_ENABLE = yes
+XGETTEXT = /usr/bin/xgettext
+XGETTEXT_015 = /usr/bin/xgettext
+XGETTEXT_EXTRA_OPTIONS =
+XMKMF =
+XMLGRAPHICS_COMMONS = /home/shashank/scilab-master_5.5.2/thirdparty/xmlgraphics-commons-1.4.jar
+XML_APIS_EXT = /home/shashank/scilab-master_5.5.2/thirdparty/xml-apis-ext.jar
+XML_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/xml2-config
+XML_FLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include/libxml2
+XML_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lxml2 -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -lz -lm -ldl
+XML_VERSION = 2.9.1
+X_CFLAGS =
+X_EXTRA_LIBS =
+X_LIBS =
+X_PRE_LIBS =
+abs_builddir = /home/shashank/scilab-master_5.5.2/modules/sparse
+abs_srcdir = /home/shashank/scilab-master_5.5.2/modules/sparse
+abs_top_builddir = /home/shashank/scilab-master_5.5.2
+abs_top_srcdir = /home/shashank/scilab-master_5.5.2
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN =
+ac_ct_F77 = gfortran
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias =
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+cxx_present = yes
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-linux-gnu
+host_alias =
+host_cpu = x86_64
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/shashank/scilab-master_5.5.2/config/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(MKDIR_P)
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias =
+top_build_prefix = ../../
+top_builddir = ../..
+top_srcdir = ../..
+SPARSE_C_SOURCES = \
+src/c/spUtils.c \
+src/c/mspelm.c \
+src/c/lu.c \
+src/c/spFactor.c \
+src/c/spBuild.c \
+src/c/spOutput.c \
+src/c/spAllocate.c \
+src/c/spSolve.c
+
+# src/c/spFortran.c
+SPARSE_FORTRAN_SOURCES = src/fortran/spcompack.f \
+src/fortran/wsposp.f \
+src/fortran/findl.f \
+src/fortran/spcho1.f \
+src/fortran/dspful.f \
+src/fortran/blkslv.f \
+src/fortran/wspcle.f \
+src/fortran/wspt.f \
+src/fortran/wspssp.f \
+src/fortran/lspmat.f \
+src/fortran/lsosp.f \
+src/fortran/blkfc1.f \
+src/fortran/wspxsp.f \
+src/fortran/lspful.f \
+src/fortran/blkfct.f \
+src/fortran/symfct.f \
+src/fortran/dspt.f \
+src/fortran/wspos.f \
+src/fortran/dful2sp.f \
+src/fortran/sputil.f \
+src/fortran/lspt.f \
+src/fortran/dspxs.f \
+src/fortran/sp2col.f \
+src/fortran/dcompa.f \
+src/fortran/sz2ptr.f \
+src/fortran/spt.f \
+src/fortran/lcompa.f \
+src/fortran/wspmat.f \
+src/fortran/iperm.f \
+src/fortran/wspful.f \
+src/fortran/spif1b.f \
+src/fortran/spextr.f \
+src/fortran/lful2sp.f \
+src/fortran/dspos.f \
+src/fortran/dspasp.f \
+src/fortran/inpnv.f \
+src/fortran/spreshape.f \
+src/fortran/spsort.f \
+src/fortran/wperm.f \
+src/fortran/dij2sp.f \
+src/fortran/dspcsp.f \
+src/fortran/spcho2.f \
+src/fortran/lspos.f \
+src/fortran/wspe2.f \
+src/fortran/spif.f \
+src/fortran/lspasp.f \
+src/fortran/dspisp.f \
+src/fortran/wful2sp.f \
+src/fortran/lij2sp.f \
+src/fortran/lspcsp.f \
+src/fortran/wspis.f \
+src/fortran/dspmsp.f \
+src/fortran/dsposp.f \
+src/fortran/wsmsp.f \
+src/fortran/wspms.f \
+src/fortran/lspisp.f \
+src/fortran/dspcle.f \
+src/fortran/wsosp.f \
+src/fortran/dspssp.f \
+src/fortran/lsposp.f \
+src/fortran/dspxsp.f \
+src/fortran/ordmmd.f \
+src/fortran/spextr1.f \
+src/fortran/wcompa.f \
+src/fortran/lspxsp.f \
+src/fortran/spisp.f \
+src/fortran/dperm.f \
+src/fortran/spind.f \
+src/fortran/dspe2.f \
+src/fortran/wspasp.f \
+src/fortran/wij2sp.f \
+src/fortran/wspcsp.f \
+src/fortran/lspops.f \
+src/fortran/spifp.f \
+src/fortran/isort1.f \
+src/fortran/dspis.f \
+src/fortran/wspxs.f \
+src/fortran/lspe2.f \
+src/fortran/wspisp.f \
+src/fortran/dsmsp.f \
+src/fortran/dspms.f \
+src/fortran/spord.f \
+src/fortran/dsosp.f \
+src/fortran/dspmat.f \
+src/fortran/wspmsp.f \
+src/fortran/lspis.f \
+src/fortran/writebuf.f \
+src/fortran/ta2lpd.f
+
+GATEWAY_C_SOURCES = sci_gateway/c/sci_spcompa.c \
+sci_gateway/c/sci_full.c \
+sci_gateway/c/sci_blkslvi.c \
+sci_gateway/c/sci_inpnvi.c \
+sci_gateway/c/sci_nnz.c \
+sci_gateway/c/sci_ludel.c \
+sci_gateway/c/sci_spmatrix.c \
+sci_gateway/c/sci_msparse.c \
+sci_gateway/c/sci_blkfc1i.c \
+sci_gateway/c/sci_bfinit.c \
+sci_gateway/c/sci_lufact.c \
+sci_gateway/c/sci_symfcti.c \
+sci_gateway/c/sci_mfull.c \
+sci_gateway/c/sci_luget.c \
+sci_gateway/c/sci_ordmmd.c \
+sci_gateway/c/sci_spget.c \
+sci_gateway/c/sci_spclean.c \
+sci_gateway/c/sci_spchol.c \
+sci_gateway/c/sci_lusolve.c \
+sci_gateway/c/sci_fadj2sp.c \
+sci_gateway/c/gw_sparse.c \
+sci_gateway/c/sci_sfinit.c \
+sci_gateway/c/sci_sparse.c \
+sci_gateway/c/sci_mspget.c
+
+GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_spcompa.f \
+sci_gateway/fortran/sci_f_sparse.f \
+sci_gateway/fortran/sci_f_full.f \
+sci_gateway/fortran/sci_f_blkslvi.f \
+sci_gateway/fortran/sci_f_inpnvi.f \
+sci_gateway/fortran/sci_f_nnz.f \
+sci_gateway/fortran/sci_f_ludel.f \
+sci_gateway/fortran/sci_f_bfinit.f \
+sci_gateway/fortran/spops.f \
+sci_gateway/fortran/sci_f_spmatrix.f \
+sci_gateway/fortran/sci_f_blkfc1i.f \
+sci_gateway/fortran/sci_f_lufact.f \
+sci_gateway/fortran/sci_f_symfcti.f \
+sci_gateway/fortran/sci_f_luget.f \
+sci_gateway/fortran/sci_f_ordmmd.f \
+sci_gateway/fortran/sci_f_spget.f \
+sci_gateway/fortran/sci_f_spclean.f \
+sci_gateway/fortran/sci_f_spchol.f \
+sci_gateway/fortran/sci_f_lusolve.f \
+sci_gateway/fortran/sci_f_fadj2sp.f \
+sci_gateway/fortran/sci_f_sfinit.f \
+sci_gateway/fortran/sci_f_ta2lpd.f
+
+libscisparse_la_CPPFLAGS = -I$(srcdir)/includes/ \
+ -I$(top_srcdir)/modules/api_scilab/includes/ \
+ -I$(top_srcdir)/modules/elementary_functions/includes/ \
+ -I$(top_srcdir)/modules/localization/includes/ \
+ -I$(top_srcdir)/modules/output_stream/includes/ \
+ $(AM_CPPFLAGS)
+
+
+#-Isrc/c/
+#pkglib_LTLIBRARIES = libscisparse.la
+noinst_LTLIBRARIES = libscisparse-algo.la libscisparse.la
+#noinst_LTLIBRARIES = libscisparse-algo.la
+libscisparse_algo_la_SOURCES = $(SPARSE_C_SOURCES) $(SPARSE_FORTRAN_SOURCES)
+libscisparse_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscisparse_algo_la_CPPFLAGS = $(libscisparse_la_CPPFLAGS)
+
+# For the code check (splint)
+CHECK_SRC = $(SPARSE_C_SOURCES) $(GATEWAY_C_SOURCES)
+INCLUDE_FLAGS = $(libscisparse_la_CPPFLAGS)
+libscisparse_la_LIBADD = libscisparse-algo.la
+
+#### Target ######
+modulename = sparse
+
+#### sparse : Conf files ####
+libscisparse_la_rootdir = $(mydatadir)
+libscisparse_la_root_DATA = license.txt
+
+#### sparse : init scripts ####
+libscisparse_la_etcdir = $(mydatadir)/etc
+libscisparse_la_etc_DATA = etc/sparse.quit etc/sparse.start
+
+#### sparse : gateway declaration ####
+libscisparse_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libscisparse_la_sci_gateway_DATA = sci_gateway/sparse_gateway.xml
+
+# Where all the Scilab stuff is installed (macros, help, ...)
+mydatadir = $(pkgdatadir)/modules/$(modulename)
+
+# Set AM_* SCI detected settings
+AM_CPPFLAGS = $(SCI_CPPFLAGS)
+AM_CFLAGS = $(SCI_CFLAGS)
+AM_CXXFLAGS = $(SCI_CXXFLAGS)
+# append includes to AM_FFLAGS to manage fortran includes
+AM_FFLAGS = $(SCI_FFLAGS) -I$(top_srcdir)/modules/core/includes/
+
+# Tag shared libraries with the Scilab version
+AM_LDFLAGS = $(SCI_LDFLAGS) -version-number $(SCILAB_LIBRARY_VERSION)
+
+# splint options
+SPLINT_OPTIONS = -weak -booltype BOOL
+
+########################### JAVA ######################################
+#### We are delegating java compilation to ant... Thanks to that
+#### the procedure will be the same with Microsoft Windows (C)
+#### and Linux/Unix
+#######################################################################
+TARGETS_ALL = $(am__append_1)
+
+################ MACROS ######################
+# Rule to build a macro
+# NOT USED AT THE MOMENT
+SUFFIXES = .sci
+
+########### INSTALL DOCUMENTATION ###################
+
+# Install documentation files into the right target
+# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because
+# automake needs the html files to be present which is not the case when
+# we are building Scilab
+
+# Where it should be installed
+pkgdocdir = $(mydatadir)
+
+# What is the mask of the help source
+DOCMASKXML = *.xml
+
+# What is the mask of the MathML sources
+DOCMASKMML = *.mml
+
+########### INSTALL DATA ###################
+# Install macros, help & demos
+# Where it should be installed
+pkgmacrosdir = $(mydatadir)
+# Which directory we process
+MACRODIRS = macros/
+# Mask of the Scilab sources macros
+MACROMASK = *.sci
+# Mask of the Scilab executable sources macros
+MACROBUILDMASK = *.sce
+# Mask of the Scilab compiled macros
+MACROBINMASK = *.bin
+# List of the standard directory for tests
+TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java
+# Where the demos should be installed
+pkgdemosdir = $(mydatadir)
+# List of the standard directory for demos
+DEMOS_DIR = demos
+# List of the standard directory for examples
+EXAMPLES_DIR = examples
+# Where to export JAVA archives (.jar)
+JARDIR = jar/
+# JAR files mask
+JARMASK = *.jar
+# Chapter file
+HELP_CHAPTERDIR = help/
+HELP_CHAPTERFILE = addchapter.sce
+HELP_CHAPTERLANG = en_US fr_FR pt_BR
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .sci .bin .c .f .lo .o .obj
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/sparse/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign modules/sparse/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/Makefile.incl.am:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+ }
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+src/c/$(am__dirstamp):
+ @$(MKDIR_P) src/c
+ @: > src/c/$(am__dirstamp)
+src/c/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/c/$(DEPDIR)
+ @: > src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spUtils.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-mspelm.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-lu.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spFactor.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spBuild.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spOutput.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spAllocate.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spSolve.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/fortran/$(am__dirstamp):
+ @$(MKDIR_P) src/fortran
+ @: > src/fortran/$(am__dirstamp)
+src/fortran/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/fortran/$(DEPDIR)
+ @: > src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcompack.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/findl.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcho1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkslv.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspcle.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspssp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkfc1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkfct.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/symfct.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sputil.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspxs.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sp2col.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sz2ptr.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/iperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spif1b.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spextr.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/inpnv.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spreshape.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spsort.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcho2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spif.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspms.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspcle.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspssp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/ordmmd.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spextr1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spind.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspops.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spifp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/isort1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspxs.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspms.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spord.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/writebuf.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/ta2lpd.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+
+libscisparse-algo.la: $(libscisparse_algo_la_OBJECTS) $(libscisparse_algo_la_DEPENDENCIES) $(EXTRA_libscisparse_algo_la_DEPENDENCIES)
+ $(AM_V_F77LD)$(F77LINK) $(am_libscisparse_algo_la_rpath) $(libscisparse_algo_la_OBJECTS) $(libscisparse_algo_la_LIBADD) $(LIBS)
+sci_gateway/c/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/c
+ @: > sci_gateway/c/$(am__dirstamp)
+sci_gateway/c/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/c/$(DEPDIR)
+ @: > sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spcompa.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_full.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_blkslvi.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_inpnvi.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_nnz.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_ludel.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spmatrix.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_msparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_blkfc1i.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_bfinit.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_lufact.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_symfcti.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_mfull.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_luget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_ordmmd.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spclean.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spchol.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_lusolve.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_fadj2sp.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-gw_sparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_sfinit.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_sparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_mspget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/fortran
+ @: > sci_gateway/fortran/$(am__dirstamp)
+sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/fortran/$(DEPDIR)
+ @: > sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spcompa.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_sparse.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_full.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_blkslvi.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_inpnvi.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_nnz.lo: sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ludel.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_bfinit.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/spops.lo: sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spmatrix.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_blkfc1i.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_lufact.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_symfcti.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_luget.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ordmmd.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spget.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spclean.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spchol.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_lusolve.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_fadj2sp.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_sfinit.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ta2lpd.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+
+libscisparse.la: $(libscisparse_la_OBJECTS) $(libscisparse_la_DEPENDENCIES) $(EXTRA_libscisparse_la_DEPENDENCIES)
+ $(AM_V_F77LD)$(F77LINK) $(am_libscisparse_la_rpath) $(libscisparse_la_OBJECTS) $(libscisparse_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f sci_gateway/c/*.$(OBJEXT)
+ -rm -f sci_gateway/c/*.lo
+ -rm -f sci_gateway/fortran/*.$(OBJEXT)
+ -rm -f sci_gateway/fortran/*.lo
+ -rm -f src/c/*.$(OBJEXT)
+ -rm -f src/c/*.lo
+ -rm -f src/fortran/*.$(OBJEXT)
+ -rm -f src/fortran/*.lo
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Plo
+include sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-lu.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Plo
+include src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Plo
+
+.c.o:
+ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Po
+# $(AM_V_CC)source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Po
+# $(AM_V_CC)source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Plo
+# $(AM_V_CC)source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $<
+
+src/c/libscisparse_algo_la-spUtils.lo: src/c/spUtils.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spUtils.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Tpo -c -o src/c/libscisparse_algo_la-spUtils.lo `test -f 'src/c/spUtils.c' || echo '$(srcdir)/'`src/c/spUtils.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Plo
+# $(AM_V_CC)source='src/c/spUtils.c' object='src/c/libscisparse_algo_la-spUtils.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spUtils.lo `test -f 'src/c/spUtils.c' || echo '$(srcdir)/'`src/c/spUtils.c
+
+src/c/libscisparse_algo_la-mspelm.lo: src/c/mspelm.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-mspelm.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Tpo -c -o src/c/libscisparse_algo_la-mspelm.lo `test -f 'src/c/mspelm.c' || echo '$(srcdir)/'`src/c/mspelm.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Plo
+# $(AM_V_CC)source='src/c/mspelm.c' object='src/c/libscisparse_algo_la-mspelm.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-mspelm.lo `test -f 'src/c/mspelm.c' || echo '$(srcdir)/'`src/c/mspelm.c
+
+src/c/libscisparse_algo_la-lu.lo: src/c/lu.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-lu.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-lu.Tpo -c -o src/c/libscisparse_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-lu.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-lu.Plo
+# $(AM_V_CC)source='src/c/lu.c' object='src/c/libscisparse_algo_la-lu.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+
+src/c/libscisparse_algo_la-spFactor.lo: src/c/spFactor.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spFactor.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Tpo -c -o src/c/libscisparse_algo_la-spFactor.lo `test -f 'src/c/spFactor.c' || echo '$(srcdir)/'`src/c/spFactor.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Plo
+# $(AM_V_CC)source='src/c/spFactor.c' object='src/c/libscisparse_algo_la-spFactor.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spFactor.lo `test -f 'src/c/spFactor.c' || echo '$(srcdir)/'`src/c/spFactor.c
+
+src/c/libscisparse_algo_la-spBuild.lo: src/c/spBuild.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spBuild.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Tpo -c -o src/c/libscisparse_algo_la-spBuild.lo `test -f 'src/c/spBuild.c' || echo '$(srcdir)/'`src/c/spBuild.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Plo
+# $(AM_V_CC)source='src/c/spBuild.c' object='src/c/libscisparse_algo_la-spBuild.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spBuild.lo `test -f 'src/c/spBuild.c' || echo '$(srcdir)/'`src/c/spBuild.c
+
+src/c/libscisparse_algo_la-spOutput.lo: src/c/spOutput.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spOutput.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Tpo -c -o src/c/libscisparse_algo_la-spOutput.lo `test -f 'src/c/spOutput.c' || echo '$(srcdir)/'`src/c/spOutput.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Plo
+# $(AM_V_CC)source='src/c/spOutput.c' object='src/c/libscisparse_algo_la-spOutput.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spOutput.lo `test -f 'src/c/spOutput.c' || echo '$(srcdir)/'`src/c/spOutput.c
+
+src/c/libscisparse_algo_la-spAllocate.lo: src/c/spAllocate.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spAllocate.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Tpo -c -o src/c/libscisparse_algo_la-spAllocate.lo `test -f 'src/c/spAllocate.c' || echo '$(srcdir)/'`src/c/spAllocate.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Plo
+# $(AM_V_CC)source='src/c/spAllocate.c' object='src/c/libscisparse_algo_la-spAllocate.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spAllocate.lo `test -f 'src/c/spAllocate.c' || echo '$(srcdir)/'`src/c/spAllocate.c
+
+src/c/libscisparse_algo_la-spSolve.lo: src/c/spSolve.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spSolve.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Tpo -c -o src/c/libscisparse_algo_la-spSolve.lo `test -f 'src/c/spSolve.c' || echo '$(srcdir)/'`src/c/spSolve.c
+ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Plo
+# $(AM_V_CC)source='src/c/spSolve.c' object='src/c/libscisparse_algo_la-spSolve.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spSolve.lo `test -f 'src/c/spSolve.c' || echo '$(srcdir)/'`src/c/spSolve.c
+
+sci_gateway/c/libscisparse_la-sci_spcompa.lo: sci_gateway/c/sci_spcompa.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spcompa.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spcompa.lo `test -f 'sci_gateway/c/sci_spcompa.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spcompa.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_spcompa.c' object='sci_gateway/c/libscisparse_la-sci_spcompa.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spcompa.lo `test -f 'sci_gateway/c/sci_spcompa.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spcompa.c
+
+sci_gateway/c/libscisparse_la-sci_full.lo: sci_gateway/c/sci_full.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_full.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Tpo -c -o sci_gateway/c/libscisparse_la-sci_full.lo `test -f 'sci_gateway/c/sci_full.c' || echo '$(srcdir)/'`sci_gateway/c/sci_full.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_full.c' object='sci_gateway/c/libscisparse_la-sci_full.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_full.lo `test -f 'sci_gateway/c/sci_full.c' || echo '$(srcdir)/'`sci_gateway/c/sci_full.c
+
+sci_gateway/c/libscisparse_la-sci_blkslvi.lo: sci_gateway/c/sci_blkslvi.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_blkslvi.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Tpo -c -o sci_gateway/c/libscisparse_la-sci_blkslvi.lo `test -f 'sci_gateway/c/sci_blkslvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkslvi.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_blkslvi.c' object='sci_gateway/c/libscisparse_la-sci_blkslvi.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_blkslvi.lo `test -f 'sci_gateway/c/sci_blkslvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkslvi.c
+
+sci_gateway/c/libscisparse_la-sci_inpnvi.lo: sci_gateway/c/sci_inpnvi.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_inpnvi.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Tpo -c -o sci_gateway/c/libscisparse_la-sci_inpnvi.lo `test -f 'sci_gateway/c/sci_inpnvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inpnvi.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_inpnvi.c' object='sci_gateway/c/libscisparse_la-sci_inpnvi.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_inpnvi.lo `test -f 'sci_gateway/c/sci_inpnvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inpnvi.c
+
+sci_gateway/c/libscisparse_la-sci_nnz.lo: sci_gateway/c/sci_nnz.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_nnz.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Tpo -c -o sci_gateway/c/libscisparse_la-sci_nnz.lo `test -f 'sci_gateway/c/sci_nnz.c' || echo '$(srcdir)/'`sci_gateway/c/sci_nnz.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_nnz.c' object='sci_gateway/c/libscisparse_la-sci_nnz.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_nnz.lo `test -f 'sci_gateway/c/sci_nnz.c' || echo '$(srcdir)/'`sci_gateway/c/sci_nnz.c
+
+sci_gateway/c/libscisparse_la-sci_ludel.lo: sci_gateway/c/sci_ludel.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_ludel.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Tpo -c -o sci_gateway/c/libscisparse_la-sci_ludel.lo `test -f 'sci_gateway/c/sci_ludel.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ludel.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_ludel.c' object='sci_gateway/c/libscisparse_la-sci_ludel.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_ludel.lo `test -f 'sci_gateway/c/sci_ludel.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ludel.c
+
+sci_gateway/c/libscisparse_la-sci_spmatrix.lo: sci_gateway/c/sci_spmatrix.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spmatrix.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spmatrix.lo `test -f 'sci_gateway/c/sci_spmatrix.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spmatrix.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_spmatrix.c' object='sci_gateway/c/libscisparse_la-sci_spmatrix.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spmatrix.lo `test -f 'sci_gateway/c/sci_spmatrix.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spmatrix.c
+
+sci_gateway/c/libscisparse_la-sci_msparse.lo: sci_gateway/c/sci_msparse.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_msparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Tpo -c -o sci_gateway/c/libscisparse_la-sci_msparse.lo `test -f 'sci_gateway/c/sci_msparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_msparse.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_msparse.c' object='sci_gateway/c/libscisparse_la-sci_msparse.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_msparse.lo `test -f 'sci_gateway/c/sci_msparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_msparse.c
+
+sci_gateway/c/libscisparse_la-sci_blkfc1i.lo: sci_gateway/c/sci_blkfc1i.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_blkfc1i.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Tpo -c -o sci_gateway/c/libscisparse_la-sci_blkfc1i.lo `test -f 'sci_gateway/c/sci_blkfc1i.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkfc1i.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_blkfc1i.c' object='sci_gateway/c/libscisparse_la-sci_blkfc1i.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_blkfc1i.lo `test -f 'sci_gateway/c/sci_blkfc1i.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkfc1i.c
+
+sci_gateway/c/libscisparse_la-sci_bfinit.lo: sci_gateway/c/sci_bfinit.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_bfinit.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Tpo -c -o sci_gateway/c/libscisparse_la-sci_bfinit.lo `test -f 'sci_gateway/c/sci_bfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bfinit.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_bfinit.c' object='sci_gateway/c/libscisparse_la-sci_bfinit.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_bfinit.lo `test -f 'sci_gateway/c/sci_bfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bfinit.c
+
+sci_gateway/c/libscisparse_la-sci_lufact.lo: sci_gateway/c/sci_lufact.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_lufact.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Tpo -c -o sci_gateway/c/libscisparse_la-sci_lufact.lo `test -f 'sci_gateway/c/sci_lufact.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lufact.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_lufact.c' object='sci_gateway/c/libscisparse_la-sci_lufact.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_lufact.lo `test -f 'sci_gateway/c/sci_lufact.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lufact.c
+
+sci_gateway/c/libscisparse_la-sci_symfcti.lo: sci_gateway/c/sci_symfcti.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_symfcti.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Tpo -c -o sci_gateway/c/libscisparse_la-sci_symfcti.lo `test -f 'sci_gateway/c/sci_symfcti.c' || echo '$(srcdir)/'`sci_gateway/c/sci_symfcti.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_symfcti.c' object='sci_gateway/c/libscisparse_la-sci_symfcti.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_symfcti.lo `test -f 'sci_gateway/c/sci_symfcti.c' || echo '$(srcdir)/'`sci_gateway/c/sci_symfcti.c
+
+sci_gateway/c/libscisparse_la-sci_mfull.lo: sci_gateway/c/sci_mfull.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_mfull.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Tpo -c -o sci_gateway/c/libscisparse_la-sci_mfull.lo `test -f 'sci_gateway/c/sci_mfull.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mfull.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_mfull.c' object='sci_gateway/c/libscisparse_la-sci_mfull.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_mfull.lo `test -f 'sci_gateway/c/sci_mfull.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mfull.c
+
+sci_gateway/c/libscisparse_la-sci_luget.lo: sci_gateway/c/sci_luget.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_luget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_luget.lo `test -f 'sci_gateway/c/sci_luget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_luget.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_luget.c' object='sci_gateway/c/libscisparse_la-sci_luget.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_luget.lo `test -f 'sci_gateway/c/sci_luget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_luget.c
+
+sci_gateway/c/libscisparse_la-sci_ordmmd.lo: sci_gateway/c/sci_ordmmd.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_ordmmd.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo -c -o sci_gateway/c/libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/c/sci_ordmmd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ordmmd.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_ordmmd.c' object='sci_gateway/c/libscisparse_la-sci_ordmmd.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/c/sci_ordmmd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ordmmd.c
+
+sci_gateway/c/libscisparse_la-sci_spget.lo: sci_gateway/c/sci_spget.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spget.lo `test -f 'sci_gateway/c/sci_spget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spget.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_spget.c' object='sci_gateway/c/libscisparse_la-sci_spget.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spget.lo `test -f 'sci_gateway/c/sci_spget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spget.c
+
+sci_gateway/c/libscisparse_la-sci_spclean.lo: sci_gateway/c/sci_spclean.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spclean.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spclean.lo `test -f 'sci_gateway/c/sci_spclean.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spclean.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_spclean.c' object='sci_gateway/c/libscisparse_la-sci_spclean.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spclean.lo `test -f 'sci_gateway/c/sci_spclean.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spclean.c
+
+sci_gateway/c/libscisparse_la-sci_spchol.lo: sci_gateway/c/sci_spchol.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spchol.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spchol.lo `test -f 'sci_gateway/c/sci_spchol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spchol.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_spchol.c' object='sci_gateway/c/libscisparse_la-sci_spchol.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spchol.lo `test -f 'sci_gateway/c/sci_spchol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spchol.c
+
+sci_gateway/c/libscisparse_la-sci_lusolve.lo: sci_gateway/c/sci_lusolve.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_lusolve.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Tpo -c -o sci_gateway/c/libscisparse_la-sci_lusolve.lo `test -f 'sci_gateway/c/sci_lusolve.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lusolve.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_lusolve.c' object='sci_gateway/c/libscisparse_la-sci_lusolve.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_lusolve.lo `test -f 'sci_gateway/c/sci_lusolve.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lusolve.c
+
+sci_gateway/c/libscisparse_la-sci_fadj2sp.lo: sci_gateway/c/sci_fadj2sp.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_fadj2sp.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Tpo -c -o sci_gateway/c/libscisparse_la-sci_fadj2sp.lo `test -f 'sci_gateway/c/sci_fadj2sp.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fadj2sp.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_fadj2sp.c' object='sci_gateway/c/libscisparse_la-sci_fadj2sp.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_fadj2sp.lo `test -f 'sci_gateway/c/sci_fadj2sp.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fadj2sp.c
+
+sci_gateway/c/libscisparse_la-gw_sparse.lo: sci_gateway/c/gw_sparse.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-gw_sparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Tpo -c -o sci_gateway/c/libscisparse_la-gw_sparse.lo `test -f 'sci_gateway/c/gw_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/gw_sparse.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Plo
+# $(AM_V_CC)source='sci_gateway/c/gw_sparse.c' object='sci_gateway/c/libscisparse_la-gw_sparse.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-gw_sparse.lo `test -f 'sci_gateway/c/gw_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/gw_sparse.c
+
+sci_gateway/c/libscisparse_la-sci_sfinit.lo: sci_gateway/c/sci_sfinit.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_sfinit.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Tpo -c -o sci_gateway/c/libscisparse_la-sci_sfinit.lo `test -f 'sci_gateway/c/sci_sfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sfinit.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_sfinit.c' object='sci_gateway/c/libscisparse_la-sci_sfinit.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_sfinit.lo `test -f 'sci_gateway/c/sci_sfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sfinit.c
+
+sci_gateway/c/libscisparse_la-sci_sparse.lo: sci_gateway/c/sci_sparse.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_sparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Tpo -c -o sci_gateway/c/libscisparse_la-sci_sparse.lo `test -f 'sci_gateway/c/sci_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sparse.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_sparse.c' object='sci_gateway/c/libscisparse_la-sci_sparse.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_sparse.lo `test -f 'sci_gateway/c/sci_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sparse.c
+
+sci_gateway/c/libscisparse_la-sci_mspget.lo: sci_gateway/c/sci_mspget.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_mspget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_mspget.lo `test -f 'sci_gateway/c/sci_mspget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mspget.c
+ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Plo
+# $(AM_V_CC)source='sci_gateway/c/sci_mspget.c' object='sci_gateway/c/libscisparse_la-sci_mspget.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_mspget.lo `test -f 'sci_gateway/c/sci_mspget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mspget.c
+
+.f.o:
+ $(AM_V_F77)$(F77COMPILE) -c -o $@ $<
+
+.f.obj:
+ $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f.lo:
+ $(AM_V_F77)$(LTF77COMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+ -rm -rf sci_gateway/c/.libs sci_gateway/c/_libs
+ -rm -rf sci_gateway/fortran/.libs sci_gateway/fortran/_libs
+ -rm -rf src/c/.libs src/c/_libs
+ -rm -rf src/fortran/.libs src/fortran/_libs
+install-libscisparse_la_etcDATA: $(libscisparse_la_etc_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_etc_DATA)'; test -n "$(libscisparse_la_etcdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_etcdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_etcdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_etcdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_etcdir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_etcDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_etc_DATA)'; test -n "$(libscisparse_la_etcdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_etcdir)'; $(am__uninstall_files_from_dir)
+install-libscisparse_la_rootDATA: $(libscisparse_la_root_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_root_DATA)'; test -n "$(libscisparse_la_rootdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_rootdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_rootdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_rootdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_rootdir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_rootDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_root_DATA)'; test -n "$(libscisparse_la_rootdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_rootdir)'; $(am__uninstall_files_from_dir)
+install-libscisparse_la_sci_gatewayDATA: $(libscisparse_la_sci_gateway_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_sci_gateway_DATA)'; test -n "$(libscisparse_la_sci_gatewaydir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_sci_gatewayDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_sci_gateway_DATA)'; test -n "$(libscisparse_la_sci_gatewaydir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libscisparse_la_etcdir)" "$(DESTDIR)$(libscisparse_la_rootdir)" "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+ -rm -f sci_gateway/c/$(am__dirstamp)
+ -rm -f sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+ -rm -f sci_gateway/fortran/$(am__dirstamp)
+ -rm -f src/c/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/c/$(am__dirstamp)
+ -rm -f src/fortran/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/fortran/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local \
+ clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-libscisparse_la_etcDATA \
+ install-libscisparse_la_rootDATA \
+ install-libscisparse_la_sci_gatewayDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am: install-html-local
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libscisparse_la_etcDATA \
+ uninstall-libscisparse_la_rootDATA \
+ uninstall-libscisparse_la_sci_gatewayDATA \
+ uninstall-pkglibLTLIBRARIES
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \
+ check-local clean clean-generic clean-libtool clean-local \
+ clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-data-local install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-html-local install-info \
+ install-info-am install-libscisparse_la_etcDATA \
+ install-libscisparse_la_rootDATA \
+ install-libscisparse_la_sci_gatewayDATA install-man \
+ install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am \
+ uninstall-libscisparse_la_etcDATA \
+ uninstall-libscisparse_la_rootDATA \
+ uninstall-libscisparse_la_sci_gatewayDATA \
+ uninstall-pkglibLTLIBRARIES
+
+
+# This target enables tests for Scilab
+check-local: $(top_builddir)/scilab-bin test
+ if test -d $(mydatadir)/tests; then \
+ @COMMAND="try test_run('$(modulename)');catch exit(-1);end;exit(0)"; export LANG=C; $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"; \
+ fi
+check-code:
+ if test -f build.xml; then \
+ $(ANT) checkstyle; \
+ fi
+ if test -x "$(SPLINT)"; then \
+ $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \
+ fi
+java:
+# Some configurations needs to export JAVA_HOME in the current env
+ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+ if test -f build.xml -a $$USEANT -eq 1; then \
+ $(ANT); \
+ fi
+
+clean-java:
+# Some configurations needs to export JAVA_HOME in the current env
+ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+ if test -f build.xml -a $$USEANT -eq 1; then \
+ $(ANT) clean; \
+ fi;
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+#swig: $(SWIG_WRAPPERS)
+# @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \
+# SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \
+# if test -n "$(SWIG_WRAPPERS)"; then \
+# for file in $(SWIG_WRAPPERS) ; do \
+# echo "Swig process of $$file (Java) ..."; \
+# $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME -outdir $$SWIG_OUTDIR $$file; \
+# done; \
+# fi
+
+#swig-scilab: $(SWIG_SCILAB_WRAPPERS)
+# @SWIG_OUTDIR=src/swig/; \
+# if test -n "$(SWIG_SCILAB_WRAPPERS)"; then \
+# for file in $(SWIG_SCILAB_WRAPPERS) ; do \
+# echo "Swig process of $$file (Scilab) ..."; \
+# $(SWIG_BIN) $(SWIG_SCILAB) -outdir $$SWIG_OUTDIR $$file; \
+# done; \
+# fi
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+#giws: $(GIWS_WRAPPERS)
+# @GIWS_OUTPUTDIR=src/jni/; \
+# MANDATORY_OPTIONS="--throws-exception-on-error --description-file"; \
+# if test -n "$(GIWS_WRAPPERS)"; then \
+# for file in $(GIWS_WRAPPERS) ; do \
+# echo "GIWS process of $$file ..."; \
+# if test -z "$(GIWS_OPTIONS)"; then \
+# $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+# else \
+# echo "Custom GIWS call with '$$GIWS_OPTIONS'"; \
+# $(GIWS_BIN) $$GIWS_OPTIONS --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+# fi \
+# done; \
+# fi
+
+#giws-exception:
+# @GIWS_OUTPUTDIR=src/jni/;\
+# echo "GIWS: Generation of exception class ..."; \
+# $(GIWS_BIN) --generate-exception-class --output-dir $$GIWS_OUTPUTDIR
+
+macros:
+ -@( if test ! -x $(top_builddir)/scilab-bin; then \
+ echo "Error : Cannot build $< : Scilab has not been built"; \
+ else \
+ $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\
+ fi)
+
+# Removes the macros
+clean-macros:
+# Removes macros (*.bin generated from .sci)
+ @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+ echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \
+ rm -f $(builddir)/$$dir/$(MACROBINMASK); \
+ done
+
+test:
+# More tests could be added here
+ @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+ if test -f build.xml -a $$USEANT -eq 1; then \
+ $(ANT) test; \
+ fi
+
+all-local: $(TARGETS_ALL)
+
+.sci.bin:
+ -@( if test ! -x $(top_builddir)/scilab-bin; then \
+ echo "Error : Cannot build $< : Scilab has not been build"; \
+ else \
+ echo "Creating $@"; \
+ $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \
+ fi )
+
+install-html-local:
+
+install-data-local-local:
+# Mainly for javasci
+ @if test -d $(srcdir)/javadoc; then \
+ cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \
+ fi
+# If the user wants the help sources to be installed
+ @echo "-------- Install of XML sources of help files --------"; \
+ for lang in $(ALL_LINGUAS); do \
+ if test -d $(srcdir)/help/$$lang; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \
+ if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \
+ for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \
+ done ; \
+ fi; \
+ fi; \
+ done; \
+ @echo "-------- Install of MathML sources --------"; \
+ if test -d $(srcdir)/help/mml/; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \
+ if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \
+ for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \
+ done ; \
+ fi; \
+ fi
+install-data-local:
+# Install the tests
+ @echo "-------- Install tests (if any) --------"; \
+ for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \
+ if test -d $(srcdir)/$$dir/; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+ if test -d "$(srcdir)/$$dir/$$file"; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \
+ $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \
+ else \
+ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+ fi \
+ done; \
+ fi; \
+ done
+# Install the help chapter
+ @echo "-------- Install the help chapter (if any) --------"; \
+ for lang in $(HELP_CHAPTERLANG); do \
+ HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \
+ if test -f $$HELPFILE; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+ echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+ $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+ fi; \
+ done
+# Install the demos & examples
+ @echo "-------- Install demos & examples (if any) --------"; \
+ for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \
+ if test -d $(srcdir)/$$dir/; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
+ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+ if test -d "$(srcdir)/$$dir/$$file"; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \
+ $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \
+ else \
+ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+ fi \
+ done; \
+ fi; \
+ done
+# Install the macros
+ @echo "-------- Install macros (if any) --------"; \
+ for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+ if test -d $(srcdir)/$$dir/; then \
+ FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\
+ if test -n "$(MACROSSPECIALEXT)"; then \
+ specialExtDir=""; \
+ for specialExt in $(MACROSSPECIALEXT); do \
+ specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \
+ done; \
+ FILELIST="$$FILELIST $$specialExtDir"; \
+ fi; \
+ for file in `ls -1 $$FILELIST 2>/dev/null`; do \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \
+ done; \
+ fi; \
+ done
+# Install java files (.jar)
+ @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \
+ echo "-------- Install jar files --------"; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \
+ for file in $(srcdir)/$(JARDIR)$(JARMASK); do\
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \
+ done ; \
+ fi
+
+########### CLEAN ###################
+# Clean help (generated automatically by Scilab)
+# It used to clean the macro (clean-macros) but this was causing
+# make clean && make to fail Scilab startup
+clean-local: clean-java
+#clean-local:
+
+distclean-local:
+ rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_*
+
+.PHONY: macros java swig giws
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/modules/sparse/Makefile.am b/modules/sparse/Makefile.am
new file mode 100755
index 000000000..07f412320
--- /dev/null
+++ b/modules/sparse/Makefile.am
@@ -0,0 +1,198 @@
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006 - INRIA - Sylvestre LEDRU
+#
+# This file is distributed under the same license as the Scilab package.
+
+SPARSE_C_SOURCES = \
+src/c/spUtils.c \
+src/c/mspelm.c \
+src/c/lu.c \
+src/c/spFactor.c \
+src/c/spBuild.c \
+src/c/spOutput.c \
+src/c/spAllocate.c \
+src/c/spSolve.c
+# src/c/spFortran.c
+
+SPARSE_FORTRAN_SOURCES = src/fortran/spcompack.f \
+src/fortran/wsposp.f \
+src/fortran/findl.f \
+src/fortran/spcho1.f \
+src/fortran/dspful.f \
+src/fortran/blkslv.f \
+src/fortran/wspcle.f \
+src/fortran/wspt.f \
+src/fortran/wspssp.f \
+src/fortran/lspmat.f \
+src/fortran/lsosp.f \
+src/fortran/blkfc1.f \
+src/fortran/wspxsp.f \
+src/fortran/lspful.f \
+src/fortran/blkfct.f \
+src/fortran/symfct.f \
+src/fortran/dspt.f \
+src/fortran/wspos.f \
+src/fortran/dful2sp.f \
+src/fortran/sputil.f \
+src/fortran/lspt.f \
+src/fortran/dspxs.f \
+src/fortran/sp2col.f \
+src/fortran/dcompa.f \
+src/fortran/sz2ptr.f \
+src/fortran/spt.f \
+src/fortran/lcompa.f \
+src/fortran/wspmat.f \
+src/fortran/iperm.f \
+src/fortran/wspful.f \
+src/fortran/spif1b.f \
+src/fortran/spextr.f \
+src/fortran/lful2sp.f \
+src/fortran/dspos.f \
+src/fortran/dspasp.f \
+src/fortran/inpnv.f \
+src/fortran/spreshape.f \
+src/fortran/spsort.f \
+src/fortran/wperm.f \
+src/fortran/dij2sp.f \
+src/fortran/dspcsp.f \
+src/fortran/spcho2.f \
+src/fortran/lspos.f \
+src/fortran/wspe2.f \
+src/fortran/spif.f \
+src/fortran/lspasp.f \
+src/fortran/dspisp.f \
+src/fortran/wful2sp.f \
+src/fortran/lij2sp.f \
+src/fortran/lspcsp.f \
+src/fortran/wspis.f \
+src/fortran/dspmsp.f \
+src/fortran/dsposp.f \
+src/fortran/wsmsp.f \
+src/fortran/wspms.f \
+src/fortran/lspisp.f \
+src/fortran/dspcle.f \
+src/fortran/wsosp.f \
+src/fortran/dspssp.f \
+src/fortran/lsposp.f \
+src/fortran/dspxsp.f \
+src/fortran/ordmmd.f \
+src/fortran/spextr1.f \
+src/fortran/wcompa.f \
+src/fortran/lspxsp.f \
+src/fortran/spisp.f \
+src/fortran/dperm.f \
+src/fortran/spind.f \
+src/fortran/dspe2.f \
+src/fortran/wspasp.f \
+src/fortran/wij2sp.f \
+src/fortran/wspcsp.f \
+src/fortran/lspops.f \
+src/fortran/spifp.f \
+src/fortran/isort1.f \
+src/fortran/dspis.f \
+src/fortran/wspxs.f \
+src/fortran/lspe2.f \
+src/fortran/wspisp.f \
+src/fortran/dsmsp.f \
+src/fortran/dspms.f \
+src/fortran/spord.f \
+src/fortran/dsosp.f \
+src/fortran/dspmat.f \
+src/fortran/wspmsp.f \
+src/fortran/lspis.f \
+src/fortran/writebuf.f \
+src/fortran/ta2lpd.f
+
+GATEWAY_C_SOURCES = sci_gateway/c/sci_spcompa.c \
+sci_gateway/c/sci_full.c \
+sci_gateway/c/sci_blkslvi.c \
+sci_gateway/c/sci_inpnvi.c \
+sci_gateway/c/sci_nnz.c \
+sci_gateway/c/sci_ludel.c \
+sci_gateway/c/sci_spmatrix.c \
+sci_gateway/c/sci_msparse.c \
+sci_gateway/c/sci_blkfc1i.c \
+sci_gateway/c/sci_bfinit.c \
+sci_gateway/c/sci_lufact.c \
+sci_gateway/c/sci_symfcti.c \
+sci_gateway/c/sci_mfull.c \
+sci_gateway/c/sci_luget.c \
+sci_gateway/c/sci_ordmmd.c \
+sci_gateway/c/sci_spget.c \
+sci_gateway/c/sci_spclean.c \
+sci_gateway/c/sci_spchol.c \
+sci_gateway/c/sci_lusolve.c \
+sci_gateway/c/sci_fadj2sp.c \
+sci_gateway/c/gw_sparse.c \
+sci_gateway/c/sci_sfinit.c \
+sci_gateway/c/sci_sparse.c \
+sci_gateway/c/sci_mspget.c
+
+GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_spcompa.f \
+sci_gateway/fortran/sci_f_sparse.f \
+sci_gateway/fortran/sci_f_full.f \
+sci_gateway/fortran/sci_f_blkslvi.f \
+sci_gateway/fortran/sci_f_inpnvi.f \
+sci_gateway/fortran/sci_f_nnz.f \
+sci_gateway/fortran/sci_f_ludel.f \
+sci_gateway/fortran/sci_f_bfinit.f \
+sci_gateway/fortran/spops.f \
+sci_gateway/fortran/sci_f_spmatrix.f \
+sci_gateway/fortran/sci_f_blkfc1i.f \
+sci_gateway/fortran/sci_f_lufact.f \
+sci_gateway/fortran/sci_f_symfcti.f \
+sci_gateway/fortran/sci_f_luget.f \
+sci_gateway/fortran/sci_f_ordmmd.f \
+sci_gateway/fortran/sci_f_spget.f \
+sci_gateway/fortran/sci_f_spclean.f \
+sci_gateway/fortran/sci_f_spchol.f \
+sci_gateway/fortran/sci_f_lusolve.f \
+sci_gateway/fortran/sci_f_fadj2sp.f \
+sci_gateway/fortran/sci_f_sfinit.f \
+sci_gateway/fortran/sci_f_ta2lpd.f
+
+libscisparse_la_CPPFLAGS = -I$(srcdir)/includes/ \
+ -I$(top_srcdir)/modules/api_scilab/includes/ \
+ -I$(top_srcdir)/modules/elementary_functions/includes/ \
+ -I$(top_srcdir)/modules/localization/includes/ \
+ -I$(top_srcdir)/modules/output_stream/includes/ \
+ $(AM_CPPFLAGS)
+
+#-Isrc/c/
+if MAINTAINER_MODE
+pkglib_LTLIBRARIES = libscisparse.la
+noinst_LTLIBRARIES = libscisparse-algo.la
+else
+noinst_LTLIBRARIES = libscisparse-algo.la libscisparse.la
+endif
+
+
+
+libscisparse_algo_la_SOURCES = $(SPARSE_C_SOURCES) $(SPARSE_FORTRAN_SOURCES)
+libscisparse_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscisparse_algo_la_CPPFLAGS = $(libscisparse_la_CPPFLAGS)
+
+# For the code check (splint)
+CHECK_SRC = $(SPARSE_C_SOURCES) $(GATEWAY_C_SOURCES)
+INCLUDE_FLAGS = $(libscisparse_la_CPPFLAGS)
+
+libscisparse_la_LIBADD = libscisparse-algo.la
+
+#### Target ######
+modulename=sparse
+
+
+#### sparse : Conf files ####
+libscisparse_la_rootdir = $(mydatadir)
+libscisparse_la_root_DATA = license.txt
+
+
+#### sparse : init scripts ####
+libscisparse_la_etcdir = $(mydatadir)/etc
+libscisparse_la_etc_DATA = etc/sparse.quit etc/sparse.start
+
+#### sparse : gateway declaration ####
+libscisparse_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libscisparse_la_sci_gateway_DATA = sci_gateway/sparse_gateway.xml
+
+include $(top_srcdir)/Makefile.incl.am
diff --git a/modules/sparse/Makefile.in b/modules/sparse/Makefile.in
new file mode 100755
index 000000000..18e60e22a
--- /dev/null
+++ b/modules/sparse/Makefile.in
@@ -0,0 +1,2155 @@
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006 - INRIA - Sylvestre LEDRU
+#
+# This file is distributed under the same license as the Scilab package.
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+#
+# This file must be used under the terms of the CeCILL.
+# This source file is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at
+# http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+#
+
+##########
+### Makefile included stuff
+### Target, variable, suffixes which are supposed to be useful in every makefile.am
+##########
+
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(top_srcdir)/Makefile.incl.am $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am $(top_srcdir)/config/mkinstalldirs \
+ $(top_srcdir)/config/depcomp
+@NEED_JAVA_TRUE@am__append_1 = java
+subdir = modules/sparse
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/backtrace.m4 \
+ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/curl.m4 \
+ $(top_srcdir)/m4/docbook.m4 $(top_srcdir)/m4/doxygen.m4 \
+ $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \
+ $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/hdf5.m4 \
+ $(top_srcdir)/m4/intel_compiler.m4 \
+ $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \
+ $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \
+ $(top_srcdir)/m4/mpi.m4 $(top_srcdir)/m4/ocaml.m4 \
+ $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/pkg.m4 \
+ $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \
+ $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \
+ $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(pkglibdir)" \
+ "$(DESTDIR)$(libscisparse_la_etcdir)" \
+ "$(DESTDIR)$(libscisparse_la_rootdir)" \
+ "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)"
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
+libscisparse_algo_la_LIBADD =
+am__dirstamp = $(am__leading_dot)dirstamp
+am__objects_1 = src/c/libscisparse_algo_la-spUtils.lo \
+ src/c/libscisparse_algo_la-mspelm.lo \
+ src/c/libscisparse_algo_la-lu.lo \
+ src/c/libscisparse_algo_la-spFactor.lo \
+ src/c/libscisparse_algo_la-spBuild.lo \
+ src/c/libscisparse_algo_la-spOutput.lo \
+ src/c/libscisparse_algo_la-spAllocate.lo \
+ src/c/libscisparse_algo_la-spSolve.lo
+am__objects_2 = src/fortran/spcompack.lo src/fortran/wsposp.lo \
+ src/fortran/findl.lo src/fortran/spcho1.lo \
+ src/fortran/dspful.lo src/fortran/blkslv.lo \
+ src/fortran/wspcle.lo src/fortran/wspt.lo \
+ src/fortran/wspssp.lo src/fortran/lspmat.lo \
+ src/fortran/lsosp.lo src/fortran/blkfc1.lo \
+ src/fortran/wspxsp.lo src/fortran/lspful.lo \
+ src/fortran/blkfct.lo src/fortran/symfct.lo \
+ src/fortran/dspt.lo src/fortran/wspos.lo \
+ src/fortran/dful2sp.lo src/fortran/sputil.lo \
+ src/fortran/lspt.lo src/fortran/dspxs.lo src/fortran/sp2col.lo \
+ src/fortran/dcompa.lo src/fortran/sz2ptr.lo src/fortran/spt.lo \
+ src/fortran/lcompa.lo src/fortran/wspmat.lo \
+ src/fortran/iperm.lo src/fortran/wspful.lo \
+ src/fortran/spif1b.lo src/fortran/spextr.lo \
+ src/fortran/lful2sp.lo src/fortran/dspos.lo \
+ src/fortran/dspasp.lo src/fortran/inpnv.lo \
+ src/fortran/spreshape.lo src/fortran/spsort.lo \
+ src/fortran/wperm.lo src/fortran/dij2sp.lo \
+ src/fortran/dspcsp.lo src/fortran/spcho2.lo \
+ src/fortran/lspos.lo src/fortran/wspe2.lo src/fortran/spif.lo \
+ src/fortran/lspasp.lo src/fortran/dspisp.lo \
+ src/fortran/wful2sp.lo src/fortran/lij2sp.lo \
+ src/fortran/lspcsp.lo src/fortran/wspis.lo \
+ src/fortran/dspmsp.lo src/fortran/dsposp.lo \
+ src/fortran/wsmsp.lo src/fortran/wspms.lo \
+ src/fortran/lspisp.lo src/fortran/dspcle.lo \
+ src/fortran/wsosp.lo src/fortran/dspssp.lo \
+ src/fortran/lsposp.lo src/fortran/dspxsp.lo \
+ src/fortran/ordmmd.lo src/fortran/spextr1.lo \
+ src/fortran/wcompa.lo src/fortran/lspxsp.lo \
+ src/fortran/spisp.lo src/fortran/dperm.lo src/fortran/spind.lo \
+ src/fortran/dspe2.lo src/fortran/wspasp.lo \
+ src/fortran/wij2sp.lo src/fortran/wspcsp.lo \
+ src/fortran/lspops.lo src/fortran/spifp.lo \
+ src/fortran/isort1.lo src/fortran/dspis.lo \
+ src/fortran/wspxs.lo src/fortran/lspe2.lo \
+ src/fortran/wspisp.lo src/fortran/dsmsp.lo \
+ src/fortran/dspms.lo src/fortran/spord.lo src/fortran/dsosp.lo \
+ src/fortran/dspmat.lo src/fortran/wspmsp.lo \
+ src/fortran/lspis.lo src/fortran/writebuf.lo \
+ src/fortran/ta2lpd.lo
+am_libscisparse_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
+libscisparse_algo_la_OBJECTS = $(am_libscisparse_algo_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+@MAINTAINER_MODE_FALSE@am_libscisparse_algo_la_rpath =
+@MAINTAINER_MODE_TRUE@am_libscisparse_algo_la_rpath =
+libscisparse_la_DEPENDENCIES = libscisparse-algo.la
+am__objects_3 = sci_gateway/c/libscisparse_la-sci_spcompa.lo \
+ sci_gateway/c/libscisparse_la-sci_full.lo \
+ sci_gateway/c/libscisparse_la-sci_blkslvi.lo \
+ sci_gateway/c/libscisparse_la-sci_inpnvi.lo \
+ sci_gateway/c/libscisparse_la-sci_nnz.lo \
+ sci_gateway/c/libscisparse_la-sci_ludel.lo \
+ sci_gateway/c/libscisparse_la-sci_spmatrix.lo \
+ sci_gateway/c/libscisparse_la-sci_msparse.lo \
+ sci_gateway/c/libscisparse_la-sci_blkfc1i.lo \
+ sci_gateway/c/libscisparse_la-sci_bfinit.lo \
+ sci_gateway/c/libscisparse_la-sci_lufact.lo \
+ sci_gateway/c/libscisparse_la-sci_symfcti.lo \
+ sci_gateway/c/libscisparse_la-sci_mfull.lo \
+ sci_gateway/c/libscisparse_la-sci_luget.lo \
+ sci_gateway/c/libscisparse_la-sci_ordmmd.lo \
+ sci_gateway/c/libscisparse_la-sci_spget.lo \
+ sci_gateway/c/libscisparse_la-sci_spclean.lo \
+ sci_gateway/c/libscisparse_la-sci_spchol.lo \
+ sci_gateway/c/libscisparse_la-sci_lusolve.lo \
+ sci_gateway/c/libscisparse_la-sci_fadj2sp.lo \
+ sci_gateway/c/libscisparse_la-gw_sparse.lo \
+ sci_gateway/c/libscisparse_la-sci_sfinit.lo \
+ sci_gateway/c/libscisparse_la-sci_sparse.lo \
+ sci_gateway/c/libscisparse_la-sci_mspget.lo
+am__objects_4 = sci_gateway/fortran/sci_f_spcompa.lo \
+ sci_gateway/fortran/sci_f_sparse.lo \
+ sci_gateway/fortran/sci_f_full.lo \
+ sci_gateway/fortran/sci_f_blkslvi.lo \
+ sci_gateway/fortran/sci_f_inpnvi.lo \
+ sci_gateway/fortran/sci_f_nnz.lo \
+ sci_gateway/fortran/sci_f_ludel.lo \
+ sci_gateway/fortran/sci_f_bfinit.lo \
+ sci_gateway/fortran/spops.lo \
+ sci_gateway/fortran/sci_f_spmatrix.lo \
+ sci_gateway/fortran/sci_f_blkfc1i.lo \
+ sci_gateway/fortran/sci_f_lufact.lo \
+ sci_gateway/fortran/sci_f_symfcti.lo \
+ sci_gateway/fortran/sci_f_luget.lo \
+ sci_gateway/fortran/sci_f_ordmmd.lo \
+ sci_gateway/fortran/sci_f_spget.lo \
+ sci_gateway/fortran/sci_f_spclean.lo \
+ sci_gateway/fortran/sci_f_spchol.lo \
+ sci_gateway/fortran/sci_f_lusolve.lo \
+ sci_gateway/fortran/sci_f_fadj2sp.lo \
+ sci_gateway/fortran/sci_f_sfinit.lo \
+ sci_gateway/fortran/sci_f_ta2lpd.lo
+am_libscisparse_la_OBJECTS = $(am__objects_3) $(am__objects_4)
+libscisparse_la_OBJECTS = $(am_libscisparse_la_OBJECTS)
+@MAINTAINER_MODE_FALSE@am_libscisparse_la_rpath =
+@MAINTAINER_MODE_TRUE@am_libscisparse_la_rpath = -rpath $(pkglibdir)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
+LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
+AM_V_F77 = $(am__v_F77_@AM_V@)
+am__v_F77_ = $(am__v_F77_@AM_DEFAULT_V@)
+am__v_F77_0 = @echo " F77 " $@;
+am__v_F77_1 =
+F77LD = $(F77)
+F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_F77LD = $(am__v_F77LD_@AM_V@)
+am__v_F77LD_ = $(am__v_F77LD_@AM_DEFAULT_V@)
+am__v_F77LD_0 = @echo " F77LD " $@;
+am__v_F77LD_1 =
+SOURCES = $(libscisparse_algo_la_SOURCES) $(libscisparse_la_SOURCES)
+DIST_SOURCES = $(libscisparse_algo_la_SOURCES) \
+ $(libscisparse_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+DATA = $(libscisparse_la_etc_DATA) $(libscisparse_la_root_DATA) \
+ $(libscisparse_la_sci_gateway_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+ALL_LINGUAS_DOC = @ALL_LINGUAS_DOC@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+ANT = @ANT@
+ANTLR = @ANTLR@
+AR = @AR@
+ARPACK_LIBS = @ARPACK_LIBS@
+ASM3 = @ASM3@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AVALON_FRAMEWORK = @AVALON_FRAMEWORK@
+AWK = @AWK@
+BATIK = @BATIK@
+BLAS_LIBS = @BLAS_LIBS@
+CC = @CC@
+CCACHE = @CCACHE@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKSTYLE = @CHECKSTYLE@
+COBERTURA = @COBERTURA@
+COMMONS_BEANUTILS = @COMMONS_BEANUTILS@
+COMMONS_IO = @COMMONS_IO@
+COMMONS_LOGGING = @COMMONS_LOGGING@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_CONFIG = @CURL_CONFIG@
+CURL_LIBS = @CURL_LIBS@
+CURL_VERSION = @CURL_VERSION@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+DOXYGEN_BIN = @DOXYGEN_BIN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ECJ = @ECJ@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FFTW3_LIB = @FFTW3_LIB@
+FFTW_ENABLE = @FFTW_ENABLE@
+FGREP = @FGREP@
+FLEXDOCK = @FLEXDOCK@
+FLIBS = @FLIBS@
+FOP = @FOP@
+FREEHEP_GRAPHICS2D = @FREEHEP_GRAPHICS2D@
+FREEHEP_GRAPHICSIO = @FREEHEP_GRAPHICSIO@
+FREEHEP_GRAPHICSIO_EMF = @FREEHEP_GRAPHICSIO_EMF@
+FREEHEP_IO = @FREEHEP_IO@
+FREEHEP_UTIL = @FREEHEP_UTIL@
+GENHTML = @GENHTML@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GIWS_BIN = @GIWS_BIN@
+GLUEGEN2_RT = @GLUEGEN2_RT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GRAPHICS_ENABLE = @GRAPHICS_ENABLE@
+GREP = @GREP@
+GUI_ENABLE = @GUI_ENABLE@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HELP_ENABLE = @HELP_ENABLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVAC_DEBUG = @JAVAC_DEBUG@
+JAVADOC = @JAVADOC@
+JAVAH = @JAVAH@
+JAVASCI_ENABLE = @JAVASCI_ENABLE@
+JAVA_ENABLE = @JAVA_ENABLE@
+JAVA_G = @JAVA_G@
+JAVA_HOME = @JAVA_HOME@
+JAVA_JNI_INCLUDE = @JAVA_JNI_INCLUDE@
+JAVA_JNI_LIBS = @JAVA_JNI_LIBS@
+JDB = @JDB@
+JEUCLID_CORE = @JEUCLID_CORE@
+JGRAPHX = @JGRAPHX@
+JHALL = @JHALL@
+JLATEXMATH = @JLATEXMATH@
+JLATEXMATH_FOP = @JLATEXMATH_FOP@
+JOGL2 = @JOGL2@
+JROSETTA_API = @JROSETTA_API@
+JROSETTA_ENGINE = @JROSETTA_ENGINE@
+JUNIT4 = @JUNIT4@
+LAPACK_LIBS = @LAPACK_LIBS@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOGGING_LEVEL = @LOGGING_LEVEL@
+LOOKS = @LOOKS@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATIO_CFLAGS = @MATIO_CFLAGS@
+MATIO_ENABLE = @MATIO_ENABLE@
+MATIO_LIBS = @MATIO_LIBS@
+MKDIR_P = @MKDIR_P@
+MPI_ENABLE = @MPI_ENABLE@
+MSGCAT = @MSGCAT@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OCAMLC = @OCAMLC@
+OCAMLDEP = @OCAMLDEP@
+OCAMLLEX = @OCAMLLEX@
+OCAMLOPT = @OCAMLOPT@
+OCAMLYACC = @OCAMLYACC@
+OPENMPI_CC = @OPENMPI_CC@
+OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
+OPENMPI_CXX = @OPENMPI_CXX@
+OPENMPI_CXXFLAGS = @OPENMPI_CXXFLAGS@
+OPENMPI_LIBS = @OPENMPI_LIBS@
+OPENMP_CFLAGS = @OPENMP_CFLAGS@
+OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@
+OPENMP_ENABLE = @OPENMP_ENABLE@
+OPENMP_LIBS = @OPENMP_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCRE_CFLAGS = @PCRE_CFLAGS@
+PCRE_CONFIG = @PCRE_CONFIG@
+PCRE_LIBS = @PCRE_LIBS@
+PCRE_VERSION = @PCRE_VERSION@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RELOCATABLE = @RELOCATABLE@
+RT_LIB = @RT_LIB@
+SAXON = @SAXON@
+SCILAB_BINARY_VERSION = @SCILAB_BINARY_VERSION@
+SCILAB_LIBRARY_VERSION = @SCILAB_LIBRARY_VERSION@
+SCILAB_VERSION_MAINTENANCE = @SCILAB_VERSION_MAINTENANCE@
+SCILAB_VERSION_MAJOR = @SCILAB_VERSION_MAJOR@
+SCILAB_VERSION_MINOR = @SCILAB_VERSION_MINOR@
+SCIRENDERER = @SCIRENDERER@
+SCIRENDERER_CP = @SCIRENDERER_CP@
+SCI_CFLAGS = @SCI_CFLAGS@
+SCI_CXXFLAGS = @SCI_CXXFLAGS@
+SCI_FFLAGS = @SCI_FFLAGS@
+SCI_LDFLAGS = @SCI_LDFLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SET_RELOCATABLE = @SET_RELOCATABLE@
+SHELL = @SHELL@
+SKINLF = @SKINLF@
+SPLINT = @SPLINT@
+STRIP = @STRIP@
+SWIG_BIN = @SWIG_BIN@
+SWIG_JAVA = @SWIG_JAVA@
+SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
+SWIG_SCILAB = @SWIG_SCILAB@
+TCLTK_LIBS = @TCLTK_LIBS@
+TCL_INC_PATH = @TCL_INC_PATH@
+TK_INC_PATH = @TK_INC_PATH@
+UMFPACK_CFLAGS = @UMFPACK_CFLAGS@
+UMFPACK_ENABLE = @UMFPACK_ENABLE@
+UMFPACK_LIB = @UMFPACK_LIB@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WITH_OCAML = @WITH_OCAML@
+WITH_TKSCI = @WITH_TKSCI@
+XCOS_ENABLE = @XCOS_ENABLE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+XMKMF = @XMKMF@
+XMLGRAPHICS_COMMONS = @XMLGRAPHICS_COMMONS@
+XML_APIS_EXT = @XML_APIS_EXT@
+XML_CONFIG = @XML_CONFIG@
+XML_FLAGS = @XML_FLAGS@
+XML_LIBS = @XML_LIBS@
+XML_VERSION = @XML_VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cxx_present = @cxx_present@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SPARSE_C_SOURCES = \
+src/c/spUtils.c \
+src/c/mspelm.c \
+src/c/lu.c \
+src/c/spFactor.c \
+src/c/spBuild.c \
+src/c/spOutput.c \
+src/c/spAllocate.c \
+src/c/spSolve.c
+
+# src/c/spFortran.c
+SPARSE_FORTRAN_SOURCES = src/fortran/spcompack.f \
+src/fortran/wsposp.f \
+src/fortran/findl.f \
+src/fortran/spcho1.f \
+src/fortran/dspful.f \
+src/fortran/blkslv.f \
+src/fortran/wspcle.f \
+src/fortran/wspt.f \
+src/fortran/wspssp.f \
+src/fortran/lspmat.f \
+src/fortran/lsosp.f \
+src/fortran/blkfc1.f \
+src/fortran/wspxsp.f \
+src/fortran/lspful.f \
+src/fortran/blkfct.f \
+src/fortran/symfct.f \
+src/fortran/dspt.f \
+src/fortran/wspos.f \
+src/fortran/dful2sp.f \
+src/fortran/sputil.f \
+src/fortran/lspt.f \
+src/fortran/dspxs.f \
+src/fortran/sp2col.f \
+src/fortran/dcompa.f \
+src/fortran/sz2ptr.f \
+src/fortran/spt.f \
+src/fortran/lcompa.f \
+src/fortran/wspmat.f \
+src/fortran/iperm.f \
+src/fortran/wspful.f \
+src/fortran/spif1b.f \
+src/fortran/spextr.f \
+src/fortran/lful2sp.f \
+src/fortran/dspos.f \
+src/fortran/dspasp.f \
+src/fortran/inpnv.f \
+src/fortran/spreshape.f \
+src/fortran/spsort.f \
+src/fortran/wperm.f \
+src/fortran/dij2sp.f \
+src/fortran/dspcsp.f \
+src/fortran/spcho2.f \
+src/fortran/lspos.f \
+src/fortran/wspe2.f \
+src/fortran/spif.f \
+src/fortran/lspasp.f \
+src/fortran/dspisp.f \
+src/fortran/wful2sp.f \
+src/fortran/lij2sp.f \
+src/fortran/lspcsp.f \
+src/fortran/wspis.f \
+src/fortran/dspmsp.f \
+src/fortran/dsposp.f \
+src/fortran/wsmsp.f \
+src/fortran/wspms.f \
+src/fortran/lspisp.f \
+src/fortran/dspcle.f \
+src/fortran/wsosp.f \
+src/fortran/dspssp.f \
+src/fortran/lsposp.f \
+src/fortran/dspxsp.f \
+src/fortran/ordmmd.f \
+src/fortran/spextr1.f \
+src/fortran/wcompa.f \
+src/fortran/lspxsp.f \
+src/fortran/spisp.f \
+src/fortran/dperm.f \
+src/fortran/spind.f \
+src/fortran/dspe2.f \
+src/fortran/wspasp.f \
+src/fortran/wij2sp.f \
+src/fortran/wspcsp.f \
+src/fortran/lspops.f \
+src/fortran/spifp.f \
+src/fortran/isort1.f \
+src/fortran/dspis.f \
+src/fortran/wspxs.f \
+src/fortran/lspe2.f \
+src/fortran/wspisp.f \
+src/fortran/dsmsp.f \
+src/fortran/dspms.f \
+src/fortran/spord.f \
+src/fortran/dsosp.f \
+src/fortran/dspmat.f \
+src/fortran/wspmsp.f \
+src/fortran/lspis.f \
+src/fortran/writebuf.f \
+src/fortran/ta2lpd.f
+
+GATEWAY_C_SOURCES = sci_gateway/c/sci_spcompa.c \
+sci_gateway/c/sci_full.c \
+sci_gateway/c/sci_blkslvi.c \
+sci_gateway/c/sci_inpnvi.c \
+sci_gateway/c/sci_nnz.c \
+sci_gateway/c/sci_ludel.c \
+sci_gateway/c/sci_spmatrix.c \
+sci_gateway/c/sci_msparse.c \
+sci_gateway/c/sci_blkfc1i.c \
+sci_gateway/c/sci_bfinit.c \
+sci_gateway/c/sci_lufact.c \
+sci_gateway/c/sci_symfcti.c \
+sci_gateway/c/sci_mfull.c \
+sci_gateway/c/sci_luget.c \
+sci_gateway/c/sci_ordmmd.c \
+sci_gateway/c/sci_spget.c \
+sci_gateway/c/sci_spclean.c \
+sci_gateway/c/sci_spchol.c \
+sci_gateway/c/sci_lusolve.c \
+sci_gateway/c/sci_fadj2sp.c \
+sci_gateway/c/gw_sparse.c \
+sci_gateway/c/sci_sfinit.c \
+sci_gateway/c/sci_sparse.c \
+sci_gateway/c/sci_mspget.c
+
+GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_spcompa.f \
+sci_gateway/fortran/sci_f_sparse.f \
+sci_gateway/fortran/sci_f_full.f \
+sci_gateway/fortran/sci_f_blkslvi.f \
+sci_gateway/fortran/sci_f_inpnvi.f \
+sci_gateway/fortran/sci_f_nnz.f \
+sci_gateway/fortran/sci_f_ludel.f \
+sci_gateway/fortran/sci_f_bfinit.f \
+sci_gateway/fortran/spops.f \
+sci_gateway/fortran/sci_f_spmatrix.f \
+sci_gateway/fortran/sci_f_blkfc1i.f \
+sci_gateway/fortran/sci_f_lufact.f \
+sci_gateway/fortran/sci_f_symfcti.f \
+sci_gateway/fortran/sci_f_luget.f \
+sci_gateway/fortran/sci_f_ordmmd.f \
+sci_gateway/fortran/sci_f_spget.f \
+sci_gateway/fortran/sci_f_spclean.f \
+sci_gateway/fortran/sci_f_spchol.f \
+sci_gateway/fortran/sci_f_lusolve.f \
+sci_gateway/fortran/sci_f_fadj2sp.f \
+sci_gateway/fortran/sci_f_sfinit.f \
+sci_gateway/fortran/sci_f_ta2lpd.f
+
+libscisparse_la_CPPFLAGS = -I$(srcdir)/includes/ \
+ -I$(top_srcdir)/modules/api_scilab/includes/ \
+ -I$(top_srcdir)/modules/elementary_functions/includes/ \
+ -I$(top_srcdir)/modules/localization/includes/ \
+ -I$(top_srcdir)/modules/output_stream/includes/ \
+ $(AM_CPPFLAGS)
+
+
+#-Isrc/c/
+@MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libscisparse.la
+@MAINTAINER_MODE_FALSE@noinst_LTLIBRARIES = libscisparse-algo.la libscisparse.la
+@MAINTAINER_MODE_TRUE@noinst_LTLIBRARIES = libscisparse-algo.la
+libscisparse_algo_la_SOURCES = $(SPARSE_C_SOURCES) $(SPARSE_FORTRAN_SOURCES)
+libscisparse_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscisparse_algo_la_CPPFLAGS = $(libscisparse_la_CPPFLAGS)
+
+# For the code check (splint)
+CHECK_SRC = $(SPARSE_C_SOURCES) $(GATEWAY_C_SOURCES)
+INCLUDE_FLAGS = $(libscisparse_la_CPPFLAGS)
+libscisparse_la_LIBADD = libscisparse-algo.la
+
+#### Target ######
+modulename = sparse
+
+#### sparse : Conf files ####
+libscisparse_la_rootdir = $(mydatadir)
+libscisparse_la_root_DATA = license.txt
+
+#### sparse : init scripts ####
+libscisparse_la_etcdir = $(mydatadir)/etc
+libscisparse_la_etc_DATA = etc/sparse.quit etc/sparse.start
+
+#### sparse : gateway declaration ####
+libscisparse_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libscisparse_la_sci_gateway_DATA = sci_gateway/sparse_gateway.xml
+
+# Where all the Scilab stuff is installed (macros, help, ...)
+mydatadir = $(pkgdatadir)/modules/$(modulename)
+
+# Set AM_* SCI detected settings
+AM_CPPFLAGS = $(SCI_CPPFLAGS)
+AM_CFLAGS = $(SCI_CFLAGS)
+AM_CXXFLAGS = $(SCI_CXXFLAGS)
+# append includes to AM_FFLAGS to manage fortran includes
+AM_FFLAGS = $(SCI_FFLAGS) -I$(top_srcdir)/modules/core/includes/
+
+# Tag shared libraries with the Scilab version
+AM_LDFLAGS = $(SCI_LDFLAGS) -version-number $(SCILAB_LIBRARY_VERSION)
+
+# splint options
+SPLINT_OPTIONS = -weak -booltype BOOL
+
+########################### JAVA ######################################
+#### We are delegating java compilation to ant... Thanks to that
+#### the procedure will be the same with Microsoft Windows (C)
+#### and Linux/Unix
+#######################################################################
+TARGETS_ALL = $(am__append_1)
+
+################ MACROS ######################
+# Rule to build a macro
+# NOT USED AT THE MOMENT
+SUFFIXES = .sci
+
+########### INSTALL DOCUMENTATION ###################
+
+# Install documentation files into the right target
+# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because
+# automake needs the html files to be present which is not the case when
+# we are building Scilab
+
+# Where it should be installed
+pkgdocdir = $(mydatadir)
+
+# What is the mask of the help source
+DOCMASKXML = *.xml
+
+# What is the mask of the MathML sources
+DOCMASKMML = *.mml
+
+########### INSTALL DATA ###################
+# Install macros, help & demos
+# Where it should be installed
+pkgmacrosdir = $(mydatadir)
+# Which directory we process
+MACRODIRS = macros/
+# Mask of the Scilab sources macros
+MACROMASK = *.sci
+# Mask of the Scilab executable sources macros
+MACROBUILDMASK = *.sce
+# Mask of the Scilab compiled macros
+MACROBINMASK = *.bin
+# List of the standard directory for tests
+TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java
+# Where the demos should be installed
+pkgdemosdir = $(mydatadir)
+# List of the standard directory for demos
+DEMOS_DIR = demos
+# List of the standard directory for examples
+EXAMPLES_DIR = examples
+# Where to export JAVA archives (.jar)
+JARDIR = jar/
+# JAR files mask
+JARMASK = *.jar
+# Chapter file
+HELP_CHAPTERDIR = help/
+HELP_CHAPTERFILE = addchapter.sce
+HELP_CHAPTERLANG = en_US fr_FR pt_BR
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .sci .bin .c .f .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/sparse/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign modules/sparse/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+$(top_srcdir)/Makefile.incl.am:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+ }
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+src/c/$(am__dirstamp):
+ @$(MKDIR_P) src/c
+ @: > src/c/$(am__dirstamp)
+src/c/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/c/$(DEPDIR)
+ @: > src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spUtils.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-mspelm.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-lu.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spFactor.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spBuild.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spOutput.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spAllocate.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/c/libscisparse_algo_la-spSolve.lo: src/c/$(am__dirstamp) \
+ src/c/$(DEPDIR)/$(am__dirstamp)
+src/fortran/$(am__dirstamp):
+ @$(MKDIR_P) src/fortran
+ @: > src/fortran/$(am__dirstamp)
+src/fortran/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/fortran/$(DEPDIR)
+ @: > src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcompack.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/findl.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcho1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkslv.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspcle.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspssp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkfc1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/blkfct.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/symfct.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sputil.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspxs.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sp2col.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/sz2ptr.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spt.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/iperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspful.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spif1b.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spextr.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/inpnv.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spreshape.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spsort.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spcho2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspos.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spif.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wful2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspms.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspcle.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspssp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lsposp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/ordmmd.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spextr1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wcompa.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspxsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dperm.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spind.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspasp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wij2sp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspcsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspops.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spifp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/isort1.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspxs.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspe2.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspisp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspms.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/spord.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dsosp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/dspmat.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/wspmsp.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/lspis.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/writebuf.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+src/fortran/ta2lpd.lo: src/fortran/$(am__dirstamp) \
+ src/fortran/$(DEPDIR)/$(am__dirstamp)
+
+libscisparse-algo.la: $(libscisparse_algo_la_OBJECTS) $(libscisparse_algo_la_DEPENDENCIES) $(EXTRA_libscisparse_algo_la_DEPENDENCIES)
+ $(AM_V_F77LD)$(F77LINK) $(am_libscisparse_algo_la_rpath) $(libscisparse_algo_la_OBJECTS) $(libscisparse_algo_la_LIBADD) $(LIBS)
+sci_gateway/c/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/c
+ @: > sci_gateway/c/$(am__dirstamp)
+sci_gateway/c/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/c/$(DEPDIR)
+ @: > sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spcompa.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_full.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_blkslvi.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_inpnvi.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_nnz.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_ludel.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spmatrix.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_msparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_blkfc1i.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_bfinit.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_lufact.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_symfcti.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_mfull.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_luget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_ordmmd.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spclean.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_spchol.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_lusolve.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_fadj2sp.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-gw_sparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_sfinit.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_sparse.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/c/libscisparse_la-sci_mspget.lo: \
+ sci_gateway/c/$(am__dirstamp) \
+ sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/fortran
+ @: > sci_gateway/fortran/$(am__dirstamp)
+sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) sci_gateway/fortran/$(DEPDIR)
+ @: > sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spcompa.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_sparse.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_full.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_blkslvi.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_inpnvi.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_nnz.lo: sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ludel.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_bfinit.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/spops.lo: sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spmatrix.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_blkfc1i.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_lufact.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_symfcti.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_luget.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ordmmd.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spget.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spclean.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_spchol.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_lusolve.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_fadj2sp.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_sfinit.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/fortran/sci_f_ta2lpd.lo: \
+ sci_gateway/fortran/$(am__dirstamp) \
+ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+
+libscisparse.la: $(libscisparse_la_OBJECTS) $(libscisparse_la_DEPENDENCIES) $(EXTRA_libscisparse_la_DEPENDENCIES)
+ $(AM_V_F77LD)$(F77LINK) $(am_libscisparse_la_rpath) $(libscisparse_la_OBJECTS) $(libscisparse_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f sci_gateway/c/*.$(OBJEXT)
+ -rm -f sci_gateway/c/*.lo
+ -rm -f sci_gateway/fortran/*.$(OBJEXT)
+ -rm -f sci_gateway/fortran/*.lo
+ -rm -f src/c/*.$(OBJEXT)
+ -rm -f src/c/*.lo
+ -rm -f src/fortran/*.$(OBJEXT)
+ -rm -f src/fortran/*.lo
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-lu.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+src/c/libscisparse_algo_la-spUtils.lo: src/c/spUtils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spUtils.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Tpo -c -o src/c/libscisparse_algo_la-spUtils.lo `test -f 'src/c/spUtils.c' || echo '$(srcdir)/'`src/c/spUtils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spUtils.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spUtils.c' object='src/c/libscisparse_algo_la-spUtils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spUtils.lo `test -f 'src/c/spUtils.c' || echo '$(srcdir)/'`src/c/spUtils.c
+
+src/c/libscisparse_algo_la-mspelm.lo: src/c/mspelm.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-mspelm.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Tpo -c -o src/c/libscisparse_algo_la-mspelm.lo `test -f 'src/c/mspelm.c' || echo '$(srcdir)/'`src/c/mspelm.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-mspelm.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/mspelm.c' object='src/c/libscisparse_algo_la-mspelm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-mspelm.lo `test -f 'src/c/mspelm.c' || echo '$(srcdir)/'`src/c/mspelm.c
+
+src/c/libscisparse_algo_la-lu.lo: src/c/lu.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-lu.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-lu.Tpo -c -o src/c/libscisparse_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-lu.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-lu.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/lu.c' object='src/c/libscisparse_algo_la-lu.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-lu.lo `test -f 'src/c/lu.c' || echo '$(srcdir)/'`src/c/lu.c
+
+src/c/libscisparse_algo_la-spFactor.lo: src/c/spFactor.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spFactor.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Tpo -c -o src/c/libscisparse_algo_la-spFactor.lo `test -f 'src/c/spFactor.c' || echo '$(srcdir)/'`src/c/spFactor.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spFactor.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spFactor.c' object='src/c/libscisparse_algo_la-spFactor.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spFactor.lo `test -f 'src/c/spFactor.c' || echo '$(srcdir)/'`src/c/spFactor.c
+
+src/c/libscisparse_algo_la-spBuild.lo: src/c/spBuild.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spBuild.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Tpo -c -o src/c/libscisparse_algo_la-spBuild.lo `test -f 'src/c/spBuild.c' || echo '$(srcdir)/'`src/c/spBuild.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spBuild.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spBuild.c' object='src/c/libscisparse_algo_la-spBuild.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spBuild.lo `test -f 'src/c/spBuild.c' || echo '$(srcdir)/'`src/c/spBuild.c
+
+src/c/libscisparse_algo_la-spOutput.lo: src/c/spOutput.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spOutput.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Tpo -c -o src/c/libscisparse_algo_la-spOutput.lo `test -f 'src/c/spOutput.c' || echo '$(srcdir)/'`src/c/spOutput.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spOutput.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spOutput.c' object='src/c/libscisparse_algo_la-spOutput.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spOutput.lo `test -f 'src/c/spOutput.c' || echo '$(srcdir)/'`src/c/spOutput.c
+
+src/c/libscisparse_algo_la-spAllocate.lo: src/c/spAllocate.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spAllocate.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Tpo -c -o src/c/libscisparse_algo_la-spAllocate.lo `test -f 'src/c/spAllocate.c' || echo '$(srcdir)/'`src/c/spAllocate.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spAllocate.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spAllocate.c' object='src/c/libscisparse_algo_la-spAllocate.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spAllocate.lo `test -f 'src/c/spAllocate.c' || echo '$(srcdir)/'`src/c/spAllocate.c
+
+src/c/libscisparse_algo_la-spSolve.lo: src/c/spSolve.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscisparse_algo_la-spSolve.lo -MD -MP -MF src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Tpo -c -o src/c/libscisparse_algo_la-spSolve.lo `test -f 'src/c/spSolve.c' || echo '$(srcdir)/'`src/c/spSolve.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Tpo src/c/$(DEPDIR)/libscisparse_algo_la-spSolve.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/spSolve.c' object='src/c/libscisparse_algo_la-spSolve.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscisparse_algo_la-spSolve.lo `test -f 'src/c/spSolve.c' || echo '$(srcdir)/'`src/c/spSolve.c
+
+sci_gateway/c/libscisparse_la-sci_spcompa.lo: sci_gateway/c/sci_spcompa.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spcompa.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spcompa.lo `test -f 'sci_gateway/c/sci_spcompa.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spcompa.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spcompa.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_spcompa.c' object='sci_gateway/c/libscisparse_la-sci_spcompa.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spcompa.lo `test -f 'sci_gateway/c/sci_spcompa.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spcompa.c
+
+sci_gateway/c/libscisparse_la-sci_full.lo: sci_gateway/c/sci_full.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_full.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Tpo -c -o sci_gateway/c/libscisparse_la-sci_full.lo `test -f 'sci_gateway/c/sci_full.c' || echo '$(srcdir)/'`sci_gateway/c/sci_full.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_full.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_full.c' object='sci_gateway/c/libscisparse_la-sci_full.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_full.lo `test -f 'sci_gateway/c/sci_full.c' || echo '$(srcdir)/'`sci_gateway/c/sci_full.c
+
+sci_gateway/c/libscisparse_la-sci_blkslvi.lo: sci_gateway/c/sci_blkslvi.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_blkslvi.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Tpo -c -o sci_gateway/c/libscisparse_la-sci_blkslvi.lo `test -f 'sci_gateway/c/sci_blkslvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkslvi.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkslvi.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_blkslvi.c' object='sci_gateway/c/libscisparse_la-sci_blkslvi.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_blkslvi.lo `test -f 'sci_gateway/c/sci_blkslvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkslvi.c
+
+sci_gateway/c/libscisparse_la-sci_inpnvi.lo: sci_gateway/c/sci_inpnvi.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_inpnvi.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Tpo -c -o sci_gateway/c/libscisparse_la-sci_inpnvi.lo `test -f 'sci_gateway/c/sci_inpnvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inpnvi.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_inpnvi.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_inpnvi.c' object='sci_gateway/c/libscisparse_la-sci_inpnvi.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_inpnvi.lo `test -f 'sci_gateway/c/sci_inpnvi.c' || echo '$(srcdir)/'`sci_gateway/c/sci_inpnvi.c
+
+sci_gateway/c/libscisparse_la-sci_nnz.lo: sci_gateway/c/sci_nnz.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_nnz.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Tpo -c -o sci_gateway/c/libscisparse_la-sci_nnz.lo `test -f 'sci_gateway/c/sci_nnz.c' || echo '$(srcdir)/'`sci_gateway/c/sci_nnz.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_nnz.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_nnz.c' object='sci_gateway/c/libscisparse_la-sci_nnz.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_nnz.lo `test -f 'sci_gateway/c/sci_nnz.c' || echo '$(srcdir)/'`sci_gateway/c/sci_nnz.c
+
+sci_gateway/c/libscisparse_la-sci_ludel.lo: sci_gateway/c/sci_ludel.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_ludel.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Tpo -c -o sci_gateway/c/libscisparse_la-sci_ludel.lo `test -f 'sci_gateway/c/sci_ludel.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ludel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ludel.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_ludel.c' object='sci_gateway/c/libscisparse_la-sci_ludel.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_ludel.lo `test -f 'sci_gateway/c/sci_ludel.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ludel.c
+
+sci_gateway/c/libscisparse_la-sci_spmatrix.lo: sci_gateway/c/sci_spmatrix.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spmatrix.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spmatrix.lo `test -f 'sci_gateway/c/sci_spmatrix.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spmatrix.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spmatrix.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_spmatrix.c' object='sci_gateway/c/libscisparse_la-sci_spmatrix.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spmatrix.lo `test -f 'sci_gateway/c/sci_spmatrix.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spmatrix.c
+
+sci_gateway/c/libscisparse_la-sci_msparse.lo: sci_gateway/c/sci_msparse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_msparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Tpo -c -o sci_gateway/c/libscisparse_la-sci_msparse.lo `test -f 'sci_gateway/c/sci_msparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_msparse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_msparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_msparse.c' object='sci_gateway/c/libscisparse_la-sci_msparse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_msparse.lo `test -f 'sci_gateway/c/sci_msparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_msparse.c
+
+sci_gateway/c/libscisparse_la-sci_blkfc1i.lo: sci_gateway/c/sci_blkfc1i.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_blkfc1i.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Tpo -c -o sci_gateway/c/libscisparse_la-sci_blkfc1i.lo `test -f 'sci_gateway/c/sci_blkfc1i.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkfc1i.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_blkfc1i.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_blkfc1i.c' object='sci_gateway/c/libscisparse_la-sci_blkfc1i.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_blkfc1i.lo `test -f 'sci_gateway/c/sci_blkfc1i.c' || echo '$(srcdir)/'`sci_gateway/c/sci_blkfc1i.c
+
+sci_gateway/c/libscisparse_la-sci_bfinit.lo: sci_gateway/c/sci_bfinit.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_bfinit.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Tpo -c -o sci_gateway/c/libscisparse_la-sci_bfinit.lo `test -f 'sci_gateway/c/sci_bfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bfinit.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_bfinit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_bfinit.c' object='sci_gateway/c/libscisparse_la-sci_bfinit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_bfinit.lo `test -f 'sci_gateway/c/sci_bfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_bfinit.c
+
+sci_gateway/c/libscisparse_la-sci_lufact.lo: sci_gateway/c/sci_lufact.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_lufact.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Tpo -c -o sci_gateway/c/libscisparse_la-sci_lufact.lo `test -f 'sci_gateway/c/sci_lufact.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lufact.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lufact.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_lufact.c' object='sci_gateway/c/libscisparse_la-sci_lufact.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_lufact.lo `test -f 'sci_gateway/c/sci_lufact.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lufact.c
+
+sci_gateway/c/libscisparse_la-sci_symfcti.lo: sci_gateway/c/sci_symfcti.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_symfcti.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Tpo -c -o sci_gateway/c/libscisparse_la-sci_symfcti.lo `test -f 'sci_gateway/c/sci_symfcti.c' || echo '$(srcdir)/'`sci_gateway/c/sci_symfcti.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_symfcti.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_symfcti.c' object='sci_gateway/c/libscisparse_la-sci_symfcti.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_symfcti.lo `test -f 'sci_gateway/c/sci_symfcti.c' || echo '$(srcdir)/'`sci_gateway/c/sci_symfcti.c
+
+sci_gateway/c/libscisparse_la-sci_mfull.lo: sci_gateway/c/sci_mfull.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_mfull.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Tpo -c -o sci_gateway/c/libscisparse_la-sci_mfull.lo `test -f 'sci_gateway/c/sci_mfull.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mfull.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mfull.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_mfull.c' object='sci_gateway/c/libscisparse_la-sci_mfull.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_mfull.lo `test -f 'sci_gateway/c/sci_mfull.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mfull.c
+
+sci_gateway/c/libscisparse_la-sci_luget.lo: sci_gateway/c/sci_luget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_luget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_luget.lo `test -f 'sci_gateway/c/sci_luget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_luget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_luget.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_luget.c' object='sci_gateway/c/libscisparse_la-sci_luget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_luget.lo `test -f 'sci_gateway/c/sci_luget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_luget.c
+
+sci_gateway/c/libscisparse_la-sci_ordmmd.lo: sci_gateway/c/sci_ordmmd.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_ordmmd.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo -c -o sci_gateway/c/libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/c/sci_ordmmd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ordmmd.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_ordmmd.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_ordmmd.c' object='sci_gateway/c/libscisparse_la-sci_ordmmd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/c/sci_ordmmd.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ordmmd.c
+
+sci_gateway/c/libscisparse_la-sci_spget.lo: sci_gateway/c/sci_spget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spget.lo `test -f 'sci_gateway/c/sci_spget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spget.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_spget.c' object='sci_gateway/c/libscisparse_la-sci_spget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spget.lo `test -f 'sci_gateway/c/sci_spget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spget.c
+
+sci_gateway/c/libscisparse_la-sci_spclean.lo: sci_gateway/c/sci_spclean.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spclean.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spclean.lo `test -f 'sci_gateway/c/sci_spclean.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spclean.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spclean.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_spclean.c' object='sci_gateway/c/libscisparse_la-sci_spclean.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spclean.lo `test -f 'sci_gateway/c/sci_spclean.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spclean.c
+
+sci_gateway/c/libscisparse_la-sci_spchol.lo: sci_gateway/c/sci_spchol.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_spchol.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Tpo -c -o sci_gateway/c/libscisparse_la-sci_spchol.lo `test -f 'sci_gateway/c/sci_spchol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spchol.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_spchol.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_spchol.c' object='sci_gateway/c/libscisparse_la-sci_spchol.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_spchol.lo `test -f 'sci_gateway/c/sci_spchol.c' || echo '$(srcdir)/'`sci_gateway/c/sci_spchol.c
+
+sci_gateway/c/libscisparse_la-sci_lusolve.lo: sci_gateway/c/sci_lusolve.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_lusolve.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Tpo -c -o sci_gateway/c/libscisparse_la-sci_lusolve.lo `test -f 'sci_gateway/c/sci_lusolve.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lusolve.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_lusolve.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_lusolve.c' object='sci_gateway/c/libscisparse_la-sci_lusolve.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_lusolve.lo `test -f 'sci_gateway/c/sci_lusolve.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lusolve.c
+
+sci_gateway/c/libscisparse_la-sci_fadj2sp.lo: sci_gateway/c/sci_fadj2sp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_fadj2sp.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Tpo -c -o sci_gateway/c/libscisparse_la-sci_fadj2sp.lo `test -f 'sci_gateway/c/sci_fadj2sp.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fadj2sp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_fadj2sp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_fadj2sp.c' object='sci_gateway/c/libscisparse_la-sci_fadj2sp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_fadj2sp.lo `test -f 'sci_gateway/c/sci_fadj2sp.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fadj2sp.c
+
+sci_gateway/c/libscisparse_la-gw_sparse.lo: sci_gateway/c/gw_sparse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-gw_sparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Tpo -c -o sci_gateway/c/libscisparse_la-gw_sparse.lo `test -f 'sci_gateway/c/gw_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/gw_sparse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-gw_sparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/gw_sparse.c' object='sci_gateway/c/libscisparse_la-gw_sparse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-gw_sparse.lo `test -f 'sci_gateway/c/gw_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/gw_sparse.c
+
+sci_gateway/c/libscisparse_la-sci_sfinit.lo: sci_gateway/c/sci_sfinit.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_sfinit.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Tpo -c -o sci_gateway/c/libscisparse_la-sci_sfinit.lo `test -f 'sci_gateway/c/sci_sfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sfinit.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sfinit.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_sfinit.c' object='sci_gateway/c/libscisparse_la-sci_sfinit.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_sfinit.lo `test -f 'sci_gateway/c/sci_sfinit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sfinit.c
+
+sci_gateway/c/libscisparse_la-sci_sparse.lo: sci_gateway/c/sci_sparse.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_sparse.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Tpo -c -o sci_gateway/c/libscisparse_la-sci_sparse.lo `test -f 'sci_gateway/c/sci_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sparse.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_sparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_sparse.c' object='sci_gateway/c/libscisparse_la-sci_sparse.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_sparse.lo `test -f 'sci_gateway/c/sci_sparse.c' || echo '$(srcdir)/'`sci_gateway/c/sci_sparse.c
+
+sci_gateway/c/libscisparse_la-sci_mspget.lo: sci_gateway/c/sci_mspget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscisparse_la-sci_mspget.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Tpo -c -o sci_gateway/c/libscisparse_la-sci_mspget.lo `test -f 'sci_gateway/c/sci_mspget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mspget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Tpo sci_gateway/c/$(DEPDIR)/libscisparse_la-sci_mspget.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sci_gateway/c/sci_mspget.c' object='sci_gateway/c/libscisparse_la-sci_mspget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libscisparse_la-sci_mspget.lo `test -f 'sci_gateway/c/sci_mspget.c' || echo '$(srcdir)/'`sci_gateway/c/sci_mspget.c
+
+.f.o:
+ $(AM_V_F77)$(F77COMPILE) -c -o $@ $<
+
+.f.obj:
+ $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.f.lo:
+ $(AM_V_F77)$(LTF77COMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+ -rm -rf sci_gateway/c/.libs sci_gateway/c/_libs
+ -rm -rf sci_gateway/fortran/.libs sci_gateway/fortran/_libs
+ -rm -rf src/c/.libs src/c/_libs
+ -rm -rf src/fortran/.libs src/fortran/_libs
+install-libscisparse_la_etcDATA: $(libscisparse_la_etc_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_etc_DATA)'; test -n "$(libscisparse_la_etcdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_etcdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_etcdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_etcdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_etcdir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_etcDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_etc_DATA)'; test -n "$(libscisparse_la_etcdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_etcdir)'; $(am__uninstall_files_from_dir)
+install-libscisparse_la_rootDATA: $(libscisparse_la_root_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_root_DATA)'; test -n "$(libscisparse_la_rootdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_rootdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_rootdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_rootdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_rootdir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_rootDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_root_DATA)'; test -n "$(libscisparse_la_rootdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_rootdir)'; $(am__uninstall_files_from_dir)
+install-libscisparse_la_sci_gatewayDATA: $(libscisparse_la_sci_gateway_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(libscisparse_la_sci_gateway_DATA)'; test -n "$(libscisparse_la_sci_gatewaydir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)" || exit $$?; \
+ done
+
+uninstall-libscisparse_la_sci_gatewayDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libscisparse_la_sci_gateway_DATA)'; test -n "$(libscisparse_la_sci_gatewaydir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(libscisparse_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libscisparse_la_etcdir)" "$(DESTDIR)$(libscisparse_la_rootdir)" "$(DESTDIR)$(libscisparse_la_sci_gatewaydir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+ -rm -f sci_gateway/c/$(am__dirstamp)
+ -rm -f sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
+ -rm -f sci_gateway/fortran/$(am__dirstamp)
+ -rm -f src/c/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/c/$(am__dirstamp)
+ -rm -f src/fortran/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/fortran/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local \
+ clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-libscisparse_la_etcDATA \
+ install-libscisparse_la_rootDATA \
+ install-libscisparse_la_sci_gatewayDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am: install-html-local
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf sci_gateway/c/$(DEPDIR) src/c/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libscisparse_la_etcDATA \
+ uninstall-libscisparse_la_rootDATA \
+ uninstall-libscisparse_la_sci_gatewayDATA \
+ uninstall-pkglibLTLIBRARIES
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \
+ check-local clean clean-generic clean-libtool clean-local \
+ clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-local distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-data-local install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-html-local install-info \
+ install-info-am install-libscisparse_la_etcDATA \
+ install-libscisparse_la_rootDATA \
+ install-libscisparse_la_sci_gatewayDATA install-man \
+ install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am \
+ uninstall-libscisparse_la_etcDATA \
+ uninstall-libscisparse_la_rootDATA \
+ uninstall-libscisparse_la_sci_gatewayDATA \
+ uninstall-pkglibLTLIBRARIES
+
+
+# This target enables tests for Scilab
+check-local: $(top_builddir)/scilab-bin test
+ if test -d $(mydatadir)/tests; then \
+ @COMMAND="try test_run('$(modulename)');catch exit(-1);end;exit(0)"; export LANG=C; $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"; \
+ fi
+check-code:
+ if test -f build.xml; then \
+ $(ANT) checkstyle; \
+ fi
+ if test -x "$(SPLINT)"; then \
+ $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \
+ fi
+@NEED_JAVA_TRUE@java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@ if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@ $(ANT); \
+@NEED_JAVA_TRUE@ fi
+
+@NEED_JAVA_TRUE@clean-java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@ if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@ $(ANT) clean; \
+@NEED_JAVA_TRUE@ fi;
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@SWIG_TRUE@swig: $(SWIG_WRAPPERS)
+@SWIG_TRUE@ @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \
+@SWIG_TRUE@ SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \
+@SWIG_TRUE@ if test -n "$(SWIG_WRAPPERS)"; then \
+@SWIG_TRUE@ for file in $(SWIG_WRAPPERS) ; do \
+@SWIG_TRUE@ echo "Swig process of $$file (Java) ..."; \
+@SWIG_TRUE@ $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@ done; \
+@SWIG_TRUE@ fi
+
+@SWIG_TRUE@swig-scilab: $(SWIG_SCILAB_WRAPPERS)
+@SWIG_TRUE@ @SWIG_OUTDIR=src/swig/; \
+@SWIG_TRUE@ if test -n "$(SWIG_SCILAB_WRAPPERS)"; then \
+@SWIG_TRUE@ for file in $(SWIG_SCILAB_WRAPPERS) ; do \
+@SWIG_TRUE@ echo "Swig process of $$file (Scilab) ..."; \
+@SWIG_TRUE@ $(SWIG_BIN) $(SWIG_SCILAB) -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@ done; \
+@SWIG_TRUE@ fi
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@GIWS_TRUE@giws: $(GIWS_WRAPPERS)
+@GIWS_TRUE@ @GIWS_OUTPUTDIR=src/jni/; \
+@GIWS_TRUE@ MANDATORY_OPTIONS="--throws-exception-on-error --description-file"; \
+@GIWS_TRUE@ if test -n "$(GIWS_WRAPPERS)"; then \
+@GIWS_TRUE@ for file in $(GIWS_WRAPPERS) ; do \
+@GIWS_TRUE@ echo "GIWS process of $$file ..."; \
+@GIWS_TRUE@ if test -z "$(GIWS_OPTIONS)"; then \
+@GIWS_TRUE@ $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+@GIWS_TRUE@ else \
+@GIWS_TRUE@ echo "Custom GIWS call with '$$GIWS_OPTIONS'"; \
+@GIWS_TRUE@ $(GIWS_BIN) $$GIWS_OPTIONS --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \
+@GIWS_TRUE@ fi \
+@GIWS_TRUE@ done; \
+@GIWS_TRUE@ fi
+
+@GIWS_TRUE@giws-exception:
+@GIWS_TRUE@ @GIWS_OUTPUTDIR=src/jni/;\
+@GIWS_TRUE@ echo "GIWS: Generation of exception class ..."; \
+@GIWS_TRUE@ $(GIWS_BIN) --generate-exception-class --output-dir $$GIWS_OUTPUTDIR
+
+macros:
+ -@( if test ! -x $(top_builddir)/scilab-bin; then \
+ echo "Error : Cannot build $< : Scilab has not been built"; \
+ else \
+ $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\
+ fi)
+
+# Removes the macros
+clean-macros:
+# Removes macros (*.bin generated from .sci)
+ @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+ echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \
+ rm -f $(builddir)/$$dir/$(MACROBINMASK); \
+ done
+
+test:
+# More tests could be added here
+ @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+ if test -f build.xml -a $$USEANT -eq 1; then \
+ $(ANT) test; \
+ fi
+
+all-local: $(TARGETS_ALL)
+
+.sci.bin:
+ -@( if test ! -x $(top_builddir)/scilab-bin; then \
+ echo "Error : Cannot build $< : Scilab has not been build"; \
+ else \
+ echo "Creating $@"; \
+ $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \
+ fi )
+
+install-html-local:
+
+install-data-local-local:
+# Mainly for javasci
+ @if test -d $(srcdir)/javadoc; then \
+ cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \
+ fi
+# If the user wants the help sources to be installed
+@INSTALL_HELP_XML_TRUE@ @echo "-------- Install of XML sources of help files --------"; \
+@INSTALL_HELP_XML_TRUE@ for lang in $(ALL_LINGUAS); do \
+@INSTALL_HELP_XML_TRUE@ if test -d $(srcdir)/help/$$lang; then \
+@INSTALL_HELP_XML_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \
+@INSTALL_HELP_XML_TRUE@ if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@ for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \
+@INSTALL_HELP_XML_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \
+@INSTALL_HELP_XML_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \
+@INSTALL_HELP_XML_TRUE@ done ; \
+@INSTALL_HELP_XML_TRUE@ fi; \
+@INSTALL_HELP_XML_TRUE@ fi; \
+@INSTALL_HELP_XML_TRUE@ done; \
+@INSTALL_HELP_XML_TRUE@ @echo "-------- Install of MathML sources --------"; \
+@INSTALL_HELP_XML_TRUE@ if test -d $(srcdir)/help/mml/; then \
+@INSTALL_HELP_XML_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \
+@INSTALL_HELP_XML_TRUE@ if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@ for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \
+@INSTALL_HELP_XML_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \
+@INSTALL_HELP_XML_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \
+@INSTALL_HELP_XML_TRUE@ done ; \
+@INSTALL_HELP_XML_TRUE@ fi; \
+@INSTALL_HELP_XML_TRUE@ fi
+install-data-local:
+# Install the tests
+ @echo "-------- Install tests (if any) --------"; \
+ for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \
+ if test -d $(srcdir)/$$dir/; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+ if test -d "$(srcdir)/$$dir/$$file"; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \
+ $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \
+ else \
+ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+ fi \
+ done; \
+ fi; \
+ done
+# Install the help chapter
+ @echo "-------- Install the help chapter (if any) --------"; \
+ for lang in $(HELP_CHAPTERLANG); do \
+ HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \
+ if test -f $$HELPFILE; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+ echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+ $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+ fi; \
+ done
+# Install the demos & examples
+ @echo "-------- Install demos & examples (if any) --------"; \
+ for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \
+ if test -d $(srcdir)/$$dir/; then \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
+ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+ if test -d "$(srcdir)/$$dir/$$file"; then \
+ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \
+ $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \
+ else \
+ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+ fi \
+ done; \
+ fi; \
+ done
+# Install the macros
+ @echo "-------- Install macros (if any) --------"; \
+ for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+ if test -d $(srcdir)/$$dir/; then \
+ FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\
+ if test -n "$(MACROSSPECIALEXT)"; then \
+ specialExtDir=""; \
+ for specialExt in $(MACROSSPECIALEXT); do \
+ specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \
+ done; \
+ FILELIST="$$FILELIST $$specialExtDir"; \
+ fi; \
+ for file in `ls -1 $$FILELIST 2>/dev/null`; do \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \
+ done; \
+ fi; \
+ done
+# Install java files (.jar)
+ @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \
+ echo "-------- Install jar files --------"; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \
+ for file in $(srcdir)/$(JARDIR)$(JARMASK); do\
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \
+ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \
+ done ; \
+ fi
+
+########### CLEAN ###################
+# Clean help (generated automatically by Scilab)
+# It used to clean the macro (clean-macros) but this was causing
+# make clean && make to fail Scilab startup
+@NEED_JAVA_TRUE@clean-local: clean-java
+@NEED_JAVA_FALSE@clean-local:
+
+distclean-local:
+ rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_*
+
+.PHONY: macros java swig giws
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/modules/sparse/etc/sparse.quit b/modules/sparse/etc/sparse.quit
new file mode 100755
index 000000000..b44d8b367
--- /dev/null
+++ b/modules/sparse/etc/sparse.quit
@@ -0,0 +1,12 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+// =============================================================================
diff --git a/modules/sparse/etc/sparse.start b/modules/sparse/etc/sparse.start
new file mode 100755
index 000000000..de5e2edd4
--- /dev/null
+++ b/modules/sparse/etc/sparse.start
@@ -0,0 +1,13 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2006 - INRIA - Scilab
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+// Load functions libraries
+// =============================================================================
+load('SCI/modules/sparse/macros/lib');
+
diff --git a/modules/sparse/help/en_US/addchapter.sce b/modules/sparse/help/en_US/addchapter.sce
new file mode 100755
index 000000000..c73aab599
--- /dev/null
+++ b/modules/sparse/help/en_US/addchapter.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+add_help_chapter("Sparse Matrix",SCI+"/modules/sparse/help/en_US",%T);
+
diff --git a/modules/sparse/help/en_US/chfact.xml b/modules/sparse/help/en_US/chfact.xml
new file mode 100755
index 000000000..d8b43a5d2
--- /dev/null
+++ b/modules/sparse/help/en_US/chfact.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="chfact">
+ <refnamediv>
+ <refname>chfact</refname>
+ <refpurpose>sparse Cholesky factorization</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>spcho=chfact(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>square symmetric positive sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>spcho</term>
+ <listitem>
+ <para>list containing the Cholesky factors in coded form</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>spcho=chfact(A)</literal> computes the sparse Cholesky factors of sparse
+ matrix <literal>A</literal>, assumed symmetric positive definite.
+ This function is based on the Ng-Peyton programs (ORNL). See the
+ Fortran programs for a complete description of the variables in
+ <literal>spcho</literal>. This function is to be used with <literal>chsolve</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+chfact(A)
+
+sol=(1:20)';
+rhs=A*sol;
+chfact(A)
+ ]]></programlisting>
+ </refsection>
+
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chsolve">chsolve</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/chsolve.xml b/modules/sparse/help/en_US/chsolve.xml
new file mode 100755
index 000000000..eac01c73c
--- /dev/null
+++ b/modules/sparse/help/en_US/chsolve.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="chsolve">
+ <refnamediv>
+ <refname>chsolve</refname>
+ <refpurpose>sparse Cholesky solver</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>sol=chsolve(spcho,rhs)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>spcho</term>
+ <listitem>
+ <para>list containing the Cholesky factors in coded form returned by chfact</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rhs, sol</term>
+ <listitem>
+ <para>full column vectors</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sol=chsolve(spcho,rhs)</literal> computes the solution of
+ <literal>rhs=A*sol</literal>, with <literal>A</literal> a symmetric sparse positive definite
+ matrix. This function is based on the Ng-Peyton programs (ORNL). See the
+ Fortran programs for a complete description of the variables in
+ <literal>spcho</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+spcho=chfact(A);
+sol=(1:20)';
+rhs=A*sol;
+spcho=chfact(A);
+chsolve(spcho,rhs)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chfact">chfact</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/decomposition/CHAPTER b/modules/sparse/help/en_US/decomposition/CHAPTER
new file mode 100755
index 000000000..ccebc80d8
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Decompositions
diff --git a/modules/sparse/help/en_US/decomposition/ludel.xml b/modules/sparse/help/en_US/decomposition/ludel.xml
new file mode 100755
index 000000000..2efca3fb0
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/ludel.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ludel">
+ <refnamediv>
+ <refname>ludel</refname>
+ <refpurpose>utility function used with lufact</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>ludel(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>handle to sparse lu factors (output of lufact)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ This function is used in conjunction with <literal>lufact</literal>. It clears
+ the internal memory space used to store the result of <literal>lufact</literal>.
+ </para>
+ <para>
+ The sequence of commands <literal>[p,r]=lufact(A);x=lusolve(p,b);ludel(p);</literal>
+ solves the sparse linear system <literal>A*x = b</literal> and clears <literal>p</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);
+x=lusolve(h,[1;1;1;1]);
+ludel(h)
+rk,sp*x
+ ]]></programlisting>
+ </refsection>
+
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/decomposition/lufact.xml b/modules/sparse/help/en_US/decomposition/lufact.xml
new file mode 100755
index 000000000..eba959262
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/lufact.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="lufact">
+ <refnamediv>
+ <refname>lufact</refname>
+ <refpurpose>sparse lu factorization</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[hand,rk]=lufact(A,prec)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>square sparse real matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>handle to sparse lu factors</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rk</term>
+ <listitem>
+ <para>integer (rank of A)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>prec</term>
+ <listitem>
+ <para>
+ a vector of size two <literal>prec=[eps,reps]</literal> giving the absolute and relative thresolds.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[hand,rk]=lufact(A)</literal> performs the lu factorization of sparse matrix <literal>A</literal>.
+ <literal>hand</literal> (no display) is used by <literal>lusolve</literal> (for solving linear
+ system) and <literal>luget</literal> (for retrieving the factors).
+ <literal>hand</literal> should be cleared by the command: <literal>ludel(hand)</literal>;
+ </para>
+ <para>
+ The A matrix needs not be full rank but must be square
+ (since A is assumed sparse one may add zeros if necessary to squaring
+ down A).
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>eps :</term>
+ <listitem>
+ <para>
+ The absolute magnitude an element must have to be considered as a pivot candidate, except as a last resort. This number should be set significantly smaller than the smallest diagonal element that is is expected to be placed in the matrix. the default value is <literal>%eps</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>reps :</term>
+ <listitem>
+ <para>This number determines what the pivot relative threshold will be. It should be between zero and one. If it is one then the pivoting method becomes complete pivoting, which is very slow and tends to fill up the matrix. If it is set close to zero the pivoting method becomes strict Markowitz with no threshold. The pivot threshold is used to eliminate pivot candidates that would cause excessive element growth if they were used. Element growth is the cause of roundoff error. Element growth occurs even in well-conditioned matrices. Setting the reps large will reduce element growth and roundoff error, but setting it too large will cause execution time to be excessive and will result in a large number of fill-ins. If this occurs, accuracy can actually be degraded because of the large number of operations required on the matrix due to the large number of fill-ins. A good value seems to be 0.001 which is the default value. The default is chosen by giving a value larger than one or less than or equal to zero. This value should be increased and the matrix resolved if growth is found to be excessive. Changing the pivot threshold does not improve performance on matrices where growth is low, as is often the case with ill-conditioned matrices. reps was chosen for use with nearly diagonally dominant matrices such as node- and modified-node admittance matrices. For these matrices it is usually best to use diagonal pivoting. For matrices without a strong diagonal, it is usually best to use a larger threshold, such as 0.01 or 0.1.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,5);b=rand(5,1);A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);a*x-b
+ludel(h)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/decomposition/luget.xml b/modules/sparse/help/en_US/decomposition/luget.xml
new file mode 100755
index 000000000..f05f01dcf
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/luget.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="luget">
+ <refnamediv>
+ <refname>luget</refname>
+ <refpurpose>extraction of sparse LU factors</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[P,L,U,Q]=luget(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>
+ handle, output of <literal>lufact</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P</term>
+ <listitem>
+ <para>sparse permutation matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>L</term>
+ <listitem>
+ <para>
+ sparse matrix, lower triangular if <literal>hand</literal> is obtained from a non singular matrix
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>U</term>
+ <listitem>
+ <para>square non singular upper triangular sparse matrix with ones along the main diagonal</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Q</term>
+ <listitem>
+ <para>sparse permutation matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[P,L,U,Q]=luget(hand)</literal> with <literal>hand</literal> obtained by
+ the command <literal>[hand,rk]=lufact(A)</literal> with <literal>A</literal> a sparse matrix
+ returns four sparse matrices such that <literal>P*L*U*Q=A</literal>.
+ </para>
+ <para>
+ The A matrix needs not be full rank but must be square
+ (since A is assumed sparse one may add zeros if necessary to squaring
+ down A).
+ </para>
+ <para>
+ If <literal>A</literal> is singular, the <literal>L</literal> matrix is column compressed (with
+ <literal>rk</literal> independent nonzero columns): the nonsingular sparse
+ matrix <literal>Q'*inv(U)</literal> column compresses <literal>A</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,2)*rand(2,5);A=sparse(a);
+[hand,rk]=lufact(A);[P,L,U,Q]=luget(hand);
+full(L), P*L*U*Q-A
+clean(P*L*U*Q-A)
+ludel(hand)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="clean">clean</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/decomposition/lusolve.xml b/modules/sparse/help/en_US/decomposition/lusolve.xml
new file mode 100755
index 000000000..9063c4bda
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/lusolve.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="lusolve">
+ <refnamediv>
+ <refname>lusolve</refname>
+ <refpurpose>sparse linear system solver</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>x=lusolve(hand,b)
+ x=lusolve(A,b)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>full real matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>real square sparse invertible matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>handle to a previously computed sparse lu factors (output of lufact)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>full real matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>x=lusolve(hand,b)</literal> solves the sparse linear system
+ <literal>A*x = b</literal>.
+ </para>
+ <para>
+ <literal>[hand,rk]=lufact(A)</literal> is the output of lufact.
+ </para>
+ <para>
+ <literal>x=lusolve(A,b)</literal> solves the sparse linear system
+ <literal>A*x = b</literal>
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);
+x=lusolve(h,[1;1;1;1]);
+ludel(h)
+rk,sp*x
+
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+x=lusolve(sp,-ones(4,1));
+sp*x
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="slash">slash</link>
+ </member>
+ <member>
+ <link linkend="backslash">backslash</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/decomposition/spchol.xml b/modules/sparse/help/en_US/decomposition/spchol.xml
new file mode 100755
index 000000000..dafaf0dde
--- /dev/null
+++ b/modules/sparse/help/en_US/decomposition/spchol.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="spchol">
+ <refnamediv>
+ <refname>spchol</refname>
+ <refpurpose>sparse cholesky factorization</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[R,P] = spchol(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>symmetric positive definite real sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P</term>
+ <listitem>
+ <para> permutation matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>R</term>
+ <listitem>
+ <para> cholesky factor</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[R,P] = spchol(X)</literal> produces a
+ lower triangular matrix <literal>R</literal> such that <literal>P*R*R'*P' = X</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+// Factorization:
+Xfull = [
+3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0.
+0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0.
+0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0.
+2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0.
+0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4.
+0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0.
+0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+X = sparse(Xfull);
+
+[R, P] = spchol(X);
+max(P*R*R'*P'-X)
+
+// Factorization and solve with backslash operator:
+Afull = [
+2 -1 0 0 0;
+-1 2 -1 0 0;
+0 -1 2 -1 0;
+0 0 -1 2 -1;
+0 0 0 -1 2
+];
+A = sparse(Afull);
+
+[L, P] = spchol(A);
+max(P*L*L'*P'-A)
+
+n = size(A, "r"); e = (1:n)'; b = A * e;
+x = P*(L'\(L\(P'*b)));
+A*x-b
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="chol">chol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/iterativesolvers/CHAPTER b/modules/sparse/help/en_US/iterativesolvers/CHAPTER
new file mode 100755
index 000000000..c59edd550
--- /dev/null
+++ b/modules/sparse/help/en_US/iterativesolvers/CHAPTER
@@ -0,0 +1 @@
+title = Linear Equations (Iterative Solvers)
diff --git a/modules/sparse/help/en_US/iterativesolvers/conjgrad.xml b/modules/sparse/help/en_US/iterativesolvers/conjgrad.xml
new file mode 100755
index 000000000..e011282e4
--- /dev/null
+++ b/modules/sparse/help/en_US/iterativesolvers/conjgrad.xml
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="conjgrad" xml:lang="en">
+ <refnamediv>
+ <refname>conjgrad</refname>
+ <refpurpose>conjugate gradient solvers</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ [x, flag, err, iter, res] = conjgrad(A, b [, method [, tol [, maxIter [, M [, M2 [, x0 [, verbose]]]]]]])
+ [x, flag, err, iter, res] = conjgrad(A, b [, method [, key=value,...]])
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <term/>
+ <listitem>
+ <para>a matrix, or a function, or a list computing
+ <literal>A*x</literal> for each given <literal>x</literal>. The
+ following is a description of the computation of A*x depending on
+ the type of A.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>matrix.</literal>If A is a matrix, it can be
+ dense or sparse
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>function.</literal>If A is a function, it must
+ have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = A ( x )
+ ]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>list.</literal>If A is a list, the first element
+ of the list is expected to be a function and the other elements
+ in the list are the arguments of the function, from index 2 to
+ the end. When the function is called, the current value of x is
+ passed to the function as the first argument. The other
+ arguments passed are the one given in the list.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>right hand side vector (size: nx1)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mehtod</term>
+ <listitem>
+ <para>scalar string, "pcg", "cgs", "bicg" or "bicgstab" (default "bicgstab")</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>tol</term>
+ <listitem>
+ <para>error relative tolerance (default: 1e-8).
+ The termination criteria is based on the 2-norm of the
+ residual r=b-Ax, divided by the 2-norm of the right hand side b.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>maxIter</term>
+ <listitem>
+ <para>maximum number of iterations (default: n)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M</term>
+ <listitem>
+ <para>preconditioner: full or sparse matrix or function returning
+ <literal>M\x</literal> (default: none)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M2</term>
+ <listitem>
+ <para>preconditioner: full or sparse matrix or function returning
+ <literal>M2\x</literal> for each <literal>x</literal> (default:
+ none)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x0</term>
+ <listitem>
+ <para>initial guess vector (default: zeros(n,1))</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>verbose</term>
+ <listitem>
+ <para>set to 1 to enable verbose logging (default 0)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>solution vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flag</term>
+ <listitem>
+ <para>
+ 0 if <literal>conjgrad</literal> converged to the desired tolerance
+ within <literal>maxi</literal> iterations, 1 else
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>err</term>
+ <listitem>
+ <para>final relative norm of the residual (the 2-norm of the right-hand side b is used)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iter</term>
+ <listitem>
+ <para>number of iterations performed</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>vector of the residual relative norms</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ Solves the linear system <literal>Ax=b</literal> using the conjugate
+ gradient method with or without preconditioning. The preconditionning
+ should be defined by a symmetric positive definite matrix
+ <literal>M</literal>, or two matrices <literal>M1</literal> and
+ <literal>M2</literal> such that <literal>M=M1*M2</literal>. in the case
+ the function solves <literal>inv(M)*A*x = inv(M)*b</literal> for
+ <literal>x</literal>. <literal>M</literal>, <literal>M1</literal> and
+ <literal>M2</literal> can be Scilab functions with calling sequence
+ <literal>y=Milx(x)</literal> which computes the corresponding left
+ division <literal>y=Mi\x</literal>.
+ </para>
+ <para>
+ The <literal>method</literal> input argument selects the solver to be used:
+ <simplelist type="inline">
+ <member>
+ "pcg" Preconditioned Conjugate Gradient
+ </member>
+ <member>
+ "cgs" preconditioned Conjugate Gradient Squared
+ </member>
+ <member>
+ "bicg" preconditioned BiConjugate Gradient
+ </member>
+ <member>
+ "bicgstab" preconditioned BiConjugate Gradient Stabilized (default)
+ </member>
+ </simplelist>
+ </para>
+ <para>
+ If <literal>method="pcg"</literal>, then the <literal>A</literal> matrix
+ must be a symmetric positive definite matrix (full or sparse)
+ or a function with calling sequence <literal>y=Ax(x)</literal> which computes
+ <literal>y=A*x</literal>.
+ Otherwise (<literal>method="cgs", "bicg" or "bicgstab"</literal>),
+ <literal>A</literal> just needs to be square.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Example with well-conditionned and ill-conditionned
+ problems
+ </title>
+ <para>In the following example, two linear systems are solved. The first
+ maxtrix has a condition number equals to ~0.02, which makes the algorithm
+ converge in exactly 10 iterations. Since this is the size of the matrix,
+ it is an expected behaviour for a gradient conjugate method. The second
+ one has a low condition number equals to 1.d-6, which makes the algorithm
+ converge in a larger 22 iterations. This is why the parameter maxIter is
+ set to 30. See below for other examples of the "key=value" syntax.
+ </para>
+ <programlisting role="example"><![CDATA[
+// Well-conditionned problem
+A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+
+b = ones(10, 1);
+[x, fail, err, iter, res] = conjgrad(A, b, "bicg", 1d-12, 15);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+
+// Ill-contionned one
+A = [ 894 0 0 0 0 28 0 0 1000 70000
+ 0 5 13 5 0 0 0 0 0 0
+ 0 13 72 34 0 0 0 0 0 6500
+ 0 5 34 1 0 0 0 0 0 55
+ 0 0 0 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 0 0 0 32 0 39 46 8 0
+ 1000 0 0 0 12 33 0 8 82 11
+ 70000 0 6500 55 0 0 0 0 11 100];
+
+[x, fail, err, iter, res] = conjgrad(A, b, method="pcg", maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Examples with A given as a sparse matrix, or function, or
+ list
+ </title>
+ <para>The following example shows that the method can handle sparse
+ matrices as well. It also shows the case where a function, computing the
+ right-hand side, is given to the "conjgrad" primitive. The final case shown by
+ this example, is when a list is passed to the primitive.
+ </para>
+ <programlisting role="example"><![CDATA[
+// Well-conditionned problem
+A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b = ones(10, 1);
+
+// Convert A into a sparse matrix
+Asparse=sparse(A);
+[x, fail, err, iter, res] = conjgrad(Asparse, b, "cgs", maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+
+// Define a function which computes the right-hand side.
+function y = Atimesx(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A*x
+endfunction
+
+// Pass the script Atimesx to the primitive
+[x, fail, err, iter, res] = conjgrad(Atimesx, b, maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+
+// Define a function which computes the right-hand side.
+function y = Atimesxbis(x, A)
+ y = A*x
+endfunction
+
+// Pass a list to the primitive
+Alist = list(Atimesxbis, Asparse);
+[x, fail, err, iter, res] = conjgrad(Alist, b, maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Examples with key=value syntax</title>
+ <para>The following example shows how to pass arguments with the
+ "key=value" syntax. This allows to set non-positionnal arguments, that is,
+ to set arguments which are not depending on their order in the list of
+ arguments. The available keys are the names of the optional arguments,
+ that is : tol, maxIter, %M, %M2, x0, verbose. Notice that, in the
+ following example, the verbose option is given before the maxIter option.
+ Without the "key=value" syntax, the positionnal arguments would require
+ that maxIter come first and verbose after.
+ </para>
+ <programlisting role="example"><![CDATA[
+// Example of an argument passed with key=value syntax
+A = [100 1; 1 10];
+b = [101; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, verbose=1);
+
+// With key=value syntax, the order does not matter
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, verbose=1, maxIter=0);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="backslash">backslash</link>
+ </member>
+ <member>
+ <link linkend="qmr">qmr</link>
+ </member>
+ <member>
+ <link linkend="gmres">gmres</link>
+ </member>
+ </simplelist>
+ </refsection>
+ <refsection>
+ <title>References</title>
+ <para>
+ <emphasis role="bold">PCG</emphasis>
+ </para>
+ <para>"Templates for the Solution of Linear Systems: Building Blocks for
+ Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
+ Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993, ftp
+ netlib2.cs.utk.edu/linalg/templates.ps
+ </para>
+ <para>"Iterative Methods for Sparse Linear Systems, Second Edition", Saad,
+ SIAM Publications, 2003, ftp
+ ftp.cs.umn.edu/dept/users/saad/PS/all_ps.zip
+ </para>
+ <para>
+ <emphasis role="bold">CGS</emphasis>
+ </para>
+ <para>
+ "CGS, A Fast Lanczos-Type Solver for Nonsymmetric Linear systems" by Peter Sonneveld.
+ </para>
+ <para>
+ <ulink url="http://epubs.siam.org/doi/abs/10.1137/0910004">Original article</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?id=64888&amp;preflayout=flat">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/ConjugateGradientSquaredMethod.html">Some theory around CGS</ulink>
+ </para>
+ <para>
+ <emphasis role="bold">BICG</emphasis>
+ </para>
+ <para>
+ "Numerical Recipes: The Art of Scientific Computing." (third ed.) by William Press, Saul Teukolsky, William Vetterling, Brian Flannery.
+ </para>
+ <para>
+ <ulink url="http://apps.nrbook.com/empanel/index.html?pg=87">http://apps.nrbook.com/empanel/index.html?pg=87</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?doid=1874391.187410">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/BiconjugateGradientMethod.html">Some theory around BICG</ulink>
+ </para>
+ <para>
+ <emphasis role="bold">BICGSTAB</emphasis>
+ </para>
+ <para>
+ "Bi-CGSTAB: A Fast and Smoothly Converging Variant of Bi-CG for the Solution of Nonsymmetric Linear Systems" by Henk van der Vorst. 339
+ </para>
+ <para>
+ <ulink url="http://epubs.siam.org/doi/abs/10.1137/0913035">Original article</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?id=131916.131930&amp;coll=DL&amp;dl=GUIDE&amp;CFID=372773884&amp;CFTOKEN=56630250">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/BiconjugateGradientStabilizedMethod.html">Some theory around BICG</ulink>
+ </para>
+ </refsection>
+ <refsection>
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>5.5.0</revnumber>
+ <revdescription>
+ Introduction
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/iterativesolvers/gmres.xml b/modules/sparse/help/en_US/iterativesolvers/gmres.xml
new file mode 100755
index 000000000..f54361ef0
--- /dev/null
+++ b/modules/sparse/help/en_US/iterativesolvers/gmres.xml
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ * Copyright (C) 2012 - Scilab Enterprises - Adeline Carnis
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="gmres">
+ <refnamediv>
+ <refname>gmres</refname>
+ <refpurpose>Generalized Minimum RESidual method</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[x,flag,err,iter,res] = gmres(A,b,[rstr,[tol,[maxi,[M,[x0]]]]])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>
+ n-by-n matrix or function returning <literal>A*x</literal>. If <literal>A</literal> is a function, it must have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = A ( x )
+ ]]></programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>right hand side vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x0</term>
+ <listitem>
+ <para>initial guess vector (default: zeros(n,1))</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M</term>
+ <listitem>
+ <para>
+ preconditioner: matrix of size n-by-n or function returning <literal>M*x</literal> (In the first case, default: eye(n,n)). If M is a function, it must have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = M ( x )
+ ]]></programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rstr</term>
+ <listitem>
+ <para>number of iterations between restarts (default: 10)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>maxi</term>
+ <listitem>
+ <para>maximum number of iterations (default: n)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>tol</term>
+ <listitem>
+ <para>error tolerance (default: 1e-6)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>solution vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>err</term>
+ <listitem>
+ <para>final residual norm</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iter</term>
+ <listitem>
+ <para>number of iterations performed</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flag</term>
+ <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>0 =</term>
+ <listitem>
+ <para>
+ <literal>gmres</literal> converged to the desired tolerance within <literal>maxi</literal> iterations
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>1 =</term>
+ <listitem>
+ <para>
+ no convergence given <literal>maxi</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>residual vector</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <variablelist>
+ <varlistentry>
+ <term>GMRES </term>
+ <listitem>
+ <para>
+ solves the linear system <literal>Ax=b</literal> using the Generalized Minimal residual method with restarts.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Details </term>
+ <listitem>
+ <para>of this algorithm are described in :</para>
+ <para>"Templates for the Solution of Linear Systems: Building Blocks for
+ Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
+ Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993 (ftp
+ netlib2.cs.utk.edu; cd linalg; get templates.ps).
+ </para>
+ <para>"Iterative Methods for Sparse Linear Systems, Second Edition" Saad,
+ SIAM Publications, 2003 (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get
+ all_ps.zip).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+ // If A and M are matrices
+A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+[x,flag,err,iter,res] = gmres(A, b)
+
+M = eye(10, 10);
+
+[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, M, zeros(10, 1))
+
+ // If A is a matrix and M is a function
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+
+function y = Mtimesx(x)
+M = eye(10,10);
+y = M*x;
+endfunction
+
+[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, Mtimesx, zeros(10, 1))
+
+ // If A is a function and M is a matrix
+ function y = Atimesx(x)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A * x;
+ endfunction
+
+ b = ones(10,1);
+ M = eye(10, 10);
+
+ [x,flag,err,iter,res] = gmres(Atimesx, b)
+
+ [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, M, zeros(10,1))
+
+ // If A and M are functions
+ function y = Atimesx(x)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A * x;
+ endfunction
+
+ function y = Mtimesx(x)
+M = eye(10,10);
+y = M*x;
+endfunction
+
+ [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, Mtimesx, zeros(10,1))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="conjgrad">conjgrad</link>
+ </member>
+ <member>
+ <link linkend="qmr">qmr</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/iterativesolvers/qmr.xml b/modules/sparse/help/en_US/iterativesolvers/qmr.xml
new file mode 100755
index 000000000..71b37cc11
--- /dev/null
+++ b/modules/sparse/help/en_US/iterativesolvers/qmr.xml
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="qmr">
+ <refnamediv>
+ <refname>qmr</refname>
+ <refpurpose>quasi minimal residual method with preconditioning </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[x,flag,err,iter,res] = qmr(A,Ap,b,x0,M1,M1p,M2,M2p,maxi,tol)
+ [x,flag,err,iter,res] = qmr(A,b,x0,M1,M2,maxi,tol)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>
+ matrix of size n-by-n or function.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>matrix.</literal>If A is a matrix, it can be
+ dense or sparse
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>function.</literal>If A is a function which returns <literal>A*x</literal>, it must
+ have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = A ( x )
+ ]]></programlisting>
+ <para>
+ If A is a function which returns <literal>A*x</literal> or <literal>A'*x</literal> depending t.
+ If <literal>t = "notransp"</literal>, the function returns <literal>A*x</literal>.
+ If <literal>t = "transp"</literal>, the function returns <literal>A'*x</literal>. It must
+ have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = A ( x, t )
+ ]]></programlisting>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Ap</term>
+ <listitem>
+ <para>
+ function returning <literal>A'*x</literal>. It must have the following header :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = Ap ( x )
+ ]]></programlisting>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>right hand side vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x0</term>
+ <listitem>
+ <para>initial guess vector (default: zeros(n,1))</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M1</term>
+ <listitem>
+ <para>
+ left preconditioner : matrix or function (In the first case, default: eye(n,n)). If <literal>M1</literal> is a function, she returns either,
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ only <literal>M1*x</literal>
+ </para>
+ </listitem>
+ <para> or
+ </para>
+ <listitem>
+ <para>
+ <literal>M1*x</literal> or <literal>M1'*x</literal> depending <literal>t</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M1p</term>
+ <listitem>
+ <para>
+ must only be provided when <literal>M1</literal> is a function returning <literal>M1*x</literal>.
+ In this case <literal>M1p</literal> is the function which returns <literal>M1'*x</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M2</term>
+ <listitem>
+ <para>
+ right preconditioner : matrix or function (In the first case, default: eye(n,n)). If <literal>M2</literal> is a function, she returns either
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ only <literal>M2*x</literal>
+ </para>
+ </listitem>
+ <para> or
+ </para>
+ <listitem>
+ <para>
+ <literal>M2*x</literal> or <literal>M2'*x</literal> depending <literal>t</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M2p</term>
+ <listitem>
+ <para>
+ must only be provided when <literal>M2</literal> is a function returning <literal>M2*x</literal>.
+ In this case <literal>M2p</literal> is the function which returns <literal>M2'*x</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>maxi</term>
+ <listitem>
+ <para>maximum number of iterations (default: n)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>tol</term>
+ <listitem>
+ <para>error tolerance (default: 1000*%eps)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>solution vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flag</term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <varname>flag</varname>=0: <code>qmr</code> converged to the desired tolerance within <varname>maxi</varname>
+ iterations,
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>flag</varname>=1: no convergence given <varname>maxi</varname>,
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>-7 &lt; flag &lt; 0</literal>: A breakdown occurred because one of the scalar quantities calculated during
+ <code>qmr</code> was equal to zero.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>residual vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>err</term>
+ <listitem>
+ <para>final residual norm</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iter</term>
+ <listitem>
+ <para>number of iterations performed</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ Solves the linear system <literal>Ax=b</literal> using the Quasi Minimal Residual Method with preconditioning.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+ // If A is a matrix
+A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+[x,flag,err,iter,res] = qmr(A, b)
+
+[x,flag,err,iter,res] = qmr(A, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // If A is a function
+ function y = Atimesx(x,t)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ if (t == 'notransp') then
+ y = A*x;
+ elseif (t == 'transp') then
+ y = A'*x;
+ end
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(Atimesx, b)
+
+ [x,flag,err,iter,res] = qmr(Atimesx, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // OR
+
+ function y = funA(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A*x
+ endfunction
+
+ function y = funAp(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A'*x
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(funA, funAp, b)
+
+ [x,flag,err,iter,res] = qmr(funA, funAp, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // If A is a matrix, M1 and M2 are functions
+ function y = M1timesx(x,t)
+ M1 = eye(10,10);
+ if(t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+ endfunction
+
+ function y = M2timesx(x,t)
+ M2 = eye(10,10);
+ if(t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(A, b, zeros(10,1), M1timesx, M2timesx, 10, 1d-12)
+
+ // OR
+
+ function y = funM1(x)
+ M1 = eye(10,10);
+ y = M1*x;
+ endfunction
+
+ function y = funM1p(x)
+ M1 = eye(10,10);
+ y = M1'*x;
+ endfunction
+
+ function y = funM2(x)
+ M2 = eye(10,10);
+ y = M2*x;
+ endfunction
+
+ function y = funM2p(x)
+ M2 = eye(10,10);
+ y = M2'*x;
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(A, b, zeros(10,1), funM1, funM1p, funM2, funM2p, 10, 1d-12)
+
+ // If A, M1, M2 are functions
+ [x,flag,err,iter,res] = qmr(funA, funAp, b, zeros(10,1), funM1, funM1p, funM2, funM2p, 10, 1d-12)
+ [x,flag,err,iter,res] = qmr(Atimesx, b, zeros(10,1), M1timesx, M2timesx, 10, 1d-12)
+
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="gmres">gmres</link>
+ </member>
+ <member>
+ <link linkend="conjgrad">conjgrad</link>
+ </member>
+ </simplelist>
+ </refsection>
+ <refsection>
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>5.4.0</revnumber>
+ <revdescription>
+ Calling qmr(A, Ap) is deprecated. qmr(A) should be used instead. The following function is an example :
+ <programlisting role=""><![CDATA[
+function y = A ( x, t )
+Amat = eye(2,2);
+if ( t== "notransp") then
+y = Amat*x;
+elseif (t == "transp") then
+y = Amat'*x;
+end
+endfunction
+ ]]></programlisting>
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/CHAPTER b/modules/sparse/help/en_US/matrixmanip/CHAPTER
new file mode 100755
index 000000000..a797a77e1
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Manipulation
diff --git a/modules/sparse/help/en_US/matrixmanip/issparse.xml b/modules/sparse/help/en_US/matrixmanip/issparse.xml
new file mode 100755
index 000000000..6bac33ba4
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/issparse.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="issparse" xml:lang="en">
+ <refnamediv>
+ <refname>issparse</refname>
+ <refpurpose>determine whether input is sparse</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>res = issparse(S)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>S</term>
+ <listitem>
+ <para>a scilab object</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>1 is the matrix is a sparse and 0 otherwise/</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>res = issparse(S)</literal> returns 1 if S is a sparse
+ matrix and 0 otherwise.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example">sp = sparse([1,2;4,5;3,10],[1,2,3]);
+ if issparse(sp) == 1 then
+ disp("It is a sparse");
+ end
+
+ A = 1;
+ if issparse(A) == 0 then
+ disp("It is not a sparse");
+ end
+ </programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="type">type</link>
+ </member>
+ <member>
+ <link linkend="typeof">typeof</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/nnz.xml b/modules/sparse/help/en_US/matrixmanip/nnz.xml
new file mode 100755
index 000000000..9bb90e77f
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/nnz.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="nnz">
+ <refnamediv>
+ <refname>nnz</refname>
+ <refpurpose>number of non zero entries in a matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>n=nnz(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>real or complex sparse (or full) matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>n</term>
+ <listitem>
+ <para>integer, the number of non zero elements in X</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>nnz</literal> counts the number of non zero entries in a sparse or full matrix
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3]);
+nnz(sp)
+a=[1 0 0 0 2];
+nnz(a)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/speye.xml b/modules/sparse/help/en_US/matrixmanip/speye.xml
new file mode 100755
index 000000000..a79e4d3ae
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/speye.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="speye" xml:lang="en">
+ <refnamediv>
+ <refname>speye</refname>
+ <refpurpose>sparse identity matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>Isp=speye(nrows,ncols)
+ Isp=speye(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>integer (number of rows)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>integer (number os columns)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>sparse identity matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>Isp=speye(nrows,ncols)</literal> returns a sparse identity
+ matrix <literal>Isp</literal> with <literal>nrows</literal> rows,
+ <literal>ncols</literal> columns. (Non square identity matrix have a
+ maximal number of ones along the main diagonal).
+ </para>
+ <para>
+ <literal>Isp=speye(A)</literal> returns a sparse identity matrix
+ with same dimensions as <literal>A</literal>. If
+ <literal>[m,n]=size(A)</literal>, <literal>speye(m,n)</literal> and
+ <literal>speye(A)</literal> are equivalent. In particular
+ <literal>speye(3)</literal> is not equivalent to
+ <literal>speye(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+eye(3,3)-full(speye(3,3))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/spones.xml b/modules/sparse/help/en_US/matrixmanip/spones.xml
new file mode 100755
index 000000000..76e2aec02
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/spones.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spones" xml:lang="en">
+ <refnamediv>
+ <refname>spones</refname>
+ <refpurpose>sparse matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>sp=spones(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=spones(A)</literal> generates a matrix with the same
+ sparsity structure as <literal>A</literal>, but with ones in the nonzero
+ positions.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(10,12,0.1);
+sp=spones(A)
+B = A~=0
+bool2s(B)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/sprand.xml b/modules/sparse/help/en_US/matrixmanip/sprand.xml
new file mode 100755
index 000000000..69ee87075
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/sprand.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2010 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sprand" xml:lang="en">
+ <refnamediv>
+ <refname>sprand</refname>
+ <refpurpose>sparse random matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>sp=sprand(nrows,ncols,density [,typ])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>integer (number of rows)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>integer (number of columns)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>density</term>
+ <listitem>
+ <para>filling coefficient (density)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>typ</term>
+ <listitem>
+ <para>
+ character string, <literal>"uniform"</literal> (default) or
+ <literal>"normal"</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=sprand(nrows,ncols,density)</literal> returns a sparse
+ matrix <literal>sp</literal> with <literal>nrows</literal> rows,
+ <literal>ncols</literal> columns and approximately
+ <literal>density*nrows*ncols</literal> non-zero entries.
+ </para>
+ <para>
+ The <literal>density</literal> parameter is expected to be in the
+ <literal>[0,1]</literal> interval. If not, it is automatically
+ projected into this interval. Therefore, using a density which is
+ lower than 0 or greater than 1 will generate neither an error,
+ nor a warning: the formula <literal>density=max(min(density,1),0)</literal>
+ is used.
+ </para>
+ <para>
+ If <literal>typ="uniform"</literal> uniformly distributed values on
+ [0,1] are generated. If <literal>typ="normal"</literal> normally
+ distributed values are generated (mean=0 and standard deviation=1).
+ </para>
+ <para>
+ The entries of the output matrix are computed from the given
+ distribution function <literal>typ</literal>.
+ The indices of the non-zeros entries are computed
+ randomly, so that the average number of nonzeros is equal to
+ <literal>density</literal>.
+ The actual indices values are computed from the exponential distribution
+ function, where the parameter of the distribution function is
+ computed accordingly.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ In the following example, we generate a 100x1000 sparse matrix with
+ approximate density 0.001, i.e. with approximately
+ 100*1000*0.001=100 nonzero entries.
+ </para>
+ <programlisting role="example"><![CDATA[
+// The entries of the matrix are uniform.
+W=sprand(100,1000,0.001);
+// The entries of the matrix are normal.
+W=sprand(100,1000,0.001,"normal");
+ ]]></programlisting>
+ <para>
+ In the following script, we check that the entries of the matrix
+ have the expected distribution.
+ We use the spget function in order to get the nonzero entries.
+ Then we compute the min, mean and max of the entries and compare
+ them with the limit values.
+ </para>
+ <programlisting role="example"><![CDATA[
+typ = "normal";
+// typ = "uniform";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+nnzs=nnz(s);
+[ij,v]=spget(s);
+[%inf -%inf 0 %inf 1] // Limit values for "normal"
+[nnzs min(v) mean(v) max(v) variance(v)]
+[%inf 0 0.5 1 1/12] // Limit values for "uniform"
+ ]]></programlisting>
+ <para>
+ In the following script, we check that the entry indices, which
+ are also chosen at random, have the correct distribution.
+ We generate <literal>kmax</literal> sparse random matrices with
+ uniform distribution.
+ For each matrix, we consider the indices of the nonzero
+ entries which were generated, i.e. we see if the event
+ <literal>Aij = {the entry (i,j) is nonzero}</literal> occurred for
+ each <literal>i</literal> and <literal>j</literal>, for <literal>i=1,2,...,nrows</literal>
+ and <literal>j=1,2,...,ncols</literal>.
+ The matrix <literal>C(i,j)</literal> stores the number of times that the event <literal>Aij</literal>
+ occurred.
+ The matrix <literal>R(k)</literal> stores the actual density of the try number <literal>k</literal>,
+ where <literal>k=1,2,...,kmax</literal>.
+ </para>
+ <programlisting role="example"><![CDATA[
+ kmax = 1000;
+ ncols=10;
+ nrows=15;
+ density=0.01;
+ typ="uniform";
+ C=zeros(nrows,ncols);
+ R=[];
+ for k=1:kmax
+ M=sprand(nrows,ncols,density,typ);
+ NZ=find(M<>0);
+ NZratio = size(NZ,"*")/(nrows*ncols);
+ R=[R NZratio];
+ C(NZ)=C(NZ)+1;
+ end
+ ]]></programlisting>
+ <para>
+ Now that this algorithm has been performed (which may require some time),
+ we can compute elementary statistics to check that the algorithm performed
+ well.
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+ // The expectation of A_ij is
+ density * kmax
+ // Compare this with the actual events :
+ C
+ // The average number should be close to the expectation.
+ [density*kmax mean(C)]
+ // The density should be close to expected density
+ [density mean(R)]
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="rand">rand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/matrixmanip/spzeros.xml b/modules/sparse/help/en_US/matrixmanip/spzeros.xml
new file mode 100755
index 000000000..32d23952f
--- /dev/null
+++ b/modules/sparse/help/en_US/matrixmanip/spzeros.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spzeros" xml:lang="en">
+ <refnamediv>
+ <refname>spzeros</refname>
+ <refpurpose>sparse zero matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>sp=spzeros(nrows,ncols)
+ sp=spzeros(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>integer (number of rows)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>integer (number os columns)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>sparse zero matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=spzeros(nrows,ncols)</literal> returns a sparse zero
+ matrix <literal>sp</literal> with <literal>nrows</literal> rows,
+ <literal>ncols</literal> columns. (Equivalent to
+ <literal>sparse([],[],[nrow,ncols])</literal>)
+ </para>
+ <para>
+ <literal>sp=spzeros(A)</literal> returns a sparse zero matrix with
+ same dimensions as <literal>A</literal>. If
+ <literal>[m,n]=size(A)</literal>, <literal>spzeros(m,n)</literal> and
+ <literal>spzeros(A)</literal> are equivalent. In particular
+ <literal>spzeros(3)</literal> is not equivalent to
+ <literal>spzeros(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+m=spzeros(2,2)
+a=rand(10,12);
+m=spzeros(a)
+sum(spzeros(1000,1000))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/ordmmd.xml b/modules/sparse/help/en_US/ordmmd.xml
new file mode 100755
index 000000000..f9d61c1a2
--- /dev/null
+++ b/modules/sparse/help/en_US/ordmmd.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ordmmd" xml:lang="en">
+ <refnamediv>
+ <refname>ordmmd</refname>
+ <refpurpose>
+ Compute multiple minimum degree ordering
+ </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ [perm,invp,nofsub]=ordmmd(xadj,iadj,n)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>n</term>
+ <listitem>
+ <para>a 1-by-1 matrix of doubles, integer value, the number of equations</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>(n+1)-by-1 matrix of doubles, integer value, pointer to the rows of A</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iadj</term>
+ <listitem>
+ <para>nnz-by-1 matrix of doubles, integer value, the row indices of A</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>perm</term>
+ <listitem>
+ <para>n-by-1 matrix of doubles, integer value, the minimum degree ordering</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>invp</term>
+ <listitem>
+ <para>n-by-1 matrix of doubles, integer value, the inverse of perm</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>nofsub</term>
+ <listitem>
+ <para>
+ 1-by-1 matrix of doubles, integer value,
+ an upper bound on the number of nonzero subscripts for the compressed storage scheme
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ The minimum degree algorithm is used to permute the rows and
+ columns of a symmetric sparse matrix before applying the Cholesky decomposition.
+ This algorithm reduces the number of non-zeros in the Cholesky factor.
+ </para>
+ <para>
+ Given a n-by-n real symmetric sparse square matrix <literal>A</literal>,
+ the Cholesky factor <literal>U</literal> will typically suffer "fill in", that is have more
+ non-zeros than the upper triangle of <literal>A</literal>.
+ We seek a permutation matrix <literal>P</literal>, so that the matrix <literal>P'*A*P</literal>,
+ which is also symmetric, has the least possible fill in its Cholesky factor.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ In the following example, we compute an ordering for a symmetric
+ sparse matrix.
+ We use the <literal>sp2adj</literal> function to compute the adjacency structure.
+ </para>
+ <programlisting role="example"><![CDATA[
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5./8. 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+[xadj,iadj,val]=sp2adj(A);
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n)
+ ]]></programlisting>
+ <para>
+ In the following example, we compute an ordering for a symmetric
+ sparse matrix.
+ We check that <literal>invp</literal> is the inverse of <literal>perm</literal>.
+ </para>
+ <programlisting role="example"><![CDATA[
+ A = [
+ 0., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0. ;
+ 0., 0., 4., 0., 0., 0., 0., 0., 0., 0., 0. ;
+ 0., 4., 0., 0., 0., 0., 0., 0., 0., 0., 0. ;
+ 2., 0., 0., 0., 0., 0., 2., 0., 2., 0., 0. ;
+ 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 4. ;
+ 0., 0., 0., 0., 0., 0., 0., 3., 0., 3., 0. ;
+ 2., 0., 0., 2., 0., 0., 0., 0., 2., 0., 0. ;
+ 0., 0., 0., 0., 0., 3., 0., 0., 0., 3., 0. ;
+ 2., 0., 0., 2., 0., 0., 2., 0., 0., 0., 0. ;
+ 0., 0., 0., 0., 0., 3., 0., 3., 0., 0., 0. ;
+ 0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 0.];
+ n=size(A,1);
+ A=sparse(A);
+ [xadj,adjncy,anz]=sp2adj(A);
+ [perm,invp,nofsub]=ordmmd(xadj,adjncy,n);
+ perm(invp)
+ ]]></programlisting>
+ <para>
+ In the following example, we compare the sparsity pattern of the Cholesky
+ factor of a matrix <literal>A</literal> and the matrix <literal>P'*A*P</literal>.
+ See p. 3, "Chapter 1: Introduction" in
+ "Computer Solution of Large Sparse Positive Definite Systems".
+ We see that the number of nonzeros in the Cholesky decomposition is
+ 15, while the matrix <literal>P'*A*P</literal> has a Cholesky decomposition with
+ 9 nonzeros.
+ </para>
+ <programlisting role="example"><![CDATA[
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5./8. 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+// See the sparsity pattern of the Cholesky factors of A
+U = sparse(chol(full(A)));
+scf();
+subplot(2,1,1);
+PlotSparse(U,"x");
+xtitle("Sparsity pattern of U, such that A=U''*U");
+// Get the adjacency structure
+[xadj,iadj,val]=sp2adj(A);
+// Compute multiple minimum degree ordering
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+// Convert the permutation vector into matrix.
+P=spzeros(n,n);
+for i=1:n
+ P(perm(i),i)=1;
+end
+// See the sparsity pattern of the Cholesky factors
+// of P'*A*P
+U = sparse(chol(full(P'*A*P)));
+subplot(2,1,2);
+PlotSparse(U,"x");
+xtitle("Sparsity pattern of U, such that P''*A*P=U''*U");
+ ]]></programlisting>
+ <scilab:image localized="true">
+ A = [
+ 4. 1. 2. 0.5 2.
+ 1. 0.5 0. 0. 0.
+ 2. 0. 3. 0. 0.
+ 0.5 0. 0. 0.625 0.
+ 2. 0. 0. 0. 16.
+ ];
+ A = sparse(A);
+ U = sparse(chol(full(A)));
+ scf();
+ subplot(2,1,1);
+ PlotSparse(U,"x");
+ xtitle("Sparsity pattern of U, such that A=U''*U");
+ [xadj,iadj,val]=sp2adj(A);
+ n = size(A,"r");
+ [perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+ P=spzeros(n,n);
+ for i=1:n
+ P(perm(i),i)=1;
+ end
+ U = sparse(chol(full(P'*A*P)));
+ subplot(2,1,2);
+ PlotSparse(U,"x");
+ xtitle("Sparsity pattern of U, such that P''*A*P=U''*U");
+ </scilab:image>
+ </refsection>
+ <refsection>
+ <title>Implementation notes</title>
+ <para>
+ This function is based on "ordmmd.f" a source code (1994) by Esmond G. Ng and Barry W. Peyton
+ from Mathematical Sciences Section, Oak Ridge National Laboratory.
+ The algorithm is based on the genmmd routine by Joseph W.H. Liu from the
+ SPARSPAK library.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Bibliography</title>
+ <para>
+ "Minimum degree algorithm", Wikipedia contributors, Wikipedia, The Free Encyclopedia. http://en.wikipedia.org/wiki/Minimum_degree_algorithm
+ </para>
+ <para>
+ "A new release of SPARSPAK: the Waterloo sparse matrix package", Alan George and Esmond Ng. 1984. SIGNUM Newsl. 19, 4 (October 1984), 9-13.
+ </para>
+ <para>
+ "Computer Solution of Large Sparse Positive Definite Systems" by Alan George and Joseph Liu, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981
+ </para>
+ <para>
+ "Implementation of Lipsol in Scilab", Rubio Scola, 1997, INRIA, No 0215
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sp2adj">sp2adj</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/CHAPTER b/modules/sparse/help/en_US/sparseconvert/CHAPTER
new file mode 100755
index 000000000..42d5e0bf2
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Conversion
diff --git a/modules/sparse/help/en_US/sparseconvert/adj2sp.xml b/modules/sparse/help/en_US/sparseconvert/adj2sp.xml
new file mode 100755
index 000000000..1b90969ce
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/adj2sp.xml
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2010 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="adj2sp" xml:lang="en">
+ <refnamediv>
+ <refname>adj2sp</refname>
+ <refpurpose>converts adjacency form into sparse matrix.</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ A=adj2sp(xadj,iadj,v)
+ A=adj2sp(xadj,iadj,v,mn)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>
+ a (n+1)-by-1 matrix of floating point integers.
+ For <literal>j=1:n</literal>, the floating point integer
+ <literal>xadj(j+1)-xadj(j)</literal> is the number of non zero entries in
+ column j.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iadj</term>
+ <listitem>
+ <para>
+ a nz-by-1 matrix of floating point integers, the row indices for the
+ nonzeros.
+ For <literal>j=1:n</literal>, for <literal>k = xadj(j):xadj(j+1)-1</literal>, the floating point integer
+ <literal>i = iadj(k)</literal> is the row index of the nonzero entry #k.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>
+ a nz-by-1 matrix of floating point integers, the non-zero entries of A.
+ For <literal>j=1:n</literal>, for <literal>k = xadj(j):xadj(j+1)-1</literal>, the floating point integer
+ <literal>Aij = v(k)</literal> is the value of the nonzero entry #k.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>
+ a 1-by-2 or 2-by-1 matrix of floating point integers, optional,
+ <literal>mn(1)</literal> is the number of rows in A,
+ <literal>mn(2)</literal> is the number of columns in A.
+ If <literal>mn</literal> is not provided, then <literal>mn=[m,n]</literal> is the default with
+ <literal>m=max(iadj)</literal> and <literal>n=size(xadj,"*")-1</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>m-by-n real or complex sparse matrix (with nz non-zero entries)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ adj2sp converts a sparse matrix into its adjacency form format.
+ The values in the adjacency format are stored colum-by-column.
+ This is why this format is sometimes called "Compressed sparse column" or CSC.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ In the following example, we create a sparse matrix from its adjacency format.
+ Then we check that it matches the expected sparse matrix.
+ </para>
+ <programlisting role="example"><![CDATA[
+xadj = [1 3 4 7 9 11]';
+iadj = [3 5 3 1 2 4 3 5 1 4]';
+v = [1 2 3 4 5 6 7 8 9 10]';
+B=adj2sp(xadj,iadj,v)
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+C=sparse(A)
+and(B==C)
+ ]]></programlisting>
+ <para>
+ In the following example, we create a sparse matrix from its adjacency format.
+ Then we check that it matches the expected sparse matrix.
+ </para>
+ <programlisting role="example"><![CDATA[
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+C=adj2sp(xadj,iadj,v)
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A)
+and(B==C)
+ ]]></programlisting>
+ <para>
+ In the following example, we check the use of the mn parameter.
+ The consistency between the mn parameter and the actual content of
+ xadj and iadj is checked by adj2sp.
+ </para>
+ <programlisting role="example"><![CDATA[
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+mn=[7 10];
+C=adj2sp(xadj,iadj,v,mn)
+ ]]></programlisting>
+ <para>
+ In the following example, create a 3-by-3 sparse matrix.
+ This example is adapted from the documentation of SciPy.
+ </para>
+ <programlisting role="example"><![CDATA[
+xadj = [1,3,4,7]
+iadj = [1,3,3,1,2,3]
+v = [1,2,3,4,5,6]
+full(adj2sp(xadj,iadj,v))
+ ]]></programlisting>
+ <para>
+ The previous script produces the following output.
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+-->full(adj2sp(xadj,iadj,v))
+ ans =
+ 1. 0. 4.
+ 0. 0. 5.
+ 2. 3. 6.
+ ]]></programlisting>
+ <para>
+ In the following example, we check that the sp2adj and adj2sp functions
+ are inverse.
+ </para>
+ <programlisting role="example"><![CDATA[
+// Templates for the Solution of Algebraic Eigenvalue Problems: a Practical Guide
+// Edited by Zhaojun Bai, James Demmel, Jack Dongarra, Axel Ruhe, and Henk van der Vorst
+// "Sparse Matrix Storage Formats", J. Dongarra
+// http://web.eecs.utk.edu/~dongarra/etemplates/book.html
+
+A = [
+10 0 0 0 -2 0
+3 9 0 0 0 3
+0 7 8 7 0 0
+3 0 8 7 5 0
+0 8 0 9 9 13
+0 4 0 0 2 -1
+];
+A = sparse(A)
+
+// To get the Compressed Sparse Column (CSC) :
+[col_ptr,row_ind,val]=sp2adj(A)
+// To convert back to sparse:
+AAsp=adj2sp(col_ptr,row_ind,val)
+// Check the conversion
+AAsp - A
+
+// To get the Compressed Sparse Row (CSR) :
+[row_ptr,col_ind,val]=sp2adj(A')
+// To convert back to sparse:
+AAsp=adj2sp(row_ptr,col_ind,val)'
+// Check the conversion
+AAsp - A
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sp2adj">sp2adj</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="spcompack">spcompack</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+ <refsection>
+ <title>References</title>
+ <para>
+ "Implementation of Lipsol in Scilab", Hector E. Rubio Scola, INRIA, Decembre 1997, Rapport Technique No 0215
+ </para>
+ <para>
+ "Solving Large Linear Optimization Problems with Scilab : Application to Multicommodity Problems", Hector E. Rubio Scola, Janvier 1999, Rapport Technique No 0227
+ </para>
+ <para>
+ "Toolbox Scilab : Detection signal design for failure detection and isolation for linear dynamic systems User's Guide", Hector E. Rubio Scola, 2000, Rapport Technique No 0241
+ </para>
+ <para>
+ "Computer Solution of Large Sparse Positive Definite Systems", A. George, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981.
+ </para>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/full.xml b/modules/sparse/help/en_US/sparseconvert/full.xml
new file mode 100755
index 000000000..8253f7991
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/full.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="full">
+ <refnamediv>
+ <refname>full</refname>
+ <refpurpose>sparse to full matrix conversion</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>X=full(sp)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>real or complex sparse (or full) matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>full matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>X=full(sp)</literal> converts the sparse matrix <literal>sp</literal> into its
+ full representation. (If <literal>sp</literal> is already full then <literal>X</literal> equals
+ <literal>sp</literal>).
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;5,4;3,1],[1,2,3]);
+A=full(sp)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/mtlb_sparse.xml b/modules/sparse/help/en_US/sparseconvert/mtlb_sparse.xml
new file mode 100755
index 000000000..cc8d8fdf6
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/mtlb_sparse.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="mtlb_sparse">
+ <refnamediv>
+ <refname>mtlb_sparse</refname>
+ <refpurpose>convert sparse matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>Y=mtlb_sparse(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Y</term>
+ <listitem>
+ <para>sparse matrix in Matlab format</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>Y=mtlb_sparse(X)</literal> is used to convert <literal>X</literal>, a Scilab sparse matrix, to
+ Matlab format. <literal>Y</literal> is the a variable with type 7,
+ i.e. <literal>type(Y)</literal> is equal to 7.
+ This function should be used in mexfiles (a Matlab mexfile containing sparse
+ matrices can be used only if the Scilab sparse matrices are converted
+ to that format). The functions <literal>full</literal> and <literal>spget</literal> work
+ with this format.
+ </para>
+ <para>
+ Other operations and functions using this format
+ can be overloaded with Scilab functions using the prefix "%msp".
+ For instance the function
+ <literal>%msp_p(x)</literal> (see SCI/modules/overloading/macros directory) is used to
+ display such "type 7" objects.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+X=sparse(rand(2,2)); Y=mtlb_sparse(X);
+Y, full(Y), [ij,v,mn]=spget(Y)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/sp2adj.xml b/modules/sparse/help/en_US/sparseconvert/sp2adj.xml
new file mode 100755
index 000000000..90fd92c18
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/sp2adj.xml
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2010 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sp2adj" xml:lang="en">
+ <refnamediv>
+ <refname>sp2adj</refname>
+ <refpurpose>converts sparse matrix into adjacency form</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>
+ [xadj,iadj,v]=sp2adj(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>m-by-n real or complex sparse matrix (with nz non-zero entries)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>
+ a (n+1)-by-1 matrix of floating point integers, pointers to the starting
+ index in iadj and v for each column.
+ For <literal>j=1:n</literal>, the floating point integer
+ <literal>xadj(j+1)-xadj(j)</literal> is the number of non zero entries in
+ column j.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iadj</term>
+ <listitem>
+ <para>
+ a nz-by-1 matrix of floating point integers, the row indices for the
+ nonzeros.
+ For <literal>j=1:n</literal>, for <literal>k = xadj(j):xadj(j+1)-1</literal>, the floating point integer
+ <literal>i = iadj(k)</literal> is the row index of the nonzero entry #k.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>
+ a nz-by-1 matrix of floating point integers, the non-zero entries of A.
+ For <literal>j=1:n</literal>, for <literal>k = xadj(j):xadj(j+1)-1</literal>, the floating point integer
+ <literal>Aij = v(k)</literal> is the value of the nonzero entry #k.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ sp2adj converts a sparse matrix into its adjacency format.
+ The values in the adjacency format are stored colum-by-column.
+ This is why this format is sometimes called "Compressed sparse column" or CSC.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ In the following example, we create a full matrix, which entries
+ goes from 1 to 10.
+ Then we convert it into a sparse matrix, which removes the zeros.
+ Finally, we compute the adjacency represention of this matrix.
+ The matrix v contains only the nonzero entries of A.
+ </para>
+ <programlisting role="example"><![CDATA[
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+B=sparse(A);
+[xadj,iadj,v]=sp2adj(B)
+expected_xadj = [1 3 4 7 9 11]';
+expected_adjncy = [3 5 3 1 2 4 3 5 1 4]';
+expected_anz = [1 2 3 4 5 6 7 8 9 10]';
+and(expected_xadj == xadj) // Should be %t
+and(expected_adjncy == iadj) // Should be %t
+and(expected_anz == v) // Should be %t
+// j is the column index
+for j = 1 : size(xadj,"*")-1
+ irows = iadj(xadj(j):xadj(j+1)-1);
+ vcolj = v(xadj(j):xadj(j+1)-1);
+ mprintf("Column #%d:\n",j)
+ mprintf(" Rows = %s:\n",sci2exp(irows))
+ mprintf(" Values= %s:\n",sci2exp(vcolj))
+end
+ ]]></programlisting>
+ <para>
+ The previous script produces the following output.
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+Column #1:
+ Rows = [3;5]:
+ Values= [1;2]:
+Column #2:
+ Rows = 3:
+ Values= 3:
+Column #3:
+ Rows = [1;2;4]:
+ Values= [4;5;6]:
+Column #4:
+ Rows = [3;5]:
+ Values= [7;8]:
+Column #5:
+ Rows = [1;4]:
+ Values= [9;10]:
+ ]]></programlisting>
+ <para>
+ Let us consider the column #1.
+ The equality xadj(2)-xadj(1)=2 indicates that there are two
+ nonzeros in the column #1.
+ The row indices are stored in iadj, which tells us that the
+ nonzero entries in column #1 are at rows #3 and #5.
+ The v matrix tells us the actual entries are equal to 1 and 2.
+ </para>
+ <para>
+ In the following example, we browse the nonzero entries of
+ a sparse matrix by looping on the adjacency structure.
+ </para>
+ <programlisting role="example"><![CDATA[
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+[xadj,iadj,v]=sp2adj(B)
+expected_xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+expected_adjncy = [2 5 2 3 1 2 7 6]';
+expected_anz = [3 7 5 3 6 5 2 3]';
+and(expected_xadj == xadj) // Should be %t
+and(expected_adjncy == iadj) // Should be %t
+and(expected_anz == v) // Should be %t
+ ]]></programlisting>
+ <para>
+ In the following example, we check that the sp2adj and adj2sp functions
+ are inverse.
+ </para>
+ <programlisting role="example"><![CDATA[
+// Templates for the Solution of Algebraic Eigenvalue Problems: a Practical Guide
+// Edited by Zhaojun Bai, James Demmel, Jack Dongarra, Axel Ruhe, and Henk van der Vorst
+// "Sparse Matrix Storage Formats", J. Dongarra
+// http://web.eecs.utk.edu/~dongarra/etemplates/book.html
+
+A = [
+10 0 0 0 -2 0
+3 9 0 0 0 3
+0 7 8 7 0 0
+3 0 8 7 5 0
+0 8 0 9 9 13
+0 4 0 0 2 -1
+];
+A = sparse(A)
+
+// To get the Compressed Sparse Column (CSC) :
+[col_ptr,row_ind,val]=sp2adj(A)
+// To convert back to sparse:
+AAsp=adj2sp(col_ptr,row_ind,val)
+// Check the conversion
+AAsp - A
+
+// To get the Compressed Sparse Row (CSR) :
+[row_ptr,col_ind,val]=sp2adj(A')
+// To convert back to sparse:
+AAsp=adj2sp(row_ptr,col_ind,val)'
+// Check the conversion
+AAsp - A
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="adj2sp">adj2sp</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="spcompack">spcompack</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+ <refsection>
+ <title>References</title>
+ <para>
+ "Implementation of Lipsol in Scilab", Hector E. Rubio Scola, INRIA, Decembre 1997, Rapport Technique No 0215
+ </para>
+ <para>
+ "Solving Large Linear Optimization Problems with Scilab : Application to Multicommodity Problems", Hector E. Rubio Scola, Janvier 1999, Rapport Technique No 0227
+ </para>
+ <para>
+ "Toolbox Scilab : Detection signal design for failure detection and isolation for linear dynamic systems User's Guide", Hector E. Rubio Scola, 2000, Rapport Technique No 0241
+ </para>
+ <para>
+ "Computer Solution of Large Sparse Positive Definite Systems", A. George, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981.
+ </para>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/sparse.xml b/modules/sparse/help/en_US/sparseconvert/sparse.xml
new file mode 100755
index 000000000..6f9aec111
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/sparse.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="sparse">
+ <refnamediv>
+ <refname>sparse</refname>
+ <refpurpose>sparse matrix definition</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>sp=sparse(X)
+ sp=sparse(ij,v [,mn])
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>real or complex or boolean full (or sparse) matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ij</term>
+ <listitem>
+ <para>two columns integer matrix (indices of non-zeros entries)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>integer vector with two entries (row-dimension, column-dimension)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sparse</literal> is used to build a sparse matrix. Only non-zero entries
+ are stored.
+ </para>
+ <para>
+ <literal>sp = sparse(X)</literal> converts a full matrix to sparse form by
+ squeezing out any zero elements. (If <literal>X</literal> is already sparse
+ <literal>sp</literal> is <literal>X</literal>).
+ </para>
+ <para>
+ <literal>sp=sparse(ij,v [,mn])</literal> builds an <literal>mn(1)</literal>-by-<literal>mn(2)</literal>
+ sparse matrix with <literal>sp(ij(k,1),ij(k,2))=v(k)</literal>.
+ <literal>ij</literal> and <literal>v</literal> must have the same column dimension.
+ If optional <literal>mn</literal> parameter is not given the <literal>sp</literal>
+ matrix dimensions are the max value of <literal>ij(:,1)</literal> and <literal>ij(:,2)</literal>
+ respectively.
+ </para>
+ <para>
+ Operations (concatenation, addition, etc,) with sparse matrices are
+ made using the same syntax as for full matrices.
+ </para>
+ <para>
+ Elementary functions are also available (<literal>abs,maxi,sum,diag,...</literal>)
+ for sparse matrices.
+ </para>
+ <para>
+ Mixed operations (full-sparse) are allowed. Results are full or sparse
+ depending on the operations.
+ </para>
+ <para>
+ Note : Any operation involing dense matrices of the same size, either as argument (e.g. <literal>sp=sparse(d)</literal>)
+ or as result (e.g. <literal>d= sp + 1.</literal>) is provided for convenience purposes but should of course be avoided.
+ Furthermore, random access to elements (<literal>sp(r,c)</literal>), especially for insertions, is not efficient, so
+ any performance-constrained access should be done in batches with <link linkend="spget">spget</link> for read access
+ and the three arguments constructor <literal>sp=sparse(ij, v, mn)</literal> for write access.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+size(sp)
+x=rand(2,2);abs(x)-full(abs(sparse(x)))
+// sparse constructor taking a single dense matrix
+// removes the zeros.
+dense=[0., 1., 0., 0., 0.,
+1., 0., 2., 0., 0.
+0., 0., 0., 0., 0.
+0., 0., 0., 0., -0.5];
+sp=sparse(dense)
+// complex matrices are also supported
+sp=sparse(dense*(1+2*%i))
+// for boolean matrices, the boolean sparse matrix
+// only stores true values (and removes false values).
+dense=[%F, %F, %T, %F, %F
+%T, %F, %F, %F, %F
+%F, %F, %F, %F, %F
+%F, %F, %F, %F, %T];
+sp=sparse(dense)
+
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/spcompack.xml b/modules/sparse/help/en_US/sparseconvert/spcompack.xml
new file mode 100755
index 000000000..13deb634c
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/spcompack.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="spcompack">
+ <refnamediv>
+ <refname>spcompack</refname>
+ <refpurpose>converts a compressed adjacency representation</refpurpose>
+ </refnamediv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para> integer vector of length (n+1).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>xlindx</term>
+ <listitem>
+ <para> integer vector of length n+1 (pointers).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>lindx</term>
+ <listitem>
+ <para> integer vector</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>adjncy</term>
+ <listitem>
+ <para> integer vector</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <programlisting role=""><![CDATA[
+Utility fonction spcompak is used to convert a compressed adjacency
+representation into standard adjacency representation.
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+// A is the sparse matrix:
+A=[1,0,0,0,0,0,0;
+ 0,1,0,0,0,0,0;
+ 0,0,1,0,0,0,0;
+ 0,0,1,1,0,0,0;
+ 0,0,1,1,1,0,0;
+ 0,0,1,1,0,1,0;
+ 0,0,1,1,0,1,1];
+A=sparse(A);
+//For this matrix, the standard adjacency representation is given by:
+xadj=[1,2,3,8,12,13,15,16];
+adjncy=[1, 2, 3,4,5,6,7, 4,5,6,7, 5, 6,7, 7];
+//(see sp2adj).
+// increments in vector xadj give the number of non zero entries in each column
+// ie there is 2-1=1 entry in the column 1
+// there is 3-2=1 entry in the column 2
+// there are 8-3=5 entries in the column 3
+// 12-8=4 4
+//etc
+//The row index of these entries is given by the adjncy vector
+// for instance,
+// adjncy (3:7)=adjncy(xadj(3):xadj(4)-1)=[3,4,5,6,7]
+// says that the 5=xadj(4)-xadj(3) entries in column 3 have row
+// indices 3,4,5,6,7.
+//In the compact representation, the repeated sequences in adjncy
+//are eliminated.
+//Here in adjncy the sequences 4,5,6,7 and 7 are eliminated.
+//The standard structure (xadj,adjncy) takes the compressed form (lindx,xlindx)
+lindx=[1, 2, 3,4,5,6,7, 5, 6,7];
+xlindx=[1,2,3,8,9,11];
+//(Columns 4 and 7 of A are eliminated).
+//A can be reconstructed from (xadj,xlindx,lindx).
+[xadj,adjncy,anz]= sp2adj(A);
+adjncy-spcompack(xadj,xlindx,lindx)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sp2adj">sp2adj</link>
+ </member>
+ <member>
+ <link linkend="adj2sp">adj2sp</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/en_US/sparseconvert/spget.xml b/modules/sparse/help/en_US/sparseconvert/spget.xml
new file mode 100755
index 000000000..20cb9db9d
--- /dev/null
+++ b/modules/sparse/help/en_US/sparseconvert/spget.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="spget">
+ <refnamediv>
+ <refname>spget</refname>
+ <refpurpose>retrieves entries of sparse matrix</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Calling Sequence</title>
+ <synopsis>[ij,v,mn]=spget(sp)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>real, complex or boolean sparse matrix</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ij</term>
+ <listitem>
+ <para>two columns integer matrix (indices of non-zeros or true entries)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>integer vector with two entries (row-dimension, column-dimension)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>column vector</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>spget</literal> is used to convert the internal representation of sparse
+ matrices into the standard <literal>ij, v</literal> representation.
+ </para>
+ <para>
+ Non zero entries (or entries set to true for a boolean sparse matrix) of <literal>sp</literal> are located in rows and columns
+ with indices in <literal>ij</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+[ij,v,mn]=spget(sp);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>See Also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/addchapter.sce b/modules/sparse/help/fr_FR/addchapter.sce
new file mode 100755
index 000000000..5744e12ad
--- /dev/null
+++ b/modules/sparse/help/fr_FR/addchapter.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+add_help_chapter("Matrices creuses",SCI+"/modules/sparse/help/fr_FR",%T);
+
diff --git a/modules/sparse/help/fr_FR/chfact.xml b/modules/sparse/help/fr_FR/chfact.xml
new file mode 100755
index 000000000..67b1eb75d
--- /dev/null
+++ b/modules/sparse/help/fr_FR/chfact.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="chfact">
+ <refnamediv>
+ <refname>chfact</refname>
+ <refpurpose>Factorisation de Cholesky creuse </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>spcho=chfact(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>A </term>
+ <listitem>
+ <para>matrice creuse réelle ou complexe
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>spcho </term>
+ <listitem>
+ <para>liste contenant les facteurs de Cholesky
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ Si <literal>A</literal> est creuse et hermitienne (symétrique dans le cas réel) définie positive, <literal>spcho=chfact(A)</literal> calcule les facteurs de sa factorisation de Cholesky.
+ Cette fonction est basée sur le programme Ng-Peyton (ORNL). Voir le programme Fortran pour une description complète des variables de la liste <literal>spcho</literal>. Cette fonction est à utiliser conjointement avec <literal>chsolve</literal>.
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chsolve">chsolve</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/chsolve.xml b/modules/sparse/help/fr_FR/chsolve.xml
new file mode 100755
index 000000000..6b054fcde
--- /dev/null
+++ b/modules/sparse/help/fr_FR/chsolve.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="chsolve">
+ <refnamediv>
+ <refname>chsolve</refname>
+ <refpurpose>solveur de Cholesky creux </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>sol=chsolve(spcho,rhs)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>spcho </term>
+ <listitem>
+ <para>liste contenant les facteurs de Cholesky renvoyés par chfact
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rhs, sol </term>
+ <listitem>
+ <para>vecteurs
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sol=chsolve(spcho,rhs)</literal> calcule la solution de
+ <literal>rhs=A*sol</literal>, où <literal>A</literal> est une matrice symétrique
+ définie positive. Cette fonction est basée sur le programme Ng-Peyton
+ (ORNL). Voir le programme Fortran pour une description complète des
+ variables de la liste <literal>spcho</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+spcho=chfact(A);
+sol=(1:20)';rhs=A*sol;
+spcho=chfact(A);
+chsolve(spcho,rhs)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chfact">chfact</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/decomposition/CHAPTER b/modules/sparse/help/fr_FR/decomposition/CHAPTER
new file mode 100755
index 000000000..41ee03202
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/CHAPTER
@@ -0,0 +1 @@
+title = Décompositions Creuses
diff --git a/modules/sparse/help/fr_FR/decomposition/ludel.xml b/modules/sparse/help/fr_FR/decomposition/ludel.xml
new file mode 100755
index 000000000..8ed809f20
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/ludel.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="ludel">
+ <refnamediv>
+ <refname>ludel</refname>
+ <refpurpose>libération de la mémoire allouée à des facteurs LU creux </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>ludel(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand </term>
+ <listitem>
+ <para>pointeur vers des facteurs L,U creux déjà calculés (sortie de lufact)
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ Cette fonction est à utiliser conjointement avec <literal>lufact</literal>. Elle libère la mémoire allouée pour le stockage des facteurs L,U creux renvoyés par <literal>lufact</literal>.
+ </para>
+ <para>
+ La suite de commandes <literal>[p,r]=lufact(A);x=lusolve(p,b);ludel(p);</literal>
+ résout le système linéaire creux <literal>A*x = b</literal> et libère les facteurs creux dont <literal>p</literal> est le pointeur.
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/decomposition/lufact.xml b/modules/sparse/help/fr_FR/decomposition/lufact.xml
new file mode 100755
index 000000000..21a82f726
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/lufact.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="lufact">
+ <refnamediv>
+ <refname>lufact</refname>
+ <refpurpose>factorisation LU d'une matrice creuse </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>[hand,rk]=lufact(A,prec)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>A </term>
+ <listitem>
+ <para>matrice réelle carrée creuse
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand </term>
+ <listitem>
+ <para>pointeur vers des facteurs L,U creux
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rk </term>
+ <listitem>
+ <para>entier (rang de A)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>prec </term>
+ <listitem>
+ <para>
+ vecteur à 2 composantes <literal>prec=[eps,reps]</literal> (tolérances absolue et relative).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[hand,rk]=lufact(A)</literal> calcule la factorisation LU d'une matrice creuse <literal>A</literal>.
+ <literal>hand</literal> (variable non affichable) est utilisé par <literal>lusolve</literal> (pour la résolution d'un système linéaire Ax=B) et <literal>luget</literal> (pour récupérer L et U à partir du pointeur <literal>hand</literal>).
+ <literal>hand</literal> doit être détruit après utilisation (par luget ou lusolve) : <literal>ludel(hand)</literal>;
+ </para>
+ <para>
+ La matrice A n'est pas obligatoirement de rang plein mais doit être carrée
+ (puisque A est supposée creuse on peut lui ajouter des lignes ou des colonnes nulles pour la rendre carrée).
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>eps :</term>
+ <listitem>
+ <para>
+ La valeur absolue qu'un élément de A doit avoir pour être utilisé comme pivot, sauf éventuellement en dernier recours. Ce nombre doit être significativement plus petit que le plus petit élément diagonal attendu dans la matrice. La valeur par défaut est <literal>%eps</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>reps :</term>
+ <listitem>
+ <para>
+ Ce nombre donne le seuil relatif pour les pivots. Il doit être compris entre zéro et un. S'il vaut un, la méthode se comporte comme un pivot total, qui est très lent et qui a tendance à remplir la matrice. S'il est proche de zéro, la méthode de pivotage est de type Markowitz stricte sans utilisation de seuil. Ce seuil est utilisé pour éliminer les pivots qui causeraient une croissance excessive des termes de la matrice. La croissance des éléments est source d'erreurs d'arrondi, et peut avoir lieu même si la matrice est bien conditionnée. Prendre reps grand réduit cette croissance excessive, et donc les erreurs d'arrondi, mais le prendre trop grand risque d'augmenter le temps d'exécution, ainsi que le remplissage de la matrice. La précision peut donc ainsi être dégradée à cause du nombre élevé d'opérations à effectuer à cause du remplissage. Une valeur correcte semble être 0.001 qui est la valeur par défaut (cette valeur par défaut est aussi utilisée si reps&gt;1 ou reps&lt;0). Cette valeur doit être augmentée et la factorisation doit être recommencée si la croissance s'avère trop importante. Changer le seuil sur les pivots n'améliore pas les performances pour les matrices où la croissance est faible, comme c'est souvent le cas pour les matrices mal conditionnées. La valeur par défaut de reps a été choisie pour un usage de lufact avec des matrices à diagonale à peu près dominante (matrices provenant de problèmes de type éléments finis). Pour ces matrices un pivotage diagonal donne les meilleurs résultats. Pour les matrices à diagonale non dominante, on obtient de meilleurs résultats en prenant un seuil plus élevé, comme 0.01 ou 0.1.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,5);b=rand(5,1);A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);a*x-b
+ludel(h)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/decomposition/luget.xml b/modules/sparse/help/fr_FR/decomposition/luget.xml
new file mode 100755
index 000000000..68076a9cb
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/luget.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="luget">
+ <refnamediv>
+ <refname>luget</refname>
+ <refpurpose>extraction de facteurs LU creux </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>[P,L,U,Q]=luget(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand </term>
+ <listitem>
+ <para>pointeur vers des facteurs L,U creux déjà calculés (sortie de lufact)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P </term>
+ <listitem>
+ <para>matrice de permutation (creuse)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>L </term>
+ <listitem>
+ <para>
+ matrice creuse, triangulaire inférieure si <literal>hand</literal> provient de la factorisation d'une matrice régulière.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>U </term>
+ <listitem>
+ <para>matrice carrée creuse, régulière, triangulaire supérieure à diagonale unité.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Q </term>
+ <listitem>
+ <para>matrice de permutation (creuse)
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[P,L,U,Q]=luget(hand)</literal> avec <literal>hand</literal> obtenue avec la commande <literal>[hand,rk]=lufact(A)</literal> avec <literal>A</literal> une matrice creuse, renvoie quatre matrices P,L,U,Q telles que <literal>P*L*U*Q=A</literal>.
+ </para>
+ <para>
+ La matrice A n'est pas obligatoirement de rang plein mais doit être carrée
+ (puisque A est supposée creuse on peut lui ajouter des lignes ou des colonnes nulles pour la rendre carrée).
+ </para>
+ <para>
+ Si <literal>A</literal> est singulière, la matrice <literal>L</literal> est à colonnes compressées (avec
+ <literal>rk</literal> colonnes indépendantes non nulles) : la matrice creuse régulière
+ <literal>Q'*inv(U)</literal> compresse les colonnes de <literal>A</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,2)*rand(2,5);A=sparse(a);
+[hand,rk]=lufact(A);[P,L,U,Q]=luget(hand);
+full(L), P*L*U*Q-A
+clean(P*L*U*Q-A)
+ludel(hand)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="clean">clean</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/decomposition/lusolve.xml b/modules/sparse/help/fr_FR/decomposition/lusolve.xml
new file mode 100755
index 000000000..e9fc2fe80
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/lusolve.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="lusolve">
+ <refnamediv>
+ <refname>lusolve</refname>
+ <refpurpose>solveur de système linéaire creux </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>x=lusolve(hand,b)
+ x=lusolve(A,b)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>matrice réelle pleine
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matrice réelle carrée creuse inversible
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>pointeur vers des facteurs L,U creux déjà calculés (sortie de lufact)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>matrice réelle pleine</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>x=lusolve(hand,b)</literal> résout le système linéaire
+ <literal>A*x = b</literal>, où <literal>hand</literal> est obtenu par un appel
+ préliminaire à <literal>lufact</literal> :<literal>[hand,rk]=lufact(A)</literal>.
+ </para>
+ <para>
+ <literal>x=lusolve(A,b)</literal> résout le système linéaire creux
+ <literal>A*x = b</literal>
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);x=lusolve(h,[1;1;1;1]);ludel(h)
+rk,sp*x
+
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+x=lusolve(sp,-ones(4,1));
+sp*x
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="slash">slash</link>
+ </member>
+ <member>
+ <link linkend="backslash">backslash</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/decomposition/spchol.xml b/modules/sparse/help/fr_FR/decomposition/spchol.xml
new file mode 100755
index 000000000..6a74c4fc7
--- /dev/null
+++ b/modules/sparse/help/fr_FR/decomposition/spchol.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="spchol">
+ <refnamediv>
+ <refname>spchol</refname>
+ <refpurpose>Factorisation de Cholesky creuse</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>[R,P] = spchol(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matrice creuse réelle symétrique et définie positive.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P</term>
+ <listitem>
+ <para> matrice de permutation
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>R</term>
+ <listitem>
+ <para> facteur de Cholesky
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>[R,P] = spchol(X)</literal> produit une matrice triangulaire inférieure <literal>R</literal> telle que <literal>P*R*R'*P' = X</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+// Factorisation:
+Xfull = [
+3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0.
+0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0.
+0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0.
+2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0.
+0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4.
+0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0.
+0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+X = sparse(Xfull);
+
+[R, P] = spchol(X);
+max(P*R*R'*P'-X)
+
+// Factorisation puis résolution avec l'opérateur '\':
+Afull = [
+2 -1 0 0 0;
+-1 2 -1 0 0;
+0 -1 2 -1 0;
+0 0 -1 2 -1;
+0 0 0 -1 2
+];
+A = sparse(Afull);
+
+[L, P] = spchol(A);
+max(P*L*L'*P'-A)
+
+n = size(A, "r"); e = (1:n)'; b = A * e;
+x = P*(L'\(L\(P'*b)));
+A*x-b
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="chol">chol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/matrixmanip/CHAPTER b/modules/sparse/help/fr_FR/matrixmanip/CHAPTER
new file mode 100755
index 000000000..7a8eeab21
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/CHAPTER
@@ -0,0 +1 @@
+title = Manipulation des Matrices Creuses
diff --git a/modules/sparse/help/fr_FR/matrixmanip/nnz.xml b/modules/sparse/help/fr_FR/matrixmanip/nnz.xml
new file mode 100755
index 000000000..89d92c41f
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/nnz.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="nnz">
+ <refnamediv>
+ <refname>nnz</refname>
+ <refpurpose>nombre de termes non nuls dans une matrice </refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>n=nnz(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>X </term>
+ <listitem>
+ <para>matrice réelle ou complexe (pleine ou creuse)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>n </term>
+ <listitem>
+ <para>entier, le nombre de termes non nuls
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>nnz</literal> compte le nombre de termes non nuls dans une matrice pleine ou creuse.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3]);
+nnz(sp)
+a=[1 0 0 0 2];
+nnz(a)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/matrixmanip/speye.xml b/modules/sparse/help/fr_FR/matrixmanip/speye.xml
new file mode 100755
index 000000000..191953450
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/speye.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="speye" xml:lang="fr">
+ <refnamediv>
+ <refname>speye</refname>
+ <refpurpose>matrice identité creuse</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>Isp=speye(nrows,ncols)
+ Isp=speye(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>entier (nombre de lignes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>entier (nombre de colonnes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matrice creuse</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matrice identité creuse</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>Isp=speye(nrows,ncols)</literal> renvoie une matrice
+ identité creuse <literal>Isp</literal> avec <literal>nrows</literal>
+ lignes et <literal>ncols</literal> colonnes.
+ </para>
+ <para>
+ <literal>Isp=speye(A)</literal> renvoie une matrice identité creuse
+ de même taille que <literal>A</literal>. Si
+ <literal>[m,n]=size(A)</literal>, les commandes
+ <literal>speye(m,n)</literal> et <literal>speye(A)</literal> sont
+ équivalentes. En particulier <literal>speye(3)</literal> n'est pas
+ équivalent à <literal>speye(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+eye(3,3)-full(speye(3,3))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/matrixmanip/spones.xml b/modules/sparse/help/fr_FR/matrixmanip/spones.xml
new file mode 100755
index 000000000..31f894370
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/spones.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spones" xml:lang="fr">
+ <refnamediv>
+ <refname>spones</refname>
+ <refpurpose>matrice creuse dont les termes valent 1</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>sp = spones(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matrice creuse</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matrice creuse</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=spones(A)</literal> génère une matrice creuse de même
+ structure que <literal>A</literal>, mais où les termes non-nuls ont été
+ remplacés par la valeur 1.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(10,12,0.1);
+sp=spones(A)
+B = A~=0
+bool2s(B)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/matrixmanip/sprand.xml b/modules/sparse/help/fr_FR/matrixmanip/sprand.xml
new file mode 100755
index 000000000..9ac2048f7
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/sprand.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sprand" xml:lang="fr">
+ <refnamediv>
+ <refname>sprand</refname>
+ <refpurpose>matrice creuse aléatoire</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>sp=sprand(nrows,ncols,fill [,typ])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>entier (nombre de lignes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>entier (nombre de colonnes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fill</term>
+ <listitem>
+ <para>coefficient de remplissage (densité)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>typ</term>
+ <listitem>
+ <para>
+ chaîne de caractères (<literal>'uniform'</literal> (par
+ défaut) ou <literal>'normal'</literal>)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matrice creuse</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=sprand(nrows,ncols,fill)</literal> renvoie une matrice
+ creuse <literal>sp</literal> avec <literal>nrows</literal> lignes,
+ <literal>ncols</literal> colonnes et approximativement
+ <literal>fill*nrows*ncols</literal> termes non-nuls.
+ </para>
+ <para>
+ Si <literal>typ='uniform'</literal> les termes non nuls suivent une
+ loi uniforme sur [0,1]. Si <literal>typ='normal'</literal> les termes non
+ nuls suivent une loi normale centrée réduite.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+W=sprand(100,1000,0.001);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="rand">rand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/fr_FR/matrixmanip/spzeros.xml b/modules/sparse/help/fr_FR/matrixmanip/spzeros.xml
new file mode 100755
index 000000000..cc4398e84
--- /dev/null
+++ b/modules/sparse/help/fr_FR/matrixmanip/spzeros.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spzeros" xml:lang="fr">
+ <refnamediv>
+ <refname>spzeros</refname>
+ <refpurpose>matrice creuse nulle</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Séquence d'appel</title>
+ <synopsis>sp = spzeros(nrows, ncols)
+ sp = spzeros(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Paramètres</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>entier (nombre de lignes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>entier (nombre de colonnes)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matrice creuse</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matrice creuse nulle</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Description</title>
+ <para>
+ <literal>sp=spzeros(nrows,ncols)</literal> renvoie une matrice
+ creuse nulle <literal>sp</literal> avec <literal>nrows</literal> lignes et
+ <literal>ncols</literal> colonnes (Équivalent à
+ <literal>sparse([],[],[nrow,ncols])</literal>).
+ </para>
+ <para>
+ <literal>sp=spzeros(A)</literal> renvoie une matrice creuse nulle de
+ mêmes dimensions que <literal>A</literal>. Si
+ <literal>[m,n]=size(A)</literal>, les commandes
+ <literal>spzeros(m,n)</literal> et <literal>spzeros(A)</literal> sont
+ équivalentes. En particulier <literal>spzeros(3)</literal> n'est pas
+ équivalent à <literal>spzeros(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <programlisting role="example"><![CDATA[
+m=spzeros(2,2)
+a=rand(10,12);
+m=spzeros(a)
+sum(spzeros(1000,1000))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/ja_JP/addchapter.sce b/modules/sparse/help/ja_JP/addchapter.sce
new file mode 100755
index 000000000..f63ec568a
--- /dev/null
+++ b/modules/sparse/help/ja_JP/addchapter.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+add_help_chapter("Sparses Matrix",SCI+"/modules/sparse/help/ja_JP",%T);
+
diff --git a/modules/sparse/help/ja_JP/chfact.xml b/modules/sparse/help/ja_JP/chfact.xml
new file mode 100755
index 000000000..867ce4744
--- /dev/null
+++ b/modules/sparse/help/ja_JP/chfact.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="chfact">
+
+ <refnamediv>
+
+ <refname>chfact</refname>
+
+ <refpurpose>疎行列ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>spcho=chfact(A)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>正方正定対称疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>spcho</term>
+
+ <listitem>
+
+ <para>コード形å¼ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã‚’å«ã‚€ãƒªã‚¹ãƒˆ</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>spcho=chfact(A)</literal> ã¯,
+
+ 正定対称行列ã¨ä»®å®šã—ã¦ç–Žè¡Œåˆ—<literal>A</literal>ã®
+
+ コレスキー分解を計算ã—ã¾ã™.
+
+ ã“ã®é–¢æ•°ã¯,Ng-Peyton プログラム (ORNL)ã«åŸºã¥ã„ã¦ã„ã¾ã™.
+
+ <literal>spcho</literal>ã®å¤‰æ•°ã®è©³ç´°ãªèª¬æ˜Žã«ã¤ã„ã¦ã¯,
+
+ Fortran プログラムをå‚ç…§ãã ã•ã„.
+
+ ã“ã®é–¢æ•°ã¯ <literal>chsolve</literal>ã¨å…±ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+chfact(A)
+
+sol=(1:20)';
+rhs=A*sol;
+chfact(A)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="chsolve">chsolve</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lufact">lufact</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spchol">spchol</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/chsolve.xml b/modules/sparse/help/ja_JP/chsolve.xml
new file mode 100755
index 000000000..8a95951ba
--- /dev/null
+++ b/modules/sparse/help/ja_JP/chsolve.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="chsolve">
+
+ <refnamediv>
+
+ <refname>chsolve</refname>
+
+ <refpurpose>疎行列ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼ã‚½ãƒ«ãƒ</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>sol=chsolve(spcho,rhs)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>spcho</term>
+
+ <listitem>
+
+ <para>chfact ã‹ã‚‰è¿”ã•ã‚ŒãŸã‚³ãƒ¼ãƒ‰å½¢å¼ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã‚’å«ã‚€ãƒªã‚¹ãƒˆ</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>rhs, sol</term>
+
+ <listitem>
+
+ <para>フル列ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>sol=chsolve(spcho,rhs)</literal> ã¯,
+
+ <literal>A</literal>を疎行列ã®æ­£å®šå¯¾ç§°è¡Œåˆ—ã¨ã—ã¦
+
+ <literal>rhs=A*sol</literal>ã®è§£ã‚’計算ã—ã¾ã™.
+
+ ã“ã®é–¢æ•°ã¯,Ng-Peyton プログラム (ORNL)ã«åŸºã¥ã„ã¦ã„ã¾ã™.
+
+ <literal>spcho</literal>ã®å¤‰æ•°ã®è©³ç´°ãªèª¬æ˜Žã«ã¤ã„ã¦ã¯,
+
+ Fortran プログラムをå‚ç…§ãã ã•ã„.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+spcho=chfact(A);
+sol=(1:20)';rhs=A*sol;
+spcho=chfact(A);
+chsolve(spcho,rhs)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="chfact">chfact</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lufact">lufact</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spchol">spchol</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/decomposition/CHAPTER b/modules/sparse/help/ja_JP/decomposition/CHAPTER
new file mode 100755
index 000000000..ccebc80d8
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Decompositions
diff --git a/modules/sparse/help/ja_JP/decomposition/ludel.xml b/modules/sparse/help/ja_JP/decomposition/ludel.xml
new file mode 100755
index 000000000..30ccb122d
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/ludel.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="ludel">
+
+ <refnamediv>
+
+ <refname>ludel</refname>
+
+ <refpurpose>lufactã§ä½¿ç”¨ã•ã‚Œã‚‹ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£é–¢æ•°</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>ludel(hand)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>hand</term>
+
+ <listitem>
+
+ <para>疎行列LU分解ã®ãƒãƒ³ãƒ‰ãƒ« (lufactã®å‡ºåŠ›)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ ã“ã®é–¢æ•°ã¯,<literal>lufact</literal>ã¨çµ„ã¿åˆã‚ã›ã¦ä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ ã“ã®é–¢æ•°ã¯,<literal>lufact</literal>ã®çµæžœã‚’ä¿å­˜ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã•ã‚Œã‚‹
+
+ 内部メモリ空間を消去ã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ 一連ã®ã‚³ãƒžãƒ³ãƒ‰,<literal>[p,r]=lufact(A);x=lusolve(p,b);ludel(p);</literal>
+
+ ã«ã‚ˆã‚Šç·šå½¢ç–Žè¡Œåˆ—システム<literal>A*x = b</literal>を解ã,
+
+ <literal>p</literal>を消去ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];
+rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);
+x=lusolve(h,[1;1;1;1]);
+ludel(h)
+rk,sp*x
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lufact">lufact</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/decomposition/lufact.xml b/modules/sparse/help/ja_JP/decomposition/lufact.xml
new file mode 100755
index 000000000..49e6e99c4
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/lufact.xml
@@ -0,0 +1,271 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="lufact">
+
+ <refnamediv>
+
+ <refname>lufact</refname>
+
+ <refpurpose>疎行列LU分解</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>[hand,rk]=lufact(A,prec)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>正方疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>hand</term>
+
+ <listitem>
+
+ <para>疎行列LU分解ã¸ã®ãƒãƒ³ãƒ‰ãƒ«</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>rk</term>
+
+ <listitem>
+
+ <para>æ•´æ•° (Aã®ãƒ©ãƒ³ã‚¯)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>prec</term>
+
+ <listitem>
+
+ <para>
+
+ 大ãã•2ã®ãƒ™ã‚¯ãƒˆãƒ«<literal>prec=[eps,reps]</literal>ã§,
+
+ 絶対ãŠã‚ˆã³ç›¸å¯¾é–¾å€¤ã‚’指定ã—ã¾ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>[hand,rk]=lufact(A)</literal>ã¯,
+
+ 疎行列<literal>A</literal>ã®LU分解を行ãªã„ã¾ã™.
+
+ <literal>hand</literal> (表示ã•ã‚Œã¾ã›ã‚“) ãŒ,
+
+ (線形システムを解ã)<literal>lusolve</literal>ãŠã‚ˆã³
+
+ (LU分解をå–å¾—ã™ã‚‹)<literal>luget</literal>ã§
+
+ 使用ã•ã‚Œã¾ã™.
+
+ <literal>hand</literal> ã¯ä»¥ä¸‹ã®ã‚³ãƒžãƒ³ãƒ‰ã«ã‚ˆã‚Šæ¶ˆåŽ»ã—ã¾ã™: <literal>ludel(hand)</literal>;
+
+ </para>
+
+ <para>
+
+ 行列Aã¯,フルランクã§ã‚ã‚‹å¿…è¦ã¯ã‚ã‚Šã¾ã›ã‚“ãŒ,正方ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™
+
+ (Aã¯ç–Žè¡Œåˆ—ã§ã‚ã‚‹ã¨ä»®å®šã•ã‚Œã‚‹ãŸã‚,å¿…è¦ã«å¿œã˜ã¦Aã®ä¸‹ã«æ­£æ–¹ã«ã™ã‚‹ãŸã‚ã®
+
+ ゼロを追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™).
+
+ </para>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>eps :</term>
+
+ <listitem>
+
+ <para>
+
+ 最終的ã«è¦ç´ ãŒãƒ”ボットã®å€™è£œã¨ã¿ãªã•ã‚Œã‚‹å¤§ãã•.
+
+ ã“ã®æ•°ã¯è¡Œåˆ—ã®ä¸­ã§å­˜åœ¨ã™ã‚‹ã¨æ€ã‚れる最もå°ã•ã„対角項よりも
+
+ è‘—ã—ãå°ã•ãªå€¤ã«è¨­å®šã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+
+ デフォルトã¯<literal>%eps</literal>ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>reps :</term>
+
+ <listitem>
+
+ <para>ã“ã®æ•°ã¯,ピãƒãƒƒãƒˆç›¸å¯¾é–¾å€¤ã‚’定義ã—ã¾ã™.
+
+ ã“ã®å€¤ã¯,0ã¨1ã®é–“ã¨ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+
+ 1ã®å ´åˆ,ピボットé¸æŠžã¯å®Œå…¨ãƒ”ボットé¸æŠžã¨ãªã‚Š,
+
+ éžå¸¸ã«é…ã,通常ã®è¡Œåˆ—ã«è¿‘ããªã‚‹ã¾ã§è¦ç´ ãŒåŸ‹ã‚られる
+
+ 傾å‘ãŒã‚ã‚Šã¾ã™. 0 ã«è¿‘ã„値を設定ã—ãŸå ´åˆ,
+
+ ピボットé¸æŠžã¯é–¾å€¤ãªã—ã®åŽ³å¯†ãªMarkowitz法ã¨ãªã‚Šã¾ã™.
+
+ ピボットã®é–¾å€¤ã¯ã“れらãŒä½¿ç”¨ã•ã‚ŒãŸå ´åˆã«ã¯
+
+ è¦ç´ ãŒå¢—加ã—ã™ãŽã‚‹ã‚ˆã†ãªãƒ”ボット候補を消去ã™ã‚‹éš›ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ è¦ç´ ã®å¢—加ãŒä¸¸ã‚誤差ã®åŽŸå› ã§ã™.
+
+ è¦ç´ ã®å¢—加ã¯æ¡ä»¶ã®è‰¯ã„行列ã«ãŠã„ã¦ã‚‚発生ã—ã¾ã™.
+
+ reps ã«å¤§ããªå€¤ã‚’設定ã™ã‚‹ã“ã¨ã§,
+
+ è¦ç´ ã®å¢—加ã¨ä¸¸ã‚誤差ãŒæ¸›å°‘ã—ã¾ã™ãŒ,
+
+ 大ãã™ãŽã‚‹å€¤ã‚’設定ã™ã‚‹ã¨å®Ÿè¡Œæ™‚é–“ãŒéŽå¤§ã¨ãªã‚Š,
+
+ 代入ã®æ•°ãŒéŽå¤§ã¨ãªã‚Šã¾ã™.
+
+ ã“ã®ã‚ˆã†ãªå ´åˆ,
+
+ 多ãã®ä»£å…¥ã«å¿…è¦ãªè¡Œåˆ—ã®æ“作ã®å›žæ•°ãŒå¤šããªã‚‹ãŸã‚,実際ã®
+
+ 精度ã¯ä½Žä¸‹ã—ã¾ã™.
+
+ 良ã„値㯠0.001 ã¨æ€ã‚ã‚Œ,ã“ã‚ŒãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã§ã™.
+
+ ã“ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã¯,1より大ãã„ã‹,0以下ã®å€¤ã‚’指定ã™ã‚‹ã“ã¨ã«ã‚ˆã‚Š
+
+ é¸æŠžã•ã‚Œã¾ã™.
+
+ ã“ã®å€¤ã¯,éŽåº¦ãªè¦ç´ æ•°ã®å¢—加ãŒèªã‚られãŸå ´åˆã«ã¯,
+
+ 増加ã•ã›,行列を決定ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+
+ ピボット閾値ã®å¤‰æ›´ã¯,è¦ç´ æ•°ã®å¢—加ãŒå°ã•ã„行列ã«ãŠã„ã¦ã¯,
+
+ æ¡ä»¶ãŒæ‚ªã„行列ã«ãŠã„ã¦æœŸå¾…ã•ã‚Œã‚‹ã‚ˆã†ãªæ€§èƒ½ã®æ”¹å–„効果を,
+
+ å¾—ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“.
+
+ reps ã¯, ノードãŠã‚ˆã³ä¿®æ­£ãƒŽãƒ¼ãƒ‰ã‚¢ãƒ‰ãƒŸã‚¿ãƒ³ã‚¹è¡Œåˆ—ã®ã‚ˆã†ãª
+
+ 近似的ã«å¯¾è§’優ä½ã®è¡Œåˆ—ã§ä½¿ç”¨ã™ã‚‹ã‚ˆã†ã«é¸æŠžã•ã‚Œã¦ã„ã¾ã™.
+
+ ã“れらã®è¡Œåˆ—ã§ã¯,通常ã¯å¯¾è§’ピボットé¸æŠžã‚’使用ã™ã‚‹ã®ãŒæœ€è‰¯ã§ã™.
+
+ 大ããªå¯¾è§’é …ãŒãªã„行列ã®å ´åˆã¯,
+
+ 通常ã¯0.01ã¾ãŸã¯0.1ã®ã‚ˆã†ãªã‚ˆã‚Šå¤§ããªé–¾å€¤ã‚’使用ã™ã‚‹ã®ãŒæœ€å–„ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+a=rand(5,5);b=rand(5,1);A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);a*x-b
+ludel(h)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lusolve">lusolve</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/decomposition/luget.xml b/modules/sparse/help/ja_JP/decomposition/luget.xml
new file mode 100755
index 000000000..c5a2b3943
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/luget.xml
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="luget">
+
+ <refnamediv>
+
+ <refname>luget</refname>
+
+ <refpurpose>疎行列LU分解ã®å±•é–‹</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>[P,L,U,Q]=luget(hand)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>hand</term>
+
+ <listitem>
+
+ <para>
+
+ ãƒãƒ³ãƒ‰ãƒ«, <literal>lufact</literal>ã®å‡ºåŠ›
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>P</term>
+
+ <listitem>
+
+ <para>疎交æ›è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>L</term>
+
+ <listitem>
+
+ <para>
+
+ 疎行列, lower triangular if <literal>hand</literal>ãŒ
+
+ 正則行列ã‹ã‚‰å¾—られãŸå ´åˆã¯ä¸Šä¸‰è§’
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>U</term>
+
+ <listitem>
+
+ <para>正方正則上三角疎行列(主対角項ã¯1)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>Q</term>
+
+ <listitem>
+
+ <para>疎交æ›è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ 疎行列 <literal>A</literal>ã«é–¢ã—ã¦
+
+ コマンド<literal>[hand,rk]=lufact(A)</literal>ã«ã‚ˆã‚Šå¾—られãŸ
+
+ <literal>hand</literal>を指定ã™ã‚‹ã¨,<literal>[P,L,U,Q]=luget(hand)</literal>
+
+ ã¯,<literal>P*L*U*Q=A</literal>ã¨ãªã‚‹ã‚ˆã†ãª4ã¤ã®ç–Žè¡Œåˆ—ã‚’è¿”ã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ 行列Aã¯ãƒ•ãƒ«ãƒ©ãƒ³ã‚¯ã§ã‚ã‚‹å¿…è¦ã¯ã‚ã‚Šã¾ã›ã‚“ãŒæ­£æ–¹è¡Œåˆ—ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™
+
+ (Aã¯ç–Žè¡Œåˆ—ã¨ä»®å®šã•ã‚Œã‚‹ãŸã‚,正方化ã™ã‚‹ãŸã‚ã«å¿…è¦ã«å¿œã˜ã¦0を追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™).
+
+ </para>
+
+ <para>
+
+ <literal>A</literal>ãŒæ­£å‰‡ã§ãªã„å ´åˆ,
+
+ 行列<literal>L</literal>ã¯(<literal>rk</literal>個ã®
+
+ 独立ã—ãŸéžã‚¼ãƒ­åˆ—ã«ã¤ã„ã¦)列圧縮ã•ã‚Œã¾ã™
+
+ 正則ãªç–Žè¡Œåˆ— <literal>Q'*inv(U)</literal> ã¯
+
+ <literal>A</literal>を列圧縮ã—ã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+a=rand(5,2)*rand(2,5);A=sparse(a);
+[hand,rk]=lufact(A);[P,L,U,Q]=luget(hand);
+full(L), P*L*U*Q-A
+clean(P*L*U*Q-A)
+ludel(hand)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lusolve">lusolve</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="clean">clean</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/decomposition/lusolve.xml b/modules/sparse/help/ja_JP/decomposition/lusolve.xml
new file mode 100755
index 000000000..a0befa06e
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/lusolve.xml
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="lusolve">
+
+ <refnamediv>
+
+ <refname>lusolve</refname>
+
+ <refpurpose>ç–Žãªç·šå½¢ã‚·ã‚¹ãƒ†ãƒ ã®è§£ã‚’å¾—ã‚‹</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>x=lusolve(hand,b)
+
+ x=lusolve(A,b)
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>b</term>
+
+ <listitem>
+
+ <para>通常ã®å®Ÿæ•°è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>å¯é€†ãªå®Ÿæ•°æ­£æ–¹ç–Žè¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>hand</term>
+
+ <listitem>
+
+ <para>疎行列LU分解を計算ã—ãŸéš›ã®ãƒãƒ³ãƒ‰ãƒ«(lufactã®å‡ºåŠ›)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>x</term>
+
+ <listitem>
+
+ <para>通常ã®å®Ÿæ•°è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>x=lusolve(hand,b)</literal> ã¯ç–Žãªç·šå½¢ã‚·ã‚¹ãƒ†ãƒ 
+
+ <literal>A*x = b</literal>を解ãã¾ã™.
+
+ </para>
+
+ <para>
+
+ <literal>[hand,rk]=lufact(A)</literal> 㯠lufact ã®å‡ºåŠ›ã§ã™.
+
+ </para>
+
+ <para>
+
+ <literal>x=lusolve(A,b)</literal>ã¯,ç–Žãªç·šå½¢ã‚·ã‚¹ãƒ†ãƒ 
+
+ <literal>A*x = b</literal>を解ãã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);x=lusolve(h,[1;1;1;1]);ludel(h)
+rk,sp*x
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+x=lusolve(sp,-ones(4,1));
+sp*x
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lufact">lufact</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="slash">slash</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="backslash">backslash</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/decomposition/spchol.xml b/modules/sparse/help/ja_JP/decomposition/spchol.xml
new file mode 100755
index 000000000..f9369d81b
--- /dev/null
+++ b/modules/sparse/help/ja_JP/decomposition/spchol.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="spchol">
+
+ <refnamediv>
+
+ <refname>spchol</refname>
+
+ <refpurpose>疎行列コレスキー分解</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>[R,P] = spchol(X)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>X</term>
+
+ <listitem>
+
+ <para>対称正定実疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>P</term>
+
+ <listitem>
+
+ <para>順列行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>R</term>
+
+ <listitem>
+
+ <para>コレスキー分解</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>[R,P] = spchol(X)</literal> ã¯,
+
+ <literal>P*R*R'*P' = X</literal>ã¨ãªã‚‹ã‚ˆã†ãª
+
+ 上三角行列<literal>R</literal> を出力ã—ã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+// Factorization:
+Xfull = [
+3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0.
+0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0.
+0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0.
+2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0.
+0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4.
+0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0.
+2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0.
+0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0.
+0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+X = sparse(Xfull);
+
+[R, P] = spchol(X);
+max(P*R*R'*P'-X)
+
+// Factorization and solve with backslash operator:
+Afull = [
+2 -1 0 0 0;
+-1 2 -1 0 0;
+0 -1 2 -1 0;
+0 0 -1 2 -1;
+0 0 0 -1 2
+];
+A = sparse(Afull);
+
+[L, P] = spchol(A);
+max(P*L*L'*P'-A)
+
+n = size(A, "r"); e = (1:n)'; b = A * e;
+x = P*(L'\(L\(P'*b)));
+A*x-b
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lusolve">lusolve</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="luget">luget</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="chol">chol</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/iterativesolvers/CHAPTER b/modules/sparse/help/ja_JP/iterativesolvers/CHAPTER
new file mode 100755
index 000000000..c59edd550
--- /dev/null
+++ b/modules/sparse/help/ja_JP/iterativesolvers/CHAPTER
@@ -0,0 +1 @@
+title = Linear Equations (Iterative Solvers)
diff --git a/modules/sparse/help/ja_JP/iterativesolvers/conjgrad.xml b/modules/sparse/help/ja_JP/iterativesolvers/conjgrad.xml
new file mode 100755
index 000000000..a8c61a1bb
--- /dev/null
+++ b/modules/sparse/help/ja_JP/iterativesolvers/conjgrad.xml
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="conjgrad" xml:lang="ja">
+ <refnamediv>
+ <refname>conjgrad</refname>
+ <refpurpose>共役勾é…ソルãƒ</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>呼ã³å‡ºã—手順</title>
+ <synopsis>
+ [x, flag, err, iter, res] = conjgrad(A, b [, method [, tol [, maxIter [, M [, M2 [, x0 [, verbose]]]]]]])
+ [x, flag, err, iter, res] = conjgrad(A, b [, method [, key=value,...]])
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>引数</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <term/>
+ <listitem>
+ <para>
+ 指令ã—ãŸå„<literal>x</literal>ã«ã¤ã„ã¦<literal>A*x</literal>を計算ã™ã‚‹
+ 行列ã¾ãŸã¯é–¢æ•°ã¾ãŸã¯ãƒªã‚¹ãƒˆ.
+ Aã®ãã‚Œãžã‚Œã®åž‹ã«é–¢ã™ã‚‹ A*x ã®è¨ˆç®—ã«é–¢ã—ã¦ä»¥ä¸‹ã«ç¤ºã—ã¾ã™.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>行列.</literal>AãŒè¡Œåˆ—ã®å ´åˆ, 通常ã¾ãŸã¯ç–Žè¡Œåˆ—ãŒä½¿ç”¨å¯èƒ½
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>関数.</literal>AãŒé–¢æ•°ã®å ´åˆ, 以下ã®ãƒ˜ãƒƒãƒ€ã‚’有ã™ã‚‹
+ å¿…è¦ãŒã‚ã‚Šã¾ã™ :
+ </para>
+ <programlisting role=""><![CDATA[
+function y = A ( x )
+ ]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>リスト.</literal>AãŒãƒªã‚¹ãƒˆã®å ´åˆ,
+ リストã®æœ€åˆã®è¦ç´ ã«ã¯é–¢æ•°ã‚’指定ã—,
+ 添字2ã‹ã‚‰æœ€å¾Œã¾ã§ã®ãƒªã‚¹ãƒˆã®ä»–ã®è¦ç´ ã«ã¯é–¢æ•°ã®å¼•æ•°ã‚’指定ã—ã¾ã™.
+ ã“ã®é–¢æ•°ãŒã‚³ãƒ¼ãƒ«ã•ã‚ŒãŸéš›,
+ xã®ã‚«ãƒ¬ãƒ³ãƒˆã®å€¤ãŒé–¢æ•°ã®æœ€åˆã®å¼•æ•°ã«æŒ‡å®šã•ã‚Œ,
+ ãã®ä»–ã®å¼•æ•°ã«ã¯ãƒªã‚¹ãƒˆã§æŒ‡å®šã•ã‚ŒãŸã‚‚ã®ãŒæŒ‡å®šã•ã‚Œã¾ã™.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>å³è¾ºãƒ™ã‚¯ãƒˆãƒ« (大ãã•: nx1)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mehtod</term>
+ <listitem>
+ <para>スカラー文字列, "pcg", "cgs", "bicg" ã¾ãŸã¯ "bicgstab" (デフォルト "bicgstab")</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>tol</term>
+ <listitem>
+ <para>相対許容誤差 (デフォルト: 1e-8).
+ 終了基準ã¯æ®‹å·® r=b-Ax ã®äºŒä¹—ノルムをå³è¾º b ã®äºŒä¹—ノルムã§å‰²ã£ãŸã‚‚ã®ã«
+ 基ã¥ãã¾ã™.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>maxIter</term>
+ <listitem>
+ <para>最大å復回数 (デフォルト: n)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M</term>
+ <listitem>
+ <para>プリコンディショナ: 通常ã¾ãŸã¯ç–Žè¡Œåˆ—ã¾ãŸã¯
+ <literal>M\x</literal> ã‚’è¿”ã™é–¢æ•° (デフォルト: none)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>M2</term>
+ <listitem>
+ <para>
+ プリコンディショナ: 通常ã¾ãŸã¯ç–Žè¡Œåˆ—ã¾ãŸã¯å„<literal>x</literal>ã®
+ <literal>M2\x</literal> ã‚’è¿”ã™é–¢æ•° (デフォルト: none)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x0</term>
+ <listitem>
+ <para>åˆæœŸæŽ¨å®šãƒ™ã‚¯ãƒˆãƒ« (デフォルト: zeros(n,1))</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>verbose</term>
+ <listitem>
+ <para>冗長ãªãƒ­ã‚°ã‚’有効ã«ã™ã‚‹å ´åˆã¯1を指定 (デフォルト 0)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>解ベクトル</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>flag</term>
+ <listitem>
+ <para>
+ <literal>conjgrad</literal> ãŒå復回数<literal>maxi</literal>以内ã«
+ 許容誤差以内ã«åŽæŸã—ãŸå ´åˆã¯ 0,
+ ãれ以外㯠1
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>err</term>
+ <listitem>
+ <para>残差ノルムã®æœ€çµ‚値 (å³è¾º b ã®äºŒä¹—ノルムを使用)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iter</term>
+ <listitem>
+ <para>実行ã—ãŸå復回数</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>相対ノルム残差ã®ãƒ™ã‚¯ãƒˆãƒ«</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>説明</title>
+ <para>
+ プリコンディショニング有りã¾ãŸã¯ç„¡ã—ã®
+ 共役勾é…法ã«ã‚ˆã‚Šç·šå½¢ã‚·ã‚¹ãƒ†ãƒ <literal>Ax=b</literal> を解ãã¾ã™.
+ プリコンディショナã¯å¯¾ç§°æ­£å®šè¡Œåˆ—<literal>M</literal>,ã¾ãŸã¯
+ <literal>M=M1*M2</literal>ã¨ãªã‚‹2ã¤ã®è¡Œåˆ—
+ <literal>M1</literal>ã¨<literal>M2</literal>
+ ã«ã‚ˆã‚Šå®šç¾©ã•ã‚Œã¾ã™.
+ ã“ã®å ´åˆ,ã“ã®é–¢æ•°ã¯<literal>inv(M)*A*x = inv(M)*b</literal>ã‚’
+ <literal>x</literal>ã«ã¤ã„ã¦è§£ãã¾ã™.
+ <literal>M</literal>, <literal>M1</literal> ãŠã‚ˆã³
+ <literal>M2</literal> ã¯, 呼ã³å‡ºã—手順<literal>y=Milx(x)</literal>
+ ã§å¯¾å¿œã™ã‚‹å·¦é™¤ç®—<literal>y=Mi\x</literal>を計算ã™ã‚‹Scilab関数ã¨
+ ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™.
+ </para>
+ <para>
+ 入力引数 <literal>method</literal> ã¯,使用ã™ã‚‹ã‚½ãƒ«ãƒã‚’指定ã—ã¾ã™:
+ <simplelist type="inline">
+ <member>
+ "pcg" プリコンディショナ付ã共役勾é…法
+ </member>
+ <member>
+ "cgs" プリコンディショナ付ã二乗共役勾é…法
+ </member>
+ <member>
+ "bicg" プリコンディショナ付ãåŒå…±å½¹å‹¾é…法
+ </member>
+ <member>
+ "bicgstab" プリコンディショナ付ã安定化åŒå…±å½¹å‹¾é…法 (デフォルト)
+ </member>
+ </simplelist>
+ </para>
+ <para>
+ <literal>method="pcg"</literal>ã®å ´åˆ, <literal>A</literal> 行列ã¯
+ 対称正定行列(通常ã¾ãŸã¯ç–Žè¡Œåˆ—)ã¾ãŸã¯å‘¼ã³å‡ºã—手順<literal>y=Ax(x)</literal>ã§
+ <literal>y=A*x</literal>を計算ã™ã‚‹é–¢æ•°ã¨ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+ ãã®ä»–ã®å ´åˆ (<literal>method="cgs", "bicg" or "bicgstab"</literal>),
+ <literal>A</literal> ã¯æ­£æ–¹è¡Œåˆ—ã§ã‚ã‚‹ã“ã¨ã®ã¿å¿…è¦ã§ã™.
+ </para>
+ </refsection>
+ <refsection>
+ <title>良æ¡ä»¶ãŠã‚ˆã³æ‚ªæ¡ä»¶ã®å•é¡Œã®ä¾‹
+ </title>
+ <para>
+ 以下ã®ä¾‹ã§ã¯, 2ã¤ã®ç·šå½¢ã‚·ã‚¹ãƒ†ãƒ ã‚’解ãã¾ã™.
+ 最åˆã®è¡Œåˆ—ã¯æ¡ä»¶æ•°ãŒ ~0.02ã§,アルゴリズムã¯10回ã§åŽæŸã—ã¾ã™.
+ ã“ã‚Œã¯è¡Œåˆ—ã®å¤§ãã•ã¨åŒã˜ã§,共役勾é…法ã§æœŸå¾…ã•ã‚Œã‚‹å‹•ä½œã§ã™.
+ 2番目ã®è¡Œåˆ—ã¯æ¡ä»¶æ•°ãŒ1.d-6ã¨å°ã•ã,アルゴリズムã¯åŽæŸã¾ã§ã«22回ã¨
+ より多ãã®å復をè¦ã—ã¾ã™.ã“ã‚ŒãŒãƒ‘ラメータ maxIter ㌠30 ã«è¨­å®šã•ã‚Œã¦ã„ã‚‹
+ ç†ç”±ã§ã™.
+ "key=value" 構文ã®ä»–ã®ä¾‹ã«ã¤ã„ã¦ã¯ä»¥ä¸‹ã‚’å‚ç…§ãã ã•ã„.
+ </para>
+ <programlisting role="example"><![CDATA[
+// 良æ¡ä»¶å•é¡Œ
+A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b = ones(10, 1);
+[x, fail, err, iter, res] = conjgrad(A, b, "bicg", 1d-12, 15);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+// 悪æ¡ä»¶å•é¡Œ
+A = [ 894 0 0 0 0 28 0 0 1000 70000
+ 0 5 13 5 0 0 0 0 0 0
+ 0 13 72 34 0 0 0 0 0 6500
+ 0 5 34 1 0 0 0 0 0 55
+ 0 0 0 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 0 0 0 32 0 39 46 8 0
+ 1000 0 0 0 12 33 0 8 82 11
+ 70000 0 6500 55 0 0 0 0 11 100];
+[x, fail, err, iter, res] = conjgrad(A, b, method="pcg", maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Aã«ç–Žè¡Œåˆ—ã¾ãŸã¯é–¢æ•°ã¾ãŸã¯ãƒªã‚¹ãƒˆã‚’指定ã™ã‚‹ä¾‹
+ </title>
+ <para>
+ 以下ã®ä¾‹ã¯,ã“ã®æ‰‹æ³•ãŒç–Žè¡Œåˆ—ã‚’åŒæ§˜ã«å‡¦ç†ã§ãã‚‹ã“ã¨ã‚’示ã™ã‚‚ã®ã§ã™.
+ ã¾ãŸ,ã“ã®ä¾‹ã¯å³è¾ºã‚’計算ã™ã‚‹é–¢æ•°ã‚’"conjgrad"ã®ãƒ—リミティブã«æŒ‡å®šã™ã‚‹
+ ケースも示ã—ã¾ã™.
+ ã“ã®ä¾‹ã®æœ€å¾Œã®ã‚±ãƒ¼ã‚¹ã¯,
+ リストをプリミティブã«æŒ‡å®šã™ãŸå ´åˆã§ã™.
+ </para>
+ <programlisting role="example"><![CDATA[
+// 良æ¡ä»¶å•é¡Œ
+A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b = ones(10, 1);
+// Aを疎行列ã«å¤‰æ›
+Asparse=sparse(A);
+[x, fail, err, iter, res] = conjgrad(Asparse, b, "cgs", maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+// å³è¾ºã‚’計算ã™ã‚‹é–¢æ•°ã‚’定義
+function y = Atimesx(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A*x
+endfunction
+// スクリプトAtimesx をプリミティブã«æŒ‡å®š
+[x, fail, err, iter, res] = conjgrad(Atimesx, b, maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+// å³è¾ºã‚’計算ã™ã‚‹é–¢æ•°ã‚’定義
+function y = Atimesxbis(x, A)
+ y = A*x
+endfunction
+// プリミティブã¸ã®ãƒªã‚¹ãƒˆã‚’指定
+Alist = list(Atimesxbis, Asparse);
+[x, fail, err, iter, res] = conjgrad(Alist, b, maxIter=30, tol=1d-12);
+mprintf(" fail=%d, iter=%d, errrel=%e\n",fail,iter,err)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>key=value 構文ã®ä¾‹</title>
+ <para>
+ 以下ã®ä¾‹ã¯"key=value"構文ã§å¼•æ•°ã‚’指定ã™ã‚‹æ–¹æ³•ã‚’示ã™ã‚‚ã®ã§ã™.
+ ã“ã‚Œã«ã‚ˆã‚Š,ä½ç½®ã‚’固定ã›ãšã«å¼•æ•°ã‚’指定ã§ã,
+ ã¤ã¾ã‚Š, 引数リストã«ãŠã‘ã‚‹é †åºã«ä¾å­˜ã›ãšã«,
+ 引数を設定ã§ãã¾ã™.
+ 有効ãªã‚­ãƒ¼ã¯ã‚ªãƒ—ション引数ã®åå‰,ã¤ã¾ã‚Š,
+ tol, maxIter, %M, %M2, x0, verbose ã§ã™.
+ 以下ã®ä¾‹ã§ã¯, verbose オプション㌠maxIterオプションã®
+ å‰ã«æŒ‡å®šã•ã‚Œã¦ã„ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„.
+ "key=value"構文ã§ã¯ãªã„å ´åˆã¯å¼•æ•°ã®ä½ç½®ãŒå›ºå®šã•ã‚Œã‚‹ãŸã‚,
+ maxIter ã¯å…ˆ, verbose ã¯å¾Œã§ä½¿ç”¨ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+ </para>
+ <programlisting role="example"><![CDATA[
+// key=value 構文ã§æŒ‡å®šã•ã‚Œã‚‹å¼•æ•°ã®ä¾‹
+A = [100 1; 1 10];
+b = [101; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, verbose=1);
+// key=value 構文ã®å ´åˆ, é †åºã¯é–¢ä¿‚ã‚ã‚Šã¾ã›ã‚“
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, verbose=1, maxIter=0);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>å‚ç…§</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="backslash">backslash</link>
+ </member>
+ <member>
+ <link linkend="qmr">qmr</link>
+ </member>
+ <member>
+ <link linkend="gmres">gmres</link>
+ </member>
+ </simplelist>
+ </refsection>
+ <refsection>
+ <title>å‚考文献</title>
+ <para>
+ <emphasis role="bold">PCG</emphasis>
+ </para>
+ <para>"Templates for the Solution of Linear Systems: Building Blocks for
+ Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
+ Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993, ftp
+ netlib2.cs.utk.edu/linalg/templates.ps
+ </para>
+ <para>"Iterative Methods for Sparse Linear Systems, Second Edition", Saad,
+ SIAM Publications, 2003, ftp
+ ftp.cs.umn.edu/dept/users/saad/PS/all_ps.zip
+ </para>
+ <para>
+ <emphasis role="bold">CGS</emphasis>
+ </para>
+ <para>
+ "CGS, A Fast Lanczos-Type Solver for Nonsymmetric Linear systems" by Peter Sonneveld.
+ </para>
+ <para>
+ <ulink url="http://epubs.siam.org/doi/abs/10.1137/0910004">Original article</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?id=64888&amp;preflayout=flat">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/ConjugateGradientSquaredMethod.html">Some theory around CGS</ulink>
+ </para>
+ <para>
+ <emphasis role="bold">BICG</emphasis>
+ </para>
+ <para>
+ "Numerical Recipes: The Art of Scientific Computing." (third ed.) by William Press, Saul Teukolsky, William Vetterling, Brian Flannery.
+ </para>
+ <para>
+ <ulink url="http://apps.nrbook.com/empanel/index.html?pg=87">http://apps.nrbook.com/empanel/index.html?pg=87</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?doid=1874391.187410">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/BiconjugateGradientMethod.html">Some theory around BICG</ulink>
+ </para>
+ <para>
+ <emphasis role="bold">BICGSTAB</emphasis>
+ </para>
+ <para>
+ "Bi-CGSTAB: A Fast and Smoothly Converging Variant of Bi-CG for the Solution of Nonsymmetric Linear Systems" by Henk van der Vorst. 339
+ </para>
+ <para>
+ <ulink url="http://epubs.siam.org/doi/abs/10.1137/0913035">Original article</ulink>
+ </para>
+ <para>
+ <ulink url="http://dl.acm.org/citation.cfm?id=131916.131930&amp;coll=DL&amp;dl=GUIDE&amp;CFID=372773884&amp;CFTOKEN=56630250">Article on ACM</ulink>
+ </para>
+ <para>
+ <ulink url="http://mathworld.wolfram.com/BiconjugateGradientStabilizedMethod.html">Some theory around BICG</ulink>
+ </para>
+ </refsection>
+ <refsection>
+ <title>履歴</title>
+ <revhistory>
+ <revision>
+ <revnumber>5.5.0</revnumber>
+ <revdescription>
+ å°Žå…¥
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/ja_JP/iterativesolvers/gmres.xml b/modules/sparse/help/ja_JP/iterativesolvers/gmres.xml
new file mode 100755
index 000000000..46bff29f2
--- /dev/null
+++ b/modules/sparse/help/ja_JP/iterativesolvers/gmres.xml
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="gmres">
+
+ <refnamediv>
+
+ <refname>gmres</refname>
+
+ <refpurpose>Generalized Minimum RESidual 法</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>[x,flag,err,iter,res] = gmres(A,b,[rstr,[tol,[maxi,[M,[x0]]]]])</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>
+
+ nè¡Œn列行列ã¾ãŸã¯<literal>A*x</literal>ã‚’è¿”ã™é–¢æ•°.
+
+ <literal>A</literal>ãŒé–¢æ•°ã®å ´åˆ,以下ã®ã‚ˆã†ãªãƒ˜ãƒƒãƒ€ã‚’有ã™ã‚‹ã“ã¨:
+
+ </para>
+
+ <programlisting role=""><![CDATA[
+function y = A ( x )
+]]></programlisting>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>b</term>
+
+ <listitem>
+
+ <para>å³è¾ºãƒ™ã‚¯ãƒˆãƒ«</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>x0</term>
+
+ <listitem>
+
+ <para>åˆæœŸæŽ¨å®šå€¤ãƒ™ã‚¯ãƒˆãƒ«(デフォルト: zeros(n,1))</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>M</term>
+
+ <listitem>
+
+ <para>
+
+ プリコンディショナ: nè¡Œn列行列(デフォルト: eye(n,n))ã¾ãŸã¯
+
+ <literal>M*x</literal>ã‚’è¿”ã™é–¢æ•°.
+
+ M ãŒé–¢æ•°ã®å ´åˆ,以下ã®ã‚ˆã†ãªãƒ˜ãƒƒãƒ€ã‚’有ã™ã‚‹ã“ã¨:
+
+ </para>
+
+ <programlisting role=""><![CDATA[
+function y = M ( x )
+ ]]></programlisting>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>rstr</term>
+
+ <listitem>
+
+ <para>リスタートã¾ã§ã®å復回数 (デフォルト: 10)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>maxi</term>
+
+ <listitem>
+
+ <para>最大å復回数 (デフォルト: n)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>tol</term>
+
+ <listitem>
+
+ <para>許容誤差 (デフォルト: 1e-6)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>x</term>
+
+ <listitem>
+
+ <para>解ã®ãƒ™ã‚¯ãƒˆãƒ«</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>err</term>
+
+ <listitem>
+
+ <para>最終残差ノルム</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>iter</term>
+
+ <listitem>
+
+ <para>実行ã—ãŸå復回数</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>flag</term>
+
+ <listitem>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>0 =</term>
+
+ <listitem>
+
+ <para>
+
+ <literal>gmres</literal>ã¯,
+
+ <literal>maxi</literal>回ã®å復内ã«
+
+ 指定ã—ãŸè¨±å®¹èª¤å·®ã«åŽæŸã—ã¾ã—ãŸ
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>1 =</term>
+
+ <listitem>
+
+ <para>
+
+ 指定ã—㟠<literal>maxi</literal>回ã§ã¯åŽæŸã—ã¾ã›ã‚“ã§ã—ãŸ
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>res</term>
+
+ <listitem>
+
+ <para>残差ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>GMRES </term>
+
+ <listitem>
+
+ <para>
+
+ 線形システム<literal>Ax=b</literal>をリスタート付ãã®
+
+ Generalized Minimal residual法ã«ã‚ˆã‚Šè§£ãã¾ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>詳細</term>
+
+ <listitem>
+
+ <para>ã“ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ã®è©³ç´°ã¯ä»¥ä¸‹ã®æ–‡çŒ®ã«è¨˜è¿°ã•ã‚Œã¦ã„ã¾ã™ :</para>
+
+ <para>"Templates for the Solution of Linear Systems: Building Blocks for
+
+ Iterative Methods", Barrett, Berry, Chan, Demmel, Donato, Dongarra,
+
+ Eijkhout, Pozo, Romine, and Van der Vorst, SIAM Publications, 1993 (ftp
+
+ netlib2.cs.utk.edu; cd linalg; get templates.ps).
+
+ </para>
+
+ <para>"Iterative Methods for Sparse Linear Systems, Second Edition" Saad,
+
+ SIAM Publications, 2003 (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get
+
+ all_ps.zip).
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+ // A ãŠã‚ˆã³ M ãŒè¡Œåˆ—ã®å ´åˆ
+A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+[x,flag,err,iter,res] = gmres(A, b)
+M = eye(10, 10);
+[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, M, zeros(10, 1))
+ // AãŒè¡Œåˆ—, MãŒé–¢æ•°ã®å ´åˆ
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+function y = Mtimesx(x)
+M = eye(10,10);
+y = M*x;
+endfunction
+[x,flag,err,iter,res] = gmres(A, b, 10, 1d-12, 20, Mtimesx, zeros(10, 1))
+ // A ãŒé–¢æ•°, M ãŒè¡Œåˆ—ã®å ´åˆ
+ function y = Atimesx(x)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A * x;
+ endfunction
+ b = ones(10,1);
+ M = eye(10, 10);
+ [x,flag,err,iter,res] = gmres(Atimesx, b)
+ [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, M, zeros(10,1))
+ // A ãŠã‚ˆã³ M ãŒé–¢æ•°
+ function y = Atimesx(x)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A * x;
+ endfunction
+ function y = Mtimesx(x)
+M = eye(10,10);
+y = M*x;
+endfunction
+ [x,flag,err,iter,res] = gmres(Atimesx, b, 10, 1d-12, 20, Mtimesx, zeros(10,1))
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="conjgrad">conjgrad</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="qmr">qmr</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/iterativesolvers/qmr.xml b/modules/sparse/help/ja_JP/iterativesolvers/qmr.xml
new file mode 100755
index 000000000..5d5b392b4
--- /dev/null
+++ b/modules/sparse/help/ja_JP/iterativesolvers/qmr.xml
@@ -0,0 +1,490 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="qmr">
+
+ <refnamediv>
+
+ <refname>qmr</refname>
+
+ <refpurpose>プリコンディショナ付ãã®Quasi Minimal Residual法</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>[x,flag,err,iter,res] = qmr(A,b,x0,M1,M1p,M2,M2p,maxi,tol)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>Parameters</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>
+
+ 大ãã•nè¡Œn列ã®è¡Œåˆ—ã¾ãŸã¯<literal>A*x</literal>ã‚’è¿”ã™é–¢æ•°
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>b</term>
+
+ <listitem>
+
+ <para>å³è¾ºãƒ™ã‚¯ãƒˆãƒ«</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>x0</term>
+
+ <listitem>
+
+ <para>åˆæœŸæŽ¨å®šãƒ™ã‚¯ãƒˆãƒ« (デフォルト: zeros(n,1))</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>M1</term>
+
+ <listitem>
+
+ <para>
+
+ 左プリコンディショナ: 行列ã¾ãŸã¯<literal>M1*x</literal>ã‚’è¿”ã™é–¢æ•°
+
+ (å‰è€…ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤: eye(n,n))
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>M1p</term>
+
+ <listitem>
+
+ <para>
+
+ <literal>M1</literal>ãŒé–¢æ•°ã®å ´åˆã®ã¿æŒ‡å®šã™ã‚‹
+
+ å¿…è¦ãŒã‚ã‚Šã¾ã™. ã“ã®å ´åˆ, <literal>M1p</literal> ã¯
+
+ <literal>M1'*x</literal>ã‚’è¿”ã™é–¢æ•°ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>M2</term>
+
+ <listitem>
+
+ <para>
+
+ å³ãƒ—リコンディショナ: 行列ã¾ãŸã¯<literal>M2*x</literal>ã‚’
+
+ è¿”ã™é–¢æ•° (å‰è€…ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤: eye(n,n))
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>M2p</term>
+
+ <listitem>
+
+ <para>
+
+ <literal>M2</literal>ãŒé–¢æ•°ã®å ´åˆã®ã¿æŒ‡å®šã™ã‚‹
+
+ å¿…è¦ãŒã‚ã‚Šã¾ã™. ã“ã®å ´åˆ,
+
+ <literal>M2p</literal>ã¯<literal>M2'*x</literal>ã‚’è¿”ã™é–¢æ•°ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>maxi</term>
+
+ <listitem>
+
+ <para>最大å復回数 (デフォルト: n)
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>tol</term>
+
+ <listitem>
+
+ <para>許容誤差 (デフォルト: 1000*%eps)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>x</term>
+
+ <listitem>
+
+ <para>解ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>flag</term>
+
+ <listitem>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>0 =</term>
+
+ <listitem>
+
+ <para>
+
+ <literal>gmres</literal> ã¯
+
+ <literal>maxi</literal>回ã®å復ã®é–“ã«
+
+ 許容誤差内ã«åŽæŸã—ã¾ã—ãŸ
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>1 =</term>
+
+ <listitem>
+
+ <para>
+
+ 指定ã—ãŸ<literal>maxi</literal>回ã®å復ã®é–“ã«
+
+ åŽæŸã—ã¾ã›ã‚“ã§ã—ãŸ
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>res</term>
+
+ <listitem>
+
+ <para>残差ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>err</term>
+
+ <listitem>
+
+ <para>最終残差ノルム</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>iter</term>
+
+ <listitem>
+
+ <para>実行ã—ãŸå復回数</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ プリコンディショナ付ãã®Quasi Minimal Residual法ã«ã‚ˆã‚Š,
+
+ 線形システム<literal>Ax=b</literal>を解ãã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+ // If A is a matrix
+A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+b=ones(10,1);
+[x,flag,err,iter,res] = qmr(A, b)
+
+[x,flag,err,iter,res] = qmr(A, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // If A is a function
+ function y = Atimesx(x,t)
+ A=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ if (t == 'notransp') then
+ y = A*x;
+ elseif (t == 'transp') then
+ y = A'*x;
+ end
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(Atimesx, b)
+
+ [x,flag,err,iter,res] = qmr(Atimesx, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // OR
+
+ function y = funA(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A*x
+ endfunction
+
+ function y = funAp(x)
+ A = [ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y = A'*x
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(funA, funAp, b)
+
+ [x,flag,err,iter,res] = qmr(funA, funAp, b, zeros(10,1), eye(10,10), eye(10,10), 10, 1d-12)
+
+ // If A is a matrix, M1 and M2 are functions
+ function y = M1timesx(x,t)
+ M1 = eye(10,10);
+ if(t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+ endfunction
+
+ function y = M2timesx(x,t)
+ M2 = eye(10,10);
+ if(t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(A, b, zeros(10,1), M1timesx, M2timesx, 10, 1d-12)
+
+ // OR
+
+ function y = funM1(x)
+ M1 = eye(10,10);
+ y = M1*x;
+ endfunction
+
+ function y = funM1p(x)
+ M1 = eye(10,10);
+ y = M1'*x;
+ endfunction
+
+ function y = funM2(x)
+ M2 = eye(10,10);
+ y = M2*x;
+ endfunction
+
+ function y = funM2p(x)
+ M2 = eye(10,10);
+ y = M2'*x;
+ endfunction
+
+ [x,flag,err,iter,res] = qmr(A, b, zeros(10,1), funM1, funM1p, funM2, funM2p, 10, 1d-12)
+
+ // If A, M1, M2 are functions
+ [x,flag,err,iter,res] = qmr(funA, funAp, b, zeros(10,1), funM1, funM1p, funM2, funM2p, 10, 1d-12)
+ [x,flag,err,iter,res] = qmr(Atimesx, b, zeros(10,1), M1timesx, M2timesx, 10, 1d-12)
+
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="gmres">gmres</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="conjgrad">conjgrad</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>履歴</title>
+
+ <revhistory>
+
+ <revision>
+
+ <revnumber>5.4.0</revnumber>
+
+ <revdescription>
+
+ qmr(A, Ap) ã®ã‚³ãƒ¼ãƒ«ã¯å»ƒæ­¢ã•ã‚Œã¾ã—ãŸ.
+
+ qmr(A) を代ã‚ã‚Šã«ä½¿ç”¨ã—ã¦ãã ã•ã„.
+
+ 以下ã®é–¢æ•°ãŒä¾‹ã¨ãªã‚Šã¾ã™ :
+
+ <programlisting role=""><![CDATA[
+function y = A ( x, t )
+Amat = eye(2,2);
+if ( t== "notransp") then
+y = Amat*x;
+elseif (t == "transp") then
+y = Amat'*x;
+end
+endfunction
+ ]]></programlisting>
+
+ </revdescription>
+
+ </revision>
+
+ </revhistory>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/matrixmanip/CHAPTER b/modules/sparse/help/ja_JP/matrixmanip/CHAPTER
new file mode 100755
index 000000000..a797a77e1
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Manipulation
diff --git a/modules/sparse/help/ja_JP/matrixmanip/issparse.xml b/modules/sparse/help/ja_JP/matrixmanip/issparse.xml
new file mode 100755
index 000000000..19ce3bf8d
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/issparse.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="issparse" xml:lang="ja">
+ <refnamediv>
+ <refname>issparse</refname>
+ <refpurpose>入力値ãŒç–Žè¡Œåˆ—ã‹ã©ã†ã‹ã‚’調ã¹ã‚‹</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>呼ã³å‡ºã—手順</title>
+ <synopsis>res = issparse(S)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>引数</title>
+ <variablelist>
+ <varlistentry>
+ <term>S</term>
+ <listitem>
+ <para>scilabオブジェクト</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>res</term>
+ <listitem>
+ <para>1: 行列ã¯ç–Žè¡Œåˆ—, 0: ãã®ä»–</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>説明</title>
+ <para>
+ <literal>res = issparse(S)</literal> ã¯ã€S ãŒç–Žè¡Œåˆ—ã®æ™‚ã«1,
+ ãれ以外ã®æ™‚ã«0ã‚’è¿”ã—ã¾ã™.
+ </para>
+ </refsection>
+ <refsection>
+ <title>例</title>
+ <programlisting role="example">sp = sparse([1,2;4,5;3,10],[1,2,3]);
+ if issparse(sp) == 1 then
+ disp("It is a sparse");
+ end
+ A = 1;
+ if issparse(A) == 0 then
+ disp("It is not a sparse");
+ end
+ </programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>å‚ç…§</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="type">type</link>
+ </member>
+ <member>
+ <link linkend="typeof">typeof</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/ja_JP/matrixmanip/nnz.xml b/modules/sparse/help/ja_JP/matrixmanip/nnz.xml
new file mode 100755
index 000000000..c0826a9ea
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/nnz.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="nnz">
+
+ <refnamediv>
+
+ <refname>nnz</refname>
+
+ <refpurpose>行列ã«ãŠã‘ã‚‹éžã‚¼ãƒ­è¦ç´ ã®æ•°</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>n=nnz(X)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>X</term>
+
+ <listitem>
+
+ <para>実数ã¾ãŸã¯è¤‡ç´ ç–Ž(ã¾ãŸã¯é€šå¸¸)行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>n</term>
+
+ <listitem>
+
+ <para>æ•´æ•°, Xã®éžã‚¼ãƒ­è¦ç´ ã®æ•°</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>nnz</literal> ã¯ç–Žè¡Œåˆ—ã¾ãŸã¯é€šå¸¸ã®è¡Œåˆ—ã«ãŠã‘ã‚‹
+
+ éžã‚¼ãƒ­è¦ç´ ã®æ•°ã‚’æ•°ãˆã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3]);
+nnz(sp)
+a=[1 0 0 0 2];
+nnz(a)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/matrixmanip/speye.xml b/modules/sparse/help/ja_JP/matrixmanip/speye.xml
new file mode 100755
index 000000000..b224401de
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/speye.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="speye" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>speye</refname>
+
+ <refpurpose>ç–Žå˜ä½è¡Œåˆ—</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>Isp=speye(nrows,ncols)
+
+ Isp=speye(A)
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>nrows</term>
+
+ <listitem>
+
+ <para>整数 (行数)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>ncols</term>
+
+ <listitem>
+
+ <para>整数 (列数)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>sp</term>
+
+ <listitem>
+
+ <para>ç–Žå˜ä½è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>Isp=speye(nrows,ncols)</literal> ã¯,
+
+ <literal>nrows</literal> 行,
+
+ <literal>ncols</literal> 列ã®
+
+ ç–Žå˜ä½è¡Œåˆ—<literal>Isp</literal>ã‚’è¿”ã—ã¾ã™.
+
+ (éžæ­£æ–¹è¡Œåˆ—ã¯ä¸»å¯¾è§’é …ã«1を有ã—ã¾ã™).
+
+ </para>
+
+ <para>
+
+ <literal>Isp=speye(A)</literal>ã¯<literal>A</literal>ã¨
+
+ åŒã˜æ¬¡å…ƒã®ç–Žå˜ä½è¡Œåˆ—ã‚’è¿”ã—ã¾ã™.
+
+ <literal>[m,n]=size(A)</literal>ã®å ´åˆ, <literal>speye(m,n)</literal> ãŠã‚ˆã³
+
+ <literal>speye(A)</literal>ã¯ç­‰ä¾¡ã§ã™. ãªãŠ,
+
+ <literal>speye(3)</literal> ã¯
+
+ <literal>speye(3,3)</literal>ã¨ç­‰ä¾¡ã§ã¯ã‚ã‚Šã¾ã›ã‚“.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+eye(3,3)-full(speye(3,3))
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="full">full</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="eye">eye</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spzeros">spzeros</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spones">spones</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/matrixmanip/spones.xml b/modules/sparse/help/ja_JP/matrixmanip/spones.xml
new file mode 100755
index 000000000..64971b973
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/spones.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spones" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>spones</refname>
+
+ <refpurpose>疎行列</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>sp=spones(A)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>sp</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>sp=spones(A)</literal> ã¯
+
+ <literal>A</literal>ã¨åŒã˜ç–Žæ§‹é€ ã‚’有ã—
+
+ ãã®éžã‚¼ãƒ­è¦ç´ ã®ä½ç½®ã«1を有ã™ã‚‹,行列を生æˆã—ã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+A=sprand(10,12,0.1);
+sp=spones(A)
+B = A~=0
+bool2s(B)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="full">full</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="eye">eye</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="speye">speye</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spzeros">spzeros</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/matrixmanip/sprand.xml b/modules/sparse/help/ja_JP/matrixmanip/sprand.xml
new file mode 100755
index 000000000..6aacb19fa
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/sprand.xml
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * Copyright (C) 2010 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sprand" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>sprand</refname>
+
+ <refpurpose>ランダム疎行列</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>sp=sprand(nrows,ncols,density [,typ])</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>nrows</term>
+
+ <listitem>
+
+ <para>整数 (行数)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>ncols</term>
+
+ <listitem>
+
+ <para>整数 (列数)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>density</term>
+
+ <listitem>
+
+ <para>å æœ‰çŽ‡ (密度)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>typ</term>
+
+ <listitem>
+
+ <para>
+
+ 文字列, <literal>"uniform"</literal> (デフォルト) ã¾ãŸã¯
+
+ <literal>"normal"</literal>
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>sp</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>sp=sprand(nrows,ncols,density)</literal> ã¯,
+
+ <literal>nrows</literal> 行<literal>ncols</literal>列,
+
+ 近似的ã«<literal>density*nrows*ncols</literal>個ã®éžã‚¼ãƒ­
+
+ エントリを有ã™ã‚‹ç–Žè¡Œåˆ—<literal>sp</literal>ã‚’è¿”ã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ <literal>density</literal>パラメータã¯
+
+ <literal>[0,1]</literal> ã®ç¯„囲ã§æŒ‡å®šã•ã‚Œã¾ã™.
+
+ ãã†ã§ãªã„å ´åˆ,
+
+ 自動的ã«ã“ã®ç¯„囲ã«å¤‰æ›ã•ã‚Œã¾ã™.
+
+ ã“ã®ãŸã‚, 0 よりå°ã•ã„ã‹ 1より大ãã„ density を使用ã—ã¦ã‚‚,
+
+ エラーも警告も発生ã—ã¾ã›ã‚“:
+
+ å¼<literal>density=max(min(density,1),0)</literal>ãŒä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ </para>
+
+ <para>
+
+ <literal>typ="uniform"</literal>ã®å ´åˆ, 一様分布ã®
+
+ 値 [0,1]ãŒç”Ÿæˆã•ã‚Œã¾ã™.
+
+ <literal>typ="normal"</literal> ã®å ´åˆ,æ­£è¦åˆ†å¸ƒã®
+
+ 値ãŒç”Ÿæˆã•ã‚Œã¾ã™ (å¹³å‡=0 ãŠã‚ˆã³æ¨™æº–åå·®=1).
+
+ </para>
+
+ <para>
+
+ 出力行列ã®ã‚¨ãƒ³ãƒˆãƒªã¯æŒ‡å®šã•ã‚ŒãŸåˆ†å¸ƒé–¢æ•°<literal>typ</literal>ã«
+
+ 基ã¥ã計算ã•ã‚Œã¾ã™.
+
+ éžã‚¼ãƒ­è¦ç´ ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã¯ãƒ©ãƒ³ãƒ€ãƒ ã«è¨ˆç®—ã•ã‚Œ,
+
+ éžã‚¼ãƒ­ã®å¹³å‡çš„ãªæ•°ã¯<literal>density</literal>ã¨ãªã‚Šã¾ã™.
+
+ 実際ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã®å€¤ã¯,指数分布関数ã«ã‚ˆã‚Šè¨ˆç®—ã•ã‚Œã¾ã™.
+
+ ãŸã ã—,分布関数ã®ãƒ‘ラメータã¯åŒæ™‚ã«è¨ˆç®—ã•ã‚Œã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,近似的ã«å¯†åº¦0.001ã®
+
+ 100x1000疎行列を生æˆã—ã¾ã™.
+
+ ã™ãªã‚ã¡,ãŠã‚ˆã 100*1000*0.001=100個ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã¨ãªã‚Šã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+// 行列ã®ã‚¨ãƒ³ãƒˆãƒªã¯ä¸€æ§˜åˆ†å¸ƒã¨ãªã‚Šã¾ã™.
+W=sprand(100,1000,0.001);
+// 行列ã®ã‚¨ãƒ³ãƒˆãƒªã¯æ­£è¦åˆ†å¸ƒã¨ãªã‚Šã¾ã™.
+W=sprand(100,1000,0.001,"normal");
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ã‚¹ã‚¯ãƒªãƒ—トã¯,
+
+ 行列ã®ã‚¨ãƒ³ãƒˆãƒªãŒæŒ‡å®šã—ãŸåˆ†å¸ƒã‚’有ã™ã‚‹ã“ã¨ã‚’確èªã—ã¾ã™.
+
+ éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã‚’å–å¾—ã™ã‚‹ãŸã‚ã«spget関数を用ã„ã¾ã™.
+
+ 次ã«,エントリã®æœ€å°å€¤,最大値,å¹³å‡ã‚’計算ã—,
+
+ limit値ã¨æ¯”較ã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+typ = "normal";
+// typ = "uniform";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+nnzs=nnz(s);
+[ij,v]=spget(s);
+[%inf -%inf 0 %inf 1] // Limit values for "normal"
+[nnzs min(v) mean(v) max(v) variance(v)]
+[%inf 0 0.5 1 1/12] // Limit values for "uniform"
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ã‚¹ã‚¯ãƒªãƒ—トã§ã¯,ランダムã«é¸æŠžã—ãŸã‚¨ãƒ³ãƒˆãƒªã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’調ã¹,
+
+ æ­£ã—ã„分布を有ã™ã‚‹ã“ã¨ã‚’確èªã—ã¾ã™.
+
+ 一様分布ã®<literal>kmax</literal>ランダム疎行列を生æˆã—ã¾ã™.
+
+ ã“ã“ã§,å„行列ã«ã¤ã„ã¦,生æˆã™ã‚‹éžã‚¼ãƒ­ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã«ã¤ã„ã¦
+
+ 考ãˆã¾ã™.
+
+ ã™ãªã‚ã¡,
+
+ <literal>i=1,2,...,nrows</literal>
+
+ ãŠã‚ˆã³ <literal>j=1,2,...,ncols</literal>ï½’ã¨ãªã‚‹
+
+ å„<literal>i</literal> ãŠã‚ˆã³ <literal>j</literal>ã«ã¤ã„ã¦
+
+ イベント <literal>Aij = {エントリ (i,j) ãŒéžã‚¼ãƒ­}</literal>
+
+ ãŒç™ºç”Ÿã™ã‚‹ã‹ã©ã†ã‹ã‚’調ã¹ã¾ã™.
+
+ 行列<literal>C(i,j)</literal>ã¯ã‚¤ãƒ™ãƒ³ãƒˆ<literal>Aij</literal>
+
+ ãŒç™ºç”Ÿã™ã‚‹å›žæ•°ã‚’ä¿å­˜ã—ã¾ã™.
+
+ 行列 <literal>R(k)</literal> ã¯,<literal>k=1,2,...,kmax</literal>
+
+ ã«ã¤ã„ã¦è©¦è¡Œå›žæ•°<literal>k</literal>ã®å®Ÿéš›ã®å¯†åº¦ã‚’ä¿å­˜ã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+ kmax = 1000;
+ ncols=10;
+ nrows=15;
+ density=0.01;
+ typ="uniform";
+ C=zeros(nrows,ncols);
+ R=[];
+ for k=1:kmax
+ M=sprand(nrows,ncols,density,typ);
+ NZ=find(M<>0);
+ NZratio = size(NZ,"*")/(nrows*ncols);
+ R=[R NZratio];
+ C(NZ)=C(NZ)+1;
+ end
+ ]]></programlisting>
+
+ <para>
+
+ ã“ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ãŒå®Ÿè¡Œã•ã‚Œã‚‹å ´åˆ(時々必è¦ã¨ãªã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™),
+
+ アルゴリズムãŒæ­£ã—ã実行ã•ã‚Œã¦ã„ã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãŸã‚ã«
+
+ è¦ç´ ã®çµ±è¨ˆå€¤ã‚’計算ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™.
+
+ </para>
+
+ <programlisting role="no-scilab-exec"><![CDATA[
+ // A_ijã®æœŸå¾…値ã¯
+ density * kmax
+ // ã“ã®å€¤ã‚’実際ã®ã‚¤ãƒ™ãƒ³ãƒˆã¨æ¯”較 :
+ C
+ // å¹³å‡å€¤ã¯æœŸå¾…値ã«è¿‘ããªã‚Šã¾ã™.
+ [density*kmax mean(C)]
+ // 密度ã¯å¯†åº¦ã®æœŸå¾…値ã«è¿‘ããªã‚Šã¾ã™
+ [density mean(R)]
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="full">full</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="rand">rand</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="speye">speye</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/matrixmanip/spzeros.xml b/modules/sparse/help/ja_JP/matrixmanip/spzeros.xml
new file mode 100755
index 000000000..f4128e96f
--- /dev/null
+++ b/modules/sparse/help/ja_JP/matrixmanip/spzeros.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spzeros" xml:lang="ja">
+ <refnamediv>
+ <refname>spzeros</refname>
+ <refpurpose>疎ゼロ行列</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>呼ã³å‡ºã—手順</title>
+ <synopsis>sp=spzeros(nrows,ncols)
+ sp=spzeros(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>パラメータ</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>整数 (行数)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>整数 (列数)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>疎行列</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>疎ゼロ行列</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>説明</title>
+ <para>
+ <literal>sp=spzeros(nrows,ncols)</literal>ã¯,
+ <literal>nrows</literal> 行,
+ <literal>ncols</literal> 列ã®
+ 疎ゼロ行列を返ã—ã¾ã™.
+ (<literal>sparse([],[],[nrow,ncols])</literal>ã¨ç­‰ä¾¡ã§ã™)
+ </para>
+ <para>
+ <literal>sp=spzeros(A)</literal> ã¯,
+ <literal>A</literal>ã¨åŒã˜æ¬¡å…ƒã‚’有ã™ã‚‹ç–Žã‚¼ãƒ­è¡Œåˆ—ã‚’è¿”ã—ã¾ã™.
+ <literal>[m,n]=size(A)</literal>ã®å ´åˆ, <literal>spzeros(m,n)</literal> ãŠã‚ˆã³
+ <literal>spzeros(A)</literal> ã¯ç­‰ä¾¡ã§ã™. ãªãŠ,
+ <literal>spzeros(3)</literal> ã¯
+ <literal>spzeros(3,3)</literal>ã¨ç­‰ã—ããªã‚Šã¾ã›ã‚“.
+ </para>
+ </refsection>
+ <refsection>
+ <title>例</title>
+ <programlisting role="example"><![CDATA[
+m=spzeros(2,2)
+a=rand(10,12);
+m=spzeros(a)
+sum(spzeros(1000,1000))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>å‚ç…§</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/ja_JP/ordmmd.xml b/modules/sparse/help/ja_JP/ordmmd.xml
new file mode 100755
index 000000000..6095241eb
--- /dev/null
+++ b/modules/sparse/help/ja_JP/ordmmd.xml
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Michael Baudin
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ordmmd" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>ordmmd</refname>
+
+ <refpurpose>
+
+ 複数ã®æœ€å°æ¬¡å…ƒé †åºä»˜ã‘を計算ã™ã‚‹
+
+ </refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>
+
+ [perm,invp,nofsub]=ordmmd(xadj,iadj,n)
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>n</term>
+
+ <listitem>
+
+ <para>doubleã€æ•´æ•°å€¤ã®1è¡Œ1列ã®è¡Œåˆ—,方程å¼ã®æ•°</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>xadj</term>
+
+ <listitem>
+
+ <para>doubleã€æ•´æ•°å€¤ã®(n+1)è¡Œ1列ã®è¡Œåˆ—,Aã®è¡Œã¸ã®ãƒã‚¤ãƒ³ã‚¿</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>iadj</term>
+
+ <listitem>
+
+ <para>doubleã€æ•´æ•°å€¤ã®nnzè¡Œ1列ã®è¡Œåˆ—,Aã®è¡Œæ·»å­—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>perm</term>
+
+ <listitem>
+
+ <para>doubleã€æ•´æ•°å€¤ã®nè¡Œ1列ã®è¡Œåˆ—,最å°æ¬¡å…ƒè¦å‰‡é…列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>invp</term>
+
+ <listitem>
+
+ <para>doubleã€æ•´æ•°å€¤ã®nè¡Œ1列ã®è¡Œåˆ—,permã®é€†è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>nofsub</term>
+
+ <listitem>
+
+ <para>
+
+ doubleã€æ•´æ•°å€¤ã®1è¡Œ1列ã®è¡Œåˆ—,圧縮記憶方å¼ã«ãŠã‘ã‚‹éžã‚¼ãƒ­è¦ç´ ã®æ•°ã®ä¸Šé™
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ コレスキー分解をé©ç”¨ã™ã‚‹å‰ã«å¯¾ç§°ç–Žè¡Œåˆ—ã®è¡ŒãŠã‚ˆã³åˆ—を交æ›ã™ã‚‹éš›ã«
+
+ 最å°æ¬¡å…ƒã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ãŒä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ ã“ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ã¯ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã®éžã‚¼ãƒ­è¦ç´ ã®æ•°ã‚’減らã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ nè¡Œn列ã®å®Ÿå¯¾ç§°ç–Žè¡Œåˆ—<literal>A</literal>を指定ã™ã‚‹ã¨,
+
+ ã“ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ <literal>U</literal> ã¯,通常,
+
+ <literal>A</literal>ã®ä¸Šä¸‰è§’è¦ç´ ã‚ˆã‚Šã‚‚éžã‚¼ãƒ­è¦ç´ ãŒå¤šããªã‚‹
+
+ "å¡—ã‚Šã¤ã¶ã—(fill in)"ã«è‹¦ã—ã‚られã¾ã™.
+
+ 行列<literal>P'*A*P</literal>ãŒåŒã˜ã対称ã§,
+
+ ãã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã®éžã‚¼ãƒ­è¦ç´ ã®æ•°ãŒæœ€å°ã¨ãªã‚‹
+
+ 交æ›è¡Œåˆ— <literal>P</literal>を探ã—ã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,対称疎行列ã®é †åºä»˜ã‘を計算ã—ã¾ã™.
+
+ 隣接構造体を計算ã™ã‚‹éš›ã«<literal>sp2adj</literal> を使用ã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5./8. 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+[xadj,iadj,val]=sp2adj(A);
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n)
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,対称疎行列ã®é †åºä»˜ã‘を計算ã—ã¾ã™.
+
+ <literal>invp</literal>ãŒ<literal>perm</literal>ã®
+
+ 逆行列ã§ã‚ã‚‹ã“ã¨ã‚’確èªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+ A = [
+ 0., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0. ;
+ 0., 0., 4., 0., 0., 0., 0., 0., 0., 0., 0. ;
+ 0., 4., 0., 0., 0., 0., 0., 0., 0., 0., 0. ;
+ 2., 0., 0., 0., 0., 0., 2., 0., 2., 0., 0. ;
+ 0., 0., 0., 0. , 0., 0., 0., 0., 0., 0., 4. ;
+ 0., 0., 0., 0., 0., 0., 0., 3., 0., 3., 0. ;
+ 2., 0., 0., 2., 0., 0., 0., 0., 2., 0., 0. ;
+ 0., 0., 0., 0., 0., 3., 0., 0., 0., 3., 0. ;
+ 2., 0., 0., 2., 0., 0., 2., 0., 0., 0., 0. ;
+ 0., 0., 0., 0., 0., 3., 0., 3., 0., 0., 0. ;
+ 0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 0.];
+ n=size(A,1);
+ A=sparse(A);
+ [xadj,adjncy,anz]=sp2adj(A);
+ [perm,invp,nofsub]=ordmmd(xadj,adjncy,n);
+ perm(invp)
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯, 行列<literal>A</literal>ã¨è¡Œåˆ—<literal>P'*A*P</literal>
+
+ ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã®ç–Žãƒ‘ターンを計算ã—ã¾ã™.
+
+ "Computer Solution of Large Sparse Positive Definite Systems"ã®p.3 "Chapter 1: Introduction"ã‚’å‚ç…§.
+
+ コレスキー分解ã®éžã‚¼ãƒ­è¦ç´ ã®æ•°ã¯15,一方,行列<literal>P'*A*P</literal>ã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã¯
+
+ 9個ã®éžã‚¼ãƒ­è¦ç´ ã‚’有ã™ã‚‹ã“ã¨ãŒã‚ã‹ã‚Šã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5./8. 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+// Aã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã®ç–Žãƒ‘ターンを調ã¹ã‚‹
+U = sparse(chol(full(A)));
+scf();
+subplot(2,1,1);
+PlotSparse(U,"x");
+xtitle("Sparsity pattern of U, such that A=U''*U");
+// 隣接構造体をå–å¾—
+[xadj,iadj,val]=sp2adj(A);
+// 複数ã®æœ€å°æ¬¡å…ƒè¦å‰‡é…列を計算
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+// 交æ›ãƒ™ã‚¯ãƒˆãƒ«ã‚’行列ã«å¤‰æ›
+P=spzeros(n,n);
+for i=1:n
+ P(perm(i),i)=1;
+end
+// P'*A*Pã®ã‚³ãƒ¬ã‚¹ã‚­ãƒ¼åˆ†è§£ã®ç–Žãƒ‘ターンを調ã¹ã‚‹
+U = sparse(chol(full(P'*A*P)));
+subplot(2,1,2);
+PlotSparse(U,"x");
+xtitle("Sparsity pattern of U, such that P''*A*P=U''*U");
+ ]]></programlisting>
+
+ <scilab:image localized="true">
+
+ A = [
+
+ 4. 1. 2. 0.5 2.
+
+ 1. 0.5 0. 0. 0.
+
+ 2. 0. 3. 0. 0.
+
+ 0.5 0. 0. 0.625 0.
+
+ 2. 0. 0. 0. 16.
+
+ ];
+
+ A = sparse(A);
+
+ U = sparse(chol(full(A)));
+
+ scf();
+
+ subplot(2,1,1);
+
+ PlotSparse(U,"x");
+
+ xtitle("Sparsity pattern of U, such that A=U''*U");
+
+ [xadj,iadj,val]=sp2adj(A);
+
+ n = size(A,"r");
+
+ [perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+
+ P=spzeros(n,n);
+
+ for i=1:n
+
+ P(perm(i),i)=1;
+
+ end
+
+ U = sparse(chol(full(P'*A*P)));
+
+ subplot(2,1,2);
+
+ PlotSparse(U,"x");
+
+ xtitle("Sparsity pattern of U, such that P''*A*P=U''*U");
+
+ </scilab:image>
+
+ </refsection>
+
+ <refsection>
+
+ <title>実装ã«é–¢ã™ã‚‹æ³¨è¨˜</title>
+
+ <para>
+
+ ã“ã®é–¢æ•°ã¯Mathematical Sciences Section, Oak Ridge National Laboratoryã®
+
+ Esmond G. Ng ãŠã‚ˆã³ Barry W. Peytonã«ã‚ˆã‚‹
+
+ ソースコード "ordmmd.f",ã«åŸºã¥ã„ã¦ã„ã¾ã™.
+
+ アルゴリズムã¯SPARSPAKライブラリã®Joseph W.H. Liuã«ã‚ˆã‚‹ genmmdルーãƒãƒ³ã«åŸºã¥ã„ã¦ã„ã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>å‚考文献</title>
+
+ <para>
+
+ "Minimum degree algorithm", Wikipedia contributors, Wikipedia, The Free Encyclopedia. http://en.wikipedia.org/wiki/Minimum_degree_algorithm
+
+ </para>
+
+ <para>
+
+ "A new release of SPARSPAK: the Waterloo sparse matrix package", Alan George and Esmond Ng. 1984. SIGNUM Newsl. 19, 4 (October 1984), 9-13.
+
+ </para>
+
+ <para>
+
+ "Computer Solution of Large Sparse Positive Definite Systems" by Alan George and Joseph Liu, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981
+
+ </para>
+
+ <para>
+
+ "Implementation of Lipsol in Scilab", Rubio Scola, 1997, INRIA, No 0215
+
+ </para>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sp2adj">sp2adj</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spchol">spchol</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/CHAPTER b/modules/sparse/help/ja_JP/sparseconvert/CHAPTER
new file mode 100755
index 000000000..42d5e0bf2
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Conversion
diff --git a/modules/sparse/help/ja_JP/sparseconvert/adj2sp.xml b/modules/sparse/help/ja_JP/sparseconvert/adj2sp.xml
new file mode 100755
index 000000000..816ab53b8
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/adj2sp.xml
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="adj2sp" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>adj2sp</refname>
+
+ <refpurpose>隣接形å¼ã‚’疎行列ã«å¤‰æ›.</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>
+
+ A=adj2sp(xadj,iadj,v)
+
+ A=adj2sp(xadj,iadj,v,mn)
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>xadj</term>
+
+ <listitem>
+
+ <para>
+
+ é•·ã• (n+1)ã®æ•´æ•°ãƒ™ã‚¯ãƒˆãƒ«.
+
+ <literal>j=1:n</literal>ã®å ´åˆ,
+
+ 浮動å°æ•°ç‚¹æ•´æ•°
+
+ <literal>xadj(j+1)-xadj(j)</literal> ã¯
+
+ j列ã«ãŠã‘ã‚‹éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®æ•°ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>iadj</term>
+
+ <listitem>
+
+ <para>
+
+ nzè¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—, éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®è¡Œæ·»å­—.
+
+ <literal>j=1:n</literal>ãŠã‚ˆã³,
+
+ <literal>k = xadj(j):xadj(j+1)-1</literal>ã«é–¢ã—ã¦,
+
+ 浮動å°æ•°ç‚¹æ•´æ•° <literal>i = iadj(k)</literal> ã¯
+
+ éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª #k ã®è¡Œæ·»å­—ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>v</term>
+
+ <listitem>
+
+ <para>
+
+ nzè¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—, Aã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª.
+
+ <literal>j=1:n</literal>ãŠã‚ˆã³,
+
+ <literal>k = xadj(j):xadj(j+1)-1</literal>ã«é–¢ã—ã¦,
+
+ 浮動å°æ•°ç‚¹æ•´æ•°<literal>Aij = v(k)</literal>ã¯
+
+ éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª #k ã®å€¤ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>mn</term>
+
+ <listitem>
+
+ <para>
+
+ 1è¡Œ2列ã¾ãŸã¯2è¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—(オプション),
+
+ <literal>mn(1)</literal> ã¯Aã®è¡Œæ•°,
+
+ <literal>mn(2)</literal> ã¯Aã®åˆ—æ•°ã§ã™.
+
+ <literal>mn</literal> ãŒæŒ‡å®šã•ã‚Œãªã„å ´åˆ,
+
+ <literal>mn=[m,n]</literal> ã¯,
+
+ <literal>m=max(iadj)</literal> ãŠã‚ˆã³
+
+ <literal>n=size(xadj,"*")-1</literal>ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã¨ãªã‚Šã¾ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>mè¡Œn列実数ã¾ãŸã¯è¤‡ç´ æ•°ã®ç–Žè¡Œåˆ— (nz 個ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ adj2sp ã¯,隣接形å¼ã‚’疎行列ã«å¤‰æ›ã—ã¾ã™.
+
+ 隣接形å¼ã®å€¤ã¯åˆ—毎ã«ä¿å­˜ã•ã‚Œã¦ã„ã¾ã™.
+
+ ã“ã‚Œã¯,ã“ã®å½¢å¼ãŒã—ã°ã—ã°
+
+ "Compressed sparse column" ã¾ãŸã¯ CSCã¨å‘¼ã°ã‚Œã‚‹ç†ç”±ã§ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,隣接形å¼ã‹ã‚‰ç–Žè¡Œåˆ—を作æˆã—ã¾ã™.
+
+ ãã®å¾Œ,期待ã—ãŸç–Žè¡Œåˆ—ã¨ä¸€è‡´ã™ã‚‹ã‹ã©ã†ã‹ã‚’確èªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+xadj = [1 3 4 7 9 11]';
+iadj = [3 5 3 1 2 4 3 5 1 4]';
+v = [1 2 3 4 5 6 7 8 9 10]';
+B=adj2sp(xadj,iadj,v)
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+C=sparse(A)
+and(B==C)
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,隣接形å¼ã‹ã‚‰ç–Žè¡Œåˆ—を作æˆã—ã¾ã™.
+
+ ãã®å¾Œ,期待ã—ãŸç–Žè¡Œåˆ—ã¨ä¸€è‡´ã™ã‚‹ã‹ã©ã†ã‹ã‚’確èªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+C=adj2sp(xadj,iadj,v)
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A)
+and(B==C)
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,mnパラメータã®ä½¿ç”¨æ³•ã‚’確èªã—ã¾ã™.
+
+ mnパラメータã¨xadjãŠã‚ˆã³iadjã®å®Ÿéš›ã®å†…容ã®æ•´åˆæ€§ã‚’adj2spã§ç¢ºèªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+mn=[7 10];
+C=adj2sp(xadj,iadj,v,mn)
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,3è¡Œ3列ã®ç–Žè¡Œåˆ—を作æˆã—ã¾ã™.
+
+ ã“ã®ä¾‹ã¯, SciPyã®æ–‡æ›¸ã‹ã‚‰ã®å¼•ç”¨ã§ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+xadj = [1,3,4,7]
+iadj = [1,3,3,1,2,3]
+v = [1,2,3,4,5,6]
+full(adj2sp(xadj,iadj,v))
+ ]]></programlisting>
+
+ <para>
+
+ å‰ã®ã‚¹ã‚¯ãƒªãƒ—トã¯ä»¥ä¸‹ã®å‡ºåŠ›ã‚’生æˆã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="no-scilab-exec"><![CDATA[
+-->full(adj2sp(xadj,iadj,v))
+ ans =
+ 1. 0. 4.
+ 0. 0. 5.
+ 2. 3. 6.
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,sp2adjãŠã‚ˆã³adj2sp関数ãŒé€†é–¢æ•°ã§ã‚ã‚‹ã“ã¨ã‚’
+
+ 確èªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+// Templates for the Solution of Algebraic Eigenvalue Problems: a Practical Guide
+// Edited by Zhaojun Bai, James Demmel, Jack Dongarra, Axel Ruhe, and Henk van der Vorst
+// "Sparse Matrix Storage Formats", J. Dongarra
+// http://web.eecs.utk.edu/~dongarra/etemplates/book.html
+
+A = [
+10 0 0 0 -2 0
+3 9 0 0 0 3
+0 7 8 7 0 0
+3 0 8 7 5 0
+0 8 0 9 9 13
+0 4 0 0 2 -1
+];
+A = sparse(A)
+
+// To get the Compressed Sparse Column (CSC) :
+[col_ptr,row_ind,val]=sp2adj(A)
+// To convert back to sparse:
+AAsp=adj2sp(col_ptr,row_ind,val)
+// Check the conversion
+AAsp - A
+
+// To get the Compressed Sparse Row (CSR) :
+[row_ptr,col_ind,val]=sp2adj(A')
+// To convert back to sparse:
+AAsp=adj2sp(row_ptr,col_ind,val)'
+// Check the conversion
+AAsp - A
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sp2adj">sp2adj</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spcompack">spcompack</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>å‚考文献</title>
+
+ <para>
+
+ "Implementation of Lipsol in Scilab", Hector E. Rubio Scola, INRIA, Decembre 1997, Rapport Technique No 0215
+
+ </para>
+
+ <para>
+
+ "Solving Large Linear Optimization Problems with Scilab : Application to Multicommodity Problems", Hector E. Rubio Scola, Janvier 1999, Rapport Technique No 0227
+
+ </para>
+
+ <para>
+
+ "Toolbox Scilab : Detection signal design for failure detection and isolation for linear dynamic systems User's Guide", Hector E. Rubio Scola, 2000, Rapport Technique No 0241
+
+ </para>
+
+ <para>
+
+ "Computer Solution of Large Sparse Positive Definite Systems", A. George, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981.
+
+ </para>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/full.xml b/modules/sparse/help/ja_JP/sparseconvert/full.xml
new file mode 100755
index 000000000..753d84dbb
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/full.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="full">
+
+ <refnamediv>
+
+ <refname>full</refname>
+
+ <refpurpose>疎行列を通常ã®è¡Œåˆ—ã«å¤‰æ›ã™ã‚‹</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>X=full(sp)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>sp</term>
+
+ <listitem>
+
+ <para>実数ã¾ãŸã¯è¤‡ç´ æ•°ã®ç–Ž(ã¾ãŸã¯é€šå¸¸ã®)行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>X</term>
+
+ <listitem>
+
+ <para>通常ã®è¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>X=full(sp)</literal> ã¯ç–Žè¡Œåˆ— <literal>sp</literal> ã‚’
+
+ 通常ã®è¡Œåˆ—表ç¾ã«å¤‰æ›ã—ã¾ã™.
+
+ (<literal>sp</literal> ãŒæ—¢ã«é€šå¸¸ã®è¡Œåˆ—ã®å ´åˆ,<literal>X</literal> ã¯
+
+ <literal>sp</literal>ã«ç­‰ã—ããªã‚Šã¾ã™).
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;5,4;3,1],[1,2,3]);
+A=full(sp)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sprand">sprand</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="speye">speye</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/mtlb_sparse.xml b/modules/sparse/help/ja_JP/sparseconvert/mtlb_sparse.xml
new file mode 100755
index 000000000..a1a26114c
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/mtlb_sparse.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="mtlb_sparse">
+
+ <refnamediv>
+
+ <refname>mtlb_sparse</refname>
+
+ <refpurpose>疎行列ã«å¤‰æ›</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>Y=mtlb_sparse(X)</synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>X</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>Y</term>
+
+ <listitem>
+
+ <para>Matlabå½¢å¼ã®ç–Žè¡Œåˆ—</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>ã›ã¤</title>
+
+ <para>
+
+ <literal>Y=mtlb_sparse(X)</literal> ã¯
+
+ Scilab疎行列<literal>X</literal>ã‚’Matlabå½¢å¼ã«å¤‰æ›ã™ã‚‹éš›ã«
+
+ 使用ã•ã‚Œã¾ã™.
+
+ <literal>Y</literal> ã¯7åž‹ã®å¤‰æ•°,ã™ãªã‚ã¡,
+
+ <literal>type(Y)</literal>ã¯7ã¨ãªã‚Šã¾ã™.
+
+ ã“ã®é–¢æ•°ã¯, mexfilesã§ä½¿ç”¨ã•ã‚Œã¾ã™ (疎行列をå«ã‚€Matlab mexileã¯Scilab疎行列を
+
+ ã“ã®å½¢å¼ã«å¤‰æ›ã—ãŸå ´åˆã®ã¿ä½¿ç”¨ã§ãã¾ã™).
+
+ 関数<literal>full</literal> ãŠã‚ˆã³ <literal>spget</literal>ã¯ã“ã®å½¢å¼ã§ã‚‚
+
+ 動作ã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ ã“ã®å½¢å¼ã‚’用ã„ã‚‹ãã®ä»–ã®å‡¦ç†ãŠã‚ˆã³é–¢æ•°ã¯,
+
+ 接頭辞 "%msp" を用ã„ã¦
+
+ Scilab関数ã«ã‚ˆã‚Šã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™.
+
+ 例ãˆã°,関数
+
+ <literal>%msp_p(x)</literal> (SCIDIR/macros/percent ディレクトリå‚ç…§)ã¯
+
+ ã“ã®ã‚ˆã†ãª"7åž‹"オブジェクトを表示ã™ã‚‹éš›ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+X=sparse(rand(2,2)); Y=mtlb_sparse(X);
+Y, full(Y), [ij,v,mn]=spget(Y)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="full">full</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/sp2adj.xml b/modules/sparse/help/ja_JP/sparseconvert/sp2adj.xml
new file mode 100755
index 000000000..0f0e77986
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/sp2adj.xml
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sp2adj" xml:lang="ja">
+
+ <refnamediv>
+
+ <refname>sp2adj</refname>
+
+ <refpurpose>疎行列を隣接形å¼ã«å¤‰æ›ã™ã‚‹</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>
+
+ [xadj,iadj,v]=sp2adj(A)
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>A</term>
+
+ <listitem>
+
+ <para>
+
+ mè¡Œn列ã®å®Ÿæ•°ã¾ãŸã¯è¤‡ç´ æ•°ã®ç–Žè¡Œåˆ— (nz 個ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª)
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>xadj</term>
+
+ <listitem>
+
+ <para>
+
+ (n+1)è¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—ã§,
+
+ å„列ã®iadjã¨vã®å…ˆé ­ã®æ·»å­—を指ã—ã¾ã™.
+
+ <literal>j=1:n</literal>ã®å ´åˆ,
+
+ 浮動å°æ•°ç‚¹æ•´æ•°
+
+ <literal>xadj(j+1)-xadj(j)</literal> ã¯
+
+ j列ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®æ•°ã«ãªã‚Šã¾ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>iadj</term>
+
+ <listitem>
+
+ <para>
+
+ nzè¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—, éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®è¡Œæ·»å­—.
+
+ <literal>j=1:n</literal>ãŠã‚ˆã³,
+
+ <literal>k = xadj(j):xadj(j+1)-1</literal>ã«é–¢ã—ã¦,
+
+ 浮動å°æ•°ç‚¹æ•´æ•° <literal>i = iadj(k)</literal> ã¯
+
+ éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª #k ã®è¡Œæ·»å­—ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>v</term>
+
+ <listitem>
+
+ <para>
+
+ nzè¡Œ1列ã®æµ®å‹•å°æ•°ç‚¹æ•´æ•°ã®è¡Œåˆ—, Aã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª.
+
+ <literal>j=1:n</literal>ãŠã‚ˆã³,
+
+ <literal>k = xadj(j):xadj(j+1)-1</literal>ã«é–¢ã—ã¦,
+
+ 浮動å°æ•°ç‚¹æ•´æ•°<literal>Aij = v(k)</literal>ã¯
+
+ éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒª #k ã®å€¤ã§ã™.
+
+ </para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ sp2adjã¯,疎行列を隣接形å¼ã«å¤‰æ›ã—ã¾ã™.
+
+ 隣接形å¼ã®å€¤ã¯åˆ—毎ã«ä¿å­˜ã•ã‚Œã¦ã„ã¾ã™.
+
+ ã“ã‚Œã¯,ã“ã®å½¢å¼ãŒã—ã°ã—ã°
+
+ "Compressed sparse column" ã¾ãŸã¯ CSCã¨å‘¼ã°ã‚Œã‚‹ç†ç”±ã§ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,1ã‹ã‚‰10ã®ã‚¨ãƒ³ãƒˆãƒªã‚’有ã™ã‚‹é€šå¸¸ã®è¡Œåˆ—を作æˆã—ã¾ã™.
+
+ 次ã«,ã“れを疎行列ã«å¤‰æ›ã—,ゼロを除ãã¾ã™.
+
+ 最後ã«,ã“ã®è¡Œåˆ—ã®éš£æŽ¥å½¢å¼ã‚’計算ã—ã¾ã™.
+
+ 行列bã¯Aã®éžã‚¼ãƒ­è¦ç´ ã®ã¿ã‚’有ã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+B=sparse(A);
+[xadj,iadj,v]=sp2adj(B)
+expected_xadj = [1 3 4 7 9 11]';
+expected_adjncy = [3 5 3 1 2 4 3 5 1 4]';
+expected_anz = [1 2 3 4 5 6 7 8 9 10]';
+and(expected_xadj == xadj) // Should be %t
+and(expected_adjncy == iadj) // Should be %t
+and(expected_anz == v) // Should be %t
+// j is the column index
+for j = 1 : size(xadj,"*")-1
+ irows = iadj(xadj(j):xadj(j+1)-1);
+ vcolj = v(xadj(j):xadj(j+1)-1);
+ mprintf("Column #%d:\n",j)
+ mprintf(" Rows = %s:\n",sci2exp(irows))
+ mprintf(" Values= %s:\n",sci2exp(vcolj))
+end
+ ]]></programlisting>
+
+ <para>
+
+ å‰ã®ã‚¹ã‚¯ãƒªãƒ—トã¯ä»¥ä¸‹ã®å‡ºåŠ›ã‚’生æˆã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="no-scilab-exec"><![CDATA[
+Column #1:
+ Rows = [3;5]:
+ Values= [1;2]:
+Column #2:
+ Rows = 3:
+ Values= 3:
+Column #3:
+ Rows = [1;2;4]:
+ Values= [4;5;6]:
+Column #4:
+ Rows = [3;5]:
+ Values= [7;8]:
+Column #5:
+ Rows = [1;4]:
+ Values= [9;10]:
+ ]]></programlisting>
+
+ <para>
+
+ 列 #1ã«ã¤ã„ã¦è€ƒãˆã¦ã¿ã¾ã—ょã†.
+
+ ç­‰å¼ xadj(2)-xadj(1)=2 ã¯åˆ— #1ã«éžã‚¼ãƒ­è¦ç´ ãŒ2個ã‚ã‚‹ã“ã¨ã‚’示ã—ã¾ã™.
+
+ 行添字㯠iadjã«ä¿å­˜ã•ã‚Œ, 列 #1 ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã¯
+
+ è¡Œ #3 ãŠã‚ˆã³ #5ã§ã‚ã‚‹ã“ã¨ã‚’示ã—ã¾ã™.
+
+ 行列 v ã¯å®Ÿéš›ã®ã‚¨ãƒ³ãƒˆãƒªãŒ 1ãŠã‚ˆã³2ã§ã‚ã‚‹ã“ã¨ã‚’示ã—ã¾ã™.
+
+ </para>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,疎行列ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã‚’隣接構造ã§ãƒ«ãƒ¼ãƒ—処ç†ã‚’
+
+ ã™ã‚‹ã“ã¨ã«ã‚ˆã‚Š,調ã¹ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+[xadj,iadj,v]=sp2adj(B)
+expected_xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+expected_adjncy = [2 5 2 3 1 2 7 6]';
+expected_anz = [3 7 5 3 6 5 2 3]';
+and(expected_xadj == xadj) // Should be %t
+and(expected_adjncy == iadj) // Should be %t
+and(expected_anz == v) // Should be %t
+ ]]></programlisting>
+
+ <para>
+
+ 以下ã®ä¾‹ã§ã¯,sp2adjãŠã‚ˆã³adj2sp関数ãŒé€†é–¢æ•°ã§ã‚ã‚‹ã“ã¨ã‚’
+
+ 確èªã—ã¾ã™.
+
+ </para>
+
+ <programlisting role="example"><![CDATA[
+// Templates for the Solution of Algebraic Eigenvalue Problems: a Practical Guide
+// Edited by Zhaojun Bai, James Demmel, Jack Dongarra, Axel Ruhe, and Henk van der Vorst
+// "Sparse Matrix Storage Formats", J. Dongarra
+// http://web.eecs.utk.edu/~dongarra/etemplates/book.html
+
+A = [
+10 0 0 0 -2 0
+3 9 0 0 0 3
+0 7 8 7 0 0
+3 0 8 7 5 0
+0 8 0 9 9 13
+0 4 0 0 2 -1
+];
+A = sparse(A)
+
+// To get the Compressed Sparse Column (CSC) :
+[col_ptr,row_ind,val]=sp2adj(A)
+// To convert back to sparse:
+AAsp=adj2sp(col_ptr,row_ind,val)
+// Check the conversion
+AAsp - A
+
+// To get the Compressed Sparse Row (CSR) :
+[row_ptr,col_ind,val]=sp2adj(A')
+// To convert back to sparse:
+AAsp=adj2sp(row_ptr,col_ind,val)'
+// Check the conversion
+AAsp - A
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="adj2sp">adj2sp</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sparse">sparse</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spcompack">spcompack</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>å‚考文献</title>
+
+ <para>
+
+ "Implementation of Lipsol in Scilab", Hector E. Rubio Scola, INRIA, Decembre 1997, Rapport Technique No 0215
+
+ </para>
+
+ <para>
+
+ "Solving Large Linear Optimization Problems with Scilab : Application to Multicommodity Problems", Hector E. Rubio Scola, Janvier 1999, Rapport Technique No 0227
+
+ </para>
+
+ <para>
+
+ "Toolbox Scilab : Detection signal design for failure detection and isolation for linear dynamic systems User's Guide", Hector E. Rubio Scola, 2000, Rapport Technique No 0241
+
+ </para>
+
+ <para>
+
+ "Computer Solution of Large Sparse Positive Definite Systems", A. George, Prentice-Hall, Inc. Englewood Cliffs, New Jersey, 1981.
+
+ </para>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/sparse.xml b/modules/sparse/help/ja_JP/sparseconvert/sparse.xml
new file mode 100755
index 000000000..7b6095c57
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/sparse.xml
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="sparse">
+
+ <refnamediv>
+
+ <refname>sparse</refname>
+
+ <refpurpose>疎行列を定義</refpurpose>
+
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <title>呼ã³å‡ºã—手順</title>
+
+ <synopsis>sp=sparse(X)
+
+ sp=sparse(ij,v [,mn])
+
+ </synopsis>
+
+ </refsynopsisdiv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>X</term>
+
+ <listitem>
+
+ <para>実数ã¾ãŸã¯è¤‡ç´ æ•°ã®é€šå¸¸ã®(ã¾ãŸã¯ç–Ž)行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>ij</term>
+
+ <listitem>
+
+ <para>2列ã®æ•´æ•°è¡Œåˆ— (éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹)</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>v</term>
+
+ <listitem>
+
+ <para>ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>mn</term>
+
+ <listitem>
+
+ <para>2ã¤ã®ã‚¨ãƒ³ãƒˆãƒª(è¡Œã®æ¬¡å…ƒ, 列ã®æ¬¡å…ƒc)を有ã™ã‚‹æ•´æ•°ãƒ™ã‚¯ãƒˆãƒ«</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>sp</term>
+
+ <listitem>
+
+ <para>疎行列</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <para>
+
+ <literal>sparse</literal>ã¯ç–Žè¡Œåˆ—を作æˆã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+
+ ゼロã§ãªã„エントリã®ã¿ãŒä¿å­˜ã•ã‚Œã¾ã™.
+
+ </para>
+
+ <para>
+
+ <literal>sp = sparse(X)</literal> ã¯,
+
+ 0è¦ç´ ã‚’除外ã™ã‚‹ã“ã¨ã«ã‚ˆã‚Š,通常ã®è¡Œåˆ—を疎行列ã«å¤‰æ›ã—ã¾ã™.
+
+ (<literal>X</literal>ãŒæ—¢ã«ç–Žè¡Œåˆ—ã®å ´åˆ,
+
+ <literal>sp</literal>ã¯<literal>X</literal>ã¨ãªã‚Šã¾ã™).
+
+ </para>
+
+ <para>
+
+ <literal>sp=sparse(ij,v [,mn])</literal>ã¯,
+
+ <literal>sp(ij(k,1),ij(k,2))=v(k)</literal>ã¨ãªã‚‹
+
+ <literal>mn(1)</literal>è¡Œ<literal>mn(2)</literal>列ã®ç–Žè¡Œåˆ—
+
+ を作æˆã—ã¾ã™.
+
+ <literal>ij</literal> ãŠã‚ˆã³ <literal>v</literal>ã¯åˆ—ã®æ¬¡å…ƒãŒ
+
+ åŒã˜ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™.
+
+ オプションã®<literal>mn</literal>パラメータãŒæŒ‡å®šã•ã‚Œãªã„å ´åˆ,
+
+ 行列<literal>sp</literal>ã®æ¬¡å…ƒã¯,ãã‚Œãžã‚Œ
+
+ <literal>ij(:,1)</literal> ãŠã‚ˆã³ <literal>ij(:,2)</literal>ã®
+
+ 最大値ã¨ãªã‚Šã¾ã™.
+
+ </para>
+
+ <para>
+
+ 疎行列ã«é–¢ã™ã‚‹æ“作(çµåˆ,加算,ç­‰,)ã¯é€šå¸¸ã®è¡Œåˆ—ã¨åŒã˜æ§‹æ–‡ã«ã‚ˆã‚Š
+
+ è¡Œãªã„ã¾ã™.
+
+ </para>
+
+ <para>
+
+ 基本的ãªé–¢æ•°(<literal>abs,maxi,sum,diag,...</literal>)ã¯ç–Žè¡Œåˆ—ã§ã‚‚
+
+ 利用å¯èƒ½ã§ã™.
+
+ </para>
+
+ <para>
+
+ (通常ã®è¡Œåˆ—ã¨ç–Žè¡Œåˆ—ã®)混用もå¯èƒ½ã§ã™.
+
+ çµæžœã¯å‡¦ç†ã«å¿œã˜ã¦é€šå¸¸ã¾ãŸã¯ç–Žè¡Œåˆ—ã¨ãªã‚Šã¾ã™.
+
+ </para>
+
+ <para>
+
+ æ³¨æ„ :
+
+ åŒã˜å¤§ãã•ã®é€šå¸¸ã®è¡Œåˆ—ã‚’å«ã‚€ä»»æ„ã®æ¼”ç®—ã¯,
+
+ 引数(例: <literal>sp=sparse(d)</literal>),
+
+ ã¾ãŸã¯,çµæžœ(例 <literal>d= sp + 1.</literal>) ã®ã©ã¡ã‚‰
+
+ ã«ã¤ã„ã¦ã‚‚利便性ã®ãŸã‚ã«æä¾›ã•ã‚Œã¦ã„ã¾ã™ãŒ,当然é¿ã‘ã‚‹ã¹ãã§ã™.
+
+ æ›´ã«,è¦ç´ (<literal>sp(r,c)</literal>)ã¸ã®ãƒ©ãƒ³ãƒ€ãƒ ã‚¢ã‚¯ã‚»ã‚¹,
+
+ 特ã«æŒ¿å…¥,ã¯åŠ¹çŽ‡çš„ã§ã¯ã‚ã‚Šã¾ã›ã‚“.
+
+ ã“ã®ãŸã‚,性能é¢ã®åˆ¶ç´„ãŒã‚るアクセスã§ã¯,
+
+ 読込ã¿ã‚¢ã‚¯ã‚»ã‚¹ã¯<link linkend="spget">spget</link>,
+
+ 書込ã¿ã‚¢ã‚¯ã‚»ã‚¹ã¯<literal>sp=sparse(ij, v, mn)</literal>ã«ã‚ˆã‚‹
+
+ ãƒãƒƒãƒå‡¦ç†ã«ã‚ˆã‚Šè¡Œã†å¿…è¦ãŒã‚ã‚Šã¾ã™.
+
+ </para>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+size(sp)
+x=rand(2,2);abs(x)-full(abs(sparse(x)))
+// sparse constructor taking a single dense matrix
+// removes the zeros.
+dense=[0., 1., 0., 0., 0.,
+1., 0., 2., 0., 0.
+0., 0., 0., 0., 0.
+0., 0., 0., 0., -0.5];
+sp=sparse(dense)
+// complex matrices are also supported
+sp=sparse(dense*(1+2*%i))
+// for boolean matrices, the boolean sparse matrix
+// only stores true values (and removes false values).
+dense=[%F, %F, %T, %F, %F
+%T, %F, %F, %F, %F
+%F, %F, %F, %F, %F
+%F, %F, %F, %F, %T];
+sp=sparse(dense)
+
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="full">full</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="sprand">sprand</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="speye">speye</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="lufact">lufact</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/spcompack.xml b/modules/sparse/help/ja_JP/sparseconvert/spcompack.xml
new file mode 100755
index 000000000..12a02f148
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/spcompack.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="spcompack">
+
+ <refnamediv>
+
+ <refname>spcompack</refname>
+
+ <refpurpose>圧縮隣接表ç¾ã«å¤‰æ›ã™ã‚‹</refpurpose>
+
+ </refnamediv>
+
+ <refsection>
+
+ <title>引数</title>
+
+ <variablelist>
+
+ <varlistentry>
+
+ <term>xadj</term>
+
+ <listitem>
+
+ <para>é•·ã• (n+1)ã®æ•´æ•°ãƒ™ã‚¯ãƒˆãƒ«.</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>xlindx</term>
+
+ <listitem>
+
+ <para>é•·ã• n+1ã®æ•´æ•°ãƒ™ã‚¯ãƒˆãƒ«(ãƒã‚¤ãƒ³ã‚¿).</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>lindx</term>
+
+ <listitem>
+
+ <para>整数ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ <varlistentry>
+
+ <term>adjncy</term>
+
+ <listitem>
+
+ <para>整数ベクトル</para>
+
+ </listitem>
+
+ </varlistentry>
+
+ </variablelist>
+
+ </refsection>
+
+ <refsection>
+
+ <title>説明</title>
+
+ <programlisting role=""><![CDATA[
+ユーティリティ関数spcompakã¯åœ§ç¸®éš£æŽ¥å½¢å¼ã‚’
+標準隣接形å¼ã«å¤‰æ›ã™ã‚‹éš›ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection>
+
+ <title>例</title>
+
+ <programlisting role="example"><![CDATA[
+// A is the sparse matrix:
+A=[1,0,0,0,0,0,0;
+ 0,1,0,0,0,0,0;
+ 0,0,1,0,0,0,0;
+ 0,0,1,1,0,0,0;
+ 0,0,1,1,1,0,0;
+ 0,0,1,1,0,1,0;
+ 0,0,1,1,0,1,1];
+A=sparse(A);
+//ã“ã®è¡Œåˆ—ã®å ´åˆ,標準隣接形å¼ã¯ä»¥ä¸‹ã®ã‚ˆã†ã«å®šç¾©ã•ã‚Œã¾ã™:
+xadj=[1,2,3,8,12,13,15,16];
+adjncy=[1, 2, 3,4,5,6,7, 4,5,6,7, 5, 6,7, 7];
+//(sp2adjå‚ç…§).
+// ベクトル xadjã®å¢—分ã¯,å„列ã®éžã‚¼ãƒ­è¦ç´ ã®æ•°ã‚’指定ã—ã¾ã™.
+// ã™ãªã‚ã¡,列1ã«ã¯ 2-1=1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨
+// 列2ã«ã¯ 3-2=1個ã®ã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨
+// 列3ã«ã¯ 8-3=5個ã®ã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨
+// 列3ã«ã¯ 12-8=4個ã®ã‚¨ãƒ³ãƒˆãƒªãŒå­˜åœ¨
+// ãªã©
+// ã“れらã®ã‚¨ãƒ³ãƒˆãƒªã®è¡Œã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã¯éš£æŽ¥ãƒ™ã‚¯ãƒˆãƒ«ã«ã‚ˆã‚Šä¾‹ãˆã°
+// 以下ã®ã‚ˆã†ã«æŒ‡å®šã§ã¾ã™
+// adjncy (3:7)=adjncy(xadj(3):xadj(4)-1)=[3,4,5,6,7]
+// ã“ã‚Œã¯, 列3ã®5=xadj(4)-xadj(3)個ã®ã‚¨ãƒ³ãƒˆãƒªã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’
+// 3,4,5,6,7 ã¨ã—ãŸã“ã¨ã‚’æ„味ã—ã¾ã™.
+// 圧縮表ç¾ã§ã¯,隣接ã™ã‚‹é‡è¤‡ã™ã‚‹ã‚·ãƒ¼ã‚±ãƒ³ã‚¹ã¯æ¶ˆåŽ»ã•ã‚Œã¾ã™.
+// ã“ã“ã§,隣接表ç¾ã§ã¯ä¸¦ã³ 4,5,6,7ãŠã‚ˆã³7ãŒæ¶ˆåŽ»ã•ã‚Œã¾ã™.
+// 標準構造(xadj,adjncy)ã¯åœ§ç¸®å½¢å¼(lindx,xlindx)ã‚’å—ã‘付ã‘ã¾ã™
+lindx=[1, 2, 3,4,5,6,7, 5, 6,7];
+xlindx=[1,2,3,8,9,11];
+//(Aã®åˆ— 4 ãŠã‚ˆã³ 7ã¯æ¶ˆåŽ»ã•ã‚Œã¾ã™).
+//Aã¯(xadj,xlindx,lindx)ã«ã‚ˆã‚Šå†æ§‹ç¯‰ã§ãã¾ã™.
+[xadj,adjncy,anz]= sp2adj(A);
+adjncy-spcompack(xadj,xlindx,lindx)
+ ]]></programlisting>
+
+ </refsection>
+
+ <refsection role="see also">
+
+ <title>å‚ç…§</title>
+
+ <simplelist type="inline">
+
+ <member>
+
+ <link linkend="sp2adj">sp2adj</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="adj2sp">adj2sp</link>
+
+ </member>
+
+ <member>
+
+ <link linkend="spget">spget</link>
+
+ </member>
+
+ </simplelist>
+
+ </refsection>
+
+</refentry>
+
diff --git a/modules/sparse/help/ja_JP/sparseconvert/spget.xml b/modules/sparse/help/ja_JP/sparseconvert/spget.xml
new file mode 100755
index 000000000..4d20506b5
--- /dev/null
+++ b/modules/sparse/help/ja_JP/sparseconvert/spget.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="spget">
+ <refnamediv>
+ <refname>spget</refname>
+ <refpurpose>疎行列ã®ã‚¨ãƒ³ãƒˆãƒªã‚’å–å¾—</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>呼ã³å‡ºã—手順</title>
+ <synopsis>[ij,v,mn]=spget(sp)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>引数</title>
+ <variablelist>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>実数ã¾ãŸã¯è¤‡ç´ æ•°ã®ç–Žè¡Œåˆ—</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ij</term>
+ <listitem>
+ <para>2列ã®æ•´æ•°è¡Œåˆ—t (éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>2ã¤ã®ã‚¨ãƒ³ãƒˆãƒª(è¡Œã®æ¬¡å…ƒ, 列ã®æ¬¡å…ƒ)を有ã™ã‚‹æ•´æ•°ãƒ™ã‚¯ãƒˆãƒ«</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>列ベクトル</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>説明</title>
+ <para>
+ <literal>spget</literal> ã¯ç–Žè¡Œåˆ—ã®å†…部形å¼ã‚’
+ 標準的ãª<literal>ij, v</literal> å½¢å¼ã«å¤‰æ›ã™ã‚‹éš›ã«ä½¿ç”¨ã•ã‚Œã¾ã™.
+ </para>
+ <para>
+ <literal>sp</literal>ã®éžã‚¼ãƒ­ã‚¨ãƒ³ãƒˆãƒªã¯,
+ <literal>ij</literal>ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã«ã‚ˆã‚Šè¡ŒãŠã‚ˆã³åˆ—ã®
+ ä½ç½®ãŒæ±ºå®šã•ã‚Œã¾ã™.
+ </para>
+ </refsection>
+ <refsection>
+ <title>例</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+[ij,v,mn]=spget(sp);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>å‚ç…§</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/addchapter.sce b/modules/sparse/help/pt_BR/addchapter.sce
new file mode 100755
index 000000000..848ab0920
--- /dev/null
+++ b/modules/sparse/help/pt_BR/addchapter.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+add_help_chapter("Matrizes Esparsas",SCI+"/modules/sparse/help/pt_BR",%T);
+
diff --git a/modules/sparse/help/pt_BR/chfact.xml b/modules/sparse/help/pt_BR/chfact.xml
new file mode 100755
index 000000000..12f52dbca
--- /dev/null
+++ b/modules/sparse/help/pt_BR/chfact.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="chfact" xml:lang="en">
+ <refnamediv>
+ <refname>chfact</refname>
+ <refpurpose>fatoração esparsa de Cholesky</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>spcho=chfact(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title> Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>uma matriz simétrica, positiva e esparsa</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>spcho</term>
+ <listitem>
+ <para>lista contendo os fatores de Cholesky em forma
+ codificada
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>spcho=chfact(A)</literal> computa os fatores esparsos de
+ Cholesky da matriz esparsa <literal>A</literal>, assumida simétrica e
+ positiva definida. A função é baseada nos programas Ng-Peyton (ORNL). Ver
+ os programas FORTRAN para uma completa descrição das variáveis em
+ <literal>spcho</literal>. Esta função deve ser usada com a função
+ <literal>chsolve</literal>.
+ </para>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chsolve">chsolve</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/chsolve.xml b/modules/sparse/help/pt_BR/chsolve.xml
new file mode 100755
index 000000000..a72657022
--- /dev/null
+++ b/modules/sparse/help/pt_BR/chsolve.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="chsolve" xml:lang="en">
+ <refnamediv>
+ <refname>chsolve</refname>
+ <refpurpose>solucionador esparso de Cholesky</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>sol=chsolve(spcho,rhs)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>spcho</term>
+ <listitem>
+ <para>lista contendo os fatores de Cholesky na forma codificada
+ retornados por chfact
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rhs, sol</term>
+ <listitem>
+ <para>vetores colunas cheios</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>sol=chsolve(spcho,rhs)</literal> computa a solução de
+ <literal>rhs=A*sol</literal>, com <literal>A</literal> uma matriz
+ simétrica e positiva definida. Esta função é baseada nos programas
+ Ng-Peyton (ORNL). Veja os programas FORTRAN para uma descrição completa
+ das variáveis em <literal>spcho</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+A=sprand(20,20,0.1);
+A=A*A'+eye();
+spcho=chfact(A);
+sol=(1:20)';rhs=A*sol;
+spcho=chfact(A);
+chsolve(spcho,rhs)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="chfact">chfact</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="spchol">spchol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/decomposition/CHAPTER b/modules/sparse/help/pt_BR/decomposition/CHAPTER
new file mode 100755
index 000000000..ccebc80d8
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Decompositions
diff --git a/modules/sparse/help/pt_BR/decomposition/ludel.xml b/modules/sparse/help/pt_BR/decomposition/ludel.xml
new file mode 100755
index 000000000..427bc9743
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/ludel.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ludel" xml:lang="en">
+ <refnamediv>
+ <refname>ludel</refname>
+ <refpurpose>função utilitária usada com lufact</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>ludel(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>manipulador para fatores lu esparsos (saída de lufact)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ Esta função é usada de modo conjunto com <literal>lufact</literal>.
+ Ela limpa o espaço de memória interna usado para guardar o resultado de
+ <literal>lufact</literal>.
+ </para>
+ <para>A seqüência de comandos
+ <literal>[p,r]=lufact(A);x=lusolve(p,b);ludel(p);</literal> resolve o
+ sistema linear esparso <literal>A*x = b</literal> e limpa
+ <literal>p</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Ver Também </title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/decomposition/lufact.xml b/modules/sparse/help/pt_BR/decomposition/lufact.xml
new file mode 100755
index 000000000..b90c5d284
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/lufact.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="lufact" xml:lang="en">
+ <refnamediv>
+ <refname>lufact</refname>
+ <refpurpose>fatoração LU esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>[hand,rk]=lufact(A,prec)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz quadrada esparsa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>manipulador para fatores LU esparsos </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>rk</term>
+ <listitem>
+ <para>inteiro (posto de A) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>prec</term>
+ <listitem>
+ <para>
+ vetor de tamanho 2 <literal>prec=[eps,reps]</literal>
+ fornecendo os limiares absoluto e relativo.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>[hand,rk]=lufact(A)</literal> realiza a fatoração LU da
+ matriz esparsa <literal>A</literal>. <literal>hand</literal> (sem
+ exibição) é usado por <literal>lusolve</literal> (para resolver sistemas
+ lineares) e <literal>luget</literal> (para retirar os fatores).
+ <literal>hand</literal> deve ser limpo pelo comando:
+ <literal>ludel(hand)</literal>;
+ </para>
+ <para>A matriz A não precisa ser de posto cheio, mas deve ser quadrada
+ (desde que A é assumida como sendo esparsa, pode-se adicionar 0, se
+ necessário, para quadrá-la).
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>eps :</term>
+ <listitem>
+ <para>a magnitude absoluta que um elemento deve ter para ser
+ considerado um candidato a pivô, exceto como último recurso. Este
+ número deve ser posto de modo a ser significantemente menor que o
+ menor elemento da diagonal que se espera estar localizado na matriz.
+ O valor padrão é <literal>%eps</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>reps :</term>
+ <listitem>
+ <para>Este número determina qual será o limiar relativo do pivô.
+ Deve estar entre 0 e 1. Se for 1, então o método de pivoteamento
+ torna-se pivotação completa, que é muito lento e tende a completar a
+ matriz. Se o número acertado é próximo de 0, o método de
+ pivoteamento torna-se estritamente de Markowitz, sem limiar. O
+ limiar de pivô é usado para eliminar candidatos a pivô que poderiam
+ causar crescimento excessivo de elementos se fossem usados.
+ Crescimento de elementos é a causa dos erros de arredondamento.
+ Crescimento de elementos ocorre mesmo em matrizes bem condicionadas.
+ Definir o reps como um número grande reduzirá o crescimento de
+ elementos e os erros de arredondamento, mas colocá-lo muito grande
+ aumentará muito o tempo de execução e resultará num grande número de
+ preenchimentos. Se isto ocorrer, a precisão pode ficar prejudicada
+ por causa do grande número de operações requeridas na matriz devido
+ ao grande número de preenchimentos. 0.001 parece um bom valor, e é o
+ valor default. O default é escolhido fornecendo-se um valor maior
+ que 1 ou menor que ou igual a 0. Este valor deve ser aumentado e a
+ matriz resolvida se o crescimento for excessivo. Mudar o limiar do
+ pivô não melhora o desempenho em matrizes onde o crescimento é
+ baixo, como é geralmente o caso de matrizes mal-condicionadas. reps
+ foi escolhido para uso com matrizes quase diagonalmente dominantes
+ como uma matriz de admissão de nó e nó modificado. Para estas
+ matrizes, geralmente o melhor é usar pivotação diagonal. Para
+ matrizes sem uma diagonal forte, geralmente é melhor usar um limiar
+ maior, como 0.01 ou 0.1.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,5);b=rand(5,1);A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);a*x-b
+ludel(h)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/decomposition/luget.xml b/modules/sparse/help/pt_BR/decomposition/luget.xml
new file mode 100755
index 000000000..2025bac26
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/luget.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="luget" xml:lang="en">
+ <refnamediv>
+ <refname>luget</refname>
+ <refpurpose>extração dos fatores LU esparsos</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>[P,L,U,Q]=luget(hand)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>
+ manipulador, saída de <literal>lufact</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P</term>
+ <listitem>
+ <para>matriz de permutação esparsa</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>L</term>
+ <listitem>
+ <para>
+ matriz esparsa, triangular infeiror se <literal>hand</literal>
+ é obtida de uma matriz não-singular
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>U</term>
+ <listitem>
+ <para>matriz quadrada triangular superior esparsa não-snigular
+ preenchida com 1 ao longo da diagonal principal
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Q</term>
+ <listitem>
+ <para>matriz de permutação esparsa</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>[P,L,U,Q]=luget(hand)</literal> com <literal>hand</literal>
+ obtida pelo comando <literal>[hand,rk]=lufact(A)</literal> com
+ <literal>A</literal> uma matriz esparsa retorna quatro matrizes esparsas
+ tais que <literal>P*L*U*Q=A</literal>.
+ </para>
+ <para>A matriz A não precisa ser de posto cheio, mas deve ser quadrada
+ (desde que A é assumida esparsa, pode-se adicionar 0, se necessário, para
+ quadrar A).
+ </para>
+ <para>
+ Se <literal>A</literal> é singular, a matriz <literal>L</literal> é
+ de colunas comprimidas (com <literal>rk</literal> colunas independentes
+ não-nulas): a matriz não-singular esparsa <literal>Q'*inv(U)</literal>
+ comprime em colunas <literal>A</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+a=rand(5,2)*rand(2,5);A=sparse(a);
+[hand,rk]=lufact(A);[P,L,U,Q]=luget(hand);
+full(L), P*L*U*Q-A
+clean(P*L*U*Q-A)
+ludel(hand)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também </title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="clean">clean</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/decomposition/lusolve.xml b/modules/sparse/help/pt_BR/decomposition/lusolve.xml
new file mode 100755
index 000000000..3011c9513
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/lusolve.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="lusolve" xml:lang="en">
+ <refnamediv>
+ <refname>lusolve</refname>
+ <refpurpose>solucionador de sistemas lineares esparsos</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>x=lusolve(hand,b)
+ x=lusolve(A,b)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>b</term>
+ <listitem>
+ <para>matriz de reais completa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz quadrada de reais esparsa e invertível </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hand</term>
+ <listitem>
+ <para>manipulador para fatores de lu esparsos previamente computados
+ (saída de lufact)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>x</term>
+ <listitem>
+ <para>matriz de reais completa </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>x=lusolve(hand,b)</literal> resolve o sistema linear
+ esparso <literal>A*x = b</literal>.
+ </para>
+ <para>
+ <literal>[hand,rk]=lufact(A)</literal> é a saída de lufact.
+ </para>
+ <para>
+ <literal>x=lusolve(A,b)</literal> resolve o sistema linear esparso
+ <literal>A*x = b</literal>
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+[h,rk]=lufact(sp);x=lusolve(h,[1;1;1;1]);ludel(h)
+rk,sp*x
+
+non_zeros=[1,2,3,4];rows_cols=[1,1;2,2;3,3;4,4];
+sp=sparse(rows_cols,non_zeros);
+x=lusolve(sp,-ones(4,1));
+sp*x
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ <member>
+ <link linkend="slash">slash</link>
+ </member>
+ <member>
+ <link linkend="backslash">backslash</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/decomposition/spchol.xml b/modules/sparse/help/pt_BR/decomposition/spchol.xml
new file mode 100755
index 000000000..7388acd2e
--- /dev/null
+++ b/modules/sparse/help/pt_BR/decomposition/spchol.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spchol" xml:lang="en">
+ <refnamediv>
+ <refname>spchol</refname>
+ <refpurpose>fatoração esparsa de Cholesky</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>[R,P] = spchol(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matriz simétrica, esparsa e positiva definida de reais </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>P</term>
+ <listitem>
+ <para>matriz de permutação </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>R</term>
+ <listitem>
+ <para>fator de Cholesky</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>[R,P] = spchol(X)</literal> produz uma matriz triângular
+ inferior <literal>R</literal> tal que <literal>P*R*R'*P' =
+ X
+ </literal>
+ .
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+X=[
+3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0. ;
+0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0. ;
+0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0. ;
+2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0. ;
+0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4. ;
+0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0. ;
+2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0. ;
+0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0. ;
+2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0. ;
+0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0. ;
+0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+X=sparse(X);[R,P] = spchol(X);
+max(P*R*R'*P'-X)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="lusolve">lusolve</link>
+ </member>
+ <member>
+ <link linkend="luget">luget</link>
+ </member>
+ <member>
+ <link linkend="chol">chol</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/matrixmanip/CHAPTER b/modules/sparse/help/pt_BR/matrixmanip/CHAPTER
new file mode 100755
index 000000000..a797a77e1
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Manipulation
diff --git a/modules/sparse/help/pt_BR/matrixmanip/nnz.xml b/modules/sparse/help/pt_BR/matrixmanip/nnz.xml
new file mode 100755
index 000000000..eb9971745
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/nnz.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="nnz" xml:lang="en">
+ <refnamediv>
+ <refname>nnz</refname>
+ <refpurpose>número de entradas não-nulas de uma matriz</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>n=nnz(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matriz de reais ou complexos esparsa (ou cheia) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>n</term>
+ <listitem>
+ <para>inteiro, número de elementos não-nulos de X. </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>nnz</literal> conta o número de entradas não-nulas de uma
+ matriz esparsa ou cheia.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3]);
+nnz(sp)
+a=[1 0 0 0 2];
+nnz(a)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/matrixmanip/speye.xml b/modules/sparse/help/pt_BR/matrixmanip/speye.xml
new file mode 100755
index 000000000..fe21e17d6
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/speye.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="speye" xml:lang="en">
+ <refnamediv>
+ <refname>speye</refname>
+ <refpurpose>matriz identidade esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>Isp=speye(nrows,ncols)
+ Isp=speye(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>inteiro (número de linhas) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>inteiro (número de colunas) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz identidade esparsa </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>Isp=speye(nrows,ncols)</literal> retorna uma matriz
+ identidade esparsa <literal>Isp</literal> com <literal>nrows</literal>
+ linhas e , <literal>ncols</literal> colunas (matrizes identidades
+ não-quadradas têm um número máximo de algarismos 1 na diagonal
+ principal).
+ </para>
+ <para>
+ <literal>Isp=speye(A)</literal> retorna uma matriz identidade
+ esparsa com as mesmas dimensões de <literal>A</literal>.
+ Se<literal>[m,n]=size(A)</literal>, <literal>speye(m,n)</literal> e
+ <literal>speye(A)</literal> são equivalentes. Em particular
+ <literal>speye(3)</literal> não é equivalente a
+ <literal>speye(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+eye(3,3)-full(speye(3,3))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/matrixmanip/spones.xml b/modules/sparse/help/pt_BR/matrixmanip/spones.xml
new file mode 100755
index 000000000..f9f099ae6
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/spones.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spones" xml:lang="en">
+ <refnamediv>
+ <refname>spones</refname>
+ <refpurpose>matriz esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>sp=spones(A)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>sp=spones(A)</literal> gera uma matriz com a mesma
+ estrutura de espargimento de <literal>A</literal>, mas com 1 em posições
+ não-nulas;
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos </title>
+ <programlisting role="example"><![CDATA[
+A=sprand(10,12,0.1);
+sp=spones(A)
+B = A~=0
+bool2s(B)
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spzeros">spzeros</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/matrixmanip/sprand.xml b/modules/sparse/help/pt_BR/matrixmanip/sprand.xml
new file mode 100755
index 000000000..00d9e12bd
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/sprand.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sprand" xml:lang="en">
+ <refnamediv>
+ <refname>sprand</refname>
+ <refpurpose>matriz esparsa randômica</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>sp=sprand(nrows,ncols,fill [,typ])</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>inteiro (número de linhas) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>inteiro (número de colunas)</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>fill</term>
+ <listitem>
+ <para>coeficiente de preenchimento (densidade) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>typ</term>
+ <listitem>
+ <para>
+ string (<literal>'uniform'</literal> (padrão) ou
+ <literal>'normal'</literal>)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz esparsa</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>sp=sprand(nrows,ncols,fill)</literal> retorna uma matriz
+ esparsa <literal>sp</literal> com <literal>nrows</literal> linhas e
+ <literal>ncols</literal> colunas e aproximadamente
+ <literal>fill*nrows*ncols</literal> entradas não-nulas.
+ </para>
+ <para>
+ Se <literal>typ='uniform'</literal> valores uniformemente
+ distribuídos em [0,1] são gerados. Se <literal>typ='normal'</literal>
+ valores normalmente distribuídos são gerados (média=0 e desvio
+ padrão=1).
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+W=sprand(100,1000,0.001);
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="rand">rand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/matrixmanip/spzeros.xml b/modules/sparse/help/pt_BR/matrixmanip/spzeros.xml
new file mode 100755
index 000000000..ade8f85a8
--- /dev/null
+++ b/modules/sparse/help/pt_BR/matrixmanip/spzeros.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spzeros" xml:lang="en">
+ <refnamediv>
+ <refname>spzeros</refname>
+ <refpurpose>matriz nula esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>sp=spzeros(nrows,ncols)
+ sp=spzeros(A)
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>nrows</term>
+ <listitem>
+ <para>inteiro (número de linhas) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ncols</term>
+ <listitem>
+ <para>inteiro (número de colunas) </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz nula esparsa </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>sp=spzeros(nrows,ncols)</literal> retorna uma matriz nula
+ esparsa <literal>sp</literal> com <literal>nrows</literal> linhas e,
+ <literal>ncols</literal> colunas. (Equivalente a
+ <literal>sparse([],[],[nrow,ncols])</literal>)
+ </para>
+ <para>
+ <literal>sp=spzeros(A)</literal> retorna uma matriz nula esparsa com
+ as mesmas dimensões que <literal>A</literal>. Se
+ <literal>[m,n]=size(A)</literal>, <literal>spzeros(m,n)</literal> e
+ <literal>spzeros(A)</literal> são equivalentes. Em particular
+ <literal>spzeros(3)</literal> não é equivalente a
+ <literal>spzeros(3,3)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+m=spzeros(2,2)
+a=rand(10,12);
+m=spzeros(a)
+sum(spzeros(1000,1000))
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="eye">eye</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="spones">spones</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/CHAPTER b/modules/sparse/help/pt_BR/sparseconvert/CHAPTER
new file mode 100755
index 000000000..42d5e0bf2
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/CHAPTER
@@ -0,0 +1 @@
+title = Sparse Matrix Conversion
diff --git a/modules/sparse/help/pt_BR/sparseconvert/adj2sp.xml b/modules/sparse/help/pt_BR/sparseconvert/adj2sp.xml
new file mode 100755
index 000000000..b792725d7
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/adj2sp.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="adj2sp" xml:lang="en">
+ <refnamediv>
+ <refname>adj2sp</refname>
+ <refpurpose>converte forma de adjacência para matriz esparsa </refpurpose>
+ </refnamediv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento (n+1). </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>adjncy</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento nz contendo os índices de
+ linha para os elementos correspondentes em anz
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>anz</term>
+ <listitem>
+ <para>vetor coluna de comprimento nz contendo os elementos não-nulos
+ de A
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>
+ vetor linha com duas entradas, <literal>mn=size(A)</literal>
+ (opcional).
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz quadrada esparsa de reais ou complexos (nz entradas
+ não-nulas)
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <programlisting role=""><![CDATA[
+adj2sp converte uma representação em forma de adjacência de uma matriz
+em sua representação padrão do Scilab (função utilitária).
+xadj, adjncy, anz = representação de adjacência de A i.e:
+ ]]></programlisting>
+ <para>
+ <literal>xadj(j+1)-xadj(j)</literal> = número de entradas não-nulas
+ na linha j. <literal>adjncy</literal> = índice de coluna das entradas
+ não-nulas nas linha 1, linha 2..., linha n.<literal> anz</literal> =
+ valores das entradas não-nulas nas linha 1, linha 2,..., linha n.
+ <literal>xadj</literal> é um vetor (coluna) de tamanho n+1 e
+ <literal>adjncy</literal> é um vetor (coluna) de inteiros de tamanho
+ <literal>nz=nnz(A)</literal>. <literal>anz</literal> é um vetor de reais
+ de tamanho <literal>nz=nnz(A)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+A = sprand(100,50,.05);
+[xadj,adjncy,anz]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,adjncy,anz,[n,m]);
+A-p,
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sp2adj">sp2adj</link>
+ </member>
+ <member>
+ <link linkend="spcompack">spcompack</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/full.xml b/modules/sparse/help/pt_BR/sparseconvert/full.xml
new file mode 100755
index 000000000..b362e23aa
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/full.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="full" xml:lang="en">
+ <refnamediv>
+ <refname>full</refname>
+ <refpurpose>conversão de matriz esparsa para cheia (completa)</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>X=full(sp)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz esparsa (ou cheia) de reais ou complexos </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matriz cheia (completa)</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>X=full(sp)</literal> converte a matriz esparsa
+ <literal>sp</literal> em sua representação cheia (completa). (Se
+ <literal>sp</literal> já é cheia, então <literal>X</literal> é igual a
+ <literal>sp</literal>).
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;5,4;3,1],[1,2,3]);
+A=full(sp)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/mtlb_sparse.xml b/modules/sparse/help/pt_BR/sparseconvert/mtlb_sparse.xml
new file mode 100755
index 000000000..7d6072515
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/mtlb_sparse.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="mtlb_sparse" xml:lang="en">
+ <refnamediv>
+ <refname>mtlb_sparse</refname>
+ <refpurpose>converte matriz esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>Y=mtlb_sparse(X)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Y</term>
+ <listitem>
+ <para>matriz esparsa em formato Matlab </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>Y=mtlb_sparse(X)</literal> é usado para converter
+ <literal>X</literal>, uma matriz esparsa Scilab, para formato Matlab.
+ <literal>Y</literal> é uma variável de tipo 7, i.e.,
+ <literal>type(Y)</literal> é igual a 7. Esta função deve ser usada em
+ mexfiles (um mexfile Matlab contendo matrizes esparsas pode ser usado
+ apenas se as matrizes esparsas do Scilab forem convertidas para este
+ formato). As funções <literal>full</literal> e <literal>spget</literal>
+ funcionam com este formato.
+ </para>
+ <para>Outras operações e funções usando este formato podem ficar
+ sobrecarregadas com funções do Scilab usando o prefixo "%msp". Por
+ exemplo, a função <literal>%msp_p(x)</literal> (ver diretório
+ SCI/modules/overloading/macros) é usada para exibir tais objetos "tipo 7".
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+X=sparse(rand(2,2)); Y=mtlb_sparse(X);
+Y, full(Y), [ij,v,mn]=spget(Y)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/sp2adj.xml b/modules/sparse/help/pt_BR/sparseconvert/sp2adj.xml
new file mode 100755
index 000000000..f4b6d1009
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/sp2adj.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sp2adj" xml:lang="en">
+ <refnamediv>
+ <refname>sp2adj</refname>
+ <refpurpose>converte uma matriz esparsa para forma de
+ adjacência
+ </refpurpose>
+ </refnamediv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>A</term>
+ <listitem>
+ <para>matriz esparsa de reais ou complexos (nz entradas não-nulas)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento (n+1). </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>adjncy</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento nz contendo os índices de
+ linha para os elementos correspondentes em anz
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>anz</term>
+ <listitem>
+ <para>vetor coluna de comprimento nz contendo os elementos não-nulos
+ de A
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <programlisting role=""><![CDATA[
+sp2adj converte uma matriz esparsa para usa forma de adjacência
+(função utilitária).
+A = matriz esparsa n x m . xadj, adjncy, anz = representação
+em adjacência de A, i.e.:
+ ]]></programlisting>
+ <para>
+ <literal>xadj(j+1)-xadj(j)</literal> = número de entradas não-nulas
+ na linha j. <literal>adjncy</literal> = índice de coluna das entradas
+ não-nulas nas linha 1, linha 2,..., linha n. <literal>anz</literal> =
+ valores de entradas não-nulas nas linha 1, linha 2,..., linha n.
+ <literal>xadj</literal> é um vetor (coluna) de tamanho n+1 e
+ <literal>adjncy</literal> é um vetor (coluna) de inteiros de tamanho
+ <literal>nz=nnz(A)</literal>. <literal>anz</literal> é um vetor de reais
+ de tamanho <literal>nz=nnz(A)</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos </title>
+ <programlisting role="example"><![CDATA[
+A = sprand(100,50,.05);
+[xadj,adjncy,anz]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,adjncy,anz,[n,m]);
+A-p,
+ ]]></programlisting>
+ </refsection>
+ <refsection role="see also">
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="adj2sp">adj2sp</link>
+ </member>
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="spcompack">spcompack</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/sparse.xml b/modules/sparse/help/pt_BR/sparseconvert/sparse.xml
new file mode 100755
index 000000000..7950c5676
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/sparse.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="sparse" xml:lang="en">
+ <refnamediv>
+ <refname>sparse</refname>
+ <refpurpose>definição de matriz esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>sp=sparse(X)
+ sp=sparse(ij,v [,mn])
+ </synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>X</term>
+ <listitem>
+ <para>matriz completa (ou esparsa) de reais ou complexos </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ij</term>
+ <listitem>
+ <para>matriz de inteiros de duas colunas (índices das entradas não
+ nulas)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>vetor</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>vetor de inteiros com duas entradas (dimensão de linha,
+ dimensão de coluna)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz esparsa </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>sparse</literal> é usado para construir uma matriz esparsa.
+ Apenas entradas não-nulas são armazenadas.
+ </para>
+ <para>
+ <literal>sp = sparse(X)</literal> converte uma matriz completa para
+ sua forma esparsa retirando qualquer elemento nulo. (Se
+ <literal>X</literal> já é esparsa <literal>sp</literal> é
+ <literal>X</literal>).
+ </para>
+ <para>
+ <literal>sp=sparse(ij,v [,mn])</literal> constrói uma matriz esparsa
+ <literal>mn(1)</literal>-por-<literal>mn(2)</literal> sparse matrix com
+ <literal>sp(ij(k,1),ij(k,2))=v(k)</literal>. <literal>ij</literal> e
+ <literal>v</literal> devem ter a mesma dimensão de coluna. Se o parâmetro
+ opcional <literal>mn</literal> não for dado, as dimensões da matriz
+ <literal>sp</literal> são os valores máximos de <literal>ij(:,1)</literal>
+ e <literal>ij(:,2)</literal> respectivamente.
+ </para>
+ <para>Operações (concatenação, adição, etc,) com matrizes esparsas são
+ feitas usando a mesma sintaxe para matrizes completas.
+ </para>
+ <para>Funções elementares também estão disponíveis
+ (<literal>abs,maxi,sum,diag,...</literal>) para matrizes esparsas.
+ </para>
+ <para>Operações mistas (completas-esparsas) são permitidas. Os resultados
+ são completos ou esparsos dependendo das operações.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+size(sp)
+x=rand(2,2);abs(x)-full(abs(sparse(x)))
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="full">full</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/spcompack.xml b/modules/sparse/help/pt_BR/sparseconvert/spcompack.xml
new file mode 100755
index 000000000..a9de7f93d
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/spcompack.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spcompack" xml:lang="en">
+ <refnamediv>
+ <refname>spcompack</refname>
+ <refpurpose>converte uma representação de adjacência comprimida em
+ representação de adjacência padrão
+ </refpurpose>
+ </refnamediv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>xadj</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento (n+1). </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>xlindx</term>
+ <listitem>
+ <para>vetor de inteiros de comprimento n+1 (ponteiros). </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>lindx</term>
+ <listitem>
+ <para>vetor de inteiros </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>adjncy</term>
+ <listitem>
+ <para>vetor de inteiros </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <programlisting role=""><![CDATA[
+A função utilitária spcompak é usada para converter uma representação de adjacência
+comprimida em uma representação de adjacência padrão.
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+// A é a matriz esparsa:
+A=[1,0,0,0,0,0,0;
+ 0,1,0,0,0,0,0;
+ 0,0,1,0,0,0,0;
+ 0,0,1,1,0,0,0;
+ 0,0,1,1,1,0,0;
+ 0,0,1,1,0,1,0;
+ 0,0,1,1,0,1,1];
+A=sparse(A);
+//Para esta matriz a representação padrão de adjacência é dada por:
+xadj=[1,2,3,8,12,13,15,16];
+adjncy=[1, 2, 3,4,5,6,7, 4,5,6,7, 5, 6,7, 7];
+//(ver sp2adj).
+// Incrementos no vetor xadj dão o número de entradas não nulas em cada coluna
+// i.e., há 2-1=1 entrada na coluna 1
+// há 3-2=1 entrada na coluna 2
+// há 8-3=5 entradas na coluna 3
+// 12-8=4 4
+//etc.
+//O índice de linha dessas entradas é dado pelo vetor adjncy
+// por exemplo,
+// adjncy (3:7)=adjncy(xadj(3):xadj(4)-1)=[3,4,5,6,7]
+// diz que as 5=xadj(4)-xadj(3) entradas na coluna 3 têm índices de linha
+// 3,4,5,6,7.
+//Na representação compacta, as seqüências repetidas em adjncy
+//são eliminadas.
+//Aqui em adjncy, as seqüências 4,5,6,7 e 7 são eliminadas.
+//A estrutura padrão (xadj,adjncy) toma a forma comprimida (lindx,xlindx)
+lindx=[1, 2, 3,4,5,6,7, 5, 6,7];
+xlindx=[1,2,3,8,9,11];
+//(colunas 4 e 7 de A são eliminadas).
+//A pode ser reconstruída de (xadj,xlindx,lindx).
+[xadj,adjncy,anz]= sp2adj(A);
+adjncy-spcompack(xadj,xlindx,lindx)
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sp2adj">sp2adj</link>
+ </member>
+ <member>
+ <link linkend="adj2sp">adj2sp</link>
+ </member>
+ <member>
+ <link linkend="spget">spget</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/pt_BR/sparseconvert/spget.xml b/modules/sparse/help/pt_BR/sparseconvert/spget.xml
new file mode 100755
index 000000000..725d52944
--- /dev/null
+++ b/modules/sparse/help/pt_BR/sparseconvert/spget.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="spget" xml:lang="en">
+ <refnamediv>
+ <refname>spget</refname>
+ <refpurpose>recupera entradas de matriz esparsa</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <title>Seqüência de Chamamento</title>
+ <synopsis>[ij,v,mn]=spget(sp)</synopsis>
+ </refsynopsisdiv>
+ <refsection>
+ <title>Parâmetros</title>
+ <variablelist>
+ <varlistentry>
+ <term>sp</term>
+ <listitem>
+ <para>matriz esparsa de reais ou complexos </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ij</term>
+ <listitem>
+ <para>matriz de inteiros de duas colunas (índices das entradas
+ não-nulas)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mn</term>
+ <listitem>
+ <para>vetor de inteiros com duas entradas (dimensão de linha,
+ dimensão de coluna)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>v</term>
+ <listitem>
+ <para>vetor coluna </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
+ <title>Descrição</title>
+ <para>
+ <literal>spget</literal> é usado para converter a representação
+ interna de matrizes esparsas na representação padrão <literal>ij,
+ v
+ </literal>
+ .
+ </para>
+ <para>
+ Entradas não-nulas de <literal>sp</literal> estão localizadas em
+ linhas e colunas com índices em <literal>ij</literal>.
+ </para>
+ </refsection>
+ <refsection>
+ <title>Exemplos</title>
+ <programlisting role="example"><![CDATA[
+sp=sparse([1,2;4,5;3,10],[1,2,3])
+[ij,v,mn]=spget(sp);
+ ]]></programlisting>
+ </refsection>
+ <refsection>
+ <title>Ver Também</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="sparse">sparse</link>
+ </member>
+ <member>
+ <link linkend="sprand">sprand</link>
+ </member>
+ <member>
+ <link linkend="speye">speye</link>
+ </member>
+ <member>
+ <link linkend="lufact">lufact</link>
+ </member>
+ </simplelist>
+ </refsection>
+</refentry>
diff --git a/modules/sparse/help/ru_RU/addchapter.sce b/modules/sparse/help/ru_RU/addchapter.sce
new file mode 100755
index 000000000..22a8a387a
--- /dev/null
+++ b/modules/sparse/help/ru_RU/addchapter.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+add_help_chapter("Sparse Matrix",SCI+"/modules/sparse/help/ru_RU",%T);
+
diff --git a/modules/sparse/includes/dynlib_sparse.h b/modules/sparse/includes/dynlib_sparse.h
new file mode 100755
index 000000000..e35cc9b98
--- /dev/null
+++ b/modules/sparse/includes/dynlib_sparse.h
@@ -0,0 +1,28 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2010 - Allan CORNET
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution. The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#ifndef __DYNLIB_SPARSE_H__
+#define __DYNLIB_SPARSE_H__
+
+#ifdef _MSC_VER
+#ifdef SPARSE_EXPORTS
+#define SPARSE_IMPEXP __declspec(dllexport)
+#else
+#define SPARSE_IMPEXP __declspec(dllimport)
+#endif
+#else
+#define SPARSE_IMPEXP
+#endif
+
+#endif /* __DYNLIB_SPARSE_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/includes/gw_sparse.h b/modules/sparse/includes/gw_sparse.h
new file mode 100755
index 000000000..fc81c1ec2
--- /dev/null
+++ b/modules/sparse/includes/gw_sparse.h
@@ -0,0 +1,51 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __GW_SPARSE__
+#define __GW_SPARSE__
+
+#include "machine.h"
+#include "dynlib_sparse.h"
+/*--------------------------------------------------------------------------*/
+SPARSE_IMPEXP int gw_sparse(void);
+/*--------------------------------------------------------------------------*/
+int sci_sparsefunc (char *fname, unsigned long fname_len);
+int sci_spget (char *fname, unsigned long fname_len);
+int sci_full (char *fname, unsigned long fname_len);
+int sci_lufact (char *fname, unsigned long fname_len);
+int sci_lusolve (char *fname, unsigned long fname_len);
+int sci_ludel (char *fname, unsigned long fname_len);
+int sci_luget (char *fname, unsigned long fname_len);
+int sci_spclean (char *fname, unsigned long fname_len);
+int sci_nnz (char *fname, unsigned long fname_len);
+int sci_spmax (char *fname, unsigned long fname_len);
+int sci_spmin (char *fname, unsigned long fname_len);
+int sci_spmatrix (char *fname, unsigned long fname_len);
+int sci_spchol (char *fname, unsigned long fname_len);
+int sci_fadj2sp (char *fname, unsigned long fname_len);
+int sci_spcompa (char *fname, unsigned long fname_len);
+int sci_ordmmd (char *fname, unsigned long fname_len);
+int sci_blkfc1i (char *fname, unsigned long fname_len);
+int sci_blkslvi (char *fname, unsigned long fname_len);
+int sci_inpnvi (char *fname, unsigned long fname_len);
+int sci_sfinit (char *fname, unsigned long fname_len);
+int sci_symfcti (char *fname, unsigned long fname_len);
+int sci_bfinit (char *fname, unsigned long fname_len);
+int sci_msparse (char *fname, unsigned long fname_len);
+int sci_mspget (char *fname, unsigned long fname_len);
+int sci_mfull (char *fname, unsigned long fname_len);
+extern int C2F(scita2lpd) (char *fname, unsigned long fname_len);
+/*--------------------------------------------------------------------------*/
+#endif /* __GW_SPARSE__ */
+/*--------------------------------------------------------------------------*/
+
diff --git a/modules/sparse/includes/sp.h b/modules/sparse/includes/sp.h
new file mode 100755
index 000000000..b00d900dc
--- /dev/null
+++ b/modules/sparse/includes/sp.h
@@ -0,0 +1,52 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SP_H__
+#define __SP_H__
+
+#define SQR(x) ((x)*(x))
+
+#define NB 32 /* block size for dgels */
+#define MINABSTOL 1e-8
+#define MAXITERS 100
+#define TOLC 1e-5 /* tolerance used for dual infeasibility */
+#define SIGTOL 1e-5 /* tolerance used for detecting zero steps
+* dF or dZ */
+#define MINRCOND 1e-8 /* minimum rcond to declare F_i dependent */
+
+/* BLAS 1 */
+double dnrm2_( );
+double ddot_( );
+void dcopy_( );
+void daxpy_( );
+void dscal_( );
+
+/* BLAS 2 */
+void dgemv_( );
+void dspmv_( );
+
+/* BLAS 3 */
+void dgemm_( );
+
+/* LAPACK */
+void dgels_( );
+void dspgst_( );
+void dspev_( );
+void dspgv_( );
+void dtrcon_( );
+
+int sp( /* int m, int L, double *F, int *blck_szs, double *c,
+ double *x, double *Z, double *ul, double nu, double abstol,
+ double reltol, double tv, int *iters, double *work,
+ int lwork, int *iwork, int *info */ );
+
+#endif /* __SP_H__ */
diff --git a/modules/sparse/includes/spConfig.h b/modules/sparse/includes/spConfig.h
new file mode 100755
index 000000000..d79b9e12d
--- /dev/null
+++ b/modules/sparse/includes/spConfig.h
@@ -0,0 +1,549 @@
+/*
+ * CONFIGURATION MACRO DEFINITIONS for sparse matrix routines
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * U.C. Berkeley
+ *
+ * This file contains macros for the sparse matrix routines that are used
+ * to define the personality of the routines. The user is expected to
+ * modify this file to maximize the performance of the routines with
+ * his/her matrices.
+ *
+ * Macros are distinguished by using solely capital letters in their
+ * identifiers. This contrasts with C defined identifiers which are
+ * strictly lower case, and program variable and procedure names which use
+ * both upper and lower case.
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ *
+ */
+
+
+#ifndef spCONFIG_DEFS
+#define spCONFIG_DEFS
+
+
+
+
+#ifdef spINSIDE_SPARSE
+/*
+ * OPTIONS
+ *
+ * These are compiler options. Set each option to one to compile that
+ * section of the code. If a feature is not desired, set the macro
+ * to NO. Recommendations are given in brackets, [ignore them].
+ *
+ * >>> Option descriptions:
+ * Arithmetic Precision
+ * The precision of the arithmetic used by Sparse can be set by
+ * changing changing the spREAL macro. This macro is
+* contained in the file spMatrix.h. It is strongly suggested to
+ * used double precision with circuit simulators. Note that
+ * because C always performs arithmetic operations in double
+ * precision, the only benefit to using single precision is that
+ * less storage is required. There is often a noticeable speed
+ * penalty when using single precision. Sparse internally refers
+ * to a spREAL as a RealNumber.
+ * REAL
+ * This specifies that the routines are expected to handle real
+ * systems of equations. The routines can be compiled to handle
+ * both real and complex systems at the same time, but there is a
+ * slight speed and memory advantage if the routines are complied
+ * to handle only real systems of equations.
+ * spCOMPLEX
+ * This specifies that the routines will be complied to handle
+ * complex systems of equations.
+ * EXPANDABLE
+ * Setting this compiler flag true (1) makes the matrix
+ * expandable before it has been factored. If the matrix is
+ * expandable, then if an element is added that would be
+ * considered out of bounds in the current matrix, the size of
+ * the matrix is increased to hold that element. As a result,
+ * the size of the matrix need not be known before the matrix is
+ * built. The matrix can be allocated with size zero and
+ * expanded.
+ * TRANSLATE
+ * This option allows the set of external row and column numbers
+ * to be non-packed. In other words, the row and column numbers
+ * do not have to be contiguous. The priced paid for this
+ * flexibility is that when TRANSLATE is set true, the time
+ * required to initially build the matrix will be greater because
+ * the external row and column number must be translated into
+ * internal equivalents. This translation brings about other
+ * benefits though. First, the spGetElement() and
+ * spGetAdmittance() routines may be used after the matrix has
+ * been factored. Further, elements, and even rows and columns,
+ * may be added to the matrix, and row and columns may be deleted
+ * from the matrix, after it has been factored. Note that when
+ * the set of row and column number is not a packed set, neither
+ * are the RHS and Solution vectors. Thus the size of these
+ * vectors must be at least as large as the external size, which
+ * is the value of the largest given row or column numbers.
+ * INITIALIZE
+ * Causes the spInitialize(), spGetInitInfo(), and
+ * spInstallInitInfo() routines to be compiled. These routines
+ * allow the user to store and read one pointer in each nonzero
+ * element in the matrix. spInitialize() then calls a user
+ * specified function for each structural nonzero in the matrix,
+ * and includes this pointer as well as the external row and
+ * column numbers as arguments. This allows the user to write
+ * custom matrix initialization routines.
+ * DIAGONAL_PIVOTING
+ * Many matrices, and in particular node- and modified-node
+ * admittance matrices, tend to be nearly symmetric and nearly
+ * diagonally dominant. For these matrices, it is a good idea to
+ * select pivots from the diagonal. With this option enabled,
+ * this is exactly what happens, though if no satisfactory pivot
+ * can be found on the diagonal, an off-diagonal pivot will be
+ * used. If this option is disabled, Sparse does not
+ * preferentially search the diagonal. Because of this, Sparse
+ * has a wider variety of pivot candidates available, and so
+ * presumably fewer fill-ins will be created. However, the
+ * initial pivot selection process will take considerably longer.
+ * If working with node admittance matrices, or other matrices
+ * with a strong diagonal, it is probably best to use
+ * DIAGONAL_PIVOTING for two reasons. First, accuracy will be
+ * better because pivots will be chosen from the large diagonal
+ * elements, thus reducing the chance of growth. Second, a near
+ * optimal ordering will be chosen quickly. If the class of
+ * matrices you are working with does not have a strong diagonal,
+ * do not use DIAGONAL_PIVOTING, but consider using a larger
+ * threshold. When DIAGONAL_PIVOTING is turned off, the following
+ * options and constants are not used: MODIFIED_MARKOWITZ,
+ * MAX_MARKOWITZ_TIES, and TIES_MULTIPLIER.
+ * ARRAY_OFFSET
+ * This determines whether arrays start at an index of zero or one.
+ * This option is necessitated by the fact that standard C
+ * convention dictates that arrays begin with an index of zero but
+ * the standard mathematic convention states that arrays begin with
+ * an index of one. So if you prefer to start your arrays with
+ * zero, or your calling Sparse from FORTRAN, set ARRAY_OFFSET to
+ * NO or 0. Otherwise, set ARRAY_OFFSET to YES or 1. Note that if
+ * you use an offset of one, the arrays that you pass to Sparse
+ * must have an allocated length of one plus the size of the
+ * matrix. ARRAY_OFFSET must be either 0 or 1, no other offsets
+ * are valid.
+ * spSEPARATED_COMPLEX_VECTORS
+ * This specifies the format for complex vectors. If this is set
+ * false then a complex vector is made up of one double sized
+ * array of RealNumber's in which the real and imaginary numbers
+ * are placed in the alternately array in the array. In other
+ * words, the first entry would be Complex[1].Real, then comes
+ * Complex[1].Imag, then Complex[1].Real, etc. If
+ * spSEPARATED_COMPLEX_VECTORS is set true, then each complex
+ * vector is represented by two arrays of RealNumbers, one with
+ * the real terms, the other with the imaginary. [NO]
+ * MODIFIED_MARKOWITZ
+ * This specifies that the modified Markowitz method of pivot
+ * selection is to be used. The modified Markowitz method differs
+ * from standard Markowitz in two ways. First, under modified
+ * Markowitz, the search for a pivot can be terminated early if a
+ * adequate (in terms of sparsity) pivot candidate is found.
+ * Thus, when using modified Markowitz, the initial factorization
+ * can be faster, but at the expense of a suboptimal pivoting
+ * order that may slow subsequent factorizations. The second
+ * difference is in the way modified Markowitz breaks Markowitz
+ * ties. When two or more elements are pivot candidates and they
+ * all have the same Markowitz product, then the tie is broken by
+ * choosing the element that is best numerically. The numerically
+ * best element is the one with the largest ratio of its magnitude
+ * to the magnitude of the largest element in the same column,
+ * excluding itself. The modified Markowitz method results in
+ * marginally better accuracy. This option is most appropriate
+ * for use when working with very large matrices where the initial
+ * factor time represents an unacceptable burden. [NO]
+ * DELETE
+ * This specifies that the spDeleteRowAndCol() routine
+ * should be compiled. Note that for this routine to be
+ * compiled, both DELETE and TRANSLATE should be set true.
+ * STRIP
+ * This specifies that the spStripFills() routine should be compiled.
+ * MODIFIED_NODAL
+ * This specifies that the routine that preorders modified node
+ * admittance matrices should be compiled. This routine results
+ * in greater speed and accuracy if used with this type of
+ * matrix.
+ * QUAD_ELEMENT
+ * This specifies that the routines that allow four related
+ * elements to be entered into the matrix at once should be
+ * compiled. These elements are usually related to an
+ * admittance. The routines affected by QUAD_ELEMENT are the
+ * spGetAdmittance, spGetQuad and spGetOnes routines.
+ * TRANSPOSE
+ * This specifies that the routines that solve the matrix as if
+ * it was transposed should be compiled. These routines are
+ * useful when performing sensitivity analysis using the adjoint
+ * method.
+ * SCALING
+ * This specifies that the routine that performs scaling on the
+ * matrix should be complied. Scaling is not strongly
+ * supported. The routine to scale the matrix is provided, but
+ * no routines are provided to scale and descale the RHS and
+ * Solution vectors. It is suggested that if scaling is desired,
+ * it only be preformed when the pivot order is being chosen [in
+ * spOrderAndFactor()]. This is the only time scaling has
+ * an effect. The scaling may then either be removed from the
+ * solution by the user or the scaled factors may simply be
+ * thrown away. [NO]
+ * DOCUMENTATION
+ * This specifies that routines that are used to document the
+ * matrix, such as spPrint() and spFileMatrix(), should be
+ * compiled.
+ * DETERMINANT
+ * This specifies that the routine spDeterminant() should be complied.
+ * STABILITY
+ * This specifies that spLargestElement() and spRoundoff() should
+ * be compiled. These routines are used to check the stability (and
+ * hence the quality of the pivoting) of the factorization by
+ * computing a bound on the size of the element is the matrix E =
+ * A - LU. If this bound is very high after applying
+ * spOrderAndFactor(), then the pivot threshold should be raised.
+ * If the bound increases greatly after using spFactor(), then the
+ * matrix should probably be reordered.
+ * CONDITION
+ * This specifies that spCondition() and spNorm(), the code that
+ * computes a good estimate of the condition number of the matrix,
+ * should be compiled.
+ * PSEUDOCONDITION
+ * This specifies that spPseudoCondition(), the code that computes
+ * a crude and easily fooled indicator of ill-conditioning in the
+ * matrix, should be compiled.
+ * MULTIPLICATION
+ * This specifies that the routines to multiply the unfactored
+ * matrix by a vector should be compiled.
+ * FORTRAN
+ * This specifies that the FORTRAN interface routines should be
+ * compiled. When interfacing to FORTRAN programs, the ARRAY_OFFSET
+ * options should be set to NO.
+ * DEBUG
+ * This specifies that additional error checking will be compiled.
+ * The type of error checked are those that are common when the
+ * matrix routines are first integrated into a user's program. Once
+ * the routines have been integrated in and are running smoothly, this
+ * option should be turned off.
+ */
+/* Begin options. */
+#define REAL YES
+#define EXPANDABLE YES
+#define TRANSLATE YES
+#define INITIALIZE YES
+#define DIAGONAL_PIVOTING YES
+#define ARRAY_OFFSET NO
+#define MODIFIED_MARKOWITZ NO
+#define SPARSEDELETE YES
+#define STRIP YES
+#define MODIFIED_NODAL YES
+#define QUAD_ELEMENT YES
+#define TRANSPOSE YES
+#define SCALING YES
+#define DOCUMENTATION YES
+#define MULTIPLICATION YES
+#define DETERMINANT YES
+#define STABILITY YES
+#define CONDITION YES
+#define PSEUDOCONDITION YES
+#define FORTRAN YES
+#define DEBUG NO
+
+/*
+ * The following options affect Sparse exports and so are exported as a
+ * side effect. For this reason they use the `sp' prefix. The boolean
+ * constants YES an NO are not defined in spMatrix.h to avoid conflicts
+ * with user code, so use 0 for NO and 1 for YES.
+ */
+#endif /* spINSIDE_SPARSE */
+#define spCOMPLEX 1
+#define spSEPARATED_COMPLEX_VECTORS 0
+#ifdef spINSIDE_SPARSE
+
+
+
+
+
+
+
+/*
+ * MATRIX CONSTANTS
+ *
+ * These constants are used throughout the sparse matrix routines. They
+ * should be set to suit the type of matrix being solved. Recommendations
+ * are given in brackets.
+ *
+ * Some terminology should be defined. The Markowitz row count is the number
+ * of non-zero elements in a row excluding the one being considered as pivot.
+ * There is one Markowitz row count for every row. The Markowitz column
+ * is defined similarly for columns. The Markowitz product for an element
+ * is the product of its row and column counts. It is a measure of how much
+ * work would be required on the next step of the factorization if that
+ * element were chosen to be pivot. A small Markowitz product is desirable.
+ *
+ * >>> Constants descriptions:
+ * DEFAULT_THRESHOLD
+ * The relative threshold used if the user enters an invalid
+ * threshold. Also the threshold used by spFactor() when
+ * calling spOrderAndFactor(). The default threshold should
+ * not be less than or equal to zero nor larger than one. [0.001]
+ * DIAG_PIVOTING_AS_DEFAULT
+ * This indicates whether spOrderAndFactor() should use diagonal
+ * pivoting as default. This issue only arises when
+ * spOrderAndFactor() is called from spFactor().
+ * SPACE_FOR_ELEMENTS
+ * This number multiplied by the size of the matrix equals the number
+ * of elements for which memory is initially allocated in
+ * spCreate(). [6]
+ * SPACE_FOR_FILL_INS
+ * This number multiplied by the size of the matrix equals the number
+ * of elements for which memory is initially allocated and specifically
+ * reserved for fill-ins in spCreate(). [4]
+ * ELEMENTS_PER_ALLOCATION
+ * The number of matrix elements requested from the malloc utility on
+ * each call to it. Setting this value greater than 1 reduces the
+ * amount of overhead spent in this system call. On a virtual memory
+ * machine, its good to allocate slightly less than a page worth of
+ * elements at a time (or some multiple thereof).
+ * [For the VAX, for real only use 41, otherwise use 31]
+ * MINIMUM_ALLOCATED_SIZE
+ * The minimum allocated size of a matrix. Note that this does not
+ * limit the minimum size of a matrix. This just prevents having to
+ * resize a matrix many times if the matrix is expandable, large and
+ * allocated with an estimated size of zero. This number should not
+ * be less than one.
+ * EXPANSION_FACTOR
+ * The amount the allocated size of the matrix is increased when it
+ * is expanded.
+ * MAX_MARKOWITZ_TIES
+ * This number is used for two slightly different things, both of which
+ * relate to the search for the best pivot. First, it is the maximum
+ * number of elements that are Markowitz tied that will be sifted
+ * through when trying to find the one that is numerically the best.
+ * Second, it creates an upper bound on how large a Markowitz product
+ * can be before it eliminates the possibility of early termination
+ * of the pivot search. In other words, if the product of the smallest
+ * Markowitz product yet found and TIES_MULTIPLIER is greater than
+ * MAX_MARKOWITZ_TIES, then no early termination takes place.
+ * Set MAX_MARKOWITZ_TIES to some small value if no early termination of
+ * the pivot search is desired. An array of RealNumbers is allocated
+ * of size MAX_MARKOWITZ_TIES so it must be positive and shouldn't
+ * be too large. Active when MODIFIED_MARKOWITZ is 1 (true). [100]
+ * TIES_MULTIPLIER
+ * Specifies the number of Markowitz ties that are allowed to occur
+ * before the search for the pivot is terminated early. Set to some
+ * large value if no early termination of the pivot search is desired.
+ * This number is multiplied times the Markowitz product to determine
+ * how many ties are required for early termination. This means that
+ * more elements will be searched before early termination if a large
+ * number of fill-ins could be created by accepting what is currently
+ * considered the best choice for the pivot. Active when
+ * MODIFIED_MARKOWITZ is 1 (true). Setting this number to zero
+ * effectively eliminates all pivoting, which should be avoided.
+ * This number must be positive. TIES_MULTIPLIER is also used when
+ * diagonal pivoting breaks down. [5]
+ * DEFAULT_PARTITION
+ * Which partition mode is used by spPartition() as default.
+ * Possibilities include
+ * spDIRECT_PARTITION -- each row used direct addressing, best for
+ * a few relatively dense matrices.
+ * spINDIRECT_PARTITION -- each row used indirect addressing, best
+ * for a few very sparse matrices.
+ * spAUTO_PARTITION -- direct or indirect addressing is chosen on
+ * a row-by-row basis, carries a large overhead, but speeds up
+ * both dense and sparse matrices, best if there is a large
+ * number of matrices that can use the same ordering.
+ */
+
+/* Begin constants. */
+#define DEFAULT_THRESHOLD 1.0e-3
+#define DIAG_PIVOTING_AS_DEFAULT YES
+#define SPACE_FOR_ELEMENTS 6
+#define SPACE_FOR_FILL_INS 4
+#define ELEMENTS_PER_ALLOCATION 31
+#define MINIMUM_ALLOCATED_SIZE 6
+#define EXPANSION_FACTOR 1.5
+#define MAX_MARKOWITZ_TIES 100
+#define TIES_MULTIPLIER 5
+#define DEFAULT_PARTITION spAUTO_PARTITION
+
+
+
+
+
+
+/*
+ * PRINTER WIDTH
+ *
+ * This macro characterize the printer for the spPrint() routine.
+ *
+ * >>> Macros:
+ * PRINTER_WIDTH
+ * The number of characters per page width. Set to 80 for terminal,
+ * 132 for line printer.
+ */
+
+/* Begin printer constants. */
+#define PRINTER_WIDTH 80
+
+
+
+
+
+
+/*
+ * MACHINE CONSTANTS
+ *
+ * These numbers must be updated when the program is ported to a new machine.
+ */
+
+/* Begin machine constants. */
+
+#ifdef notdef /* __STDC__ */
+/*
+ * This code is currently deleted because most ANSI standard C compilers
+ * do not provide the standard header files yet.
+ */
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+# define LARGEST_SHORT_INTEGER SHRT_MAX
+# define LARGEST_LONG_INTEGER LONG_MAX
+#else /* NOT defined(__STDC__) */
+
+/* Apple MacOSX */
+
+#ifdef __APPLE__ /* __STDC__ */
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+# define LARGEST_SHORT_INTEGER SHRT_MAX
+# define LARGEST_LONG_INTEGER LONG_MAX
+#endif /* NOT defined(__STDC__) */
+
+/* VAX machine constants */
+#if (defined(vax) && !defined(netbsd))
+# define MACHINE_RESOLUTION 6.93889e-18
+# define LARGEST_REAL 1.70141e+38
+# define SMALLEST_REAL 2.938743e-39
+# define LARGEST_SHORT_INTEGER 32766
+# define LARGEST_LONG_INTEGER 2147483646
+#endif
+
+/* MIPS machine constants */
+#if (defined(mips) && !defined(netbsd))
+# define MACHINE_RESOLUTION 6.93889e-18
+# define LARGEST_REAL 1.70141e+38
+# define SMALLEST_REAL 2.938743e-39
+# define LARGEST_SHORT_INTEGER 32766
+# define LARGEST_LONG_INTEGER 2147483646
+#endif
+
+
+/* hp9000 machine constants */
+#ifdef hpux
+/* These values are correct for hp9000/300. Should be correct for others. */
+# define MACHINE_RESOLUTION 8.9e-15
+# define LARGEST_REAL 1.79769313486231e+308
+# define SMALLEST_REAL 2.22507385850721e-308
+# define LARGEST_SHORT_INTEGER 32766
+# define LARGEST_LONG_INTEGER 2147483646
+#endif
+
+/* IBM machine constants */
+#ifdef aix
+/** The STDC option works on aix on gives the values that i've copied here */
+# define MACHINE_RESOLUTION 2.2204460492503131e-16
+# define LARGEST_REAL 1.7976931348623158e+308
+# define SMALLEST_REAL 2.2250738585072014e-308
+# define LARGEST_SHORT_INTEGER 32767
+# define LARGEST_LONG_INTEGER 2147483647
+#endif
+
+/* Sun machine constants */
+#if (defined(sun) && !defined(netbsd))
+/* These values are rumored to be the correct values. */
+# define MACHINE_RESOLUTION 8.9e-15
+# define LARGEST_REAL 1.79769313486231e+308
+# define SMALLEST_REAL 2.22507385850721e-308
+# define LARGEST_SHORT_INTEGER 32766
+# define LARGEST_LONG_INTEGER 2147483646
+#endif
+/* DEC alpha machine constant*/
+#if (defined(__alpha) && !defined(netbsd))
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+# define LARGEST_SHORT_INTEGER SHRT_MAX
+# define LARGEST_LONG_INTEGER LONG_MAX
+#endif
+#ifdef linux
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+# define LARGEST_SHORT_INTEGER SHRT_MAX
+# define LARGEST_LONG_INTEGER LONG_MAX
+#endif
+#if defined(netbsd) || defined(freebsd)
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+# define LARGEST_SHORT_INTEGER SHRT_MAX
+# define LARGEST_LONG_INTEGER LONG_MAX
+#endif
+#ifdef _MSC_VER
+# include <limits.h>
+# include <float.h>
+# define MACHINE_RESOLUTION DBL_EPSILON
+# define LARGEST_REAL DBL_MAX
+# define SMALLEST_REAL DBL_MIN
+/* XXXXX : a v'erifier */
+# define LARGEST_SHORT_INTEGER 32766
+# define LARGEST_LONG_INTEGER 2147483646
+#endif
+#endif /* NOT defined(__STDC__) */
+
+/*
+ * ANNOTATION
+ *
+ * This macro changes the amount of annotation produced by the matrix
+ * routines. The annotation is used as a debugging aid. Change the number
+ * associated with ANNOTATE to change the amount of annotation produced by
+ * the program.
+ */
+
+/* Begin annotation definitions. */
+#define ANNOTATE NONE
+
+#define NONE 0
+#define ON_STRANGE_BEHAVIOR 1
+#define FULL 2
+
+#endif /* spINSIDE_SPARSE */
+
+#endif /* spCONFIG_DEFS */
+
+
+
diff --git a/modules/sparse/includes/spDefs.h b/modules/sparse/includes/spDefs.h
new file mode 100755
index 000000000..e2e57b6ea
--- /dev/null
+++ b/modules/sparse/includes/spDefs.h
@@ -0,0 +1,828 @@
+#ifndef __SPDEFS_H__
+#define __SPDEFS_H__
+#include "core_math.h"
+/*
+ * DATA STRUCTURE AND MACRO DEFINITIONS for Sparse.
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains common type definitions and macros for the sparse
+ * matrix routines. These definitions are of no interest to the user.
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ *
+ */
+
+
+
+
+/*
+ * IMPORTS
+ */
+
+/*
+ * If running lint, change some of the compiler options to get a more
+ * complete inspection.
+ */
+
+#ifdef lint
+#undef REAL
+#undef spCOMPLEX
+#undef EXPANDABLE
+#undef TRANSLATE
+#undef INITIALIZE
+#undef SPARSEDELETE
+#undef STRIP
+#undef MODIFIED_NODAL
+#undef QUAD_ELEMENT
+#undef TRANSPOSE
+#undef SCALING
+#undef DOCUMENTATION
+#undef MULTIPLICATION
+#undef DETERMINANT
+#undef CONDITION
+#undef PSEUDOCONDITION
+#undef FORTRAN
+#undef DEBUG
+
+#define REAL YES
+#define spCOMPLEX YES
+#define EXPANDABLE YES
+#define TRANSLATE YES
+#define INITIALIZE YES
+#define SPARSEDELETE YES
+#define STRIP YES
+#define MODIFIED_NODAL YES
+#define QUAD_ELEMENT YES
+#define TRANSPOSE YES
+#define SCALING YES
+#define DOCUMENTATION YES
+#define MULTIPLICATION YES
+#define DETERMINANT YES
+#define CONDITION YES
+#define PSEUDOCONDITION YES
+#define FORTRAN YES
+#define DEBUG YES
+
+#define LINT YES
+#else /* not lint */
+#define LINT NO
+#endif /* not lint */
+
+
+
+/*
+ * MACRO DEFINITIONS
+ *
+ * Macros are distinguished by using solely capital letters in their
+ * identifiers. This contrasts with C defined identifiers which are strictly
+ * lower case, and program variable and procedure names which use both upper
+ * and lower case.
+ */
+
+/* Begin macros. */
+
+/* Boolean data type */
+
+#define SPBOOLEAN int
+#define NO 0
+#define YES 1
+#define NOT !
+#define AND &&
+#define OR ||
+
+/* NULL pointer */
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define SPARSE_ID 0x772773 /* Arbitrary (is Sparse on phone). */
+#define IS_SPARSE(matrix) ((matrix) != NULL && \
+ (matrix)->ID == SPARSE_ID)
+#define IS_VALID(matrix) ((matrix) != NULL && \
+ (matrix)->ID == SPARSE_ID && \
+ (matrix)->Error >= spOKAY && \
+ (matrix)->Error < spFATAL)
+#define IS_FACTORED(matrix) ((matrix)->Factored && !(matrix)->NeedsOrdering)
+
+/* Macro commands */
+/* Macro function that returns the square of a number. */
+#define SQR(a) ((a)*(a))
+
+/* Macro procedure that swaps two entities. */
+#define SWAP(type, a, b) {type swapx; swapx = a; a = b; b = swapx;}
+
+/* Macro function that returns the approx absolute value of a complex number. */
+#if spCOMPLEX
+#define ELEMENT_MAG(ptr) (Abs((ptr)->Real) + Abs((ptr)->Imag))
+#else
+#define ELEMENT_MAG(ptr) ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real)
+#endif
+
+/* Complex assignment statements. */
+#define CMPLX_ASSIGN(to,from) \
+{ (to).Real = (from).Real; \
+ (to).Imag = (from).Imag; \
+}
+#define CMPLX_CONJ_ASSIGN(to,from) \
+{ (to).Real = (from).Real; \
+ (to).Imag = -(from).Imag; \
+}
+#define CMPLX_NEGATE_ASSIGN(to,from) \
+{ (to).Real = -(from).Real; \
+ (to).Imag = -(from).Imag; \
+}
+#define CMPLX_CONJ_NEGATE_ASSIGN(to,from) \
+{ (to).Real = -(from).Real; \
+ (to).Imag = (from).Imag; \
+}
+#define CMPLX_CONJ(a) (a).Imag = -(a).Imag
+#define CMPLX_NEGATE(a) \
+{ (a).Real = -(a).Real; \
+ (a).Imag = -(a).Imag; \
+}
+
+/* Macro that returns the approx magnitude (L-1 norm) of a complex number. */
+#define CMPLX_1_NORM(a) (Abs((a).Real) + Abs((a).Imag))
+
+/* Macro that returns the approx magnitude (L-infinity norm) of a complex. */
+#define CMPLX_INF_NORM(a) (Max (Abs((a).Real),Abs((a).Imag)))
+
+/* Macro function that returns the magnitude (L-2 norm) of a complex number. */
+#define CMPLX_2_NORM(a) (sqrt((a).Real*(a).Real + (a).Imag*(a).Imag))
+
+/* Macro function that performs complex addition. */
+#define CMPLX_ADD(to,from_a,from_b) \
+{ (to).Real = (from_a).Real + (from_b).Real; \
+ (to).Imag = (from_a).Imag + (from_b).Imag; \
+}
+
+/* Macro function that performs complex subtraction. */
+#define CMPLX_SUBT(to,from_a,from_b) \
+{ (to).Real = (from_a).Real - (from_b).Real; \
+ (to).Imag = (from_a).Imag - (from_b).Imag; \
+}
+
+/* Macro function that is equivalent to += operator for complex numbers. */
+#define CMPLX_ADD_ASSIGN(to,from) \
+{ (to).Real += (from).Real; \
+ (to).Imag += (from).Imag; \
+}
+
+/* Macro function that is equivalent to -= operator for complex numbers. */
+#define CMPLX_SUBT_ASSIGN(to,from) \
+{ (to).Real -= (from).Real; \
+ (to).Imag -= (from).Imag; \
+}
+
+/* Macro function that multiplies a complex number by a scalar. */
+#define SCLR_MULT(to,sclr,cmplx) \
+{ (to).Real = (sclr) * (cmplx).Real; \
+ (to).Imag = (sclr) * (cmplx).Imag; \
+}
+
+/* Macro function that multiply-assigns a complex number by a scalar. */
+#define SCLR_MULT_ASSIGN(to,sclr) \
+{ (to).Real *= (sclr); \
+ (to).Imag *= (sclr); \
+}
+
+/* Macro function that multiplies two complex numbers. */
+#define CMPLX_MULT(to,from_a,from_b) \
+{ (to).Real = (from_a).Real * (from_b).Real - \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag = (from_a).Real * (from_b).Imag + \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/* Macro function that implements to *= from for complex numbers. */
+#define CMPLX_MULT_ASSIGN(to,from) \
+{ RealNumber to_real_ = (to).Real; \
+ (to).Real = to_real_ * (from).Real - \
+ (to).Imag * (from).Imag; \
+ (to).Imag = to_real_ * (from).Imag + \
+ (to).Imag * (from).Real; \
+}
+
+/* Macro function that multiplies two complex numbers, the first of which is
+ * conjugated. */
+#define CMPLX_CONJ_MULT(to,from_a,from_b) \
+{ (to).Real = (from_a).Real * (from_b).Real + \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag = (from_a).Real * (from_b).Imag - \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/* Macro function that multiplies two complex numbers and then adds them
+ * to another. to = add + mult_a * mult_b */
+#define CMPLX_MULT_ADD(to,mult_a,mult_b,add) \
+{ (to).Real = (mult_a).Real * (mult_b).Real - \
+ (mult_a).Imag * (mult_b).Imag + (add).Real; \
+ (to).Imag = (mult_a).Real * (mult_b).Imag + \
+ (mult_a).Imag * (mult_b).Real + (add).Imag; \
+}
+
+/* Macro function that subtracts the product of two complex numbers from
+ * another. to = subt - mult_a * mult_b */
+#define CMPLX_MULT_SUBT(to,mult_a,mult_b,subt) \
+{ (to).Real = (subt).Real - (mult_a).Real * (mult_b).Real + \
+ (mult_a).Imag * (mult_b).Imag; \
+ (to).Imag = (subt).Imag - (mult_a).Real * (mult_b).Imag - \
+ (mult_a).Imag * (mult_b).Real; \
+}
+
+/* Macro function that multiplies two complex numbers and then adds them
+ * to another. to = add + mult_a* * mult_b where mult_a* represents mult_a
+ * conjugate. */
+#define CMPLX_CONJ_MULT_ADD(to,mult_a,mult_b,add) \
+{ (to).Real = (mult_a).Real * (mult_b).Real + \
+ (mult_a).Imag * (mult_b).Imag + (add).Real; \
+ (to).Imag = (mult_a).Real * (mult_b).Imag - \
+ (mult_a).Imag * (mult_b).Real + (add).Imag; \
+}
+
+/* Macro function that multiplies two complex numbers and then adds them
+ * to another. to += mult_a * mult_b */
+#define CMPLX_MULT_ADD_ASSIGN(to,from_a,from_b) \
+{ (to).Real += (from_a).Real * (from_b).Real - \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag += (from_a).Real * (from_b).Imag + \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/* Macro function that multiplies two complex numbers and then subtracts them
+ * from another. */
+#define CMPLX_MULT_SUBT_ASSIGN(to,from_a,from_b) \
+{ (to).Real -= (from_a).Real * (from_b).Real - \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag -= (from_a).Real * (from_b).Imag + \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/* Macro function that multiplies two complex numbers and then adds them
+ * to the destination. to += from_a* * from_b where from_a* represents from_a
+ * conjugate. */
+#define CMPLX_CONJ_MULT_ADD_ASSIGN(to,from_a,from_b) \
+{ (to).Real += (from_a).Real * (from_b).Real + \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag += (from_a).Real * (from_b).Imag - \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/* Macro function that multiplies two complex numbers and then subtracts them
+ * from the destination. to -= from_a* * from_b where from_a* represents from_a
+ * conjugate. */
+#define CMPLX_CONJ_MULT_SUBT_ASSIGN(to,from_a,from_b) \
+{ (to).Real -= (from_a).Real * (from_b).Real + \
+ (from_a).Imag * (from_b).Imag; \
+ (to).Imag -= (from_a).Real * (from_b).Imag - \
+ (from_a).Imag * (from_b).Real; \
+}
+
+/*
+ * Macro functions that provide complex division.
+ */
+
+/* Complex division: to = num / den */
+#define CMPLX_DIV(to,num,den) \
+{ RealNumber r_, s_; \
+ if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR \
+ ((den).Real < (den).Imag AND (den).Real <= -(den).Imag)) \
+ { r_ = (den).Imag / (den).Real; \
+ s_ = (den).Real + r_*(den).Imag; \
+ (to).Real = ((num).Real + r_*(num).Imag)/s_; \
+ (to).Imag = ((num).Imag - r_*(num).Real)/s_; \
+ } \
+ else \
+ { r_ = (den).Real / (den).Imag; \
+ s_ = (den).Imag + r_*(den).Real; \
+ (to).Real = (r_*(num).Real + (num).Imag)/s_; \
+ (to).Imag = (r_*(num).Imag - (num).Real)/s_; \
+ } \
+}
+
+/* Complex division and assignment: num /= den */
+#define CMPLX_DIV_ASSIGN(num,den) \
+{ RealNumber r_, s_, t_; \
+ if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR \
+ ((den).Real < (den).Imag AND (den).Real <= -(den).Imag)) \
+ { r_ = (den).Imag / (den).Real; \
+ s_ = (den).Real + r_*(den).Imag; \
+ t_ = ((num).Real + r_*(num).Imag)/s_; \
+ (num).Imag = ((num).Imag - r_*(num).Real)/s_; \
+ (num).Real = t_; \
+ } \
+ else \
+ { r_ = (den).Real / (den).Imag; \
+ s_ = (den).Imag + r_*(den).Real; \
+ t_ = (r_*(num).Real + (num).Imag)/s_; \
+ (num).Imag = (r_*(num).Imag - (num).Real)/s_; \
+ (num).Real = t_; \
+ } \
+}
+
+/* Complex reciprocation: to = 1.0 / den */
+#define CMPLX_RECIPROCAL(to,den) \
+{ RealNumber r_; \
+ if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR \
+ ((den).Real < (den).Imag AND (den).Real <= -(den).Imag)) \
+ { r_ = (den).Imag / (den).Real; \
+ (to).Imag = -r_*((to).Real = 1.0/((den).Real + r_*(den).Imag)); \
+ } \
+ else \
+ { r_ = (den).Real / (den).Imag; \
+ (to).Real = -r_*((to).Imag = -1.0/((den).Imag + r_*(den).Real));\
+ } \
+}
+
+
+
+
+
+
+/*
+ * ASSERT and ABORT
+ *
+ * Macro used to assert that if the code is working correctly, then
+ * a condition must be true. If not, then execution is terminated
+ * and an error message is issued stating that there is an internal
+ * error and giving the file and line number. These assertions are
+ * not evaluated unless the DEBUG flag is true.
+ */
+
+#if DEBUG
+#define ASSERT(condition) if (NOT(condition)) ABORT()
+#else
+#define ASSERT(condition)
+#endif
+
+#if DEBUG
+#define ABORT() \
+{ (void)fflush(stdout); \
+ (void)fprintf(stderr, _("sparse: panic in file `%s' at line %d.\n"), \
+ __FILE__, __LINE__); \
+ (void)fflush(stderr); \
+ abort(); \
+}
+#else
+#define ABORT()
+#endif
+
+
+
+
+
+/*
+ * IMAGINARY VECTORS
+ *
+ * The imaginary vectors iRHS and iSolution are only needed when the
+ * options spCOMPLEX and spSEPARATED_COMPLEX_VECTORS are set. The following
+ * macro makes it easy to include or exclude these vectors as needed.
+ */
+
+#if spCOMPLEX AND spSEPARATED_COMPLEX_VECTORS
+#define IMAG_VECTORS , iRHS, iSolution
+#define IMAG_RHS , iRHS
+#else
+#define IMAG_VECTORS
+#define IMAG_RHS
+#endif
+
+
+/*
+ * REAL NUMBER
+ */
+
+/* Begin `RealNumber'. */
+
+typedef spREAL RealNumber, *RealVector;
+
+/*
+ * COMPLEX NUMBER DATA STRUCTURE
+ *
+ * >>> Structure fields:
+ * Real (RealNumber)
+ * The real portion of the number. Real must be the first
+ * field in this structure.
+ * Imag (RealNumber)
+ * The imaginary portion of the number. This field must follow
+ * immediately after Real.
+ */
+
+/* Begin `ComplexNumber'. */
+
+typedef struct
+{
+ RealNumber Real;
+ RealNumber Imag;
+} ComplexNumber, *ComplexVector;
+
+
+
+
+
+
+
+
+/*
+ * MATRIX ELEMENT DATA STRUCTURE
+ *
+ * Every nonzero element in the matrix is stored in a dynamically allocated
+ * MatrixElement structure. These structures are linked together in an
+ * orthogonal linked list. Two different MatrixElement structures exist.
+ * One is used when only real matrices are expected, it is missing an entry
+ * for imaginary data. The other is used if complex matrices are expected.
+ * It contains an entry for imaginary data.
+ *
+ * >>> Structure fields:
+ * Real (RealNumber)
+ * The real portion of the value of the element. Real must be the first
+ * field in this structure.
+ * Imag (RealNumber)
+ * The imaginary portion of the value of the element. If the matrix
+ * routines are not compiled to handle complex matrices, then this
+ * field does not exist. If it exists, it must follow immediately after
+ * Real.
+ * Row (int)
+ * The row number of the element.
+ * Col (int)
+ * The column number of the element.
+ * NextInRow (struct MatrixElement *)
+ * NextInRow contains a pointer to the next element in the row to the
+ * right of this element. If this element is the last nonzero in the
+ * row then NextInRow contains NULL.
+ * NextInCol (struct MatrixElement *)
+ * NextInCol contains a pointer to the next element in the column below
+ * this element. If this element is the last nonzero in the column then
+ * NextInCol contains NULL.
+ * pInitInfo (char *)
+ * Pointer to user data used for initialization of the matrix element.
+ * Initialized to NULL.
+ *
+ * >>> Type definitions:
+ * ElementPtr
+ * A pointer to a MatrixElement.
+ * ArrayOfElementPtrs
+ * An array of ElementPtrs. Used for FirstInRow, FirstInCol and
+ * Diag pointer arrays.
+ */
+
+/* Begin `MatrixElement'. */
+
+struct MatrixElement
+{
+ RealNumber Real;
+#if spCOMPLEX
+ RealNumber Imag;
+#endif
+ int Row;
+ int Col;
+ struct MatrixElement *NextInRow;
+ struct MatrixElement *NextInCol;
+#if INITIALIZE
+ char *pInitInfo;
+#endif
+};
+
+typedef struct MatrixElement *ElementPtr;
+typedef ElementPtr *ArrayOfElementPtrs;
+
+
+
+
+
+
+
+
+/*
+ * SPALLOCATION DATA STRUCTURE
+ *
+ * The sparse matrix routines keep track of all memory that is allocated by
+ * the operating system so the memory can later be freed. This is done by
+ * saving the pointers to all the chunks of memory that are allocated to a
+ * particular matrix in an allocation list. That list is organized as a
+ * linked list so that it can grow without a priori bounds.
+ *
+ * >>> Structure fields:
+ * AllocatedPtr (char *)
+ * Pointer to chunk of memory that has been allocated for the matrix.
+ * NextRecord (struct AllocationRecord *)
+ * Pointer to the next allocation record.
+ */
+
+/* Begin `AllocationRecord'. */
+struct AllocationRecord
+{
+ char *AllocatedPtr;
+ struct AllocationRecord *NextRecord;
+};
+
+typedef struct AllocationRecord *AllocationListPtr;
+
+
+
+
+
+
+
+
+
+/*
+ * FILL-IN LIST DATA STRUCTURE
+ *
+ * The sparse matrix routines keep track of all fill-ins separately from
+ * user specified elements so they may be removed by spStripFills(). Fill-ins
+ * are allocated in bunched in what is called a fill-in lists. The data
+ * structure defined below is used to organize these fill-in lists into a
+ * linked-list.
+ *
+ * >>> Structure fields:
+ * pFillinList (ElementPtr)
+ * Pointer to a fill-in list, or a bunch of fill-ins arranged contiguously
+ * in memory.
+ * NumberOfFillinsInList (int)
+ * Seems pretty self explanatory to me.
+ * Next (struct FillinListNodeStruct *)
+ * Pointer to the next fill-in list structures.
+ */
+
+/* Begin `FillinListNodeStruct'. */
+struct FillinListNodeStruct
+{
+ ElementPtr pFillinList;
+ int NumberOfFillinsInList;
+ struct FillinListNodeStruct *Next;
+};
+
+
+
+
+
+
+
+
+
+
+/*
+ * MATRIX FRAME DATA STRUCTURE
+ *
+ * This structure contains all the pointers that support the orthogonal
+ * linked list that contains the matrix elements. Also included in this
+ * structure are other numbers and pointers that are used globally by the
+ * sparse matrix routines and are associated with one particular matrix.
+ *
+ * >>> Type definitions:
+ * MatrixPtr
+ * A pointer to MatrixFrame. Essentially, a pointer to the matrix.
+ *
+ * >>> Structure fields:
+ * AbsThreshold (RealNumber)
+ * The absolute magnitude an element must have to be considered as a
+ * pivot candidate, except as a last resort.
+ * AllocatedExtSize (int)
+ * The allocated size of the arrays used to translate external row and
+ * column numbers to their internal values.
+ * AllocatedSize (int)
+ * The currently allocated size of the matrix; the size the matrix can
+ * grow to when EXPANDABLE is set true and AllocatedSize is the largest
+ * the matrix can get without requiring that the matrix frame be
+ * reallocated.
+ * Complex (SPBOOLEAN)
+ * The flag which indicates whether the matrix is complex (true) or
+ * real.
+ * CurrentSize (int)
+ * This number is used during the building of the matrix when the
+ * TRANSLATE option is set true. It indicates the number of internal
+ * rows and columns that have elements in them.
+ * Diag (ArrayOfElementPtrs)
+ * Array of pointers that points to the diagonal elements.
+ * DoCmplxDirect (SPBOOLEAN *)
+ * Array of flags, one for each column in matrix. If a flag is true
+ * then corresponding column in a complex matrix should be eliminated
+ * in spFactor() using direct addressing (rather than indirect
+ * addressing).
+ * DoRealDirect (SPBOOLEAN *)
+ * Array of flags, one for each column in matrix. If a flag is true
+ * then corresponding column in a real matrix should be eliminated
+ * in spFactor() using direct addressing (rather than indirect
+ * addressing).
+ * Elements (int)
+ * The number of original elements (total elements minus fill ins)
+ * present in matrix.
+ * Error (int)
+ * The error status of the sparse matrix package.
+ * ExtSize (int)
+ * The value of the largest external row or column number encountered.
+ * ExtToIntColMap (int [])
+ * An array that is used to convert external columns number to internal
+ * external column numbers. Present only if TRANSLATE option is set true.
+ * ExtToIntRowMap (int [])
+ * An array that is used to convert external row numbers to internal
+ * external row numbers. Present only if TRANSLATE option is set true.
+ * Factored (SPBOOLEAN)
+ * Indicates if matrix has been factored. This flag is set true in
+ * spFactor() and spOrderAndFactor() and set false in spCreate()
+ * and spClear().
+ * Fillins (int)
+ * The number of fill-ins created during the factorization the matrix.
+ * FirstInCol (ArrayOfElementPtrs)
+ * Array of pointers that point to the first nonzero element of the
+ * column corresponding to the index.
+ * FirstInRow (ArrayOfElementPtrs)
+ * Array of pointers that point to the first nonzero element of the row
+ * corresponding to the index.
+ * ID (unsigned long int)
+ * A constant that provides the sparse data structure with a signature.
+ * When DEBUG is true, all externally available sparse routines check
+ * this signature to assure they are operating on a valid matrix.
+ * Intermediate (RealVector)
+ * Temporary storage used in the spSolve routines. Intermediate is an
+ * array used during forward and backward substitution. It is
+ * commonly called y when the forward and backward substitution process is
+ * denoted Ax = b => Ly = b and Ux = y.
+ * InternalVectorsAllocated (SPBOOLEAN)
+ * A flag that indicates whether the markowitz vectors and the
+ * Intermediate vector have been created.
+ * These vectors are created in CreateInternalVectors().
+ * IntToExtColMap (int [])
+ * An array that is used to convert internal column numbers to external
+ * external column numbers.
+ * IntToExtRowMap (int [])
+ * An array that is used to convert internal row numbers to external
+ * external row numbers.
+ * MarkowitzCol (int [])
+ * An array that contains the count of the non-zero elements excluding
+ * the pivots for each column. Used to generate and update MarkowitzProd.
+ * MarkowitzProd (long [])
+ * The array of the products of the Markowitz row and column counts. The
+ * element with the smallest product is the best pivot to use to maintain
+ * sparsity.
+ * MarkowitzRow (int [])
+ * An array that contains the count of the non-zero elements excluding
+ * the pivots for each row. Used to generate and update MarkowitzProd.
+ * MaxRowCountInLowerTri (int)
+ * The maximum number of off-diagonal element in the rows of L, the
+ * lower triangular matrix. This quantity is used when computing an
+ * estimate of the roundoff error in the matrix.
+ * NeedsOrdering (SPBOOLEAN)
+ * This is a flag that signifies that the matrix needs to be ordered
+ * or reordered. NeedsOrdering is set true in spCreate() and
+ * spGetElement() or spGetAdmittance() if new elements are added to the
+ * matrix after it has been previously factored. It is set false in
+ * spOrderAndFactor().
+ * NumberOfInterchangesIsOdd (SPBOOLEAN)
+ * Flag that indicates the sum of row and column interchange counts
+ * is an odd number. Used when determining the sign of the determinant.
+ * Partitioned (SPBOOLEAN)
+ * This flag indicates that the columns of the matrix have been
+ * partitioned into two groups. Those that will be addressed directly
+ * and those that will be addressed indirectly in spFactor().
+ * PivotsOriginalCol (int)
+ * Column pivot was chosen from.
+ * PivotsOriginalRow (int)
+ * Row pivot was chosen from.
+ * PivotSelectionMethod (char)
+ * Character that indicates which pivot search method was successful.
+ * PreviousMatrixWasComplex (SPBOOLEAN)
+ * This flag in needed to determine how to clear the matrix. When
+ * dealing with real matrices, it is important that the imaginary terms
+ * in the matrix elements be zero. Thus, if the previous matrix was
+ * complex, then the current matrix will be cleared as if it were complex
+ * even if it is real.
+ * RelThreshold (RealNumber)
+ * The magnitude an element must have relative to others in its row
+ * to be considered as a pivot candidate, except as a last resort.
+ * Reordered (SPBOOLEAN)
+ * This flag signifies that the matrix has been reordered. It
+ * is cleared in spCreate(), set in spMNA_Preorder() and
+ * spOrderAndFactor() and is used in spPrint().
+ * RowsLinked (SPBOOLEAN)
+ * A flag that indicates whether the row pointers exist. The AddByIndex
+ * routines do not generate the row pointers, which are needed by some
+ * of the other routines, such as spOrderAndFactor() and spScale().
+ * The row pointers are generated in the function spcLinkRows().
+ * SingularCol (int)
+ * Normally zero, but if matrix is found to be singular, SingularCol is
+ * assigned the external column number of pivot that was zero.
+ * SingularRow (int)
+ * Normally zero, but if matrix is found to be singular, SingularRow is
+ * assigned the external row number of pivot that was zero.
+ * Singletons (int)
+ * The number of singletons available for pivoting. Note that if row I
+ * and column I both contain singletons, only one of them is counted.
+ * Size (int)
+ * Number of rows and columns in the matrix. Does not change as matrix
+ * is factored.
+ * TrashCan (MatrixElement)
+ * This is a dummy MatrixElement that is used to by the user to stuff
+ * data related to the zero row or column. In other words, when the user
+ * adds an element in row zero or column zero, then the matrix returns
+ * a pointer to TrashCan. In this way the user can have a uniform way
+ * data into the matrix independent of whether a component is connected
+ * to ground.
+ *
+ * >>> The remaining fields are related to memory allocation.
+ * TopOfAllocationList (AllocationListPtr)
+ * Pointer which points to the top entry in a list. The list contains
+ * all the pointers to the segments of memory that have been allocated
+ * to this matrix. This is used when the memory is to be freed on
+ * deallocation of the matrix.
+ * RecordsRemaining (int)
+ * Number of slots left in the list of allocations.
+ * NextAvailElement (ElementPtr)
+ * Pointer to the next available element which has been allocated but as
+ * yet is unused. Matrix elements are allocated in groups of
+ * ELEMENTS_PER_ALLOCATION in order to speed element allocation and
+ * freeing.
+ * ElementsRemaining (int)
+ * Number of unused elements left in last block of elements allocated.
+ * NextAvailFillin (ElementPtr)
+ * Pointer to the next available fill-in which has been allocated but
+ * as yet is unused. Fill-ins are allocated in a group in order to keep
+ * them physically close in memory to the rest of the matrix.
+ * FillinsRemaining (int)
+ * Number of unused fill-ins left in the last block of fill-ins
+ * allocated.
+ * FirstFillinListNode (FillinListNodeStruct *)
+ * A pointer to the head of the linked-list that keeps track of the
+ * lists of fill-ins.
+ * LastFillinListNode (FillinListNodeStruct *)
+ * A pointer to the tail of the linked-list that keeps track of the
+ * lists of fill-ins.
+ */
+
+/* Begin `MatrixFrame'. */
+struct MatrixFrame
+{
+ int NumRank ; /* the numerical Rank of the matrix */
+ RealNumber AbsThreshold;
+ int AllocatedSize;
+ int AllocatedExtSize;
+ SPBOOLEAN Complex;
+ int CurrentSize;
+ ArrayOfElementPtrs Diag;
+ SPBOOLEAN *DoCmplxDirect;
+ SPBOOLEAN *DoRealDirect;
+ int Elements;
+ int Error;
+ int ExtSize;
+ int *ExtToIntColMap;
+ int *ExtToIntRowMap;
+ SPBOOLEAN Factored;
+ int Fillins;
+ ArrayOfElementPtrs FirstInCol;
+ ArrayOfElementPtrs FirstInRow;
+ unsigned long ID;
+ RealVector Intermediate;
+ SPBOOLEAN InternalVectorsAllocated;
+ int *IntToExtColMap;
+ int *IntToExtRowMap;
+ int *MarkowitzRow;
+ int *MarkowitzCol;
+ long *MarkowitzProd;
+ int MaxRowCountInLowerTri;
+ SPBOOLEAN NeedsOrdering;
+ SPBOOLEAN NumberOfInterchangesIsOdd;
+ SPBOOLEAN Partitioned;
+ int PivotsOriginalCol;
+ int PivotsOriginalRow;
+ char PivotSelectionMethod;
+ SPBOOLEAN PreviousMatrixWasComplex;
+ RealNumber RelThreshold;
+ SPBOOLEAN Reordered;
+ SPBOOLEAN RowsLinked;
+ int SingularCol;
+ int SingularRow;
+ int Singletons;
+ int Size;
+ struct MatrixElement TrashCan;
+
+ AllocationListPtr TopOfAllocationList;
+ int RecordsRemaining;
+ ElementPtr NextAvailElement;
+ int ElementsRemaining;
+ ElementPtr NextAvailFillin;
+ int FillinsRemaining;
+ struct FillinListNodeStruct *FirstFillinListNode;
+ struct FillinListNodeStruct *LastFillinListNode;
+};
+typedef struct MatrixFrame *MatrixPtr;
+
+#endif /* __SPDEFS_H__*/
diff --git a/modules/sparse/includes/spmalloc.h b/modules/sparse/includes/spmalloc.h
new file mode 100755
index 000000000..1ac571ce0
--- /dev/null
+++ b/modules/sparse/includes/spmalloc.h
@@ -0,0 +1,33 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SPMALLOC_H__
+#define __SPMALLOC_H__
+
+#include <stdlib.h>
+#include "MALLOC.h"
+#define SPMALLOC(x) MALLOC(((size_t) x))
+#define SPALLOC(type,number) ((type *)SPMALLOC((unsigned)(sizeof(type)*(number))))
+#define SPREALLOC(ptr,type,number) \
+ ptr = (type *)REALLOC((char *)ptr,(unsigned)(sizeof(type)*(number)))
+
+#define SPFREE(ptr) { if ((ptr) != NULL) {FREE((void *)(ptr)); (ptr) = NULL;}}
+
+
+/* Calloc that properly handles allocating a cleared vector. */
+#define SPCALLOC(ptr,type,number) \
+{ int i; ptr = SPALLOC(type, number); \
+ if (ptr != (type *)NULL) \
+ for(i=(number)-1;i>=0; i--) ptr[i] = (type) 0; \
+}
+
+#endif /*__SPMALLOC_H__*/
diff --git a/modules/sparse/includes/spmatrix.h b/modules/sparse/includes/spmatrix.h
new file mode 100755
index 000000000..6b1e1fc35
--- /dev/null
+++ b/modules/sparse/includes/spmatrix.h
@@ -0,0 +1,325 @@
+#ifndef __SPMATRIX_H__
+#define __SPMATRIX_H__
+
+/*
+ * EXPORTS for sparse matrix routines.
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains definitions that are useful to the calling
+ * program. In particular, this file contains error keyword
+ * definitions, some macro functions that are used to quickly enter
+ * data into the matrix and the type definition of a data structure
+ * that acts as a template for entering admittances into the matrix.
+ * Also included is the type definitions for the various functions
+ * available to the user.
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ *
+ */
+
+
+
+
+#ifndef spOKAY
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ */
+
+#include "spConfig.h"
+
+
+
+
+
+
+/*
+ * ERROR KEYWORDS
+ *
+ * The actual numbers used in the error codes are not sacred, they can be
+ * changed under the condition that the codes for the nonfatal errors are
+ * less than the code for spFATAL and similarly the codes for the fatal
+ * errors are greater than that for spFATAL.
+ *
+ * >>> Error descriptions:
+ * spOKAY
+ * No error has occurred.
+ * spSMALL_PIVOT
+ * When reordering the matrix, no element was found which satisfies the
+ * absolute threshold criteria. The largest element in the matrix was
+ * chosen as pivot. Non-fatal.
+ * spZERO_DIAG
+ * Fatal error. A zero was encountered on the diagonal the matrix. This
+ * does not necessarily imply that the matrix is singular. When this
+ * error occurs, the matrix should be reconstructed and factored using
+ * spOrderAndFactor().
+ * spSINGULAR
+ * Fatal error. Matrix is singular, so no unique solution exists.
+ * spNO_MEMORY
+ * Fatal error. Indicates that not enough memory is available to handle
+ * the matrix.
+ * spPANIC
+ * Fatal error indicating that the routines are not prepared to
+ * handle the matrix that has been requested. This may occur when
+ * the matrix is specified to be real and the routines are not
+ * compiled for real matrices, or when the matrix is specified to
+ * be complex and the routines are not compiled to handle complex
+ * matrices.
+ * spFATAL
+ * Not an error flag, but rather the dividing line between fatal errors
+ * and warnings.
+ */
+
+/* Begin error macros. */
+#define spOKAY 0
+#define spSMALL_PIVOT 1
+#define spZERO_DIAG 2
+#define spSINGULAR 3
+#define spNO_MEMORY 4
+#define spPANIC 5
+
+#define spFATAL 2
+
+
+
+
+
+
+
+/*
+ * KEYWORD DEFINITIONS
+ *
+ * Here we define what precision arithmetic Sparse will use. Double
+ * precision is suggested as being most appropriate for circuit
+ * simulation and for C. However, it is possible to change spREAL
+ * to a float for single precision arithmetic. Note that in C, single
+ * precision arithmetic is often slower than double precision. Sparse
+ * internally refers to spREALs as RealNumbers.
+ *
+ * Some C compilers, notably the old VMS compiler, do not handle the keyword
+ * "void" correctly. If this is true for your compiler, remove the
+ * comment delimiters from the redefinition of void to int below.
+ */
+
+#define spREAL double
+/* #define void int */
+
+
+
+
+
+/*
+ * PARTITION TYPES
+ *
+ * When factoring a previously ordered matrix using spFactor(), Sparse
+ * operates on a row-at-a-time basis. For speed, on each step, the row
+ * being updated is copied into a full vector and the operations are
+ * performed on that vector. This can be done one of two ways, either
+ * using direct addressing or indirect addressing. Direct addressing
+ * is fastest when the matrix is relatively dense and indirect addressing
+ * is quite sparse. The user can select which partitioning mode is used.
+ * The following keywords are passed to spPartition() and indicate that
+ * Sparse should use only direct addressing, only indirect addressing, or
+ * that it should choose the best mode on a row-by-row basis. The time
+ * required to choose a partition is of the same order of the cost to factor
+ * the matrix.
+ *
+ * If you plan to factor a large number of matrices with the same structure,
+ * it is best to let Sparse choose the partition. Otherwise, you should
+ * choose the partition based on the predicted density of the matrix.
+ */
+
+/* Begin partition keywords. */
+
+#define spDEFAULT_PARTITION 0
+#define spDIRECT_PARTITION 1
+#define spINDIRECT_PARTITION 2
+#define spAUTO_PARTITION 3
+
+
+
+
+
+/*
+ * MACRO FUNCTION DEFINITIONS
+ *
+ * >>> Macro descriptions:
+ * spADD_REAL_ELEMENT
+ * Macro function that adds data to a real element in the matrix by a
+ * pointer.
+ * spADD_IMAG_ELEMENT
+ * Macro function that adds data to a imaginary element in the matrix by
+ * a pointer.
+ * spADD_COMPLEX_ELEMENT
+ * Macro function that adds data to a complex element in the matrix by a
+ * pointer.
+ * spADD_REAL_QUAD
+ * Macro function that adds data to each of the four real matrix elements
+ * specified by the given template.
+ * spADD_IMAG_QUAD
+ * Macro function that adds data to each of the four imaginary matrix
+ * elements specified by the given template.
+ * spADD_COMPLEX_QUAD
+ * Macro function that adds data to each of the four complex matrix
+ * elements specified by the given template.
+ */
+
+/* Begin Macros. */
+#define spADD_REAL_ELEMENT(element,real) *(element) += real
+
+#define spADD_IMAG_ELEMENT(element,imag) *(element+1) += imag
+
+#define spADD_COMPLEX_ELEMENT(element,real,imag) \
+{ *(element) += real; \
+ *(element+1) += imag; \
+}
+
+#define spADD_REAL_QUAD(template,real) \
+{ *((template).Element1) += real; \
+ *((template).Element2) += real; \
+ *((template).Element3Negated) -= real; \
+ *((template).Element4Negated) -= real; \
+}
+
+#define spADD_IMAG_QUAD(template,imag) \
+{ *((template).Element1+1) += imag; \
+ *((template).Element2+1) += imag; \
+ *((template).Element3Negated+1) -= imag; \
+ *((template).Element4Negated+1) -= imag; \
+}
+
+#define spADD_COMPLEX_QUAD(template,real,imag) \
+{ *((template).Element1) += real; \
+ *((template).Element2) += real; \
+ *((template).Element3Negated) -= real; \
+ *((template).Element4Negated) -= real; \
+ *((template).Element1+1) += imag; \
+ *((template).Element2+1) += imag; \
+ *((template).Element3Negated+1) -= imag; \
+ *((template).Element4Negated+1) -= imag; \
+}
+
+
+
+
+
+
+
+/*
+ * TYPE DEFINITION FOR COMPONENT TEMPLATE
+ *
+ * This data structure is used to hold pointers to four related elements in
+ * matrix. It is used in conjunction with the routines
+ * spGetAdmittance
+ * spGetQuad
+ * spGetOnes
+ * These routines stuff the structure which is later used by the spADD_QUAD
+ * macro functions above. It is also possible for the user to collect four
+ * pointers returned by spGetElement and stuff them into the template.
+ * The spADD_QUAD routines stuff data into the matrix in locations specified
+ * by Element1 and Element2 without changing the data. The data is negated
+ * before being placed in Element3 and Element4.
+ */
+
+/* Begin `spTemplate'. */
+struct spTemplate
+{
+ spREAL *Element1 ;
+ spREAL *Element2 ;
+ spREAL *Element3Negated;
+ spREAL *Element4Negated;
+};
+
+
+
+
+
+/*
+ * FUNCTION TYPE DEFINITIONS
+ *
+ * The type of every user accessible function is declared here.
+ */
+
+/* Begin function declarations. */
+
+/* For compilers that understand function prototypes. */
+
+extern void spClear( char* );
+extern spREAL spCondition( char*, spREAL, int* );
+extern char *spCreate( int, int, int* );
+extern void spDeleteRowAndCol( char*, int, int );
+extern void spDestroy( char* );
+extern int spElementCount( char* );
+extern int spError( char* );
+extern int spFactor( char* );
+extern int spFileMatrix( char*, char*, char*, int, int, int );
+extern int spFileStats( char*, char*, char* );
+extern int spFillinCount( char* );
+extern int spGetAdmittance( char*, int, int, struct spTemplate* );
+extern spREAL *spGetElement( char*, int, int );
+extern char *spGetInitInfo( spREAL* );
+extern int spGetOnes( char*, int, int, int, struct spTemplate* );
+extern int spGetQuad( char*, int, int, int, int, struct spTemplate* );
+extern int spGetSize( char*, int );
+extern int spInitialize( char*, int (*)() );
+extern void spInstallInitInfo( spREAL*, char* );
+extern spREAL spLargestElement( char* );
+extern void spMNA_Preorder( char* );
+extern spREAL spNorm( char* );
+extern int spOrderAndFactor( char*, spREAL[], spREAL, spREAL, int );
+extern void spPartition( char*, int );
+extern void spPrint( char*, int, int, int );
+extern spREAL spPseudoCondition( char* );
+extern spREAL spRoundoff( char*, spREAL );
+extern void spScale( char*, spREAL[], spREAL[] );
+extern void spSetComplex( char* );
+extern void spSetReal( char* );
+extern void spStripFills( char* );
+extern void spWhereSingular( char*, int*, int* );
+
+/* Functions with argument lists that are dependent on options. */
+
+#if spCOMPLEX
+extern void spDeterminant ( char*, int*, spREAL*, spREAL* );
+#else /* NOT spCOMPLEX */
+extern void spDeterminant ( char*, int*, spREAL* );
+#endif /* NOT spCOMPLEX */
+#if spCOMPLEX && spSEPARATED_COMPLEX_VECTORS
+extern int spFileVector( char*, char* , spREAL[], spREAL[]);
+extern void spMultiply( char*, spREAL[], spREAL[], spREAL[], spREAL[] );
+extern void spMultTransposed(char*, spREAL[], spREAL[], spREAL[], spREAL[]);
+extern void spSolve( char*, spREAL[], spREAL[], spREAL[], spREAL[] );
+extern void spSolveTransposed(char*, spREAL[], spREAL[], spREAL[], spREAL[]);
+#else /* NOT (spCOMPLEX && spSEPARATED_COMPLEX_VECTORS) */
+extern int spFileVector( char*, char* , spREAL[] );
+extern void spMultiply( char*, spREAL[], spREAL[] );
+extern void spMultTransposed( char*, spREAL[], spREAL[] );
+extern void spSolve( char*, spREAL[], spREAL[] );
+extern void spSolveTransposed( char*, spREAL[], spREAL[] );
+#endif /* NOT (spCOMPLEX && spSEPARATED_COMPLEX_VECTORS) */
+
+#endif /* spOKAY */
+
+#endif /* __SPMATRIX_H__ */
diff --git a/modules/sparse/libscisparse-algo.la b/modules/sparse/libscisparse-algo.la
new file mode 100755
index 000000000..e58ee4889
--- /dev/null
+++ b/modules/sparse/libscisparse-algo.la
@@ -0,0 +1,41 @@
+# libscisparse-algo.la - a libtool library file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libscisparse-algo.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lpthread -ldl -lcurses -lm'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libscisparse-algo.
+current=
+age=
+revision=
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir=''
diff --git a/modules/sparse/libscisparse.la b/modules/sparse/libscisparse.la
new file mode 100755
index 000000000..9af4d10ed
--- /dev/null
+++ b/modules/sparse/libscisparse.la
@@ -0,0 +1,41 @@
+# libscisparse.la - a libtool library file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libscisparse.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lpthread -ldl -lcurses -lm'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libscisparse.
+current=
+age=
+revision=
+
+# Is this an already installed library?
+installed=no
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir=''
diff --git a/modules/sparse/license.txt b/modules/sparse/license.txt
new file mode 100755
index 000000000..602c3be38
--- /dev/null
+++ b/modules/sparse/license.txt
@@ -0,0 +1,32 @@
+Copyright:
+Copyright (c) 2008 - DIGITEO
+Copyright (c) 1989-2008 - INRIA
+Copyright (c) 1989-2007 - ENPC
+Copyright (c) Bruno Pincon
+
+License:
+This module must be used under the terms of the CeCILL.
+This module file is licensed as described in the file COPYING, which
+you should have received as part of this distribution. The terms
+are also available at
+http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+sp:
+===
+
+Files: src/c/{spFortran.c, spSolve.c, spFactor.c, spOutput.c, spUtils.c,
+spBuild.c, spAllocate.c}
+
+Copyright:
+1985,86,87,88 Kenneth S. Kundert and the University of California.
+
+License:
+BSD like
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided
+that the above copyright notice appear in all copies and supporting
+documentation and that the authors and the University of California
+are properly credited. The authors and the University of California
+make no representations as to the suitability of this software for
+any purpose. It is provided `as is', without express or implied warranty.
+
diff --git a/modules/sparse/locales/ca_ES.po b/modules/sparse/locales/ca_ES.po
new file mode 100755
index 000000000..a0e4995f3
--- /dev/null
+++ b/modules/sparse/locales/ca_ES.po
@@ -0,0 +1,453 @@
+# Catalan translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2011-09-01 09:43+0000\n"
+"Last-Translator: oriolsbd <oriolsbd@yahoo.es>\n"
+"Language-Team: Catalan <ca@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: ca\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "sparse: Pànic al fitxer `%s' a la línia %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: S'ha trobat un zero a la diagonal de la matriu.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Reordenant, Pas = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "Recompte d'operacions al bucle intern de la factorització = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "S'ha trobat un pivot a %1d,%1d utilitzant "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"RESUM DE LA MATRIU\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Mida de la matriu = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "S'ha reordenat la matriu.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matriu després de la factorització:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matriu abans de la factorització:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Columnes %1d a %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Major element de la matriu = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Menor element de la matriu = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Major element de la diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Menor element de la diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Major element del pivot = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Menor element del pivot = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Densitat = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Elements omplerts = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Avís: La següent matriu s'ha factortitzat de forma LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "La matriu no s'ha factoritzat.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Començant una matriu nova |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "La matriu és complexa.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "La matriu és real.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Nombre inicial d'elements = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Nombre mitjà inicial d'elements per fila = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Elements omplerts = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Nombre mitjà d'elements omplerts per fila = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Nombre total d'elements = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Nombre mitjà d'elements per fila = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Densitat = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Llindar relatiu = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Llindar absolut = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Major element = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Menor element = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norma del costat de la dreta: %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Processat especial on el costat de la dreta val zero.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Tipus de precondició #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Tipus de precondició #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Nou residu = %s < tol = %s => break\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Iteració #%s/%s residu : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Residu final = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "L'algoritme ha donat un error\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Error de convergència.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "L'algoritme ha acabat bé\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Nombre incorrecte d'arguments d'entrada: Hi ha d'haver entre %d i %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: L'argument d'entrada #%d és d'un tipus incorrecte.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Arguments:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d és d'un tipus incorrecte: Ha de ser una matriu "
+"quadrada.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d és d'un tipus incorrecte: Ha de ser un vector "
+"columna.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té una mida incorrecta: Ha de ser de la mateixa "
+"mida que l'argument d'entrada #%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d és d'un tipus incorrecte: Ha de ser un "
+"escalar.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té un valor incorrecte: Ha de ser un vector "
+"columna.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: L'argument d'entrada té un número incorrecte: Ha de ser com a mínim %d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té una mida incorrecta: Ha de ser una matriu "
+"quadrada.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té una mida incorrecta: Ha de ser un vector "
+"columna.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té una mida incorrecta: Ha de ser un escalar.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: No convergeix.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: El nombre d'arguments d'entrada és incorrecte: Han de ser com a mínim "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: L'argument d'entrada #%d té un valor incorrecte: Ha de ser la "
+"transposada de la funció %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
diff --git a/modules/sparse/locales/cs_CZ.po b/modules/sparse/locales/cs_CZ.po
new file mode 100755
index 000000000..f0b86066b
--- /dev/null
+++ b/modules/sparse/locales/cs_CZ.po
@@ -0,0 +1,468 @@
+# Czech translation for scilab
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2013-06-30 20:50+0000\n"
+"Last-Translator: Zbyněk Schwarz <Unknown>\n"
+"Language-Team: Czech <cs@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "rozptýlení: panika v souboru '%s' na řádku %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: Na diagonále matice byla zjištěna nula.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Seřazuji, Krok = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "PoÄet operací pro vnitÅ™ní smyÄku faktorizace = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Osa nalezena v %1d,%1d použitím "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"PŘEHLED MATICE\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Velikost matice = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "Matice byla seřazena.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matice po faktorizaci:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matice před faktorizací:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Sloupce %1d až %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Největší prvek v matici = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Nejmenší prvek matice = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Největší diagonální prvek = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Nejmenší diagonální prvek = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Největší prvek osy = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Nejmenší prvek osy = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Hustota = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "PoÄet vyplnÄ›ní = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Varování : Následující matice zapracována do formy LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "Matice nebyla zapracována.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| ZaÄínám novou matici |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "Matice je komplexní.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "Matice je reálná.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " PoÄáteÄní poÄet prvků = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " PoÄáteÄní průmÄ›rný poÄet prvků na řádek = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Vyplnění = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " PrůmÄ›rný poÄet vyplnÄ›ní na řádek = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Celkový poÄet prvků = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " PrůmÄ›rný poÄet prvků na řádek = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Hustota = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Relativní Práh = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Absolutní práh = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Největší Prvek = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Nejmenší Prvek = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norma vpravo : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Zvláštní zpracování, kde pravá strana je nula.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Typ stabilizace #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Typ stabilizace #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Nové zbytkové = %s < tol = %s => break\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Opakování #%s/%s zbytkové : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "KoneÄný zbytkový = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Algoritmus selhal.\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Chyba konvergence.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Algoritmus proveden\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s: Å patný poÄet vstupních argumentů: oÄekáváno %d až %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr "%s: Å patný poÄet výstupních argumentů: OÄekáváno %d až %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: Špatný typ vstupního argumentu #%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: Špatná velikost vstupního argumentu #%d: %s má velikost %d, ale "
+"oÄekáváno %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: Å patná hodnota vstupního argumentu #%d: %s=%d, ale oÄekávána kladná "
+"hodnota.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: Å patná hodnota vstupního argumentu #%d: %s=%s, ale je oÄekáváno celé "
+"Äíslo s plovoucí Äárkou.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: Špatná hodnota vstupního argumentu #%d: %s=%d, což se neshoduje s %s: "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: Špatná hodnota vstupního argumentu #%d: %s=%d, což se neshoduje s "
+"velikostí %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr " Možná matice není kladně definitivní."
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " SYMFCT vyžaduje aby PERM bylo neqns x 1"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " SYMFCT vyžaduje aby INVN bylo neqns x 1"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " SYMFCT vyžaduje aby CACHSZ bylo 1 x 1"
+
+msgid " Insufficient working storage in sfinit"
+msgstr " NedostateÄné pracovní úložiÅ¡tÄ› v sfinit"
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argumenty:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekávána Ätvercová matice.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s: Å patný typ vstupního argumentu #%d: OÄekáván sloupcový vektor.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: Å patná velikost vstupního argumentu #%d: OÄekávána stejná velikost jako "
+"vstupní argument #%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s: Å patný typ vstupního argumentu #%d: OÄekáván skalár.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Å patná hodnota vstupního argumentu #%d: OÄekáván sloupcový vektor.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s: Å patný poÄet vstupních argumentů: OÄekáváno alespoň %d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Å patná velikost vstupního argumentu #%d: OÄekávána Ätvercová matice.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Å patná velikost vstupního argumentu #%d: OÄekáván sloupcový vektor.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s: Å patná velikost vstupního argumentu #%d: OÄekáván skalár.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: Nesblížili se.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr "%s: Å patný poÄet vstupních argumentů: OÄekávány alespoň %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekávána reálná, komplexní, Äi "
+"řídká matice nebo funkce.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Å patná hodnota vstupního argumentu #%d: OÄekávána transpozice funkce "
+"%s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekávána transpozice funkce %s.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+"%s: Volání qmr(A,Ap) je zastaralé. Prosím prohlédněte si dokumentaci pro "
+"další podrobnosti.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekáván reálný, komplexní, celý "
+"nebo řídký sloupcový vektor.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekávána reálná, komplexní, nebo "
+"Ätvercová matice, Äi funkce.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: Volání qmr(...,M1,M1p) je zastaralé. Prosím prohlédněte si dokumentaci "
+"pro další podrobnosti.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+"%s: Å patný typ vstupního argumentu #%d: OÄekávána transpozice funkce.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s: Špatný prototyp vstupního argumentu #%d: Pokud M1 je funkce, použijte "
+"hlaviÄku M1(x,t) namísto M1(x).\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: Volání qmr(...,M2,M2p) je zastaralé. Prosím prohlédněte si dokumentaci "
+"pro další podrobnosti.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s: Špatný prototyp vstupního argumentu #%d: Pokud M2 je funkce, použijte "
+"hlaviÄku M2(x,t) namísto M2(x).\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr "%s: Å patný typ vstupního argumentu #%d: OÄekáván reálný skalár.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s: Å patný poÄet vstupních argumentů: OÄekávány %d nebo %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr "%s: Å patný typ vstupního argumentu #%d: OÄekáván Å™etÄ›zec.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Å patná hodnota vstupního argumentu #%d: OÄekáváno '%s', nebo '%s'.\n"
diff --git a/modules/sparse/locales/de_DE.po b/modules/sparse/locales/de_DE.po
new file mode 100755
index 000000000..bfadb0f17
--- /dev/null
+++ b/modules/sparse/locales/de_DE.po
@@ -0,0 +1,443 @@
+# German translation for scilab
+# Copyright (c) 2008 Rosetta Contributors and Canonical Ltd 2008
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2012-02-28 12:05+0000\n"
+"Last-Translator: Daniel Dietrich <Unknown>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: de\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr ""
+"Fehler: Programmabsturz bei Verarbeitung der Datei '%s' bei Zeile %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: eine Null ist in der Diagonalen der Matrix aufgetreten.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Neuordnung, Stufe = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "Funktionszähler für die innere Schleife der Faktorisierung = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Pivot unter Verwendung von %1d,%1d gefunden "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"Matrxi Zusammenfassung\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Größe der Matrix = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "Matrix wurde reorganisiert.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matrix nach der Faktorisierung:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matrix vor der Faktorisierung:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Spalten %1d nach %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Größtes Element in Matrix = %-1.41g.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Kleinstes Element in Matrix = %-1.41g.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Größtes diagonales Element in Matrix =% -1.41g.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Kleinstes diagonales Element in Matrix = %-1.41g.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Größtes Pivot Element in Matrix = -%1.41g.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Kleinstes Pivot Element in Matrix =% -1.41g.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Dichte = %2.21f%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Anzahl der Ausfüllungen = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Warnung: die folgende Matrix ist in LU Form faktorisiert.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "Matrix wurde nicht faktorosiert.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "|||Starte neue Matrix|||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "Matrix ist komplex.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "Matrix ist reell.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " ursprüngliche Anzahl der Elemente=%d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr ""
+" ursprüngliche durchschnittliche Anzahl an Elementen per Reihe = %1f\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Eintragungen=%d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Durchschnittliche Anzahl an Eintragungen per Reihe=%1f%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Gesamte Anzahl an Elementen=%d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Gesamte Anzahl an Elementen per Reihe=%1f\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Dichte=%1f%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " relativer Schwellenwert=%e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " absoluter Schwellenwert=%e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Größtes Element=%e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Kleinstes Element = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norm der rechten Hand Seite: %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr ""
+"Spezielle Datenverarbeitung, während die rechte-Hand Seite Null ist.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Typ der Vorkonditionierung #1: %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Typ der Vorkonditionierung #2: %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Neue Residue = %s < Toleranz = %s => Abbruch\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Iteration #%s/%s Residue: %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "endgültige Residue = %s > Toleranz = %s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Algorithmus schlägt fehl\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Konvergenz Fehler.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Algorithmus Durchlauf\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s: Falsche Anzahl an Eingangsargumenten: %d zu %d erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Falsche Anzahl von Ausgangsargumenten: zwischen %d und %d erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: falscher Typ für Eingangsargument #%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argumente:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr "%s: falscher Typ für Eingangsargument #%d: N x N Matrix erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s: falscher Typ für Eingangsargument #%d: Spaltenvektor erwartet.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: falsche Größe für Eingangsargument #%d: gleiche Größe wie das "
+"Eingangsargument #%d erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s: falsche Typ für Eingangsargument #%d: Skalar erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: falscher Wert für Eingangsargument #%d: Spaltenvektor erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s: falsche Anzahl an Eingangsargumenten: mindestens %d erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr "%s: falsche Größe für Eingangsargument #%d: N x N Martix erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s: Falsche Größe für Eingangsargument #%d: Skalar erwartet.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: keine Konvergenz.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: falsche Anzahl von Eingangsargumenten: mindestens %d werden erwartet.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: falscher Wert für Eingangsargument #%d: Transponent der Funktion %s "
+"erwartet.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s: Falsche Anzahl von Eingangsargumenten: %d oder %d erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: Falscher Typ an Eingangsargument #%d: eine Zeichenkette erwartet.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
diff --git a/modules/sparse/locales/es_ES.po b/modules/sparse/locales/es_ES.po
new file mode 100755
index 000000000..f315e1857
--- /dev/null
+++ b/modules/sparse/locales/es_ES.po
@@ -0,0 +1,465 @@
+# Spanish translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2011-10-22 15:38+0000\n"
+"Last-Translator: Fido <Unknown>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: es\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "Pánico en '%s' en la línea %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: Se encontró un cero en la diagonal de la matriz.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Reordenando, paso = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "Operación cuenta para el loop interno de la factorización = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Se encontró un intercambio en %1d,%1d usando "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"SUMARIO DE LA MATRIZ\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Tamaño de la matriz = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "La matriz ha sido reordenada.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matriz después de la factorización:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matriz antes de la factorización:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Columnas de %1d a %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Elemento mayor de la matriz = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Elemento menor de la matriz = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Elemento mayor de la diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Elemento menor de la diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Elemento mayor del intercambio = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Elemento menor del intercambio = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Densidad = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Número de elementos llenos = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Advertencia : La siguiente matriz está factorizada en forma LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "La matriz no fue factorizada.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Iniciando nueva matriz |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "La matriz es compleja.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "La matriz es real.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Número inicial de elementos = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Promedio inicial de números por fila = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Distintos de cero = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Promedio de números distintos de cero por fila = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Número total de elementos = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Promedio de elementos por fila = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Densidad = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Umbral Relativo = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Umbral Absoluto = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Elemento Mayor = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Elemento Menor = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norma del lado derecho : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Procesamiento especial donde el lado derecho sea cero.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Tipo de pre-condicionamiento #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Tipo de pre-condicionamiento #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Nuevo residuo = %s < tol = %s => break\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Iteración #%s/%s residual : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Residuo final = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Falló algoritmo\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Error de convergencia.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Pasó el algoritmo\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Número incorrecto de argumentos de entrada: Se esperaban de %d a %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Número incorrecto de argumentos de salida: Se esperaban de %d a %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: Tipo incorrecto para el argumento de entrada #%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: Tamaño incorrecto para el argumento de entrada #%d: %s tiene tamaño %d, "
+"se se esperaba que fuera %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: Valor incorrecto para el argumento de entrada #%d: %s=%d, pero se "
+"esperaba un valor positivo.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: Valor incorrecto para el argumento de entrada #%d: %s=%s, pero se "
+"esperaba un número de punto flotante.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: Valor incorrecto para el argumento de entrada #%d: %s=%d, y no coincide "
+"con %s: %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: Valor incorrecto para el argumento de entrada #%d: %s=%d, lo que no "
+"concuerda con el tamaño de %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argumentos:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Tipo incorrecto del argumento de entrada #%d: Se esperaba una matriz "
+"cuadrada.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Tipo incorrecto del argumento de entrada #%d: Se esperaba un vector "
+"columna.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: Tamaño incorrecto del argumento de entrada #%d: Se esperaba el mismo del "
+"argumento de entrada #%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Tipo incorrecto del argumento de entrada #%d: Se esperaba un escalar.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Valor incorrecto del argumento de entrada #%d: Se esperaba un vector "
+"columna.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: Número incorrecto de argumentos de entrada: Se esperaban al menos %d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Tamaño incorrecto del argumento de entrada #%d: Se esperaba una matriz "
+"cuadrada.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Tamaño incorrecto del argumento de entrada #%d: Se esperaba un vector "
+"columna.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Tamaño incorrecto del argumento de entrada #%d: Se esperaba un escalar.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: No converge.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: Número incorrecto de argumentos de entrada: Se esperaban al menos %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Valor incorrecto del argumento de entrada #%d: Se esperaba el traspuesto "
+"de la función %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+"%s: Número incorrecto de argumentos de entrada: Se esperaban %d ó %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: Tipo incorrecto del argumento de entrada #%d: Se esperaba un string.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Valor incorrecto del argumento de entrada #%d: Se esperaba '%s' o '%s'.\n"
diff --git a/modules/sparse/locales/fr_FR.po b/modules/sparse/locales/fr_FR.po
new file mode 100755
index 000000000..6077cad62
--- /dev/null
+++ b/modules/sparse/locales/fr_FR.po
@@ -0,0 +1,486 @@
+# French translation for scilab
+# Copyright (c) 2008 Rosetta Contributors and Canonical Ltd 2008
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2013-12-11 16:03+0000\n"
+"Last-Translator: Julie PAUL <Unknown>\n"
+"Language-Team: French <fr@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: fr\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "Creuse : erreur dans le fichier `%s' à la ligne %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s : Un zéro a été trouvé sur la diagonale de la matrice.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Réorganisation, étape = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr ""
+"Décompte d'opérations pour la boucle interne de factorisation = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Pivot trouvé à %1d,%1d utilisant "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"Résumé de matrice\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Dimension de la matrice = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "La matrice a été réorganisée.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matrice après factorisation :\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matrice avant factorisation :\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Colonnes %1d à %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Le plus grand élément dans la matrice = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Le plus petit élément de la matrice = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Le plus grand élément diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Le plus petit élément diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Le plus grand élément pivot = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Le plus petit élément pivot = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Densité = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Nombre de compléments = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Attention : La matrice qui suit est factorisée sous la forme LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "La matrice n'a pas été factorisée.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Début d'une nouvelle matrice |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "La matrice est complexe.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "La matrice est réelle.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Nombre initial d'éléments = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Nombre initial moyen d'éléments par ligne = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Compléments = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Nombre moyen de compléments par ligne = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Nombre total d'éléments = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Nombre moyen d'éléments par ligne = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Densité = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Seuil relatif = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Seuil absolu = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Le plus grand élément = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Le plus petit élément = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norme du membre droit : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Traitement spécial là où le membre droit vaut zéro.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Type de préconditionnement n°1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Type de préconditionnement n°2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Nouveau résidu = %s < tol = %s => arrêt\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Itération #%s/%s résidu : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Résidu final = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Échec de l'algorithme\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s : Erreur de convergence.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Succès de l'algorithme\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s : Nombre erroné d'arguments d'entrée : %d à %d attendus.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr "%s : Nombre erroné d'arguments de sortie : %d à %d attendus.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s : Type erroné de l'argument d'entrée n°%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s : Dimension erronée de l'argument d'entrée n°%d : %s a la dimension %d, "
+"mais %d attendu.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : %s=%d, mais une valeur "
+"positive attendue.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : %s=%s, mais un flottant "
+"entier attendu.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : %s=%d, ce qui ne "
+"correspond pas à %s : %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : %s=%d, ce qui ne "
+"correspond pas à la dimension de %s : %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr " La matrice des possibles n'est pas définie positive."
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+"Diagonale non positive rencontrée, la matrice n'est pas définie positive."
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr "Mémoire de travail insuffisante dans blkfct, temp(*)."
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr "Mémoire de travail insuffisante dans blkfct, iwork(*)."
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " SYMFCT requiert que PERM soit de taille neqns x 1"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " SYMFCT requiert que INVN soit de taille neqns x 1"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " SYMFCT requiert que CACHSZ soit de taille 1 x 1"
+
+msgid " Insufficient working storage in sfinit"
+msgstr " Mémoire de travail insuffisante dans sfinit"
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Arguments :\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une matrice carrée attendue.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une matrice attendue.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Un vecteur colonne attendu.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s : Dimension erronée de l'argument d'entrée n°%d : Même dimension que "
+"l'argument d'entrée n°%d attendue.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une seule chaîne de "
+"caractères attendue.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : %s, %s, %s ou %s attendu.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Un scalaire attendu.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : Un vecteur colonne "
+"attendu.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s : Nombre erroné d'arguments d'entrée : Au moins %d attendus.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s : Dimension erronée de l'argument d'entrée n°%d : Une matrice carrée "
+"attendue.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s : Dimension erronée de l'argument d'entrée n°%d : Un vecteur de colonne "
+"attendu.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s : Dimension erronée de l'argument d'entrée n°%d : Un scalaire attendu.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s : Ne converge pas\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr "%s : Nombre erroné d'arguments d'entrée : %d au moins attendus.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n °%d : Un réel, une matrice "
+"complexe, une matrice creuse ou une fonction attendu.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : Une transposée de la "
+"fonction %s attendue.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une transposée de la fonction "
+"%s attendue.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+"%s : Appeler qmr(A,Ap) est obsolète. Veuillez consulter l'aide de qmr pour "
+"plus d'informations.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Un vecteur colonne réel ou "
+"complexe, dense ou creux attendu.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une fonction ou une matrice "
+"carrée, réelle ou complexe, dense ou creuse attendue.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s : Appeler qmr(...,M1,M1p) est obsolète. Veuillez consulter l'aide de qmr "
+"pour plus d'informations.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une transposée de la fonction "
+"attendue.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s : Prototype erroné de l'argument d'entrée n°%d : Si M1 est une fonction, "
+"utilisez l'entête M1(x,t) au lieu de M1(x).\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s : Appeler qmr(...,M2,M2p) est obsolète. Veuillez consulter l'aide de qmr "
+"pour plus d'informations.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s : Prototype erroné de l'argument d'entrée n°%d : Si M2 est une fonction, "
+"utilisez l'entête M2(x,t) au lieu de M2(x).\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Un scalaire réel attendu.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s : Nombre erroné d'arguments d'entrée : %d ou %d attendus.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s : Type erroné de l'argument d'entrée n°%d : Une chaîne de caractères "
+"attendue.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s : Valeur erronée de l'argument d'entrée n°%d : '%s' ou '%s' attendu.\n"
diff --git a/modules/sparse/locales/it_IT.po b/modules/sparse/locales/it_IT.po
new file mode 100755
index 000000000..590b07569
--- /dev/null
+++ b/modules/sparse/locales/it_IT.po
@@ -0,0 +1,504 @@
+# Italian translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2015-02-15 20:27+0000\n"
+"Last-Translator: Carml <mighty.carml@gmail.com>\n"
+"Language-Team: Italian <it@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: it\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "scarso: panico nel file '%s' alla riga %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: È stato trovato uno zero sulla diagonale della matrice.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Riordino, passo = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr ""
+"Conteggio delle operazioni per il ciclo interno di fattorizzazione = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Trovato un pivot a %1d,%1d usando "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"SOMMARIO DELLA MATRICE\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Dimensioni della matrice = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "La matrice è stata riordinata.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "La matrice dopo la fattorizzazione:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "La matrice dopo la fattorizzazione:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Colonne da %1d a %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"L'elemento più grande nella matrice = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Il più piccolo elemento nella matrice = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Il più grande elemento diagonale = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "ll più piccolo elemento diagonale = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Il più grande elemento pivot = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Il più piccolo elemento pivot = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Densità = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Numero di rimpiazzi = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Attenzione . la seguente matrice è fattorizzata nella forma LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "La matrice non è stata calcolata.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Avvio della nuova matrice |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "La matrice è complessa.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "La matrice è reale.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Numero iniziale di elementi = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Numero medio di elementi per riga = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Rimpiazzi = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Numero medio di rimpiazzi per riga = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Numero totale di elementi = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Numero medio di elementi per riga = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Densità = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Limite relativo = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Limite assoluto = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Elemento più grande = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Elemento più piccolo = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "La norma della parte destra : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Elaborazione speciale quando la parte destra è zero.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Tipo di precondizionamento #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Tipo di precondizionamento #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Nuovo residuo = %s < tol =%s => interruzione\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Iterazione #%s/%s residuo : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Residuo finale = %s > tol = %s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "L'algoritmo fallisce\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Errore di convergenza.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Passo dell'algoritmo\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Il numero degli argomenti in ingresso è sbagliato: era atteso da %d a "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Il numero degli argomenti in uscita è sbagliato: era atteso da %d a "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: L'argomento in ingresso #%d è di tipo sbagliato.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha una dimensione sbagliata: %s ha "
+"dimensione %d, ma era attesa %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: %s=%d, ma era atteso "
+"un valore positivo.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: %s=%s, ma era atteso "
+"un intero a virgola mobile.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: %s=%d, ma non "
+"corrisponde a %s: %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: %s=%d, ma non "
+"corrisponde alla dimensione di %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr " La matrice possibile è definita non positiva."
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+"Trovata una diagonale non positiva, la matrice è definita non positiva."
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr "Memoria di lavoro insufficiente in blkfct, temp(*)"
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr "Memoria di lavoro insufficiente in blkfct, iwork(*)."
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " SYMFCT richiede che PERM sia neqns x 1"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " SYMFCT richiede che INVN sia neqns x 1"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " SYMFCT richiede che CACHSZ sia 1 x 1"
+
+msgid " Insufficient working storage in sfinit"
+msgstr " Memoria di lavoro insufficiente in sfinit"
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argomenti:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una matrice "
+"quadrata.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una "
+"matrice.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era atteso un vettore "
+"colonna.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha una dimensione sbagliata: era attesa la "
+"stessa dim. dell'arg. in ingr. #%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una stringa "
+"singola.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+"%s: L' argomento in ingresso #%d ha un valore sbagliato: era atteso %s, %s, "
+"%s o %s.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era atteso uno "
+"scalare.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: era atteso un "
+"vettore colonna.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: Il numero degli argomenti in ingresso è sbagliato: ne erano attesi "
+"almeno %d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha una dimensione sbagliata: era attesa una "
+"matrice quadrata.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: era atteso un "
+"vettore colonna.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha una dimensione sbagliata: era atteso uno "
+"scalare.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: Non è converso.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: Il numero degli argomenti in ingresso è sbagliato: ne erano attesi "
+"almeno %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una matrice "
+"reale o complessa o una matrice sparsa o una funzione.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: era attesa la "
+"trasposta della funzione %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una "
+"trasposta della funzione %s.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+"%s: La chiamata qmr(A,Ap) è deprecata. Consultare la documentazione di qmr "
+"per maggiori dettagli.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era atteso un vettore "
+"reale o complesso, uno pieno o uno a colonna sparso.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una matrice "
+"reale o complessa, piena o sparsa, una quadrata o una funzione.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: La chiamata qmr(...,M1,M1p) è deprecata. Consultare la documentazione di "
+"qmr per maggiori dettagli.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una "
+"trasposta della funzione.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s: Il prototipo dell'argomento in ingresso #%d è sbagliato: se M1 è una "
+"funsione, usare l'header M1(x,t) invece di M1(x).\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: La chiamata qmr(...,M2,M2p) è deprecata. Consultare la documentazione di "
+"qmr per maggiori dettagli.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s: Il prototipo dell'argomento in ingresso #%d è sbagliato: se M2 è una "
+"funsione, usare l'header M2(x,t) invece di M2(x).\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era atteso uno scalare "
+"reale.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+"%s: Il numero degli argomenti in ingresso è sbagliato: ne erano attesi %d o "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d è di tipo sbagliato: era attesa una "
+"stringa.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: L'argomento in ingresso #%d ha un valore sbagliato: era atteso '%s' o "
+"'%s'.\n"
diff --git a/modules/sparse/locales/ja_JP.po b/modules/sparse/locales/ja_JP.po
new file mode 100755
index 000000000..55ec15507
--- /dev/null
+++ b/modules/sparse/locales/ja_JP.po
@@ -0,0 +1,560 @@
+# Japanese translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2013-12-08 11:58+0000\n"
+"Last-Translator: Rui Hirokawa <Unknown>\n"
+"Language-Team: Japanese <z-saito@guitar.ocn.ne.jp>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"X-Poedit-Country: Japan\n"
+"Language: ja\n"
+"X-Poedit-Language: Japanese\n"
+
+# File: includes/spDefs.h, line: 379
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "スパース: ç·š %2$d 㧠ファイル `%1$s' ã¯ãƒ‘ニックã§ã™ã€‚\n"
+
+#
+# File: src/c/lu.c, line: 121
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: 行列ã§ã‚¼ãƒ­ãŒå¯¾è§’ç·šã§å‡ºä¼šã„ã¾ã—ãŸã€‚\n"
+
+#
+# File: src/c/spFactor.c, line: 233
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "å†æ•´ç†ã€ã‚¹ãƒ†ãƒƒãƒ— = %1d\n"
+
+#
+# File: src/c/spFactor.c, line: 711
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "因数分解ã®å†…å´ã®ãƒ«ãƒ¼ãƒ—ã®ãŸã‚ã®æ“作数 = %d\n"
+
+#
+# File: src/c/spFactor.c, line: 3011
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "軸㯠%1d,%1d ã§ä½¿ã£ã¦ã„ã‚‹ã®ã‚’見ã¤ã‘ã¾ã—㟠"
+
+#
+# File: src/c/spOutput.c, line: 176
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"行列è¦ç´„\n"
+"\n"
+
+#
+# File: src/c/spOutput.c, line: 177
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "行列ã®ã‚µã‚¤ã‚º = %1u x %1u.\n"
+
+#
+# File: src/c/spOutput.c, line: 179
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "行列ã¯å†æ•´ç†ã•ã‚Œã¾ã—ãŸã€‚\n"
+
+#
+# File: src/c/spOutput.c, line: 183
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "行列因å­åˆ†è§£ã®å¾Œã®è¡Œåˆ—:\n"
+
+#
+# File: src/c/spOutput.c, line: 185
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "因数分解ã®å‰ã®è¡Œåˆ—:\n"
+
+#
+# File: src/c/spOutput.c, line: 223
+# File: src/c/spOutput.c, line: 225
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "列 %1d ã‹ã‚‰ %1d ã¸\n"
+
+#
+# File: src/c/spOutput.c, line: 308
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"行列ã®æœ€ã‚‚大ãã„è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 309
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "行列ã®æœ€ã‚‚å°ã•ã„è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 322
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最も大ãã„対角線ã®è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 323
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "最もå°ã•ã„対角線ã®è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 326
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最も大ãã„軸ã®è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 327
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "最もå°ã•ã„軸ã®è¦ç´  = %-1.4lg.\n"
+
+#
+# File: src/c/spOutput.c, line: 331
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"密度 = %2.2lf%%.\n"
+
+#
+# File: src/c/spOutput.c, line: 334
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "fill-ins ã®æ•° = %1d.\n"
+
+#
+# File: src/c/spOutput.c, line: 417
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "警告 : 以下ã®è¡Œåˆ—ã¯LUå½¢ã«å› æ•°åˆ†è§£ã•ã‚Œã¾ã™ã€‚\n"
+
+#
+# File: src/c/spOutput.c, line: 683
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "行列ã¯å› æ•°åˆ†è§£ã•ã‚Œã¾ã›ã‚“ã§ã—ãŸã€‚\n"
+
+#
+# File: src/c/spOutput.c, line: 684
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| æ–°ã—ã„行列を開始 |||\n"
+
+#
+# File: src/c/spOutput.c, line: 687
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "行列ã¯è¤‡é›‘ã§ã™ã€‚\n"
+
+#
+# File: src/c/spOutput.c, line: 689
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "行列ã¯å®Ÿã§ã™ã€‚\n"
+
+#
+# File: src/c/spOutput.c, line: 713
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " è¦ç´ ã®åˆæœŸæ•° = %d\n"
+
+#
+# File: src/c/spOutput.c, line: 716
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " 列当ãŸã‚Šã®è¦ç´ ã®æœ€åˆã®å¹³å‡æ•° = %lf\n"
+
+#
+# File: src/c/spOutput.c, line: 718
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Fill-ins = %d\n"
+
+#
+# File: src/c/spOutput.c, line: 719
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " 列当ãŸã‚Šã®fill-insã®å¹³å‡æ•° = %lf%%\n"
+
+#
+# File: src/c/spOutput.c, line: 721
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " è¦ç´ ã®ç·æ•° = %d\n"
+
+#
+# File: src/c/spOutput.c, line: 723
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " 列当ãŸã‚Šã®è¦ç´ ã®å¹³å‡æ•° = %lf\n"
+
+#
+# File: src/c/spOutput.c, line: 725
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " 密度 = %lf%%\n"
+
+#
+# File: src/c/spOutput.c, line: 727
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " 相対値境界 = %e\n"
+
+#
+# File: src/c/spOutput.c, line: 728
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " 絶対値境界 = %e\n"
+
+#
+# File: src/c/spOutput.c, line: 729
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " 最も大ãã„è¦ç´  = %e\n"
+
+#
+# File: src/c/spOutput.c, line: 730
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" 最もå°ã•ã„è¦ç´  = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "å³è¾ºãƒ™ã‚¯ãƒˆãƒ«ã®ãƒŽãƒ«ãƒ  : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "å³è¾ºãƒ™ã‚¯ãƒˆãƒ«ãŒã‚¼ãƒ­ã®ç‰¹åˆ¥ãªåŠ å·¥\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " å‰å‡¦ç†ã®ç¨®é¡ž #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " å‰å‡¦ç†ã®ç¨®é¡ž #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " æ–°ã—ã„残差 = %s < tol = %s => break\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " å復 #%s/%s 残差 : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "最終ã®æ®‹å·® = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "異常終了\n"
+
+#
+# File: macros/pcg.sci, line: 269
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: 集åˆã‚¨ãƒ©ãƒ¼\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "正常終了\n"
+
+#
+# File: macros/gmres.sci, line: 152
+# File: macros/pcg.sci, line: 48
+# File: macros/pcg.sci, line: 51
+# File: macros/qmr.sci, line: 261
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%1$s: 入力引数ã§ä¸æ­£ãªæ•°: %3$d ã¸ã® %2$d を想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr "%s: 出力引数ã®æ•°ãŒé–“é•ã£ã¦ã„ã¾ã™: %d ã‹ã‚‰ %d 個ã®å¼•æ•°ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#
+# File: macros/pcg.sci, line: 98
+# File: macros/pcg.sci, line: 138
+# File: macros/pcg.sci, line: 164
+# File: macros/qmr.sci, line: 73
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªåž‹ã§ã™ã€‚\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr "%s: 入力引数 #%d ã®æ•°ãŒé–“é•ã£ã¦ã„ã¾ã™: %s ã®å¤§ãã•ã¯ %d ã§ã™ãŒ, %d ãŒä»•æ§˜ã§ã™.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr "%s: 入力引数 #%d: %s=%d ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™, æ­£ã®å€¤ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr "%s: 入力引数ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™ #%d: %s=%s, 浮動å°æ•°ç‚¹æ•°ã®æ•´æ•°ãŒä»•æ§˜ã§ã™.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr "%s: 入力引数 #%d: %s=%d ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™, %s:%d å½¢å¼ã«ä¸€è‡´ã—ã¾ã›ã‚“.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr "%s: 入力引数 #%d: %s=%d ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™, %s: %d ãŒãŠå¤§ãã•ã¨ä¸€è‡´ã—ã¾ã›ã‚“.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr " 実行å¯èƒ½è¡Œåˆ—ãŒæ­£å®šã§ã¯ã‚ã‚Šã¾ã›ã‚“."
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr "æ­£ã§ãªã„対角è¦ç´ ãŒã‚ã‚Šã¾ã—ãŸ, 行列ã¯æ­£å®šã§ã¯ã‚ã‚Šã¾ã›ã‚“."
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr "blkfct, temp(*) ã§åˆ©ç”¨å¯èƒ½ãªè¨˜æ†¶é ˜åŸŸãŒå分ã§ã‚ã‚Šã¾ã›ã‚“."
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr "blkfct, iwork(*) ã§åˆ©ç”¨å¯èƒ½ãªè¨˜æ†¶é ˜åŸŸãŒå分ã§ã‚ã‚Šã¾ã›ã‚“."
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " SYMFCT 㯠PERM ㌠1 x 1 ã§ã‚ã‚‹ã“ã¨ã‚’è¦æ±‚ã—ã¾ã™"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " SYMFCT 㯠INVN ㌠1 x 1 ã§ã‚ã‚‹ã“ã¨ã‚’è¦æ±‚ã—ã¾ã™"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " SYMFCT 㯠CACHSZ ㌠1 x 1 ã§ã‚ã‚‹ã“ã¨ã‚’è¦æ±‚ã—ã¾ã™"
+
+msgid " Insufficient working storage in sfinit"
+msgstr " sfinit ã®ä½œæ¥­é ˜åŸŸãŒè¶³ã‚Šã¾ã›ã‚“"
+
+#
+# File: macros/pcg.sci, line: 72
+#, c-format
+msgid "Arguments:\n"
+msgstr "引数:\n"
+
+#
+# File: macros/gmres.sci, line: 122
+# File: macros/pcg.sci, line: 103
+# File: macros/pcg.sci, line: 142
+# File: macros/pcg.sci, line: 168
+# File: macros/qmr.sci, line: 79
+# File: macros/qmr.sci, line: 140
+# File: macros/qmr.sci, line: 191
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªåž‹: 正方行列を想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 行列を指定ã—ã¦ãã ã•ã„.\n"
+
+#
+# File: macros/gmres.sci, line: 71
+# File: macros/gmres.sci, line: 142
+# File: macros/pcg.sci, line: 108
+# File: macros/qmr.sci, line: 115
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªåž‹: 列ベクトルを想定ã—ã¾ã™ã€‚\n"
+
+#
+# File: macros/gmres.sci, line: 128
+# File: macros/pcg.sci, line: 112
+# File: macros/pcg.sci, line: 145
+# File: macros/pcg.sci, line: 171
+# File: macros/pcg.sci, line: 179
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªã‚µã‚¤ã‚º: 入力引数 #%d ã¨ã—ã¦åŒã˜ã‚µã‚¤ã‚ºã‚’想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 文字列を1ã¤æŒ‡å®šã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr "%s: 入力引数 #%d ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™: %s, %s, %s ã¾ãŸã¯ %s を指定ã—ã¦ãã ã•ã„.\n"
+
+#
+# File: macros/gmres.sci, line: 83
+# File: macros/gmres.sci, line: 93
+# File: macros/gmres.sci, line: 103
+# File: macros/pcg.sci, line: 117
+# File: macros/pcg.sci, line: 121
+# File: macros/qmr.sci, line: 235
+# File: macros/qmr.sci, line: 249
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªåž‹: スカラーを想定ã—ã¾ã™ã€‚\n"
+
+#
+# File: macros/pcg.sci, line: 176
+# File: macros/qmr.sci, line: 105
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªå€¤: 列ベクトルを想定ã—ã¾ã™ã€‚\n"
+
+#
+# File: macros/gmres.sci, line: 51
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s: 入力引数ã§ä¸æ­£ãªæ•°: å°‘ãªãã¨ã‚‚ %d を想定ã—ã¾ã™ã€‚\n"
+
+#
+# File: macros/gmres.sci, line: 66
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªã‚µã‚¤ã‚º: 正方行列を想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr "%s: 入力引数 #%d ã®å¤§ãã•ãŒé–“é•ã£ã¦ã„ã¾ã™: 列ベクトルを指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s: 入力引数 #%d ã®å¤§ãã•ãŒé–“é•ã£ã¦ã„ã¾ã™: スカラーを指定ã—ã¦ãã ã•ã„.\n"
+
+#
+# File: macros/gmres.sci, line: 290
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: 集ã¾ã‚Šã¾ã›ã‚“ã§ã—ãŸã€‚\n"
+
+#
+# File: macros/qmr.sci, line: 61
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr "%s: 入力引数ã§ä¸æ­£ãªæ•°: 最低ã§ã‚‚ %d を想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr "%s: 引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 実数ã¾ãŸã¯è¤‡ç´ æ•°ã®è¡Œåˆ—ã€ç–Žè¡Œåˆ—ã¾ãŸã¯é–¢æ•°ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#
+# File: macros/qmr.sci, line: 97
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr "%s: 入力引数 #%d ã§ä¸æ­£ãªå€¤: 機能 %s ã®ç½®ãæ›ãˆã‚’想定ã—ã¾ã™ã€‚\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 関数 %s ã®è»¢ç½®ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr "%s : qmr(A,Ap) ã®ã‚³ãƒ¼ãƒ«ã¯å»ƒæ­¢ã•ã‚Œã¦ã„ã¾ã™. 詳細ã«ã¤ã„ã¦ã¯, qmr ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å‚ç…§ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 実数ã¾ãŸã¯è¤‡ç´ æ•°ã®é€šå¸¸ã¾ãŸã¯ç–Žã®åˆ—ベクトルを指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 実数ã¾ãŸã¯è¤‡ç´ æ•°ã®é€šå¸¸ã¾ãŸã¯ç–Žã®æ­£æ–¹è¡Œåˆ—ã¾ãŸã¯é–¢æ•°ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr "%s : qmr(...,M1,M1p) ã®ã‚³ãƒ¼ãƒ«ã¯å»ƒæ­¢ã•ã‚Œã¦ã„ã¾ã™. 詳細ã«ã¤ã„ã¦ã¯, qmr ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å‚ç…§ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 関数ã®è»¢ç½®ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s: 入力引数 #%d ã®ãƒ—ロトタイプãŒé–“é•ã£ã¦ã„ã¾ã™: M1 ãŒé–¢æ•°ã®å ´åˆ, M1(x)ã§ã¯ãªãヘッダ M1(x,t) を使用ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr "%s : qmr(...,M2,M2p) ã®ã‚³ãƒ¼ãƒ«ã¯å»ƒæ­¢ã•ã‚Œã¦ã„ã¾ã™. 詳細ã«ã¤ã„ã¦ã¯, qmr ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’å‚ç…§ãã ã•ã„.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s: 入力引数 #%d ã®ãƒ—ロトタイプãŒé–“é•ã£ã¦ã„ã¾ã™: M12ãŒé–¢æ•°ã®å ´åˆ, M2(x)ã§ã¯ãªãヘッダ M2(x,t) を使用ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 実数スカラーを指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s: 入力引数ã®æ•°ãŒé–“é•ã£ã¦ã„ã¾ã™: %d ã¾ãŸã¯ %d 個ã®å¼•æ•°ã‚’指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr "%s: 入力引数 #%d ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™: 文字列を指定ã—ã¦ãã ã•ã„.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr "%s: 入力引数 #%d ã®å€¤ãŒé–“é•ã£ã¦ã„ã¾ã™: '%s' ã¾ãŸã¯ '%s' を指定ã—ã¦ãã ã•ã„.\n"
diff --git a/modules/sparse/locales/pl_PL.po b/modules/sparse/locales/pl_PL.po
new file mode 100755
index 000000000..1f4c17921
--- /dev/null
+++ b/modules/sparse/locales/pl_PL.po
@@ -0,0 +1,465 @@
+# Polish translation for scilab
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2011-10-20 14:22+0000\n"
+"Last-Translator: Grzegorz Szostek <Unknown>\n"
+"Language-Team: Polish <pl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: pl\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "Moduł macierze rzadkie (sparse): błąd w pliku `%s' w linii %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: Napotkano zero na przekÄ…tnej macierzy.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Zmiana numeracji elementów. Krok = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "Ilość operacji dla pętli wewnętrznej rozkładu na czynniki = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "W pozycji %1d,%1d znaleziono element główny (pivot), używając "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"Podsumowanie dla macierzy\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Rozmiar macierzy = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "Kolejność elementów macierzy została zmieniona.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Macierz po rozkładzie na czynniki:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Macierz przed rozkładem na czynniki:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Kolumny od %1d to %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Największy element w macierzy = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Najmniejszy element w macierzy = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Największy element na przekątnej = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Najmniejszy element diagonalny = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Największy element wybrany (pivot) = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Najmniejszy element główny (piwot) = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Gęstość = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Liczba wypełnień = %1d\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr ""
+"Ostrzeżenie : Następująca macierz jest sprowadzona do postaci iloczynu LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "Macierz nie została rozłożona na czynniki.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Rozpoczęto nową macierz |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "Macierz z liczb zespolonych.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "Macierz jest typu real.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Początkowa liczba elementów = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Początkowa średnia liczba elementów w każdym wierszu = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Wypełnienia = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Średnia liczba wypełnień w każdym wierszu = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Całkowita liczba elementów = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Średnia liczba elementów w każdym wierszu = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Gęstość = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Próg względny = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Próg bezwzględny = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Największy element = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Najmniejszy element = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norma prawej strony :%s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Specjalny proces dla przypadku gdy prawa strona jest zerowa.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Type of preconditionning #1 : %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Type of preconditionning #2 : %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr ""
+" Nowy błąd obliczeniowy (residual) = %s < tol = %s => koniec obliczeń\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " BÅ‚Ä…d obliczeniowy (residual) dla Iteracji nr %s/%s : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Końcowy błąd obliczeń (residual) = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Brak powodzenia algorytmu\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Błąd zbieżności.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Powodzenie algorytmu\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Nieprawidłowa liczba argumentów wejściowych: oczekiwano od %d do %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Nieprawidłowa liczba parametrów wyjściowych: oczekiwano od %d do %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: Nieprawidłowy typ dla argumentu wejściowego nr %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: Nieprawidłowy rozmiar argumentu wejściowego #%d: %s ma rozmiar %d, "
+"oczekiwano %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: Nieprawidłowa wartość argumentu wejściowego #%d: %s=%d, oczekiwano "
+"wartości dodatniej.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argumenty:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Nieprawidłowy typ parametru wejściowego nr %d: Oczekiwano macierzy "
+"kwadratowej.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Nieprawidłowy typ argumentu wejściowego nr %d: oczekiwany jest wektor "
+"kolumnowy.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: Nieprawidłowy rozmiar argumentu wejściowego nr %d: Oczekiwany taki sam "
+"rozmiar jak u argumentu wejściowego nr %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Nieprawidłowy typ argumentu wejściowego nr %d: oczekiwany skalar.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Nieprawidłowa wartość argumentu wejściowego nr %d: Oczekiwany wektor "
+"kolumnowy.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: Nieprawidłowa liczba argumentów wejściowych: Oczekiwano przynajmniej "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Nieprawidłowy rozmiar argumentu wejściowego nr %d: Oczekiwano macierzy "
+"kwadratowej.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Niepoprawny rozmiar parametru wejściowego nr %d: Oczekiwano wektor "
+"kolumnowy.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Nieprawidłowy rozmiar parametru wejściowego nr %d: oczekiwano skalara.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: Nie zbiegajÄ… siÄ™.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: Nieprawidłowa liczba argumentów wejściowych: oczekiwano przynajmniej "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Nieprawidłowa wartość argumentu wejściowego nr %d: Oczekiwana funkcja "
+"transponowana %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+"%s: Nieprawidłowa liczba argumentów wejściowych: oczekiwano %d lub %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: Nieprawidłowy typ argumentu wejściowego #%d: Oczekiwana jest wartość "
+"typu string.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Nieprawidłowa wartość argumentu wejściowego #%d: oczekiwano '%s' lub "
+"'%s' .\n"
diff --git a/modules/sparse/locales/pt_BR.po b/modules/sparse/locales/pt_BR.po
new file mode 100755
index 000000000..404d72796
--- /dev/null
+++ b/modules/sparse/locales/pt_BR.po
@@ -0,0 +1,469 @@
+# Brazilian Portuguese translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2012-04-22 00:04+0000\n"
+"Last-Translator: Ramiro Pereira de Magalhães <ramiro.p.magalhaes@gmail.com>\n"
+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: pt_BR\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "Sparse: pânico no arquivo '%s' na linha %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: Um zero foi encontrado na diagonal da matriz.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "Reordenando, Passo = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "Contagem de operações para o laço mais interno da fatoração = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Pivô encontrado em %1d,%1d utilizando "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"SUMÃRIO DE MATRIZES\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Tamanho da matriz = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "A matriz foi reordenada.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Matriz após fatoração:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Matriz antes da fatoração:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Colunas de %1d a %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Maior elemento na matriz = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Menor elemento na matriz = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Maior elemento da diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Menor elemento da diagonal = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Maior pivô = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Menor pivô = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"Densidade = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "Quantidade de preenchimentos = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Aviso: A matriz a seguir está fatorada na forma LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "A matriz não foi fatorada.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Iniciando nova matriz |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "A matriz é de números complexos.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "A matriz é de números reais.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Quantidade inicial de elementos = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Média inicial da quantidade de elementos por linha = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Preenchimentos = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Média de preenchimentos por linha = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Quantidade total de elementos = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Média da quantidade de elementos por linha = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " Densidade = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " Limiar relativo = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " Limiar absoluto = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Maior elemento = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Menor elemento = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Norma do lado direito: %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Processamento especial onde o lado direito é zero.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Tipo de precondicionador #1: %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Tipo de precondicionador #2: %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Novo resíduo = %s < tol = %s => break\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Iteração #%s/%s resíduo: %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "Resíduo final = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "O algoritmo falhou\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Erro de convergência.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Passagem do algoritmo\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Quantidade incorreta de argumentos de entrada: esperava-se de %d a %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Quantidade incorreta de argumentos de saída: esperava-se de %d a %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: Tipo incorreto para o argumento de entrada #%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: Tamanho incorreto para argumento de entrada #%d: %s tem %d, mas %d é "
+"esperado.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: Valor incorreto para argumento de entrada #%d: %s=%d, pois é esperado um "
+"valor positivo.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: Valor incorreto para argumento de entrada #%d: %s=%s, mas se esperava "
+"um inteiro ponto flutuante.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: Valor incorreto para argumento de entrada #%d: %s=%d, que não "
+"corresponde %s: %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: Valor incorreto para argumento de entrada #%d: %s=%d, que não "
+"corresponde com o tamanho de %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Argumentos:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Tipo incorreto para o argumento de entrada #%d: esperava-se uma matriz "
+"quadrada.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Tipo incorreto para o argumento de entrada #%d: esperava-se um vetor "
+"coluna.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: Tamanho incorreto para o argumento de entrada #%d: esperava-se o mesmo "
+"tamanho do argumento de entrada #%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Tipo incorreto para o argumento de entrada #%d: esperava-se um escalar.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Valor incorreto para o argumento de entrada #%d: esperava-se um vetor "
+"coluna.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: Quantidade incorreta de argumentos de entrada: esperava-se pelo menos "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Tamanho incorreto para o argumento de entrada #%d: esperava-se uma "
+"matriz quadrada.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Tamanho incorreto para o argumento de entrada #%d: esperava-se um vetor "
+"coluna.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: Tamanho incorreto para o argumento de entrada #%d: esperava-se um "
+"escalar.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: Não convergiu.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: Quantidade incorreta de argumentos de entrada: esperava-se pelo menos "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Valor incorreto para o argumento de entrada #%d: esperava-se a "
+"transposta da função %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+"%s: Quantidade incorreta de argumentos de entrada: esperava-se %d ou %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: Tipo errado para o argumento de entrada #%d: Esperava-se uma string.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Valor incorreto para o argumento de entrada #%d: esperava-se '%s' ou "
+"'%s'.\n"
diff --git a/modules/sparse/locales/ru_RU.po b/modules/sparse/locales/ru_RU.po
new file mode 100755
index 000000000..9bcae1a5b
--- /dev/null
+++ b/modules/sparse/locales/ru_RU.po
@@ -0,0 +1,469 @@
+# Russian translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2014-03-26 01:06+0000\n"
+"Last-Translator: Stanislav V. Kroter <krotersv@gmail.com>\n"
+"Language-Team: Russian <ru@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: ru\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "sparse: ошибка в файле «%s» в Ñтроке %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: Ðа диагонали матрицы вÑтречен нуль.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "ПереупорÑдочение, шаг = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "ПодÑчёт операций Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½ÐµÐ³Ð¾ цикла факторизации = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Ведущий Ñлемент найден на %1d,%1d иÑпользуетÑÑ "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"СВОДКРМÐТРИЦЫ\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "Размер матрицы = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "Матрица была переупорÑдочена.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "Матрица поÑле факторизации:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "Матрица до факторизации:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Столбцы Ñ %1d по %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðаибольший Ñлемент в матрице = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Ðаименьший Ñлемент в матрице = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðаибольший диагональный Ñлемент = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Ðаименьший диагональный Ñлемент в матрице = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðаибольший ведущий Ñлемент = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Ðаименьший ведущий Ñлемент = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"ПлотноÑÑ‚ÑŒ = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "КоличеÑтво замеÑтителей = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "Внимание: ÑÐ»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð° факторизована к LU форме.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "Матрица не была факторизована.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Ðачало новой матрицы |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "Матрица ÑвлÑетÑÑ ÐºÐ¾Ð¼Ð¿Ð»ÐµÐºÑной.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "Матрица ÑвлÑетÑÑ Ð²ÐµÑ‰ÐµÑтвенной.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Ðачальное чиÑло Ñлементов = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Ðачальное Ñреднее чиÑло Ñлементов в Ñтроке = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " ЗамеÑтители = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Среднее чиÑло замеÑтителей в Ñтроке = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Общее чиÑло Ñлементов = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Среднее чиÑло Ñлементов в Ñтроке = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " ПлотноÑÑ‚ÑŒ = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " ОтноÑительный порог = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " ÐбÑолютный порог = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Ðаибольший Ñлемент = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Ðаименьший Ñлемент = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Ðорма правой Ñтороны : %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "Ð¡Ð¿ÐµÑ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ° там, где Ð¿Ñ€Ð°Ð²Ð°Ñ Ñторона - ноль.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Тип предобуÑÐ»Ð¾Ð²Ð»Ð¸Ð²Ð°Ð½Ð¸Ñ â„–1: %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Тип предобуÑÐ»Ð¾Ð²Ð»Ð¸Ð²Ð°Ð½Ð¸Ñ â„–2: %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " ÐÐ¾Ð²Ð°Ñ Ð½ÐµÐ²Ñзка = %s < tol = %s => завершение\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Ð˜Ñ‚ÐµÑ€Ð°Ñ†Ð¸Ñ â„–%s/%s невÑзка: %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "ÐžÐºÐ¾Ð½Ñ‡Ð°Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð½ÐµÐ²Ñзка = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Сбой алгоритма\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: Ошибка ÑходимоÑти.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Ðлгоритм пройден\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s: Ðеверное количеÑтво входных параметров: ожидалоÑÑŒ от %d до %d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: Ðеверное количеÑтво выходных параметров: ожидалоÑÑŒ от %d до %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: Ðеверный тип входного параметра â„–%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: Ðеверный размер входного параметра â„–%d: %s имеет размер %d, но ожидалÑÑ "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: %s=%d, но ожидалоÑÑŒ "
+"положительное значение.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: %s=%s, но ожидалоÑÑŒ целое Ñ "
+"плавающей точкой.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: %s=%d, которое не равно %s: "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: %s=%d, которое не равно "
+"размеру %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+"Обнаружена Ð½ÐµÐ¿Ð¾Ð»Ð¾Ð¶Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð´Ð¸Ð°Ð³Ð¾Ð½Ð°Ð»ÑŒ, матрица не ÑвлÑетÑÑ Ð¿Ð¾Ð»Ð¾Ð¶Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾ "
+"определённой."
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr "ÐедоÑтаточно рабочего хранилища в blkfct, temp(*)."
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr "ÐедоÑтаточно рабочего хранилица в blkfct, iwork(*)."
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " SYMFCT требует, чтобы размер PERM был neqns x 1"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " SYMFCT требует, чтобы размер INVN был neqns x 1"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " SYMFCT требует, чтобы размер CACHSZ был 1 x 1"
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Параметры:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного параметра â„–%d: ожидалаÑÑŒ ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð°.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr "%s: Ðеверный тип входного аргумента â„–%d: ожидалаÑÑŒ матрица.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s: Ðеверный тип входного параметра â„–%d: ожидалÑÑ Ð²ÐµÐºÑ‚Ð¾Ñ€-Ñтолбец.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: Ðеверный размер входного параметра â„–%d: ожидалÑÑ Ð¾Ð´Ð¸Ð½Ð°ÐºÐ¾Ð²Ñ‹Ð¹ размер Ñ "
+"входным параметром №%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного аргумента â„–%d: ожидалоÑÑŒ одиночное Ñтроковое "
+"значение.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного аргумента â„–%d: ожидалоÑÑŒ %s, %s, %s или %s.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s: Ðеверный тип входного параметра â„–%d: ожидалÑÑ ÑкалÑÑ€.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: ожидалÑÑ Ð²ÐµÐºÑ‚Ð¾Ñ€-Ñтолбец.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s: Ðеверное количеÑтво входных параметров: ожидалоÑÑŒ не менее %d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: Ðеверный размер входного параметра â„–%d: ожидалаÑÑŒ ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð°.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: Ðеверный рамзер входного параметра â„–%d: ожидалÑÑ Ð²ÐµÐºÑ‚Ð¾Ñ€-Ñтолбец.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s: Ðеверный размер входного параметра â„–%d: ожидалÑÑ ÑкалÑÑ€.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: Ðет ÑходимоÑти.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: Ðеверное количеÑтво входных параметров: ожидалоÑÑŒ как минимум %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного аргумента â„–%d : ожидалаÑÑŒ вещеÑÑ‚Ð²ÐµÐ½Ð½Ð°Ñ Ð¸Ð»Ð¸ "
+"комплекÑÐ½Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð°, либо Ñ€Ð°Ð·Ñ€ÐµÐ¶Ñ‘Ð½Ð½Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð°, либо функциÑ.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: ожидалоÑÑŒ транÑпонирование "
+"функции %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr "%s : Вызов qmr(A,Ap) уÑтарел. Смотрите документацию по qmr.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного аргумента â„–%d: ожидалÑÑ Ð²ÐµÑ‰ÐµÑтвенный или "
+"комплекÑный, полный или разрежённый вектор-Ñтолбец.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного аргумента â„–%d: ожидалиÑÑŒ вещеÑÑ‚Ð²ÐµÐ½Ð½Ð°Ñ Ð¸Ð»Ð¸ "
+"комплекÑнаÑ, Ð¿Ð¾Ð»Ð½Ð°Ñ Ð¸Ð»Ð¸ разрежённаÑ, ÐºÐ²Ð°Ð´Ñ€Ð°Ñ‚Ð½Ð°Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ð° или функциÑ.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr "%s : Вызов qmr(...,M1,M1p) уÑтарел. Смотрите документацию по qmr.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s: Ðеверный прототип входного аргумента â„–%d: ЕÑли M1 - Ñто функциÑ, то "
+"иÑпользуйте заголовок M1(x,t) вмеÑто M1(x).\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr "%s : Вызов qmr(...,M2,M2p) уÑтарел. Смотрите документацию по qmr.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s: Ðеверный прототип входного аргумента â„–%d: ЕÑли M2 - Ñто функциÑ, то "
+"иÑпользуйте заголовок M2(x,t) вмеÑто M2(x).\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+"%s: Ðеверный тип входного аргумента â„–%d: ожидаетÑÑ Ð²ÐµÑ‰ÐµÑтвенный ÑкалÑÑ€.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s: Ðеверное количеÑтво входных параметров: ожидалоÑÑŒ %d или %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr "%s: Ðеверный тип входного параметра â„–%d: ожидалаÑÑŒ Ñтрока.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Ðеверное значение входного параметра â„–%d: ожидалоÑÑŒ «%s» или «%s».\n"
diff --git a/modules/sparse/locales/sparse.pot b/modules/sparse/locales/sparse.pot
new file mode 100755
index 000000000..8a7e65f0d
--- /dev/null
+++ b/modules/sparse/locales/sparse.pot
@@ -0,0 +1,676 @@
+# Localization of the module sparse
+# Please see in SCI/tools/localization for localization management
+# Copyright (C) 2007-2008 - INRIA
+# Copyright (C) 2008-2011 - DIGITEO
+# Copyright (C) 2012-2014 - Scilab-Enterprises
+# This file is distributed under the same license as the Scilab package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"Last-Translator: Vincent COUVERT <vincent.couvert@scilab-enterprises.com>\n"
+"Language-Team: Scilab Localization <localization@lists.scilab.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Revision-Date: 2015-03-27 13:54+0100\n"
+
+# File: includes/spDefs.h, line: 379
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr ""
+
+#
+# File: src/c/lu.c, line: 127
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr ""
+
+#
+# File: src/c/spFactor.c, line: 252
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr ""
+
+#
+# File: src/c/spFactor.c, line: 813
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr ""
+
+#
+# File: src/c/spFactor.c, line: 3395
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 186
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 187
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 190
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 196
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 200
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 257
+# File: src/c/spOutput.c, line: 261
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 387
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 388
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 410
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 411
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 415
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 416
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 420
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 424
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 513
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 843
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 845
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 849
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 853
+#, c-format
+msgid "Matrix is real.\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 884
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 887
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 889
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 890
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 892
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 894
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 896
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 898
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 899
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 900
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr ""
+
+#
+# File: src/c/spOutput.c, line: 901
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+
+# File: macros/%bicg.sci, line: 52
+# File: macros/%bicgstab.sci, line: 52
+# File: macros/%cgs.sci, line: 52
+# File: macros/%pcg.sci, line: 63
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 56
+# File: macros/%bicgstab.sci, line: 56
+# File: macros/%cgs.sci, line: 56
+# File: macros/%pcg.sci, line: 67
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 76
+# File: macros/%bicgstab.sci, line: 76
+# File: macros/%cgs.sci, line: 76
+# File: macros/%pcg.sci, line: 85
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 77
+# File: macros/%bicgstab.sci, line: 77
+# File: macros/%cgs.sci, line: 77
+# File: macros/%pcg.sci, line: 86
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 85
+# File: macros/%bicgstab.sci, line: 85
+# File: macros/%bicgstab.sci, line: 142
+# File: macros/%cgs.sci, line: 85
+# File: macros/%pcg.sci, line: 94
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 91
+# File: macros/%bicgstab.sci, line: 91
+# File: macros/%cgs.sci, line: 91
+# File: macros/%pcg.sci, line: 100
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 175
+# File: macros/%bicgstab.sci, line: 188
+# File: macros/%cgs.sci, line: 180
+# File: macros/conjgrad.sci, line: 266
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 176
+# File: macros/%bicgstab.sci, line: 189
+# File: macros/%cgs.sci, line: 181
+# File: macros/conjgrad.sci, line: 267
+#, c-format
+msgid "Algorithm fails\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 180
+# File: macros/%bicgstab.sci, line: 193
+# File: macros/%cgs.sci, line: 185
+# File: macros/conjgrad.sci, line: 271
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr ""
+
+#
+# File: macros/%bicg.sci, line: 185
+# File: macros/%bicgstab.sci, line: 198
+# File: macros/%cgs.sci, line: 190
+# File: macros/conjgrad.sci, line: 276
+#, c-format
+msgid "Algorithm pass\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 19
+# File: macros/conjgrad.sci, line: 92
+# File: macros/conjgrad.sci, line: 95
+# File: macros/gmres.sci, line: 148
+# File: macros/qmr.sci, line: 296
+# File: macros/sp2adj.sci, line: 19
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 23
+# File: macros/sp2adj.sci, line: 23
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 43
+# File: macros/adj2sp.sci, line: 47
+# File: macros/adj2sp.sci, line: 51
+# File: macros/conjgrad.sci, line: 145
+# File: macros/conjgrad.sci, line: 202
+# File: macros/conjgrad.sci, line: 231
+# File: macros/sp2adj.sci, line: 29
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 57
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 63
+# File: macros/adj2sp.sci, line: 67
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 71
+# File: macros/adj2sp.sci, line: 75
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 79
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+
+#
+# File: macros/adj2sp.sci, line: 83
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 54
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 59
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 61
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 63
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 104
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 106
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 108
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+#
+# File: macros/chfact.sci, line: 114
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 119
+#, c-format
+msgid "Arguments:\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 150
+# File: macros/conjgrad.sci, line: 206
+# File: macros/conjgrad.sci, line: 235
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 155
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 158
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 162
+# File: macros/conjgrad.sci, line: 167
+# File: macros/conjgrad.sci, line: 209
+# File: macros/conjgrad.sci, line: 238
+# File: macros/conjgrad.sci, line: 246
+# File: macros/gmres.sci, line: 75
+# File: macros/gmres.sci, line: 127
+# File: macros/gmres.sci, line: 141
+# File: macros/qmr.sci, line: 133
+# File: macros/qmr.sci, line: 162
+# File: macros/qmr.sci, line: 216
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 172
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 174
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 178
+# File: macros/conjgrad.sci, line: 182
+# File: macros/qmr.sci, line: 255
+# File: macros/qmr.sci, line: 277
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+
+#
+# File: macros/conjgrad.sci, line: 243
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+
+#
+# File: macros/gmres.sci, line: 51
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+
+#
+# File: macros/gmres.sci, line: 66
+# File: macros/gmres.sci, line: 122
+# File: macros/qmr.sci, line: 79
+# File: macros/qmr.sci, line: 159
+# File: macros/qmr.sci, line: 213
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+
+#
+# File: macros/gmres.sci, line: 71
+# File: macros/gmres.sci, line: 138
+# File: macros/qmr.sci, line: 118
+# File: macros/qmr.sci, line: 130
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+
+#
+# File: macros/gmres.sci, line: 83
+# File: macros/gmres.sci, line: 93
+# File: macros/gmres.sci, line: 103
+# File: macros/qmr.sci, line: 263
+# File: macros/qmr.sci, line: 285
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+
+#
+# File: macros/gmres.sci, line: 286
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 61
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 73
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 91
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 95
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 105
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 115
+# File: macros/qmr.sci, line: 127
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 153
+# File: macros/qmr.sci, line: 206
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 178
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 180
+# File: macros/qmr.sci, line: 235
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 183
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 233
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 238
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#
+# File: macros/qmr.sci, line: 259
+# File: macros/qmr.sci, line: 281
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#
+# File: macros/sprand.sci, line: 17
+# File: macros/spzeros.sci, line: 14
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+
+#
+# File: macros/sprand.sci, line: 25
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+
+#
+# File: macros/sprand.sci, line: 29
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
diff --git a/modules/sparse/locales/uk_UA.po b/modules/sparse/locales/uk_UA.po
new file mode 100755
index 000000000..9852753a3
--- /dev/null
+++ b/modules/sparse/locales/uk_UA.po
@@ -0,0 +1,501 @@
+# Ukrainian translation for scilab
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the scilab package.
+#
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+# Yuri Chornoivan <yurchor@gmail.com>, 2010, 2012, 2013.
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2013-12-06 19:44+0000\n"
+"Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n"
+"Language-Team: Ukrainian <translation@linux.org.ua>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: uk\n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "sparse: помилка у файлі «%s», Ñ€Ñдок %d.\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: на діагоналі матриці виÑвлено нульовий елемент.\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "ПеревпорÑдкуваннÑ, крок = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "КількіÑÑ‚ÑŒ операцій Ð´Ð»Ñ Ð¿Ñ€Ñмого циклу факторизації = %d.\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr "Знайдено опорний елемент у позиції %1d,%1d, викориÑÑ‚Ð°Ð½Ð½Ñ "
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"РЕЗЮМЕ ÐœÐТРИЦІ\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "РозмірніÑÑ‚ÑŒ матриці = %1u x %1u.\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "Матрицю було перевпорÑдковано.\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "ÐœÐ°Ñ‚Ñ€Ð¸Ñ†Ñ Ð¿Ñ–ÑÐ»Ñ Ñ„Ð°ÐºÑ‚Ð¾Ñ€Ð¸Ð·Ð°Ñ†Ñ–Ñ—:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "ÐœÐ°Ñ‚Ñ€Ð¸Ñ†Ñ Ð´Ð¾ факторизації:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "Стовпчики від %1d до %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðайбільший елемент у матриці = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "Ðайменший елемент матриці = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðайбільший діагональний елемент = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "Ðайменший діагональний елемент = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"Ðайбільший опорний елемент = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr "Ðайменший опорний елемент = %-1.4lg.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"ЩільніÑÑ‚ÑŒ = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr "КількіÑÑ‚ÑŒ ненульових елементів = %1d.\n"
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "ПопередженнÑ: наведену нижче матрицю факторизовано за формулою LU.\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "Матрицю не було факторизовано.\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| Початок нової матриці |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "ÐœÐ°Ñ‚Ñ€Ð¸Ñ†Ñ Ñ” комплекÑною.\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "ÐœÐ°Ñ‚Ñ€Ð¸Ñ†Ñ Ñ” дійÑною.\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " Початкова кількіÑÑ‚ÑŒ елементів = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " Початкова кількіÑÑ‚ÑŒ елементів на Ñ€Ñдок = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Ðенульових коефіцієнтів = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " Ð¡ÐµÑ€ÐµÐ´Ð½Ñ ÐºÑ–Ð»ÑŒÐºÑ–ÑÑ‚ÑŒ ненульових коефіцієнтів на Ñ€Ñдок = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " Загальна кількіÑÑ‚ÑŒ елементів = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " Ð¡ÐµÑ€ÐµÐ´Ð½Ñ ÐºÑ–Ð»ÑŒÐºÑ–ÑÑ‚ÑŒ елементів на Ñ€Ñдок = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " ЩільніÑÑ‚ÑŒ = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " ВідноÑне порогове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ = %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " ÐбÑолютне порогове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ = %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " Ðайбільший елемент = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" Ðайменший елемент = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "Ðорма правої чаÑтини: %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "ОÑоблива обробка Ð´Ð»Ñ Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†ÑŒ з нульовою правою чаÑтиною.\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr " Тип передобумовленоÑÑ‚Ñ– â„–1: %d\n"
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr " Тип передобумовленоÑÑ‚Ñ– â„–2: %d\n"
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr " Ðова нев’Ñзка = %s < tol = %s => зупинка\n"
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " Ð†Ñ‚ÐµÑ€Ð°Ñ†Ñ–Ñ â„–%s з %s, нев’Ñзка: %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "ОÑтаточна нев’Ñзка = %s > припуÑтиму похибку =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "Збій алгоритму\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: помилка збіжноÑÑ‚Ñ–.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "Ðлгоритм пройдено\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr ""
+"%s: помилкова кількіÑÑ‚ÑŒ вхідних параметрів: Ñлід викориÑтовувати від %d до "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+"%s: помилкова кількіÑÑ‚ÑŒ вихідних параметрів: Ñлід викориÑтовувати Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ "
+"від %d до %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: помилковий тип вхідного параметра №%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+"%s: помилкова розмірніÑÑ‚ÑŒ вхідного параметра â„–%d: %s має розмірніÑÑ‚ÑŒ %d, "
+"Ñлід було викориÑтати розмірніÑÑ‚ÑŒ %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: %s=%d, але мало бути вказано "
+"додатне значеннÑ.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: %s=%s, але мало бути вказано "
+"ціле чиÑло з плаваючою крапкою.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: %s=%d, що не відповідає %s: "
+"%d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: %s=%d, що не відповідає "
+"розмірноÑÑ‚Ñ– %s: %d.\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr " Можлива Ð¼Ð°Ñ‚Ñ€Ð¸Ñ†Ñ Ð½Ðµ Ñ” додатно визначеною."
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+"ВиÑвлено недодатний діагональний елемент. ÐœÐ°Ñ‚Ñ€Ð¸Ñ†Ñ Ð½Ðµ Ñ” додатно визначеною."
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr "ÐедоÑтатній робочий обÑÑг пам’ÑÑ‚Ñ– у blkfct, temp(*)."
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr "ÐедоÑтатній робочий обÑÑг пам’ÑÑ‚Ñ– у blkfct, iwork(*)."
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr " Ð”Ð»Ñ SYMFCT PERM повинне мати розмірніÑÑ‚ÑŒ кількоÑÑ‚Ñ– рівнÑнь на 1"
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr " Ð”Ð»Ñ SYMFCT INVN повинне мати розмірніÑÑ‚ÑŒ кількоÑÑ‚Ñ– рівнÑнь на 1"
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr " Ð”Ð»Ñ SYMFCT CACHSZ повинне мати розмірніÑÑ‚ÑŒ 1 на 1"
+
+msgid " Insufficient working storage in sfinit"
+msgstr " ÐедоÑтатній об’єм робочого Ñховища даних у sfinit"
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "Параметри:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: Ñлід викориÑтовувати квадратну "
+"матрицю.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути викориÑтано матрицю.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: Ñлід викориÑтовувати тип вектора-"
+"Ñтовпчика.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr ""
+"%s: помилкова розмірніÑÑ‚ÑŒ вхідного параметра â„–%d: розмірніÑÑ‚ÑŒ має збігатиÑÑ "
+"з розмірніÑÑ‚ÑŽ вхідного параметра â„–%d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути вказано один Ñ€Ñдок "
+"(string).\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: мало бути вказано %s, %s, %s "
+"або %s.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: Ñлід викориÑтовувати ÑкалÑрний "
+"тип.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: Ñлід викориÑтовувати тип "
+"вектора-Ñтовпчика.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr ""
+"%s: помилкова кількіÑÑ‚ÑŒ вхідних параметрів: Ñлід викориÑтовувати не менше за "
+"%d.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr ""
+"%s: помилкова розмірніÑÑ‚ÑŒ вхідного параметра â„–%d: Ñлід викориÑтовувати "
+"квадратну матрицю.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+"%s: помилкова розмірніÑÑ‚ÑŒ вхідного параметра â„–%d: Ñлід викориÑтовувати "
+"вектор-Ñтовпчик.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr ""
+"%s: помилкова розмірніÑÑ‚ÑŒ вхідного параметра â„–%d: Ñлід викориÑтовувати "
+"чиÑло.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: не збігÑÑ.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr ""
+"%s: помилкова кількіÑÑ‚ÑŒ вхідних параметрів: мало бути не менше за %d.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра №%d : мало бути вказано матрицю з "
+"дійÑних або комплекÑних чиÑел, розріджену матрицю або функцію.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ñ‚Ð¸Ð¿ вхідного параметра â„–%d: мала бути функціÑ, "
+"транÑпонована щодо %s.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути вказано транÑпозицію "
+"функції %s.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+"%s: Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ qmr(A,Ap) вважаєтьÑÑ Ð·Ð°Ñтарілою. Будь лаÑка, ознайомтеÑÑ Ð· "
+"документацією щодо qmr, щоб дізнатиÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути вказано дійÑний або "
+"комплекÑний, заповнений або розріджений вектор-Ñтовпчик.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути вказано дійÑну або "
+"комплекÑну, заповнену або розріджену квадратну матрицю або функцію.\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ qmr(...,M1,M1p) вважаєтьÑÑ Ð·Ð°Ñтарілою. Будь лаÑка, ознайомтеÑÑ Ð· "
+"документацією щодо qmr, щоб дізнатиÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: мало бути вказано транÑпозицію "
+"функції.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+"%s: помилковий прототип вхідного параметра â„–%d: Ñкщо M1 Ñ” функцією, "
+"викориÑтовуйте заголовок M1(x,t) заміÑÑ‚ÑŒ M1(x).\n"
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+"%s: Ñ„ÑƒÐ½ÐºÑ†Ñ–Ñ qmr(...,M2,M2p) вважаєтьÑÑ Ð·Ð°Ñтарілою. Будь лаÑка, ознайомтеÑÑ Ð· "
+"документацією щодо qmr, щоб дізнатиÑÑ Ð±Ñ–Ð»ÑŒÑˆÐµ.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+"%s: помилковий прототип вхідного параметра â„–%d: Ñкщо M2 Ñ” функцією, "
+"викориÑтовуйте заголовок M2(x,t) заміÑÑ‚ÑŒ M2(x).\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: Ñлід викориÑтовувати дійÑне "
+"чиÑло.\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+"%s: помилкова кількіÑÑ‚ÑŒ вхідних параметрів: Ñлід викориÑтовувати %d або %d.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+"%s: помилковий тип вхідного параметра â„–%d: Ñлід викориÑтовувати тип "
+"«string».\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
+"%s: Помилкове Ð·Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ Ð²Ñ…Ñ–Ð´Ð½Ð¾Ð³Ð¾ параметра â„–%d: Ñлід викориÑтовувати «%s» або "
+"«%s».\n"
diff --git a/modules/sparse/locales/zh_CN.po b/modules/sparse/locales/zh_CN.po
new file mode 100755
index 000000000..5fb03a244
--- /dev/null
+++ b/modules/sparse/locales/zh_CN.po
@@ -0,0 +1,432 @@
+# Simplified Chinese translation for scilab
+# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2012-06-23 08:52+0000\n"
+"Last-Translator: Wesh <Unknown>\n"
+"Language-Team: Simplified Chinese <zh_CN@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: \n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr "sparse:致命错误å‘生于文件`%s'的第%d行。\n"
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr "%s: é‡åˆ°é›¶åœ¨å¯¹è§’线上的矩阵。\n"
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr "é‡æ–°æŽ’åºï¼ŒStep = %1d\n"
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr "æ“作数的分解内循环= %d。\n"
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr ""
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"矩阵概è¦\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr "矩阵大å°= %1u x %1u。\n"
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "矩阵被é‡æ–°æŽ’åºã€‚\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "因数分解åŽçš„矩阵:\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "因数分解å‰çš„矩阵:\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "列数从%1d到%1d。\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"矩阵中的最大元素 = %-1.4lg。\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr "矩阵中的最å°å…ƒç´  = %-1.4lg。\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最大对角线元素 = %-1.4lg。\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr "最å°å¯¹è§’线元素 = %-1.4lg。\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最大枢轴元素= %-1.4lg。\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"密度= %2.2lf%%。\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr ""
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr "警告:以下矩阵分解到LUå½¢å¼ã€‚\n"
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "矩阵并没有被分解。\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr "||| 开始新矩阵 |||\n"
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "矩阵是å¤æ•°çŸ©é˜µã€‚\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "矩阵是实数矩阵。\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " åˆç­‰æ•°å­—元素= %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr ""
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " 填充项= %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " æ¯è¡Œå¹³å‡å¡«å……项= %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " 元素总é‡= %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " æ¯è¡Œå¹³å‡å…ƒç´ = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " 密度= %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " 相对阈值= %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " ç»å¯¹é˜€å€¼= %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " 最大元素 = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" 最å°å…ƒç´ = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr "规范化å³è¾¹: %s\n"
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr "特别处ç†å³ä¾§æ˜¯é›¶çš„。\n"
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr ""
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr ""
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr ""
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr ""
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "最åŽå‰©ä½™= %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "算法失败\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s:收敛错误。\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "算法通过\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s:输入å‚数的数目错误:应该为%d到%d个å‚数。\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr "%s:输出å‚数的数目错误:应该介于%d与%d之间。\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s:输入å‚æ•°#%d的类型错误。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr "%s:第%d个输入å‚数的大å°é”™è¯¯ï¼š%s大å°ä¸º%d,但是应该为%d。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr "%s:第%d个输入å‚数的值错误:%s=%d,但是应该为正数。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr "%s:第%d个输入å‚数的值错误:%s=%s,但是应该为浮点整数。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr "%s:第%d个输入å‚数的值错误:%s=%d,和%sä¸åŒ¹é…:%d。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr "%s:第%d个输入å‚数的值错误:%s=%d,和%s的大å°ä¸åŒ¹é…:%d。\n"
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "å‚数:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr "%s:输入å‚æ•°#%d的类型错误:应该为方阵。\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s:输入å‚æ•°#%d的类型错误:应该为列å‘é‡ã€‚\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr "%s:输入å‚æ•°#%d的大å°é”™è¯¯ï¼šåº”该与输入å‚æ•°#%d的大å°ç›¸åŒã€‚\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s:输入å‚æ•°#%d的类型错误:应该为标é‡ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr "%s:输入å‚æ•°#%d的值错误:应该为列å‘é‡ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s:输入å‚数的个数错误:应该至少有%d个。\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr "%s:输入å‚æ•°#%d的大å°é”™è¯¯ï¼šåº”该为方阵。\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr "%s:第%d个输入å‚数的大å°é”™è¯¯ï¼šåº”该为列å‘é‡ã€‚\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s:第%d个输入å‚数的大å°é”™è¯¯ï¼šåº”该为标é‡ã€‚\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s:无法收敛。\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr "%s:输入å‚数的数目错误:至少应该输入%d个。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr "%s:第%d个输入å‚数的类型错误:应该为实数或å¤æ•°çŸ©é˜µï¼Œæˆ–稀ç–矩阵,或函数。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr "%s:第%d个输入å‚数的值错误:应该为函数%s的转置。\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr "%s:输入å‚数的数目错误:应该为%d个或%d个。\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr "%s:第%d个输入å‚数的类型错误:应该为字符串。\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr "%s:第%d个输入å‚数的值错误:应该为‘%s’或‘%s’。\n"
diff --git a/modules/sparse/locales/zh_TW.po b/modules/sparse/locales/zh_TW.po
new file mode 100755
index 000000000..e686ff3b3
--- /dev/null
+++ b/modules/sparse/locales/zh_TW.po
@@ -0,0 +1,432 @@
+# Chinese (Traditional) translation for scilab
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the scilab package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: scilab\n"
+"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
+"POT-Creation-Date: 2013-04-16 17:44+0100\n"
+"PO-Revision-Date: 2011-09-01 10:09+0000\n"
+"Last-Translator: tim loo <timloo0710@gmail.com>\n"
+"Language-Team: Chinese (Traditional) <zh_TW@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Launchpad (build 17413)\n"
+"Language: \n"
+
+#, c-format
+msgid "sparse: panic in file `%s' at line %d.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: A zero was encountered on the diagonal the matrix.\n"
+msgstr ""
+
+#, c-format
+msgid "Reordering, Step = %1d\n"
+msgstr ""
+
+#, c-format
+msgid "Operation count for inner loop of factorization = %d.\n"
+msgstr ""
+
+#, c-format
+msgid "Pivot found at %1d,%1d using "
+msgstr ""
+
+#, c-format
+msgid ""
+"MATRIX SUMMARY\n"
+"\n"
+msgstr ""
+"矩陣總åˆ( SUMMARY)\n"
+"\n"
+
+#, c-format
+msgid "Size of matrix = %1u x %1u.\n"
+msgstr ""
+
+#, c-format
+msgid "Matrix has been reordered.\n"
+msgstr "矩陣已é‡æŽ’åº\n"
+
+#, c-format
+msgid "Matrix after factorization:\n"
+msgstr "矩陣因å¼åˆ†è§£å¾Œ\n"
+
+#, c-format
+msgid "Matrix before factorization:\n"
+msgstr "矩陣因å¼åˆ†è§£å‰\n"
+
+#, c-format
+msgid "Columns %1d to %1d.\n"
+msgstr "行 %1d 到 %1d.\n"
+
+#, c-format
+msgid ""
+"\n"
+"Largest element in matrix = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最大的矩陣元素 = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest element in matrix = %-1.4lg.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Largest diagonal element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最大的å°è§’線元素( diagonal element) = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest diagonal element = %-1.4lg.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Largest pivot element = %-1.4lg.\n"
+msgstr ""
+"\n"
+"最大的 pivot element = %-1.4lg.\n"
+
+#, c-format
+msgid "Smallest pivot element = %-1.4lg.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"\n"
+"Density = %2.2lf%%.\n"
+msgstr ""
+"\n"
+"密度(Density) = %2.2lf%%.\n"
+
+#, c-format
+msgid "Number of fill-ins = %1d.\n"
+msgstr ""
+
+#, c-format
+msgid "Warning : The following matrix is factored in to LU form.\n"
+msgstr ""
+
+#, c-format
+msgid "Matrix has not been factored.\n"
+msgstr "矩陣還未因å¼åˆ†è§£\n"
+
+#, c-format
+msgid "||| Starting new matrix |||\n"
+msgstr ""
+
+#, c-format
+msgid "Matrix is complex.\n"
+msgstr "Matrix 是複數(complex).\n"
+
+#, c-format
+msgid "Matrix is real.\n"
+msgstr "Matrix 是實數(real).\n"
+
+#, c-format
+msgid " Initial number of elements = %d\n"
+msgstr " 元素(elements)的起啟數字 = %d\n"
+
+#, c-format
+msgid " Initial average number of elements per row = %lf\n"
+msgstr " æ¯åˆ—元素啟始的數目 = %lf\n"
+
+#, c-format
+msgid " Fill-ins = %d\n"
+msgstr " Fill-ins = %d\n"
+
+#, c-format
+msgid " Average number of fill-ins per row = %lf%%\n"
+msgstr " æ¯åˆ—fill-insçš„å¹³å‡æ•¸ = %lf%%\n"
+
+#, c-format
+msgid " Total number of elements = %d\n"
+msgstr " elements的總數 = %d\n"
+
+#, c-format
+msgid " Average number of elements per row = %lf\n"
+msgstr " æ¯åˆ—元素的平å‡æ•¸ = %lf\n"
+
+#, c-format
+msgid " Density = %lf%%\n"
+msgstr " 密度(Density) = %lf%%\n"
+
+#, c-format
+msgid " Relative Threshold = %e\n"
+msgstr " 相å°çš„臨界點= %e\n"
+
+#, c-format
+msgid " Absolute Threshold = %e\n"
+msgstr " 絕å°çš„邊界值= %e\n"
+
+#, c-format
+msgid " Largest Element = %e\n"
+msgstr " 最大的元素( Element) = %e\n"
+
+#, c-format
+msgid ""
+" Smallest Element = %e\n"
+"\n"
+"\n"
+msgstr ""
+" 最å°çš„ Element = %e\n"
+"\n"
+"\n"
+
+#, c-format
+msgid "Norm of right-hand side : %s\n"
+msgstr ""
+
+#, c-format
+msgid "Special processing where the right-hand side is zero.\n"
+msgstr ""
+
+#, c-format
+msgid " Type of preconditionning #1 : %d\n"
+msgstr ""
+
+#, c-format
+msgid " Type of preconditionning #2 : %d\n"
+msgstr ""
+
+#, c-format
+msgid " New residual = %s < tol = %s => break\n"
+msgstr ""
+
+#, c-format
+msgid " Iteration #%s/%s residual : %s\n"
+msgstr " 迭代(Iteration) #%s/%s residual : %s\n"
+
+#, c-format
+msgid "Final residual = %s > tol =%s\n"
+msgstr "最後剩餘(residual) = %s > tol =%s\n"
+
+#, c-format
+msgid "Algorithm fails\n"
+msgstr "演算法有誤\n"
+
+#, c-format
+msgid "%s: Convergence error.\n"
+msgstr "%s: 收歛有誤.\n"
+
+#, c-format
+msgid "Algorithm pass\n"
+msgstr "演算法æˆåŠŸ\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d to %d expected.\n"
+msgstr "%s: 輸入åƒæ•¸å€‹æ•¸éŒ¯èª¤: 應該有 %d 至 %d 個.\n"
+
+#, c-format
+msgid "%s: Wrong number of output arguments: %d to %d expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d.\n"
+msgstr "%s: 第 %d 個輸入åƒæ•¸åž‹æ…‹éŒ¯èª¤.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, but a positive value is "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%s, but a floating point integer "
+"is expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: %s=%d, which does not match size of "
+"%s: %d.\n"
+msgstr ""
+
+msgid " Possible matrix is not positive definite."
+msgstr ""
+
+msgid "Non-positive diagonal encountered, matrix is not positive definite."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, temp(*)."
+msgstr ""
+
+msgid "Insufficient working storage in blkfct, iwork(*)."
+msgstr ""
+
+msgid " SYMFCT requires PERM to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires INVN to be neqns x 1"
+msgstr ""
+
+msgid " SYMFCT requires CACHSZ to be 1 x 1"
+msgstr ""
+
+msgid " Insufficient working storage in sfinit"
+msgstr ""
+
+#, c-format
+msgid "Arguments:\n"
+msgstr "åƒæ•¸:\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Square matrix expected.\n"
+msgstr "%s: 第 %d 輸入åƒæ•¸åž‹æ…‹éŒ¯èª¤: 應為一方陣.\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A matrix expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Column vector expected.\n"
+msgstr "%s: 第 %d 輸入åƒæ•¸åž‹æ…‹éŒ¯èª¤ : 應為列å‘é‡.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong size for input argument #%d: Same size as input argument #%d "
+"expected.\n"
+msgstr "%s: 第#%d個輸入åƒæ•¸é•·åº¦æœ‰èª¤: 應和第 #%d個åƒæ•¸åŒé•·åº¦æ‰å°\n"
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Single String expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: Scalar expected.\n"
+msgstr "%s: 第 %d 個輸入åƒæ•¸åž‹æ…‹éŒ¯èª¤: 應為純é‡.\n"
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: Column vector expected.\n"
+msgstr "%s: 第 %d 輸入åƒæ•¸å€¼éŒ¯èª¤: è¡Œå‘é‡(Column vector )æ‰å°.\n"
+
+#, c-format
+msgid "%s: Wrong number of input argument: At least %d expected.\n"
+msgstr "%s: 輸入åƒæ•¸ä¹‹æ•¸ç›®éŒ¯èª¤: 至少 %d個æ‰å°.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Square matrix expected.\n"
+msgstr "%s: 第 %d 個輸入åƒæ•¸é•·åº¦éŒ¯èª¤: 應為方陣.\n"
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong size for input argument #%d: Scalar expected.\n"
+msgstr "%s: 第 %d 個輸入åƒæ•¸é•·åº¦éŒ¯èª¤: 應為純é‡.\n"
+
+#, c-format
+msgid "%s: Did not converge.\n"
+msgstr "%s: ä¸æ”¶æ­›( converge).\n"
+
+#, c-format
+msgid "%s: Wrong number of input arguments: At least %d expected.\n"
+msgstr "%s: 輸入åƒæ•¸æ•¸ç›®éŒ¯èª¤ : 至少應有 %d 個.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d : A real or complex matrix or a sparse "
+"matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong value for input argument #%d: Transpose of the function %s "
+"expected.\n"
+msgstr "%s: 第 %d 輸入åƒæ•¸å€¼éŒ¯èª¤: 變æ›å‡½å¼(Transpose)%sæ‰å°.\n"
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function %s "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more "
+"details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse "
+"column vector expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A real or complex, full or sparse, "
+"square matrix or a function expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong type for input argument #%d: A transpose of the function "
+"expected.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M1 is function, use the header "
+"M1(x,t) instead M1(x).\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for "
+"more details.\n"
+msgstr ""
+
+#, c-format
+msgid ""
+"%s: Wrong prototype of input argument #%d: If M2 is function, use the header "
+"M2(x,t) instead M2(x).\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A real scalar expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong number of input arguments: %d or %d expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong type for input argument #%d: A string expected.\n"
+msgstr ""
+
+#, c-format
+msgid "%s: Wrong value for input argument #%d: '%s' or '%s' expected.\n"
+msgstr ""
diff --git a/modules/sparse/macros/%bicg.bin b/modules/sparse/macros/%bicg.bin
new file mode 100755
index 000000000..ce2399d50
--- /dev/null
+++ b/modules/sparse/macros/%bicg.bin
Binary files differ
diff --git a/modules/sparse/macros/%bicg.sci b/modules/sparse/macros/%bicg.sci
new file mode 100755
index 000000000..800fd319c
--- /dev/null
+++ b/modules/sparse/macros/%bicg.sci
@@ -0,0 +1,189 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+//
+// bicg --
+// BICG solves the linear system %Ax=b using the BiConjugate Gradient method.
+// If M is given, it is used as a preconditionning matrix.
+// If both M and M2 are given, the matrix M * M2 is used as a preconditionning
+// matrix.
+//
+// input %A REAL matrix or a function y=Ax(x) which computes y=%A*x for a given x
+// b REAL right hand side vector
+// tol, optional REAL error tolerance (default: 1e-8)
+// maxIter, optional INTEGER maximum number of iterations (default: size(%b))
+// %M, optional REAL preconditioner matrix (default: none)
+// %M2, optional REAL preconditioner matrix (default: none)
+// x0, optional REAL initial guess vector (default: the zero vector)
+// verbose, optional INTEGER set to 1 to enable verbose logging (default : 0)
+//
+// output x REAL solution vector
+// resNorm REAL final relative norm of the residual
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+//
+// References
+//
+// "Numerical Recipes: The Art of Scientific Computing." (third ed.)
+// by William Press, Saul Teukolsky, William Vetterling, Brian Flannery.
+//
+// http://apps.nrbook.com/empanel/index.html?pg=87
+// http://dl.acm.org/citation.cfm?doid=1874391.187410
+// http://mathworld.wolfram.com/BiconjugateGradientMethod.html
+//
+// Notes
+// This script was originally a matlab > scilab translation of the bicg.m
+// script from http://www.netlib.org/templates/matlab
+//
+// The input / output arguments of this command are the same as Matlab's bicg command.
+//
+
+function [x, resNorm, iter, resVec] = %bicg(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+
+ // Initialization
+ bnrm2 = norm(%b);
+ if (verbose==1) then
+ printf(gettext("Norm of right-hand side : %s\n"), string(bnrm2));
+ end
+ if (bnrm2 == 0) then
+ if (verbose==1) then
+ printf(gettext("Special processing where the right-hand side is zero.\n"));
+ end
+ // When rhs is 0, there is a trivial solution : x=0
+ x = zeros(%b);
+ resNorm = 0;
+ resVec = resNorm;
+ else
+ x = x0;
+ // r = %b - %A*x;
+ if (matrixType ==1),
+ r = %b - %A*x;
+ r2 = r;
+ else
+ r = %b - %A(x,Aargs(:));
+ r2 = r;
+ end
+ resNorm = norm(r) / bnrm2;
+ resVec = resNorm;
+ end
+ if (verbose==1) then
+ printf(gettext(" Type of preconditionning #1 : %d\n"),precondType);
+ printf(gettext(" Type of preconditionning #2 : %d\n"),precondBis);
+ end
+ // Begin iteration
+ // Distinguish the number of iterations processed from the currentiter index
+ iter = 0
+ for currentiter = 1:maxIter
+ if (resNorm <= tol) then
+ if (verbose==1) then
+ printf(gettext(" New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
+ end
+ break;
+ end
+ iter = iter + 1
+ if (verbose==1) then
+ printf(gettext(" Iteration #%s/%s residual : %s\n"),string(currentiter),string(maxIter),string(resNorm));
+ printf(" x=\n");
+ disp(x);
+ end
+ // Solve M M2 r = r
+ if %M == [] & %M2 == [] then
+ z = r;
+ elseif %M2 == [] then
+ // Compute r so that M r = r
+ if (precondType == 1) then
+ z = %M \ r;
+ elseif (precondType == 2) then
+ z = %M(r,Margs(:));
+ else
+ z = r;
+ end
+ else
+ // Compute r so that M M2 r = r
+ if (precondBis == 1) then
+ z = %M \ r;
+ z = %M2 \ r;
+ elseif (precondBis == 2) then
+ z = %M(r,Margs(:));
+ z = %M2(r,M2args(:));
+ else
+ z = r;
+ end
+ end
+ // Solve M' M2' r2 = r2
+ if %M == [] & %M2 == [] then
+ z2 = r2;
+ elseif %M2 == [] then
+ // Compute r so that M' r = r
+ if (precondType == 1) then
+ z2 = %M' \ r2;
+ elseif (precondType == 2) then
+ z2 = %M(r2,Margs(:));
+ else
+ z2 = r2;
+ end
+ else
+ // Compute r so that M' M2' r = r
+ if (precondBis == 1) then
+ z2 = %M' \ r2;
+ z2 = %M2' \ r2;
+ elseif (precondBis == 2) then
+ z2 = %M(r2,Margs(:));
+ z2 = %M2(r2,M2args(:));
+ else
+ z2 = r2;
+ end
+ end
+ rho = r'*z2;
+ if (rho == 0) then
+ break;
+ end
+ if (currentiter > 1) then
+ bet = rho / rho_old;
+ p = z + bet*p;
+ p2 = z2 + bet*p2;
+ else
+ p = z;
+ p2 = z2;
+ end
+ // q = %A*p; q2 = %A'*p2;
+ if (matrixType == 1),
+ q = %A*p;
+ q2 = %A'*p2;
+ else
+ q = %A(p);
+ q2 = %A(p2);
+ end
+ alp = rho / (p2'*q);
+ x = x + alp*p;
+ r = r - alp*q;
+ r2 = r2 - alp*q2;
+ resNorm = norm(r) / bnrm2;
+ // Caution : transform the scalar resVec into vector resVec !
+ resVec = [resVec;resNorm];
+ rho_old = rho;
+ end
+ // Test for convergence
+ if (resNorm > tol) then
+ if (verbose==1) then
+ printf(gettext("Final residual = %s > tol =%s\n"),string(resNorm),string(tol));
+ printf(gettext("Algorithm fails\n"));
+ end
+ flag = 1;
+ if (lhs < 2) then
+ warning(msprintf(gettext("%s: Convergence error.\n"),"bicg"));
+ end
+ else
+ flag = 0;
+ if (verbose==1) then
+ printf(gettext("Algorithm pass\n"));
+ end
+ end
+
+endfunction
diff --git a/modules/sparse/macros/%bicgstab.bin b/modules/sparse/macros/%bicgstab.bin
new file mode 100755
index 000000000..51b70eaaf
--- /dev/null
+++ b/modules/sparse/macros/%bicgstab.bin
Binary files differ
diff --git a/modules/sparse/macros/%bicgstab.sci b/modules/sparse/macros/%bicgstab.sci
new file mode 100755
index 000000000..fe90693ed
--- /dev/null
+++ b/modules/sparse/macros/%bicgstab.sci
@@ -0,0 +1,202 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+//
+// bicgstab --
+// BICG solves the linear system %Ax=b using the BiConjugate Gradient Stabilized method.
+// If M is given, it is used as a preconditionning matrix.
+// If both M and M2 are given, the matrix M * M2 is used as a preconditionning
+// matrix.
+//
+// input %A REAL matrix or a function y=Ax(x) which computes y=%A*x for a given x
+// b REAL right hand side vector
+// tol, optional REAL error tolerance (default: 1e-8)
+// maxIter, optional INTEGER maximum number of iterations (default: size(%b))
+// %M, optional REAL preconditioner matrix (default: none)
+// %M2, optional REAL preconditioner matrix (default: none)
+// x0, optional REAL initial guess vector (default: the zero vector)
+// verbose, optional INTEGER set to 1 to enable verbose logging (default : 0)
+//
+// output x REAL solution vector
+// resNorm REAL final relative norm of the residual
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+//
+// References
+//
+// "Bi-CGSTAB: A Fast and Smoothly Converging Variant of Bi-CG for the Solution of Nonsymmetric Linear Systems"
+// by Henk van der Vorst.
+//
+// http://epubs.siam.org/doi/abs/10.1137/0913035
+// http://dl.acm.org/citation.cfm?id=131916.131930&coll=DL&dl=GUIDE&CFID=372773884&CFTOKEN=56630250
+// http://mathworld.wolfram.com/BiconjugateGradientStabilizedMethod.html
+//
+// Notes
+// This script was originally a matlab > scilab translation of the bicgstab.m
+// script from http://www.netlib.org/templates/matlab
+//
+// The input / output arguments of this command are the same as Matlab's bicgstab command.
+//
+
+function [x, resNorm, iter, resVec] = %bicgstab(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+
+ // Initialization
+ bnrm2 = norm(%b);
+ if (verbose==1) then
+ printf(gettext("Norm of right-hand side : %s\n"), string(bnrm2));
+ end
+ if (bnrm2 == 0) then
+ if (verbose==1) then
+ printf(gettext("Special processing where the right-hand side is zero.\n"));
+ end
+ // When rhs is 0, there is a trivial solution : x=0
+ x = zeros(%b);
+ resNorm = 0;
+ resVec = resNorm;
+ else
+ x = x0;
+ // r = %b - %A*x;
+ if (matrixType ==1),
+ r = %b - %A*x;
+ r2 = r;
+ else
+ r = %b - %A(x,Aargs(:));
+ r2 = r;
+ end
+ resNorm = norm(r) / bnrm2;
+ resVec = resNorm;
+ end
+ if (verbose==1) then
+ printf(gettext(" Type of preconditionning #1 : %d\n"),precondType);
+ printf(gettext(" Type of preconditionning #2 : %d\n"),precondBis);
+ end
+ // Begin iteration
+ // Distinguish the number of iterations processed from the currentiter index
+ iter = 0
+ for currentiter = 1:maxIter
+ if (resNorm <= tol) then
+ if (verbose==1) then
+ printf(gettext(" New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
+ end
+ break;
+ end
+ iter = iter + 1
+ if (verbose==1) then
+ printf(gettext(" Iteration #%s/%s residual : %s\n"),string(currentiter),string(maxIter),string(resNorm));
+ printf(" x=\n");
+ disp(x);
+ end
+ rho = r2'*r;
+ if (rho == 0) then
+ break;
+ end
+ if (currentiter > 1) then
+ bet = (rho/rho_old)*(alp/ome);
+ p = r + bet*(p-ome*v);
+ else
+ p = r;
+ end
+ // Solve M' M2' P = p
+ if %M == [] & %M2 == [] then
+ P = p;
+ elseif %M2 == [] then
+ // Compute r so that M' P = p
+ if (precondType == 1) then
+ P = %M \ p;
+ elseif (precondType == 2) then
+ P = %M(p,Margs(:));
+ else
+ P = p;
+ end
+ else
+ // Compute r so that M' M2' P = p
+ if (precondBis == 1) then
+ P = %M \ p;
+ P = %M2 \ p;
+ elseif (precondBis == 2) then
+ P = %M(p,Margs(:));
+ P = %M2(p,M2args(:));
+ else
+ P = p;
+ end
+ end
+ // v = %A*P;
+ if (matrixType == 1),
+ v = %A*P;
+ else
+ v = %A(P);
+ end
+ alp = rho / (r2'*v);
+ s = r - alp*v;
+ // Check for convergence
+ if (norm(s) <= tol) then
+ x = x+alp*P;
+ resNorm = norm(s) / bnrm2;
+ if (verbose==1) then
+ printf(gettext(" New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
+ end
+ resVec = [resVec;resNorm];
+ break;
+ end
+ // Solve M M2 S = s
+ if %M == [] & %M2 == [] then
+ S = s;
+ elseif %M2 == [] then
+ // Compute r so that M S = s
+ if (precondType == 1) then
+ S = %M \ s;
+ elseif (precondType == 2) then
+ S = %M(s,Margs(:));
+ else
+ S = s;
+ end
+ else
+ // Compute r so that M M2 S = s
+ if (precondBis == 1) then
+ S = %M \ s;
+ S = %M2 \ s;
+ elseif (precondBis == 2) then
+ S = %M(s,Margs(:));
+ S = %M2(s,M2args(:));
+ else
+ S = s;
+ end
+ end
+ // t = %A*S;
+ if (matrixType == 1),
+ t = %A*S;
+ else
+ t = %A(S);
+ end
+ ome = (t'*s)/(t'*t);
+ x = x + alp*P+ome*S;
+ r = s - ome*t;
+ resNorm = norm(r) / bnrm2;
+ // Caution : transform the scalar resVec into vector resVec !
+ resVec = [resVec;resNorm];
+ rho_old = rho;
+ end
+ // Test for convergence
+ if (resNorm > tol) then
+ if (verbose==1) then
+ printf(gettext("Final residual = %s > tol =%s\n"),string(resNorm),string(tol));
+ printf(gettext("Algorithm fails\n"));
+ end
+ flag = 1;
+ if (lhs < 2) then
+ warning(msprintf(gettext("%s: Convergence error.\n"),"bicgstab"));
+ end
+ else
+ flag = 0;
+ if (verbose==1) then
+ printf(gettext("Algorithm pass\n"));
+ end
+ end
+
+endfunction
diff --git a/modules/sparse/macros/%cgs.bin b/modules/sparse/macros/%cgs.bin
new file mode 100755
index 000000000..fee108f61
--- /dev/null
+++ b/modules/sparse/macros/%cgs.bin
Binary files differ
diff --git a/modules/sparse/macros/%cgs.sci b/modules/sparse/macros/%cgs.sci
new file mode 100755
index 000000000..bec33e08b
--- /dev/null
+++ b/modules/sparse/macros/%cgs.sci
@@ -0,0 +1,194 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+//
+// cgs --
+// CGS solves the linear system %Ax=b using the Conjugate Gradient Squared method.
+// If M is given, it is used as a preconditionning matrix.
+// If both M and M2 are given, the matrix M * M2 is used as a preconditionning
+// matrix.
+//
+// input %A REAL matrix or a function y=Ax(x) which computes y=%A*x for a given x
+// b REAL right hand side vector
+// tol, optional REAL error tolerance (default: 1e-8)
+// maxIter, optional INTEGER maximum number of iterations (default: size(%b))
+// %M, optional REAL preconditioner matrix (default: none)
+// %M2, optional REAL preconditioner matrix (default: none)
+// x0, optional REAL initial guess vector (default: the zero vector)
+// verbose, optional INTEGER set to 1 to enable verbose logging (default : 0)
+//
+// output x REAL solution vector
+// resNorm REAL final relative norm of the residual
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+//
+// References
+//
+// "CGS, A Fast Lanczos-Type Solver for Nonsymmetric Linear systems"
+// by Peter Sonneveld
+//
+// http://epubs.siam.org/doi/abs/10.1137/0910004
+// http://dl.acm.org/citation.cfm?id=64888&preflayout=flat
+// http://mathworld.wolfram.com/ConjugateGradientSquaredMethod.html
+//
+// Notes
+// This script was originally a matlab > scilab translation of the cgs.m
+// script from http://www.netlib.org/templates/matlab
+//
+// The input / output arguments of this command are the same as Matlab's cgs command.
+//
+
+function [x, resNorm, iter, resVec] = %cgs(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+
+ // Initialization
+ bnrm2 = norm(%b);
+ if (verbose==1) then
+ printf(gettext("Norm of right-hand side : %s\n"), string(bnrm2));
+ end
+ if (bnrm2 == 0) then
+ if (verbose==1) then
+ printf(gettext("Special processing where the right-hand side is zero.\n"));
+ end
+ // When rhs is 0, there is a trivial solution : x=0
+ x = zeros(%b);
+ resNorm = 0;
+ resVec = resNorm;
+ else
+ x = x0;
+ // r = %b - %A*x;
+ if (matrixType ==1),
+ r = %b - %A*x;
+ r2 = r;
+ else
+ r = %b - %A(x,Aargs(:));
+ r2 = r;
+ end
+ resNorm = norm(r) / bnrm2;
+ resVec = resNorm;
+ end
+ if (verbose==1) then
+ printf(gettext(" Type of preconditionning #1 : %d\n"),precondType);
+ printf(gettext(" Type of preconditionning #2 : %d\n"),precondBis);
+ end
+ // begin iteration
+ // Distinguish the number of iterations processed from the currentiter index
+ iter = 0
+ for currentiter = 1:maxIter
+ if (resNorm <= tol) then
+ if (verbose==1) then
+ printf(gettext(" New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
+ end
+ break;
+ end
+ iter = iter + 1
+ if (verbose==1) then
+ printf(gettext(" Iteration #%s/%s residual : %s\n"),string(currentiter),string(maxIter),string(resNorm));
+ printf(" x=\n");
+ disp(x);
+ end
+ rho = r2'*r;
+ if (rho == 0) then
+ break;
+ end
+ if (currentiter > 1) then
+ bet = rho / rho_old;
+ u = r + bet*q;
+ p = u + bet*(q+bet*p);
+ else
+ u = r;
+ p = u;
+ end
+ // Solve M M2 P = p
+ if %M == [] & %M2 == [] then
+ P = p;
+ elseif %M2 == [] then
+ // Compute P so that M P = p
+ if (precondType == 1) then
+ P = %M \ p;
+ elseif (precondType == 2) then
+ P = %M(p,Margs(:));
+ else
+ P = p;
+ end
+ else
+ // Compute P so that M M2 P = p
+ if (precondBis == 1) then
+ P = %M \ p;
+ P = %M2 \ p;
+ elseif (precondBis == 2) then
+ P = %M(p,Margs(:));
+ P = %M2(p,M2args(:));
+ else
+ P = p;
+ end
+ end
+ // v = %A*P;
+ if (matrixType ==1),
+ v = %A*P;
+ else
+ v = %A(P);
+ end
+ alp = rho / (r2'*v);
+ q = u - (alp*v);
+ // Solve M M2 u = u+q
+ uq = u + q;
+ if %M == [] & %M2 == [] then
+ U = uq;
+ elseif %M2 == [] then
+ // Compute Q so that M U = u+q
+ if (precondType == 1) then
+ U = %M \ uq;
+ elseif (precondType == 2) then
+ U = %M(uq,Margs(:));
+ else
+ U = uq;
+ end
+ else
+ // Compute z so that M M2 U = u+q
+ if (precondBis == 1) then
+ U = %M \ uq;
+ U = %M2 \ uq;
+ elseif (precondBis == 2) then
+ U = %M(uq,Margs(:));
+ U = %M2(uq,M2args(:));
+ else
+ U = uq;
+ end
+ end
+ x = x + alp*U;
+ // U = %A*U;
+ if (matrixType ==1),
+ U = %A*U;
+ else
+ U = %A(U);
+ end
+ r = r - alp*U;
+ resNorm = norm(r) / bnrm2;
+ // Caution : transform the scalar resVec into vector resVec !
+ resVec = [resVec;resNorm];
+ rho_old = rho;
+ end
+ // test for convergence
+ if (resNorm > tol) then
+ if (verbose==1) then
+ printf(gettext("Final residual = %s > tol =%s\n"),string(resNorm),string(tol));
+ printf(gettext("Algorithm fails\n"));
+ end
+ flag = 1;
+ if (lhs < 2) then
+ warning(msprintf(gettext("%s: Convergence error.\n"),"cgs"));
+ end
+ else
+ flag = 0;
+ if (verbose==1) then
+ printf(gettext("Algorithm pass\n"));
+ end
+ end
+
+endfunction
diff --git a/modules/sparse/macros/%pcg.bin b/modules/sparse/macros/%pcg.bin
new file mode 100755
index 000000000..b36f6439d
--- /dev/null
+++ b/modules/sparse/macros/%pcg.bin
Binary files differ
diff --git a/modules/sparse/macros/%pcg.sci b/modules/sparse/macros/%pcg.sci
new file mode 100755
index 000000000..be3162f87
--- /dev/null
+++ b/modules/sparse/macros/%pcg.sci
@@ -0,0 +1,149 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - INRIA - Michael Baudin
+// Copyright (C) 2008 - INRIA - Michael Baudin
+// Copyright (C) 2006 - INRIA - Serge Steer
+// Copyright (C) 2005 - IRISA - Sage Group
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+//
+// pcg --
+// PCG solves the symmetric positive definite linear system %Ax=b
+// using the Preconditionned Conjugate Gradient.
+// If M is given, it is used as a preconditionning matrix.
+// If both M and M2 are given, the matrix M * M2 is used as a preconditionning
+// matrix.
+//
+// input %A REAL symmetric positive definite matrix or a function
+// y=Ax(x) which computes y=%A*x for a given x
+// b REAL right hand side vector
+// tol, optional REAL error tolerance (default: 1e-8)
+// maxIter, optional INTEGER maximum number of iterations (default: size(%b))
+// %M, optional REAL preconditioner matrix (default: none)
+// %M2, optional REAL preconditioner matrix (default: none)
+// x0, optional REAL initial guess vector (default: the zero vector)
+// verbose, optional INTEGER set to 1 to enable verbose logging (default : 0)
+//
+// output x REAL solution vector
+// resNorm REAL final relative norm of the residual
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+//
+// References
+//
+// "Templates for the Solution of Linear Systems: Building Blocks
+// for Iterative Methods",
+// Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout,
+// Pozo, Romine, and Van der Vorst, SIAM Publications, 1993
+// (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).
+//
+// "Iterative Methods for Sparse Linear Systems, Second Edition"
+// Saad, SIAM Publications, 2003
+// (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).
+//
+// Golub and Van Loan, Matrix Computations
+//
+// Notes
+// This script was originally a matlab > scilab translation of the cg.m
+// script from http://www.netlib.org/templates/matlab
+//
+// The input / output arguments of this command are the same as
+// Matlab's cg command.
+//
+
+function [x, resNorm, iter, resVec] = %pcg(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+
+ // Initialization
+ bnrm2 = norm(%b);
+ if (verbose==1) then
+ printf(gettext("Norm of right-hand side : %s\n"), string(bnrm2));
+ end
+ if (bnrm2 == 0) then
+ if (verbose==1) then
+ printf(gettext("Special processing where the right-hand side is zero.\n"));
+ end
+ // When rhs is 0, there is a trivial solution : x=0
+ x = zeros(%b);
+ resNorm = 0;
+ resVec = resNorm;
+ else
+ x = x0;
+ // r = %b - %A*x;
+ if (matrixType ==1),
+ r = %b - %A*x;
+ else
+ r = %b - %A(x,Aargs(:));
+ end
+ resNorm = norm(r) / bnrm2;
+ resVec = resNorm;
+ end
+ if (verbose==1) then
+ printf(gettext(" Type of preconditionning #1 : %d\n"),precondType);
+ printf(gettext(" Type of preconditionning #2 : %d\n"),precondBis);
+ end
+ // Begin iteration
+ // Distinguish the number of iterations processed from the currentiter index
+ iter = 0
+ for currentiter = 1:maxIter
+ if (resNorm <= tol) then
+ if (verbose==1) then
+ printf(gettext(" New residual = %s < tol = %s => break\n"),string(resNorm),string(tol));
+ end
+ break;
+ end
+ iter = iter + 1
+ if (verbose==1) then
+ printf(gettext(" Iteration #%s/%s residual : %s\n"),string(currentiter),string(maxIter),string(resNorm));
+ printf(" x=\n");
+ disp(x);
+ end
+ if %M == [] & %M2 == [] then
+ z = r;
+ elseif %M2 == [] then
+ // Compute z so that M z = r
+ if (precondType == 1) then
+ z = %M \ r;
+ elseif (precondType == 2) then
+ z = %M(r,Margs(:));
+ else
+ z = r;
+ end
+ else
+ // Compute z so that M M2 z = r
+ if (precondBis == 1) then
+ z = %M \ r;
+ z = %M2 \ z;
+ elseif (precondBis == 2) then
+ z = %M(r,Margs(:));
+ z = %M2(z,M2args(:));
+ else
+ z = r;
+ end
+ end
+ rho = r'*z;
+ if (currentiter > 1) then
+ bet = rho / rho_old;
+ p = z + bet*p;
+ else
+ p = z;
+ end
+ // q = %A*p;
+ if (matrixType ==1),
+ q = %A*p;
+ else
+ q = %A(p);
+ end
+ alp = rho / (p'*q );
+ x = x + alp*p;
+ r = r - alp*q;
+ resNorm = norm(r) / bnrm2;
+ // Caution : transform the scalar resVec into vector resVec !
+ resVec = [resVec;resNorm];
+ rho_old = rho;
+ end
+
+endfunction
diff --git a/modules/sparse/macros/adj2sp.bin b/modules/sparse/macros/adj2sp.bin
new file mode 100755
index 000000000..3a6cceefc
--- /dev/null
+++ b/modules/sparse/macros/adj2sp.bin
Binary files differ
diff --git a/modules/sparse/macros/adj2sp.sci b/modules/sparse/macros/adj2sp.sci
new file mode 100755
index 000000000..7a2b66085
--- /dev/null
+++ b/modules/sparse/macros/adj2sp.sci
@@ -0,0 +1,97 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) XXXX-2008 - INRIA
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+function A=adj2sp(varargin)
+ // adjacency to sparse conversion.
+ // See adj2sp.xml for help.
+ //
+ // Check number of arguments
+ [lhs, rhs] = argn()
+ if ( and(rhs <> [3 4]) ) then
+ lstr = gettext("%s: Wrong number of input arguments: %d to %d expected.\n")
+ error ( msprintf(lstr,"adj2sp",3,4))
+ end
+ if ( and(lhs <> [0 1]) ) then
+ lstr = gettext("%s: Wrong number of output arguments: %d to %d expected.\n")
+ error ( msprintf(lstr,"adj2sp",0,1))
+ end
+ //
+ // Get arguments
+ xadj = varargin(1)
+ iadj = varargin(2)
+ v = varargin(3)
+ //
+ // Get size of the matrix
+ if ( rhs == 3 ) then
+ m = max(iadj)
+ n = size(xadj,"*")-1
+ mn = [m,n]
+ else
+ mn = varargin(4)
+ end
+ //
+ // Check type of arguments
+ if ( typeof(xadj) <> "constant" ) then
+ lstr = gettext("%s: Wrong type for input argument #%d.\n")
+ error ( msprintf(lstr,"adj2sp",1))
+ end
+ if ( typeof(iadj) <> "constant" ) then
+ lstr = gettext("%s: Wrong type for input argument #%d.\n")
+ error ( msprintf(lstr,"adj2sp",2))
+ end
+ if ( typeof(mn) <> "constant" ) then
+ lstr = gettext("%s: Wrong type for input argument #%d.\n")
+ error ( msprintf(lstr,"adj2sp",3))
+ end
+ //
+ // Check size of arguments
+ if ( size(mn,"*") <> 2 ) then
+ lstr = gettext("%s: Wrong size for input argument #%d: %s has size %d, but %d is expected.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn",size(mn,"*"),2))
+ end
+ //
+ // Check content of arguments
+ if ( mn(1) < 0 ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%d, but a positive value is expected.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(1)",mn(1)))
+ end
+ if ( mn(2) < 0 ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%d, but a positive value is expected.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(2)",mn(2)))
+ end
+ if ( int(mn(1)) <> mn(1) ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%s, but a floating point integer is expected.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(1)",string(mn(1))))
+ end
+ if ( int(mn(2)) <> mn(2) ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%s, but a floating point integer is expected.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(2)",string(mn(2))))
+ end
+ if ( mn(1) <> max(iadj) ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%d, which does not match %s: %d.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(1)",mn(1),"max(iadj)",max(iadj)))
+ end
+ if ( mn(2) <> size(xadj,"*")-1 ) then
+ lstr = gettext("%s: Wrong value for input argument #%d: %s=%d, which does not match size of %s: %d.\n")
+ error ( msprintf(lstr,"adj2sp",4,"mn(2)",mn(2),"xadj",size(xadj,"*")))
+ end
+ //
+ // Make xadj, iadj, mn column matrices
+ xadj = xadj(:)
+ iadj = iadj(:)
+ mn = mn(:)
+ //
+ // Proceed...
+ nza = size(iadj,"*")
+ j = fadj2sp(xadj,mn(2),nza)
+ A = sparse([j,iadj],v,[mn(2),mn(1)])'
+endfunction
+
diff --git a/modules/sparse/macros/buildmacros.bat b/modules/sparse/macros/buildmacros.bat
new file mode 100755
index 000000000..5df334e1e
--- /dev/null
+++ b/modules/sparse/macros/buildmacros.bat
@@ -0,0 +1,11 @@
+rem Scilab ( http://mwww.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) INRIA
+rem
+rem This file must be used under the terms of the CeCILL.
+rem This source file is licensed as described in the file COPYING, which
+rem you should have received as part of this distribution. The terms
+rem are also available at
+rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit; \ No newline at end of file
diff --git a/modules/sparse/macros/buildmacros.sce b/modules/sparse/macros/buildmacros.sce
new file mode 100755
index 000000000..1ff122048
--- /dev/null
+++ b/modules/sparse/macros/buildmacros.sce
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005-2008 - INRIA - Allan CORNET
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+if (isdef("genlib") == %f) then
+ exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce");
+end
+//------------------------------------
+genlib("sparselib","SCI/modules/sparse/macros",%f,%t);
+//------------------------------------
diff --git a/modules/sparse/macros/chfact.bin b/modules/sparse/macros/chfact.bin
new file mode 100755
index 000000000..bd0766b0f
--- /dev/null
+++ b/modules/sparse/macros/chfact.bin
Binary files differ
diff --git a/modules/sparse/macros/chfact.sci b/modules/sparse/macros/chfact.sci
new file mode 100755
index 000000000..34e05d8e3
--- /dev/null
+++ b/modules/sparse/macros/chfact.sci
@@ -0,0 +1,132 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function spcho=chfact(A)
+ //cholesky factors, returned in a tlist
+ //spcho = {xlnz, nnzl, xsuper, xlindx, lindx, snode,
+ // split, tmpsiz, perm, invp, lnz}.
+ //
+ // invp=spcho('invp');xlnz=spcho('xlnz');
+ // xlindx=spcho('xlindx');lindx=spcho('lindx');lnz=spcho('lnz');
+ // P=sparse([(1:m)',invp],ones(invp),[m,m]);
+ // adjncy = spcompack(xlnz,xlindx,lindx);
+ // R=adj2sp(xlnz,adjncy,lnz);
+ // =>P*R*R'*P'=A
+ m = size(A,1);
+ if size(A,2) ~= m | type(A)~=5 | A == [] then,
+ error("Matrix must be square, sparse and nonempty.");
+ end;
+ neqns=m;
+ [xadj,adjncy,v]=sp2adj(A-diag(diag(A)));
+ [perm,invp,nofsub]=ordmmd(xadj,adjncy,neqns);
+ cachsz = 16;
+ spcho=symfct(xadj,adjncy,perm,invp,cachsz,neqns);
+ [xadjf,adjncyf,v]=sp2adj(A);
+ spcho=inpnv(xadjf,adjncyf,v,spcho);
+ level=8;
+ spcho=blkfc1(spcho,level);
+endfunction
+
+function [spcho]= blkfc1(spcho,level)
+ //retrieves Fortran variables (see sfinit.f,bfinit.f,symfct.f )
+ //[xlnz,nnzl,xsuper,xlindx,lindx,snode,split,tmpsiz,perm,invp,lnz]=spcho(2:12);
+ xsuper=spcho("xsuper");
+ nsuper=size(xsuper,1)-1;
+ snode=spcho("snode");
+ neqns=size(snode,1);
+ lnz=spcho("lnz");
+ nnzl=size(lnz,1);
+ iwsiz = 2*neqns+2*nsuper;
+ iwork = zeros(iwsiz,1);
+ tmpsiz = spcho("tmpsiz");
+ tmpvec= zeros(tmpsiz,1);
+ iflag=0;
+ // calling blkfc1i primitive
+ [lnz,iflag]=blkfc1i(neqns,nsuper,xsuper,snode,spcho("split"),spcho("xlindx"),spcho("lindx"),spcho("xlnz"),lnz,iwsiz,iwork,tmpsiz,tmpvec,iflag,level);
+ //
+ if max(abs(lnz)) > 5d63 then
+ warning(gettext(" Possible matrix is not positive definite."));
+ end;
+
+ select iflag
+ case -1 then,
+ error(gettext("Non-positive diagonal encountered, matrix is not positive definite.")),
+ case -2 then,
+ error(gettext("Insufficient working storage in blkfct, temp(*).")),
+ case -3 then,
+ error(gettext("Insufficient working storage in blkfct, iwork(*).")),
+ end;
+ //
+ spcho("lnz")=lnz;
+endfunction
+
+function rhs=blkslv(spcho,rhs)
+ //
+ //[xlnz,nnzl,xsuper,xlindx,lindx,snode,split,tmpsiz,perm,invp,lnz]=spcho(2:12);
+ xsuper=spcho("xsuper");
+ nsuper=size(xsuper,1)-1;
+ neqns =size(rhs,1);
+ rhs=blkslvi(nsuper,xsuper,spcho("xlindx"),spcho("lindx"),spcho("xlnz"),...
+ spcho("lnz"),rhs);
+endfunction
+
+function [spcho]=inpnv(xadjf,adjf,anzf,spcho)
+ //
+ //[xlnz,nnzl,xsuper,xlindx,lindx,snode,split,tmpsiz,perm,invp,lnz]=spcho(2:12);
+ //
+ xsuper=spcho("xsuper");
+ neqns=size(xadjf,1)-1,
+ nsuper=size(xsuper,1)-1,
+ //
+ offset=zeros(neqns,1);
+ lnz=zeros(spcho("nnzl"),1);
+ //
+ lnz = inpnvi(neqns,xadjf,adjf,anzf,spcho("perm"),spcho("invp"),nsuper,...
+ xsuper,spcho("xlindx"),spcho("lindx"),spcho("xlnz"),lnz,offset);
+ //
+ spcho("lnz")=lnz;
+endfunction
+
+function [spcho] = symfct(xadj,adjncy,perm,invp,cachsz,neqns)
+ //
+ // sfinit - input
+ //
+ nnza=size(adjncy,1);
+ iwsiz = 7*neqns+4;
+ iwork=zeros(iwsiz,1);
+ ///
+ if size(perm)~= [neqns,1] then, error(gettext(" SYMFCT requires PERM to be neqns x 1")),
+ end;
+ if size(invp)~= [neqns,1] then, error(gettext(" SYMFCT requires INVN to be neqns x 1")),
+ end;
+ if size(cachsz)~= [1,1] then, error(gettext(" SYMFCT requires CACHSZ to be 1 x 1")),
+ end;
+ //
+ [perm,invp,colcnt,nnzl,nsub,nsuper,snode,xsuper,iflag]=...
+ sfinit(neqns,nnza,xadj,adjncy,perm,invp,iwsiz,iwork);
+ //
+ if iflag == -1 then error(gettext(" Insufficient working storage in sfinit")),end;
+ //
+ bb=xsuper(1:nsuper+1,1);
+ xsuper=bb
+ iwsiz = 2*nsuper+2*neqns+1;
+ iwork=zeros(iwsiz,1);
+ //
+ //
+ [xlindx,lindx,xlnz,iflag]=symfcti(neqns,nnza,xadj,adjncy,perm,...
+ invp,colcnt,nsuper,xsuper,snode,nsub,iwsiz,iwork)
+ if iflag == -1 then error(" Insufficient working storage in symfct"),end;
+ if iflag == -2 then error(" Inconsistancy in the input in symfct"),end;
+ //
+ [tmpsiz,split]=bfinit(neqns,nsuper,xsuper,snode,xlindx,lindx,cachsz)
+
+ spcho = tlist(["chol","xlnz","nnzl","xsuper","xlindx","lindx","snode","split",...
+ "tmpsiz","perm","invp","lnz"],...
+ xlnz,nnzl,xsuper,xlindx,lindx,snode,split,tmpsiz,perm,invp,[])
+endfunction
diff --git a/modules/sparse/macros/chsolve.bin b/modules/sparse/macros/chsolve.bin
new file mode 100755
index 000000000..a48c9d05c
--- /dev/null
+++ b/modules/sparse/macros/chsolve.bin
Binary files differ
diff --git a/modules/sparse/macros/chsolve.sci b/modules/sparse/macros/chsolve.sci
new file mode 100755
index 000000000..21ecbd7a1
--- /dev/null
+++ b/modules/sparse/macros/chsolve.sci
@@ -0,0 +1,22 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function sol=chsolve(spcho,rhs)
+ // Cholesky solver for A*sol=rhs (A is symmetric >0)
+ // 1rst step: spcho=chfact(A)
+ // 2nd step: sol=chsolve(spcho,rhs)
+ // Example: N=20; A=sprand(N,N,0.1);
+ // A=A*A'+speye(A);
+ // sol=(1:N)'; rhs=A*sol;
+ // spcho=chfact(A); sol=chsolve(spcho,rhs)
+ perm=spcho("perm");
+ sol=blkslv(spcho,rhs(perm));
+ sol(perm)=sol
+endfunction
diff --git a/modules/sparse/macros/cleanmacros.bat b/modules/sparse/macros/cleanmacros.bat
new file mode 100755
index 000000000..768190a8b
--- /dev/null
+++ b/modules/sparse/macros/cleanmacros.bat
@@ -0,0 +1,13 @@
+rem Scilab ( http://mwww.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) INRIA
+rem
+rem This file must be used under the terms of the CeCILL.
+rem This source file is licensed as described in the file COPYING, which
+rem you should have received as part of this distribution. The terms
+rem are also available at
+rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+@del *.bin 2>NUL
+@del lib 2>NUL
+@del names 2>NUL \ No newline at end of file
diff --git a/modules/sparse/macros/conjgrad.bin b/modules/sparse/macros/conjgrad.bin
new file mode 100755
index 000000000..6c1566c7e
--- /dev/null
+++ b/modules/sparse/macros/conjgrad.bin
Binary files differ
diff --git a/modules/sparse/macros/conjgrad.sci b/modules/sparse/macros/conjgrad.sci
new file mode 100755
index 000000000..07a7da992
--- /dev/null
+++ b/modules/sparse/macros/conjgrad.sci
@@ -0,0 +1,280 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: transformed into a gateway to
+// propose pcg, cgs, bicg and bicgstab.
+// Copyright (C) 2009 - INRIA - Michael Baudin
+// Copyright (C) 2008 - INRIA - Michael Baudin
+// Copyright (C) 2006 - INRIA - Serge Steer
+// Copyright (C) 2005 - IRISA - Sage Group
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+//
+// conjgrad --
+// This function regroups four methods from the "Conjugate Gradient family" to solve the linear system %Ax=b:
+// - PCG (Preconditioned Conjugate Gradient): A must be symmetric positive definite,
+// - CGS (preconditioned Conjugate Gradient Squared): A must be square,
+// - BICG (preconditioned BiConjugate Gradient): A must be square,
+// - BICGSTAB (preconditioned BiConjugate Gradient Stabilized): A must be square (default method).
+// If M is given, it is used as a preconditionning matrix.
+// If both M and M2 are given, the matrix M * M2 is used as a preconditionning
+// matrix.
+//
+// input %A REAL matrix or a function y=Ax(x) which computes y=%A*x for a given x
+// b REAL right hand side vector
+// tol, optional REAL error tolerance (default: 1e-8)
+// maxIter, optional INTEGER maximum number of iterations (default: size(%b))
+// %M, optional REAL preconditioner matrix (default: none)
+// %M2, optional REAL preconditioner matrix (default: none)
+// x0, optional REAL initial guess vector (default: the zero vector)
+// verbose, optional INTEGER set to 1 to enable verbose logging (default : 0)
+//
+// output x REAL solution vector
+// flag INTEGER: 0 = solution found to tolerance
+// 1 = no convergence given maxIter
+// resNorm REAL final relative norm of the residual
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+//
+// References
+//
+// PCG
+// "Templates for the Solution of Linear Systems: Building Blocks
+// for Iterative Methods",
+// Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout,
+// Pozo, Romine, and Van der Vorst, SIAM Publications, 1993
+// (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).
+//
+// "Iterative Methods for Sparse Linear Systems, Second Edition"
+// Saad, SIAM Publications, 2003
+// (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).
+//
+// Golub and Van Loan, Matrix Computations
+//
+// CGS
+// "CGS, A Fast Lanczos-Type Solver for Nonsymmetric Linear systems"
+// by Peter Sonneveld
+//
+// http://epubs.siam.org/doi/abs/10.1137/0910004
+// http://dl.acm.org/citation.cfm?id=64888&preflayout=flat
+// http://mathworld.wolfram.com/ConjugateGradientSquaredMethod.html
+//
+// BICG
+// "Numerical Recipes: The Art of Scientific Computing." (third ed.)
+// by William Press, Saul Teukolsky, William Vetterling, Brian Flannery.
+//
+// http://apps.nrbook.com/empanel/index.html?pg=87
+// http://dl.acm.org/citation.cfm?doid=1874391.187410
+// http://mathworld.wolfram.com/BiconjugateGradientMethod.html
+//
+// BICGSTAB
+// "Bi-CGSTAB: A Fast and Smoothly Converging Variant of Bi-CG for the Solution of Nonsymmetric Linear Systems"
+// by Henk van der Vorst.
+//
+// http://epubs.siam.org/doi/abs/10.1137/0913035
+// http://dl.acm.org/citation.cfm?id=131916.131930&coll=DL&dl=GUIDE&CFID=372773884&CFTOKEN=56630250
+// http://mathworld.wolfram.com/BiconjugateGradientStabilizedMethod.html
+//
+// Notes
+//
+// The input / output arguments of this command are the same as
+// Matlab's pcg, cgs, bicg and bicgstab commands, augmented with the 'method' argument
+//
+
+function [x, flag, resNorm, iter, resVec] = conjgrad(%A, %b, method, tol, maxIter, %M, %M2, x0, verbose )
+
+ [lhs, rhs] = argn(0);
+
+ if rhs < 2 then
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"conjgrad",2,7));
+ end
+ if rhs > 8 then
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"conjgrad",2,7));
+ end
+ if exists("method", "local") == 0 then
+ method = "bicgstab";
+ end
+ if exists("tol", "local") == 0 then
+ tol = 1e-8
+ end
+ if exists("maxIter", "local") == 0 then
+ maxIter = size(%b, 1)
+ end
+ if exists("%M", "local") == 0 then
+ %M = []
+ end
+ if exists("%M2", "local") == 0 then
+ %M2 = []
+ end
+ if exists("x0", "local") == 0 then
+ x0 = zeros(%b);
+ end
+ if exists("verbose", "local") == 0 then
+ verbose = 0;
+ end
+ if verbose == 1 then
+ printf(gettext("Arguments:\n"));
+ printf(" tol = "+string(tol)+"\n");
+ printf(" maxIter = "+string(maxIter)+"\n");
+ printf(" M = \n")
+ disp(%M)
+ printf(" M2 = \n");
+ disp(%M2)
+ printf(" x0 = \n");
+ disp(x0)
+ printf(" verbose = "+string(verbose)+"\n");
+ end
+ // Compute matrixType
+ select type(%A)
+ case 1 then
+ matrixType = 1;
+ case 5 then
+ matrixType = 1;
+ case 13 then
+ matrixType = 0;
+ Aargs = list()
+ case 15 then
+ Aargs = list(%A(2:$))
+ // Caution : modify the input argument %A !
+ %A = %A(1);
+ matrixType = 0;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"conjgrad",1));
+ end
+ // If %A is a matrix (dense or sparse)
+ if matrixType == 1 then
+ if size(%A,1) ~= size(%A,2) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"conjgrad",1));
+ end
+ end
+ // Check right hand side %b
+ if type(%b) ~= 1
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A matrix expected.\n"),"conjgrad",2));
+ end
+ if size(%b,2) ~= 1 then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Column vector expected.\n"),"conjgrad",2));
+ end
+ if matrixType == 1 then
+ if size(%b,1) ~= size(%A,1) then
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",2,1));
+ end
+ end
+ if matrixType == 1 then
+ if size(%b,1) ~= size(%A,1) then
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",2,1));
+ end
+ end
+ // Check method
+ if type(method) ~= 10 | size(method) ~= [1 1]
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Single String expected.\n"),"conjgrad",3));
+ elseif and(method ~= ["pcg" "cgs" "bicg" "bicgstab"]),
+ error(msprintf(gettext("%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"),"conjgrad",3,"pcg","cgs","bicg","bicgstab"));
+ end
+ // Check type of the error tolerance tol
+ if or(size(tol) ~= [1 1]) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"conjgrad",4));
+ end
+ // Check the type of maximum number of iterations maxIter
+ if or(size(maxIter) ~= [1 1]) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"conjgrad",5));
+ end
+ // Compute precondType
+ select type(%M)
+ case 1 then
+ // M is a matrix
+ // precondType = 0 if the M is empty
+ // = 1 if the M is not empty
+ precondType = bool2s(size(%M,"*")>=1);
+ case 5 then
+ precondType = 1;
+ case 13 then
+ Margs = list()
+ precondType = 2;
+ case 15 then
+ Margs = list(%M(2:$))
+ // Caution : modify the input argument %M !
+ %M = %M(1);
+ precondType = 2;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"conjgrad",6));
+ end
+ if precondType == 1 then
+ if size(%M,1) ~= size(%M,2) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"conjgrad",6));
+ end
+ if size(%M,1) ~= size(%b,1) then
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",6,2));
+ end
+ end
+ // Compute precondBis
+ select type(%M2)
+ case 1 then
+ // M2 is a matrix
+ // precondBis = 0 if the M2 is empty
+ // = 1 if the M2 is not empty
+ precondBis = bool2s(size(%M2,"*")>=1);
+ case 5 then
+ precondBis = 1;
+ case 13 then
+ M2args = list()
+ precondBis = 2;
+ case 15 then
+ M2args = list(%M2(2:$))
+ // Caution : modify the input argument %M2 !
+ %M2 = %M2(1);
+ // Caution : modify precondType again !
+ precondType = 2;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d.\n"),"conjgrad",7));
+ end
+ if precondBis == 1 then
+ if size(%M2,1) ~= size(%M2,2) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"conjgrad",7));
+ end
+ if size(%M2,1) ~= size(%b,1) then
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",7,2));
+ end
+ end
+ // Check size of the initial vector x0
+ if size(x0,2) ~= 1 then
+ error(msprintf(gettext("%s: Wrong value for input argument #%d: Column vector expected.\n"),"conjgrad",8));
+ end
+ if size(x0,1) ~= size(%b,1) then
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",8,2));
+ end
+
+ // ------------
+ // Computations
+ // ------------
+ select method
+ case "pcg"
+ [x, resNorm, iter, resVec] = %pcg(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+ case "cgs"
+ [x, resNorm, iter, resVec] = %cgs(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+ case "bicg"
+ [x, resNorm, iter, resVec] = %bicg(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+ else // "bicgstab"
+ [x, resNorm, iter, resVec] = %bicgstab(%A, %b, tol, maxIter, %M, %M2, x0, verbose )
+ end
+
+ // Test for convergence
+ if resNorm > tol then
+ if verbose == 1 then
+ printf(gettext("Final residual = %s > tol =%s\n"),string(resNorm),string(tol));
+ printf(gettext("Algorithm fails\n"));
+ end
+ flag = 1;
+ if lhs < 2 then
+ warning(msprintf(gettext("%s: Convergence error.\n"),"conjgrad"));
+ end
+ else
+ flag = 0;
+ if verbose == 1 then
+ printf(gettext("Algorithm pass\n"));
+ end
+ end
+
+endfunction
diff --git a/modules/sparse/macros/gmres.bin b/modules/sparse/macros/gmres.bin
new file mode 100755
index 000000000..af336c31c
--- /dev/null
+++ b/modules/sparse/macros/gmres.bin
Binary files differ
diff --git a/modules/sparse/macros/gmres.sci b/modules/sparse/macros/gmres.sci
new file mode 100755
index 000000000..ec0943042
--- /dev/null
+++ b/modules/sparse/macros/gmres.sci
@@ -0,0 +1,308 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) XXXX-2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+// [x, flag, resNorm, iter, resVec] = gmres( A, b, x, M, restrt, max_it, tol )
+//
+// GMRES solves the linear system Ax=b
+// using the Generalized Minimal RESidual ( GMRES ) method with restarts .
+//
+// input A REAL nonsymmetric positive definite matrix or function
+// x REAL initial guess vector
+// b REAL right hand side vector
+// M REAL preconditioner matrix or function
+// restrt INTEGER number of iterations between restarts
+// max_it INTEGER maximum number of iterations
+// tol REAL error tolerance
+//
+// output x REAL solution vector
+// flag INTEGER: 0 = solution found to tolerance
+// 1 = no convergence given max_it
+// resNorm REAL final residual norm
+// iter INTEGER number of iterations performed
+// resVec REAL residual vector
+
+// Details of this algorithm are described in
+//
+// "Templates for the Solution of Linear Systems: Building Blocks
+// for Iterative Methods",
+// Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout,
+// Pozo, Romine, and Van der Vorst, SIAM Publications, 1993
+// (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).
+//
+// "Iterative Methods for Sparse Linear Systems, Second Edition"
+// Saad, SIAM Publications, 2003
+// (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).
+
+function [x, flag, resNorm, iter, resVec] = gmres(A, varargin)
+
+ // -----------------------
+ // Parsing input arguments
+ // -----------------------
+
+ [lhs,rhs]=argn(0);
+ if ( rhs < 2 ),
+ error(msprintf(gettext("%s: Wrong number of input argument: At least %d expected.\n"),"gmres",2));
+ end
+
+ // Parsing the matrix A et the right hand side vector b
+ select type(A)
+ case 1 then
+ matrixType = 1;
+ case 5 then
+ matrixType = 1;
+ case 13 then
+ matrixType = 0;
+ end
+ // If A is a matrix (full or sparse)
+ if (matrixType == 1),
+ if (size(A,1) ~= size(A,2)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Square matrix expected.\n"),"gmres",1));
+ end
+ end
+ b=varargin(1);
+ if (size(b,2) ~= 1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Column vector expected.\n"),"gmres",2));
+ end
+ if (matrixType==1),
+ if (size(b,1) ~= size(A,1)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"gmres",2,1));
+ end
+ end
+
+ // Number of iterations between restarts
+ if (rhs >= 3),
+ restrt=varargin(2);
+ if (size(restrt) ~= [1 1]),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Scalar expected.\n"),"gmres",3));
+ end
+ else
+ restrt=20;
+ end
+
+ // Error tolerance tol
+ if (rhs >= 4),
+ tol=varargin(3);
+ if (size(tol) ~= [1 1]);
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Scalar expected.\n"),"gmres",4));
+ end
+ else
+ tol = 1e-6;
+ end
+
+ // Maximum number of iterations max_it
+ if (rhs >= 5),
+ max_it=varargin(4);
+ if (size(max_it) ~= [1 1]),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Scalar expected.\n"),"gmres",5));
+ end
+ else
+ max_it=size(b,1);
+ end
+
+ // Parsing of the preconditioner matrix M
+ if (rhs >= 6),
+ M = varargin(5);
+ select type(M)
+ case 1 then
+ precondType = 1;
+ case 5 then
+ precondType = 1;
+ case 13 then
+ precondType = 0;
+ end
+ if (precondType == 1),
+ if (size(M,1) ~= size(M,2)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Square matrix expected.\n"),"gmres",4));
+ end
+ if (size(M,1) == 0),
+ precondType = 2; // no preconditionning
+ elseif ( size(M,1) ~= size(b,1) ),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"gmres",4,2));
+ end
+ end
+ else
+ precondType = 2; // no preconditionning
+ end
+
+ // Parsing of the initial vector x
+ if (rhs >= 7),
+ x=varargin(6);
+ if (size(x,2) ~= 1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Column vector expected.\n"),"gmres",3));
+ end
+ if ( size(x,1) ~= size(b,1) ),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"gmres",3,2));
+ end
+ else
+ x=zeros(b);
+ end
+
+ if (rhs > 7),
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"gmres",2,7));
+ end
+
+ // ------------
+ // Computations
+ // ------------
+
+ j = 0;
+ flag = 0;
+ it2 = 0;
+
+ bnrm2 = norm(b);
+ if (bnrm2 == 0.0),
+ x = zeros(b);
+ resNorm = 0;
+ iter = 0;
+ resVec = resNorm;
+ flag = 0;
+ return
+ end
+
+ // r = M \ ( b-A*x );
+ if (matrixType == 1),
+ r = b - A*x;
+ else
+ r = b - A(x);
+ end
+ if (precondType == 1),
+ r = M \ r;
+ elseif (precondType == 0),
+ r = M(r);
+ end
+ resNorm = norm(r)/bnrm2;
+ resVec = resNorm;
+ if (resNorm < tol),
+ iter=0;
+ return;
+ end
+
+ n = size(b,1);
+ m = restrt;
+ V(1:n,1:m+1) = zeros(n,m+1);
+ H(1:m+1,1:m) = zeros(m+1,m);
+ cs(1:m) = zeros(m,1);
+ sn(1:m) = zeros(m,1);
+ e1 = zeros(n,1);
+ e1(1) = 1.0;
+
+ for j = 1:max_it
+ // r = M \ ( b-A*x );
+ if (matrixType == 1),
+ r = b - A*x;
+ else
+ r = b - A(x);
+ end
+ if (precondType == 1),
+ r = M \ r;
+ elseif (precondType == 0),
+ r = M(r);
+ end
+
+ V(:,1) = r / norm( r );
+ s = norm( r )*e1;
+ for i = 1:m // construct orthonormal
+ it2 = it2 + 1; // basis using Gram-Schmidt
+ // w = M \ (A*V(:,i));
+ if (matrixType == 1),
+ w = A*V(:,i);
+ else
+ w = A(V(:,i));
+ end
+ if (precondType == 1),
+ w = M \ w;
+ elseif (precondType == 0),
+ w = M(w);
+ end
+
+ for k = 1:i
+ H(k,i)= w'*V(:,k);
+ w = w - H(k,i)*V(:,k);
+ end
+ H(i+1,i) = norm( w );
+ V(:,i+1) = w / H(i+1,i);
+ for k = 1:i-1 // apply Givens rotation
+ temp = cs(k)*H(k,i) + sn(k)*H(k+1,i);
+ H(k+1,i) = -sn(k)*H(k,i) + cs(k)*H(k+1,i);
+ H(k,i) = temp;
+ end
+ // form i-th rotation matrix
+ [tp1,tp2] = rotmat( H(i,i), H(i+1,i) );
+ cs(i) = tp1;
+ sn(i) = tp2;
+ temp = cs(i)*s(i);
+ s(i+1) = -sn(i)*s(i);
+ s(i) = temp;
+ H(i,i) = cs(i)*H(i,i) + sn(i)*H(i+1,i);
+ H(i+1,i) = 0.0;
+ resNorm = real(abs(s(i+1))) / bnrm2;
+ resVec = [resVec;resNorm];
+ if ( resNorm <= tol ),
+ y = H(1:i,1:i) \ s(1:i);
+ x = x + V(:,1:i)*y;
+ break;
+ end
+ end
+ if (resNorm <= tol),
+ iter = j-1+it2;
+ break;
+ end
+ y = H(1:m,1:m) \ s(1:m);
+ // update approximation
+ x = x + V(:,1:m)*y;
+ // r = M \ ( b-A*x )
+ if (matrixType == 1),
+ r = b - A*x;
+ else
+ r = b - A(x);
+ end
+ if (precondType == 1),
+ r = M \ r;
+ elseif (precondType == 0),
+ r = M(r);
+ end
+ s(j+1) = norm(r);
+ resNorm = real(s(j+1)) / bnrm2;
+ resVec = [resVec; resNorm];
+
+ if ( resNorm <= tol ),
+ iter = j+it2;
+ break;
+ end
+ if ( j== max_it ),
+ iter=j+it2;
+ end
+ end
+ if ( resNorm > tol ),
+ flag = 1;
+ if (lhs < 2),
+ warning(msprintf(gettext("%s: Did not converge.\n"),"gmres"));
+ end
+ end
+endfunction //GMRES
+
+
+//
+// Compute the Givens rotation matrix parameters for a and b.
+//
+function [ c, s ] = rotmat( a, b )
+ if ( b == 0.0 ),
+ c = 1.0;
+ s = 0.0;
+ elseif ( abs(b) > abs(a) ),
+ temp = a / b;
+ s = 1.0 / sqrt( 1.0 + temp^2 );
+ c = temp * s;
+ else
+ temp = b / a;
+ c = 1.0 / sqrt( 1.0 + temp^2 );
+ s = temp * c;
+ end
+endfunction //rotmat
diff --git a/modules/sparse/macros/issparse.bin b/modules/sparse/macros/issparse.bin
new file mode 100755
index 000000000..cf8e972d7
--- /dev/null
+++ b/modules/sparse/macros/issparse.bin
Binary files differ
diff --git a/modules/sparse/macros/issparse.sci b/modules/sparse/macros/issparse.sci
new file mode 100755
index 000000000..c0a109ac8
--- /dev/null
+++ b/modules/sparse/macros/issparse.sci
@@ -0,0 +1,16 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) XXXX-2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+function r=issparse(x)
+ r=0;
+ if or(type(x)==[5,7]) then
+ r=1
+ end
+endfunction
diff --git a/modules/sparse/macros/lib b/modules/sparse/macros/lib
new file mode 100755
index 000000000..59c004d55
--- /dev/null
+++ b/modules/sparse/macros/lib
Binary files differ
diff --git a/modules/sparse/macros/names b/modules/sparse/macros/names
new file mode 100755
index 000000000..edde6e8fd
--- /dev/null
+++ b/modules/sparse/macros/names
@@ -0,0 +1,15 @@
+%bicg
+%bicgstab
+%cgs
+%pcg
+adj2sp
+chfact
+chsolve
+conjgrad
+gmres
+issparse
+qmr
+sp2adj
+speye
+sprand
+spzeros
diff --git a/modules/sparse/macros/qmr.bin b/modules/sparse/macros/qmr.bin
new file mode 100755
index 000000000..daf5a12ac
--- /dev/null
+++ b/modules/sparse/macros/qmr.bin
Binary files differ
diff --git a/modules/sparse/macros/qmr.sci b/modules/sparse/macros/qmr.sci
new file mode 100755
index 000000000..739058377
--- /dev/null
+++ b/modules/sparse/macros/qmr.sci
@@ -0,0 +1,491 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) XXXX-2008 - INRIA
+// Copyright (C) 2005 - IRISA - Sage Group
+
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+// [x, flag, err, iter, res] = qmr( A, Ap, b, x, M1, M1p, M2, M2p, max_it, tol )
+//
+// QMR solves the linear system Ax=b using the
+// Quasi Minimal Residual method with preconditioning.
+//
+// input A REAL matrix or function
+// x REAL initial guess vector
+// b REAL right hand side vector
+// M1 REAL left preconditioner matrix
+// M2 REAL right preconditioner matrix
+// max_it INTEGER maximum number of iterations
+// tol REAL error tolerance
+//
+// output x REAL solution vector
+// flag INTEGER: 0: solution found to tolerance
+// 1: no convergence given max_it
+// breakdown:
+// -1: rho
+// -2: Beta
+// -3: gam
+// -4: delta
+// -5: ep
+// -6: xi
+// err REAL final residual norm
+// iter INTEGER number of iterations performed
+// res REAL residual vector
+
+// Details of this algorithm are described in
+//
+// "Templates for the Solution of Linear Systems: Building Blocks
+// for Iterative Methods",
+// Barrett, Berry, Chan, Demmel, Donato, Dongarra, Eijkhout,
+// Pozo, Romine, and Van der Vorst, SIAM Publications, 1993
+// (ftp netlib2.cs.utk.edu; cd linalg; get templates.ps).
+//
+// "Iterative Methods for Sparse Linear Systems, Second Edition"
+// Saad, SIAM Publications, 2003
+// (ftp ftp.cs.umn.edu; cd dept/users/saad/PS; get all_ps.zip).
+
+// Sage Group (IRISA, 2005)
+
+function [x, flag, err, iter, res] = qmr( A, varargin)
+
+ // -----------------------
+ // Parsing input arguments
+ // -----------------------
+ [lhs,rhs]=argn(0);
+ if ( rhs < 2 ),
+ error(msprintf(gettext("%s: Wrong number of input arguments: At least %d expected.\n"),"qmr",2));
+ end
+
+ // Parsing the matrix A
+ select type(A)
+ case 1 then
+ cpt=1;
+ case 5 then
+ cpt=1;
+ case 13 then
+ cpt=0;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d : A real or complex matrix or a sparse matrix or a function expected.\n"),"qmr",1));
+ end
+
+ // If A is a matrix (dense or sparse)
+ if (cpt==1),
+ if (size(A,1) ~= size(A,2)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Square matrix expected.\n"),"qmr",1));
+ end
+ fct=0;
+ cptmat = 1;
+ end
+
+ // If A is a function
+ if (cpt==0),
+ fct = 0;
+ if rhs >= 2,
+ funcorvec=varargin(1);
+ if and(type(funcorvec) <> [1 5 13]) then
+ error(msprintf(gettext("%s: Wrong value for input argument #%d: Transpose of the function %s expected.\n"),"qmr",2,"A"));
+ // if the following input argument is a sparse or dense matrix
+ elseif or(type(funcorvec) == [1 5]) then
+ if size(getfield(1,macrovar(A)),"*") == 1 then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function %s expected.\n"), "qmr", 2, "A"));
+ end
+ matvec = A;
+ cptmat = 1;
+ // if the following input argument is a function
+ else
+ matvec = A;
+ matvecp = funcorvec;
+ cptmat = 2;
+ fct = 1;
+ warning(msprintf(gettext("%s : Calling qmr(A,Ap) is deprecated. Please see qmr documentation for more details.\n"),"qmr"));
+ end
+ end
+ end
+
+ // Parsing right hand side b
+ if ( rhs >= fct+2 ),
+ b=varargin(fct+1);
+ // if b is not constant or sparse
+ if and(type(b) <> [1 5]) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", fct+2));
+ end
+ if ( size(b,2) ~= 1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Column vector expected.\n"),"qmr",fct+2));
+ end
+ end
+
+ // Parsing initial vector x
+ if ( rhs >= fct+3),
+ x=varargin(fct+2);
+ // if x is not constant or sparse
+ if and(type(x) <> [1 5]) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", fct + 3));
+ end
+ if (size(x,2) ~= 1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Column vector expected.\n"),"qmr",fct+3));
+ end
+ if ( size(x,1) ~= size(b,1)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"qmr",fct+3,fct+2));
+ end
+ // By default
+ else
+ x=zeros(size(b,1),1);
+ end
+
+ //--------------------------------------------------------
+ // Parsing of the preconditioner matrix M1
+ //--------------------------------------------------------
+ if (rhs >=fct+4),
+ Prec_g=varargin(fct+3);
+ select type(Prec_g)
+ case 1 then
+ cpt=1;
+ case 5 then
+ cpt=1;
+ case 13 then
+ cpt=0;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", fct + 4));
+ end
+
+ // if M1 is a matrix
+ if ( cpt==1 ),
+ if (size(Prec_g,1) ~= size(Prec_g,2)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Square matrix expected.\n"),"qmr",fct+4));
+ end
+ if (size(Prec_g,1)~=size(b,1)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"qmr",fct+4,fct+2));
+ end
+ cptmatM1 = 1;
+ end
+
+ // if M1 is a function
+ if ( cpt==0 ),
+ precond_g = Prec_g;
+ cptmatM1 = 1;
+ if ( rhs >= fct+5 & size(getfield(1,macrovar(precond_g)),"*") == 1),
+ Precp_g = varargin(fct+4);
+ if (type(Precp_g) == 13 & size(getfield(1,macrovar(Precp_g)),"*")==1) then
+ //precond_g = Prec_g;
+ precondp_g = Precp_g;
+ cptmatM1 = 2;
+ fct = fct+1;
+ warning(msprintf(gettext("%s : Calling qmr(...,M1,M1p) is deprecated. Please see qmr documentation for more details.\n"),"qmr"));
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", fct + 5));
+ end
+ elseif rhs < fct+5 & size(getfield(1, macrovar(precond_g)), "*") == 1 then
+ error(msprintf(gettext("%s: Wrong prototype of input argument #%d: If M1 is function, use the header M1(x,t) instead M1(x).\n"), "qmr", fct+4));
+ end
+ end
+ // By default
+ else
+ deff("y=precond_g(x)","y=x");
+ deff("y=precondp_g(x)","y=x");
+ cptmatM1 = 2;
+ end
+
+ //--------------------------------------------------------
+ // Parsing of the preconditioner matrix M2
+ //--------------------------------------------------------
+ if (rhs >=fct+5),
+ Prec_d=varargin(fct+4);
+ select type(Prec_d)
+ case 1 then
+ cpt=1;
+ case 5 then
+ cpt=1;
+ case 13 then
+ cpt=0;
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", fct + 5));
+ end
+
+ // M2 matrix
+ if ( cpt==1 ),
+
+ if (size(Prec_d,1) ~= size(Prec_d,2)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Square matrix expected.\n"),"qmr",fct+5));
+ end
+ if (size(Prec_d,1)~=size(b,1)),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"qmr",fct+5,fct+2));
+ end
+ cptmatM2 = 1;
+
+ end
+
+ // M2 function
+ if ( cpt==0 )
+ precond_d = Prec_d;
+ cptmatM2 = 1;
+ if ( rhs >= fct+6 & size(getfield(1,macrovar(precond_d)),"*") == 1),
+ Precp_d=varargin(fct+5);
+ if (type(Precp_d) == 13 & size(getfield(1,macrovar(Precp_d)),"*") == 1) then
+ precond_d = Prec_d;
+ precondp_d = Precp_d;
+ cptmatM2 = 2;
+ fct = fct+1;
+ warning(msprintf(gettext("%s : Calling qmr(...,M2,M2p) is deprecated. Please see qmr documentation for more details.\n"),"qmr"));
+ else
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", fct + 6));
+ end
+ elseif rhs < fct+6 & size(getfield(1, macrovar(precond_d)), "*") == 1 then
+ error(msprintf(gettext("%s: Wrong prototype of input argument #%d: If M2 is function, use the header M2(x,t) instead M2(x).\n"), "qmr", fct+5));
+ end
+ end
+ // By default
+ else
+ deff("y=precond_d(x)","y=x");
+ deff("y=precondp_d(x)","y=x");
+ cptmatM2 = 2;
+ end
+
+ //--------------------------------------------------------
+ // Parsing of the maximum number of iterations max_it
+ //--------------------------------------------------------
+ if (rhs >= fct+6),
+ max_it=varargin(fct+5);
+ // if max_it is not constant
+ if type(max_it) <> 1 then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"qmr",fct + 6));
+ end
+
+ if ~isreal(max_it) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"),"qmr",fct + 6));
+ end
+
+ if (size(max_it,1) ~= 1 | size(max_it,2) ~=1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Scalar expected.\n"),"qmr",fct+6));
+ end
+ // By default
+ else
+ max_it=size(b,1);
+ end
+
+ //--------------------------------------------------------
+ // Parsing of the error tolerance tol
+ //--------------------------------------------------------
+ if (rhs == fct+7),
+ tol=varargin(fct+6);
+ // if tol is not constant
+ if type(tol) <> 1 then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"),"qmr",fct + 7));
+ end
+
+ if ~isreal(tol) then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"),"qmr",fct + 7));
+ end
+
+ if (size(tol,1) ~= 1 | size(tol,2) ~=1),
+ error(msprintf(gettext("%s: Wrong size for input argument #%d: Scalar expected.\n"),"qmr",fct+7));
+ end
+ // By default
+ else
+ tol=1000*%eps;
+ end
+
+ //--------------------------------------------------------
+ // test about input arguments number
+ //--------------------------------------------------------
+ if (rhs > fct+7),
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d to %d expected.\n"),"qmr",2,fct+7));
+ end
+
+ // ------------
+ // Computations
+ // ------------
+
+ // initialization
+ i = 0;
+ flag = 0;
+ iter = 0;
+ bnrm2 = norm( b );
+ if (bnrm2 == 0.0),
+ bnrm2 = 1.0;
+ end
+
+ // r = b - A*x;
+ if (cptmat == 1) then
+ r = b - matvec(x,"notransp");
+ elseif (cptmat==2) then // If A is a function
+ r = b - matvec(x);
+ end
+
+ err = norm( r ) / bnrm2;
+ res = err;
+ if ( err < tol ), return; end
+
+ // [M1,M2] = lu( M );
+ v_tld = r;
+
+ // y = M1 \ v_tld;
+ if (cptmatM1 == 1) then
+ y = precond_g(v_tld,"notransp");
+ elseif (cptmatM1==2) then
+ y = precond_g(v_tld);
+ end
+
+ rho = norm( y );
+
+ w_tld = r;
+ // z = M2' \ w_tld;
+ if (cptmatM2 == 1) then
+ z = precond_d(w_tld,"transp");
+ elseif (cptmatM2 == 2) then
+ z = precondp_d(w_tld);
+ end
+
+ xi = norm( z );
+
+ gam = 1.0;
+ eta = -1.0;
+ theta = 0.0;
+
+ for i = 1:max_it, // begin iteration
+ if ( rho == 0.0 | xi == 0.0 ), iter=i; break; end
+ v = v_tld / rho;
+ y = y / rho;
+
+ w = w_tld / xi;
+ z = z / xi;
+
+ delta = z'*y;
+ if ( delta == 0.0 ), iter=i; break; end
+
+ // y_tld = M2 \ y;
+ if (cptmatM2 == 1) then
+ y_tld = precond_d(y,"notransp");
+ elseif (cptmatM2 == 2) then
+ y_tld = precond_d(y);
+ end
+
+ // z_tld = M1'\ z;
+ if (cptmatM1 == 1) then
+ z_tld = precond_g(z,"transp");
+ elseif (cptmatM1 == 2) then
+ z_tld = precondp_g(z);
+ end
+
+ if ( i > 1 ), // direction vector
+ p = y_tld - ( xi*delta / ep )*p;
+ q = z_tld - ( rho*delta / ep )*q;
+ else
+ p = y_tld;
+ q = z_tld;
+ end
+
+ // p_tld = A*p;
+ if (cptmat == 1) then
+ p_tld = matvec(p,"notransp");
+ elseif (cptmat == 2) then
+ p_tld = matvec(p);
+ end
+
+ ep = q'*p_tld;
+ if ( ep == 0.0 ), iter=i; break; end
+
+ Beta = ep / delta;
+ if ( Beta == 0.0 ), iter=i; break; end
+
+ v_tld = p_tld - Beta*v;
+
+ // y = M1 \ v_tld;
+ if (cptmatM1 == 1) then
+ y = precond_g(v_tld,"notransp");
+ elseif (cptmatM1==2) then
+ y = precond_g(v_tld);
+ end
+
+ rho_1 = rho;
+ rho = norm( y );
+
+ // w_tld = ( A'*q ) - ( Beta*w );
+ if (cptmat == 1) then
+ w_tld = ( matvec(q,"transp") ) - ( Beta*w );
+ elseif (cptmat == 2) then
+ w_tld = ( matvecp(q) ) - ( Beta*w );
+ end
+
+ // z = M2' \ w_tld;
+ if (cptmatM2 == 1) then
+ z = precond_d(w_tld,"transp");
+ elseif (cptmatM2 == 2) then
+ z = precondp_d(w_tld);
+ end
+
+ xi = norm( z );
+ gamma_1 = gam;
+ theta_1 = theta;
+ theta = rho / ( gamma_1*Beta );
+ gam = 1.0 / sqrt( 1.0 + (theta^2) );
+ if ( gam == 0.0 ), iter=i; break; end
+
+ eta = -eta*rho_1*(gam^2) / ( Beta*(gamma_1^2) );
+
+ if ( i > 1 ), // compute adjustment
+ d = eta*p + (( theta_1*gam )^2)*d;
+ s = eta*p_tld + (( theta_1*gam )^2)*s;
+ else
+ d = eta*p;
+ s = eta*p_tld;
+ end
+ x = x + d; // update approximation
+
+ r = r - s; // update residual
+ err = norm( r ) / bnrm2; // check convergence
+ res = [res;err];
+
+ if ( err <= tol ), iter=i; break; end
+
+ if ( i == max_it ), iter=i; end
+ end
+
+ if ( err <= tol ), // converged
+ flag = 0;
+ elseif ( rho == 0.0 ), // breakdown
+ flag = -1;
+ elseif ( Beta == 0.0 ),
+ flag = -2;
+ elseif ( gam == 0.0 ),
+ flag = -3;
+ elseif ( delta == 0.0 ),
+ flag = -4;
+ elseif ( ep == 0.0 ),
+ flag = -5;
+ elseif ( xi == 0.0 ),
+ flag = -6;
+ else // no convergence
+ flag = 1;
+ end
+
+endfunction
+
+function y = matvec(x,t)
+ if (t=="notransp") then
+ y = A*x;
+ elseif (t=="transp") then
+ y = A'*x;
+ end
+endfunction
+
+function y = precond_g(x,t)
+ if (t=="notransp") then
+ y = Prec_g*x;
+ elseif (t=="transp") then
+ y = Prec_g'*x;
+ end
+endfunction
+
+function y = precond_d(x,t)
+ if (t=="notransp") then
+ y = Prec_d*x;
+ elseif (t=="transp") then
+ y = Prec_d'*x;
+ end
+endfunction
+
diff --git a/modules/sparse/macros/sp2adj.bin b/modules/sparse/macros/sp2adj.bin
new file mode 100755
index 000000000..b44ecd4d7
--- /dev/null
+++ b/modules/sparse/macros/sp2adj.bin
Binary files differ
diff --git a/modules/sparse/macros/sp2adj.sci b/modules/sparse/macros/sp2adj.sci
new file mode 100755
index 000000000..da86ffdba
--- /dev/null
+++ b/modules/sparse/macros/sp2adj.sci
@@ -0,0 +1,50 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) XXXX-2008 - INRIA
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+
+function [xadj,iadj,v]=sp2adj(A)
+ // sparse conversion to adjacency
+ // See sp2adj.xml for help.
+ //
+ // Check number of arguments
+ [lhs, rhs] = argn()
+ if ( rhs <> 1 ) then
+ lstr = gettext("%s: Wrong number of input arguments: %d to %d expected.\n")
+ error ( msprintf(lstr,"sp2adj",1,1))
+ end
+ if ( and(lhs <> [0 1 2 3]) ) then
+ lstr = gettext("%s: Wrong number of output arguments: %d to %d expected.\n")
+ error ( msprintf(lstr,"sp2adj",0,3))
+ end
+ //
+ // Check type of arguments
+ if ( typeof(A) <> "sparse" ) then
+ lstr = gettext("%s: Wrong type for input argument #%d.\n")
+ error ( msprintf(lstr,"sp2adj",1))
+ end
+ //
+ // Check size of arguments
+ // Nothing to do
+ //
+ // Check content of arguments
+ // Nothing to do
+ //
+ [ij,v,n]=spget(A')
+ N=n(1)
+ if ( ij == [] ) then,
+ xadj=ones(n(2)+1,1)
+ iadj=[]
+ v=[]
+ else,
+ [xadj,la,iadj]=ta2lpd(ij(:,1)',ij(:,2)',N+1,N)
+ xadj=xadj(:)
+ iadj=iadj(:)
+ end
+endfunction
diff --git a/modules/sparse/macros/speye.bin b/modules/sparse/macros/speye.bin
new file mode 100755
index 000000000..0732eca35
--- /dev/null
+++ b/modules/sparse/macros/speye.bin
Binary files differ
diff --git a/modules/sparse/macros/speye.sci b/modules/sparse/macros/speye.sci
new file mode 100755
index 000000000..56d62ebd9
--- /dev/null
+++ b/modules/sparse/macros/speye.sci
@@ -0,0 +1,16 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function [sp]=speye(m,n)
+
+ [lhs,rhs]=argn(0)
+ if rhs==1 then [m,n]=size(m),end
+ mn=min(m,n)
+ sp=sparse([(1:mn)' (1:mn)'],ones(mn,1),[m,n])
+endfunction
diff --git a/modules/sparse/macros/sprand.bin b/modules/sparse/macros/sprand.bin
new file mode 100755
index 000000000..17f3057d3
--- /dev/null
+++ b/modules/sparse/macros/sprand.bin
Binary files differ
diff --git a/modules/sparse/macros/sprand.sci b/modules/sparse/macros/sprand.sci
new file mode 100755
index 000000000..e42c3e5bb
--- /dev/null
+++ b/modules/sparse/macros/sprand.sci
@@ -0,0 +1,74 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function a=sprand(m,n,density,typ)
+
+ //---- Check arguments----------------------------------------------
+ rhs = argn(2)
+
+ if ( rhs < 3 | rhs > 4 ) then
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "sprand" , 3 , 4 ));
+ end
+
+ if ( rhs < 4 ) then
+ typ="def";
+ end
+
+ if type(typ)<>10 then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A string expected.\n"),"sprand",4));
+ end
+
+ if and(typ<>["u";"n";"uniform";"normal";"def";"nor"]) then
+ error(msprintf(gettext("%s: Wrong value for input argument #%d: ''%s'' or ''%s'' expected.\n"),"sprand",4,"uniform","normal"));
+ end
+ if typ == "u" | typ == "uniform" then //"uniform" is the syntax for uniform distribution with rand, the equivalent with grand is "def"
+ typ = "def";
+ elseif typ == "n" | typ == "normal" then //"normal" is the syntax for normal distribution with rand, the equivalent with grand is "nor"
+ typ = "nor";
+ end
+
+ density=max(min(density,1),0);
+
+ nel=m*n*density; //the objective number of non zero elements
+ if nel==0 then
+ a=sparse([],[],[m,n])
+ return
+ end
+
+ //---- generate a sequence of increments----------------------------
+ mdist = 1/density //the mean distance between to consecutive index
+ nel1 = (2.2-density)*nel; //generate more increments than requested nnz elements
+ ij = round(1+grand(nel1,1,"exp",(mdist-1)))
+
+ //---- sum the increments to get the index--------------------------
+ ij=cumsum(ij);
+
+ //---- eliminate the index with exceed the maximum matrix index
+ ij(find(ij>m*n))=[];
+ nel1=size(ij,"*");
+ if nel1==0 then
+ a=sparse([],[],[m,n]);
+ return
+ end
+ //---- generate the row and column indices from the 1D index--------
+
+ ij=ind2sub([m,n],ij);
+
+ //---- generates the random non zeros elements --------------------
+ //according to the requested law and create the sparse matrix
+ if typ == "nor" then // Because of the syntax of grand, we have two cases, one with "def" and one with "nor"
+ a=sparse(ij,grand(nel1,1,typ,0,1),[m,n]);
+ elseif typ == "def" then
+ a=sparse(ij,grand(nel1,1,typ),[m,n]);
+ end
+
+
+endfunction
+
diff --git a/modules/sparse/macros/spzeros.bin b/modules/sparse/macros/spzeros.bin
new file mode 100755
index 000000000..d8d462971
--- /dev/null
+++ b/modules/sparse/macros/spzeros.bin
Binary files differ
diff --git a/modules/sparse/macros/spzeros.sci b/modules/sparse/macros/spzeros.sci
new file mode 100755
index 000000000..a6373f4a5
--- /dev/null
+++ b/modules/sparse/macros/spzeros.sci
@@ -0,0 +1,21 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function [sp]=spzeros(m,n)
+
+ [lhs,rhs]=argn(0)
+ if ( rhs < 1 ) then
+ error(msprintf(gettext("%s: Wrong number of input arguments: %d or %d expected.\n"), "spzeros" , 1 , 2 ));
+ end
+
+ if rhs==1 then
+ [m,n]=size(m)
+ end
+ sp=sparse([],[],[m,n])
+endfunction
diff --git a/modules/sparse/sci_gateway/c/.deps/.dirstamp b/modules/sparse/sci_gateway/c/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/.dirstamp
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-gw_sparse.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-gw_sparse.Plo
new file mode 100755
index 000000000..585d38986
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-gw_sparse.Plo
@@ -0,0 +1,281 @@
+sci_gateway/c/libscisparse_la-gw_sparse.lo: sci_gateway/c/gw_sparse.c \
+ /usr/include/stdc-predef.h /usr/include/string.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/xlocale.h \
+ /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h \
+ ../../modules/core/includes/callFunctionFromGateway.h \
+ ../../modules/api_scilab/includes/api_scilab.h \
+ ../../modules/core/includes/stack-c.h \
+ ../../modules/core/includes/core_math.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/values.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h \
+ ../../modules/core/includes/stack-def.h \
+ ../../modules/core/includes/machine.h \
+ ../../modules/core/includes/stackTypeVariable.h \
+ ../../modules/core/includes/BOOL.h \
+ ../../modules/core/includes/doublecomplex.h \
+ ../../modules/core/includes/stack1.h \
+ ../../modules/core/includes/scisparse.h \
+ ../../modules/core/includes/stack2.h \
+ ../../modules/core/includes/stack3.h \
+ ../../modules/core/includes/stack-optional.h \
+ ../../modules/core/includes/sci_types.h \
+ ../../modules/api_scilab/includes/api_common.h \
+ ../../modules/api_scilab/includes/api_scilab.h \
+ ../../modules/api_scilab/includes/api_double.h \
+ ../../modules/core/includes/doublecomplex.h \
+ ../../modules/api_scilab/includes/api_string.h /usr/include/wchar.h \
+ /usr/include/stdio.h /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar2.h \
+ ../../modules/api_scilab/includes/api_int.h \
+ ../../modules/api_scilab/includes/api_poly.h \
+ ../../modules/api_scilab/includes/api_sparse.h \
+ ../../modules/api_scilab/includes/api_boolean.h \
+ ../../modules/api_scilab/includes/api_boolean_sparse.h \
+ ../../modules/api_scilab/includes/api_pointer.h \
+ ../../modules/api_scilab/includes/api_list.h \
+ ../../modules/api_scilab/includes/api_error.h \
+ ../../modules/api_scilab/includes/api_handle.h \
+ ../../modules/api_scilab/includes/api_optional.h \
+ ../../modules/core/includes/stack-optional.h \
+ ../../modules/api_scilab/includes/api_hypermat.h \
+ ../../modules/core/includes/core_math.h \
+ ../../modules/core/includes/sci_types.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/string.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
+
+../../modules/core/includes/callFunctionFromGateway.h:
+
+../../modules/api_scilab/includes/api_scilab.h:
+
+../../modules/core/includes/stack-c.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/values.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+../../modules/core/includes/stack-def.h:
+
+../../modules/core/includes/machine.h:
+
+../../modules/core/includes/stackTypeVariable.h:
+
+../../modules/core/includes/BOOL.h:
+
+../../modules/core/includes/doublecomplex.h:
+
+../../modules/core/includes/stack1.h:
+
+../../modules/core/includes/scisparse.h:
+
+../../modules/core/includes/stack2.h:
+
+../../modules/core/includes/stack3.h:
+
+../../modules/core/includes/stack-optional.h:
+
+../../modules/core/includes/sci_types.h:
+
+../../modules/api_scilab/includes/api_common.h:
+
+../../modules/api_scilab/includes/api_scilab.h:
+
+../../modules/api_scilab/includes/api_double.h:
+
+../../modules/core/includes/doublecomplex.h:
+
+../../modules/api_scilab/includes/api_string.h:
+
+/usr/include/wchar.h:
+
+/usr/include/stdio.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar2.h:
+
+../../modules/api_scilab/includes/api_int.h:
+
+../../modules/api_scilab/includes/api_poly.h:
+
+../../modules/api_scilab/includes/api_sparse.h:
+
+../../modules/api_scilab/includes/api_boolean.h:
+
+../../modules/api_scilab/includes/api_boolean_sparse.h:
+
+../../modules/api_scilab/includes/api_pointer.h:
+
+../../modules/api_scilab/includes/api_list.h:
+
+../../modules/api_scilab/includes/api_error.h:
+
+../../modules/api_scilab/includes/api_handle.h:
+
+../../modules/api_scilab/includes/api_optional.h:
+
+../../modules/core/includes/stack-optional.h:
+
+../../modules/api_scilab/includes/api_hypermat.h:
+
+../../modules/core/includes/core_math.h:
+
+../../modules/core/includes/sci_types.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_bfinit.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_bfinit.Plo
new file mode 100755
index 000000000..b2186bb8b
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_bfinit.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_bfinit.lo: sci_gateway/c/sci_bfinit.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkfc1i.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkfc1i.Plo
new file mode 100755
index 000000000..f2023f414
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkfc1i.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_blkfc1i.lo: sci_gateway/c/sci_blkfc1i.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkslvi.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkslvi.Plo
new file mode 100755
index 000000000..4156befd0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_blkslvi.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_blkslvi.lo: sci_gateway/c/sci_blkslvi.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_fadj2sp.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_fadj2sp.Plo
new file mode 100755
index 000000000..750749f31
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_fadj2sp.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_fadj2sp.lo: sci_gateway/c/sci_fadj2sp.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_full.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_full.Plo
new file mode 100755
index 000000000..77c3c4710
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_full.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_full.lo: sci_gateway/c/sci_full.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_inpnvi.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_inpnvi.Plo
new file mode 100755
index 000000000..865e389d2
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_inpnvi.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_inpnvi.lo: sci_gateway/c/sci_inpnvi.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ludel.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ludel.Plo
new file mode 100755
index 000000000..7986e3fe9
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ludel.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_ludel.lo: sci_gateway/c/sci_ludel.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lufact.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lufact.Plo
new file mode 100755
index 000000000..bec1a9aa4
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lufact.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_lufact.lo: sci_gateway/c/sci_lufact.c \
+ /usr/include/stdc-predef.h ../../modules/core/includes/machine.h \
+ includes/gw_sparse.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+../../modules/core/includes/machine.h:
+
+includes/gw_sparse.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_luget.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_luget.Plo
new file mode 100755
index 000000000..9f3b18987
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_luget.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_luget.lo: sci_gateway/c/sci_luget.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lusolve.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lusolve.Plo
new file mode 100755
index 000000000..33f28290e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_lusolve.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_lusolve.lo: sci_gateway/c/sci_lusolve.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mfull.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mfull.Plo
new file mode 100755
index 000000000..37f09680a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mfull.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_mfull.lo: sci_gateway/c/sci_mfull.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_msparse.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_msparse.Plo
new file mode 100755
index 000000000..d3f1bcc9a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_msparse.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_msparse.lo: sci_gateway/c/sci_msparse.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mspget.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mspget.Plo
new file mode 100755
index 000000000..14f54939a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_mspget.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_mspget.lo: sci_gateway/c/sci_mspget.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_nnz.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_nnz.Plo
new file mode 100755
index 000000000..9caf3283d
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_nnz.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_nnz.lo: sci_gateway/c/sci_nnz.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ordmmd.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ordmmd.Plo
new file mode 100755
index 000000000..c5efa4ecb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_ordmmd.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_ordmmd.lo: sci_gateway/c/sci_ordmmd.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sfinit.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sfinit.Plo
new file mode 100755
index 000000000..672f40e06
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sfinit.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_sfinit.lo: sci_gateway/c/sci_sfinit.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sparse.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sparse.Plo
new file mode 100755
index 000000000..11dddfd3e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_sparse.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_sparse.lo: sci_gateway/c/sci_sparse.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spchol.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spchol.Plo
new file mode 100755
index 000000000..0ddc2c587
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spchol.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_spchol.lo: sci_gateway/c/sci_spchol.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spclean.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spclean.Plo
new file mode 100755
index 000000000..c66b789ed
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spclean.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_spclean.lo: sci_gateway/c/sci_spclean.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spcompa.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spcompa.Plo
new file mode 100755
index 000000000..3e03b3cde
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spcompa.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_spcompa.lo: sci_gateway/c/sci_spcompa.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spget.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spget.Plo
new file mode 100755
index 000000000..36f78f2d6
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spget.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_spget.lo: sci_gateway/c/sci_spget.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spmatrix.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spmatrix.Plo
new file mode 100755
index 000000000..7e76b5808
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_spmatrix.Plo
@@ -0,0 +1,12 @@
+sci_gateway/c/libscisparse_la-sci_spmatrix.lo: \
+ sci_gateway/c/sci_spmatrix.c /usr/include/stdc-predef.h \
+ includes/gw_sparse.h ../../modules/core/includes/machine.h \
+ includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_symfcti.Plo b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_symfcti.Plo
new file mode 100755
index 000000000..9e1faa2ac
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.deps/libscisparse_la-sci_symfcti.Plo
@@ -0,0 +1,11 @@
+sci_gateway/c/libscisparse_la-sci_symfcti.lo: sci_gateway/c/sci_symfcti.c \
+ /usr/include/stdc-predef.h includes/gw_sparse.h \
+ ../../modules/core/includes/machine.h includes/dynlib_sparse.h
+
+/usr/include/stdc-predef.h:
+
+includes/gw_sparse.h:
+
+../../modules/core/includes/machine.h:
+
+includes/dynlib_sparse.h:
diff --git a/modules/sparse/sci_gateway/c/.dirstamp b/modules/sparse/sci_gateway/c/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.dirstamp
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-gw_sparse.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-gw_sparse.o
new file mode 100755
index 000000000..f28a132b0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-gw_sparse.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_bfinit.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_bfinit.o
new file mode 100755
index 000000000..092fe10f2
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_bfinit.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkfc1i.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkfc1i.o
new file mode 100755
index 000000000..03fb66470
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkfc1i.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkslvi.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkslvi.o
new file mode 100755
index 000000000..0c59127aa
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_blkslvi.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_fadj2sp.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_fadj2sp.o
new file mode 100755
index 000000000..ce7c6a9c0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_fadj2sp.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_full.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_full.o
new file mode 100755
index 000000000..fd4e0d6d4
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_full.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_inpnvi.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_inpnvi.o
new file mode 100755
index 000000000..b18b80ba6
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_inpnvi.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ludel.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ludel.o
new file mode 100755
index 000000000..d13147754
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ludel.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lufact.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lufact.o
new file mode 100755
index 000000000..a88c16ec5
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lufact.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_luget.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_luget.o
new file mode 100755
index 000000000..819bbca45
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_luget.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lusolve.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lusolve.o
new file mode 100755
index 000000000..d6f1ddb5e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_lusolve.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mfull.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mfull.o
new file mode 100755
index 000000000..ae57f9de1
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mfull.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_msparse.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_msparse.o
new file mode 100755
index 000000000..2124e3615
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_msparse.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mspget.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mspget.o
new file mode 100755
index 000000000..a91a3eb82
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_mspget.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_nnz.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_nnz.o
new file mode 100755
index 000000000..626d472eb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_nnz.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ordmmd.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ordmmd.o
new file mode 100755
index 000000000..4ada80162
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_ordmmd.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sfinit.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sfinit.o
new file mode 100755
index 000000000..97a4eaccc
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sfinit.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sparse.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sparse.o
new file mode 100755
index 000000000..d8994b161
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_sparse.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spchol.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spchol.o
new file mode 100755
index 000000000..a1c6d1654
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spchol.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spclean.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spclean.o
new file mode 100755
index 000000000..145335567
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spclean.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spcompa.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spcompa.o
new file mode 100755
index 000000000..ab22bb6da
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spcompa.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spget.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spget.o
new file mode 100755
index 000000000..ed4e3f5d0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spget.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spmatrix.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spmatrix.o
new file mode 100755
index 000000000..c29b68573
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_spmatrix.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_symfcti.o b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_symfcti.o
new file mode 100755
index 000000000..4fdab5e72
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/.libs/libscisparse_la-sci_symfcti.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/c/gw_sparse.c b/modules/sparse/sci_gateway/c/gw_sparse.c
new file mode 100755
index 000000000..c1aa52b26
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/gw_sparse.c
@@ -0,0 +1,61 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <string.h>
+#include "gw_sparse.h"
+#include "callFunctionFromGateway.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+static gw_generic_table Tab[] =
+{
+ {sci_sparsefunc, "sparse"},
+ {sci_spget, "spget"},
+ {sci_full, "full"},
+ {sci_lufact, "lufact"},
+ {sci_lusolve, "lusolve"},
+ {sci_ludel, "ludel"},
+ {sci_luget, "luget"},
+ {sci_spclean, "spclean"},
+ {sci_nnz, "nnz"},
+ {NULL, ""}, //spmax
+ {NULL, ""}, //spmin
+ {sci_spmatrix, "spmatrix"},
+ {sci_spchol, "spchol"},
+ {sci_fadj2sp, "fadj2sp"},
+ {sci_spcompa, "spcompa"},
+ {sci_ordmmd, "ordmmd"},
+ {sci_blkfc1i, "blkfc1i"},
+ {sci_blkslvi, "blkslvi"},
+ {sci_inpnvi, "inpnvi"},
+ {sci_sfinit, "sfinit"},
+ {sci_symfcti, "symfcti"},
+ {sci_bfinit, "bfinit"},
+ {sci_msparse, "msparse"},
+ {sci_mspget, "mspget"},
+ {sci_mfull, "mfull"},
+ {C2F(scita2lpd), "ta2lpd"}
+};
+/*--------------------------------------------------------------------------*/
+int gw_sparse(void)
+{
+ if (pvApiCtx == NULL)
+ {
+ pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+ }
+
+ pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
+ callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-gw_sparse.lo b/modules/sparse/sci_gateway/c/libscisparse_la-gw_sparse.lo
new file mode 100755
index 000000000..1cb06ee3e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-gw_sparse.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-gw_sparse.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-gw_sparse.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_bfinit.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_bfinit.lo
new file mode 100755
index 000000000..8fee5f7cb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_bfinit.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_bfinit.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_bfinit.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkfc1i.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkfc1i.lo
new file mode 100755
index 000000000..059e54b5f
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkfc1i.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_blkfc1i.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_blkfc1i.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkslvi.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkslvi.lo
new file mode 100755
index 000000000..b57c3d5b0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_blkslvi.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_blkslvi.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_blkslvi.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_fadj2sp.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_fadj2sp.lo
new file mode 100755
index 000000000..b1b01369c
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_fadj2sp.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_fadj2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_fadj2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_full.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_full.lo
new file mode 100755
index 000000000..f6508c714
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_full.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_full.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_full.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_inpnvi.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_inpnvi.lo
new file mode 100755
index 000000000..569a2c29f
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_inpnvi.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_inpnvi.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_inpnvi.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_ludel.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_ludel.lo
new file mode 100755
index 000000000..68c6d3e0a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_ludel.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_ludel.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_ludel.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_lufact.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_lufact.lo
new file mode 100755
index 000000000..18b061271
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_lufact.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_lufact.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_lufact.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_luget.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_luget.lo
new file mode 100755
index 000000000..6c23a99c4
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_luget.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_luget.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_luget.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_lusolve.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_lusolve.lo
new file mode 100755
index 000000000..c932ae3fc
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_lusolve.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_lusolve.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_lusolve.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_mfull.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_mfull.lo
new file mode 100755
index 000000000..df12f662a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_mfull.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_mfull.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_mfull.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_msparse.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_msparse.lo
new file mode 100755
index 000000000..208801755
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_msparse.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_msparse.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_msparse.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_mspget.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_mspget.lo
new file mode 100755
index 000000000..878aa1bf9
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_mspget.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_mspget.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_mspget.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_nnz.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_nnz.lo
new file mode 100755
index 000000000..f86a46fe4
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_nnz.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_nnz.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_nnz.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_ordmmd.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_ordmmd.lo
new file mode 100755
index 000000000..b9a1f085a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_ordmmd.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_ordmmd.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_ordmmd.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_sfinit.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_sfinit.lo
new file mode 100755
index 000000000..e806f6a55
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_sfinit.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_sfinit.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_sfinit.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_sparse.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_sparse.lo
new file mode 100755
index 000000000..27494e47a
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_sparse.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_sparse.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_sparse.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_spchol.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spchol.lo
new file mode 100755
index 000000000..9e679d365
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spchol.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_spchol.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_spchol.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_spclean.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spclean.lo
new file mode 100755
index 000000000..ada3e6c54
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spclean.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_spclean.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_spclean.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_spcompa.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spcompa.lo
new file mode 100755
index 000000000..08017ed83
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spcompa.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_spcompa.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_spcompa.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_spget.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spget.lo
new file mode 100755
index 000000000..b3734af01
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spget.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_spget.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_spget.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_spmatrix.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spmatrix.lo
new file mode 100755
index 000000000..d7ecb0920
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_spmatrix.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_spmatrix.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_spmatrix.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/libscisparse_la-sci_symfcti.lo b/modules/sparse/sci_gateway/c/libscisparse_la-sci_symfcti.lo
new file mode 100755
index 000000000..c3b5ed896
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/libscisparse_la-sci_symfcti.lo
@@ -0,0 +1,12 @@
+# sci_gateway/c/libscisparse_la-sci_symfcti.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_la-sci_symfcti.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/c/sci_bfinit.c b/modules/sparse/sci_gateway/c/sci_bfinit.c
new file mode 100755
index 000000000..28762fac2
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_bfinit.c
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intbfinit)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_bfinit(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intbfinit)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_blkfc1i.c b/modules/sparse/sci_gateway/c/sci_blkfc1i.c
new file mode 100755
index 000000000..1ed6beb7b
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_blkfc1i.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intblkfc1i)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_blkfc1i(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intblkfc1i)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_blkslvi.c b/modules/sparse/sci_gateway/c/sci_blkslvi.c
new file mode 100755
index 000000000..6c7bf97f3
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_blkslvi.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intblkslvi)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_blkslvi(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intblkslvi)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_fadj2sp.c b/modules/sparse/sci_gateway/c/sci_fadj2sp.c
new file mode 100755
index 000000000..eace3173d
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_fadj2sp.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intfadj2sp)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_fadj2sp(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intfadj2sp)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_full.c b/modules/sparse/sci_gateway/c/sci_full.c
new file mode 100755
index 000000000..95a5551c9
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_full.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intfull)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_full(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intfull)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_inpnvi.c b/modules/sparse/sci_gateway/c/sci_inpnvi.c
new file mode 100755
index 000000000..44c119dd6
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_inpnvi.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intinpnvi)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_inpnvi(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intinpnvi)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_ludel.c b/modules/sparse/sci_gateway/c/sci_ludel.c
new file mode 100755
index 000000000..91ebdb0bc
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_ludel.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intludel)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_ludel(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intludel)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_lufact.c b/modules/sparse/sci_gateway/c/sci_lufact.c
new file mode 100755
index 000000000..41bfeb39d
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_lufact.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+#include "machine.h"
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intlufact)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_lufact(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intlufact)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_luget.c b/modules/sparse/sci_gateway/c/sci_luget.c
new file mode 100755
index 000000000..cb6fb14bd
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_luget.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intluget)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_luget(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intluget)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_lusolve.c b/modules/sparse/sci_gateway/c/sci_lusolve.c
new file mode 100755
index 000000000..b0b9e1251
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_lusolve.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intlusolve)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_lusolve(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intlusolve)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_mfull.c b/modules/sparse/sci_gateway/c/sci_mfull.c
new file mode 100755
index 000000000..571f5c9eb
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_mfull.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intmfull)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_mfull(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intmfull)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_msparse.c b/modules/sparse/sci_gateway/c/sci_msparse.c
new file mode 100755
index 000000000..da7639d8e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_msparse.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intmsparse)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_msparse(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intmsparse)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_mspget.c b/modules/sparse/sci_gateway/c/sci_mspget.c
new file mode 100755
index 000000000..7772bccb8
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_mspget.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intmspget)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_mspget(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intmspget)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_nnz.c b/modules/sparse/sci_gateway/c/sci_nnz.c
new file mode 100755
index 000000000..64ea92398
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_nnz.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intnnz)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_nnz(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intnnz)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_ordmmd.c b/modules/sparse/sci_gateway/c/sci_ordmmd.c
new file mode 100755
index 000000000..a99dd89bd
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_ordmmd.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intordmmd)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_ordmmd(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intordmmd)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_sfinit.c b/modules/sparse/sci_gateway/c/sci_sfinit.c
new file mode 100755
index 000000000..0c05da5d0
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_sfinit.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intsfinit)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_sfinit(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intsfinit)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_sparse.c b/modules/sparse/sci_gateway/c/sci_sparse.c
new file mode 100755
index 000000000..32287267d
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_sparse.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intsparse)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_sparsefunc(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intsparse)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_spchol.c b/modules/sparse/sci_gateway/c/sci_spchol.c
new file mode 100755
index 000000000..133a8a1a4
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_spchol.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intspchol)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_spchol(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intspchol)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_spclean.c b/modules/sparse/sci_gateway/c/sci_spclean.c
new file mode 100755
index 000000000..d42b8b2db
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_spclean.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intspclean)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_spclean(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intspclean)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_spcompa.c b/modules/sparse/sci_gateway/c/sci_spcompa.c
new file mode 100755
index 000000000..e8f9bd30e
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_spcompa.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intspcompa)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_spcompa(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intspcompa)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_spget.c b/modules/sparse/sci_gateway/c/sci_spget.c
new file mode 100755
index 000000000..a0a19e0f6
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_spget.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intspget)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_spget(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intspget)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_spmatrix.c b/modules/sparse/sci_gateway/c/sci_spmatrix.c
new file mode 100755
index 000000000..0539af830
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_spmatrix.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intspmatrix)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_spmatrix(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intspmatrix)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/c/sci_symfcti.c b/modules/sparse/sci_gateway/c/sci_symfcti.c
new file mode 100755
index 000000000..7b441e173
--- /dev/null
+++ b/modules/sparse/sci_gateway/c/sci_symfcti.c
@@ -0,0 +1,23 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "gw_sparse.h"
+/*--------------------------------------------------------------------------*/
+extern int C2F(intsymfcti)(int *id);
+/*--------------------------------------------------------------------------*/
+int sci_symfcti(char *fname, unsigned long fname_len)
+{
+ static int id[6];
+ C2F(intsymfcti)(id);
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/sparse/sci_gateway/fortran/.deps/.dirstamp b/modules/sparse/sci_gateway/fortran/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.deps/.dirstamp
diff --git a/modules/sparse/sci_gateway/fortran/.dirstamp b/modules/sparse/sci_gateway/fortran/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.dirstamp
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_bfinit.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_bfinit.o
new file mode 100755
index 000000000..e80e03699
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_bfinit.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkfc1i.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkfc1i.o
new file mode 100755
index 000000000..cf0dc69b0
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkfc1i.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkslvi.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkslvi.o
new file mode 100755
index 000000000..00ca9b775
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_blkslvi.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_fadj2sp.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_fadj2sp.o
new file mode 100755
index 000000000..6b7221a9d
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_fadj2sp.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_full.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_full.o
new file mode 100755
index 000000000..300b6eadc
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_full.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_inpnvi.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_inpnvi.o
new file mode 100755
index 000000000..9b4dfe1b3
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_inpnvi.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_ludel.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ludel.o
new file mode 100755
index 000000000..255e8fd8d
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ludel.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_lufact.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_lufact.o
new file mode 100755
index 000000000..fe37540e9
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_lufact.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_luget.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_luget.o
new file mode 100755
index 000000000..f055de7f0
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_luget.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_lusolve.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_lusolve.o
new file mode 100755
index 000000000..792535bf2
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_lusolve.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_nnz.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_nnz.o
new file mode 100755
index 000000000..62e5aad5b
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_nnz.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_ordmmd.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ordmmd.o
new file mode 100755
index 000000000..d5b09a667
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ordmmd.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_sfinit.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_sfinit.o
new file mode 100755
index 000000000..ca65de14e
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_sfinit.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_sparse.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_sparse.o
new file mode 100755
index 000000000..6639e8a7a
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_sparse.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_spchol.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spchol.o
new file mode 100755
index 000000000..ca193cdff
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spchol.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_spclean.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spclean.o
new file mode 100755
index 000000000..ff5e56afd
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spclean.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_spcompa.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spcompa.o
new file mode 100755
index 000000000..05bd914d3
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spcompa.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_spget.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spget.o
new file mode 100755
index 000000000..bf5559f16
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spget.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_spmatrix.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spmatrix.o
new file mode 100755
index 000000000..89425cb45
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_spmatrix.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_symfcti.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_symfcti.o
new file mode 100755
index 000000000..b2c6c8bd9
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_symfcti.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/sci_f_ta2lpd.o b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ta2lpd.o
new file mode 100755
index 000000000..bc7dae379
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/sci_f_ta2lpd.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/.libs/spops.o b/modules/sparse/sci_gateway/fortran/.libs/spops.o
new file mode 100755
index 000000000..821094475
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/.libs/spops.o
Binary files differ
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_bfinit.f b/modules/sparse/sci_gateway/fortran/sci_f_bfinit.f
new file mode 100755
index 000000000..81f75aa72
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_bfinit.f
@@ -0,0 +1,76 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function bfinit
+ subroutine intbfinit(id)
+ logical getrhsvar, createvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=7
+ maxrhs=7
+ minlhs=2
+ maxlhs=2
+c
+
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'i', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'i', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'i', m7, n7, l7)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+ k=maxrhs+1
+ if(.not.createvar(k ,'i',1,1,l8)) return
+ if(.not.createvar(k+1,'i',istk(l1),1,l9)) return
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call bfinit(istk(l1),istk(l2),istk(l3),istk(l4),
+ $ istk(l5),istk(l6),istk(l7),istk(l8),istk(l9))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 8
+ lhsvar( 2)= 9
+
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_bfinit.lo b/modules/sparse/sci_gateway/fortran/sci_f_bfinit.lo
new file mode 100755
index 000000000..d49c8ac27
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_bfinit.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_bfinit.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_bfinit.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.f b/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.f
new file mode 100755
index 000000000..b182293dc
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.f
@@ -0,0 +1,82 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function blkfc1i
+ subroutine intblkfc1i(id)
+ logical getrhsvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=15
+ maxrhs=15
+ minlhs=2
+ maxlhs=2
+c
+
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'i', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'i', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'i', m7, n7, l7)) return
+ if(.not.getrhsvar( 8,'i', m8, n8, l8)) return
+ if(.not.getrhsvar( 9,'d', m9, n9, l9)) return
+ if(.not.getrhsvar(10,'i',m10,n10,l10)) return
+ if(.not.getrhsvar(11,'i',m11,n11,l11)) return
+ if(.not.getrhsvar(12,'i',m12,n12,l12)) return
+ if(.not.getrhsvar(13,'d',m10,n13,l13)) return
+ if(.not.getrhsvar(14,'i',m11,n14,l14)) return
+ if(.not.getrhsvar(15,'i',m12,n15,l15)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call blkfc1(istk(l1),istk(l2),istk(l3) ,istk(l4),
+ $ istk( l5),istk( l6),istk( l7),istk( l8), stk(l9),
+ $ istk(l10),istk(l11),istk(l12), stk(l13),
+ $ istk(l14),istk(l15))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 9
+ lhsvar( 2)= 14
+
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.lo b/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.lo
new file mode 100755
index 000000000..550ac7cf8
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_blkfc1i.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_blkfc1i.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_blkfc1i.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.f b/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.f
new file mode 100755
index 000000000..1e404ed87
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.f
@@ -0,0 +1,70 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function blkslvi
+ subroutine intblkslvi(id)
+ logical getrhsvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=7
+ maxrhs=7
+ minlhs=1
+ maxlhs=1
+c
+
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'i', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'d', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'d', m7, n7, l7)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call blkslv(istk(l1),istk(l2),istk(l3),istk(l4),
+ $ istk(l5),stk(l6),stk(l7))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 7
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.lo b/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.lo
new file mode 100755
index 000000000..6af6edb88
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_blkslvi.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_blkslvi.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_blkslvi.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.f b/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.f
new file mode 100755
index 000000000..228d7223f
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.f
@@ -0,0 +1,65 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intfadj2sp(id)
+ include 'stack.h'
+c**********************************************************
+ logical getrhsvar, createvar, putlhsvar
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=3
+ maxrhs=3
+ minlhs=1
+ maxlhs=1
+c
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+ k=maxrhs
+ if(.not.createvar(k+1,'i',istk(l3),1,l4)) return
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call spind(istk(l4),istk(l1),istk(l2),istk(l3))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar(1)=4
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.lo b/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.lo
new file mode 100755
index 000000000..f87b54063
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_fadj2sp.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_fadj2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_fadj2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_full.f b/modules/sparse/sci_gateway/fortran/sci_f_full.f
new file mode 100755
index 000000000..a743aa7e8
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_full.f
@@ -0,0 +1,106 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intfull(id)
+ include 'stack.h'
+ integer id(nsiz),top0
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ lw = lstk(top+1)
+ if (rhs .ne. 1) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 1) then
+ call error(41)
+ return
+ endif
+ il=iadr(lstk(top))
+ if(istk(il).eq.1.or.istk(il).eq.2.or.istk(il).eq.4) return
+ if(istk(il).ne.5.and.istk(il).ne.6) then
+ call funnam(ids(1,pt+1),'full',iadr(lstk(top)))
+ fun=-1
+ return
+ endif
+ nel=istk(il+4)
+ m=istk(il+1)
+ n=istk(il+2)
+ it=istk(il+3)
+
+* take care of the fact that m*n*(1+it) may be too big for
+* integer arithmetic (and then can lead to stack corruption)
+* (added by Bruno trapping the m x n problems ...)
+* A solution is to do the following test:
+* if ( dble( m*n*(1+it) ) .ne. dble(m)*dble(n)*dble(1+it) ) then
+* raise an error
+*
+* but further computations may also be corrupted for instance
+* sadr(il+4)+m*n*(it+1) ... (m*n*(1+it) may be just good in
+* integer arithmetic but then adding with sadr(il+4) may
+* produce an integer overflow.
+*
+* So a safer test is to limit to m*n <= 30000 x 30000 which
+* represent in full format a very big matrix (7.2 Go in double
+* precision) together with enough security for the other computations
+* 30000 x 30000 = 900 000 000 < 2 147 483 647 = 2^31-1
+*
+ if ( dble(m)*dble(n) .gt. 900000000 ) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+
+ ilr=il+5
+ ilc=ilr+m
+ if(istk(il).eq.5) then
+c matrix of scalar
+ l=sadr(ilc+nel)
+ ils=iadr(max(sadr(il+4)+m*n*(it+1),lw))
+ ls=sadr(ils+m+nel)
+ lw=ls+nel*(it+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call icopy(m+nel,istk(ilr),1,istk(ils),1)
+ call unsfdcopy(nel*(it+1),stk(l),1,stk(ls),1)
+ istk(il)=1
+ l=sadr(il+4)
+ if(it.eq.0) then
+ call dspful(m,n,stk(ls),nel,istk(ils),stk(l))
+ else
+ call wspful(m,n,stk(ls),stk(ls+nel),nel,istk(ils),
+ $ stk(l),stk(l+m*n))
+ endif
+ lstk(top+1)=l+m*n*(it+1)
+ else
+c matrix of boolean
+ ils=max(il+3+m*n,iadr(lw))
+ lw=sadr(ils+m+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call icopy(m+nel,istk(ilr),1,istk(ils),1)
+ istk(il)=4
+ l=il+3
+ call lspful(m,n,nel,istk(ils),istk(l))
+ lstk(top+1)=sadr(l+m*n)
+ endif
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_full.lo b/modules/sparse/sci_gateway/fortran/sci_f_full.lo
new file mode 100755
index 000000000..f006088fc
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_full.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_full.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_full.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.f b/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.f
new file mode 100755
index 000000000..1ea73311e
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.f
@@ -0,0 +1,77 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function inpnvi
+ subroutine intinpnvi(id)
+ logical getrhsvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=13
+ maxrhs=13
+ minlhs=1
+ maxlhs=1
+c
+
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'d', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'i', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'i', m7, n7, l7)) return
+ if(.not.getrhsvar( 8,'i', m8, n8, l8)) return
+ if(.not.getrhsvar( 9,'i', m9, n9, l9)) return
+ if(.not.getrhsvar(10,'i',m10,n10,l10)) return
+ if(.not.getrhsvar(11,'i',m11,n11,l11)) return
+ if(.not.getrhsvar(12,'d',m12,n12,l12)) return
+ if(.not.getrhsvar(13,'i',m13,n13,l13)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call inpnv(istk(l1),istk(l2),istk(l3),stk(l4),
+ $ istk(l5) ,istk(l6) ,istk(l7) ,istk(l8),istk(l9),
+ $ istk(l10),istk(l11), stk(l12),istk(l13))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 12
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.lo b/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.lo
new file mode 100755
index 000000000..7085ca673
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_inpnvi.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_inpnvi.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_inpnvi.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ludel.f b/modules/sparse/sci_gateway/fortran/sci_f_ludel.f
new file mode 100755
index 000000000..08bbd3bd5
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ludel.f
@@ -0,0 +1,58 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intludel(id)
+ include 'stack.h'
+ integer id(nsiz),top0,hand
+ integer iadr, sadr
+
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+ if (rhs .ne. 1) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 1) then
+ call error(41)
+ return
+ endif
+c checking variable fmat (number 1)
+c
+ il1 = iadr(lstk(top-rhs+1))
+
+ if (istk(il1) .ne. 128) then
+ err=1
+ call error(218)
+ return
+ endif
+ l1 = sadr(il1+4)
+ hand=stk(l1)
+ call ludel1(hand,ierr)
+ if (ierr.ne.0) then
+ err=1
+ call error(247)
+ return
+ endif
+
+ if (err .gt. 0) return
+c
+ top=top-rhs
+c no output variable
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=0
+ lstk(top+1)=lstk(top)+1
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ludel.lo b/modules/sparse/sci_gateway/fortran/sci_f_ludel.lo
new file mode 100755
index 000000000..526e3d846
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ludel.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_ludel.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_ludel.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_lufact.f b/modules/sparse/sci_gateway/fortran/sci_f_lufact.f
new file mode 100755
index 000000000..1b6e370b7
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_lufact.f
@@ -0,0 +1,126 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intlufact(id)
+ include 'stack.h'
+ double precision abstol,reltol
+ integer id(nsiz),top0,tops,rhss,fmatindex
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+ tops=top
+ rhss=rhs
+
+ if (rhs .ne. 1.and.rhs .ne. 2) then
+ call error(39)
+ return
+ endif
+ if (lhs .gt. 2) then
+ call error(41)
+ return
+ endif
+ abstol=stk(leps)
+ reltol=0.001d0
+ if(rhs.eq.2) then
+c checking variable tol (number 2)
+ il=iadr(lstk(top))
+ if (istk(il) .ne. 1) then
+ err = 1
+ call error(53)
+ return
+ endif
+ l=sadr(il+4)
+ if (istk(il+2)*istk(il+1).eq.1) then
+ abstol=stk(l)
+ elseif (istk(il+2)*istk(il+1).eq.2) then
+ abstol=stk(l)
+ reltol=stk(l+1)
+ else
+ err = 1
+ call error(89)
+ return
+ endif
+ top=top-1
+ rhs=rhs-1
+ endif
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+c
+c checking variable sp (number 1)
+c
+ il1 = iadr(lstk(top))
+ if (istk(il1) .ne. 5) then
+ call funnam(ids(1,pt+1),'lufact',iadr(lstk(top)))
+ fun=-1
+ top=tops
+ rhs=rhss
+ return
+ endif
+ m=istk(il1+1)
+ n=istk(il1+2)
+ if(m.ne.n) then
+ err=1
+ call error(20)
+ return
+ endif
+ it=istk(il1+3)
+ nel=istk(il1+4)
+ l=sadr(il1+5+m+nel)
+ if(it.ne.0) then
+ err=1
+ call error(52)
+ return
+ endif
+
+
+ mx=max(m,n)
+ call lufact1(stk(l),istk(il1+5),istk(il1+5+m),mx,nel,
+ $ fmatindex,abstol,reltol,nrank,ierr)
+ if(ierr.gt.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+c
+ top=top-rhs
+c
+c output variable: fmat
+c
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=128
+ istk(il+1)=m
+ istk(il+2)=n
+ istk(il+3)=it
+ l=sadr(il+4)
+ stk(l)=fmatindex
+ lstk(top+1)=l+1
+c
+ if(lhs .eq.2) then
+c
+c output variable: rank
+c
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=1
+ istk(il+2)=1
+ istk(il+3)=0
+ l=sadr(il+4)
+ stk(l)=nrank
+ lstk(top+1)=l+1
+ endif
+ return
+ end
+
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_lufact.lo b/modules/sparse/sci_gateway/fortran/sci_f_lufact.lo
new file mode 100755
index 000000000..8cbfe4395
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_lufact.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_lufact.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_lufact.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_luget.f b/modules/sparse/sci_gateway/fortran/sci_f_luget.f
new file mode 100755
index 000000000..73866d427
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_luget.f
@@ -0,0 +1,111 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intluget(id)
+ include 'stack.h'
+ integer id(nsiz),top0,ptr
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+ if (rhs .ne. 1) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 4) then
+ call error(41)
+ return
+ endif
+c checking variable fmat (number 1)
+c
+ il1 = iadr(lstk(top-rhs+1))
+ if (istk(il1) .ne. 128) then
+ err=1
+ call error(218)
+ return
+ endif
+ m=istk(il1+1)
+ n=istk(il1+2)
+ it1=istk(il1+3)
+ l1 = sadr(il1+4)
+ ptr=stk(l1)
+ call lusiz1(ptr,nl,nu,ierr)
+ if (ierr.ne.0) then
+ err=1
+ call error(247)
+ return
+ endif
+ ilp=il1
+ lp=sadr(ilp+5+m+m)
+ lw=lp+m*(it1+1)
+ lstk(top+1)=lw
+c
+ top=top+1
+ ill=iadr(lstk(top))
+ ll=sadr(ill+5+m+nl)
+ lw=ll+nl*(it1+1)
+ lstk(top+1)=lw
+c
+ top=top+1
+ ilu=iadr(lstk(top))
+ lu=sadr(ilu+5+n+nu)
+ lw=lu+nu*(it1+1)
+ lstk(top+1)=lw
+c
+ top=top+1
+ ilq=iadr(lstk(top))
+ lq=sadr(ilq+5+n+n)
+ lw=lq+n*(it1+1)
+ lstk(top+1)=lw
+c
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ istk(ilp)=5
+ istk(ilp+1)=n
+ istk(ilp+2)=n
+ istk(ilp+3)=it1
+ istk(ilp+4)=n
+c
+ istk(ill)=5
+ istk(ill+1)=n
+ istk(ill+2)=n
+ istk(ill+3)=it1
+ istk(ill+4)=nl
+c
+ istk(ilu)=5
+ istk(ilu+1)=n
+ istk(ilu+2)=n
+ istk(ilu+3)=it1
+ istk(ilu+4)=nu
+c
+ istk(ilq)=5
+ istk(ilq+1)=n
+ istk(ilq+2)=n
+ istk(ilq+3)=it1
+ istk(ilq+4)=n
+c
+ call luget1(ptr,istk(ilp+5),stk(lp),istk(ill+5),stk(ll),
+ $ istk(ilu+5),stk(lu),istk(ilq+5),stk(lq),ierr)
+ if (ierr.ne.0) then
+ err=1
+ call error(247)
+ return
+ endif
+ return
+ end
+c ======================================
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_luget.lo b/modules/sparse/sci_gateway/fortran/sci_f_luget.lo
new file mode 100755
index 000000000..ccdf6eef4
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_luget.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_luget.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_luget.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_lusolve.f b/modules/sparse/sci_gateway/fortran/sci_f_lusolve.f
new file mode 100755
index 000000000..670b689f6
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_lusolve.f
@@ -0,0 +1,149 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intlusolve(id)
+ include 'stack.h'
+ double precision abstol,reltol
+ integer id(nsiz),top0,hand
+ integer iadr, sadr
+ logical fact
+
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+ if (rhs .ne. 2) then
+ call error(39)
+ return
+ endif
+ if (lhs .gt. 1) then
+ call error(41)
+ return
+ endif
+c checking variable fmat (number 1)
+c
+ il1 = iadr(lstk(top-rhs+1))
+ if (istk(il1) .eq. 128) then
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+ l1 = sadr(il1+4)
+ hand=stk(l1)
+ fact=.true.
+ elseif(istk(il1) .eq. 5) then
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+ if(m1.ne.n1) then
+ err=1
+ call error(20)
+ return
+ endif
+ it1=istk(il1+3)
+ nel1=istk(il1+4)
+ l1=sadr(il1+5+m1+nel1)
+ if(it1.ne.0) then
+ call error(220)
+ return
+ endif
+c
+ abstol=stk(leps)
+ reltol=0.001d0
+ mx=max(m1,n1)
+ call lufact1(stk(l1),istk(il1+5),istk(il1+5+m1),mx,nel1,
+ $ hand,abstol,reltol,nrank,ierr)
+ if(ierr.gt.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+c if(nrank.ne.m1) then
+c call ludel1(hand)
+c call error(19)
+c return
+c endif
+ fact=.false.
+ else
+ call funnam(ids(1,pt+1),'lusolve',iadr(lstk(top-rhs+1)))
+ fun=-1
+ return
+ endif
+c checking variable b (number 2)
+c
+ il2 = iadr(lstk(top-rhs+2))
+ if (istk(il2) .ne. 1.and.istk(il2) .ne. 5) then
+ call funnam(ids(1,pt+1),'lusolve',iadr(lstk(top-rhs+2)))
+ fun=-1
+ endif
+ m2 = istk(il2+1)
+ n2 = istk(il2+2)
+ it2 = istk(il2+3)
+ if(m2.ne.m1) then
+ call error(60)
+ return
+ endif
+ l2 = sadr(il2+4)
+ l2i=l2+m2*n2
+c
+ if(istk(il2).eq.1) then
+c b is full
+ lw3=lw
+ lw3i=lw3+m2*n2
+ lw=lw+m2*n2*(it2+1)
+ err=lw-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+c
+ do 40 j=0,n2-1
+ call lusolve1(hand,stk(l2+j*m2),stk(lw3+j*m2),ierr)
+ if(it2.eq.1) then
+ call lusolve1(hand,stk(l2i+j*m2),stk(lw3i+j*m2),ierr)
+ endif
+ if (ierr.ne.0) then
+ err=1
+ call error(247)
+ return
+ endif
+ if (err .gt. 0) return
+ 40 continue
+
+ if(.not.fact) call ludel1(hand,ierr)
+c
+ top=top-rhs
+ lw0=lw
+ mv=lw0-l0
+c
+c output variable: x
+c
+ top=top+1
+ il=iadr(lstk(top))
+ l=sadr(il+4)
+ err=l+m2*(it2+1)-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+ istk(il)=1
+ istk(il+1)=m2
+ istk(il+2)=n2
+ istk(il+3)=it2
+ call unsfdcopy(m2*n2*(it2+1),stk(lw3),1,stk(l),1)
+ lstk(top+1)=l+m2*n2*(it2+1)
+ else
+c b is sparse
+ call error(222)
+ return
+ endif
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_lusolve.lo b/modules/sparse/sci_gateway/fortran/sci_f_lusolve.lo
new file mode 100755
index 000000000..1ec888436
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_lusolve.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_lusolve.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_lusolve.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_nnz.f b/modules/sparse/sci_gateway/fortran/sci_f_nnz.f
new file mode 100755
index 000000000..47e0f0fbf
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_nnz.f
@@ -0,0 +1,71 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intnnz(id)
+ include 'stack.h'
+ integer id(nsiz),top0
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ if (rhs .ne. 1) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 1) then
+ call error(41)
+ return
+ endif
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+c
+c checking variable sp (number 1)
+c
+ il1 = iadr(lstk(top))
+ if (istk(il1) .eq. 5) then
+ m=istk(il1+1)
+ n=istk(il1+2)
+ it=istk(il1+3)
+ nel=istk(il1+4)
+ elseif (istk(il1) .eq. 1) then
+ m=istk(il1+1)
+ n=istk(il1+2)
+ it=istk(il1+3)
+ l=sadr(il1+4)
+ nel=0
+ if(it.eq.0) then
+ do 50 i=0,m*n-1
+ if(stk(l+i).ne.0.0d0) nel=nel+1
+ 50 continue
+ else
+ li=l+m*n
+ do 51 i=0,m*n-1
+ if(abs(stk(l+i))+abs(stk(li+i)).ne.0.0d0) nel=nel+1
+ 51 continue
+ endif
+ else
+ call funnam(ids(1,pt+1),'nnz',iadr(lstk(top)))
+ fun=-1
+ return
+ endif
+ istk(il1)=1
+ istk(il1+1)=1
+ istk(il1+2)=1
+ istk(il1+3)=0
+ l=sadr(il1+4)
+ stk(l)=nel
+ lstk(top+1)=l+1
+ return
+ end
+c ======================================
+
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_nnz.lo b/modules/sparse/sci_gateway/fortran/sci_f_nnz.lo
new file mode 100755
index 000000000..9d6789706
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_nnz.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_nnz.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_nnz.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.f b/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.f
new file mode 100755
index 000000000..0ca470a82
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.f
@@ -0,0 +1,91 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function ordmmd
+ subroutine intordmmd(id)
+c**********************************************************
+ logical getrhsvar, createvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=3
+ maxrhs=3
+ minlhs=3
+ maxlhs=3
+c
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar(1,'i',m1,n1,l1)) return
+ if(.not.getrhsvar(2,'i',m2,n2,l2)) return
+ if(.not.getrhsvar(3,'i',m3,n3,l3)) return
+c*******************************************************
+c 1.1-Verify the input.
+c*******************************************************
+ if(istk(l3).ne.m1-1) then
+ buf = ' The provided "n" does not correspond to the matrix'//
+ + ' defined by xadj and iadj'
+ call error(9999)
+ return
+ endif
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+ k=maxrhs+1
+ if(.not.createvar(k, 'i',istk(l3),1,l4)) return
+ if(.not.createvar(k+1,'i',istk(l3),1,l5)) return
+ if(.not.createvar(k+2,'i',1,1,l6)) return
+ if(.not.createvar(k+3,'i',4*istk(l3),1,l7)) return
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call ordmmd(istk(l3),istk(l1),istk(l2),istk(l5),
+ $ istk(l4),4*istk(l3),istk(l7),istk(l6),iflag)
+
+c******************************************************
+c 4-Display error message(s)
+c******************************************************
+ if(iflag .NE. 0) then
+ buf = ' insufficient working storage'
+ call error(9999)
+ return
+ endif
+c
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar(1)=4
+ lhsvar(2)=5
+ lhsvar(3)=6
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.lo b/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.lo
new file mode 100755
index 000000000..64b145cfd
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ordmmd.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_ordmmd.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_ordmmd.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_sfinit.f b/modules/sparse/sci_gateway/fortran/sci_f_sfinit.f
new file mode 100755
index 000000000..09d96e975
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_sfinit.f
@@ -0,0 +1,91 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c SCILAB function sfinit
+ subroutine intsfinit(id)
+ logical getrhsvar, createvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=8
+ maxrhs=8
+ minlhs=9
+ maxlhs=9
+c
+c
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'i', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'i', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'i', m7, n7, l7)) return
+ if(.not.getrhsvar( 8,'i', m8, n8, l8)) return
+**************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+ k=maxrhs+1
+ if(.not.createvar(k ,'i',istk(l1),1,l9)) return
+ if(.not.createvar(k+1,'i',1,1,l10)) return
+ if(.not.createvar(k+2,'i',1,1,l11)) return
+ if(.not.createvar(k+3,'i',1,1,l12)) return
+ if(.not.createvar(k+4,'i',istk(l1),1,l13)) return
+ if(.not.createvar(k+5,'i',istk(l1)+1,1,l14)) return
+ if(.not.createvar(k+6,'i',1,1,l15)) return
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call sfinit(istk(l1),istk(l2),istk(l3) ,istk(l4),
+ $ istk(l5), istk(l6) ,istk(l9) ,istk(l10),istk(l11),
+ $ istk(l12),istk(l13),istk(l14),
+ $ istk(l7), istk(l8) ,istk(l15))
+
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 5
+ lhsvar( 2)= 6
+ lhsvar( 3)= 9
+ lhsvar( 4)= 10
+ lhsvar( 5)= 11
+ lhsvar( 6)= 12
+ lhsvar( 7)= 13
+ lhsvar( 8)= 14
+ lhsvar( 9)= 15
+
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_sfinit.lo b/modules/sparse/sci_gateway/fortran/sci_f_sfinit.lo
new file mode 100755
index 000000000..08a338b2e
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_sfinit.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_sfinit.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_sfinit.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_sparse.f b/modules/sparse/sci_gateway/fortran/sci_f_sparse.f
new file mode 100755
index 000000000..6172a4fe8
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_sparse.f
@@ -0,0 +1,275 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intsparse(id)
+ include 'stack.h'
+ integer id(nsiz),top0,tops
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+c
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+ tops=top
+c
+ lw = lstk(top+1)
+ if (lhs .ne. 1) then
+ call error(41)
+ return
+ endif
+c creation de matrice creuse
+ if(rhs.eq.1) then
+c sparse(x)
+ il=iadr(lstk(top))
+ if(istk(il).eq.5.or.istk(il).eq.6) return
+ m=istk(il+1)
+ n=istk(il+2)
+ if(m*n.eq.0.or.m.eq.-1) return
+ if(istk(il).eq.1) then
+ it=istk(il+3)
+ l=sadr(il+4)
+c
+ ilr=iadr(lw)
+ lw=sadr(ilr+m+m*n)
+
+ ls=lw
+ li=ls+m*n
+ lw=ls+m*n*(it+1)
+
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(it.eq.0) then
+ call dful2sp(m,n,stk(l),nel,istk(ilr),stk(ls),0.0d0)
+ else
+ call wful2sp(m,n,stk(l),stk(l+m*n),nel,
+ $ istk(ilr),stk(ls),stk(li),0.0d0,0.0d0)
+ endif
+ call icopy(m+nel,istk(ilr),1,istk(il+5),1)
+ l=sadr(il+5+m+nel)
+ call unsfdcopy(nel,stk(ls),1,stk(l),1)
+ if(it.eq.1) call unsfdcopy(nel,stk(li),1,stk(l+nel),1)
+ istk(il)=5
+ istk(il+4)=nel
+ lstk(top+1)=l+nel*(it+1)
+ elseif(istk(il).eq.4) then
+ l=il+3
+ ilr=iadr(lw)
+ lw=sadr(ilr+m*n)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call lful2sp(m,n,istk(l),nel,istk(ilr))
+ call icopy(m+nel,istk(ilr),1,istk(il+5),1)
+ l=sadr(il+5+m+nel)
+ istk(il)=6
+ istk(il+3)=0
+ istk(il+4)=nel
+ lstk(top+1)=l
+ else
+ call funnam(ids(1,pt+1),'sparse',iadr(lstk(top)))
+ fun=-1
+ return
+ endif
+ return
+ endif
+c
+c sparse([i,j],value,[m,n])
+ if (rhs .ne. 3.and.rhs.ne.2) then
+ call error(39)
+ return
+ endif
+ m=-1
+ n=-1
+ if(rhs.eq.3) then
+c [m,n] given
+ il=iadr(lstk(top))
+ if(istk(il).ne.1.or.istk(il+3).ne.0) then
+ err=1
+ call error(52)
+ return
+ endif
+ if(istk(il+1)*istk(il+2).ne.2) then
+ err=1
+ call error(60)
+ return
+ endif
+ l=sadr(il+4)
+ m=stk(l)
+ n=stk(l+1)
+ if(m.lt.0.or.n.lt.0) then
+ call error(60)
+ return
+ endif
+ if (m.eq.0 .or. n.eq.0) then ! m*n correction (Bruno)
+ top=top0
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=0
+ istk(il+2)=0
+ istk(il+3)=0
+ lstk(top+1)=sadr(il+4)+1
+ return
+ endif
+ top=top-1
+ lw=lstk(top+1)
+ endif
+
+ ilij=iadr(lstk(top-1))
+ if(istk(ilij).ne.1.or.istk(ilij+3).ne.0) then
+ err=2
+ call error(52)
+ return
+ endif
+ if(istk(ilij+1).ne.0.and.istk(ilij+2).ne.2) then
+ err=2
+ call error(60)
+ return
+ endif
+ nel=istk(ilij+1)*istk(ilij+2)/2
+ lij=sadr(ilij+4)
+ ilij=iadr(lij)
+ if(nel.gt.0) then
+ call entier(nel*2,stk(lij),istk(ilij))
+ endif
+c test if indices are all strictly positive
+ do 05 i=0,2*nel-1
+ if (istk(ilij+i).le.0) then
+ call error(21)
+ return
+ endif
+ 05 continue
+
+c compute number of rows if is not given
+ if(rhs.eq.2) then
+ mm=0
+ do 10 i=0,nel-1
+ mm=max(mm,istk(ilij+i))
+ 10 continue
+ else
+ mm=m
+ endif
+c
+ ilv=iadr(lstk(top))
+ if(istk(ilv).ne.1.and.istk(ilv).ne.4) then
+ call funnam(ids(1,pt+1),'sparse',iadr(lstk(top)))
+ fun=-1
+ top=tops
+ return
+ endif
+ if(istk(ilv+1)*istk(ilv+2).ne.nel) then
+ err=2
+ call error(60)
+ return
+ endif
+ il1=ilij
+ if(istk(ilv).eq.1) then
+ itv=istk(ilv+3)
+ lv=sadr(ilv+4)
+ lind=iadr(max(lw,sadr(il1+5+mm+nel)+nel*(itv+1)))
+ liw=lind+mm+nel
+ lw=sadr(liw+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel0=nel
+ if(itv.eq.0) then
+ call dij2sp(m,n,nel,istk(ilij),stk(lv),
+ $ istk(lind),mm+nel0,istk(liw),ierr)
+ else
+ call wij2sp(m,n,nel,istk(ilij),stk(lv),stk(lv+nel0),
+ $ istk(lind),mm+nel0,istk(liw),ierr)
+ endif
+ if(ierr.eq.2) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ elseif(ierr.eq.1) then
+ call error(42)
+ return
+ elseif(ierr.eq.3) then
+ call error(221)
+ return
+ endif
+ top=top-1
+ il1=iadr(lstk(top))
+ istk(il1)=5
+ istk(il1+1)=m
+ istk(il1+2)=n
+ istk(il1+3)=itv
+ istk(il1+4)=nel
+ ilr=il1+5
+ l=sadr(ilr+m+nel)
+ inc=1
+ if(l.gt.lv) then
+ inc=-1
+ if(itv.eq.1) then
+ call unsfdcopy(nel,stk(lv+nel0),inc,stk(l+nel),inc)
+ endif
+ call unsfdcopy(nel,stk(lv),inc,stk(l),inc)
+ else
+ inc=1
+ call unsfdcopy(nel,stk(lv),inc,stk(l),inc)
+ if(itv.eq.1) then
+ call unsfdcopy(nel,stk(lv+nel0),inc,stk(l+nel),inc)
+ endif
+ endif
+
+ lstk(top+1)=l+nel*(itv+1)
+ inc=1
+ if(ilr.gt.lind) inc=-1
+ call icopy(m+nel,istk(lind),inc,istk(ilr),inc)
+ else
+ lv=ilv+3
+ lind=iadr(max(lw,sadr(il1+5+mm+nel)))
+ liw=lind+mm+nel
+ lw=sadr(liw+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel0=nel
+ call lij2sp(m,n,nel,istk(ilij),istk(lv),
+ $ istk(lind),mm+nel,istk(liw),ierr)
+ if(ierr.eq.2) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ elseif(ierr.eq.1) then
+ call error(42)
+ return
+ elseif(ierr.eq.3) then
+ call error(221)
+ return
+ endif
+ top=top-1
+ il1=iadr(lstk(top))
+ istk(il1)=6
+ istk(il1+1)=m
+ istk(il1+2)=n
+ istk(il1+3)=0
+ istk(il1+4)=nel
+ ilr=il1+5
+ l=sadr(ilr+m+nel)
+ lstk(top+1)=l
+ inc=1
+ if(ilr.gt.lind) inc=-1
+ call icopy(m+nel,istk(lind),inc,istk(ilr),inc)
+ endif
+ return
+ end
+
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_sparse.lo b/modules/sparse/sci_gateway/fortran/sci_f_sparse.lo
new file mode 100755
index 000000000..a0a1c7e0f
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_sparse.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_sparse.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_sparse.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spchol.f b/modules/sparse/sci_gateway/fortran/sci_f_spchol.f
new file mode 100755
index 000000000..05af410a4
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spchol.f
@@ -0,0 +1,178 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intspchol(id)
+c
+ include 'stack.h'
+ integer id(nsiz)
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+
+ lw = lstk(top+1)
+ l0= lstk(top+1-rhs)
+ if (rhs .ne.1) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 2) then
+ call error(41)
+ return
+ endif
+ il=iadr(lstk(top))
+ ityp=istk(il)
+ if(ityp.ne.5.and.ityp.ne.6) then
+ err=1
+ call error(217)
+ return
+ endif
+ nel=istk(il+4)
+ m=istk(il+1)
+ n=istk(il+2)
+ if (m.ne.n) then
+ call error(20)
+ return
+ endif
+ it=istk(il+3)
+ if (it.ne.0) then
+ err=1
+ call error(52)
+ return
+ endif
+ iinda=il+5
+ ia=sadr(iinda+nel+n)
+ ixadjf=iadr(ia+nel)
+ iperm=ixadjf+n+1
+ iinvp=iperm+n
+ icolcnt=iinvp+n
+ isnode=icolcnt+n
+ ixadj=isnode+n
+ iadjncy=ixadj+n+1
+ ixsuper=iadjncy+nel-n
+ iiwork=ixsuper+n+1
+ iindlnz=iiwork+7*n+3
+ ilnz=sadr(iindlnz+n+nel)
+ idiag=ilnz+nel
+ err = idiag+n-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+ call spcho1(n,stk(ia),nel,istk(iinda),istk(ixadjf),istk(iperm),
+ & istk(iinvp),istk(icolcnt),istk(isnode),nnzl,nsub,nsuper,
+ & istk(ixsuper),istk(iiwork),istk(ixadj),istk(iadjncy),
+ & istk(iindlnz), stk(ilnz),stk(idiag),ierr)
+C
+ if (ierr .eq. 1) then
+ call error(29)
+ if(n.le.0) then
+ call blkslv(0,0,0,0,0,0.d0,0.d0)
+ endif
+ return
+ endif
+ iwsiz=nsuper+2*n+1
+C************************************************************************
+ iiwork=ixsuper+nsuper+1
+ ixlindx=iiwork+2*nsuper+2*n+1
+ ilindx=ixlindx+nsuper+1
+ ixlnz=ilindx+nsub
+ ilnz=sadr(ixlnz+n+1)
+ isplit=iadr(ilnz+nnzl)
+ itmpvec=sadr(isplit+n)
+ CALL SYMFCT (N,nel-n,istk(iXADJ),istk(iADJNCY), istk(iPERM),
+ & istk(iINVP),istk(iCOLCNT),NSUPER,istk(iXSUPER),istk(iSNODE),
+ & nsub , istk(iXLINDX), istk(iLINDX),istk(iXLNZ),nsuper+2*n+1,
+ & istk(iiwork) , IFLAG )
+C
+ CALL BFINIT ( n , NSUPER,istk(iXSUPER),istk(iSNODE) ,
+ & istk(iXLINDX),istk(iLINDX), 16, iTMPSIZ, istk(iSPLIT) )
+c
+ itmpsiz=max(itmpsiz,n)
+ iindlnz=iadr(itmpvec+itmpsiz)
+ err = sadr(iindlnz+n+nnzl)-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+C
+ CALL INPNV (n,istk(iXADJF),istk(iinda+n),stk(ia),istk(iPERM),
+ & istk(iINVP),NSUPER, istk(iXSUPER),istk(iXLINDX),istk(iLINDX),
+ & istk(iXLNZ),stk(iLNZ),istk(iIWORK) )
+C
+ CALL SPCHO2 ( n , NSUPER, istk(iXSUPER),istk(iSNODE) ,
+ & istk(iSPLIT) , istk(iXLINDX), istk(iLINDX) ,istk(iXLNZ) ,
+ & stk(iLNZ) , istk(iIWORK) ,iTMPSIZ,stk(iTMPVEC),
+ & istk(iindlnz),nnzl,nsub)
+ nel=istk(ixlnz+n)-1
+ ia=sadr(iinda+nel+n)
+ ierr=5
+ do 32 i=1,nel
+ if (stk(iLNZ+i-1) .gt. 5.D+63) then
+ ierr=1
+ endif
+ 32 continue
+ if (ierr .eq. 1) then
+ call basout(io,wte,
+ & 'WARNING: Possible not positive definite matrix!')
+ endif
+ call icopy(n,istk(iinvp),1,istk(iindlnz-n),1)
+ if (ia+nel .GE. sadr(ixlnz)) then
+ ixln=iadr(ia+nel)
+ iln=sadr(ixln+n+1)
+ isplit=iadr(iln+nnzl)
+ itmpvec=sadr(isplit+n)
+ iindn=iadr(itmpvec+itmpsiz)
+ do 33 i=1,n+nnzl
+ istk(iindn+n+nnzl-i)=istk(iindlnz+n+nnzl-i)
+ 33 continue
+ iindlnz=iindn
+ do 34 i=1,nnzl
+ stk(iln+nnzl-i)=stk(ilnz+nnzl-i)
+ 34 continue
+ ilnz=iln
+ do 35 i=1,n+1
+ istk(ixln+n+1-i)=istk(ixlnz+n+1-i)
+ 35 continue
+ ixlnz=ixln
+ call icopy(n,istk(iinvp),1,istk(iindlnz-n),1)
+ err = sadr(iindlnz+n+nnzl)-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+ endif
+C
+ call dspt(n,n,stk(ilnz),nel,istk(iindlnz),istk(ixlnz),
+ & stk(ia),istk(isplit),istk(iinda))
+ istk(il+4)=nel
+ top=top+1
+
+ lstk(top)=ia+nel
+ lnl=iadr(ia+nel)
+ istk(lnl)=ityp
+ istk(lnl+1)=n
+ istk(lnl+2)=n
+ istk(lnl+3)=0
+ istk(lnl+4)=n
+ call icopy(n,istk(iindlnz-n),1,istk(lnl+5+n),1)
+ ilp=sadr(lnl+5+2*n)
+ do 70 i=1,n
+ istk(lnl+4+i)=1
+ stk(ilp+i-1)=1.0d0
+ 70 continue
+
+ lstk(top+1)=ilp+n
+c
+ return
+ end
+
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spchol.lo b/modules/sparse/sci_gateway/fortran/sci_f_spchol.lo
new file mode 100755
index 000000000..97dc94611
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spchol.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_spchol.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_spchol.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spclean.f b/modules/sparse/sci_gateway/fortran/sci_f_spclean.f
new file mode 100755
index 000000000..31c749c3a
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spclean.f
@@ -0,0 +1,89 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intspclean(id)
+ include 'stack.h'
+ double precision abstol,reltol
+ integer id(nsiz),top0,tops,rhss
+ integer iadr, sadr
+
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+c
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+ tops=top
+ rhss=rhs
+c
+ abstol=1.0d-10
+ reltol=1.0d-10
+ if(rhs.eq.2) then
+c checking variable tol (number 2)
+ il=iadr(lstk(top))
+ if (istk(il) .ne. 1) then
+ err = 1
+ call error(53)
+ return
+ endif
+ l=sadr(il+4)
+ if (istk(il+2)*istk(il+1).eq.1) then
+ abstol=stk(l)
+ elseif (istk(il+2)*istk(il+1).eq.2) then
+ abstol=stk(l)
+ reltol=stk(l+1)
+ else
+ err = 1
+ call error(89)
+ return
+ endif
+ top=top-1
+ rhs=rhs-1
+ endif
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+c
+c checking variable sp (number 1)
+c
+ il1 = iadr(lstk(top))
+ if (istk(il1) .ne. 5) then
+ call funnam(ids(1,pt+1),'clean',iadr(lstk(top)))
+ fun=-1
+ top=tops
+ rhs=rhss
+ return
+ endif
+ m=istk(il1+1)
+ n=istk(il1+2)
+ it=istk(il1+3)
+ nel=istk(il1+4)
+ l=sadr(il1+5+m+nel)
+ ilind=iadr(lw)
+ lw=sadr(ilind+m+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(it.eq.0) then
+ call dspcle(m,n,stk(l),nel,istk(il1+5),stk(l),nelr,
+ $ istk(ilind),abstol,reltol)
+ else
+ call wspcle(m,n,stk(l),stk(l+nel),nel,istk(il1+5),stk(l),
+ $ stk(l+nel),nelr,istk(ilind),abstol,reltol)
+ endif
+ if(nelr.eq.nel) return
+ call icopy(m+nelr,istk(ilind),1,istk(il1+5),1)
+ l1=sadr(il1+5+m+nelr)
+ call unsfdcopy(nelr,stk(l),1,stk(l1),1)
+ if(it.eq.1) call unsfdcopy(nelr,stk(l+nel),1,stk(l1+nelr),1)
+ istk(il1+4)=nelr
+ lstk(top+1)=l1+nelr*(it+1)
+ return
+ end
+c ======================================
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spclean.lo b/modules/sparse/sci_gateway/fortran/sci_f_spclean.lo
new file mode 100755
index 000000000..c1e692cc0
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spclean.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_spclean.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_spclean.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spcompa.f b/modules/sparse/sci_gateway/fortran/sci_f_spcompa.f
new file mode 100755
index 000000000..6413d7d99
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spcompa.f
@@ -0,0 +1,66 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intspcompa(id)
+c**********************************************************
+ logical getrhsvar, createvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=3
+ maxrhs=3
+ minlhs=1
+ maxlhs=1
+c
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar(1,'i',m1,n1,l1)) return
+ if(.not.getrhsvar(2,'i',m2,n2,l2)) return
+ if(.not.getrhsvar(3,'i',m3,n3,l3)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+ k=maxrhs+1
+ if(.not.createvar(k,'i',istk(l1+m1-1)-1,1,l4)) return
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call spcompack(m1*n1-1,m2*n2-1,m3*n3,istk(l1+m1*n1-1)-1,
+ $ istk(l2),istk(l3),istk(l1),istk(l4))
+
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar(1)=4
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spcompa.lo b/modules/sparse/sci_gateway/fortran/sci_f_spcompa.lo
new file mode 100755
index 000000000..1684c4161
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spcompa.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_spcompa.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_spcompa.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spget.f b/modules/sparse/sci_gateway/fortran/sci_f_spget.f
new file mode 100755
index 000000000..30968f361
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spget.f
@@ -0,0 +1,145 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine intspget(id)
+ include 'stack.h'
+ double precision tv
+ integer id(nsiz),top0
+ integer iadr, sadr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+c
+ rhs = max(0,rhs)
+ top0=top+1-rhs
+
+ lw = lstk(top+1)
+ if (rhs .ne.1) then
+ call error(39)
+ return
+ endif
+ if (lhs .gt. 3) then
+ call error(41)
+ return
+ endif
+ il=iadr(lstk(top))
+ ityp=istk(il)
+ if(ityp.ne.5.and.ityp.ne.6) then
+ call funnam(ids(1,pt+1),'spget',iadr(lstk(top)))
+ fun=-1
+ return
+ endif
+ nel=istk(il+4)
+ m=istk(il+1)
+ n=istk(il+2)
+ it=istk(il+3)
+ ilr=il+5
+ ilc=ilr+m
+ l=sadr(ilc+nel)
+
+ if(nel.eq.0) then
+ istk(il)=1
+ istk(il+1)=0
+ istk(il+2)=0
+ istk(il+3)=0
+ lstk(top+1)=sadr(il+4)
+ if(lhs.ge.2) then
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=0
+ istk(il+2)=0
+ istk(il+3)=0
+ lstk(top+1)=sadr(il+4)
+ endif
+ if(lhs.eq.3) then
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=1
+ istk(il+2)=2
+ istk(il+3)=0
+ l=sadr(il+4)
+ stk(l)=m
+ stk(l+1)=n
+ lstk(top+1)=l+2
+ endif
+ return
+ endif
+ lij=sadr(il+4)
+ ilv=iadr(lij+2*nel)
+ if(ityp.eq.5) then
+ lv=sadr(ilv+4)
+ ilrs=iadr(max(lw,lv+nel*(it+1)))
+ else
+ ilrs=iadr(max(lw,lij+2*nel))
+ endif
+ lw=sadr(ilrs+m+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+c sauvegarde
+ call icopy(m+nel,istk(ilr),1,istk(ilrs),1)
+c constitution des variables de sortie
+ if(ityp.eq.5) then
+ if(l.ge.lv) then
+ call unsfdcopy(nel*(it+1),stk(l),1,stk(lv),1)
+ else
+ call unsfdcopy(nel*(it+1),stk(l),-1,stk(lv),-1)
+ endif
+ endif
+ call int2db(nel,istk(ilrs+m),1,stk(lij+nel),1)
+ i1=0
+ do 30 i=1,m
+ if(istk(ilrs-1+i).ne.0) then
+ tv=i
+ call dset(istk(ilrs-1+i),tv,stk(lij+i1),1)
+ i1=i1+istk(ilrs-1+i)
+ endif
+ 30 continue
+ istk(il)=1
+ istk(il+1)=nel
+ istk(il+2)=2
+ istk(il+3)=0
+ lstk(top+1)=lij+2*nel
+ if(lhs.ge.2) then
+ top=top+1
+ if(ityp.eq.5) then
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=nel
+ istk(il+2)=1
+ istk(il+3)=it
+ lstk(top+1)=lv+nel*(it+1)
+ else
+ il=iadr(lstk(top))
+ istk(il)=4
+ istk(il+1)=nel
+ istk(il+2)=1
+ call iset(nel,1,istk(il+3),1)
+ lstk(top+1)=sadr(il+3+nel)
+ endif
+ endif
+ if(lhs.eq.3) then
+ top=top+1
+ il=iadr(lstk(top))
+ istk(il)=1
+ istk(il+1)=1
+ istk(il+2)=2
+ istk(il+3)=0
+ l=sadr(il+4)
+ stk(l)=m
+ stk(l+1)=n
+ lstk(top+1)=l+2
+ endif
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spget.lo b/modules/sparse/sci_gateway/fortran/sci_f_spget.lo
new file mode 100755
index 000000000..a03e4aa63
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spget.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_spget.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_spget.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.f b/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.f
new file mode 100755
index 000000000..b3320a6c1
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.f
@@ -0,0 +1,176 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine intspmatrix(id)
+ include 'stack.h'
+ integer id(nsiz),top0,tops
+ integer iadr, sadr
+ double precisionx sz, szr
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+
+ rhs = max(0,rhs)
+ tops=top
+ top0=top+1-rhs
+
+ if (rhs .lt.2) then
+ call error(39)
+ return
+ endif
+ if (lhs .ne. 1) then
+ call error(41)
+ return
+ endif
+ lw = lstk(top+1)
+ l0 = lstk(top+1-rhs)
+c checking variable ne
+ il=iadr(lstk(top))
+ if(istk(il).ne.1.or.istk(il+3).ne.0) then
+ err=3
+ call error(52)
+ return
+ endif
+ if(rhs.eq.2) then
+ if(istk(il+3).ne.0) then
+ err=3
+ call error(52)
+ return
+ endif
+ if(istk(il+1)*istk(il+2).eq.1) then
+ mr=int(stk(sadr(il+4)))
+ nr=1
+ elseif(istk(il+1)*istk(il+2).eq.2) then
+ mr=int(stk(sadr(il+4)))
+ nr=int(stk(sadr(il+4)+1))
+ else
+ top=tops
+ call ref2val
+ call funnam(ids(1,pt+1),'matrix',iadr(lstk(top-rhs+1)))
+ fun=-1
+ return
+ endif
+ elseif(rhs.gt.3) then
+ top=tops
+ call ref2val
+ call funnam(ids(1,pt+1),'matrix',iadr(lstk(top-rhs+1)))
+ fun=-1
+ return
+ elseif(rhs.eq.3) then
+ if(istk(il+1)*istk(il+2).ne.1) then
+ err=3
+ call error(60)
+ return
+ endif
+ l=sadr(il+4)
+ nr=stk(l)
+c checking variable mr
+ top=top-1
+ il=iadr(lstk(top))
+ if(istk(il).ne.1.or.istk(il+3).ne.0) then
+ err=3
+ call error(52)
+ return
+ endif
+ if(istk(il+1)*istk(il+2).ne.1) then
+ err=3
+ call error(60)
+ return
+ endif
+ l=sadr(il+4)
+ mr=stk(l)
+ endif
+c checking variable sp
+ top=top-1
+ il1 = iadr(lstk(top))
+ if (istk(il1) .ne. 5.and.istk(il1) .ne. 6) then
+ err = 1
+ call error(219)
+ return
+ endif
+ m=istk(il1+1)
+ n=istk(il1+2)
+
+C to avoid integer overflow
+ sz=dble(m)*dble(n)
+ szr=dble(mr)*dble(nr)
+
+ if(sz.ne.szr) then
+ call error(60)
+ return
+ endif
+ if(mr.eq.m) return
+
+ it=istk(il1+3)
+ nel=istk(il1+4)
+ l=sadr(il1+5+m+nel)
+ if(istk(il1).eq.5) then
+ if(mr.gt.m) then
+ ls=sadr(il1+5+mr+nel)
+ ils=iadr(ls+nel*(it+1))
+ iw=ils+nel+m
+ lw=sadr(iw+3*nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call unsfdcopy(nel*(it+1),stk(l),-1,stk(ls),-1)
+ call icopy(nel+m,istk(il1+5),-1,istk(ils),-1)
+ else
+ ls=sadr(il1+5+mr+nel)
+ ils=iadr(lw)
+ iw=ils+nel+m
+ lw=sadr(iw+3*nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call icopy(nel+m,istk(il1+5),1,istk(ils),1)
+ call unsfdcopy(nel*(it+1),stk(l),1,stk(ls),1)
+ endif
+ if(it.eq.0) then
+ call dspmat(m,n,stk(ls),nel,istk(ils),mr,istk(il1+5),
+ $ istk(iw))
+ else
+ call wspmat(m,n,stk(ls),stk(ls+nel),nel,istk(ils),mr,
+ $ istk(il1+5),istk(iw))
+ endif
+ lstk(top+1)=ls+nel*(it+1)
+ else
+ if(mr.gt.m) then
+ ils=il1+5+mr+nel
+ iw=ils+nel+m
+ lw=sadr(iw+3*nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call icopy(nel+m,istk(il1+5),-1,istk(ils),-1)
+ else
+ ls=sadr(il1+5+mr+nel)
+ ils=iadr(lw)
+ iw=ils+nel+m
+ lw=sadr(iw+3*nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call icopy(nel+m,istk(il1+5),1,istk(ils),1)
+ endif
+ call lspmat(m,n,nel,istk(ils),mr,istk(il1+5),istk(iw))
+ lstk(top+1)=sadr(il1+5+mr+nel)
+ endif
+ istk(il1+1)=mr
+ istk(il1+2)=nr
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.lo b/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.lo
new file mode 100755
index 000000000..9ccdea79f
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_spmatrix.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_spmatrix.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_spmatrix.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_symfcti.f b/modules/sparse/sci_gateway/fortran/sci_f_symfcti.f
new file mode 100755
index 000000000..fde75c7bc
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_symfcti.f
@@ -0,0 +1,87 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+c SCILAB function symfcti
+ subroutine intsymfcti(id)
+ logical getrhsvar, createvar, putlhsvar
+ include 'stack.h'
+c
+ nbvars=0
+c*****************************************************
+c 0-Check number of rhs and lhs arguments
+c*****************************************************
+ minrhs=13
+ maxrhs=13
+ minlhs=4
+ maxlhs=4
+c
+
+ if(.not.((rhs.ge.minrhs).and.(rhs.le.maxrhs))) then
+ call erro('wrong number of rhs arguments')
+ return
+ endif
+ if(.not.((lhs.ge.minlhs).and.(lhs.le.maxlhs))) then
+ call erro('wrong number of lhs arguments')
+ return
+ endif
+
+c*******************************************************
+c 1-Get rhs parameters and set their Fortran types
+c*******************************************************
+ if(.not.getrhsvar( 1,'i', m1, n1, l1)) return
+ if(.not.getrhsvar( 2,'i', m2, n2, l2)) return
+ if(.not.getrhsvar( 3,'i', m3, n3, l3)) return
+ if(.not.getrhsvar( 4,'i', m4, n4, l4)) return
+ if(.not.getrhsvar( 5,'i', m5, n5, l5)) return
+ if(.not.getrhsvar( 6,'i', m6, n6, l6)) return
+ if(.not.getrhsvar( 7,'i', m7, n7, l7)) return
+ if(.not.getrhsvar( 8,'i', m8, n8, l8)) return
+ if(.not.getrhsvar( 9,'i', m9, n9, l9)) return
+ if(.not.getrhsvar(10,'i',m10,n10,l10)) return
+ if(.not.getrhsvar(11,'i',m11,n11,l11)) return
+ if(.not.getrhsvar(12,'i',m12,n12,l12)) return
+ if(.not.getrhsvar(13,'i',m13,n13,l13)) return
+
+c*****************************************************
+c 2-If necessary, create additional variables
+c (working arrays, default values, ...)
+c*****************************************************
+
+ k=maxrhs+1
+ if(.not.createvar(k ,'i',istk(l8)+1,1,l14)) return
+ if(.not.createvar(k+1,'i',istk(l11) ,1,l15)) return
+ if(.not.createvar(k+2,'i',istk(l1)+1,1,l16)) return
+ if(.not.createvar(k+3,'i',1,1,l17)) return
+
+c******************************************************
+c 3-Routine call
+c stk <-> double
+c sstk <-> real
+c istk <-> integer
+c cstk <-> character
+c*****************************************************
+ call symfct(istk(l1),istk(l2),istk(l3),istk(l4),
+ $ istk(l5) ,istk(l6) ,istk(l7) ,istk(l8),istk(l9),
+ $ istk(l10),istk(l11) ,istk(l14),istk(l15),
+ $ istk(l16),istk(l12) ,istk(l13),istk(l17))
+c******************************************************
+c 5- Set lhs parameters
+c******************************************************
+ lhsvar( 1)= 14
+ lhsvar( 2)= 15
+ lhsvar( 3)= 16
+ lhsvar( 4)= 17
+
+c******************************************************
+c 6-Sending lhs variables to Scilab
+c******************************************************
+ if(.not.putlhsvar()) return
+c .
+ return
+ end
+c ======================================
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_symfcti.lo b/modules/sparse/sci_gateway/fortran/sci_f_symfcti.lo
new file mode 100755
index 000000000..e437d3af3
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_symfcti.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_symfcti.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_symfcti.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.f b/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.f
new file mode 100755
index 000000000..669ddaaea
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.f
@@ -0,0 +1,87 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) DIGITEO 2010 - Yann COLLETTE
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine scita2lpd(fname)
+c
+ character*(*) fname
+ include 'stack.h'
+c
+ integer iadr
+ integer topk,rhsk,topl
+ logical checkrhs,checklhs,getvectrow,getscalar,checkval,cremat
+ iadr(l)=l+l-1
+ rhs = max(0,rhs)
+c
+ topk = top
+ rhsk = rhs
+ if(.not.checkrhs(fname,4,4)) return
+ if(.not.checklhs(fname,1,3)) return
+c checking variable tail (number 1)
+c
+ if(.not.getvectrow(fname,top,top-rhs+1,it1,m1,n1,lr1,lc1)) return
+c checking variable head (number 2)
+c
+ if(.not.getvectrow(fname,top,top-rhs+2,it2,m2,n2,lr2,lc2)) return
+c checking variable n1 (number 3)
+c
+ if(.not.getscalar(fname,top,top-rhs+3,lr3)) return
+c checking variable n (number 4)
+c
+ if(.not.getscalar(fname,top,top-rhs+4,lr4)) return
+c
+c cross variable size checking
+c
+ if(.not.checkval(fname,n1,n2)) return
+ call entier(n1,stk(lr1),istk(iadr(lr1)))
+ call entier(n2,stk(lr2),istk(iadr(lr2)))
+ call entier(1,stk(lr4),istk(iadr(lr4)))
+ nn5= int(stk(lr3))
+ if(.not.cremat(fname,top+1,0,nn5,1,lw5,loc5)) return
+ if(.not.cremat(fname,top+2,0,n1,1,lw6,loc6)) return
+ if(.not.cremat(fname,top+3,0,n1,1,lw7,loc7)) return
+ call ta2lpd(istk(iadr(lr1)),istk(iadr(lr2)),n1,istk(iadr(lr4)),st
+ $ k(lw5),stk(lw6),stk(lw7))
+ if(err .gt. 0 .or. err1 .gt. 0) return
+c
+ topk=top-rhs
+ topl=top+3
+c
+ if(lhs .ge. 1) then
+c --------------output variable: lp
+ top=topl+1
+ if(.not.cremat(fname,top,0,1,nn5,lrs,lcs)) return
+ call int2db(1*nn5,istk(iadr(lw5)),-1,stk(lrs),-1)
+ endif
+c
+ if(lhs .ge. 2) then
+c --------------output variable: la
+ top=topl+2
+ if(.not.cremat(fname,top,0,1,n1,lrs,lcs)) return
+ call int2db(1*n1,istk(iadr(lw6)),-1,stk(lrs),-1)
+ endif
+c
+ if(lhs .ge. 3) then
+c --------------output variable: ls
+ top=topl+3
+ if(.not.cremat(fname,top,0,1,n1,lrs,lcs)) return
+ call int2db(1*n1,istk(iadr(lw7)),-1,stk(lrs),-1)
+ endif
+c Putting in order the stack
+ if(lhs .ge. 1) then
+ call copyobj(fname,topl+1,topk+1)
+ endif
+ if(lhs .ge. 2) then
+ call copyobj(fname,topl+2,topk+2)
+ endif
+ if(lhs .ge. 3) then
+ call copyobj(fname,topl+3,topk+3)
+ endif
+ top=topk+lhs
+ return
+ end
diff --git a/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.lo b/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.lo
new file mode 100755
index 000000000..94f2c9378
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/sci_f_ta2lpd.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/sci_f_ta2lpd.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sci_f_ta2lpd.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/fortran/spops.f b/modules/sparse/sci_gateway/fortran/spops.f
new file mode 100755
index 000000000..1bebded98
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/spops.f
@@ -0,0 +1,2278 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine spops
+c
+c operations on sparse matrices
+ include 'stack.h'
+ integer op
+Cc (DLL Intel Fortran)
+cDEC$ IF DEFINED (FORDLL)
+cDEC$ ATTRIBUTES DLLIMPORT:: /mtlbc/
+cDEC$ ENDIF
+
+ common /mtlbc/ mmode
+c
+ integer iadr,sadr
+c
+ double precision sr,si,e1,powr,powi
+ integer star,dstar,slash,bslash,dot,colon,quote
+ integer less,great,equal
+ integer insert,extrac
+ integer top0
+ logical isany
+ integer tops,top4
+
+* the following boolean vars are defined to replace test on m*n == 0 or m*n == 1)
+* for sparse matrices the product m x n may leads to integer overflow.
+* (bruno dec 2004)
+ logical a1_is_empty, a1_is_scalar, a2_is_empty, a2_is_scalar,
+ $ a3_is_empty, a3_is_scalar, a4_is_empty, a4_is_scalar
+
+ data star/47/,dstar/62/,slash/48/
+ data bslash/49/,dot/51/,colon/44/,quote/53/
+ data less/59/,great/60/,equal/50/
+ data insert/2/,extrac/3/
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+c
+ op=fin
+c
+ if (ddt .eq. 4) then
+ call writebufspc(buf,fin)
+ call basout(io,wte,' spops op: '//buf(1:4))
+ endif
+c
+ top0=top
+ lw=lstk(top+1)+1
+ if(op.eq.extrac) goto 70
+ if(op.eq.insert) goto 80
+ it2=0
+ goto (04,03,02,01) rhs
+ call error(39)
+ return
+c
+ 01 il4=iadr(lstk(top))
+ if(istk(il4).lt.0) il4=iadr(istk(il4+1))
+ m4=istk(il4+1)
+ n4=istk(il4+2)
+ it4=istk(il4+3)
+ if(istk(il4).eq.5) then
+ nel4=istk(il4+4)
+ irc4=il4+5
+ l4=sadr(irc4+m4+nel4)
+ elseif(istk(il4).eq.1) then
+ nel4=m4*n4
+ l4=sadr(il4+4)
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn4=m4*n4 ! must not be used if arg4 is a sparse
+ a4_is_empty = m4.eq.0 .or. n4.eq.0
+ a4_is_scalar = (.not.a4_is_empty) .and. (m4.eq.1 .and. n4.eq.1)
+
+ top=top-1
+c
+ 02 il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.5) then
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ elseif(istk(il3).eq.1) then
+ l3=sadr(il3+4)
+ nel3=m3*n3
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn3=m3*n3 ! must not be used if arg3 is a sparse
+ a3_is_empty = m3.eq.0 .or. n3.eq.0
+ a3_is_scalar = (.not.a3_is_empty) .and. (m3.eq.1 .and. n3.eq.1)
+
+ top=top-1
+c
+ 03 il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ if(istk(il2).eq.5) then
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ elseif(istk(il2).eq.1) then
+ l2=sadr(il2+4)
+ nel2=m2*n2
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn2=m2*n2 ! must not be used if arg2 is a sparse
+ a2_is_empty = m2.eq.0 .or. n2.eq.0
+ a2_is_scalar = (.not.a2_is_empty) .and. (m2.eq.1 .and. n2.eq.1)
+
+ top=top-1
+c
+ 04 il1=iadr(lstk(top))
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+ it1=istk(il1+3)
+ if(istk(il1).eq.5) then
+ nel1=istk(il1+4)
+ irc1=il1+5
+ l1=sadr(irc1+m1+nel1)
+ elseif(istk(il1).eq.1) then
+ l1=sadr(il1+4)
+ nel1=m1*n1
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn1=m1*n1 ! must not be used if arg1 is a sparse
+ a1_is_empty = m1.eq.0 .or. n1.eq.0
+ a1_is_scalar = (.not.a1_is_empty) .and. (m1.eq.1 .and. n1.eq.1)
+
+ top=top-1
+c
+c operations binaires et ternaires
+c --------------------------------
+c
+ top=top+1
+ itr=max(it1,it2)
+c
+ fun = 0
+c
+c cconc extrac insert rconc
+ goto(65 , 999 , 999 ,66) op
+c
+c : + - * / \ = '
+ goto(06,07,08,10,20,25,130,05,05,60) op+1-colon
+c
+ 05 if(op.eq.dstar .or. op.eq.dstar+dot) goto 30 ! case dstar+dot added (bug fix 1769)
+ if(op.eq.quote+dot) goto 60
+ if(op.ge.3*dot+star) goto 200
+ if(op.ge.2*dot+star) goto 120
+ if(op.ge.less+equal) goto 130
+ if(op.ge.dot+star) goto 55
+ if(op.ge.less) goto 130
+
+ 06 top=top0
+ fin=-fin
+ return
+
+c
+c addition
+ 07 continue
+
+ if (a1_is_empty) then
+c []+a
+ if (mmode.eq.1) then
+c . Matlab like []+a=[]
+ else
+c . []+a=a
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ goto 999
+ endif
+ elseif(a2_is_empty) then
+c a+[]
+ if (mmode.eq.1) then
+c . Matlab like a+[]=[]
+ istk(il1+1)=0
+ istk(il1+2)=0
+ istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)
+ else
+c . a+[]=a
+ endif
+ goto 999
+ endif
+ if (m1 .lt. 0) then
+c eye+a
+ top=top0
+ fin=-fin
+ return
+ endif
+ if (m2 .lt. 0) then
+c a+eye
+ top=top0
+ fin=-fin
+ return
+ endif
+
+ if (a2_is_scalar .and. .not. a1_is_scalar) then
+c a+cst
+ top=top0
+ fin=-fin
+ return
+ endif
+ if (a1_is_scalar .and. .not.a2_is_scalar) then
+c cst+a
+ top=top0
+ fin=-fin
+ return
+ endif
+ if (m1.ne.m2 .or. n1.ne.n2) then
+ call error(8)
+ return
+ endif
+
+ if(istk(il1).ne.5 .or. istk(il2).ne.5) then
+c addition with a full matrix
+ top=top0
+ fin=-fin
+ return
+ endif
+c addition of 2 sparse matrices of the same size
+ irc=iadr(lw)
+ if(itr.eq.1) then
+ nelmx=(iadr(lstk(bot))-irc-m1-10)/5
+ else
+ nelmx=(iadr(lstk(bot))-irc-m1-10)/3
+ endif
+ lc=sadr(irc+m1+nelmx)
+ lw=lc+nelmx*(itr+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel=nelmx
+ if(itr.eq.1) then
+ call wspasp(m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+nel2),nel2,istk(irc2),stk(lc),stk(lc+nel),
+ $ nel,istk(irc),it1,it2,ierr)
+ else
+ call dspasp(m1,n1,stk(l1),nel1,istk(irc1),stk(l2),nel2,
+ $ istk(irc2),stk(lc),nel,istk(irc),ierr)
+ endif
+ if(ierr.ne.0) then
+ call error(17)
+ return
+ endif
+ istk(il1+3)=itr
+ istk(il1+4)=nel
+ call icopy(m1+nel,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+nel)
+ call unsfdcopy(nel,stk(lc),1,stk(l1),1)
+ if(itr.eq.1) call unsfdcopy(nel,stk(lc+nelmx),1,stk(l1+nel),1)
+ lstk(top+1)=l1+nel*(itr+1)
+ go to 999
+c
+c soustraction
+ 08 if(rhs.eq.1) then
+ if(mn1.eq.0) goto 999
+ call dscal(nel1*(it1+1),-1.0d+0,stk(l1),1)
+ goto 999
+ endif
+
+ if (a1_is_empty) then
+c []-a
+ if (mmode.eq.1) then
+c . Matlab like []-a=[]
+ else
+c . []-a=-a
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ call dscal(nel2*(it2+1),-1.0d0,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ goto 999
+ endif
+ elseif(a2_is_empty) then
+c a-[]
+ if (mmode.eq.1) then
+c . Matlab like a-[]=[]
+ istk(il1+1)=0
+ istk(il1+2)=0
+ istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)
+ else
+c . a-[]=a
+ endif
+ goto 999
+ endif
+ if (m1 .lt. 0.or.m2 .lt. 0) then
+c soustraction a-eye*b
+ top=top0
+ fin=-fin
+ return
+ endif
+
+ if (a2_is_scalar .and. .not.a1_is_scalar) then
+c a-cst
+ top=top0
+ fin=-fin
+ return
+ endif
+ if (a1_is_scalar .and. .not.a2_is_scalar) then
+c cst-a
+ top=top0
+ fin=-fin
+ return
+ endif
+
+c check dimensions
+ if (m1 .ne. m2.or.n1 .ne. n2) then
+ call error(9)
+ return
+ endif
+ if(istk(il1).ne.5.or.istk(il2).ne.5) then
+c soustraction avec une matrice non creuse
+ top=top0
+ fin=-fin
+ return
+ endif
+c soustraction de 2 matrice sparse de meme taille
+ irc=iadr(lw)
+ if(itr.eq.1) then
+ nelmx=(iadr(lstk(bot))-irc-m1-10)/5
+ else
+ nelmx=(iadr(lstk(bot))-irc-m1-10)/3
+ endif
+ lc=sadr(irc+m1+nelmx)
+ lw=lc+nelmx*(itr+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel=nelmx
+ if(itr.eq.1) then
+ call wspssp(m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+nel2),nel2,istk(irc2),stk(lc),stk(lc+nel),
+ $ nel,istk(irc),it1,it2,ierr)
+ else
+ call dspssp(m1,n1,stk(l1),nel1,istk(irc1),stk(l2),nel2,
+ $ istk(irc2),stk(lc),nel,istk(irc),ierr)
+ endif
+ if(ierr.ne.0) then
+ call error(17)
+ return
+ endif
+ istk(il1+3)=itr
+ istk(il1+4)=nel
+ call icopy(m1+nel,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+nel)
+ call unsfdcopy(nel,stk(lc),1,stk(l1),1)
+ if(itr.eq.1) call unsfdcopy(nel,stk(lc+nelmx),1,stk(l1+nel),1)
+ lstk(top+1)=l1+nel*(itr+1)
+ go to 999
+
+c multiplication
+ 10 continue
+c$$$ if (m2*mn2 .eq. 1) go to 12
+c$$$ if (mn1 .eq. 1 ) go to 13
+c$$$ if (mn2 .eq. 1 ) go to 12
+ if (a2_is_scalar) goto 12
+ if (a1_is_scalar) goto 13
+ m1=abs(m1)
+ n1=abs(n1)
+ m2=abs(m2)
+ n2=abs(n2)
+ if(a1_is_empty .or. a2_is_empty) then
+ istk(il1)=1
+ istk(il1+1)=0
+ istk(il1+2)=0
+ istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)+1
+ goto 999
+ endif
+c matrix matrix multiplication
+ if (n1 .ne. m2) then
+ call error(10)
+ return
+ endif
+ if(istk(il1).eq.1.or.istk(il2).eq.1) then
+c full x sparse or sparse x full
+ lc=lw
+ lw=lw+m1*n2*(itr+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(istk(il1).eq.1) then
+c full x sparse
+ if(itr.eq.1) then
+ call wsmsp(m1,n1,n2,stk(l1),stk(l1+m1*n1),m1,
+ $ stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(lc),stk(lc+m1*n2),m1,it1,it2)
+ else
+ call dsmsp(m1,n1,n2,stk(l1),m1,stk(l2),nel2,
+ $ istk(irc2),stk(lc),m1)
+ endif
+ else
+c sparse x full
+ if(itr.eq.1) then
+ call wspms(m1,n1,n2,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+m2*n2),m2,stk(lc),stk(lc+m1*n2),m1,
+ $ it1,it2)
+ else
+ call dspms(m1,n1,n2,stk(l1),nel1,istk(irc1),
+ $ stk(l2),m2,stk(lc),m1)
+ endif
+ endif
+ istk(il1)=1
+ istk(il1+1)=m1
+ istk(il1+2)=n2
+ istk(il1+3)=itr
+ l1=sadr(il1+4)
+ call unsfdcopy(m1*n2*(itr+1),stk(lc),1,stk(l1),1)
+ lstk(top+1)=l1+m1*n2*(itr+1)
+ return ! ici un return direct (pas de goto 999) !
+ endif
+
+* sparse x sparse
+ ib=iadr(lw)
+ ic=ib+m2+1
+ ixb=ic+m1+1
+ lx=sadr(ixb+n2)
+ lc=lx+n2*(itr+1)
+ nel=(iadr(lstk(bot))-iadr(lc)-m1-10)/(1+2*(itr+1))
+ irc=iadr(lc+nel*(itr+1))
+ lw=sadr(irc+m1+nel)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nelc=nel
+ if(itr.eq.1) then
+ call wspmsp(m1,n1,n2,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(lc),stk(lc+nel),nelc,istk(irc),
+ $ istk(ib),istk(ic),stk(lx),stk(lx+n2),istk(ixb),
+ $ it1,it2,ierr)
+ else
+ call dspmsp(m1,n1,n2,stk(l1),nel1,istk(irc1),
+ $ stk(l2),nel2,istk(irc2),stk(lc),nelc,istk(irc),
+ $ istk(ib),istk(ic),stk(lx),istk(ixb),ierr)
+ endif
+ if(ierr.eq.1) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ istk(il1+2)=n2
+ istk(il1+3)=itr
+ istk(il1+4)=nelc
+ l1=sadr(il1+5+m1+nelc)
+ if(lc.ge.l1) then
+ call unsfdcopy(nelc,stk(lc),1,stk(l1),1)
+ if(itr.eq.1) call unsfdcopy(nelc,stk(lc+nel),1,stk(l1+nelc),1)
+ else
+ call unsfdcopy(nelc,stk(lc),-1,stk(l1),-1)
+ if(itr.eq.1) call unsfdcopy(nelc,stk(lc+nel),-1,
+ $ stk(l1+nelc),-1)
+ endif
+ call icopy(nelc+m1,istk(irc),1,istk(il1+5),1)
+ lstk(top+1)=l1+nelc*(itr+1)
+ go to 999
+c
+ 12 continue
+c a*cst
+ if(istk(il2).eq.1) then
+ si = 0.0d0
+ sr = stk(l2)
+ if(it2.eq.1) si = stk(l2+1)
+ elseif(istk(il2).eq.5) then
+ if(nel2.eq.0) then
+ sr = 0.0d0
+ si = 0.0d0
+ else
+ si = 0.0d0
+ sr = stk(l2)
+ if(it2.eq.1) si = stk(l2+1)
+ endif
+ endif
+ if(abs(sr)+abs(si).eq.0.0d0) then
+ if(istk(il1).eq.1) then
+ istk(il1+3)=0
+ call dset(m1*n1,0.0d0,stk(l1),1)
+ lstk(top+1)=l1+m1*n1
+ else
+ istk(il1+3)=0
+ istk(il1+4)=0
+ call iset(abs(m1),0,istk(il1+5),1)
+ lstk(top+1)=sadr(il1+5+abs(m1))+1
+ endif
+ return
+ endif
+ go to 14
+
+ 13 continue
+c cst*a
+ if(istk(il1).eq.1) then
+ si = 0.0d0
+ sr = stk(l1)
+ if(it1.eq.1) si = stk(l1+1)
+ elseif(istk(il1).eq.5) then
+ if(nel1.eq.0) then
+ sr = 0.0d0
+ si = 0.0d0
+ else
+ si = 0.0d0
+ sr = stk(l1)
+ if(it1.eq.1) si = stk(l1+1)
+ endif
+ endif
+ if(abs(sr)+abs(si).eq.0.0d0) then
+ if(istk(il2).eq.1) then
+ istk(il1)=1
+ istk(il1+1)=m2
+ istk(il1+2)=n2
+ istk(il1+3)=0
+ l1=sadr(il1+4)
+ call dset(m2*n2,0.0d0,stk(l1),1)
+ lstk(top+1)=l1+m2*n2
+ else
+ istk(il1)=5
+ istk(il1+1)=m2
+ istk(il1+2)=n2
+ istk(il1+3)=0
+ istk(il1+4)=0
+c call iset(iabs(m2),0,stk(il1+5),1)
+c lstk(top+1)=sadr(il1+5+abs(m2))+1
+c FD modif
+ nnnb=1+abs(m2)
+ call iset(nnnb,0,istk(il1+5),1)
+ lstk(top+1)=sadr(il1+5+nnnb)
+ endif
+ return
+ endif
+
+ if(istk(il2).eq.5) then
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ elseif(istk(il2).eq.1) then
+ call icopy(4,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+4)
+ call unsfdcopy(mn2*(it2+1),stk(l2),1,stk(l1),1)
+ endif
+ m1=m2
+ n1=n2
+ mn1=it1
+ it1=it2
+ it2=mn1
+ mn1=mn2
+ nel1=nel2
+c
+ 14 continue
+ istk(il1+1)=m1
+ istk(il1+2)=n1
+ istk(il1+3)=itr
+ lstk(top+1)=l1+nel1*(itr+1)
+c
+ err=lstk(top+1)-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+c
+ goto (15,16,17),it2+2*it1
+c la matrice et le scalaire sont reel
+ call dscal(nel1,sr,stk(l1),1)
+ lstk(top+1)=l1+nel1
+ goto 999
+ 15 continue
+c la matrice est reelle le scalaire est complexe
+ err=l1+2*nel1-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call unsfdcopy(nel1,stk(l1),1,stk(l1+nel1),1)
+ call dscal(nel1,sr,stk(l1),1)
+ call dscal(nel1,si,stk(l1+nel1),1)
+ lstk(top+1)=l1+2*nel1
+ goto 999
+ 16 continue
+c la matrice est complexe, le scalaire est reel
+ call dscal(nel1,sr,stk(l1),1)
+ call dscal(nel1,sr,stk(l1+nel1),1)
+ lstk(top+1)=l1+2*nel1
+ goto 999
+ 17 continue
+c la matrice et le scalaire sont complexes
+ call wscal(nel1,sr,si,stk(l1),stk(l1+nel1),1)
+ lstk(top+1)=l1+2*nel1
+ goto 999
+c
+c right division
+ 20 if (mn2 .ne. 1) then
+c right division by a matrix -->macro coded
+ fin = -fin
+ top = top0
+ rhs = 2
+ go to 999
+ endif
+c right division by a scalar
+ sr=stk(l2)
+ si=0.0d+0
+ if(it2.eq.1) si=stk(l2+1)
+ e1=max(abs(sr),abs(si))
+ if(e1.eq.0.0d+0) then
+ call error(27)
+ return
+ endif
+ sr=sr/e1
+ si=si/e1
+ e1=e1*(sr*sr+si*si)
+ sr=sr/e1
+ si=-si/e1
+c call multiplication with scalar inverse
+ goto 14
+c
+c left division
+ 25 if ( .not.a1_is_scalar ) then
+c left division by a matrix -->macro coded
+ top=top0
+ fin=-fin
+ return
+ endif
+c left division by a scalar
+ sr=stk(l1)
+ si=0.0d+0
+ if(it1.eq.1) si=stk(l1+1)
+ e1=max(abs(sr),abs(si))
+ if(e1.eq.0.0d+0) then
+ call error(27)
+ return
+ endif
+ sr=sr/e1
+ si=si/e1
+ e1=e1*(sr*sr+si*si)
+ sr=sr/e1
+ si=-si/e1
+ if(istk(il2).eq.1) then
+ call icopy(4,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+4)
+ nel2=mn2
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ else
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ endif
+ m1=m2
+ n1=n2
+ it=it1
+ it1=it2
+ it2=it
+ mn1=mn2
+ nel1=nel2
+ goto 14
+*
+* power operations: sp^pow or sp.^pow
+* (modified by Bruno jan 19 2006 to fix bug 1769)
+*
+* notes : dstar corresponds to ^
+* dstar+dot corresponds to .^
+* at the beginning of this toooooooo big subroutine the code is
+* branched here in these 2 cases.
+*
+ 30 if (mn2 .ne. 1) then
+ call error(30)
+ return
+ endif
+
+* for sp^pow with a sp square and not scalar (scalar case is faster handle
+* by the element wize power op)
+ if ( op.eq.dstar .and. m1.eq.n1 .and. .not.a1_is_scalar ) goto 31
+
+* sp^pow is nevertheless "authorized" when sp is a vector (and done
+* as an element wize power operation)
+ if ( op.eq.dstar .and. m1.ne.1 .and. n1.ne.1 ) then
+ err=1
+ call error(20)
+ return
+ endif
+C obsolescence warning
+ if ( op.eq.dstar.and.(m1.ne.1 .or. n1.ne.1)) call msgs(116)
+* so the following concerns only element wise power
+*
+************end of the modif for bug 1769****************
+*
+ err=l1+nel1*2-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(it2.eq.0) then
+ powr=stk(l2)
+ if(it1.eq.0) then
+ call ddpow(nel1,stk(l1),stk(l1+nel1),1,powr,err,itr)
+ else
+ call wdpow(nel1,stk(l1),stk(l1+nel1),1,powr,err)
+ endif
+ else
+ powr=stk(l2)
+ powi=stk(l2+1)
+ if(it1.eq.0) then
+ call dwpow(nel1,stk(l1),stk(l1+nel1),1,
+ & powr,powi,err)
+ else
+ call wwpow(nel1,stk(l1),stk(l1+nel1),1,
+ & powr,powi,err)
+ endif
+ endif
+ if(err.eq.1) then
+ call error(30)
+ return
+ endif
+ if(err.eq.2) then
+ call error(27)
+ return
+ endif
+ istk(il1+3)=itr
+ lstk(top+1)=l1+nel1*(itr+1)
+ goto 999
+c
+c elevation d'une matrice carree a une puissance
+ 31 continue
+ top=top0
+ fin=-fin
+ return
+c
+
+c operations elements a elements
+ 55 continue
+ i1=1
+ i2=1
+ op = op - dot
+ if(a1_is_empty .or. a2_is_empty) then
+c [].*a a.*[] -->[]
+ istk(il1)=1
+ istk(il1+1)=0
+ istk(il1+2)=0
+ istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)+1
+ goto 999
+ endif
+ if(a1_is_scalar .or. a2_is_scalar) then
+ goto(06,07,08,10,20,25,130,05,05,60) op+1-colon
+ endif
+c
+c check dimensions
+ if (m1.ne.m2 .or. n1.ne.n2) then
+ call error(6)
+ return
+ endif
+ if(op.eq.slash) then
+ if(istk(il2).eq.1) then
+ if(it2.eq.0) then
+ do 56 i=0,mn1-1
+ if(stk(l2+i).eq.0.0d0) then
+ call error(27)
+ return
+ endif
+ stk(l2+i)=1.0d0/stk(l2+i)
+ 56 continue
+ else
+ do 57 i=0,mn2-1
+ sr=stk(l2+i)
+ si=stk(l2+mn2+i)
+ e1=abs(sr)+abs(si)
+ if(e1.eq.0.0d+0) then
+ call error(27)
+ return
+ endif
+ sr=sr/e1
+ si=si/e1
+ e1=e1*(sr*sr+si*si)
+ stk(l2+i)=sr/e1
+ stk(l2+mn2+i)=-si/e1
+ 57 continue
+ endif
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ elseif(op.eq.bslash) then
+ if(istk(il1).eq.1) then
+ if(it1.eq.0) then
+ do 58 i=0,mn1-1
+ if(stk(l1+i).eq.0.0d0) then
+ call error(27)
+ return
+ endif
+ stk(l1+i)=1.0d0/stk(l1+i)
+ 58 continue
+ else
+ do 59 i=0,mn1-1
+ sr=stk(l1+i)
+ si=stk(l1+mn1+i)
+ e1=abs(sr)+abs(si)
+ if(e1.eq.0.0d+0) then
+ call error(27)
+ return
+ endif
+ sr=sr/e1
+ si=si/e1
+ e1=e1*(sr*sr+si*si)
+ stk(l1+i)=sr/e1
+ stk(l1+mn1+i)=-si/e1
+ 59 continue
+ endif
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ endif
+ if(nel1.eq.0.or.nel2.eq.0) then
+ istk(il1)=5
+ istk(il1+3)=0
+ istk(il1+4)=0
+ call iset(m1,0,istk(il1+5),1)
+ lstk(top+1)=sadr(il1+5+m1)
+ return
+ endif
+ if(istk(il1).eq.1) then
+c full.*sparse
+ nel=nel2
+ if(it1.eq.0.and.it2.eq.0) then
+ call dspxs(m1,n1,stk(l2),nel2,istk(irc2),stk(l1),m1,
+ $ stk(l2),nel,istk(irc2),ierr)
+ else
+ if(it2.eq.0) then
+ err=l2+2*nel2-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ endif
+ call wspxs(m1,n1,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(l1),stk(l1+nel1),m1,
+ $ stk(l2),stk(l2+nel2),nel,istk(irc2),ierr,it2,it1)
+ endif
+ istk(il1)=5
+ istk(il1+3)=itr
+ istk(il1+4)=nel
+ l=sadr(il1+5+m1+nel)
+ call icopy(m1+nel,istk(irc2),1,istk(il1+5),1)
+ call unsfdcopy(nel,stk(l2),1,stk(l),1)
+ if(itr.eq.1) call unsfdcopy(nel,stk(l2+nel2),1,stk(l+nel),1)
+ lstk(top+1)=l+nel*(itr+1)
+ return
+ elseif(istk(il2).eq.1) then
+c sparse.*full
+ nel=nel1
+ if(it1.eq.0.and.it2.eq.0) then
+ call dspxs(m1,n1,stk(l1),nel1,istk(irc1),stk(l2),m1,
+ $ stk(l1),nel,istk(irc1),ierr)
+ else
+ lri=l1+nel1
+ if(it1.eq.0) then
+ lri=lw
+ err=lri+nel1-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ endif
+ call wspxs(m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+nel2),m1,
+ $ stk(l1),stk(lri),nel,istk(irc1),ierr,it1,it2)
+ endif
+ istk(il1)=5
+ istk(il1+3)=itr
+ istk(il1+4)=nel
+ l=sadr(il1+5+m1+nel)
+ call icopy(m1+nel,istk(irc1),1,istk(il1+5),1)
+ call unsfdcopy(nel,stk(l1),1,stk(l),1)
+ if(itr.eq.1) call unsfdcopy(nel,stk(lri),1,stk(l+nel),1)
+ lstk(top+1)=l+nel*(itr+1)
+ return
+ endif
+c sparse.*sparse
+ nel=nel1
+ if(it1.eq.0.and.it2.eq.0) then
+ call dspxsp(m1,n1,stk(l1),nel1,istk(irc1),
+ $ stk(l2),nel2,istk(irc2),stk(l1),nel,istk(irc1),ierr)
+ lrr=l1
+
+ else
+ lrr=lw
+ lri=lrr+min(nel1,nel2)
+ err=lri+min(nel1,nel2)-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call wspxsp(m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(lrr),stk(lri),nel,istk(irc1),ierr,it1,it2)
+ endif
+
+ istk(il1+3)=itr
+ istk(il1+4)=nel
+ l=sadr(il1+5+m1+nel)
+ call unsfdcopy(nel,stk(lrr),1,stk(l),1)
+ if(itr.eq.1) call unsfdcopy(nel,stk(lri),1,stk(l+nel),1)
+ lstk(top+1)=l+nel*(itr+1)
+ return
+c
+c
+c transposition (modified by bruno)
+ 60 istk(il1+1)=n1
+ istk(il1+2)=m1
+ if(nel1.eq.0) then
+ lw=sadr(il1+5+n1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call iset(n1,0,istk(il1+5),1)
+ lstk(top+1)=lw
+ goto 999
+ endif
+ iptr=iadr(lw) ! for work array ptr of size n1
+ irc2=iptr+n1
+ l2=sadr(irc2+n1+nel1)
+ lw=l2+nel1*(it1+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+
+ if (it1 .eq. 0) then
+ inc = 0
+ else
+ inc = nel1
+ endif
+
+ call spt(m1, n1, nel1, it1, istk(iptr),
+ $ stk(l1), stk(l1+inc), istk(irc1), istk(irc1+m1),
+ $ stk(l2), stk(l2+inc), istk(irc2), istk(irc2+n1))
+
+* recopie en "top"
+ call icopy(n1+nel1,istk(irc2),1,istk(irc1),1)
+ l1=sadr(irc1+n1+nel1)
+ call unsfdcopy(nel1*(it1+1),stk(l2),1,stk(l1),1)
+ if(it1.eq.1 .and. op.ne.quote+dot) then
+ call dscal(nel1,-1.0d0,stk(l1+nel1),1) ! complexe conjugue si A' et it=1
+ endif
+ lstk(top+1)=l1+nel1*(it1+1)
+ goto 999
+c
+c concatenation [a b]
+ 65 continue
+ if(m1.lt.0.or.m2.lt.0) then
+ call error(14)
+ return
+ endif
+ if(m2.eq.0) then
+ return
+ elseif(m1.eq.0) then
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ return
+ elseif(m1.ne.m2) then
+ call error(5)
+ return
+ endif
+ if(istk(il1).ne.5.or.istk(il2).ne.5) then
+ top=top0
+ fin=-fin
+ return
+ endif
+c
+ nelr=nel1+nel2
+ istk(il1+2)=n1+n2
+ istk(il1+3)=itr
+ istk(il1+4)=nelr
+ lr=lw
+ irc=iadr(lr+nelr*(itr+1))
+ lw=sadr(irc+m1+nelr)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(itr.eq.0) then
+ call dspcsp(0,m1,n1,stk(l1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),nel2,istk(irc2),
+ $ stk(lr),nelr,istk(irc))
+ else
+ call wspcsp(0,m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(lr),stk(lr+nelr),nelr,istk(irc),it1,it2)
+ endif
+ call icopy(m1+nelr,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+nelr)
+ call unsfdcopy(nelr*(itr+1),stk(lr),1,stk(l1),1)
+ lstk(top+1)=l1+nelr*(itr+1)
+ return
+c
+c concatenation [a;b]
+ 66 continue
+ if(n1.lt.0.or.n2.lt.0) then
+ call error(14)
+ return
+ endif
+ if(n2.eq.0) then
+ goto 999
+ elseif(n1.eq.0)then
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ goto 999
+ elseif(n1.ne.n2) then
+ call error(6)
+ return
+ endif
+ if(istk(il1).ne.5.or.istk(il2).ne.5) then
+ top=top0
+ fin=-fin
+ return
+ endif
+
+
+ nelr=nel1+nel2
+ istk(il1+1)=m1+m2
+ istk(il1+3)=itr
+ istk(il1+4)=nelr
+ lr=lw
+ irc=iadr(lr+nelr*(itr+1))
+ lw=sadr(irc+m1+m2+nelr)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ if(itr.eq.0) then
+ call dspcsp(1,m1,n1,stk(l1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),nel2,istk(irc2),
+ $ stk(lr),nelr,istk(irc))
+ else
+ call wspcsp(1,m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ stk(lr),stk(lr+nelr),nelr,istk(irc),it1,it2)
+ endif
+ call icopy(m1+m2+nelr,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+m2+nelr)
+ call unsfdcopy(nelr*(itr+1),stk(lr),1,stk(l1),1)
+ lstk(top+1)=l1+nelr*(itr+1)
+ goto 999
+c
+c extraction (modified by bruno)
+c
+ 70 continue
+ if(rhs.lt.2) then
+ call error(227)
+ return
+ endif
+ if(rhs.gt.2) goto 75 ! goto extraction arg3(arg1,arg2)
+
+c****** extraction arg2(arg1) *************************************
+*
+c get arg2
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ a2_is_empty = m2.eq.0 .or. n2.eq.0
+ a2_is_scalar = (.not.a2_is_empty) .and. (m2.eq.1 .and. n2.eq.1)
+ mn2=m2*n2
+ top=top-1
+c get arg1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+ a1_is_empty = m1.eq.0 .or. n1.eq.0
+ a1_is_scalar = (.not.a1_is_empty) .and. (m1.eq.1 .and. n1.eq.1)
+
+ if(a2_is_empty) then
+c . arg2=[] -> return an empty matrix []
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m2.lt.0) then
+c . arg2=eye
+ call error(14)
+ return
+ elseif(m1.lt.0) then ! case arg2(:) => just reshape to column vector
+ if(n2.eq.1) then
+c . already a column vector
+ ilrs=iadr(lstk(top))
+ call icopy(5+m2+nel2,istk(il2),1,istk(ilrs),1)
+ l1=sadr(ilrs+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ else ! n2 > 1
+c . reshape to column vector via spmat (reshape is named matrix in scilab)
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=5
+ istk(ilrs+1)=mn2
+ istk(ilrs+2)=1
+ istk(ilrs+3)=it2
+ istk(ilrs+4)=nel2
+ irc1=ilrs+5
+ l1=sadr(ilrs+5+m2*n2+nel2)
+
+ ircr=iadr(lw)
+ iw=ircr+m2*n2+nel2
+** correction d'un bug
+ lr=sadr(iw+3*nel2)
+ lw= lr + nel2*(it2+1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ ! copie des valeurs de arg2
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(lr),1)
+ if(it2.eq.0) then
+*** le bug etait du au fait que stk(l2) (remplace par stk(lr)) est remanie
+*** (via une permutation) et donc pb si arg2 est passe par reference
+
+*** il faudrait peut-être utiliser spreshape maintenant
+ call dspmat(m2,n2,stk(lr),nel2,istk(irc2),m2*n2
+ $ ,istk(ircr),istk(iw))
+ else
+
+ call wspmat(m2,n2,stk(lr),stk(lr+nel2),nel2,istk(irc2)
+ $ ,m2*n2,istk(ircr),istk(iw))
+ endif
+ call icopy(m2*n2+nel2,istk(ircr),1,istk(irc1),1)
+ call unsfdcopy(nel2*(it2+1),stk(lr),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ endif
+ return
+ endif
+
+*** extraction arg2(arg1) (suite)
+ call indxg(il1,mn2,ilr,mi,mx,lw,1) ! analysis of the index vector arg1
+ if(err.gt.0) return
+ if(mx.gt.mn2) then
+ call error(21)
+ return
+ endif
+
+ 72 if(mi.eq.0) then ! case arg2([]) => return a void matrix (type = 1)
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ endif
+c set output sizes ! extraction arg2(arg1)
+ if ( m2 .eq. 1 ) then ! A is a row sparse => B also (and only in this case)
+ mr = 1
+ nr = mi
+ else ! A not a row sparse => B a column sparse
+ mr = mi
+ nr = 1
+ endif
+
+c get memory for the result
+ lptr=iadr(lw)
+ irc=lptr+m2
+ lw=sadr(irc+mr)
+ nelrm=(2*(lstk(bot)-lw)-1)/(3+2*it2)
+ if(nelrm.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lr=sadr(irc+mr+nelrm)
+ lw=lr+nelrm*(it2+1)
+ inc2 = nel2*it2
+ incr = nelrm*it2
+
+* subroutine spextr1(A_m, A_n, A_nel, A_mnel, A_icol, A_R, A_I,
+* $ B_m, B_n, B_nel, B_mnel, B_icol, B_R, B_I,
+* $ it, i, ni, nel_max, ptr, ierr)
+
+ call spextr1(m2, n2, nel2, istk(irc2), istk(irc2+m2), stk(l2),
+ $ stk(l2+inc2),
+ $ mr, nr, nelr, istk(irc), istk(irc+mr), stk(lr),
+ $ stk(lr+incr),
+ $ it2, istk(ilr), mi, nelrm, istk(lptr), ierr)
+
+c form resulting variable
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=5
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=it2
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ call unsfdcopy(nelr,stk(lr),1,stk(l1),1)
+ if(it2.eq.1) call unsfdcopy(nelr,stk(lr+nelrm),1,stk(l1+nelr),1)
+ lstk(top+1)=l1+nelr*(it2+1)
+ go to 999
+c
+c arg3(arg1,arg2)
+ 75 if(rhs.gt.3) then
+ call error(36)
+ return
+ endif
+c get arg3
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ mn3=m3*n3
+ top=top-1
+c get arg2
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ top=top-1
+c get arg1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+
+ if(m3.eq.0.or.n3.eq.0) then
+c . arg3=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m3.lt.0) then
+c .arg3=eye
+ call error(14)
+ return
+ endif
+c check and convert indices variables
+
+ call indxg(il1,m3,ili,mi,mxi,lw,11)
+ if(err.gt.0) return
+ if(mxi.gt.m3) then
+ call error(21)
+ return
+ endif
+ if(mi.lt.0) then
+ mr=m3 ! modif bruno
+ else
+ mr=mi
+ endif
+ call indxg(il2,n3,ilj,nj,mxj,lw,11)
+ if(err.gt.0) return
+ if(mxj.gt.n3) then
+ call error(21)
+ return
+ endif
+ if(nj.lt.0) then
+ nr=n3 ! modif bruno
+ else
+ nr=nj
+ endif
+c
+ 76 continue
+ if(mr.eq.0 .or. nr.eq.0) then
+c . arg1=[] or arg2=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ endif
+c get memory for the result
+ lptr=iadr(lw) ! istk(lptr) = ptr(1)
+ irc=lptr+m3+1 ! m3+1 cases pour le tableau ptr => istk(irc) = p(1)
+ ircr = irc + nr ! nr cases pour le tableau p de la permutation mnelr(1) = istk(ircr)
+ lw=sadr(ircr+mr) !
+ nelrmax = (lstk(bot)-lw)/(1+2*(it3+1)) ! nb max possible d'elts pour la matrice resultat
+ if(nelrmax.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lr=sadr(ircr+mr+nelrmax)
+ lw=lr+nelrmax*(it3+1)
+
+c perform extraction
+ if(it3.eq.0) then ! les parties imaginaires (inutilisées)
+ inc3 = 0 ! pointeront sur les parties réelles
+ incr = 0
+ else
+ inc3 = nel3
+ incr = nelrmax
+ endif
+ call spextr(m3, n3, nel3, istk(irc3), istk(irc3+m3), stk(l3),
+ $ stk(l3+inc3),
+ $ mr, nr, nelr, istk(ircr), istk(ircr+mr), stk(lr),
+ $ stk(lr+incr),
+ $ it3, istk(ili), mi, istk(ilj), nj, nelrmax,
+ $ istk(lptr), istk(irc), ierr)
+
+* subroutine spextr(A_m, A_n, A_nel, A_mnel, A_icol, A_R, A_I,
+* $ B_m, B_n, B_nel, B_mnel, B_icol, B_R, B_I,
+* $ it, i, ni, j, nj, nel_max, ptr, p, ierr)
+
+ if(ierr .eq. -1) then ! not enough memory
+ err=1 ! valeur bidon : j'imagine qu'il faut donner
+ call error(17) ! une idee a l'utilisateur de la mémoire manquante
+ return
+ endif
+
+c form resulting variable
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=5
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=it3
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(ircr),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ call unsfdcopy(nelr,stk(lr),1,stk(l1),1)
+ if(it3.eq.1) call unsfdcopy(nelr,stk(lr+nelrmax),1,stk(l1+nelr),1)
+ lstk(top+1)=l1+nelr*(it3+1)
+ go to 999
+
+*
+* insertion operations
+*
+ 80 continue
+ if(rhs.gt.4) then
+ top=top0
+ fin=-fin
+ return
+ endif
+ if(rhs.eq.4) goto 90 ! goto A(i,j) = B insertion
+*
+* here begin arg3(arg1)=arg2 insertion
+* get arg3
+ tops = top
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.5) then
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn3=m3*n3
+
+c get arg2
+ top=top-1
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ if(istk(il2).eq.5) then
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ elseif(istk(il2).eq.1) then
+ l2=sadr(il2+4)
+ nel2=m2*n2
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn2=m2*n2
+
+c get arg1
+ top=top-1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ if (istk(il1).eq.10.or.istk(il1).eq.15) then
+ top=top0
+ fin=-fin
+ return
+ endif
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+
+****************************************************************
+*
+* code added by bruno to treat the case arg3(arg1)=arg2
+* with:
+* arg1 a sparse boolean matrix of the same dimension than arg3
+* arg2 is a full vector or a scalar with nel1 elements
+*
+ if (istk(il1).eq.6 .and. m1.eq.m3 .and. n1.eq.n3 .and.
+ $ istk(il2).eq.1 .and. (m2.eq.1 .or. n2.eq.1) ) then
+ nel1 = istk(il1+4)
+ a2_is_scalar = m2.eq.1 .and. n2.eq.1
+ if (a2_is_scalar .or. m2*n2.eq.nel1) then
+ ip = iadr(lstk(tops+1))
+ if (.not. a2_is_scalar) then
+ iq = ip + n1+1
+ ilr = iq + nel1
+ else
+ iq = ip
+ ilr = ip
+ endif
+ lr = sadr(ilr + 5 + m1)
+ itr = max(it3,it2)
+ nelmax = (2*(lstk(bot)-lr)-1)/(3+2*itr)
+ if(nelmax .le. 0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ ilrc = ilr + 5 + m1
+ lr = sadr(ilrc+nelmax)
+ if (itr .eq. 0) then
+ lri = lr
+ else
+ lri = lr + nelmax
+ endif
+
+ call spif1b(m3, n3, nel3, it3, istk(irc3), istk(irc3+m3),
+ $ stk(l3), stk(l3+nel3), nel1, istk(il1+5),
+ $ istk(il1+5+m1), it2, stk(l2), stk(l2+mn2),
+ $ a2_is_scalar, nelr, itr, istk(ilr+5),
+ $ istk(ilrc), stk(lr), stk(lri), nelmax, istk(ip),
+ $ istk(iq), ierr)
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+* form the resulting var
+ istk(ilrs) = 5
+ istk(ilrs+1) = m3
+ istk(ilrs+2) = n3
+ istk(ilrs+3) = itr
+ istk(ilrs+4) = nelr
+ call icopy(m3+nelr,istk(ilr+5),1,istk(ilrs+5),1)
+ lrs = sadr(ilrs+5+m3+nelr)
+ call unsfdcopy(nelr,stk(lr),1,stk(lrs),1)
+ if (itr .eq. 1) then
+ call unsfdcopy(nelr,stk(lri),1,stk(lrs+nelr),1)
+ endif
+ lstk(top+1) = lrs + (1+itr)*nelr
+ go to 999
+ endif
+ endif
+*
+* end of the case added by Bruno
+*
+****************************************************************
+
+ if (m2.eq.0) then
+c . arg3(arg1)=[] -->[]
+ if(m1.eq.-1) then
+c . arg3(:)=[]
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m1.eq.0) then
+c . arg3([])=[] --> arg3
+ call icopy(5+m3+nel3,istk(il3),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m3+nel3)
+ call unsfdcopy(nel3*(it3+1),stk(l3),1,stk(l),1)
+* lstk(top+1)=l+mn3*(it3+1)
+ lstk(top+1)=l+nel3*(it3+1)
+ goto 999
+ else
+c . arg3(arg1)=[]
+ if(istk(il1).eq.4.and.m3.eq.m1.and.n3.eq.n1) then
+ if(.not.isany(il1)) then
+c . arg3([])=[] --> arg3
+ call icopy(5+m3+nel3,istk(il3),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m3+nel3)
+ call unsfdcopy(nel3*(it3+1),stk(l3),1,stk(l),1)
+* lstk(top+1)=l+mn3*(it3+1)
+ lstk(top+1)=l+nel3*(it3+1)
+ goto 999
+ endif
+ endif
+c . arg3(arg1)=[] -->arg3(compl(arg1),:)
+ if(m3.gt.1.and.n3.gt.1) then
+c . call macro coded op to reshape and insert
+ top=top0
+ fin=-fin
+ return
+ else
+ call indxgc(il1,mn3,ilr,mi,mx,lw)
+ if(err.gt.0) return
+ l2=l3
+ n2=n3
+ m2=m3
+ mn2=m2*n2
+ it2=it3
+ nel2=nel3
+ irc2=irc3
+c . call extraction
+ goto 72
+ endif
+ endif
+ elseif(m2.lt.0.or.m3.lt.0) then
+c . arg3=eye,arg2=eye
+ call error(14)
+ return
+ elseif(m1.lt.0) then
+c . arg3(:)=arg2 reshape arg2 according to arg3
+* CAUTION: bug if arg2 is a full matrix !
+ if(mn2.eq.mn3) then
+ if ( m2.ne.m3 ) then ! macro coded
+ top=top0
+ fin=-fin
+ return
+ elseif ( istk(il2) .eq. 5 ) then ! equal sizes arg2 is a sparse
+ istk(ilrs)=5
+ istk(ilrs+1)=m3
+ istk(ilrs+2)=n3
+ call icopy(2+m2+nel2,istk(il2+3),1,istk(ilrs+3),1)
+ l1=sadr(ilrs+5+m2+nel2)
+ call unsfdcopy(nel2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+nel2*(it2+1)
+ return
+ else ! equal sizes arg2 is a full matrix
+ istk(ilrs)=1
+ istk(ilrs+1)=m3
+ istk(ilrs+2)=n3
+ istk(ilrs+3)=it2
+ l1=sadr(ilrs+4)
+ call unsfdcopy(mn2*(it2+1),stk(l2),1,stk(l1),1)
+ lstk(top+1)=l1+mn2*(it2+1)
+ return
+ endif
+ elseif(mn2.eq.1) then
+ istk(ilrs)=1
+ istk(ilrs+1)=m3
+ istk(ilrs+2)=n3
+ istk(ilrs+3)=it2
+ l1=sadr(ilrs+4)
+ call dset(mn3,stk(l2),stk(l1),1)
+ if(it2.eq.1) call dset(mn3,stk(l2+1),stk(l1+mn3),1)
+ lstk(top+1)=l1+mn3*(it2+1)
+ return
+ else
+ call error(15)
+ return
+ endif
+ elseif(m3.gt.1.and.n3.gt.1) then
+c . arg3(arg1)=arg2 with arg3 not a vector
+ top=top0
+ fin=-fin
+ return
+ endif
+
+
+ 81 call indxg(il1,mn3,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.eq.0) then
+c . arg3([])=arg2
+ if(mn2.eq.1) then
+c . arg3([])=c --> arg3
+ call icopy(5+m3+nel3,istk(il3),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m3+nel3)
+ call unsfdcopy(nel3*(it3+1),stk(l3),1,stk(l),1)
+* lstk(top+1)=l+mn3*(it3+1)
+ lstk(top+1)=l+nel3*(it3+1)
+ goto 999
+ else
+ call error(15)
+ return
+ endif
+ endif
+ if(mi.ne.mn2) then
+ if(mn2.gt.1) then
+ call error(15)
+ return
+ elseif(istk(il2).ne.1) then
+ top=top0
+ fin=-fin
+ return
+ endif
+ endif
+c
+ if (n3.gt.1.and.m3.gt.1) then ! ce test est inutile puisque ce cas est traite par macro
+c . arg3 is not a vector
+ if(n2.gt.1.and.m2.gt.1) then
+ call error(15)
+ return
+ endif
+ if(mxi.gt.m3*n3) then
+ call error(21)
+ return
+ endif
+ mr=m3
+ nr=n3
+ elseif (n3.le.1.and.n2.le.1) then
+c . arg3 and arg2 are column vectors
+ mr=max(m3,mxi)
+ nr=max(n3,1)
+ elseif (m3.le.1.and.m2.le.1) then
+c . row vectors
+ nr=max(n3,mxi)
+ mr=max(m3,1)
+ else
+c . arg3 and arg2 dimensions dont agree
+ call error(15)
+ return
+ endif
+
+c set output sizes
+ if (m3 .gt. 1.or.m1.lt.0) then
+c . column vector
+ m=mi
+ n=-1
+ mr = mi
+ nr = 1
+ else
+c . row vector
+ m=-1
+ n=mi
+ nr = mi
+ mr = 1
+ endif
+ itr=max(it2,it3)
+ lptr=iadr(lw)
+ irc=lptr+mr+1
+ lw=sadr(irc+mr)
+ nelr=(lstk(bot)-lw-1)/(1+2*(itr+1))
+ if(nelr.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lr=sadr(irc+mr+nelr)
+ lw=lr+nelr*(itr+1)
+ nel=nelr
+ if(istk(il2).eq.5) then
+ if(itr.eq.0) then
+ call dspisp(m3,n3,stk(l3),nel3,istk(irc3),
+ $ istk(ili),m,istk(ili),n,
+ $ m2,n2,stk(l2),nel2,istk(irc2),
+ $ mr,nr,stk(lr),nelr,istk(irc),istk(lptr),ierr)
+ else
+ call wspisp(m3,n3,stk(l3),stk(l3+nel3),nel3,istk(irc3),
+ $ istk(ili),m,istk(ili),n,
+ $ m2,n2,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ mr,nr,stk(lr),stk(lr+nelr),nelr,istk(irc),
+ $ istk(lptr),ierr,it3,it2)
+ endif
+ else
+ if(itr.eq.0) then
+ call dspis(m3,n3,stk(l3),nel3,istk(irc3),
+ $ istk(ili),m,istk(ili),n,
+ $ m2,n2,stk(l2),
+ $ mr,nr,stk(lr),nelr,istk(irc),ierr)
+ else
+ call wspis(m3,n3,stk(l3),stk(l3+nel3),nel3,istk(irc3),
+ $ istk(ili),m,istk(ili),n,
+ $ m2,n2,stk(l2),stk(l2+nel2),
+ $ mr,nr,stk(lr),stk(lr+nelr),nelr,istk(irc),
+ $ ierr,it3,it2)
+ endif
+ endif
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ istk(ilrs)=5
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=itr
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ call unsfdcopy(nelr,stk(lr),1,stk(l1),1)
+ if(itr.eq.1) call unsfdcopy(nelr,stk(lr+nel),1,stk(l1+nelr),1)
+ lstk(top+1)=l1+nelr*(itr+1)
+ go to 999 ! c'est un return
+
+ 90 continue
+c **** insertion arg4(arg1,arg2)=arg3 *****
+c (comments added by Bruno to try to understand this stuff)
+
+c get arg4
+ il4=iadr(lstk(top))
+ top4 = top ! pour le cas en place
+ if(istk(il4).lt.0) il4=iadr(istk(il4+1))
+ m4=istk(il4+1)
+ n4=istk(il4+2)
+ it4=istk(il4+3)
+ if(istk(il4).eq.5) then ! arg4 is a sparse matrix
+ nel4=istk(il4+4)
+ irc4=il4+5 ! irc4 index in istk for the arrays mnel(m4 elts) and icol(nel4 elts)
+ l4=sadr(irc4+m4+nel4) ! l4 index in stk for the coef arrays (real and complex if any)
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn4=m4*n4
+
+c get arg3 ! for insertion arg4(arg1,arg2)=arg3
+ top=top-1
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.5) then ! arg3 is a sparse matrix
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ elseif(istk(il3).eq.1) then ! arg3 is a full matrix
+ l3=sadr(il3+4)
+ nel3=m3*n3
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn3=m3*n3
+
+c get arg2 ! for insertion arg4(arg1,arg2)=arg3
+ top=top-1
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+
+c get arg1 ! for insertion arg4(arg1,arg2)=arg3
+ top=top-1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+
+ if (m3.eq.0) then ! So this is the operation arg4(arg1,arg2) = [] => all rows of
+ ! of indices arg1 and all columns of indices arg2 must be deleted.
+ ! In the following many special cases are taken into account
+ ! this is certainly not necessary.
+ if(m1.eq.-1.and.m2.eq.-1) then
+ ! this is arg4(:,:)=[] and so arg4 becomes an empty matrix arg4 <- []
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999 ! goto the end
+
+ elseif(m1.eq.0.or.m2.eq.0) then
+ ! this is arg4([],arg2)=[] or arg4(arg1,[])=[] --> arg4 is not modified
+ call icopy(5+m4+nel4,istk(il4),1,istk(ilrs),1) ! ilrs index in istk of the result
+ l=sadr(ilrs+5+m4+nel4)
+ call unsfdcopy(nel4*(it4+1),stk(l4),1,stk(l),1)
+ lstk(top+1)=l+mn4*(it4+1)
+ goto 999
+
+ elseif(m2.eq.-1) then
+ ! this is arg3(arg1,:)=[] --> arg3(compl(arg1),:)
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ if(err.gt.0) return
+ mr=mi
+ call indxg(il2,n4,ilj,nj,mxj,lw,11)
+ if(err.gt.0) return
+ if(nj.lt.0) then
+ nr=mxj
+ else
+ nr=nj
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ mn3=m3*n3
+ it3=it4
+ irc3=irc4
+ nel3=nel4
+c . call extraction (the result is arg3(compl(arg1),:))
+ goto 76
+
+ elseif(m1.eq.-1) then
+ ! this is arg4(:,arg2)=[] --> arg4(:,compl(arg2))
+ call indxgc(il2,n4,ilj,nj,mxj,lw)
+ if(err.gt.0) return
+ nr=nj
+ call indxg(il1,m4,ili,mi,mxi,lw,11)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr=mxi
+ else
+ mr=mi
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ mn3=m3*n3
+ it3=it4
+ irc3=irc4
+ nel3=nel4
+c . call extraction (the result is arg3(:,compl(arg2)))
+ goto 76
+ else
+ ! this is arg4(arg1,arg2)=[]
+ lw1=lw
+ call indxgc(il2,n4,ilj,nj,mxj,lw)
+ if(err.gt.0) return
+ nr=nj
+ if(nj.eq.0) then
+c . arg4(arg1,1:n4)=[]
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ lw2=lw
+ if(err.gt.0) return
+ mr=mi
+c . arg2=1:n3
+ if(mi.eq.0) then
+c . arg4(1:m4,1:n4)=[]
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ else
+c . arg4(arg1,1:n4)=[]
+c . replace arg2 by ":"
+ il2=iadr(lw2)
+ istk(il2)=1
+ istk(il2+1)=-1
+ istk(il2+2)=-1
+ istk(il2+3)=0
+c .
+ lw=lw2+2
+ call indxg(il2,n4,ilj,nj,mxj,lw,11)
+ if(err.gt.0) return
+ if(nj.lt.0) then
+ nr=mxj
+ else
+ nr=nj
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ it3=it4
+ mn3=m3*n3
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ endif
+ elseif(nj.eq.n4) then
+c arg4(arg1,[])=[] --> arg4
+ call icopy(5+m4+nel4,istk(il4),1,istk(ilrs),1) ! ilrs index in istk of the result
+ l=sadr(ilrs+5+m4+nel4)
+ call unsfdcopy(nel4*(it4+1),stk(l4),1,stk(l),1)
+ lstk(top+1)=l+mn4*(it4+1)
+ goto 999
+ else
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ if(err.gt.0) return
+ if(mi.eq.0) then
+c . arg4(1:m4,arg2)=[]
+ call indxg(il1,m4,ili,mi,mxi,lw,11)
+ if(err.gt.0) return
+C . given set is larger than 1:m4
+ mi=min(m4,mi)
+
+ if(mi.lt.0) then
+ mr=mxi
+ else
+ mr=mi
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ it3=it4
+ mn3=m3*n3
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ elseif(mi.eq.m4) then
+c arg4([],arg2)=[] --> arg4
+ call icopy(5+m4+nel4,istk(il4),1,istk(ilrs),1) ! ilrs index in istk of the result
+ l=sadr(ilrs+5+m4+nel4)
+ call unsfdcopy(nel4*(it4+1),stk(l4),1,stk(l),1)
+ lstk(top+1)=l+mn4*(it4+1)
+ goto 999
+ else
+ call error(15)
+ return
+ endif
+ endif
+ endif
+
+ elseif(m3.lt.0.or.m4.lt.0) then
+c . arg3=eye , arg4=eye
+ call error(14)
+ return
+
+ elseif(m1.eq.-1.and.m2.eq.-1) then
+c . arg4(:,:)=arg3
+ if(mn3.eq.mn4) then
+* reshape arg3 according to arg4
+ if ( istk(il3) .eq. 1 ) then ! arg3 is a full matrix
+ istk(ilrs)=1 ! => change of type (sparse -> full)
+ istk(ilrs+1)=m4
+ istk(ilrs+2)=n4
+ istk(ilrs+3)=it3
+ l1=sadr(ilrs+4)
+ call unsfdcopy(mn3*(it3+1),stk(l3),1,stk(l1),1)
+ lstk(top+1)=l1+mn3*(it3+1)
+ return
+ else ! arg3 is a sparse matrix
+ if( m3 .eq. m4 ) then
+ istk(ilrs)=5
+ istk(ilrs+1)=m4
+ istk(ilrs+2)=n4
+ call icopy(2+m3+nel3,istk(il3+3),1,istk(ilrs+3),1)
+ l1=sadr(ilrs+5+m3+nel3)
+ call unsfdcopy(nel3*(it3+1),stk(l3),1,stk(l1),1)
+ lstk(top+1)=l1+nel3*(it3+1)
+ return
+ else
+ top=top0 ! macro coded in %sp_i_sp.sci
+ fin=-fin
+ return
+ endif
+ endif
+ elseif(mn3.eq.1) then ! arg4(:,:)=arg3 with arg3 a scalar
+ istk(ilrs)=1 ! => change of type (sparse -> full)
+ istk(ilrs+1)=m4
+ istk(ilrs+2)=n4
+ istk(ilrs+3)=it3
+ l1=sadr(ilrs+4)
+ call dset(mn4,stk(l3),stk(l1),1)
+ if(it3.eq.1) call dset(mn4,stk(l3+1),stk(l1+mn4),1)
+ lstk(top+1)=l1+mn4*(it3+1)
+ return
+ else
+ call error(15)
+ return
+ endif
+ endif
+
+ ! insertion arg4(arg1,arg2)=arg3 : treatment of indices vectors arg1 and arg2
+ call indxg(il1,m4,ili,mi,mxi,lw,11)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr1=mxi ! car indice implicite :
+ else
+ mr1=mi
+ endif
+ call indxg(il2,n4,ilj,mj,mxj,lw,11)
+ if(err.gt.0) return
+ if(mj.lt.0) then
+ nr1=mxj ! car indice implicite :
+ else
+ nr1=mj
+ endif
+ if(mr1.ne.m3.or.nr1.ne.n3) then
+c . sizes of arg1 or arg2 dont agree with arg3 sizes
+ if(m3*n3.eq.1) then
+ if(mr1.eq.0.or.nr1.eq.0) then
+ call icopy(5+m4+nel4,istk(il4),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m4+nel4)
+ call unsfdcopy(nel4*(it4+1),stk(l4),1,stk(l),1)
+ lstk(top+1)=l+mn4*(it4+1)
+ goto 999
+ endif
+ if(istk(il3).eq.5) then ! A(i,j) = B with B a 1x1 sparse matrix
+ top=top0 ! is macro coded (see second case of %sp_i_sp.sci)
+ fin=-fin
+ return
+ endif
+ else
+ call error(15)
+ return
+ endif
+ else
+ if(mr1.eq.0.or.nr1.eq.0) then
+ call error(15)
+ return
+ endif
+ endif
+ mr=max(m4,mxi)
+ nr=max(n4,mxj)
+
+* try if we can do insertion in place
+ if ( (istk(il3).eq.1) .and. (it4.ge.it3)
+ $ .and. (mi.gt.0).and.(mj.gt.0).and.(mi.le.m4).and.(mj.le.n4)
+ $ .and. (mi*mj.lt.nel4/4) ) then
+*
+ lws = lw ! sauvegarde
+ lptr=iadr(lw) ! for ptr (size m4)
+ lka = lptr + m4 ! for ka (size mi*mj)
+ lw = sadr(lka+mi*mj)
+ err=lw-lstk(bot)
+ if (err .gt. 0) then
+ call error(17)
+ return
+ endif
+ call spifp(m4, n4, nel4, istk(irc4), istk(irc4+m4), stk(l4),
+ $ stk(l4+it4*nel4), it4, istk(ili), mi, istk(ilj), mj,
+ $ istk(lptr), istk(lka), it3, stk(l3),
+ $ stk(l3+mi*mj*it3), iflag)
+ if (iflag .eq. 1) then ! yes insertion in place is OK (and also done by spifp)
+ k=istk(iadr(lstk(top4))+2)
+ top = top - 1
+ call setref(k)
+ goto 999
+ else
+ lw = lws
+ endif
+ endif
+
+ itr=max(it4,it3)
+ if(istk(il3).eq.5) then ! insertion sparse(ind_i, ind_j) = sparse matrix
+ ! accelerated by bruno for Jean-François 's simulations
+
+ ipi = iadr(lw) ! indice pour pi
+ ipj = ipi + max(0,mi) ! indice pour pj
+ ipptr_row = ipj + max(0,mj) ! indice pour B_ptr_row
+ irc = ipptr_row + m3+1 ! indice pour C_mnel
+ lw = sadr(irc + mr) ! indice de stk à partir duquel il faut caser C_icol, C_R et C_I
+ nelmax = 2*(lstk(bot)-lw)/(1+2*(itr+1))
+ if(nelmax .le. 0) then
+ err = lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lr = sadr(irc + mr + nelmax)
+ lw = lr + nelmax*(itr + 1)
+
+c arg4(arg1,arg2)=arg3 A(i,j) = B
+* subroutine spisp(A_m, A_n, A_nel, A_it, A_mnel, A_icol, A_R, A_I,
+* $ B_m, B_n, B_nel, B_it, B_mnel, B_icol, B_R, B_I,
+* $ C_m, C_n, C_nel, C_it, C_mnel, C_icol, C_R, C_I,
+* $ B_ptr_row, i, pi, ni, j, pj, nj, nelmax, ierr)
+
+ call spisp(m4,n4,nel4,it4,istk(irc4),istk(irc4+m4),
+ $ stk(l4),stk(l4+it4*nel4),
+ $ m3,n3,nel3,it3,istk(irc3),istk(irc3+m3),
+ $ stk(l3),stk(l3+it3*nel3),
+ $ mr,nr,nelr,itr,istk(irc), istk(irc+mr),
+ $ stk(lr), stk(lr+itr*nelmax),
+ $ istk(ipptr_row), istk(ili), istk(ipi), mi,
+ $ istk(ilj), istk(ipj), mj, nelmax, ierr)
+ nel = nelmax
+
+ else ! insertion sparse(ind_i, ind_j) = full matrix
+
+ ipi = iadr(lw) ! indice pour pi
+ ipj = ipi + max(0,mi) ! indice pour pj
+ irc = ipj + max(0,mj) ! indice pour C_mnel
+ lw = sadr(irc + mr) ! indice de stk à partir duquel il faut caser C_icol, C_R et C_I
+ nelmax = 2*(lstk(bot)-lw)/(1+2*(itr+1))
+ if(nelmax .le. 0) then
+ err = lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lr = sadr(irc + mr + nelmax)
+ lw = lr + nelmax*(itr + 1)
+
+c arg4(arg1,arg2)=arg3 A(i,j) = B
+* subroutine spif(A_m, A_n, A_nel, A_it, A_mnel, A_icol, A_R, A_I,
+* $ B_m, B_n, B_it, B_R, B_I,
+* $ C_m, C_n, C_nel, C_it, C_mnel, C_icol, C_R, C_I,
+* $ i, pi, ni, j, pj, nj, nelmax, ierr)
+*
+ call spif(m4,n4,nel4,it4,istk(irc4),istk(irc4+m4),
+ $ stk(l4),stk(l4+it4*nel4),
+ $ m3,n3,it3,stk(l3),stk(l3+it3*m3*n3),
+ $ mr,nr,nelr,itr,istk(irc), istk(irc+mr),
+ $ stk(lr), stk(lr+itr*nelmax),
+ $ istk(ili), istk(ipi), mi, istk(ilj), istk(ipj), mj,
+ $ nelmax, ierr)
+ nel = nelmax
+
+ endif
+
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ istk(ilrs)=5
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=itr
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ call unsfdcopy(nelr,stk(lr),1,stk(l1),1)
+ if(itr.eq.1) call unsfdcopy(nelr,stk(lr+nel),1,stk(l1+nelr),1)
+ lstk(top+1)=l1+nelr*(itr+1)
+ go to 999
+c
+c *. /. \.
+ 120 fin=-fin
+ top=top+1
+ goto 999
+c
+ 130 continue
+ if(fin.eq.61) then
+ fin=-fin
+ top=top+1
+ goto 999
+ endif
+
+c comparaisons
+ if(max(it1,it2).eq.1) then
+ if(op.ne.equal.and.op.ne.less+great) then
+ fin=-fin
+ top=top0
+ return
+ endif
+ endif
+ if (a1_is_empty .and. a2_is_empty) then
+ if(op.eq.equal.or.op.eq.less+great) then
+ istk(il1)=4
+ istk(il1+1)=1
+ istk(il1+2)=1
+ istk(il1+3)=1
+ if(op.eq.less+great) istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)
+ goto 999
+ else
+ call error(60)
+ return
+ endif
+ endif
+ if( (a1_is_empty .or. a2_is_empty).or.
+ & (.not.a1_is_scalar .and. .not. a2_is_scalar)) then
+ if(n1.ne.n2.or.m1.ne.m2) then
+ if(op.eq.equal.or.op.eq.less+great) then
+ istk(il1)=4
+ istk(il1+1)=1
+ istk(il1+2)=1
+ istk(il1+3)=0
+ if(op.eq.less+great) istk(il1+3)=1
+ lstk(top+1)=sadr(il1+4)
+ return
+ else
+ call error(60)
+ return
+ endif
+ endif
+ endif
+c
+ mr=m1
+ nr=n1
+ if( a1_is_scalar ) then
+ mr=m2
+ nr=n2
+ endif
+ irc=iadr(lw)
+ nelmx=(iadr(lstk(bot))-irc-mr-10)
+ lw=sadr(irc+mr+nelmx)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel=nelmx
+ if(istk(il1).eq.1) then
+ if(itr.eq.1) then
+ call wsosp(op,m1,n1,stk(l1),stk(l1+nel1),
+ $ m2,n2,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ nel,istk(irc),ierr,it1,it2)
+ else
+ call dsosp(op,m1,n1,stk(l1),m2,n2,stk(l2),nel2,
+ $ istk(irc2),nel,istk(irc),ierr)
+ endif
+ elseif(istk(il2).eq.1) then
+ if(itr.eq.1) then
+ call wspos(op,m1,n1,stk(l1),stk(l1+nel1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),stk(l2+nel2),
+ $ nel,istk(irc),ierr,it1,it2)
+ else
+ call dspos(op,m1,n1,stk(l1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),nel,istk(irc),ierr)
+ endif
+ else
+ if(itr.eq.1) then
+ call wsposp(op,m1,n1,stk(l1),stk(l1+nel1),nel1,
+ $ istk(irc1),m2,n2,stk(l2),stk(l2+nel2),nel2,istk(irc2),
+ $ nel,istk(irc),ierr,it1,it2)
+ else
+ call dsposp(op,m1,n1,stk(l1),nel1,istk(irc1),
+ $ m2,n2,stk(l2),nel2,istk(irc2),
+ $ nel,istk(irc),ierr)
+ endif
+ endif
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ istk(il1)=6
+ istk(il1+1)=mr
+ istk(il1+2)=nr
+
+ istk(il1+3)=0
+ istk(il1+4)=nel
+ irc1=il1+5
+ call icopy(mr+nel,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+mr+nel)
+ lstk(top+1)=l1
+ go to 999
+c
+c kronecker
+ 200 continue
+ top=top0
+ fin=-fin
+ return
+
+
+c
+
+ 999 return
+ end
diff --git a/modules/sparse/sci_gateway/fortran/spops.lo b/modules/sparse/sci_gateway/fortran/spops.lo
new file mode 100755
index 000000000..33a630b87
--- /dev/null
+++ b/modules/sparse/sci_gateway/fortran/spops.lo
@@ -0,0 +1,12 @@
+# sci_gateway/fortran/spops.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spops.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/sci_gateway/sparse_gateway.xml b/modules/sparse/sci_gateway/sparse_gateway.xml
new file mode 100755
index 000000000..330aa3bfc
--- /dev/null
+++ b/modules/sparse/sci_gateway/sparse_gateway.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) XXXX-2008 - INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ -->
+
+<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
+<GATEWAY name="sparse">
+ <!-- =================== -->
+ <!--
+ Scilab
+ Interface description. In this file, we define the list of the function which
+ will be available into Scilab and the link to the "native" function.
+
+ gatewayId is the position in the hashtable 'Interfaces' defined in the
+ file SCI/modules/core/src/c/callinterf.h
+
+ primitiveId is the position in the hashtable '<module>Table Tab[]' defined
+ in the file modules/<module>/sci_gateway/c/gw_<module>.c
+
+ primitiveName is the name of the Scilab function
+
+ @author Allan CORNET
+ @author Sylvestre LEDRU
+ @date INRIA 2007
+ ===================
+ Don't touch if you do not know what you are doing
+-->
+ <!-- =================== -->
+
+ <PRIMITIVE gatewayId="27" primitiveId="1" primitiveName="sparse" />
+ <PRIMITIVE gatewayId="27" primitiveId="2" primitiveName="spget" />
+ <PRIMITIVE gatewayId="27" primitiveId="3" primitiveName="full" />
+ <PRIMITIVE gatewayId="27" primitiveId="4" primitiveName="lufact" />
+ <PRIMITIVE gatewayId="27" primitiveId="5" primitiveName="lusolve" />
+ <PRIMITIVE gatewayId="27" primitiveId="6" primitiveName="ludel" />
+ <PRIMITIVE gatewayId="27" primitiveId="7" primitiveName="luget" />
+ <PRIMITIVE gatewayId="27" primitiveId="9" primitiveName="nnz" />
+ <PRIMITIVE gatewayId="27" primitiveId="13" primitiveName="spchol" />
+ <PRIMITIVE gatewayId="27" primitiveId="14" primitiveName="fadj2sp" />
+ <PRIMITIVE gatewayId="27" primitiveId="15" primitiveName="spcompack" />
+ <PRIMITIVE gatewayId="27" primitiveId="16" primitiveName="ordmmd" />
+ <PRIMITIVE gatewayId="27" primitiveId="17" primitiveName="blkfc1i" />
+ <PRIMITIVE gatewayId="27" primitiveId="18" primitiveName="blkslvi" />
+ <PRIMITIVE gatewayId="27" primitiveId="19" primitiveName="inpnvi" />
+ <PRIMITIVE gatewayId="27" primitiveId="20" primitiveName="sfinit" />
+ <PRIMITIVE gatewayId="27" primitiveId="21" primitiveName="symfcti" />
+ <PRIMITIVE gatewayId="27" primitiveId="22" primitiveName="bfinit" />
+ <PRIMITIVE gatewayId="27" primitiveId="23" primitiveName="mtlb_sparse" />
+ <PRIMITIVE gatewayId="27" primitiveId="24" primitiveName="%msp_spget" />
+ <PRIMITIVE gatewayId="27" primitiveId="25" primitiveName="%msp_full" />
+ <PRIMITIVE gatewayId="27" primitiveId="26" primitiveName="ta2lpd" />
+</GATEWAY>
diff --git a/modules/sparse/sparse.iss b/modules/sparse/sparse.iss
new file mode 100755
index 000000000..6aa842085
--- /dev/null
+++ b/modules/sparse/sparse.iss
@@ -0,0 +1,46 @@
+;
+; Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+; Copyright (C) INRIA - Allan CORNET
+; Copyright (C) DIGITEO - 2010 - Allan CORNET
+;
+; This file must be used under the terms of the CeCILL.
+; This source file is licensed as described in the file COPYING, which
+; you should have received as part of this distribution. The terms
+; are also available at
+; http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+;
+;--------------------------------------------------------------------------------------------------------------
+; Inno Setup Script (5.3 and more) for Scilab (UNICODE version required)
+;
+;--------------------------------------------------------------------------------------------------------------
+; sparse module
+;--------------------------------------------------------------------------------------------------------------
+;
+#define SPARSE "sparse"
+;
+Source: bin\{#SPARSE}_f.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
+Source: bin\{#SPARSE}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#SPARSE}\license.txt; DestDir: {app}\modules\{#SPARSE}; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#SPARSE}\sci_gateway\{#SPARSE}_gateway.xml; DestDir: {app}\modules\{#SPARSE}\sci_gateway; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#SPARSE}\etc\{#SPARSE}.quit; DestDir: {app}\modules\{#SPARSE}\etc; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\etc\{#SPARSE}.start; DestDir: {app}\modules\{#SPARSE}\etc; Components: {#COMPN_SCILAB}
+;
+;
+;Source: modules\{#SPARSE}\includes\*.h; DestDir: {app}\modules\{#SPARSE}\includes; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#SPARSE}\macros\buildmacros.sce; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\buildmacros.bat; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\cleanmacros.bat; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\lib; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\names; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\*.bin; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+Source: modules\{#SPARSE}\macros\*.sci; DestDir: {app}\modules\{#SPARSE}\macros; Components: {#COMPN_SCILAB}
+;
+;Source: modules\{#SPARSE}\demos\*.*; DestDir: {app}\modules\{#SPARSE}\demos; Flags: recursesubdirs; Components: {#COMPN_SCILAB}
+;
+Source: modules\{#SPARSE}\tests\*.*; DestDir: {app}\modules\{#SPARSE}\tests; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_TESTS}
+;
+;--------------------------------------------------------------------------------------------------------------
diff --git a/modules/sparse/src/c/.deps/.dirstamp b/modules/sparse/src/c/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/src/c/.deps/.dirstamp
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-lu.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-lu.Plo
new file mode 100755
index 000000000..05c957681
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-lu.Plo
@@ -0,0 +1,189 @@
+src/c/libscisparse_algo_la-lu.lo: src/c/lu.c /usr/include/stdc-predef.h \
+ src/c/lu.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h \
+ ../../modules/output_stream/includes/cerro.h \
+ ../../modules/core/includes/machine.h \
+ ../../modules/localization/includes/localization.h \
+ /usr/include/libintl.h /usr/include/locale.h \
+ /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/xlocale.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h includes/dynlib_sparse.h \
+ ../../modules/output_stream/includes/Scierror.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ ../../modules/output_stream/includes/do_error_number.h
+
+/usr/include/stdc-predef.h:
+
+src/c/lu.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+../../modules/output_stream/includes/cerro.h:
+
+../../modules/core/includes/machine.h:
+
+../../modules/localization/includes/localization.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+/usr/include/xlocale.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+includes/dynlib_sparse.h:
+
+../../modules/output_stream/includes/Scierror.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+../../modules/output_stream/includes/do_error_number.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-mspelm.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-mspelm.Plo
new file mode 100755
index 000000000..44a1fc46d
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-mspelm.Plo
@@ -0,0 +1,214 @@
+src/c/libscisparse_algo_la-mspelm.lo: src/c/mspelm.c \
+ /usr/include/stdc-predef.h ../../modules/core/includes/stack-c.h \
+ /usr/include/string.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/xlocale.h \
+ /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h \
+ ../../modules/core/includes/core_math.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h \
+ ../../modules/core/includes/stack-def.h \
+ ../../modules/core/includes/machine.h \
+ ../../modules/core/includes/stackTypeVariable.h \
+ ../../modules/core/includes/BOOL.h \
+ ../../modules/core/includes/doublecomplex.h \
+ ../../modules/core/includes/stack1.h \
+ ../../modules/core/includes/scisparse.h \
+ ../../modules/core/includes/stack2.h \
+ ../../modules/core/includes/stack3.h \
+ ../../modules/core/includes/stack-optional.h \
+ ../../modules/core/includes/sci_types.h \
+ ../../modules/output_stream/includes/Scierror.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ ../../modules/output_stream/includes/do_error_number.h \
+ ../../modules/core/includes/machine.h \
+ ../../modules/elementary_functions/includes/elementary_functions.h \
+ ../../modules/elementary_functions/includes/int2db.h \
+ ../../modules/elementary_functions/includes/dynlib_elementary_functions.h \
+ ../../modules/output_stream/includes/basout.h \
+ ../../modules/output_stream/includes/dynlib_output_stream.h
+
+/usr/include/stdc-predef.h:
+
+../../modules/core/includes/stack-c.h:
+
+/usr/include/string.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+../../modules/core/includes/stack-def.h:
+
+../../modules/core/includes/machine.h:
+
+../../modules/core/includes/stackTypeVariable.h:
+
+../../modules/core/includes/BOOL.h:
+
+../../modules/core/includes/doublecomplex.h:
+
+../../modules/core/includes/stack1.h:
+
+../../modules/core/includes/scisparse.h:
+
+../../modules/core/includes/stack2.h:
+
+../../modules/core/includes/stack3.h:
+
+../../modules/core/includes/stack-optional.h:
+
+../../modules/core/includes/sci_types.h:
+
+../../modules/output_stream/includes/Scierror.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+../../modules/output_stream/includes/do_error_number.h:
+
+../../modules/core/includes/machine.h:
+
+../../modules/elementary_functions/includes/elementary_functions.h:
+
+../../modules/elementary_functions/includes/int2db.h:
+
+../../modules/elementary_functions/includes/dynlib_elementary_functions.h:
+
+../../modules/output_stream/includes/basout.h:
+
+../../modules/output_stream/includes/dynlib_output_stream.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spAllocate.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spAllocate.Plo
new file mode 100755
index 000000000..bd69c53be
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spAllocate.Plo
@@ -0,0 +1,161 @@
+src/c/libscisparse_algo_la-spAllocate.lo: src/c/spAllocate.c \
+ /usr/include/stdc-predef.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h includes/spmalloc.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h src/c/spAllocate.h
+
+/usr/include/stdc-predef.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+includes/spmalloc.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+src/c/spAllocate.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spBuild.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spBuild.Plo
new file mode 100755
index 000000000..fb95ab5d9
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spBuild.Plo
@@ -0,0 +1,164 @@
+src/c/libscisparse_algo_la-spBuild.lo: src/c/spBuild.c \
+ /usr/include/stdc-predef.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h includes/spmalloc.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h src/c/spBuild.h \
+ src/c/spAllocate.h
+
+/usr/include/stdc-predef.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+includes/spmalloc.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+src/c/spBuild.h:
+
+src/c/spAllocate.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spFactor.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spFactor.Plo
new file mode 100755
index 000000000..4a92d1ff0
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spFactor.Plo
@@ -0,0 +1,166 @@
+src/c/libscisparse_algo_la-spFactor.lo: src/c/spFactor.c \
+ /usr/include/stdc-predef.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h includes/spmalloc.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h src/c/spFortran.h \
+ ../../modules/core/includes/machine.h src/c/spBuild.h
+
+/usr/include/stdc-predef.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+includes/spmalloc.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+src/c/spFortran.h:
+
+../../modules/core/includes/machine.h:
+
+src/c/spBuild.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spOutput.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spOutput.Plo
new file mode 100755
index 000000000..be12a3786
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spOutput.Plo
@@ -0,0 +1,218 @@
+src/c/libscisparse_algo_la-spOutput.lo: src/c/spOutput.c \
+ /usr/include/stdc-predef.h /usr/include/stdio.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h includes/spmalloc.h \
+ /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h \
+ ../../modules/localization/includes/localization.h \
+ ../../modules/core/includes/machine.h /usr/include/libintl.h \
+ /usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
+ /usr/include/xlocale.h \
+ ../../modules/localization/includes/charEncoding.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar2.h \
+ /usr/include/x86_64-linux-gnu/sys/stat.h \
+ /usr/include/x86_64-linux-gnu/bits/stat.h \
+ ../../modules/core/includes/BOOL.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/values.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+includes/spmalloc.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+../../modules/localization/includes/localization.h:
+
+../../modules/core/includes/machine.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+/usr/include/xlocale.h:
+
+../../modules/localization/includes/charEncoding.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar2.h:
+
+/usr/include/x86_64-linux-gnu/sys/stat.h:
+
+/usr/include/x86_64-linux-gnu/bits/stat.h:
+
+../../modules/core/includes/BOOL.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/values.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spSolve.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spSolve.Plo
new file mode 100755
index 000000000..ecc6d98be
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spSolve.Plo
@@ -0,0 +1,151 @@
+src/c/libscisparse_algo_la-spSolve.lo: src/c/spSolve.c \
+ /usr/include/stdc-predef.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h includes/spmatrix.h \
+ includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h
+
+/usr/include/stdc-predef.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
diff --git a/modules/sparse/src/c/.deps/libscisparse_algo_la-spUtils.Plo b/modules/sparse/src/c/.deps/libscisparse_algo_la-spUtils.Plo
new file mode 100755
index 000000000..5133c4be9
--- /dev/null
+++ b/modules/sparse/src/c/.deps/libscisparse_algo_la-spUtils.Plo
@@ -0,0 +1,163 @@
+src/c/libscisparse_algo_la-spUtils.lo: src/c/spUtils.c \
+ /usr/include/stdc-predef.h includes/spConfig.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
+ /usr/include/limits.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/local_lim.h \
+ /usr/include/linux/limits.h \
+ /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/float.h src/c/spUtils.h \
+ includes/spmatrix.h includes/spConfig.h includes/spDefs.h \
+ ../../modules/core/includes/core_math.h /usr/include/math.h \
+ /usr/include/x86_64-linux-gnu/bits/math-vector.h \
+ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_val.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_valf.h \
+ /usr/include/x86_64-linux-gnu/bits/huge_vall.h \
+ /usr/include/x86_64-linux-gnu/bits/inf.h \
+ /usr/include/x86_64-linux-gnu/bits/nan.h \
+ /usr/include/x86_64-linux-gnu/bits/mathdef.h \
+ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \
+ /usr/include/x86_64-linux-gnu/bits/mathinline.h /usr/include/stdlib.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h includes/spmalloc.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h src/c/spBuild.h
+
+/usr/include/stdc-predef.h:
+
+includes/spConfig.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h:
+
+/usr/include/limits.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix1_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/local_lim.h:
+
+/usr/include/linux/limits.h:
+
+/usr/include/x86_64-linux-gnu/bits/posix2_lim.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/float.h:
+
+src/c/spUtils.h:
+
+includes/spmatrix.h:
+
+includes/spConfig.h:
+
+includes/spDefs.h:
+
+../../modules/core/includes/core_math.h:
+
+/usr/include/math.h:
+
+/usr/include/x86_64-linux-gnu/bits/math-vector.h:
+
+/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_val.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_valf.h:
+
+/usr/include/x86_64-linux-gnu/bits/huge_vall.h:
+
+/usr/include/x86_64-linux-gnu/bits/inf.h:
+
+/usr/include/x86_64-linux-gnu/bits/nan.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathdef.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathcalls.h:
+
+/usr/include/x86_64-linux-gnu/bits/mathinline.h:
+
+/usr/include/stdlib.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+includes/spmalloc.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+src/c/spBuild.h:
diff --git a/modules/sparse/src/c/.dirstamp b/modules/sparse/src/c/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/src/c/.dirstamp
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-lu.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-lu.o
new file mode 100755
index 000000000..9b7038fad
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-lu.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-mspelm.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-mspelm.o
new file mode 100755
index 000000000..a865cc180
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-mspelm.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spAllocate.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spAllocate.o
new file mode 100755
index 000000000..c219ba43a
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spAllocate.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spBuild.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spBuild.o
new file mode 100755
index 000000000..705fb02d1
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spBuild.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spFactor.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spFactor.o
new file mode 100755
index 000000000..fc1e8a532
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spFactor.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spOutput.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spOutput.o
new file mode 100755
index 000000000..c28a3ee11
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spOutput.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spSolve.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spSolve.o
new file mode 100755
index 000000000..ec19ab3cd
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spSolve.o
Binary files differ
diff --git a/modules/sparse/src/c/.libs/libscisparse_algo_la-spUtils.o b/modules/sparse/src/c/.libs/libscisparse_algo_la-spUtils.o
new file mode 100755
index 000000000..f61d9fc42
--- /dev/null
+++ b/modules/sparse/src/c/.libs/libscisparse_algo_la-spUtils.o
Binary files differ
diff --git a/modules/sparse/src/c/DllmainSparse.c b/modules/sparse/src/c/DllmainSparse.c
new file mode 100755
index 000000000..d3d8175b4
--- /dev/null
+++ b/modules/sparse/src/c/DllmainSparse.c
@@ -0,0 +1,34 @@
+
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <windows.h>
+/*--------------------------------------------------------------------------*/
+#pragma comment(lib,"../../../../bin/libintl.lib")
+/*--------------------------------------------------------------------------*/
+int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
+{
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ }
+ return 1;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/modules/sparse/src/c/core_Import.def b/modules/sparse/src/c/core_Import.def
new file mode 100755
index 000000000..70f9f0897
--- /dev/null
+++ b/modules/sparse/src/c/core_Import.def
@@ -0,0 +1,19 @@
+LIBRARY core.dll
+
+
+EXPORTS
+;core
+callFunctionFromGateway
+com_
+putlhsvar_
+intersci_
+GetData
+createdata_
+stack_
+getrhsvar_
+iop_
+vstk_
+overload_
+MyHeapAlloc
+MyHeapFree
+MyHeapRealloc
diff --git a/modules/sparse/src/c/elementary_functions_f_Import.def b/modules/sparse/src/c/elementary_functions_f_Import.def
new file mode 100755
index 000000000..6e82430eb
--- /dev/null
+++ b/modules/sparse/src/c/elementary_functions_f_Import.def
@@ -0,0 +1,8 @@
+ LIBRARY elementary_functions_f.dll
+
+
+EXPORTS
+;
+;elementary_functions_f
+;
+dset_ \ No newline at end of file
diff --git a/modules/sparse/src/c/libscisparse_algo_la-lu.lo b/modules/sparse/src/c/libscisparse_algo_la-lu.lo
new file mode 100755
index 000000000..017071f68
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-lu.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-lu.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-lu.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-mspelm.lo b/modules/sparse/src/c/libscisparse_algo_la-mspelm.lo
new file mode 100755
index 000000000..080e20c68
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-mspelm.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-mspelm.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-mspelm.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spAllocate.lo b/modules/sparse/src/c/libscisparse_algo_la-spAllocate.lo
new file mode 100755
index 000000000..82e866631
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spAllocate.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spAllocate.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spAllocate.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spBuild.lo b/modules/sparse/src/c/libscisparse_algo_la-spBuild.lo
new file mode 100755
index 000000000..9e4751225
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spBuild.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spBuild.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spBuild.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spFactor.lo b/modules/sparse/src/c/libscisparse_algo_la-spFactor.lo
new file mode 100755
index 000000000..72adcb3da
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spFactor.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spFactor.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spFactor.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spOutput.lo b/modules/sparse/src/c/libscisparse_algo_la-spOutput.lo
new file mode 100755
index 000000000..bf8295db5
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spOutput.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spOutput.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spOutput.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spSolve.lo b/modules/sparse/src/c/libscisparse_algo_la-spSolve.lo
new file mode 100755
index 000000000..476da27f9
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spSolve.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spSolve.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spSolve.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/libscisparse_algo_la-spUtils.lo b/modules/sparse/src/c/libscisparse_algo_la-spUtils.lo
new file mode 100755
index 000000000..9f0c94ff0
--- /dev/null
+++ b/modules/sparse/src/c/libscisparse_algo_la-spUtils.lo
@@ -0,0 +1,12 @@
+# src/c/libscisparse_algo_la-spUtils.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscisparse_algo_la-spUtils.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/c/lu.c b/modules/sparse/src/c/lu.c
new file mode 100755
index 000000000..fe1ccc60d
--- /dev/null
+++ b/modules/sparse/src/c/lu.c
@@ -0,0 +1,497 @@
+/* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Enpc - JPC
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ */
+
+/* README :
+ * The routines in this file use a pointer to a Matrix
+ * at the Fortran Level this pointer is stored as an integer
+ * so we cast pointer to long int
+ * f_(fmat)
+ * long *fmat
+ * *fmat = (long)spCreate(*n,0,&error);
+ *
+ * At fortran level the int must be an int *4
+ * in order to store a C long
+ * since we are in scilab
+ * the pointer transmitted to f_ is an istk(il1) it can in fact contain
+ * something as long as a double
+
+ */
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#include "lu.h"
+#include "Scierror.h"
+/*
+ *
+ * lufact1 >>> Creation and LU factorization of a sparse matrix
+ * Entry <<
+ * val,rc
+ * arrays of size k and kx2 a(rc(i),rc(*k+i))=val(i)
+ * for i=0,(*k-1)
+ * *n : size of the created square matrix
+ * *k : number of given values
+ * *eps : The machine precision number
+ * Return >>
+ * fmat : pointer to a long int which is a cast of an adress
+ * *nrank : The numerical rank
+ */
+
+
+static void spFixThresold(char *eMatrix, double eps, double releps)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ Matrix->AbsThreshold = eps;
+ Matrix->RelThreshold = releps;
+}
+
+
+static void spGetNumRank(char* eMatrix, int *n)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ *n = Matrix->NumRank;
+}
+
+void C2F(lufact1)(double *val, int *lln, int *col, int *n, int *nel,
+ int *fmatindex, double *eps, double *releps, int *nrank, int *ierr)
+{
+ int error, i, i0, i1, k, j;
+ char *fmat;
+ spREAL *pelement;
+ *ierr = 0;
+ fmat = spCreate(*n, 0, &error);
+ if (error != spOKAY)
+ {
+ *ierr = 1;
+ return;
+ }
+ *fmatindex = addluptr (fmat);
+ if ( *fmatindex == -1)
+ {
+ *ierr = 1;
+ return;
+ }
+
+ i0 = 0;
+ i1 = i0;
+ i = 1;
+ for (k = 0 ; k < *nel; k++)
+ {
+ i0 = i0 + 1;
+ while (i0 - i1 > lln[i - 1])
+ {
+ i1 = i0;
+ i = i + 1;
+ i0 = i0 + 1;
+ }
+ j = col[k];
+
+ pelement = spGetElement(fmat, i, j);
+
+ if (pelement == 0)
+ {
+ *ierr = 2;
+ return;
+ }
+ spADD_REAL_ELEMENT(pelement, (spREAL)(val[k]));
+
+ }
+ /* Fix the AbsThresold with scilex %eps */
+ spFixThresold(fmat, *eps, *releps);
+
+ /* spPrint((char *) *fmat,1,1,1); */
+ error = spFactor(fmat);
+
+ spGetNumRank(fmat, nrank);
+
+ switch (error)
+ {
+ case spZERO_DIAG:
+ Scierror(999, _("%s: A zero was encountered on the diagonal the matrix.\n"), "zero_diag");
+ break;
+ case spNO_MEMORY:
+ *ierr = 3;
+ break;
+ case spSINGULAR:
+ *ierr = -1; /*Singular matrix" */
+ break;
+ case spSMALL_PIVOT:
+ *ierr = -2; /* matrix is singular at precision level */
+ break;
+ }
+
+}
+
+/*
+ * lusolve1 >>> Solves fmat*x=b
+ * *fmat : a pointer to the sparse matrix factored by lufact
+ * b,v
+ * two arrays of size n the matrix size
+ */
+void C2F(lusolve1)(int *fmatindex, double *b, double *x, int *ierr)
+{
+ char *fmat;
+ if (getluptr((int)*fmatindex, &fmat) == -1)
+ {
+ *ierr = 1;
+ return;
+ }
+ *ierr = 0;
+ spSolve(fmat, (spREAL*)b, (spREAL*)x);
+}
+
+/*
+ * ludel1 >>> delete sparse matrix
+ * *fmat : a pointer to the sparse matrix factored by lufact
+ */
+
+void C2F(ludel1)(int *fmatindex, int *ierr)
+{
+ char *fmat;
+ if (getluptr((int)*fmatindex, &fmat) == -1)
+ {
+ *ierr = 1;
+ return;
+ }
+ *ierr = 0;
+ removeluptr ((int)*fmatindex);
+ spDestroy(fmat);
+
+}
+
+/*
+ * lusize >>> returns in n the size of the sparse matrix
+ * *fmat : a pointer to the sparse matrix factored by lufact
+ */
+/*
+**
+static void spSize(char* eMatrix, int *n)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ *n=Matrix->Size;
+}
+*/
+
+/*
+** @FIXME : Dead code
+void C2F(lusize)(long* fmat, int *n)
+{
+spSize((char *) *fmat,n);
+}
+*/
+
+/*
+ * luget1 >>> extract the LU coded matrix into a full array
+ * sigg,sigd :
+ * two arrays of size n which code permutations
+ * lu :
+ * an array coded matrix of size nxn where lu will be stored
+ */
+
+
+/* filling right permutation */
+static void GetSigD(MatrixPtr Matrix, int indsigd[], double sigd[])
+{
+ int I, J, mc = 0, last = 0;
+ int Size = Matrix->Size;
+ for (I = 1; I <= Size; I++)
+ {
+ indsigd[I - 1] = 1;
+ indsigd[Size + I - 1] = Matrix->IntToExtColMap[I];
+ sigd[I - 1] = 1.0;
+ }
+ /* counting missing colums */
+ for (I = 1; I <= Size; I++)
+ if (Matrix->ExtToIntColMap[I] == -1)
+ {
+ mc++;
+ }
+ /* filling missing colums */
+ if (mc != 0)
+ {
+ for (I = Size - (mc) + 1 ; I <= Size; I++)
+ {
+ for ( J = last + 1; J <= Size; J++)
+ {
+ if (Matrix->ExtToIntColMap[J] == -1)
+ {
+ last = J;
+ break;
+ }
+ }
+ indsigd[I - 1] = 1;
+ indsigd[Size + I - 1] = last;
+ }
+ }
+}
+
+
+/* filling left permutation */
+
+static void GetSigG(MatrixPtr Matrix, int indsigg[], double sigg[])
+{
+ int Size = Matrix->Size;
+ int I, J, mc = 0, last = 0;
+ /* counting missing Rows*/
+ for (I = 1; I <= Size; I++)
+ if (Matrix->ExtToIntRowMap[I] == -1)
+ {
+ mc++;
+ }
+
+ for (I = 1; I <= Size - mc ; I++)
+ {
+ indsigg[I - 1] = 1;
+ indsigg[Size + Matrix->IntToExtRowMap[I] - 1] = I;
+ sigg[I - 1] = 1.0;
+ }
+ /* filling missing Rows */
+ if (mc != 0)
+ {
+ for (I = Size - (mc) + 1 ; I <= Size; I++)
+ {
+ for ( J = last + 1; J <= Size; J++)
+ {
+ if (Matrix->ExtToIntRowMap[J] == -1)
+ {
+
+ last = J;
+ break;
+ }
+ }
+ indsigg[I - 1] = 1;
+ indsigg[Size + last - 1] = I;
+ sigg[I - 1] = 1.0;
+ }
+ }
+}
+
+
+static void spLuget(char *eMatrix, int *indP, double *P, int* indl,
+ double *l, int *indu, double *u, int *indQ, double *Q)
+{
+ int I, J;
+ int lsize, usize;
+
+ MatrixPtr Matrix = (MatrixPtr) eMatrix;
+ ElementPtr pElement;
+ int Size;
+ Size = Matrix->Size;
+ GetSigD(Matrix, indQ, Q);
+ GetSigG(Matrix, indP, P);
+ for (J = 1; J <= Size ; J++)
+ {
+ indl[J - 1] = 0;
+ indu[J - 1] = 0;
+ }
+ lsize = 0;
+ usize = 0;
+ for (I = 1; I <= Size ; I++)
+ {
+ indu[I - 1] = indu[I - 1] + 1;
+ indu[Size + usize] = I;
+ u[usize] = 1.0;
+ usize = usize + 1;
+
+ pElement = Matrix->FirstInRow[I];
+ while ( pElement != NULL )
+ {
+ J = pElement->Col;
+ if (I >= J)
+ {
+ indl[I - 1] = indl[I - 1] + 1;
+ indl[Size + lsize] = J;
+ l[lsize] = (double) pElement->Real ;
+ lsize = lsize + 1;
+
+ }
+ else
+ {
+ indu[I - 1] = indu[I - 1] + 1;
+ indu[Size + usize] = J;
+ u[usize] = (double) pElement->Real ;
+ usize = usize + 1;
+
+ }
+ pElement = pElement->NextInRow;
+ };
+ };
+}
+
+
+
+
+
+void C2F(luget1)(int *fmatindex, int *indP, double *P,
+ int *indl, double *l, int *indu, double *u,
+ int *indQ, double *Q, int *ierr)
+{
+ char *fmat;
+ if (getluptr((int)*fmatindex, &fmat) == -1)
+ {
+ *ierr = 1;
+ return;
+ }
+ *ierr = 0;
+ spLuget(fmat, indP, P, indl, l, indu, u, indQ, Q);
+}
+
+
+/*
+ * lusiz1 >>> extract the L and U number of non zero elements
+ * lsize and usize
+ */
+
+
+static void spLusiz(char *eMatrix, int *lsize, int *usize)
+{
+ int J;
+ MatrixPtr Matrix = (MatrixPtr) eMatrix;
+ ElementPtr pElement;
+ int Size;
+ Size = Matrix->Size;
+ *lsize = 0;
+ *usize = Size;
+ for (J = 1; J <= Size ; J++)
+ {
+ pElement = Matrix->FirstInCol[J];
+ while ( pElement != NULL )
+ {
+ if (pElement->Row >= J)
+ {
+ *lsize = *lsize + 1;
+ }
+ else
+ {
+ *usize = *usize + 1;
+ }
+ pElement = pElement->NextInCol;
+ };
+ };
+}
+
+void C2F(lusiz1)(int* fmatindex, int* lsize, int* usize, int *ierr)
+{
+ char *fmat;
+ if (getluptr((int)*fmatindex, &fmat) == -1)
+ {
+ *ierr = 1;
+ return;
+ }
+ *ierr = 0;
+ spLusiz(fmat, lsize, usize);
+}
+
+char **sci_luptr_table = NULL;
+int sci_luptr_table_size = 0;/* allocated size for pointer table*/
+int sci_luptr_index = 0;/* max index used (one based)*/
+
+
+/**addluptr
+ * This function adds a pointer on a sparse lu factorization to Scilab internal table
+ */
+int addluptr (char *ptr)
+{
+ int i, sel;
+ int rsize = 10;
+ if (sci_luptr_table_size == 0) /* first call alloacte a small array of pointers*/
+ {
+ sci_luptr_table = (char **)MALLOC(rsize * sizeof(char *));
+ if (sci_luptr_table == NULL)
+ {
+ return -1;
+ }
+ sci_luptr_table_size += 10;
+ }
+ /* look for a free cell in sci_luptr_table*/
+ sel = -1;
+ for (i = 0; i < sci_luptr_index; i++)
+ {
+ if ( sci_luptr_table[i] == NULL)
+ {
+ sel = i;
+ break;
+ }
+ }
+ if (sel == -1)
+ {
+ if (sci_luptr_index < sci_luptr_table_size)
+ {
+ sel = sci_luptr_index++;
+ }
+ else
+ {
+ sci_luptr_table = (char **)REALLOC(sci_luptr_table, (sci_luptr_table_size + rsize) * sizeof(char *));
+ if (sci_luptr_table == NULL)
+ {
+ return -1;
+ }
+ sci_luptr_table_size += 10;
+ sel = sci_luptr_index++;
+ }
+ }
+ sci_luptr_table[sel] = ptr;
+ return sel + 1;
+}
+/**getluptr
+ * this function returns a pointer on a sparse lu factorization
+ * given its index (one based) in the table
+ */
+int getluptr(int sel, char **ptr)
+{
+ if (sel > sci_luptr_index || sel < 1)
+ {
+ return -1;
+ }
+ if (sci_luptr_table[sel - 1] == NULL)
+ {
+ return -1;
+ }
+ *ptr = sci_luptr_table[sel - 1];
+ return 0;
+}
+
+/**removeluptr
+ * This function removes a pointer on a sparse lu factorization
+ * out of Scilab internal table given its index in the table
+ */
+int removeluptr (int sel)
+{
+ if (sel > sci_luptr_index || sel < 1)
+ {
+ return -1;
+ }
+ sci_luptr_table[sel - 1] = NULL;
+ if (sel == sci_luptr_index)
+ {
+ sci_luptr_index--;
+ }
+ return 0;
+}
+
+/**resetluptr
+ * This function reinitialize the Scilab sparse lu pointer table
+ */
+void resetluptr()
+{
+ FREE(sci_luptr_table);
+ sci_luptr_table_size = 0;/* allocated size for pointer table*/
+ sci_luptr_index = 0;/* max index used (one based)*/
+}
diff --git a/modules/sparse/src/c/lu.h b/modules/sparse/src/c/lu.h
new file mode 100755
index 000000000..cfeec38fc
--- /dev/null
+++ b/modules/sparse/src/c/lu.h
@@ -0,0 +1,44 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __LU_H__
+#define __LU_H__
+
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+
+#include "cerro.h"
+#include "machine.h"
+#include "localization.h"
+#include "MALLOC.h"
+#include "dynlib_sparse.h"
+
+SPARSE_IMPEXP int addluptr (char *ptr); /* */
+SPARSE_IMPEXP int getluptr (int sel, char **ptr);
+SPARSE_IMPEXP int removeluptr (int sel);
+SPARSE_IMPEXP void resetluptr (void); /* to be used to free the lu pointer table */
+
+SPARSE_IMPEXP void C2F(lufact1)(double *val, int *lln, int *col, int *n, int *nel,
+ int *fmatindex, double *eps, double *releps, int *nrank, int *ierr);
+
+SPARSE_IMPEXP void C2F(lusolve1)(int *fmatindex, double *b, double *x, int *ierr);
+
+SPARSE_IMPEXP void C2F(ludel1)(int *fmatindex, int *ierr);
+
+SPARSE_IMPEXP void C2F(lusiz1)(int *fmatindex, int* lsize, int* usize, int *ierr);
+
+SPARSE_IMPEXP void C2F(luget1)(int *fmatindex, int *indP, double *P,
+ int *indl, double *l, int *indu, double *u,
+ int *indQ, double *Q, int *ierr);
+#endif /* !__LU_H__ */
diff --git a/modules/sparse/src/c/mspelm.c b/modules/sparse/src/c/mspelm.c
new file mode 100755
index 000000000..0d29aee7c
--- /dev/null
+++ b/modules/sparse/src/c/mspelm.c
@@ -0,0 +1,497 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "stack-c.h"
+#include "Scierror.h"
+#include "elementary_functions.h"
+#include "int2db.h"
+#include "basout.h"
+
+#define CHAR(x) (cstk(x))
+#define INT(x) (istk(x))
+#define DOUBLE(x) ( stk(x))
+#define CMPLX(x) (zstk(x))
+
+/* Copyright INRIA */
+/*----------------------------------------------------------
+ * conversion of Scilab sparse to Matlab sparse
+ * for use in functions interfaced through mex
+ *
+ * C2F(intmsparse) : matlab_sparse
+ *
+ *
+ *
+ *---------------------------------------------------------*/
+
+/* Table of constant values */
+
+static int c1 = 1;
+static int c_n1 = -1;
+static double c_b46 = 0.;
+
+extern int C2F(intmfull)(int *id), C2F(intmspget)(int *id);
+extern int C2F(intmsparse)(int *id);
+
+static int wmspful(int *ma, int *na, double *ar, double *ai, int *nela, int *inda, double *rr, double *ri);
+static int dmspful(int *ma, int *na, double *a, int *nela, int *inda, double *r__);
+
+extern int C2F(dspt)();
+extern int C2F(wspt)();
+extern int empty(void);
+
+int C2F(intmsparse)(int *id)
+{
+ /* System generated locals */
+ int I1;
+ /* Local variables */
+ static int tops;
+ static int I, l, m, n;
+ static int ia, il, it, lr, lw, ilc, nel, ilr, iat, irc, lat, top0;
+ static int kkk;
+
+ if ( Rhs == 2)
+ {
+ return empty();
+ }
+ --id;
+ /* Function Body */
+ Rhs = Max(0, Rhs);
+ top0 = Top + 1 - Rhs;
+ tops = Top;
+
+ lw = C2F(vstk).lstk[Top];
+ if (Lhs != 1)
+ {
+ SciError(41);
+ return 0;
+ }
+ if (Rhs != 1)
+ {
+ SciError(39);
+ return 0;
+ }
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ if (*istk(il) == 5)
+ {
+ nel = *istk(il + 4);
+ m = *istk(il + 1);
+ n = *istk(il + 2);
+ it = *istk(il + 3);
+ ilr = il + 5;
+ ilc = ilr + m;
+ I1 = ilr + m + nel;
+ l = I1 / 2 + 1;
+
+ ia = lw + lw - 1;
+ iat = ia + m + 1;
+ irc = iat + n + 1;
+ I1 = irc + n + nel;
+ lat = I1 / 2 + 1;
+ lw = lat + nel * (it + 1);
+ Err = lw - C2F(vstk).lstk[Bot - 1];
+ if (Err > 0)
+ {
+ SciError(17);
+ return 0;
+ }
+ *istk(ia) = 1;
+ I1 = m;
+ for (I = 1; I <= I1; ++I)
+ {
+ *istk(ia + I) = *istk(ia + I - 1) + *istk(ilr + I - 1);
+ }
+ if (it == 0)
+ {
+ C2F(dspt)(&m, &n, stk(l), &nel, istk(ilr), istk(ia
+ ), stk(lat), istk(iat), istk(irc));
+ }
+ else
+ {
+ C2F(wspt)(&m, &n, stk(l), stk(l + nel), &
+ nel, istk(ilr), istk(ia), stk(lat),
+ stk(lat + nel), istk(iat), istk(irc));
+ }
+ *istk(il ) = 7;
+ I1 = ilr + n + 1 + nel;
+ lr = I1 / 2 + 1;
+ I1 = n + 1;
+ /* FD modif Jc -1 & Ir -1
+ C2F(icopy)(&I1, istk(iat ), &c1, istk(ilr ), &c1);
+ C2F(icopy)(&nel, istk(irc + n ), &c1, istk(ilr + n+1), &c1); */
+ for (kkk = 0; kkk < I1; ++kkk)
+ {
+ *istk(ilr + kkk) = *istk(iat + kkk) - 1;
+ }
+ for (kkk = 0; kkk < nel; ++kkk)
+ {
+ *istk(ilr + n + 1 + kkk) = *istk(irc + n + kkk) - 1;
+ }
+ I1 = nel * (it + 1);
+ C2F(unsfdcopy)(&I1, stk(lat ), &c1, stk(lr ), &
+ c1);
+ C2F(vstk).lstk[Top] = lr + nel * (it + 1);
+ }
+ else if (*istk(il ) == 7)
+ {
+ }
+ else
+ {
+ SciError(44);
+ return 0;
+ }
+ return 0;
+}
+
+int empty(void)
+{
+ int m, n;
+ int k;
+ int m1, n1, p1;
+ int m2, n2, p2;
+ int NZMAX = 1;
+ int jc = 5;
+ int ir;
+ int *header;
+ double *value;
+ GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &p1);
+ GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &p2);
+ m = (int) * stk(p1);
+ n = (int) * stk(p2);
+ CreateData(3, (6 + n + 1)*sizeof(int) + sizeof(double));
+ header = (int *) GetData(3);
+ value = (double *) header;
+ header[0] = 7;
+ header[1] = m;
+ header[2] = n;
+ header[3] = 0;
+ header[4] = NZMAX;
+ header[jc] = 0;
+ ir = jc + n + 1;
+ for (k = 0; k < n; ++k)
+ {
+ header[jc + k + 1] = 0;
+ }
+ header[ir] = 0;
+ value[(5 + header[2] + header[4]) / 2 + 1] = 0.0;
+ LhsVar(1) = 3;
+ PutLhsVar();
+ return 1;
+}
+
+/*---------------------------------------
+ * %msp_get
+ *---------------------------------------*/
+
+int C2F(intmspget)(int *id)
+{
+ int I1, I2, I3;
+
+ /* Local variables */
+ static int ilrs;
+ static int ityp, j, l, m, n;
+ static int j1_;
+ static int nc, il, it, lv, lw;
+ static double tv;
+ static int ilc, nel, nelmax, ilr, lij, ilv, top0, kkk;
+
+ /* Parameter adjustments */
+ --id;
+
+ /* Function Body */
+ Rhs = Max(0, Rhs);
+ top0 = Top + 1 - Rhs;
+ lw = C2F(vstk).lstk[Top];
+ if (Rhs != 1)
+ {
+ SciError(39);
+ return 0;
+ }
+ if (Lhs > 3)
+ {
+ SciError(41);
+ return 0;
+ }
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ ityp = *istk(il );
+ nelmax = *istk(il + 4);
+ m = *istk(il + 1);
+ n = *istk(il + 2);
+ it = *istk(il + 3);
+ ilr = il + 5;
+ nel = *istk(ilr + n);
+ /* printf("mspelm: nelmax,nel %i %i\n", nelmax,nel); */
+ ilc = ilr + n + 1;
+ I1 = ilc + nelmax;
+ l = I1 / 2 + 1;
+ if (nel == 0)
+ {
+ *istk(il ) = 1;
+ *istk(il + 1) = 0;
+ *istk(il + 2) = 0;
+ *istk(il + 3) = 0;
+ I1 = il + 4;
+ C2F(vstk).lstk[Top] = I1 / 2 + 1;
+ if (Lhs >= 2)
+ {
+ ++Top;
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] -
+ 1;
+ *istk(il ) = 1;
+ *istk(il + 1) = 0;
+ *istk(il + 2) = 0;
+ *istk(il + 3) = 0;
+ I1 = il + 4;
+ C2F(vstk).lstk[Top] = I1 / 2 + 1;
+ }
+ if (Lhs == 3)
+ {
+ ++Top;
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ *istk(il ) = 1;
+ *istk(il + 1) = 1;
+ *istk(il + 2) = 2;
+ *istk(il + 3) = 0;
+ I1 = il + 4;
+ l = I1 / 2 + 1;
+ *stk(l ) = (double) m;
+ *stk(l + 1) = (double) n;
+ C2F(vstk).lstk[Top] = l + 2;
+ }
+ return 0;
+ }
+ I1 = il + 4;
+ lij = I1 / 2 + 1;
+ I1 = lij + (nel << 1);
+ ilv = I1 + I1 - 1;
+ I1 = ilv + 4;
+ lv = I1 / 2 + 1;
+ I2 = lw, I3 = lv + nel * (it + 1);
+ I1 = Max(I2, I3);
+ ilrs = I1 + I1 - 1;
+ I1 = ilrs + n + 1 + nel;
+ lw = I1 / 2 + 1;
+ Err = lw - C2F(vstk).lstk[Bot - 1];
+ if (Err > 0)
+ {
+ SciError(17);
+ return 0;
+ }
+ I1 = n + nel + 1;
+ /* FD 1ere colonne de ij = indices en C + 1 */
+ for (kkk = 0; kkk < I1; ++kkk)
+ {
+ *istk(ilrs + kkk) = *istk(ilr + kkk) + 1;
+ }
+ /* C2F(icopy)(&I1, istk(ilr ), &c1, istk(ilrs ), &c1); */
+
+ /* V */
+ if (l >= lv)
+ {
+ I1 = nel * (it + 1);
+ /* printf("vvvvvvvvvvvvvvvvvv\n");
+ printf("%f\n",stk(l));
+ printf("%f\n",stk(l+1));
+ printf("%f\n",stk(l+2));
+ printf("%f\n",stk(l+3));
+ printf("vvvvvvvvvvvvvvvvvv\n"); */
+ C2F(unsfdcopy)(&I1, stk(l ), &c1, stk(lv ), &c1);
+ }
+ else
+ {
+ I1 = nel * (it + 1);
+ /* printf("wwwwwwwwwwwwwww\n");
+ printf("%f\n",*stk(l));
+ printf("%f\n",*stk(l+1));
+ printf("%f\n",*stk(l+2));
+ printf("%f\n",*stk(l+3));
+ printf("wwwwwwwwwwwwwwwwwwww\n"); */
+ C2F(unsfdcopy)(&I1, stk(l ), &c_n1, stk(lv ), &c_n1);
+ }
+
+ C2F(int2db)(&nel, istk(ilrs + n + 1), &c1, stk(lij), &c1);
+ for (j = 1; j <= n; ++j)
+ {
+ nc = *istk(ilrs + j ) - *istk(ilrs + j - 1);
+ j1_ = *istk(ilrs + j - 1) - 1;
+ tv = (double) j;
+ C2F(dset)(&nc, &tv, stk(lij + nel + j1_ ), &c1);
+ }
+
+ /* ij */
+ *istk(il ) = 1;
+ *istk(il + 1) = nel;
+ *istk(il + 2) = 2;
+ *istk(il + 3) = 0;
+ C2F(vstk).lstk[Top] = lij + (nel << 1);
+ if (Lhs >= 2)
+ {
+ /* V */
+ ++Top;
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ *istk(il ) = 1;
+ *istk(il + 1) = nel;
+ *istk(il + 2) = 1;
+ *istk(il + 3) = it;
+ C2F(vstk).lstk[Top] = lv + nel * (it + 1);
+ }
+ if (Lhs == 3)
+ {
+ /* mn */
+ ++Top;
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ *istk(il ) = 1;
+ *istk(il + 1) = 1;
+ *istk(il + 2) = 2;
+ *istk(il + 3) = 0;
+ I1 = il + 4;
+ l = I1 / 2 + 1;
+ *stk(l ) = (double) m;
+ *stk(l + 1) = (double) n;
+ C2F(vstk).lstk[Top] = l + 2;
+ }
+ return 0;
+}
+
+/*---------------------------------------
+ * %msp_full
+ *---------------------------------------*/
+
+int C2F(intmfull)(int *id)
+{
+ int I1, I2, I3;
+
+ /* Local variables */
+ static int l, m, n;
+ static int il, it, ls, lw, ilc, nel, ilr, ils, kkk;
+ static int top0;
+
+ /* Parameter adjustments */
+ --id;
+
+ /* Function Body */
+ Rhs = Max(0, Rhs);
+ top0 = Top + 1 - Rhs;
+ lw = C2F(vstk).lstk[Top];
+ if (Rhs != 1)
+ {
+ SciError(39);
+ return 0;
+ }
+ if (Lhs != 1)
+ {
+ SciError(41);
+ return 0;
+ }
+ il = C2F(vstk).lstk[Top - 1] + C2F(vstk).lstk[Top - 1] - 1;
+ nel = *istk(il + 4);
+ m = *istk(il + 1);
+ n = *istk(il + 2);
+ it = *istk(il + 3);
+ ilr = il + 5;
+ ilc = ilr + n + 1;
+ I1 = ilc + nel;
+ l = I1 / 2 + 1;
+ I1 = il + 4;
+ /* Computing MAX */
+ I3 = I1 / 2 + 1 + m * n * (it + 1);
+ I2 = Max(I3, lw);
+ ils = I2 + I2 - 1;
+ I1 = ils + n + 1 + nel;
+ ls = I1 / 2 + 1;
+ lw = ls + nel * (it + 1);
+ Err = lw - C2F(vstk).lstk[Bot - 1];
+ if (Err > 0)
+ {
+ SciError(17);
+ return 0;
+ }
+ I1 = n + 1 + nel;
+ /* FD modif */
+ for (kkk = 0; kkk < I1; ++kkk)
+ {
+ *istk(ils + kkk) = *istk(ilr + kkk) + 1;
+ }
+ /* C2F(icopy)(&I1, istk(ilr ), &c1, istk(ils ), &c1); */
+ I1 = nel * (it + 1);
+ C2F(unsfdcopy)(&I1, stk(l ), &c1, stk(ls ), &c1);
+ *istk(il ) = 1;
+ I1 = il + 4;
+ l = I1 / 2 + 1;
+ if (it == 0)
+ {
+ dmspful(&m, &n, stk(ls ), &nel, istk(ils ), stk(l ));
+ }
+ else
+ {
+ wmspful(&m, &n, stk(ls ), stk(ls + nel ), &nel, istk(ils ),
+ stk(l ), stk(l + m * n ));
+ }
+ C2F(vstk).lstk[Top] = l + m * n * (it + 1);
+ return 0;
+}
+
+static int dmspful(int *ma, int *na, double *a, int *nela, int *inda, double *rr)
+{
+ int I1, I2;
+ static int I, j, k, ii, nj;
+
+ I1 = *ma * *na;
+ C2F(dset)(&I1, &c_b46, rr, &c1);
+ k = 0;
+ I1 = *na;
+ for (j = 1; j <= I1; ++j)
+ {
+ nj = inda[j] - inda[j - 1];
+ if (nj > 0)
+ {
+ I2 = nj;
+ for (ii = 1; ii <= I2; ++ii)
+ {
+ I = inda[*na + k + ii];
+ rr[I + (j - 1) * *ma - 1 ] = a[k + ii - 1];
+ }
+ k += nj;
+ }
+ }
+ return 0;
+}
+
+static int wmspful(int *ma, int *na, double *ar, double *ai, int *nela, int *inda, double *rr, double *ri)
+{
+ int I1, I2;
+ static int I, j, k, ii, nj;
+
+ I1 = *ma * *na;
+ C2F(dset)(&I1, &c_b46, rr, &c1);
+ I1 = *ma * *na;
+ C2F(dset)(&I1, &c_b46, ri, &c1);
+ k = 0;
+ I1 = *na;
+ for (j = 1; j <= I1; ++j)
+ {
+ nj = inda[j] - inda[j - 1];
+ if (nj > 0)
+ {
+ I2 = nj;
+ for (ii = 1; ii <= I2; ++ii)
+ {
+ I = inda[*na + k + ii];
+ rr[I + (j - 1) * *ma - 1] = ar[k + ii - 1];
+ ri[I + (j - 1) * *ma - 1] = ai[k + ii - 1];
+ }
+ k += nj;
+ }
+ }
+ return 0;
+}
+
+
diff --git a/modules/sparse/src/c/spAllocate.c b/modules/sparse/src/c/spAllocate.c
new file mode 100755
index 000000000..35f83c28c
--- /dev/null
+++ b/modules/sparse/src/c/spAllocate.c
@@ -0,0 +1,906 @@
+/*
+ * MATRIX SPALLOCATION MODULE
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains the allocation and deallocation routines for the
+ * sparse matrix routines.
+ *
+ * >>> User accessible functions contained in this file:
+ * spCreate
+ * spDestroy
+ * spError
+ * spWhereSingular
+ * spGetSize
+ * spSetReal
+ * spSetComplex
+ * spFillinCount
+ * spElementCount
+ *
+ * >>> Other functions contained in this file:
+ * spcGetElement
+ * InitializeElementBlocks
+ * spcGetFillin
+ * RecordAllocation
+ * AllocateBlockOfAllocationList
+ * EnlargeMatrix
+ * ExpandTranslationArrays
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spmalloc.h"
+#include "spAllocate.h"
+#include "MALLOC.h"
+
+static int InitializeElementBlocks( MatrixPtr Matrix, int InitialNumberOfElements, int NumberOfFillinsExpected );
+
+static int RecordAllocation( MatrixPtr Matrix, char *AllocatedPtr );
+
+static int AllocateBlockOfAllocationList( MatrixPtr Matrix );
+/*
+ * MATRIX SPALLOCATION
+ *
+ * Allocates and initializes the data structures associated with a matrix.
+ *
+ * >>> Returned:
+ * A pointer to the matrix is returned cast into the form of a pointer to
+ * a character. This pointer is then passed and used by the other matrix
+ * routines to refer to a particular matrix. If an error occurs, the NULL
+ * pointer is returned.
+ *
+ * >>> Arguments:
+ * Size <input> (int)
+ * Size of matrix or estimate of size of matrix if matrix is EXPANDABLE.
+ * Complex <input> (int)
+ * Type of matrix. If Complex is 0 then the matrix is real, otherwise
+ * the matrix will be complex. Note that if the routines are not set up
+ * to handle the type of matrix requested, then a spPANIC error will occur.
+ * Further note that if a matrix will be both real and complex, it must
+ * be specified here as being complex.
+ * pError <output> (int *)
+ * Returns error flag, needed because function spError() will not work
+ * correctly if spCreate() returns NULL.
+ *
+ * >>> Local variables:
+ * AllocatedSize (int)
+ * The size of the matrix being allocated.
+ * Matrix (MatrixPtr)
+ * A pointer to the matrix frame being created.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spPANIC
+ * Error is cleared in this routine.
+ */
+
+char *spCreate(int Size, SPBOOLEAN Complex, int *pError )
+{
+ register unsigned SizePlusOne;
+ register MatrixPtr Matrix;
+ register int I;
+ int AllocatedSize;
+
+ /* Begin `spCreate'. */
+ /* Clear error flag. */
+ *pError = spOKAY;
+
+ /* Test for valid size. */
+ if ((Size < 0) OR (Size == 0 AND NOT EXPANDABLE))
+ {
+ *pError = spPANIC;
+ return NULL;
+ }
+
+ /* Test for valid type. */
+#if NOT spCOMPLEX
+ if (Complex)
+ {
+ *pError = spPANIC;
+ return NULL;
+ }
+#endif
+#if NOT REAL
+ if (NOT Complex)
+ {
+ *pError = spPANIC;
+ return NULL;
+ }
+#endif
+
+ /* Create Matrix. */
+ AllocatedSize = Max( Size, MINIMUM_ALLOCATED_SIZE );
+ SizePlusOne = (unsigned)(AllocatedSize + 1);
+
+ if ((Matrix = SPALLOC(struct MatrixFrame, 1)) == NULL)
+ {
+ *pError = spNO_MEMORY;
+ return NULL;
+ }
+
+ /* Initialize matrix */
+ Matrix->ID = SPARSE_ID;
+ Matrix->Complex = Complex;
+ Matrix->PreviousMatrixWasComplex = Complex;
+ Matrix->Factored = NO;
+ Matrix->Elements = 0;
+ Matrix->Error = *pError;
+ Matrix->Fillins = 0;
+ Matrix->Reordered = NO;
+ Matrix->NeedsOrdering = YES;
+ Matrix->NumberOfInterchangesIsOdd = NO;
+ Matrix->Partitioned = NO;
+ Matrix->RowsLinked = NO;
+ Matrix->InternalVectorsAllocated = NO;
+ Matrix->SingularCol = 0;
+ Matrix->SingularRow = 0;
+ Matrix->Size = Size;
+ Matrix->AllocatedSize = AllocatedSize;
+ Matrix->ExtSize = Size;
+ Matrix->AllocatedExtSize = AllocatedSize;
+ Matrix->CurrentSize = 0;
+ Matrix->ExtToIntColMap = NULL;
+ Matrix->ExtToIntRowMap = NULL;
+ Matrix->IntToExtColMap = NULL;
+ Matrix->IntToExtRowMap = NULL;
+ Matrix->MarkowitzRow = NULL;
+ Matrix->MarkowitzCol = NULL;
+ Matrix->MarkowitzProd = NULL;
+ Matrix->DoCmplxDirect = NULL;
+ Matrix->DoRealDirect = NULL;
+ Matrix->Intermediate = NULL;
+ Matrix->RelThreshold = DEFAULT_THRESHOLD;
+ Matrix->AbsThreshold = 0.0;
+
+ Matrix->TopOfAllocationList = NULL;
+ Matrix->RecordsRemaining = 0;
+ Matrix->ElementsRemaining = 0;
+ Matrix->FillinsRemaining = 0;
+
+ RecordAllocation( Matrix, (char *)Matrix );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ goto MemoryError;
+ }
+
+ /* Take out the trash. */
+ Matrix->TrashCan.Real = 0.0;
+#if spCOMPLEX
+ Matrix->TrashCan.Imag = 0.0;
+#endif
+ Matrix->TrashCan.Row = 0;
+ Matrix->TrashCan.Col = 0;
+ Matrix->TrashCan.NextInRow = NULL;
+ Matrix->TrashCan.NextInCol = NULL;
+#if INITIALIZE
+ Matrix->TrashCan.pInitInfo = NULL;
+#endif
+
+ /* Allocate space in memory for Diag pointer vector. */
+ SPCALLOC( Matrix->Diag, ElementPtr, SizePlusOne);
+ if (Matrix->Diag == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Allocate space in memory for FirstInCol pointer vector. */
+ SPCALLOC( Matrix->FirstInCol, ElementPtr, SizePlusOne);
+ if (Matrix->FirstInCol == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Allocate space in memory for FirstInRow pointer vector. */
+ SPCALLOC( Matrix->FirstInRow, ElementPtr, SizePlusOne);
+ if (Matrix->FirstInRow == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Allocate space in memory for IntToExtColMap vector. */
+ if (( Matrix->IntToExtColMap = SPALLOC(int, SizePlusOne)) == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Allocate space in memory for IntToExtRowMap vector. */
+ if (( Matrix->IntToExtRowMap = SPALLOC(int, SizePlusOne)) == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Initialize MapIntToExt vectors. */
+ for (I = 1; I <= AllocatedSize; I++)
+ {
+ Matrix->IntToExtRowMap[I] = I;
+ Matrix->IntToExtColMap[I] = I;
+ }
+
+#if TRANSLATE
+ /* Allocate space in memory for ExtToIntColMap vector. */
+ if (( Matrix->ExtToIntColMap = SPALLOC(int, SizePlusOne)) == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Allocate space in memory for ExtToIntRowMap vector. */
+ if (( Matrix->ExtToIntRowMap = SPALLOC(int, SizePlusOne)) == NULL)
+ {
+ goto MemoryError;
+ }
+
+ /* Initialize MapExtToInt vectors. */
+ for (I = 1; I <= AllocatedSize; I++)
+ {
+ Matrix->ExtToIntColMap[I] = -1;
+ Matrix->ExtToIntRowMap[I] = -1;
+ }
+ Matrix->ExtToIntColMap[0] = 0;
+ Matrix->ExtToIntRowMap[0] = 0;
+#endif
+
+ /* Allocate space for fill-ins and initial set of elements. */
+ InitializeElementBlocks( Matrix, SPACE_FOR_ELEMENTS * AllocatedSize,
+ SPACE_FOR_FILL_INS * AllocatedSize );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ goto MemoryError;
+ }
+
+ return (char *)Matrix;
+
+MemoryError:
+
+ /* Deallocate matrix and return no pointer to matrix if there is not enough
+ memory. */
+ *pError = spNO_MEMORY;
+ spDestroy( (char *)Matrix);
+ return NULL;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * ELEMENT SPALLOCATION
+ *
+ * This routine allocates space for matrix elements. It requests large blocks
+ * of storage from the system and doles out individual elements as required.
+ * This technique, as opposed to allocating elements individually, tends to
+ * speed the allocation process.
+ *
+ * >>> Returned:
+ * A pointer to an element.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * A pointer to the first element in the group of elements being allocated.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+ElementPtr spcGetElement( MatrixPtr Matrix )
+{
+ ElementPtr pElement;
+
+ /* Begin `spcGetElement'. */
+
+ /* Allocate block of MatrixElements if necessary. */
+ if (Matrix->ElementsRemaining == 0)
+ {
+ pElement = SPALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
+ RecordAllocation( Matrix, (char *)pElement );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return NULL;
+ }
+ Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
+ Matrix->NextAvailElement = pElement;
+ }
+
+ /* Update Element counter and return pointer to Element. */
+ Matrix->ElementsRemaining--;
+ return Matrix->NextAvailElement++;
+
+}
+
+
+
+
+
+
+
+
+/*
+ * ELEMENT SPALLOCATION INITIALIZATION
+ *
+ * This routine allocates space for matrix fill-ins and an initial set of
+ * elements. Besides being faster than allocating space for elements one
+ * at a time, it tends to keep the fill-ins physically close to the other
+ * matrix elements in the computer memory. This keeps virtual memory paging
+ * to a minimum.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * InitialNumberOfElements <input> (int)
+ * This number is used as the size of the block of memory, in
+ * MatrixElements, reserved for elements. If more than this number of
+ * elements are generated, then more space is allocated later.
+ * NumberOfFillinsExpected <input> (int)
+ * This number is used as the size of the block of memory, in
+ * MatrixElements, reserved for fill-ins. If more than this number of
+ * fill-ins are generated, then more space is allocated, but they may
+ * not be physically close in computer's memory.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * A pointer to the first element in the group of elements being allocated.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+InitializeElementBlocks( MatrixPtr Matrix, int InitialNumberOfElements,
+ int NumberOfFillinsExpected )
+{
+ ElementPtr pElement;
+
+ /* Begin `InitializeElementBlocks'. */
+
+ /* Allocate block of MatrixElements for elements. */
+ pElement = SPALLOC(struct MatrixElement, InitialNumberOfElements);
+ RecordAllocation( Matrix, (char *)pElement );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return 0;
+ }
+ Matrix->ElementsRemaining = InitialNumberOfElements;
+ Matrix->NextAvailElement = pElement;
+
+ /* Allocate block of MatrixElements for fill-ins. */
+ pElement = SPALLOC(struct MatrixElement, NumberOfFillinsExpected);
+ RecordAllocation( Matrix, (char *)pElement );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return 0;
+ }
+ Matrix->FillinsRemaining = NumberOfFillinsExpected;
+ Matrix->NextAvailFillin = pElement;
+
+ /* Allocate a fill-in list structure. */
+ Matrix->FirstFillinListNode = SPALLOC(struct FillinListNodeStruct, 1);
+ RecordAllocation( Matrix, (char *)Matrix->FirstFillinListNode );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return 0;
+ }
+ Matrix->LastFillinListNode = Matrix->FirstFillinListNode;
+
+ Matrix->FirstFillinListNode->pFillinList = pElement;
+ Matrix->FirstFillinListNode->NumberOfFillinsInList = NumberOfFillinsExpected;
+ Matrix->FirstFillinListNode->Next = NULL;
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+/*
+ * FILL-IN SPALLOCATION
+ *
+ * This routine allocates space for matrix fill-ins. It requests large blocks
+ * of storage from the system and doles out individual elements as required.
+ * This technique, as opposed to allocating elements individually, tends to
+ * speed the allocation process.
+ *
+ * >>> Returned:
+ * A pointer to the fill-in.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+ElementPtr spcGetFillin( MatrixPtr Matrix )
+{
+ struct FillinListNodeStruct *pListNode;
+ ElementPtr pFillins;
+
+ /* Begin `spcGetFillin'. */
+
+#if NOT STRIP OR LINT
+ if (Matrix->FillinsRemaining == 0)
+ {
+ return spcGetElement( Matrix );
+ }
+#endif
+#if STRIP OR LINT
+
+ if (Matrix->FillinsRemaining == 0)
+ {
+ pListNode = Matrix->LastFillinListNode;
+
+ /* First see if there are any stripped fill-ins left. */
+ if (pListNode->Next != NULL)
+ {
+ Matrix->LastFillinListNode = pListNode = pListNode->Next;
+ Matrix->FillinsRemaining = pListNode->NumberOfFillinsInList;
+ Matrix->NextAvailFillin = pListNode->pFillinList;
+ }
+ else
+ {
+ /* Allocate block of fill-ins. */
+ pFillins = SPALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
+ RecordAllocation( Matrix, (char *)pFillins );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return NULL;
+ }
+ Matrix->FillinsRemaining = ELEMENTS_PER_ALLOCATION;
+ Matrix->NextAvailFillin = pFillins;
+
+ /* Allocate a fill-in list structure. */
+ pListNode->Next = SPALLOC(struct FillinListNodeStruct, 1);
+ RecordAllocation( Matrix, (char *)pListNode->Next );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return NULL;
+ }
+ Matrix->LastFillinListNode = pListNode = pListNode->Next;
+
+ pListNode->pFillinList = pFillins;
+ pListNode->NumberOfFillinsInList = ELEMENTS_PER_ALLOCATION;
+ pListNode->Next = NULL;
+ }
+ }
+#endif
+
+ /* Update Fill-in counter and return pointer to Fill-in. */
+ Matrix->FillinsRemaining--;
+ return Matrix->NextAvailFillin++;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * RECORD A MEMORY SPALLOCATION
+ *
+ * This routine is used to record all memory allocations so that the memory
+ * can be freed later.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * AllocatedPtr <input> (char *)
+ * The pointer returned by malloc or calloc. These pointers are saved in
+ * a list so that they can be easily freed.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+RecordAllocation( MatrixPtr Matrix, char *AllocatedPtr )
+{
+ /* Begin `RecordAllocation'. */
+ /*
+ * If Allocated pointer is NULL, assume that malloc returned a NULL pointer,
+ * which indicates a spNO_MEMORY error.
+ */
+ if (AllocatedPtr == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+
+ /* Allocate block of MatrixElements if necessary. */
+ if (Matrix->RecordsRemaining == 0)
+ {
+ AllocateBlockOfAllocationList( Matrix );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ SPFREE(AllocatedPtr);
+ return 0;
+ }
+ }
+
+ /* Add Allocated pointer to Allocation List. */
+ (++Matrix->TopOfAllocationList)->AllocatedPtr = AllocatedPtr;
+ Matrix->RecordsRemaining--;
+ return 0;
+
+}
+
+
+
+
+
+
+
+
+/*
+ * ADD A BLOCK OF SLOTS TO SPALLOCATION LIST
+ *
+ * This routine increases the size of the allocation list.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ *
+ * >>> Local variables:
+ * ListPtr (AllocationListPtr)
+ * Pointer to the list that contains the pointers to segments of memory
+ * that were allocated by the operating system for the current matrix.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+AllocateBlockOfAllocationList( MatrixPtr Matrix )
+{
+ register int I;
+ register AllocationListPtr ListPtr;
+
+ /* Begin `AllocateBlockOfAllocationList'. */
+ /* Allocate block of records for allocation list. */
+ ListPtr = SPALLOC(struct AllocationRecord, (ELEMENTS_PER_ALLOCATION + 1));
+ if (ListPtr == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+
+ /* String entries of allocation list into singly linked list. List is linked
+ such that any record points to the one before it. */
+
+ ListPtr->NextRecord = Matrix->TopOfAllocationList;
+ Matrix->TopOfAllocationList = ListPtr;
+ ListPtr += ELEMENTS_PER_ALLOCATION;
+ for (I = ELEMENTS_PER_ALLOCATION; I > 0; I--)
+ {
+ ListPtr->NextRecord = ListPtr - 1;
+ ListPtr--;
+ }
+
+ /* Record allocation of space for allocation list on allocation list. */
+ Matrix->TopOfAllocationList->AllocatedPtr = (char *)ListPtr;
+ Matrix->RecordsRemaining = ELEMENTS_PER_ALLOCATION;
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+/*
+ * MATRIX DEALLOCATION
+ *
+ * Deallocates pointers and elements of Matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix frame which is to be removed from memory.
+ *
+ * >>> Local variables:
+ * ListPtr (AllocationListPtr)
+ * Pointer into the linked list of pointers to allocated data structures.
+ * Points to pointer to structure to be freed.
+ * NextListPtr (AllocationListPtr)
+ * Pointer into the linked list of pointers to allocated data structures.
+ * Points to the next pointer to structure to be freed. This is needed
+ * because the data structure to be freed could include the current node
+ * in the allocation list.
+ */
+
+void spDestroy(register char *eMatrix)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register AllocationListPtr ListPtr, NextListPtr;
+
+
+ /* Begin `spDestroy'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+ /* Deallocate the vectors that are located in the matrix frame. */
+ SPFREE( Matrix->IntToExtColMap );
+ SPFREE( Matrix->IntToExtRowMap );
+ SPFREE( Matrix->ExtToIntColMap );
+ SPFREE( Matrix->ExtToIntRowMap );
+ SPFREE( Matrix->Diag );
+ SPFREE( Matrix->FirstInRow );
+ SPFREE( Matrix->FirstInCol );
+ SPFREE( Matrix->MarkowitzRow );
+ SPFREE( Matrix->MarkowitzCol );
+ SPFREE( Matrix->MarkowitzProd );
+ SPFREE( Matrix->DoCmplxDirect );
+ SPFREE( Matrix->DoRealDirect );
+ SPFREE( Matrix->Intermediate );
+
+
+ /* Sequentially step through the list of allocated pointers freeing pointers
+ * along the way. */
+
+ ListPtr = Matrix->TopOfAllocationList;
+ while (ListPtr != NULL )
+ {
+ char *LocPtr;
+ /* dans certain cas le pointeur ds la zone a desalouer
+ se trouve lui meme ds la dite zone en fait quand
+ ( ListPtr == ListPtr->AllocatedPtr )
+ donc un free(x) suivit de x=0
+ fait que l'on essaye d'ecrire ds une zone que l'on vient de desalouer
+ ce qui plante sur linux
+ fprintf(stderr,"Warning bad SPFREE\n");
+ je regle le probleme en mettant a zero avant le free !
+ */
+ NextListPtr = ListPtr->NextRecord;
+ /* BUGUED : SPFREE( ListPtr->AllocatedPtr) */
+ LocPtr = ListPtr->AllocatedPtr;
+ ListPtr->AllocatedPtr = NULL;
+ if ( LocPtr != NULL)
+ {
+ FREE(LocPtr);
+ }
+ ListPtr = NextListPtr;
+ }
+ return;
+}
+
+
+
+
+
+
+
+/*
+ * RETURN MATRIX ERROR STATUS
+ *
+ * This function is used to determine the error status of the given matrix.
+ *
+ * >>> Returned:
+ * The error status of the given matrix.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * The matrix for which the error status is desired.
+ */
+
+int spError( char *eMatrix )
+{
+ /* Begin `spError'. */
+
+ if (eMatrix != NULL)
+ {
+ ASSERT(((MatrixPtr)eMatrix)->ID == SPARSE_ID);
+ return ((MatrixPtr)eMatrix)->Error;
+ }
+ else
+ {
+ return spNO_MEMORY;
+ } /* This error may actually be spPANIC,
+ * no way to tell. */
+}
+
+
+
+
+
+
+
+
+
+/*
+ * WHERE IS MATRIX SINGULAR
+ *
+ * This function returns the row and column number where the matrix was
+ * detected as singular or where a zero was detected on the diagonal.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * The matrix for which the error status is desired.
+ * pRow <output> (int *)
+ * The row number.
+ * pCol <output> (int *)
+ * The column number.
+ */
+
+void spWhereSingular( char *eMatrix, int *pRow, int *pCol )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+
+ /* Begin `spWhereSingular'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+ if (Matrix->Error == spSINGULAR OR Matrix->Error == spZERO_DIAG)
+ {
+ *pRow = Matrix->SingularRow;
+ *pCol = Matrix->SingularCol;
+ }
+ else
+ {
+ *pRow = *pCol = 0;
+ }
+ return;
+}
+
+
+
+
+
+
+/*
+ * MATRIX SIZE
+ *
+ * Returns the size of the matrix. Either the internal or external size of
+ * the matrix is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to matrix.
+ * External <input> (SPBOOLEAN)
+ * If External is set true, the external size , i.e., the value of the
+ * largest external row or column number encountered is returned.
+ * Otherwise the true size of the matrix is returned. These two sizes
+ * may differ if the TRANSLATE option is set true.
+ */
+
+int spGetSize(char *eMatrix, SPBOOLEAN External )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+
+ /* Begin `spGetSize'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+#if TRANSLATE
+ if (External)
+ {
+ return Matrix->ExtSize;
+ }
+ else
+ {
+ return Matrix->Size;
+ }
+#else
+ return Matrix->Size;
+#endif
+}
+
+
+
+
+
+
+
+
+/*
+ * SET MATRIX COMPLEX OR REAL
+ *
+ * Forces matrix to be either real or complex.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to matrix.
+ */
+
+void spSetReal( char *eMatrix )
+{
+ /* Begin `spSetReal'. */
+
+ ASSERT( IS_SPARSE( (MatrixPtr)eMatrix ) AND REAL);
+ ((MatrixPtr)eMatrix)->Complex = NO;
+ return;
+}
+
+
+void spSetComplex( char *eMatrix )
+{
+ /* Begin `spSetComplex'. */
+
+ ASSERT( IS_SPARSE( (MatrixPtr)eMatrix ) AND spCOMPLEX);
+ ((MatrixPtr)eMatrix)->Complex = YES;
+ return;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * ELEMENT OR FILL-IN COUNT
+ *
+ * Two functions used to return simple statistics. Either the number
+ * of total elements, or the number of fill-ins can be returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to matrix.
+ */
+
+int spFillinCount( char *eMatrix )
+{
+ /* Begin `spFillinCount'. */
+
+ ASSERT( IS_SPARSE( (MatrixPtr)eMatrix ) );
+ return ((MatrixPtr)eMatrix)->Fillins;
+}
+
+
+int spElementCount( char *eMatrix )
+{
+ /* Begin `spElementCount'. */
+
+ ASSERT( IS_SPARSE( (MatrixPtr)eMatrix ) );
+ return ((MatrixPtr)eMatrix)->Elements;
+}
diff --git a/modules/sparse/src/c/spAllocate.h b/modules/sparse/src/c/spAllocate.h
new file mode 100755
index 000000000..814f4d531
--- /dev/null
+++ b/modules/sparse/src/c/spAllocate.h
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SPALLOCATE_H__
+#define __SPALLOCATE_H__
+
+#include "spDefs.h"
+
+ElementPtr spcGetElement( MatrixPtr Matrix );
+
+ElementPtr spcGetFillin( MatrixPtr Matrix );
+
+#endif /* __SPALLOCATE_H__ */
diff --git a/modules/sparse/src/c/spBuild.c b/modules/sparse/src/c/spBuild.c
new file mode 100755
index 000000000..5a2a335e1
--- /dev/null
+++ b/modules/sparse/src/c/spBuild.c
@@ -0,0 +1,1149 @@
+/*
+ * MATRIX BUILD MODULE
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains the routines associated with clearing, loading and
+ * preprocessing the matrix for the sparse matrix routines.
+ *
+ * >>> User accessible functions contained in this file:
+ * spClear
+ * spGetElement
+ * spGetAdmittance
+ * spGetQuad
+ * spGetOnes
+ * spInstallInitInfo
+ * spGetInitInfo
+ * spInitialize
+ *
+ * >>> Other functions contained in this file:
+ * spcFindElementInCol
+ * Translate
+ * spcCreateElement
+ * spcLinkRows
+ * EnlargeMatrix
+ * ExpandTranslationArrays
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+
+
+
+/**
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spmalloc.h"
+#include "spBuild.h"
+#include "spAllocate.h"
+
+static void Translate( MatrixPtr Matrix, int *Row, int *Col );
+static int EnlargeMatrix( MatrixPtr Matrix, register int NewSize );
+static int ExpandTranslationArrays( MatrixPtr Matrix, register int NewSize );
+
+
+
+/**
+ * CLEAR MATRIX
+ *
+ * Sets every element of the matrix to zero and clears the error flag.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix that is to be cleared.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * A pointer to the element being cleared.
+ */
+
+void
+spClear( char *eMatrix )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register int I;
+
+ /* Begin `spClear'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+ /* Clear matrix. */
+#if spCOMPLEX
+ if (Matrix->PreviousMatrixWasComplex OR Matrix->Complex)
+ {
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ pElement->Real = 0.0;
+ pElement->Imag = 0.0;
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+ else
+#endif
+ {
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ pElement->Real = 0.0;
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+
+ /* Empty the trash. */
+ Matrix->TrashCan.Real = 0.0;
+#if spCOMPLEX
+ Matrix->TrashCan.Imag = 0.0;
+#endif
+
+ Matrix->Error = spOKAY;
+ Matrix->Factored = NO;
+ Matrix->SingularCol = 0;
+ Matrix->SingularRow = 0;
+ Matrix->PreviousMatrixWasComplex = Matrix->Complex;
+ return;
+}
+
+
+/**
+ * SINGLE ELEMENT ADDITION TO MATRIX BY INDEX
+ *
+ * Finds element [Row,Col] and returns a pointer to it. If element is
+ * not found then it is created and spliced into matrix. This routine
+ * is only to be used after spCreate() and before spMNA_Preorder(),
+ * spFactor() or spOrderAndFactor(). Returns a pointer to the
+ * Real portion of a MatrixElement. This pointer is later used by
+ * spADD_xxx_ELEMENT to directly access element.
+ *
+ * >>> Returns:
+ * Returns a pointer to the element. This pointer is then used to directly
+ * access the element during successive builds.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix that the element is to be added to.
+ * Row <input> (int)
+ * Row index for element. Must be in the range of [0..Size] unless
+ * the options EXPANDABLE or TRANSLATE are used. Elements placed in
+ * row zero are discarded. In no case may Row be less than zero.
+ * Col <input> (int)
+ * Column index for element. Must be in the range of [0..Size] unless
+ * the options EXPANDABLE or TRANSLATE are used. Elements placed in
+ * column zero are discarded. In no case may Col be less than zero.
+ *
+ * >>> Local variables:
+ * pElement (RealNumber *)
+ * Pointer to the element.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+RealNumber *
+spGetElement( char *eMatrix, int Row, int Col )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ RealNumber *pElement;
+ ElementPtr spcFindElementInCol();
+
+
+ /* Begin `spGetElement'. */
+ ASSERT( IS_SPARSE( Matrix ) AND Row >= 0 AND Col >= 0 );
+
+ if ((Row == 0) OR (Col == 0))
+ {
+ return &Matrix->TrashCan.Real;
+ }
+
+#if NOT TRANSLATE
+ ASSERT(Matrix->NeedsOrdering);
+#endif
+
+#if TRANSLATE
+ Translate( Matrix, &Row, &Col );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return NULL;
+ }
+#endif
+
+#if NOT TRANSLATE
+#if NOT EXPANDABLE
+ ASSERT(Row <= Matrix->Size AND Col <= Matrix->Size);
+#endif
+
+#if EXPANDABLE
+ /* Re-size Matrix if necessary. */
+ if ((Row > Matrix->Size) OR (Col > Matrix->Size))
+ {
+ EnlargeMatrix( Matrix, Max(Row, Col) );
+ }
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return NULL;
+ }
+#endif
+#endif
+
+ /*
+ * The condition part of the following if statement tests to see if the
+ * element resides along the diagonal, if it does then it tests to see
+ * if the element has been created yet (Diag pointer not NULL). The
+ * pointer to the element is then assigned to Element after it is cast
+ * into a pointer to a RealNumber. This casting makes the pointer into
+ * a pointer to Real. This statement depends on the fact that Real
+ * is the first record in the MatrixElement structure.
+ */
+
+ if ((Row != Col) OR ((pElement = (RealNumber *)Matrix->Diag[Row]) == NULL))
+ {
+ /*
+ * Element does not exist or does not reside along diagonal. Search
+ * column for element. As in the if statement above, the pointer to the
+ * element which is returned by spcFindElementInCol is cast into a
+ * pointer to Real, a RealNumber.
+ */
+ pElement = (RealNumber*)spcFindElementInCol( Matrix,
+ &(Matrix->FirstInCol[Col]),
+ Row, Col, YES );
+ }
+ return pElement;
+}
+
+
+
+
+/**
+ * FIND ELEMENT BY SEARCHING COLUMN
+ *
+ * Searches column starting at element specified at PtrAddr and finds element
+ * in Row. If Element does not exists, it is created. The pointer to the
+ * element is returned.
+ *
+ * >>> Returned:
+ * A pointer to the desired element:
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to Matrix.
+ * LastAddr <input-output> (ElementPtr *)
+ * Address of pointer that initially points to the element in Col at which
+ * the search is started. The pointer in this location may be changed if
+ * a fill-in is required in and adjacent element. For this reason it is
+ * important that LastAddr be the address of a FirstInCol or a NextInCol
+ * rather than a temporary variable.
+ * Row <input> (int)
+ * Row being searched for.
+ * Col (int)
+ * Column being searched.
+ * CreateIfMissing <input> (SPBOOLEAN)
+ * Indicates what to do if element is not found, create one or return a
+ * NULL pointer.
+ *
+ * Local variables:
+ * pElement (ElementPtr)
+ * Pointer used to search through matrix.
+ */
+
+ElementPtr
+spcFindElementInCol( MatrixPtr Matrix, register ElementPtr *LastAddr, register int Row, int Col, SPBOOLEAN CreateIfMissing )
+{
+ register ElementPtr pElement;
+ ElementPtr spcCreateElement();
+
+ /* Begin `spcFindElementInCol'. */
+ pElement = *LastAddr;
+
+ /* Search for element. */
+ while (pElement != NULL)
+ {
+ if (pElement->Row < Row)
+ {
+ /* Have not reached element yet. */
+ LastAddr = &(pElement->NextInCol);
+ pElement = pElement->NextInCol;
+ }
+ else if (pElement->Row == Row)
+ {
+ /* Reached element. */
+ return pElement;
+ }
+ else
+ {
+ break; /* while loop */
+ }
+ }
+
+ /* Element does not exist and must be created. */
+ if (CreateIfMissing)
+ {
+ return spcCreateElement( Matrix, Row, Col, LastAddr, NO );
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+
+
+#if TRANSLATE
+
+/**
+ * TRANSLATE EXTERNAL INDICES TO INTERNAL
+ *
+ * Convert internal row and column numbers to internal row and column numbers.
+ * Also updates Ext/Int maps.
+ *
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Row <input/output> (int *)
+ * Upon entry Row is either a external row number of an external node
+ * number. Upon entry, the internal equivalent is supplied.
+ * Col <input/output> (int *)
+ * Upon entry Column is either a external column number of an external node
+ * number. Upon entry, the internal equivalent is supplied.
+ *
+ * >>> Local variables:
+ * ExtCol (int)
+ * Temporary variable used to hold the external column or node number
+ * during the external to internal column number translation.
+ * ExtRow (int)
+ * Temporary variable used to hold the external row or node number during
+ * the external to internal row number translation.
+ * IntCol (int)
+ * Temporary variable used to hold the internal column or node number
+ * during the external to internal column number translation.
+ * IntRow (int)
+ * Temporary variable used to hold the internal row or node number during
+ * the external to internal row number translation.
+ */
+
+static void
+Translate( MatrixPtr Matrix, int *Row, int *Col )
+{
+ register int IntRow, IntCol, ExtRow, ExtCol;
+
+ /* Begin `Translate'. */
+ ExtRow = *Row;
+ ExtCol = *Col;
+
+ /* Expand translation arrays if necessary. */
+ if ((ExtRow > Matrix->AllocatedExtSize) OR
+ (ExtCol > Matrix->AllocatedExtSize))
+ {
+ ExpandTranslationArrays( Matrix, Max(ExtRow, ExtCol) );
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return;
+ }
+ }
+
+ /* Set ExtSize if necessary. */
+ if ((ExtRow > Matrix->ExtSize) OR (ExtCol > Matrix->ExtSize))
+ {
+ Matrix->ExtSize = Max(ExtRow, ExtCol);
+ }
+
+ /* Translate external row or node number to internal row or node number. */
+ if ((IntRow = Matrix->ExtToIntRowMap[ExtRow]) == -1)
+ {
+ Matrix->ExtToIntRowMap[ExtRow] = ++Matrix->CurrentSize;
+ Matrix->ExtToIntColMap[ExtRow] = Matrix->CurrentSize;
+ IntRow = Matrix->CurrentSize;
+
+#if NOT EXPANDABLE
+ ASSERT(IntRow <= Matrix->Size);
+#endif
+
+#if EXPANDABLE
+ /* Re-size Matrix if necessary. */
+ if (IntRow > Matrix->Size)
+ {
+ EnlargeMatrix( Matrix, IntRow );
+ }
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return;
+ }
+#endif
+
+ Matrix->IntToExtRowMap[IntRow] = ExtRow;
+ Matrix->IntToExtColMap[IntRow] = ExtRow;
+ }
+
+ /* Translate external column or node number to internal column or node number.*/
+ if ((IntCol = Matrix->ExtToIntColMap[ExtCol]) == -1)
+ {
+ Matrix->ExtToIntRowMap[ExtCol] = ++Matrix->CurrentSize;
+ Matrix->ExtToIntColMap[ExtCol] = Matrix->CurrentSize;
+ IntCol = Matrix->CurrentSize;
+
+#if NOT EXPANDABLE
+ ASSERT(IntCol <= Matrix->Size);
+#endif
+
+#if EXPANDABLE
+ /* Re-size Matrix if necessary. */
+ if (IntCol > Matrix->Size)
+ {
+ EnlargeMatrix( Matrix, IntCol );
+ }
+ if (Matrix->Error == spNO_MEMORY)
+ {
+ return;
+ }
+#endif
+
+ Matrix->IntToExtRowMap[IntCol] = ExtCol;
+ Matrix->IntToExtColMap[IntCol] = ExtCol;
+ }
+
+ *Row = IntRow;
+ *Col = IntCol;
+ return;
+}
+#endif
+
+
+#if QUAD_ELEMENT
+/**
+ * ADDITION OF ADMITTANCE TO MATRIX BY INDEX
+ *
+ * Performs same function as spGetElement except rather than one
+ * element, all four Matrix elements for a floating component are
+ * added. This routine also works if component is grounded. Positive
+ * elements are placed at [Node1,Node2] and [Node2,Node1]. This
+ * routine is only to be used after spCreate() and before
+ * spMNA_Preorder(), spFactor() or spOrderAndFactor().
+ *
+ * >>> Returns:
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix that component is to be entered in.
+ * Node1 <input> (int)
+ * Row and column indices for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Node zero is the
+ * ground node. In no case may Node1 be less than zero.
+ * Node2 <input> (int)
+ * Row and column indices for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Node zero is the
+ * ground node. In no case may Node2 be less than zero.
+ * Template <output> (struct spTemplate *)
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int spGetAdmittance( char *Matrix, int Node1, int Node2, struct spTemplate *Template )
+{
+
+ /* Begin `spGetAdmittance'. */
+ Template->Element1 = spGetElement(Matrix, Node1, Node1 );
+ Template->Element2 = spGetElement(Matrix, Node2, Node2 );
+ Template->Element3Negated = spGetElement( Matrix, Node2, Node1 );
+ Template->Element4Negated = spGetElement( Matrix, Node1, Node2 );
+ if
+ ( (Template->Element1 == NULL)
+ OR (Template->Element2 == NULL)
+ OR (Template->Element3Negated == NULL)
+ OR (Template->Element4Negated == NULL)
+ )
+ {
+ return spNO_MEMORY;
+ }
+
+ if (Node1 == 0)
+ {
+ SWAP( RealNumber*, Template->Element1, Template->Element2 );
+ }
+
+ return spOKAY;
+}
+#endif /* QUAD_ELEMENT */
+
+
+#if QUAD_ELEMENT
+/**
+ * ADDITION OF FOUR ELEMENTS TO MATRIX BY INDEX
+ *
+ * Similar to spGetAdmittance, except that spGetAdmittance only
+ * handles 2-terminal components, whereas spGetQuad handles simple
+ * 4-terminals as well. These 4-terminals are simply generalized
+ * 2-terminals with the option of having the sense terminals different
+ * from the source and sink terminals. spGetQuad adds four
+ * elements to the matrix. Positive elements occur at Row1,Col1
+ * Row2,Col2 while negative elements occur at Row1,Col2 and Row2,Col1.
+ * The routine works fine if any of the rows and columns are zero.
+ * This routine is only to be used after spCreate() and before
+ * spMNA_Preorder(), spFactor() or spOrderAndFactor()
+ * unless TRANSLATE is set true.
+ *
+ * >>> Returns:
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix that component is to be entered in.
+ * Row1 <input> (int)
+ * First row index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Row1 be less than zero.
+ * Row2 <input> (int)
+ * Second row index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Row2 be less than zero.
+ * Col1 <input> (int)
+ * First column index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground column. In no case may Col1 be less than zero.
+ * Col2 <input> (int)
+ * Second column index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground column. In no case may Col2 be less than zero.
+ * Template <output> (struct spTemplate *)
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ * Real <input> (RealNumber)
+ * Real data to be added to elements.
+ * Imag <input> (RealNumber)
+ * Imag data to be added to elements. If matrix is real, this argument
+ * may be deleted.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int spGetQuad(char *Matrix, int Row1, int Row2, int Col1, int Col2, struct spTemplate *Template )
+{
+ /* Begin `spGetQuad'. */
+ Template->Element1 = spGetElement( Matrix, Row1, Col1);
+ Template->Element2 = spGetElement( Matrix, Row2, Col2 );
+ Template->Element3Negated = spGetElement( Matrix, Row2, Col1 );
+ Template->Element4Negated = spGetElement( Matrix, Row1, Col2 );
+ if
+ ( (Template->Element1 == NULL)
+ OR (Template->Element2 == NULL)
+ OR (Template->Element3Negated == NULL)
+ OR (Template->Element4Negated == NULL)
+ )
+ {
+ return spNO_MEMORY;
+ }
+
+ if (Template->Element1 == &((MatrixPtr)Matrix)->TrashCan.Real)
+ {
+ SWAP( RealNumber *, Template->Element1, Template->Element2 );
+ }
+
+ return spOKAY;
+}
+#endif /* QUAD_ELEMENT */
+
+
+#if QUAD_ELEMENT
+/**
+ * ADDITION OF FOUR STRUCTURAL ONES TO MATRIX BY INDEX
+ *
+ * Performs similar function to spGetQuad() except this routine is
+ * meant for components that do not have an admittance representation.
+ *
+ * The following stamp is used:
+ * Pos Neg Eqn
+ * Pos [ . . 1 ]
+ * Neg [ . . -1 ]
+ * Eqn [ 1 -1 . ]
+ *
+ * >>> Returns:
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix that component is to be entered in.
+ * Pos <input> (int)
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Pos be less than zero.
+ * Neg <input> (int)
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Neg be less than zero.
+ * Eqn <input> (int)
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Eqn be less than zero.
+ * Template <output> (struct spTemplate *)
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int spGetOnes(char *Matrix, int Pos, int Neg, int Eqn, struct spTemplate *Template)
+{
+ /* Begin `spGetOnes'. */
+ Template->Element4Negated = spGetElement( Matrix, Neg, Eqn );
+ Template->Element3Negated = spGetElement( Matrix, Eqn, Neg );
+ Template->Element2 = spGetElement( Matrix, Pos, Eqn );
+ Template->Element1 = spGetElement( Matrix, Eqn, Pos );
+ if
+ ( (Template->Element1 == NULL)
+ OR (Template->Element2 == NULL)
+ OR (Template->Element3Negated == NULL)
+ OR (Template->Element4Negated == NULL)
+ )
+ {
+ return spNO_MEMORY;
+ }
+
+ spADD_REAL_QUAD( *Template, 1.0 );
+ return spOKAY;
+}
+#endif /* QUAD_ELEMENT */
+
+
+/**
+ *
+ * CREATE AND SPLICE ELEMENT INTO MATRIX
+ *
+ * This routine is used to create new matrix elements and splice them into the
+ * matrix.
+ *
+ * >>> Returned:
+ * A pointer to the element that was created is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Row <input> (int)
+ * Row index for element.
+ * Col <input> (int)
+ * Column index for element.
+ * LastAddr <input-output> (ElementPtr *)
+ * This contains the address of the pointer to the element just above the
+ * one being created. It is used to speed the search and it is updated with
+ * address of the created element.
+ * Fillin <input> (SPBOOLEAN)
+ * Flag that indicates if created element is to be a fill-in.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix. It is used to refer to the newly
+ * created element and to restring the pointers of the element's row and
+ * column.
+ * pLastElement (ElementPtr)
+ * Pointer to the element in the matrix that was just previously pointed
+ * to by pElement. It is used to restring the pointers of the element's
+ * row and column.
+ * pCreatedElement (ElementPtr)
+ * Pointer to the desired element, the one that was just created.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+ElementPtr
+spcCreateElement( MatrixPtr Matrix, int Row, register int Col, register ElementPtr * LastAddr, SPBOOLEAN Fillin )
+{
+ register ElementPtr pElement, pLastElement;
+ ElementPtr pCreatedElement;
+
+ /* Begin `spcCreateElement'. */
+
+ if (Matrix->RowsLinked)
+ {
+ /* Row pointers cannot be ignored. */
+ if (Fillin)
+ {
+ pElement = spcGetFillin( Matrix );
+ Matrix->Fillins++;
+ }
+ else
+ {
+ pElement = spcGetElement( Matrix );
+ Matrix->NeedsOrdering = YES;
+ }
+ if (pElement == NULL)
+ {
+ return NULL;
+ }
+
+ /* If element is on diagonal, store pointer in Diag. */
+ if (Row == Col)
+ {
+ Matrix->Diag[Row] = pElement;
+ }
+
+ /* Initialize Element. */
+ pCreatedElement = pElement;
+ pElement->Row = Row;
+ pElement->Col = Col;
+ pElement->Real = 0.0;
+#if spCOMPLEX
+ pElement->Imag = 0.0;
+#endif
+#if INITIALIZE
+ pElement->pInitInfo = NULL;
+#endif
+
+ /* Splice element into column. */
+ pElement->NextInCol = *LastAddr;
+ *LastAddr = pElement;
+
+ /* Search row for proper element position. */
+ pElement = Matrix->FirstInRow[Row];
+ pLastElement = NULL;
+ while (pElement != NULL)
+ {
+ /* Search for element row position. */
+ if (pElement->Col < Col)
+ {
+ /* Have not reached desired element. */
+ pLastElement = pElement;
+ pElement = pElement->NextInRow;
+ }
+ else
+ {
+ pElement = NULL;
+ }
+ }
+
+ /* Splice element into row. */
+ pElement = pCreatedElement;
+ if (pLastElement == NULL)
+ {
+ /* Element is first in row. */
+ pElement->NextInRow = Matrix->FirstInRow[Row];
+ Matrix->FirstInRow[Row] = pElement;
+ }
+ else
+ /* Element is not first in row. */
+ {
+ pElement->NextInRow = pLastElement->NextInRow;
+ pLastElement->NextInRow = pElement;
+ }
+
+ }
+ else
+ {
+ /*
+ * Matrix has not been factored yet. Thus get element rather than fill-in.
+ * Also, row pointers can be ignored.
+ */
+
+ /* Allocate memory for Element. */
+ pElement = spcGetElement( Matrix );
+ if (pElement == NULL)
+ {
+ return NULL;
+ }
+
+ /* If element is on diagonal, store pointer in Diag. */
+ if (Row == Col)
+ {
+ Matrix->Diag[Row] = pElement;
+ }
+
+ /* Initialize Element. */
+ pCreatedElement = pElement;
+ pElement->Row = Row;
+#if DEBUG
+ pElement->Col = Col;
+#endif
+ pElement->Real = 0.0;
+#if spCOMPLEX
+ pElement->Imag = 0.0;
+#endif
+#if INITIALIZE
+ pElement->pInitInfo = NULL;
+#endif
+
+ /* Splice element into column. */
+ pElement->NextInCol = *LastAddr;
+ *LastAddr = pElement;
+ }
+
+ Matrix->Elements++;
+ return pCreatedElement;
+}
+
+
+/**
+ *
+ * LINK ROWS
+ *
+ * This routine is used to generate the row links. The spGetElement()
+ * routines do not create row links, which are needed by the spFactor()
+ * routines.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * FirstInRowEntry (ElementPtr *)
+ * A pointer into the FirstInRow array. Points to the FirstInRow entry
+ * currently being operated upon.
+ * FirstInRowArray (ArrayOfElementPtrs)
+ * A pointer to the FirstInRow array. Same as Matrix->FirstInRow but
+ * resides in a register and requires less indirection so is faster to
+ * use.
+ * Col (int)
+ * Column currently being operated upon.
+ */
+
+int spcLinkRows( MatrixPtr Matrix )
+{
+ register ElementPtr pElement, *FirstInRowEntry;
+ register ArrayOfElementPtrs FirstInRowArray;
+ register int Col;
+
+ /* Begin `spcLinkRows'. */
+ FirstInRowArray = Matrix->FirstInRow;
+ for (Col = Matrix->Size; Col >= 1; Col--)
+ {
+ /* Generate row links for the elements in the Col'th column. */
+ pElement = Matrix->FirstInCol[Col];
+
+ while (pElement != NULL)
+ {
+ pElement->Col = Col;
+ FirstInRowEntry = &FirstInRowArray[pElement->Row];
+ pElement->NextInRow = *FirstInRowEntry;
+ *FirstInRowEntry = pElement;
+ pElement = pElement->NextInCol;
+ }
+ }
+ Matrix->RowsLinked = YES;
+ return 0;
+}
+
+
+
+/**
+ * ENLARGE MATRIX
+ *
+ * Increases the size of the matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * NewSize <input> (int)
+ * The new size of the matrix.
+ *
+ * >>> Local variables:
+ * OldAllocatedSize (int)
+ * The allocated size of the matrix before it is expanded.
+ */
+
+static int EnlargeMatrix( MatrixPtr Matrix, register int NewSize )
+{
+ register int I, OldAllocatedSize = Matrix->AllocatedSize;
+
+ /* Begin `EnlargeMatrix'. */
+ Matrix->Size = NewSize;
+
+ if (NewSize <= OldAllocatedSize)
+ {
+ return 0;
+ }
+
+ /* Expand the matrix frame. */
+ NewSize = (int) Max( NewSize, EXPANSION_FACTOR * OldAllocatedSize );
+ Matrix->AllocatedSize = NewSize;
+
+ if (( SPREALLOC(Matrix->IntToExtColMap, int, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ if (( SPREALLOC(Matrix->IntToExtRowMap, int, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ if (( SPREALLOC(Matrix->Diag, ElementPtr, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ if (( SPREALLOC(Matrix->FirstInCol, ElementPtr, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ if (( SPREALLOC(Matrix->FirstInRow, ElementPtr, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+
+ /*
+ * Destroy the Markowitz and Intermediate vectors, they will be recreated
+ * in spOrderAndFactor().
+ */
+ SPFREE( Matrix->MarkowitzRow );
+ SPFREE( Matrix->MarkowitzCol );
+ SPFREE( Matrix->MarkowitzProd );
+ SPFREE( Matrix->DoRealDirect );
+ SPFREE( Matrix->DoCmplxDirect );
+ SPFREE( Matrix->Intermediate );
+ Matrix->InternalVectorsAllocated = NO;
+
+ /* Initialize the new portion of the vectors. */
+ for (I = OldAllocatedSize + 1; I <= NewSize; I++)
+ {
+ Matrix->IntToExtColMap[I] = I;
+ Matrix->IntToExtRowMap[I] = I;
+ Matrix->Diag[I] = NULL;
+ Matrix->FirstInRow[I] = NULL;
+ Matrix->FirstInCol[I] = NULL;
+ }
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+#if TRANSLATE
+
+/**
+ * EXPAND TRANSLATION ARRAYS
+ *
+ * Increases the size arrays that are used to translate external to internal
+ * row and column numbers.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * NewSize <input> (int)
+ * The new size of the translation arrays.
+ *
+ * >>> Local variables:
+ * OldAllocatedSize (int)
+ * The allocated size of the translation arrays before being expanded.
+ */
+
+static int
+ExpandTranslationArrays( MatrixPtr Matrix, register int NewSize )
+{
+ register int I, OldAllocatedSize = Matrix->AllocatedExtSize;
+
+ /* Begin `ExpandTranslationArrays'. */
+ Matrix->ExtSize = NewSize;
+
+ if (NewSize <= OldAllocatedSize)
+ {
+ return 0;
+ }
+
+ /* Expand the translation arrays ExtToIntRowMap and ExtToIntColMap. */
+ NewSize = (int) Max( NewSize, EXPANSION_FACTOR * OldAllocatedSize );
+ Matrix->AllocatedExtSize = NewSize;
+
+ if (( SPREALLOC(Matrix->ExtToIntRowMap, int, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ if (( SPREALLOC(Matrix->ExtToIntColMap, int, NewSize + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+
+ /* Initialize the new portion of the vectors. */
+ for (I = OldAllocatedSize + 1; I <= NewSize; I++)
+ {
+ Matrix->ExtToIntRowMap[I] = -1;
+ Matrix->ExtToIntColMap[I] = -1;
+ }
+
+ return 0;
+}
+#endif
+
+
+
+
+
+
+
+
+
+#if INITIALIZE
+/**
+ * INITIALIZE MATRIX
+ *
+ * With the INITIALIZE compiler option (see spConfig.h) set true,
+ * Sparse allows the user to keep initialization information with each
+ * structurally nonzero matrix element. Each element has a pointer
+ * that is set and used by the user. The user can set this pointer
+ * using spInstallInitInfo and may be read using spGetInitInfo. Both
+ * may be used only after the element exists. The function
+ * spInitialize() is a user customizable way to initialize the matrix.
+ * Passed to this routine is a function pointer. spInitialize() sweeps
+ * through every element in the matrix and checks the pInitInfo
+ * pointer (the user supplied pointer). If the pInitInfo is NULL,
+ * which is true unless the user changes it (almost always true for
+ * fill-ins), then the element is zeroed. Otherwise, the function
+ * pointer is called and passed the pInitInfo pointer as well as the
+ * element pointer and the external row and column numbers. If the
+ * user sets the value of each element, then spInitialize() replaces
+ * spClear().
+ *
+ * The user function is expected to return a nonzero int if there
+ * is a fatal error and zero otherwise. Upon encountering a nonzero
+ * return code, spInitialize() terminates and returns the error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ *
+ * >>> Possible Errors:
+ * Returns nonzero if error, zero otherwise.
+ */
+
+void spInstallInitInfo( RealNumber *pElement, char *pInitInfo )
+{
+ /* Begin `spInstallInitInfo'. */
+ ASSERT(pElement != NULL);
+
+ ((ElementPtr)pElement)->pInitInfo = pInitInfo;
+}
+
+
+char *spGetInitInfo( RealNumber *pElement )
+{
+ /* Begin `spGetInitInfo'. */
+ ASSERT(pElement != NULL);
+
+ return (char *)((ElementPtr)pElement)->pInitInfo;
+}
+
+
+int spInitialize( char *eMatrix, int (*pInit)() )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ int J, Error, Col;
+
+ /* Begin `spInitialize'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+#if spCOMPLEX
+ /* Clear imaginary part of matrix if matrix is real but was complex. */
+ if (Matrix->PreviousMatrixWasComplex AND NOT Matrix->Complex)
+ {
+ for (J = Matrix->Size; J > 0; J--)
+ {
+ pElement = Matrix->FirstInCol[J];
+ while (pElement != NULL)
+ {
+ pElement->Imag = 0.0;
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+#endif /* spCOMPLEX */
+
+ /* Initialize the matrix. */
+ for (J = Matrix->Size; J > 0; J--)
+ {
+ pElement = Matrix->FirstInCol[J];
+ Col = Matrix->IntToExtColMap[J];
+ while (pElement != NULL)
+ {
+ if (pElement->pInitInfo == NULL)
+ {
+ pElement->Real = 0.0;
+# if spCOMPLEX
+ pElement->Imag = 0.0;
+# endif
+ }
+ else
+ {
+ Error = (*pInit)((RealNumber *)pElement, pElement->pInitInfo,
+ Matrix->IntToExtRowMap[pElement->Row], Col);
+ if (Error)
+ {
+ Matrix->Error = spFATAL;
+ return Error;
+ }
+
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+
+ /* Empty the trash. */
+ Matrix->TrashCan.Real = 0.0;
+#if spCOMPLEX
+ Matrix->TrashCan.Imag = 0.0;
+#endif
+
+ Matrix->Error = spOKAY;
+ Matrix->Factored = NO;
+ Matrix->SingularCol = 0;
+ Matrix->SingularRow = 0;
+ Matrix->PreviousMatrixWasComplex = Matrix->Complex;
+ return 0;
+}
+#endif /* INITIALIZE */
diff --git a/modules/sparse/src/c/spBuild.h b/modules/sparse/src/c/spBuild.h
new file mode 100755
index 000000000..546c44a25
--- /dev/null
+++ b/modules/sparse/src/c/spBuild.h
@@ -0,0 +1,25 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SPBUILD_H__
+#define __SPBUILD_H__
+
+#include "spDefs.h"
+/* TODO: move comments from spBuild.c */
+
+ElementPtr spcFindElementInCol( MatrixPtr Matrix, register ElementPtr *LastAddr, register int Row, int Col, SPBOOLEAN CreateIfMissing );
+
+ElementPtr spcCreateElement( MatrixPtr Matrix, int Row, register int Col, register ElementPtr * LastAddr, SPBOOLEAN Fillin );
+
+int spcLinkRows( MatrixPtr Matrix );
+
+#endif /* __SPBUILD_H__ */
diff --git a/modules/sparse/src/c/spFactor.c b/modules/sparse/src/c/spFactor.c
new file mode 100755
index 000000000..f0026dab3
--- /dev/null
+++ b/modules/sparse/src/c/spFactor.c
@@ -0,0 +1,3469 @@
+/*
+ * MATRIX FACTORIZATION MODULE
+ *
+ * Author: Advising Professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains the routines to factor the matrix into LU form.
+ *
+ * >>> User accessible functions contained in this file:
+ * spOrderAndFactor
+ * spFactor
+ * spPartition
+ *
+ * >>> Other functions contained in this file:
+ * FactorComplexMatrix CreateInternalVectors
+ * CountMarkowitz MarkowitzProducts
+ * SearchForPivot SearchForSingleton
+ * QuicklySearchDiagonal SearchDiagonal
+ * SearchEntireMatrix FindLargestInCol
+ * FindBiggestInColExclude ExchangeRowsAndCols
+ * spcRowExchange spcColExchange
+ * ExchangeColElements ExchangeRowElements
+ * RealRowColElimination ComplexRowColElimination
+ * UpdateMarkowitzNumbers CreateFillin
+ * MatrixIsSingular ZeroPivot
+ * WriteStatus
+ */
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#define spINSIDE_SPARSE
+
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spmalloc.h"
+#include "spFortran.h"
+#include "spBuild.h"
+
+static int FactorComplexMatrix( MatrixPtr Matrix );
+static int CreateInternalVectors( MatrixPtr Matrix );
+static int CountMarkowitz( MatrixPtr Matrix, register RealVector RHS, int Step );
+static int MarkowitzProducts( MatrixPtr Matrix, int Step );
+static ElementPtr SearchForPivot( MatrixPtr Matrix, int Step, int DiagPivoting );
+static ElementPtr SearchForSingleton( MatrixPtr Matrix, int Step );
+static ElementPtr QuicklySearchDiagonal( MatrixPtr Matrix, int Step );
+static ElementPtr SearchDiagonal( MatrixPtr Matrix, register int Step );
+static ElementPtr SearchEntireMatrix( MatrixPtr Matrix, int Step );
+static RealNumber FindLargestInCol( register ElementPtr pElement );
+static RealNumber FindBiggestInColExclude( MatrixPtr Matrix, register ElementPtr pElement, register int Step );
+static int ExchangeRowsAndCols( MatrixPtr Matrix, ElementPtr pPivot, register int Step );
+static int ExchangeColElements( MatrixPtr Matrix, int Row1, register ElementPtr Element1, int Row2, register ElementPtr Element2, int Column );
+static int ExchangeRowElements( MatrixPtr Matrix, int Col1, register ElementPtr Element1, int Col2, register ElementPtr Element2, int Row );
+static int RealRowColElimination( MatrixPtr Matrix, register ElementPtr pPivot );
+static int ComplexRowColElimination( MatrixPtr Matrix, register ElementPtr pPivot );
+static int UpdateMarkowitzNumbers( MatrixPtr Matrix, ElementPtr pPivot );
+static ElementPtr CreateFillin( MatrixPtr Matrix, register int Row, int Col );
+static int MatrixIsSingular( MatrixPtr Matrix, int Step );
+static int ZeroPivot( MatrixPtr Matrix, int Step );
+
+
+int spcRowExchange( MatrixPtr Matrix, int Row1, int Row2 );
+int spcColExchange( MatrixPtr Matrix, int Col1, int Col2 );
+
+/*
+ * ORDER AND FACTOR MATRIX
+ *
+ * This routine chooses a pivot order for the matrix and factors it
+ * into LU form. It handles both the initial factorization and subsequent
+ * factorizations when a reordering is desired. This is handled in a manner
+ * that is transparent to the user. The routine uses a variation of
+ * Gauss's method where the pivots are associated with L and the
+ * diagonal terms of U are one.
+ *
+ * >>> Returned:
+ * The error code is returned. Possible errors are listed below.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * Representative right-hand side vector that is used to determine
+ * pivoting order when the right hand side vector is sparse. If
+ * RHS is a NULL pointer then the RHS vector is assumed to
+ * be full and it is not used when determining the pivoting
+ * order.
+ * RelThreshold <input> (RealNumber)
+ * This number determines what the pivot relative threshold will
+ * be. It should be between zero and one. If it is one then the
+ * pivoting method becomes complete pivoting, which is very slow
+ * and tends to fill up the matrix. If it is set close to zero
+ * the pivoting method becomes strict Markowitz with no
+ * threshold. The pivot threshold is used to eliminate pivot
+ * candidates that would cause excessive element growth if they
+ * were used. Element growth is the cause of roundoff error.
+ * Element growth occurs even in well-conditioned matrices.
+ * Setting the RelThreshold large will reduce element growth and
+ * roundoff error, but setting it too large will cause execution
+ * time to be excessive and will result in a large number of
+ * fill-ins. If this occurs, accuracy can actually be degraded
+ * because of the large number of operations required on the
+ * matrix due to the large number of fill-ins. A good value seems
+ * to be 0.001. The default is chosen by giving a value larger
+ * than one or less than or equal to zero. This value should be
+ * increased and the matrix resolved if growth is found to be
+ * excessive. Changing the pivot threshold does not improve
+ * performance on matrices where growth is low, as is often the
+ * case with ill-conditioned matrices. Once a valid threshold is
+ * given, it becomes the new default. The default value of
+ * RelThreshold was chosen for use with nearly diagonally
+ * dominant matrices such as node- and modified-node admittance
+ * matrices. For these matrices it is usually best to use
+ * diagonal pivoting. For matrices without a strong diagonal, it
+ * is usually best to use a larger threshold, such as 0.01 or
+ * 0.1.
+ * AbsThreshold <input> (RealNumber)
+ * The absolute magnitude an element must have to be considered
+ * as a pivot candidate, except as a last resort. This number
+ * should be set significantly smaller than the smallest diagonal
+ * element that is is expected to be placed in the matrix. If
+ * there is no reasonable prediction for the lower bound on these
+ * elements, then AbsThreshold should be set to zero.
+ * AbsThreshold is used to reduce the possibility of choosing as a
+ * pivot an element that has suffered heavy cancellation and as a
+ * result mainly consists of roundoff error. Once a valid
+ * threshold is given, it becomes the new default.
+ * DiagPivoting <input> (SPBOOLEAN)
+ * A flag indicating that pivot selection should be confined to the
+ * diagonal if possible. If DiagPivoting is nonzero and if
+ * DIAGONAL_PIVOTING is enabled pivots will be chosen only from
+ * the diagonal unless there are no diagonal elements that satisfy
+ * the threshold criteria. Otherwise, the entire reduced
+ * submatrix is searched when looking for a pivot. The diagonal
+ * pivoting in Sparse is efficient and well refined, while the
+ * off-diagonal pivoting is not. For symmetric and near symmetric
+ * matrices, it is best to use diagonal pivoting because it
+ * results in the best performance when reordering the matrix and
+ * when factoring the matrix without ordering. If there is a
+ * considerable amount of nonsymmetry in the matrix, then
+ * off-diagonal pivoting may result in a better equation ordering
+ * simply because there are more pivot candidates to choose from.
+ * A better ordering results in faster subsequent factorizations.
+ * However, the initial pivot selection process takes considerably
+ * longer for off-diagonal pivoting.
+ *
+ * >>> Local variables:
+ * pPivot (ElementPtr)
+ * Pointer to the element being used as a pivot.
+ * ReorderingRequired (SPBOOLEAN)
+ * Flag that indicates whether reordering is required.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spSINGULAR
+ * spSMALL_PIVOT
+ * Error is cleared in this function.
+ */
+
+
+int spOrderAndFactor(char *eMatrix, RealNumber RHS[], RealNumber RelThreshold, RealNumber AbsThreshold, SPBOOLEAN DiagPivoting )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ ElementPtr pPivot;
+ int Step, Size, ReorderingRequired;
+ RealNumber LargestInCol;
+
+ /* Begin `spOrderAndFactor'. */
+ ASSERT( IS_VALID(Matrix) AND NOT Matrix->Factored);
+
+ Matrix->Error = spOKAY;
+ Size = Matrix->Size;
+ if (RelThreshold <= 0.0)
+ {
+ RelThreshold = Matrix->RelThreshold;
+ }
+ if (RelThreshold > 1.0)
+ {
+ RelThreshold = Matrix->RelThreshold;
+ }
+ Matrix->RelThreshold = RelThreshold;
+ if (AbsThreshold < 0.0)
+ {
+ AbsThreshold = Matrix->AbsThreshold;
+ }
+ Matrix->AbsThreshold = AbsThreshold;
+ ReorderingRequired = NO;
+
+ if (NOT Matrix->NeedsOrdering)
+ {
+ /* Matrix has been factored before and reordering is not required. */
+ for (Step = 1; Step <= Size; Step++)
+ {
+ pPivot = Matrix->Diag[Step];
+ LargestInCol = FindLargestInCol(pPivot->NextInCol);
+ if ((LargestInCol * RelThreshold < ELEMENT_MAG(pPivot)))
+ {
+ if (Matrix->Complex)
+ {
+ ComplexRowColElimination( Matrix, pPivot );
+ }
+ else
+ {
+ RealRowColElimination( Matrix, pPivot );
+ }
+ }
+ else
+ {
+ ReorderingRequired = YES;
+ break; /* for loop */
+ }
+ }
+ if (NOT ReorderingRequired)
+ {
+ goto Done;
+ }
+ else
+ {
+ /*
+ * A pivot was not large enough to maintain accuracy,
+ * so a partial reordering is required.
+ */
+
+#if ANNOTATE >= ON_STRANGE_BEHAVIOR
+ printf(_("Reordering, Step = %1d\n"), Step);
+#endif
+ }
+ } /* End of if(NOT Matrix->NeedsOrdering) */
+ else
+ {
+ /*
+ * This is the first time the matrix has been factored. These few statements
+ * indicate to the rest of the code that a full reodering is required rather
+ * than a partial reordering, which occurs during a failure of a fast
+ * factorization.
+ */
+ Step = 1;
+ if (NOT Matrix->RowsLinked)
+ {
+ spcLinkRows( Matrix );
+ }
+ if (NOT Matrix->InternalVectorsAllocated)
+ {
+ CreateInternalVectors( Matrix );
+ }
+ if (Matrix->Error >= spFATAL)
+ {
+ return Matrix->Error;
+ }
+ }
+
+ /* Form initial Markowitz products. */
+ CountMarkowitz( Matrix, RHS, Step );
+ MarkowitzProducts( Matrix, Step );
+ Matrix->MaxRowCountInLowerTri = -1;
+ /* Initialize numerical Rank */
+ Matrix->NumRank = Matrix->Size;
+ /* Perform reordering and factorization. */
+ for (; Step <= Size; Step++)
+ {
+ pPivot = SearchForPivot( Matrix, Step, DiagPivoting );
+ if (pPivot != NULL && ELEMENT_MAG(pPivot) > Matrix->AbsThreshold)
+ /*JPC return MatrixIsSingular( Matrix, Step ); */
+ {
+ ExchangeRowsAndCols( Matrix, pPivot, Step );
+
+ if (Matrix->Complex)
+ {
+ ComplexRowColElimination( Matrix, pPivot );
+ }
+ else
+ {
+ RealRowColElimination( Matrix, pPivot );
+ }
+
+ if (Matrix->Error >= spFATAL)
+ {
+ return Matrix->Error;
+ }
+ UpdateMarkowitzNumbers( Matrix, pPivot );
+
+#if ANNOTATE == FULL
+ WriteStatus( Matrix, Step );
+#endif
+ }
+ else
+ {
+ Matrix->NumRank = Step - 1;
+#if ANNOTATE == FULL
+ if (pPivot == NULL)
+ {
+ fprintf(stderr, "//Matrix is Singular Returning LU ");
+ }
+ else
+ {
+ fprintf(stderr, "//Matrix is Singular at level prec [%f] I return LU\n", ELEMENT_MAG(pPivot));
+ }
+#endif
+ break;
+
+ }
+ }
+ /* Changing the diag elements in order to have L in the matrix */
+
+Done:
+ Matrix->NeedsOrdering = NO;
+ Matrix->Reordered = YES;
+ Matrix->Factored = YES;
+
+ return Matrix->Error;
+}
+
+
+
+
+
+
+
+/*
+ * FACTOR MATRIX
+ *
+ * This routine is the companion routine to spOrderAndFactor().
+ * Unlike spOrderAndFactor(), spFactor() cannot change the ordering.
+ * It is also faster than spOrderAndFactor(). The standard way of
+ * using these two routines is to first use spOrderAndFactor() for the
+ * initial factorization. For subsequent factorizations, spFactor()
+ * is used if there is some assurance that little growth will occur
+ * (say for example, that the matrix is diagonally dominant). If
+ * spFactor() is called for the initial factorization of the matrix,
+ * then spOrderAndFactor() is automatically called with the default
+ * threshold. This routine uses "row at a time" LU factorization.
+ * Pivots are associated with the lower triangular matrix and the
+ * diagonals of the upper triangular matrix are ones.
+ *
+ * >>> Returned:
+ * The error code is returned. Possible errors are listed below.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spSINGULAR
+ * spZERO_DIAG
+ * spSMALL_PIVOT
+ * Error is cleared in this function.
+ */
+
+int spFactor( char *eMatrix )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register ElementPtr pColumn;
+ register int Step, Size;
+ RealNumber Mult;
+
+ /* Begin `spFactor'. */
+ ASSERT( IS_VALID(Matrix) AND NOT Matrix->Factored);
+
+ if (Matrix->NeedsOrdering)
+ {
+ return spOrderAndFactor( eMatrix, (RealVector)NULL,
+ 0.0, -1.0, DIAG_PIVOTING_AS_DEFAULT );
+ /*jpc I put -1.0 for AbsThresold in order to use the Matrix stored Thresold see lu.c */
+ }
+ if (NOT Matrix->Partitioned)
+ {
+ spPartition( eMatrix, spDEFAULT_PARTITION );
+ }
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ return FactorComplexMatrix( Matrix );
+ }
+#endif
+
+#if REAL
+ Size = Matrix->Size;
+
+ if (Matrix->Diag[1]->Real == 0.0)
+ {
+ return ZeroPivot( Matrix, 1 );
+ }
+ /*jpc Matrix->Diag[1]->Real = 1.0 / Matrix->Diag[1]->Real;*/
+
+ /* Start factorization. */
+ for (Step = 2; Step <= Size; Step++)
+ {
+ if (Matrix->DoRealDirect[Step])
+ {
+ /* Update column using direct addressing scatter-gather. */
+ register RealNumber *Dest = (RealNumber *)Matrix->Intermediate;
+
+ /* Scatter. */
+ pElement = Matrix->FirstInCol[Step];
+ while (pElement != NULL)
+ {
+ Dest[pElement->Row] = pElement->Real;
+ pElement = pElement->NextInCol;
+ }
+
+ /* Update column. */
+ pColumn = Matrix->FirstInCol[Step];
+ while (pColumn->Row < Step)
+ {
+ pElement = Matrix->Diag[pColumn->Row];
+ pColumn->Real = Dest[pColumn->Row] * pElement->Real;
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ Dest[pElement->Row] -= pColumn->Real * pElement->Real;
+ }
+ pColumn = pColumn->NextInCol;
+ }
+
+ /* Gather. */
+ pElement = Matrix->Diag[Step]->NextInCol;
+ while (pElement != NULL)
+ {
+ pElement->Real = Dest[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+
+ /* Check for singular matrix. */
+ if (Dest[Step] == 0.0)
+ {
+ return ZeroPivot( Matrix, Step );
+ }
+ /*jpc Matrix->Diag[Step]->Real = 1.0 / Dest[Step];*/
+ }
+ else
+ {
+ /* Update column using indirect addressing scatter-gather. */
+ register RealNumber **pDest = (RealNumber **)Matrix->Intermediate;
+
+ /* Scatter. */
+ pElement = Matrix->FirstInCol[Step];
+ while (pElement != NULL)
+ {
+ pDest[pElement->Row] = &pElement->Real;
+ pElement = pElement->NextInCol;
+ }
+
+ /* Update column. */
+ pColumn = Matrix->FirstInCol[Step];
+ while (pColumn->Row < Step)
+ {
+ pElement = Matrix->Diag[pColumn->Row];
+ Mult = (*pDest[pColumn->Row] *= pElement->Real);
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ *pDest[pElement->Row] -= Mult * pElement->Real;
+ }
+ pColumn = pColumn->NextInCol;
+ }
+
+ /* Check for singular matrix. */
+ if (Matrix->Diag[Step]->Real == 0.0)
+ {
+ return ZeroPivot( Matrix, Step );
+ }
+ /*jpc Matrix->Diag[Step]->Real = 1.0 / Matrix->Diag[Step]->Real; */
+ }
+ }
+
+ Matrix->Factored = YES;
+ return (Matrix->Error = spOKAY);
+#endif /* REAL */
+}
+
+
+
+
+
+
+#if spCOMPLEX
+/*
+ * FACTOR COMPLEX MATRIX
+ *
+ * This routine is the companion routine to spFactor(), it
+ * handles complex matrices. It is otherwise identical.
+ *
+ * >>> Returned:
+ * The error code is returned. Possible errors are listed below.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ *
+ * >>> Possible errors:
+ * spSINGULAR
+ * Error is cleared in this function.
+ */
+
+static int
+FactorComplexMatrix( MatrixPtr Matrix )
+{
+ register ElementPtr pElement;
+ register ElementPtr pColumn;
+ register int Step, Size;
+ ComplexNumber Mult, Pivot;
+
+ /* Begin `FactorComplexMatrix'. */
+ ASSERT(Matrix->Complex);
+
+ Size = Matrix->Size;
+ pElement = Matrix->Diag[1];
+ if (ELEMENT_MAG(pElement) == 0.0)
+ {
+ return ZeroPivot( Matrix, 1 );
+ }
+ /* Cmplx expr: *pPivot = 1.0 / *pPivot. */
+ CMPLX_RECIPROCAL( *pElement, *pElement );
+
+ /* Start factorization. */
+ for (Step = 2; Step <= Size; Step++)
+ {
+ if (Matrix->DoCmplxDirect[Step])
+ {
+ /* Update column using direct addressing scatter-gather. */
+ register ComplexNumber *Dest;
+ Dest = (ComplexNumber *)Matrix->Intermediate;
+
+ /* Scatter. */
+ pElement = Matrix->FirstInCol[Step];
+ while (pElement != NULL)
+ {
+ Dest[pElement->Row] = *(ComplexNumber *)pElement;
+ pElement = pElement->NextInCol;
+ }
+
+ /* Update column. */
+ pColumn = Matrix->FirstInCol[Step];
+ while (pColumn->Row < Step)
+ {
+ pElement = Matrix->Diag[pColumn->Row];
+ /* Cmplx expr: Mult = Dest[pColumn->Row] * (1.0 / *pPivot). */
+ CMPLX_MULT(Mult, Dest[pColumn->Row], *pElement);
+ CMPLX_ASSIGN(*pColumn, Mult);
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ /* Cmplx expr: Dest[pElement->Row] -= Mult * pElement */
+ CMPLX_MULT_SUBT_ASSIGN(Dest[pElement->Row], Mult, *pElement);
+ }
+ pColumn = pColumn->NextInCol;
+ }
+
+ /* Gather. */
+ pElement = Matrix->Diag[Step]->NextInCol;
+ while (pElement != NULL)
+ {
+ *(ComplexNumber *)pElement = Dest[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+
+ /* Check for singular matrix. */
+ Pivot = Dest[Step];
+ if (CMPLX_1_NORM(Pivot) == 0.0)
+ {
+ return ZeroPivot( Matrix, Step );
+ }
+ CMPLX_RECIPROCAL( *Matrix->Diag[Step], Pivot );
+ }
+ else
+ {
+ /* Update column using direct addressing scatter-gather. */
+ register ComplexNumber **pDest;
+ pDest = (ComplexNumber **)Matrix->Intermediate;
+
+ /* Scatter. */
+ pElement = Matrix->FirstInCol[Step];
+ while (pElement != NULL)
+ {
+ pDest[pElement->Row] = (ComplexNumber *)pElement;
+ pElement = pElement->NextInCol;
+ }
+
+ /* Update column. */
+ pColumn = Matrix->FirstInCol[Step];
+ while (pColumn->Row < Step)
+ {
+ pElement = Matrix->Diag[pColumn->Row];
+ /* Cmplx expr: Mult = *pDest[pColumn->Row] * (1.0 / *pPivot). */
+ CMPLX_MULT(Mult, *pDest[pColumn->Row], *pElement);
+ CMPLX_ASSIGN(*pDest[pColumn->Row], Mult);
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ /* Cmplx expr: *pDest[pElement->Row] -= Mult * pElement */
+ CMPLX_MULT_SUBT_ASSIGN(*pDest[pElement->Row], Mult, *pElement);
+ }
+ pColumn = pColumn->NextInCol;
+ }
+
+ /* Check for singular matrix. */
+ pElement = Matrix->Diag[Step];
+ if (ELEMENT_MAG(pElement) == 0.0)
+ {
+ return ZeroPivot( Matrix, Step );
+ }
+ CMPLX_RECIPROCAL( *pElement, *pElement );
+ }
+ }
+
+ Matrix->Factored = YES;
+ return (Matrix->Error = spOKAY);
+}
+#endif /* spCOMPLEX */
+
+
+
+
+
+/*
+ * PARTITION MATRIX
+ *
+ * This routine determines the cost to factor each row using both
+ * direct and indirect addressing and decides, on a row-by-row basis,
+ * which addressing mode is fastest. This information is used in
+ * spFactor() to speed the factorization.
+ *
+ * When factoring a previously ordered matrix using spFactor(), Sparse
+ * operates on a row-at-a-time basis. For speed, on each step, the
+ * row being updated is copied into a full vector and the operations
+ * are performed on that vector. This can be done one of two ways,
+ * either using direct addressing or indirect addressing. Direct
+ * addressing is fastest when the matrix is relatively dense and
+ * indirect addressing is best when the matrix is quite sparse. The
+ * user selects the type of partition used with Mode. If Mode is set
+ * to spDIRECT_PARTITION, then the all rows are placed in the direct
+ * addressing partition. Similarly, if Mode is set to
+ * spINDIRECT_PARTITION, then the all rows are placed in the indirect
+ * addressing partition. By setting Mode to spAUTO_PARTITION, the
+ * user allows Sparse to select the partition for each row
+ * individually. spFactor() generally runs faster if Sparse is
+ * allowed to choose its own partitioning, however choosing a
+ * partition is expensive. The time required to choose a partition is
+ * of the same order of the cost to factor the matrix. If you plan to
+ * factor a large number of matrices with the same structure, it is
+ * best to let Sparse choose the partition. Otherwise, you should
+ * choose the partition based on the predicted density of the matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * Mode <input> (int)
+ * Mode must be one of three special codes: spDIRECT_PARTITION,
+ * spINDIRECT_PARTITION, or spAUTO_PARTITION.
+ */
+
+void
+spPartition( char *eMatrix, int Mode )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement, pColumn;
+ register int Step, Size;
+ register int *Nc, *No, *Nm;
+ SPBOOLEAN *DoRealDirect, *DoCmplxDirect;
+
+ /* Begin `spPartition'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+ if (Matrix->Partitioned)
+ {
+ return;
+ }
+ Size = Matrix->Size;
+ DoRealDirect = Matrix->DoRealDirect;
+ DoCmplxDirect = Matrix->DoCmplxDirect;
+ Matrix->Partitioned = YES;
+
+ /* If partition is specified by the user, this is easy. */
+ if (Mode == spDEFAULT_PARTITION)
+ {
+ Mode = DEFAULT_PARTITION;
+ }
+ if (Mode == spDIRECT_PARTITION)
+ {
+ for (Step = 1; Step <= Size; Step++)
+#if REAL
+ DoRealDirect[Step] = YES;
+#endif
+#if spCOMPLEX
+ DoCmplxDirect[Step] = YES;
+#endif
+ return;
+ }
+ else if (Mode == spINDIRECT_PARTITION)
+ {
+ for (Step = 1; Step <= Size; Step++)
+#if REAL
+ DoRealDirect[Step] = NO;
+#endif
+#if spCOMPLEX
+ DoCmplxDirect[Step] = NO;
+#endif
+ return;
+ }
+ else
+ {
+ ASSERT( Mode == spAUTO_PARTITION );
+ }
+
+ /* Otherwise, count all operations needed in when factoring matrix. */
+ Nc = (int *)Matrix->MarkowitzRow;
+ No = (int *)Matrix->MarkowitzCol;
+ Nm = (int *)Matrix->MarkowitzProd;
+
+ /* Start mock-factorization. */
+ for (Step = 1; Step <= Size; Step++)
+ {
+ Nc[Step] = No[Step] = Nm[Step] = 0;
+
+ pElement = Matrix->FirstInCol[Step];
+ while (pElement != NULL)
+ {
+ Nc[Step]++;
+ pElement = pElement->NextInCol;
+ }
+
+ pColumn = Matrix->FirstInCol[Step];
+ while (pColumn->Row < Step)
+ {
+ pElement = Matrix->Diag[pColumn->Row];
+ Nm[Step]++;
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ No[Step]++;
+ }
+ pColumn = pColumn->NextInCol;
+ }
+ }
+
+ for (Step = 1; Step <= Size; Step++)
+ {
+ /*
+ * The following are just estimates based on a count on the number of
+ * machine instructions used on each machine to perform the various
+ * tasks. It was assumed that each machine instruction required the
+ * same amount of time (I don't believe this is true for the VAX, and
+ * have no idea if this is true for the 68000 family). For optimum
+ * performance, these numbers should be tuned to the machine.
+ * Nc is the number of nonzero elements in the column.
+ * Nm is the number of multipliers in the column.
+ * No is the number of operations in the inner loop.
+ */
+
+#define generic
+#ifdef hp9000s300
+#if REAL
+ DoRealDirect[Step] = (Nm[Step] + No[Step] > 3 * Nc[Step] - 2 * Nm[Step]);
+#endif
+#if spCOMPLEX
+ /* On the hp350, it is never profitable to use direct for complex. */
+ DoCmplxDirect[Step] = NO;
+#endif
+#undef generic
+#endif
+
+#ifdef vax
+#if REAL
+ DoRealDirect[Step] = (Nm[Step] + No[Step] > 3 * Nc[Step] - 2 * Nm[Step]);
+#endif
+#if spCOMPLEX
+ DoCmplxDirect[Step] = (Nm[Step] + No[Step] > 7 * Nc[Step] - 4 * Nm[Step]);
+#endif
+#undef generic
+#endif
+
+#ifdef generic
+#if REAL
+ DoRealDirect[Step] = (Nm[Step] + No[Step] > 3 * Nc[Step] - 2 * Nm[Step]);
+#endif
+#if spCOMPLEX
+ DoCmplxDirect[Step] = (Nm[Step] + No[Step] > 7 * Nc[Step] - 4 * Nm[Step]);
+#endif
+#undef generic
+#endif
+ }
+
+#if (ANNOTATE == FULL)
+ {
+ int Ops = 0;
+ for (Step = 1; Step <= Size; Step++)
+ {
+ Ops += No[Step];
+ }
+ printf(_("Operation count for inner loop of factorization = %d.\n"), Ops);
+ }
+#endif
+ return;
+}
+
+
+
+
+
+
+
+/*
+ * CREATE INTERNAL VECTORS
+ *
+ * Creates the Markowitz and Intermediate vectors.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ *
+ * >>> Local variables:
+ * SizePlusOne (unsigned)
+ * Size of the arrays to be allocated.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+CreateInternalVectors( MatrixPtr Matrix )
+{
+ int Size;
+
+ /* Begin `CreateInternalVectors'. */
+ /* Create Markowitz arrays. */
+ Size = Matrix->Size;
+
+ if (Matrix->MarkowitzRow == NULL)
+ {
+ if (( Matrix->MarkowitzRow = SPALLOC(int, Size + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+ if (Matrix->MarkowitzCol == NULL)
+ {
+ if (( Matrix->MarkowitzCol = SPALLOC(int, Size + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+ if (Matrix->MarkowitzProd == NULL)
+ {
+ if (( Matrix->MarkowitzProd = SPALLOC(long, Size + 2)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+
+ /* Create DoDirect vectors for use in spFactor(). */
+#if REAL
+ if (Matrix->DoRealDirect == NULL)
+ {
+ if (( Matrix->DoRealDirect = SPALLOC(SPBOOLEAN, Size + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+#endif
+#if spCOMPLEX
+ if (Matrix->DoCmplxDirect == NULL)
+ {
+ if (( Matrix->DoCmplxDirect = SPALLOC(SPBOOLEAN, Size + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+#endif
+
+ /* Create Intermediate vectors for use in MatrixSolve. */
+#if spCOMPLEX
+ if (Matrix->Intermediate == NULL)
+ {
+ if ((Matrix->Intermediate = SPALLOC(RealNumber, 2 * (Size + 1))) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+#else
+ if (Matrix->Intermediate == NULL)
+ {
+ if ((Matrix->Intermediate = SPALLOC(RealNumber, Size + 1)) == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ }
+ }
+#endif
+
+ if (Matrix->Error != spNO_MEMORY)
+ {
+ Matrix->InternalVectorsAllocated = YES;
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+/*
+ * COUNT MARKOWITZ
+ *
+ * Scans Matrix to determine the Markowitz counts for each row and column.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * Representative right-hand side vector that is used to determine
+ * pivoting order when the right hand side vector is sparse. If
+ * RHS is a NULL pointer then the RHS vector is assumed to be full
+ * and it is not used when determining the pivoting order.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * Count (int)
+ * Temporary counting variable.
+ * ExtRow (int)
+ * The external row number that corresponds to I.
+ * pElement (ElementPtr)
+ * Pointer to matrix elements.
+ * Size (int)
+ * The size of the matrix.
+ */
+
+static int CountMarkowitz( MatrixPtr Matrix, register RealVector RHS, int Step )
+{
+ register int Count, I, Size = Matrix->Size;
+ register ElementPtr pElement;
+ int ExtRow;
+
+ /* Begin `CountMarkowitz'. */
+
+ /* Correct array pointer for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spSEPARATED_COMPLEX_VECTORS OR NOT spCOMPLEX
+ if (RHS != NULL)
+ {
+ --RHS;
+ }
+#else
+ if (RHS != NULL)
+ {
+ if (Matrix->Complex)
+ {
+ RHS -= 2;
+ }
+ else
+ {
+ --RHS;
+ }
+ }
+#endif
+#endif
+
+ /* Generate MarkowitzRow Count for each row. */
+ for (I = Step; I <= Size; I++)
+ {
+ /* Set Count to -1 initially to remove count due to pivot element. */
+ Count = -1;
+ pElement = Matrix->FirstInRow[I];
+ while (pElement != NULL AND pElement->Col < Step)
+ {
+ pElement = pElement->NextInRow;
+ }
+ while (pElement != NULL)
+ {
+ Count++;
+ pElement = pElement->NextInRow;
+ }
+
+ /* Include nonzero elements in the RHS vector. */
+ ExtRow = Matrix->IntToExtRowMap[I];
+
+#if spSEPARATED_COMPLEX_VECTORS OR NOT spCOMPLEX
+ if (RHS != NULL)
+ if (RHS[ExtRow] != 0.0)
+ {
+ Count++;
+ }
+#else
+ if (RHS != NULL)
+ {
+ if (Matrix->Complex)
+ {
+ if ((RHS[2 * ExtRow] != 0.0) OR (RHS[2 * ExtRow + 1] != 0.0))
+ {
+ Count++;
+ }
+ }
+ else if (RHS[I] != 0.0)
+ {
+ Count++;
+ }
+ }
+#endif
+ Matrix->MarkowitzRow[I] = Count;
+ }
+
+ /* Generate the MarkowitzCol count for each column. */
+ for (I = Step; I <= Size; I++)
+ {
+ /* Set Count to -1 initially to remove count due to pivot element. */
+ Count = -1;
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL AND pElement->Row < Step)
+ {
+ pElement = pElement->NextInCol;
+ }
+ while (pElement != NULL)
+ {
+ Count++;
+ pElement = pElement->NextInCol;
+ }
+ Matrix->MarkowitzCol[I] = Count;
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+/*
+ * MARKOWITZ PRODUCTS
+ *
+ * Calculates MarkowitzProduct for each diagonal element from the Markowitz
+ * counts.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local Variables:
+ * pMarkowitzProduct (long *)
+ * Pointer that points into MarkowitzProduct array. Is used to
+ * sequentially access entries quickly.
+ * pMarkowitzRow (int *)
+ * Pointer that points into MarkowitzRow array. Is used to sequentially
+ * access entries quickly.
+ * pMarkowitzCol (int *)
+ * Pointer that points into MarkowitzCol array. Is used to sequentially
+ * access entries quickly.
+ * Product (long)
+ * Temporary storage for Markowitz product./
+ * Size (int)
+ * The size of the matrix.
+ */
+
+static int
+MarkowitzProducts( MatrixPtr Matrix, int Step )
+{
+ register int I, *pMarkowitzRow, *pMarkowitzCol;
+ register long Product, *pMarkowitzProduct;
+ register int Size = Matrix->Size;
+ double fProduct;
+
+ /* Begin `MarkowitzProducts'. */
+ Matrix->Singletons = 0;
+
+ pMarkowitzProduct = &(Matrix->MarkowitzProd[Step]);
+ pMarkowitzRow = &(Matrix->MarkowitzRow[Step]);
+ pMarkowitzCol = &(Matrix->MarkowitzCol[Step]);
+
+ for (I = Step; I <= Size; I++)
+ {
+ /* If chance of overflow, use real numbers. */
+ if ((*pMarkowitzRow > LARGEST_SHORT_INTEGER AND * pMarkowitzCol != 0) OR
+ (*pMarkowitzCol > LARGEST_SHORT_INTEGER AND * pMarkowitzRow != 0))
+ {
+ fProduct = (double)(*pMarkowitzRow++) * (double)(*pMarkowitzCol++);
+ if (fProduct >= LARGEST_LONG_INTEGER)
+ {
+ *pMarkowitzProduct++ = LARGEST_LONG_INTEGER;
+ }
+ else
+ {
+ *pMarkowitzProduct++ = (long) fProduct;
+ }
+ }
+ else
+ {
+ Product = *pMarkowitzRow++ **pMarkowitzCol++;
+ if ((*pMarkowitzProduct++ = Product) == 0)
+ {
+ Matrix->Singletons++;
+ }
+ }
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * SEARCH FOR BEST PIVOT
+ *
+ * Performs a search to determine the element with the lowest Markowitz
+ * Product that is also acceptable. An acceptable element is one that is
+ * larger than the AbsThreshold and at least as large as RelThreshold times
+ * the largest element in the same column. The first step is to look for
+ * singletons if any exist. If none are found, then all the diagonals are
+ * searched. The diagonal is searched once quickly using the assumption that
+ * elements on the diagonal are large compared to other elements in their
+ * column, and so the pivot can be chosen only on the basis of the Markowitz
+ * criterion. After a element has been chosen to be pivot on the basis of
+ * its Markowitz product, it is checked to see if it is large enough.
+ * Waiting to the end of the Markowitz search to check the size of a pivot
+ * candidate saves considerable time, but is not guaranteed to find an
+ * acceptable pivot. Thus if unsuccessful a second pass of the diagonal is
+ * made. This second pass checks to see if an element is large enough during
+ * the search, not after it. If still no acceptable pivot candidate has
+ * been found, the search expands to cover the entire matrix.
+ *
+ * >>> Returned:
+ * A pointer to the element chosen to be pivot. If every element in the
+ * matrix is zero, then NULL is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * The row and column number of the beginning of the reduced submatrix.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to element that has been chosen to be the pivot.
+ *
+ * >>> Possible errors:
+ * spSINGULAR
+ * spSMALL_PIVOT
+ */
+
+static ElementPtr
+SearchForPivot( MatrixPtr Matrix, int Step, int DiagPivoting )
+{
+ register ElementPtr ChosenPivot;
+
+ /* Begin `SearchForPivot'. */
+
+ /* If singletons exist, look for an acceptable one to use as pivot. */
+ if (Matrix->Singletons)
+ {
+ ChosenPivot = SearchForSingleton( Matrix, Step );
+ if (ChosenPivot != NULL)
+ {
+ Matrix->PivotSelectionMethod = 's';
+ return ChosenPivot;
+ }
+ }
+
+#if DIAGONAL_PIVOTING
+ if (DiagPivoting)
+ {
+ /*
+ * Either no singletons exist or they weren't acceptable. Take quick first
+ * pass at searching diagonal. First search for element on diagonal of
+ * remaining submatrix with smallest Markowitz product, then check to see
+ * if it okay numerically. If not, QuicklySearchDiagonal fails.
+ */
+ ChosenPivot = QuicklySearchDiagonal( Matrix, Step );
+ if (ChosenPivot != NULL)
+ {
+ Matrix->PivotSelectionMethod = 'q';
+ return ChosenPivot;
+ }
+
+ /*
+ * Quick search of diagonal failed, carefully search diagonal and check each
+ * pivot candidate numerically before even tentatively accepting it.
+ */
+ ChosenPivot = SearchDiagonal( Matrix, Step );
+ if (ChosenPivot != NULL)
+ {
+ Matrix->PivotSelectionMethod = 'd';
+ return ChosenPivot;
+ }
+ }
+#endif /* DIAGONAL_PIVOTING */
+
+ /* No acceptable pivot found yet, search entire matrix. */
+ ChosenPivot = SearchEntireMatrix( Matrix, Step );
+ Matrix->PivotSelectionMethod = 'e';
+
+ return ChosenPivot;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * SEARCH FOR SINGLETON TO USE AS PIVOT
+ *
+ * Performs a search to find a singleton to use as the pivot. The
+ * first acceptable singleton is used. A singleton is acceptable if
+ * it is larger in magnitude than the AbsThreshold and larger
+ * than RelThreshold times the largest of any other elements in the same
+ * column. It may seem that a singleton need not satisfy the
+ * relative threshold criterion, however it is necessary to prevent
+ * excessive growth in the RHS from resulting in overflow during the
+ * forward and backward substitution. A singleton does not need to
+ * be on the diagonal to be selected.
+ *
+ * >>> Returned:
+ * A pointer to the singleton chosen to be pivot. In no singleton is
+ * acceptable, return NULL.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to element that has been chosen to be the pivot.
+ * PivotMag (RealNumber)
+ * Magnitude of ChosenPivot.
+ * Singletons (int)
+ * The count of the number of singletons that can be used as pivots.
+ * A local version of Matrix->Singletons.
+ * pMarkowitzProduct (long *)
+ * Pointer that points into MarkowitzProduct array. It is used to quickly
+ * access successive Markowitz products.
+ */
+
+static ElementPtr
+SearchForSingleton( MatrixPtr Matrix, int Step )
+{
+ register ElementPtr ChosenPivot;
+ register int I;
+ register long *pMarkowitzProduct;
+ int Singletons;
+ RealNumber PivotMag;
+
+ /* Begin `SearchForSingleton'. */
+ /* Initialize pointer that is to scan through MarkowitzProduct vector. */
+ pMarkowitzProduct = &(Matrix->MarkowitzProd[Matrix->Size + 1]);
+ Matrix->MarkowitzProd[Matrix->Size + 1] = Matrix->MarkowitzProd[Step];
+
+ /* Decrement the count of available singletons, on the assumption that an
+ * acceptable one will be found. */
+ Singletons = Matrix->Singletons--;
+
+ /*
+ * Assure that following while loop will always terminate, this is just
+ * preventive medicine, if things are working right this should never
+ * be needed.
+ */
+ Matrix->MarkowitzProd[Step - 1] = 0;
+
+ while (Singletons-- > 0)
+ {
+ /* Singletons exist, find them. */
+
+ /*
+ * This is tricky. Am using a pointer to sequentially step through the
+ * MarkowitzProduct array. Search terminates when singleton (Product = 0)
+ * is found. Note that the conditional in the while statement
+ * ( *pMarkowitzProduct ) is true as long as the MarkowitzProduct is not
+ * equal to zero. The row (and column) index on the diagonal is then
+ * calculated by subtracting the pointer to the Markowitz product of
+ * the first diagonal from the pointer to the Markowitz product of the
+ * desired element, the singleton.
+ *
+ * Search proceeds from the end (high row and column numbers) to the
+ * beginning (low row and column numbers) so that rows and columns with
+ * large Markowitz products will tend to be move to the bottom of the
+ * matrix. However, choosing Diag[Step] is desirable because it would
+ * require no row and column interchanges, so inspect it first by
+ * putting its Markowitz product at the end of the MarkowitzProd
+ * vector.
+ */
+
+ while ( *pMarkowitzProduct-- )
+ {
+ /*
+ * N bottles of beer on the wall;
+ * N bottles of beer.
+ * you take one down and pass it around;
+ * N-1 bottles of beer on the wall.
+ */
+ }
+ I = (int) (pMarkowitzProduct - Matrix->MarkowitzProd + 1);
+
+ /* Assure that I is valid. */
+ if (I < Step)
+ {
+ break; /* while (Singletons-- > 0) */
+ }
+ if (I > Matrix->Size)
+ {
+ I = Step;
+ }
+
+ /* Singleton has been found in either/both row or/and column I. */
+ if ((ChosenPivot = Matrix->Diag[I]) != NULL)
+ {
+ /* Singleton lies on the diagonal. */
+ PivotMag = ELEMENT_MAG(ChosenPivot);
+ if
+ ( PivotMag > Matrix->AbsThreshold AND
+ PivotMag > Matrix->RelThreshold *
+ FindBiggestInColExclude( Matrix, ChosenPivot, Step )
+ )
+ {
+ return ChosenPivot;
+ }
+ }
+ else
+ {
+ /* Singleton does not lie on diagonal, find it. */
+ if (Matrix->MarkowitzCol[I] == 0)
+ {
+ ChosenPivot = Matrix->FirstInCol[I];
+ while ((ChosenPivot != NULL) AND (ChosenPivot->Row < Step))
+ {
+ ChosenPivot = ChosenPivot->NextInCol;
+ }
+ PivotMag = ELEMENT_MAG(ChosenPivot);
+ if
+ ( PivotMag > Matrix->AbsThreshold AND
+ PivotMag > Matrix->RelThreshold *
+ FindBiggestInColExclude( Matrix, ChosenPivot,
+ Step )
+ )
+ {
+ return ChosenPivot;
+ }
+ else
+ {
+ if (Matrix->MarkowitzRow[I] == 0)
+ {
+ ChosenPivot = Matrix->FirstInRow[I];
+ while ((ChosenPivot != NULL) AND (ChosenPivot->Col < Step))
+ {
+ ChosenPivot = ChosenPivot->NextInRow;
+ }
+ PivotMag = ELEMENT_MAG(ChosenPivot);
+ if
+ ( PivotMag > Matrix->AbsThreshold AND
+ PivotMag > Matrix->RelThreshold *
+ FindBiggestInColExclude( Matrix,
+ ChosenPivot,
+ Step )
+ )
+ {
+ return ChosenPivot;
+ }
+ }
+ }
+ }
+ else
+ {
+ ChosenPivot = Matrix->FirstInRow[I];
+ while ((ChosenPivot != NULL) AND (ChosenPivot->Col < Step))
+ {
+ ChosenPivot = ChosenPivot->NextInRow;
+ }
+ PivotMag = ELEMENT_MAG(ChosenPivot);
+ if
+ ( PivotMag > Matrix->AbsThreshold AND
+ PivotMag > Matrix->RelThreshold *
+ FindBiggestInColExclude( Matrix, ChosenPivot,
+ Step )
+ )
+ {
+ return ChosenPivot;
+ }
+ }
+ }
+ /* Singleton not acceptable (too small), try another. */
+ } /* end of while(lSingletons>0) */
+
+ /*
+ * All singletons were unacceptable. Restore Matrix->Singletons count.
+ * Initial assumption that an acceptable singleton would be found was wrong.
+ */
+ Matrix->Singletons++;
+ return NULL;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+#if DIAGONAL_PIVOTING
+#if MODIFIED_MARKOWITZ
+/*
+ * QUICK SEARCH OF DIAGONAL FOR PIVOT WITH MODIFIED MARKOWITZ CRITERION
+ *
+ * Searches the diagonal looking for the best pivot. For a pivot to be
+ * acceptable it must be larger than the pivot RelThreshold times the largest
+ * element in its reduced column. Among the acceptable diagonals, the
+ * one with the smallest MarkowitzProduct is sought. Search terminates
+ * early if a diagonal is found with a MarkowitzProduct of one and its
+ * magnitude is larger than the other elements in its row and column.
+ * Since its MarkowitzProduct is one, there is only one other element in
+ * both its row and column, and, as a condition for early termination,
+ * these elements must be located symmetricly in the matrix. If a tie
+ * occurs between elements of equal MarkowitzProduct, then the element with
+ * the largest ratio between its magnitude and the largest element in its
+ * column is used. The search will be terminated after a given number of
+ * ties have occurred and the best (largest ratio) of the tied element will
+ * be used as the pivot. The number of ties that will trigger an early
+ * termination is MinMarkowitzProduct * TIES_MULTIPLIER.
+ *
+ * >>> Returned:
+ * A pointer to the diagonal element chosen to be pivot. If no diagonal is
+ * acceptable, a NULL is returned.
+ *
+ * >>> Arguments:
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to the element that has been chosen to be the pivot.
+ * LargestOffDiagonal (RealNumber)
+ * Magnitude of the largest of the off-diagonal terms associated with
+ * a diagonal with MarkowitzProduct equal to one.
+ * Magnitude (RealNumber)
+ * Absolute value of diagonal element.
+ * MaxRatio (RealNumber)
+ * Among the elements tied with the smallest Markowitz product, MaxRatio
+ * is the best (smallest) ratio of LargestInCol to the diagonal Magnitude
+ * found so far. The smaller the ratio, the better numerically the
+ * element will be as pivot.
+ * MinMarkowitzProduct (long)
+ * Smallest Markowitz product found of pivot candidates that lie along
+ * diagonal.
+ * NumberOfTies (int)
+ * A count of the number of Markowitz ties that have occurred at current
+ * MarkowitzProduct.
+ * pDiag (ElementPtr)
+ * Pointer to current diagonal element.
+ * pMarkowitzProduct (long *)
+ * Pointer that points into MarkowitzProduct array. It is used to quickly
+ * access successive Markowitz products.
+ * Ratio (RealNumber)
+ * For the current pivot candidate, Ratio is the ratio of the largest
+ * element in its column (excluding itself) to its magnitude.
+ * TiedElements (ElementPtr[])
+ * Array of pointers to the elements with the minimum Markowitz
+ * product.
+ * pOtherInCol (ElementPtr)
+ * When there is only one other element in a column other than the
+ * diagonal, pOtherInCol is used to point to it. Used when Markowitz
+ * product is to determine if off diagonals are placed symmetricly.
+ * pOtherInRow (ElementPtr)
+ * When there is only one other element in a row other than the diagonal,
+ * pOtherInRow is used to point to it. Used when Markowitz product is
+ * to determine if off diagonals are placed symmetricly.
+ */
+
+static ElementPtr
+QuicklySearchDiagonal( MatrixPtr Matrix, int Step )
+{
+ register long MinMarkowitzProduct, *pMarkowitzProduct;
+ register ElementPtr pDiag, pOtherInRow, pOtherInCol;
+ int I, NumberOfTies;
+ ElementPtr ChosenPivot, TiedElements[MAX_MARKOWITZ_TIES + 1];
+ RealNumber Magnitude, LargestInCol, Ratio, MaxRatio;
+ RealNumber LargestOffDiagonal;
+ RealNumber FindBiggestInColExclude();
+
+ /* Begin `QuicklySearchDiagonal'. */
+ NumberOfTies = -1;
+ MinMarkowitzProduct = LARGEST_LONG_INTEGER;
+ pMarkowitzProduct = &(Matrix->MarkowitzProd[Matrix->Size + 2]);
+ Matrix->MarkowitzProd[Matrix->Size + 1] = Matrix->MarkowitzProd[Step];
+
+ /* Assure that following while loop will always terminate. */
+ Matrix->MarkowitzProd[Step - 1] = -1;
+
+ /*
+ * This is tricky. Am using a pointer in the inner while loop to
+ * sequentially step through the MarkowitzProduct array. Search
+ * terminates when the Markowitz product of zero placed at location
+ * Step-1 is found. The row (and column) index on the diagonal is then
+ * calculated by subtracting the pointer to the Markowitz product of
+ * the first diagonal from the pointer to the Markowitz product of the
+ * desired element. The outer for loop is infinite, broken by using
+ * break.
+ *
+ * Search proceeds from the end (high row and column numbers) to the
+ * beginning (low row and column numbers) so that rows and columns with
+ * large Markowitz products will tend to be move to the bottom of the
+ * matrix. However, choosing Diag[Step] is desirable because it would
+ * require no row and column interchanges, so inspect it first by
+ * putting its Markowitz product at the end of the MarkowitzProd
+ * vector.
+ */
+
+ for (;;) /* Endless for loop. */
+ {
+ while (MinMarkowitzProduct < * (--pMarkowitzProduct))
+ {
+ /*
+ * N bottles of beer on the wall;
+ * N bottles of beer.
+ * You take one down and pass it around;
+ * N-1 bottles of beer on the wall.
+ */
+ }
+
+ I = pMarkowitzProduct - Matrix->MarkowitzProd;
+
+ /* Assure that I is valid; if I < Step, terminate search. */
+ if (I < Step)
+ {
+ break; /* Endless for loop */
+ }
+ if (I > Matrix->Size)
+ {
+ I = Step;
+ }
+
+ if ((pDiag = Matrix->Diag[I]) == NULL)
+ {
+ continue; /* Endless for loop */
+ }
+ if ((Magnitude = ELEMENT_MAG(pDiag)) <= Matrix->AbsThreshold)
+ {
+ continue; /* Endless for loop */
+ }
+
+ if (*pMarkowitzProduct == 1)
+ {
+ /* Case where only one element exists in row and column other than diagonal. */
+
+ /* Find off diagonal elements. */
+ pOtherInRow = pDiag->NextInRow;
+ pOtherInCol = pDiag->NextInCol;
+ if (pOtherInRow == NULL AND pOtherInCol == NULL)
+ {
+ pOtherInRow = Matrix->FirstInRow[I];
+ while (pOtherInRow != NULL)
+ {
+ if (pOtherInRow->Col >= Step AND pOtherInRow->Col != I)
+ {
+ break;
+ }
+ pOtherInRow = pOtherInRow->NextInRow;
+ }
+ pOtherInCol = Matrix->FirstInCol[I];
+ while (pOtherInCol != NULL)
+ {
+ if (pOtherInCol->Row >= Step AND pOtherInCol->Row != I)
+ {
+ break;
+ }
+ pOtherInCol = pOtherInCol->NextInCol;
+ }
+ }
+
+ /* Accept diagonal as pivot if diagonal is larger than off diagonals and the
+ * off diagonals are placed symmetricly. */
+ if (pOtherInRow != NULL AND pOtherInCol != NULL)
+ {
+ if (pOtherInRow->Col == pOtherInCol->Row)
+ {
+ LargestOffDiagonal = Max(ELEMENT_MAG(pOtherInRow),
+ ELEMENT_MAG(pOtherInCol));
+ if (Magnitude >= LargestOffDiagonal)
+ {
+ /* Accept pivot, it is unlikely to contribute excess error. */
+ return pDiag;
+ }
+ }
+ }
+ }
+
+ if (*pMarkowitzProduct < MinMarkowitzProduct)
+ {
+ /* Notice strict inequality in test. This is a new smallest MarkowitzProduct. */
+ TiedElements[0] = pDiag;
+ MinMarkowitzProduct = *pMarkowitzProduct;
+ NumberOfTies = 0;
+ }
+ else
+ {
+ /* This case handles Markowitz ties. */
+ if (NumberOfTies < MAX_MARKOWITZ_TIES)
+ {
+ TiedElements[++NumberOfTies] = pDiag;
+ if (NumberOfTies >= MinMarkowitzProduct * TIES_MULTIPLIER)
+ {
+ break; /* Endless for loop */
+ }
+ }
+ }
+ } /* End of endless for loop. */
+
+ /* Test to see if any element was chosen as a pivot candidate. */
+ if (NumberOfTies < 0)
+ {
+ return NULL;
+ }
+
+ /* Determine which of tied elements is best numerically. */
+ ChosenPivot = NULL;
+ MaxRatio = 1.0 / Matrix->RelThreshold;
+
+ for (I = 0; I <= NumberOfTies; I++)
+ {
+ pDiag = TiedElements[I];
+ Magnitude = ELEMENT_MAG(pDiag);
+ LargestInCol = FindBiggestInColExclude( Matrix, pDiag, Step );
+ Ratio = LargestInCol / Magnitude;
+ if (Ratio < MaxRatio)
+ {
+ ChosenPivot = pDiag;
+ MaxRatio = Ratio;
+ }
+ }
+ return ChosenPivot;
+}
+
+
+
+
+
+
+
+
+
+
+#else /* Not MODIFIED_MARKOWITZ */
+/*
+ * QUICK SEARCH OF DIAGONAL FOR PIVOT WITH CONVENTIONAL MARKOWITZ
+ * CRITERION
+ *
+ * Searches the diagonal looking for the best pivot. For a pivot to be
+ * acceptable it must be larger than the pivot RelThreshold times the largest
+ * element in its reduced column. Among the acceptable diagonals, the
+ * one with the smallest MarkowitzProduct is sought. Search terminates
+ * early if a diagonal is found with a MarkowitzProduct of one and its
+ * magnitude is larger than the other elements in its row and column.
+ * Since its MarkowitzProduct is one, there is only one other element in
+ * both its row and column, and, as a condition for early termination,
+ * these elements must be located symmetricly in the matrix.
+ *
+ * >>> Returned:
+ * A pointer to the diagonal element chosen to be pivot. If no diagonal is
+ * acceptable, a NULL is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to the element that has been chosen to be the pivot.
+ * LargestOffDiagonal (RealNumber)
+ * Magnitude of the largest of the off-diagonal terms associated with
+ * a diagonal with MarkowitzProduct equal to one.
+ * Magnitude (RealNumber)
+ * Absolute value of diagonal element.
+ * MinMarkowitzProduct (long)
+ * Smallest Markowitz product found of pivot candidates which are
+ * acceptable.
+ * pDiag (ElementPtr)
+ * Pointer to current diagonal element.
+ * pMarkowitzProduct (long *)
+ * Pointer that points into MarkowitzProduct array. It is used to quickly
+ * access successive Markowitz products.
+ * pOtherInCol (ElementPtr)
+ * When there is only one other element in a column other than the
+ * diagonal, pOtherInCol is used to point to it. Used when Markowitz
+ * product is to determine if off diagonals are placed symmetricly.
+ * pOtherInRow (ElementPtr)
+ * When there is only one other element in a row other than the diagonal,
+ * pOtherInRow is used to point to it. Used when Markowitz product is
+ * to determine if off diagonals are placed symmetricly.
+ */
+
+static ElementPtr
+QuicklySearchDiagonal( MatrixPtr Matrix, int Step )
+{
+ register long MinMarkowitzProduct, *pMarkowitzProduct;
+ register ElementPtr pDiag;
+ int I;
+ ElementPtr ChosenPivot, pOtherInRow, pOtherInCol;
+ RealNumber Magnitude, LargestInCol, LargestOffDiagonal;
+ RealNumber FindBiggestInColExclude();
+
+ /* Begin `QuicklySearchDiagonal'. */
+ ChosenPivot = NULL;
+ MinMarkowitzProduct = LARGEST_LONG_INTEGER;
+ pMarkowitzProduct = &(Matrix->MarkowitzProd[Matrix->Size + 2]);
+ Matrix->MarkowitzProd[Matrix->Size + 1] = Matrix->MarkowitzProd[Step];
+
+ /* Assure that following while loop will always terminate. */
+ Matrix->MarkowitzProd[Step - 1] = -1;
+
+ /*
+ * This is tricky. Am using a pointer in the inner while loop to
+ * sequentially step through the MarkowitzProduct array. Search
+ * terminates when the Markowitz product of zero placed at location
+ * Step-1 is found. The row (and column) index on the diagonal is then
+ * calculated by subtracting the pointer to the Markowitz product of
+ * the first diagonal from the pointer to the Markowitz product of the
+ * desired element. The outer for loop is infinite, broken by using
+ * break.
+ *
+ * Search proceeds from the end (high row and column numbers) to the
+ * beginning (low row and column numbers) so that rows and columns with
+ * large Markowitz products will tend to be move to the bottom of the
+ * matrix. However, choosing Diag[Step] is desirable because it would
+ * require no row and column interchanges, so inspect it first by
+ * putting its Markowitz product at the end of the MarkowitzProd
+ * vector.
+ */
+
+ for (;;) /* Endless for loop. */
+ {
+ while (*(--pMarkowitzProduct) >= MinMarkowitzProduct)
+ {
+ /* Just passing through. */
+ }
+
+ I = (int)(pMarkowitzProduct - Matrix->MarkowitzProd);
+
+ /* Assure that I is valid; if I < Step, terminate search. */
+ if (I < Step)
+ {
+ break; /* Endless for loop */
+ }
+ if (I > Matrix->Size)
+ {
+ I = Step;
+ }
+
+ if ((pDiag = Matrix->Diag[I]) == NULL)
+ {
+ continue; /* Endless for loop */
+ }
+ if ((Magnitude = ELEMENT_MAG(pDiag)) <= Matrix->AbsThreshold)
+ {
+ continue; /* Endless for loop */
+ }
+
+ if (*pMarkowitzProduct == 1)
+ {
+ /* Case where only one element exists in row and column other than diagonal. */
+
+ /* Find off-diagonal elements. */
+ pOtherInRow = pDiag->NextInRow;
+ pOtherInCol = pDiag->NextInCol;
+ if (pOtherInRow == NULL AND pOtherInCol == NULL)
+ {
+ pOtherInRow = Matrix->FirstInRow[I];
+ while (pOtherInRow != NULL)
+ {
+ if (pOtherInRow->Col >= Step AND pOtherInRow->Col != I)
+ {
+ break;
+ }
+ pOtherInRow = pOtherInRow->NextInRow;
+ }
+ pOtherInCol = Matrix->FirstInCol[I];
+ while (pOtherInCol != NULL)
+ {
+ if (pOtherInCol->Row >= Step AND pOtherInCol->Row != I)
+ {
+ break;
+ }
+ pOtherInCol = pOtherInCol->NextInCol;
+ }
+ }
+
+ /* Accept diagonal as pivot if diagonal is larger than off-diagonals and the
+ * off-diagonals are placed symmetricly. */
+ if (pOtherInRow != NULL AND pOtherInCol != NULL)
+ {
+ if (pOtherInRow->Col == pOtherInCol->Row)
+ {
+ LargestOffDiagonal = Max(ELEMENT_MAG(pOtherInRow),
+ ELEMENT_MAG(pOtherInCol));
+ if (Magnitude >= LargestOffDiagonal)
+ {
+ /* Accept pivot, it is unlikely to contribute excess error. */
+ return pDiag;
+ }
+ }
+ }
+ }
+
+ MinMarkowitzProduct = *pMarkowitzProduct;
+ ChosenPivot = pDiag;
+ } /* End of endless for loop. */
+
+ if (ChosenPivot != NULL)
+ {
+ LargestInCol = FindBiggestInColExclude( Matrix, ChosenPivot, Step );
+ if ( ELEMENT_MAG(ChosenPivot) <= Matrix->RelThreshold * LargestInCol )
+ {
+ ChosenPivot = NULL;
+ }
+ }
+ return ChosenPivot;
+}
+#endif /* Not MODIFIED_MARKOWITZ */
+
+
+
+
+
+
+
+
+
+/*
+ * SEARCH DIAGONAL FOR PIVOT WITH MODIFIED MARKOWITZ CRITERION
+ *
+ * Searches the diagonal looking for the best pivot. For a pivot to be
+ * acceptable it must be larger than the pivot RelThreshold times the largest
+ * element in its reduced column. Among the acceptable diagonals, the
+ * one with the smallest MarkowitzProduct is sought. If a tie occurs
+ * between elements of equal MarkowitzProduct, then the element with
+ * the largest ratio between its magnitude and the largest element in its
+ * column is used. The search will be terminated after a given number of
+ * ties have occurred and the best (smallest ratio) of the tied element will
+ * be used as the pivot. The number of ties that will trigger an early
+ * termination is MinMarkowitzProduct * TIES_MULTIPLIER.
+ *
+ * >>> Returned:
+ * A pointer to the diagonal element chosen to be pivot. If no diagonal is
+ * acceptable, a NULL is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to the element that has been chosen to be the pivot.
+ * Size (int)
+ * Local version of size which is placed in a register to increase speed.
+ * Magnitude (RealNumber)
+ * Absolute value of diagonal element.
+ * MinMarkowitzProduct (long)
+ * Smallest Markowitz product found of those pivot candidates which are
+ * acceptable.
+ * NumberOfTies (int)
+ * A count of the number of Markowitz ties that have occurred at current
+ * MarkowitzProduct.
+ * pDiag (ElementPtr)
+ * Pointer to current diagonal element.
+ * pMarkowitzProduct (long*)
+ * Pointer that points into MarkowitzProduct array. It is used to quickly
+ * access successive Markowitz products.
+ * Ratio (RealNumber)
+ * For the current pivot candidate, Ratio is the
+ * Ratio of the largest element in its column to its magnitude.
+ * RatioOfAccepted (RealNumber)
+ * For the best pivot candidate found so far, RatioOfAccepted is the
+ * Ratio of the largest element in its column to its magnitude.
+ */
+
+static ElementPtr
+SearchDiagonal( MatrixPtr Matrix, register int Step )
+{
+ register int J = 0;
+ register long MinMarkowitzProduct = 0, *pMarkowitzProduct = NULL;
+ register int I = 0;
+ register ElementPtr pDiag = NULL;
+ int NumberOfTies = 0, Size = Matrix->Size;
+ ElementPtr ChosenPivot = NULL;
+ RealNumber Magnitude = 0., Ratio = 0., RatioOfAccepted = 0., LargestInCol = 0.;
+ RealNumber FindBiggestInColExclude();
+
+ /* Begin `SearchDiagonal'. */
+ ChosenPivot = NULL;
+ MinMarkowitzProduct = LARGEST_LONG_INTEGER;
+ pMarkowitzProduct = &(Matrix->MarkowitzProd[Size + 2]);
+ Matrix->MarkowitzProd[Size + 1] = Matrix->MarkowitzProd[Step];
+
+ /* Start search of diagonal. */
+ for (J = Size + 1; J > Step; J--)
+ {
+ if (*(--pMarkowitzProduct) > MinMarkowitzProduct)
+ {
+ continue; /* for loop */
+ }
+ if (J > Matrix->Size)
+ {
+ I = Step;
+ }
+ else
+ {
+ I = J;
+ }
+ if ((pDiag = Matrix->Diag[I]) == NULL)
+ {
+ continue; /* for loop */
+ }
+ if ((Magnitude = ELEMENT_MAG(pDiag)) <= Matrix->AbsThreshold)
+ {
+ continue; /* for loop */
+ }
+
+ /* Test to see if diagonal's magnitude is acceptable. */
+ LargestInCol = FindBiggestInColExclude( Matrix, pDiag, Step );
+ if (Magnitude <= Matrix->RelThreshold * LargestInCol)
+ {
+ continue; /* for loop */
+ }
+
+ if (*pMarkowitzProduct < MinMarkowitzProduct)
+ {
+ /* Notice strict inequality in test. This is a new smallest MarkowitzProduct. */
+ ChosenPivot = pDiag;
+ MinMarkowitzProduct = *pMarkowitzProduct;
+ RatioOfAccepted = LargestInCol / Magnitude;
+ NumberOfTies = 0;
+ }
+ else
+ {
+ /* This case handles Markowitz ties. */
+ NumberOfTies++;
+ Ratio = LargestInCol / Magnitude;
+ if (Ratio < RatioOfAccepted)
+ {
+ ChosenPivot = pDiag;
+ RatioOfAccepted = Ratio;
+ }
+ if (NumberOfTies >= MinMarkowitzProduct * TIES_MULTIPLIER)
+ {
+ return ChosenPivot;
+ }
+ }
+ } /* End of for(Step) */
+ return ChosenPivot;
+}
+#endif /* DIAGONAL_PIVOTING */
+
+
+
+
+
+
+
+
+
+
+/*
+ * SEARCH ENTIRE MATRIX FOR BEST PIVOT
+ *
+ * Performs a search over the entire matrix looking for the acceptable
+ * element with the lowest MarkowitzProduct. If there are several that
+ * are tied for the smallest MarkowitzProduct, the tie is broken by using
+ * the ratio of the magnitude of the element being considered to the largest
+ * element in the same column. If no element is acceptable then the largest
+ * element in the reduced submatrix is used as the pivot and the
+ * matrix is declared to be spSMALL_PIVOT. If the largest element is
+ * zero, the matrix is declared to be spSINGULAR.
+ *
+ * >>> Returned:
+ * A pointer to the diagonal element chosen to be pivot. If no element is
+ * found, then NULL is returned and the matrix is spSINGULAR.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * ChosenPivot (ElementPtr)
+ * Pointer to the element that has been chosen to be the pivot.
+ * LargestElementMag (RealNumber)
+ * Magnitude of the largest element yet found in the reduced submatrix.
+ * Size (int)
+ * Local version of Size; placed in a register for speed.
+ * Magnitude (RealNumber)
+ * Absolute value of diagonal element.
+ * MinMarkowitzProduct (long)
+ * Smallest Markowitz product found of pivot candidates which are
+ * acceptable.
+ * NumberOfTies (int)
+ * A count of the number of Markowitz ties that have occurred at current
+ * MarkowitzProduct.
+ * pElement (ElementPtr)
+ * Pointer to current element.
+ * pLargestElement (ElementPtr)
+ * Pointer to the largest element yet found in the reduced submatrix.
+ * Product (long)
+ * Markowitz product for the current row and column.
+ * Ratio (RealNumber)
+ * For the current pivot candidate, Ratio is the
+ * Ratio of the largest element in its column to its magnitude.
+ * RatioOfAccepted (RealNumber)
+ * For the best pivot candidate found so far, RatioOfAccepted is the
+ * Ratio of the largest element in its column to its magnitude.
+ *
+ * >>> Possible errors:
+ * spSINGULAR
+ * spSMALL_PIVOT
+ */
+
+static ElementPtr
+SearchEntireMatrix( MatrixPtr Matrix, int Step )
+{
+ register int I = 0, Size = Matrix->Size;
+ register ElementPtr pElement = NULL;
+ int NumberOfTies = 0;
+ long Product = 0, MinMarkowitzProduct = 0;
+ ElementPtr ChosenPivot = NULL, pLargestElement = NULL;
+ RealNumber Magnitude = 0., LargestElementMag = 0., Ratio = 0., RatioOfAccepted = 0., LargestInCol = 0.;
+
+
+ /* Begin `SearchEntireMatrix'. */
+ ChosenPivot = NULL;
+ LargestElementMag = 0.0;
+ MinMarkowitzProduct = LARGEST_LONG_INTEGER;
+
+ /* Start search of matrix on column by column basis. */
+ for (I = Step; I <= Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+
+ while (pElement != NULL AND pElement->Row < Step)
+ {
+ pElement = pElement->NextInCol;
+ }
+
+ if ((LargestInCol = FindLargestInCol(pElement)) == 0.0)
+ {
+ continue; /* for loop */
+ }
+
+ while (pElement != NULL)
+ {
+ /* Check to see if element is the largest encountered so far. If so, record
+ its magnitude and address. */
+ if ((Magnitude = ELEMENT_MAG(pElement)) > LargestElementMag)
+ {
+ LargestElementMag = Magnitude;
+ pLargestElement = pElement;
+ }
+ /* Calculate element's MarkowitzProduct. */
+ Product = Matrix->MarkowitzRow[pElement->Row] *
+ Matrix->MarkowitzCol[pElement->Col];
+
+ /* Test to see if element is acceptable as a pivot candidate. */
+ if ((Product <= MinMarkowitzProduct) AND
+ (Magnitude > Matrix->RelThreshold * LargestInCol) AND
+ (Magnitude > Matrix->AbsThreshold))
+ {
+ /* Test to see if element has lowest MarkowitzProduct yet found, or whether it
+ is tied with an element found earlier. */
+ if (Product < MinMarkowitzProduct)
+ {
+ /* Notice strict inequality in test. This is a new smallest MarkowitzProduct. */
+ ChosenPivot = pElement;
+ MinMarkowitzProduct = Product;
+ RatioOfAccepted = LargestInCol / Magnitude;
+ NumberOfTies = 0;
+ }
+ else
+ {
+ /* This case handles Markowitz ties. */
+ NumberOfTies++;
+ Ratio = LargestInCol / Magnitude;
+ if (Ratio < RatioOfAccepted)
+ {
+ ChosenPivot = pElement;
+ RatioOfAccepted = Ratio;
+ }
+ if (NumberOfTies >= MinMarkowitzProduct * TIES_MULTIPLIER)
+ {
+ return ChosenPivot;
+ }
+ }
+ }
+ pElement = pElement->NextInCol;
+ } /* End of while(pElement != NULL) */
+ } /* End of for(Step) */
+
+ if (ChosenPivot != NULL)
+ {
+ return ChosenPivot;
+ }
+
+
+ if (LargestElementMag == 0.0)
+ {
+ Matrix->Error = spSINGULAR;
+ return NULL;
+ }
+
+ Matrix->Error = spSMALL_PIVOT;
+ return pLargestElement;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * DETERMINE THE MAGNITUDE OF THE LARGEST ELEMENT IN A COLUMN
+ *
+ * This routine searches a column and returns the magnitude of the largest
+ * element. This routine begins the search at the element pointed to by
+ * pElement, the parameter.
+ *
+ * The search is conducted by starting at the element specified by a pointer,
+ * which should be one below the diagonal, and moving down the column. On
+ * the way down the column, the magnitudes of the elements are tested to see
+ * if they are the largest yet found.
+ *
+ * >>> Returned:
+ * The magnitude of the largest element in the column below and including
+ * the one pointed to by the input parameter.
+ *
+ * >>> Arguments:
+ * pElement <input> (ElementPtr)
+ * The pointer to the first element to be tested. Also, used by the
+ * routine to access all lower elements in the column.
+ *
+ * >>> Local variables:
+ * Largest (RealNumber)
+ * The magnitude of the largest element.
+ * Magnitude (RealNumber)
+ * The magnitude of the currently active element.
+ */
+
+static RealNumber
+FindLargestInCol( register ElementPtr pElement )
+{
+ RealNumber Magnitude, Largest = 0.0;
+
+ /* Begin `FindLargestInCol'. */
+ /* Search column for largest element beginning at Element. */
+ while (pElement != NULL)
+ {
+ if ((Magnitude = ELEMENT_MAG(pElement)) > Largest)
+ {
+ Largest = Magnitude;
+ }
+ pElement = pElement->NextInCol;
+ }
+
+ return Largest;
+}
+
+
+
+
+
+
+
+
+
+
+/*
+ * DETERMINE THE MAGNITUDE OF THE LARGEST ELEMENT IN A COLUMN
+ * EXCLUDING AN ELEMENT
+ *
+ * This routine searches a column and returns the magnitude of the largest
+ * element. One given element is specifically excluded from the search.
+ *
+ * The search is conducted by starting at the first element in the column
+ * and moving down the column until the active part of the matrix is entered,
+ * i.e. the reduced submatrix. The rest of the column is then traversed
+ * looking for the largest element.
+ *
+ * >>> Returned:
+ * The magnitude of the largest element in the active portion of the column,
+ * excluding the specified element, is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * pElement <input> (ElementPtr)
+ * The pointer to the element that is to be excluded from search. Column
+ * to be searched is one that contains this element. Also used to
+ * access the elements in the column.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated. Indicates where
+ * the active part of the matrix begins.
+ *
+ * >>> Local variables:
+ * Col (int)
+ * The number of the column to be searched. Also the column number of
+ * the element to be avoided in the search.
+ * Largest (RealNumber)
+ * The magnitude of the largest element.
+ * Magnitude (RealNumber)
+ * The magnitude of the currently active element.
+ * Row (int)
+ * The row number of element to be excluded from the search.
+ */
+
+static RealNumber
+FindBiggestInColExclude( MatrixPtr Matrix, register ElementPtr pElement, register int Step )
+{
+ register int Row;
+ int Col;
+ RealNumber Largest, Magnitude;
+
+ /* Begin `FindBiggestInColExclude'. */
+ Row = pElement->Row;
+ Col = pElement->Col;
+ pElement = Matrix->FirstInCol[Col];
+
+ /* Travel down column until reduced submatrix is entered. */
+ while ((pElement != NULL) AND (pElement->Row < Step))
+ {
+ pElement = pElement->NextInCol;
+ }
+
+ /* Initialize the variable Largest. */
+ if (pElement->Row != Row)
+ {
+ Largest = ELEMENT_MAG(pElement);
+ }
+ else
+ {
+ Largest = 0.0;
+ }
+
+ /* Search rest of column for largest element, avoiding excluded element. */
+ while ((pElement = pElement->NextInCol) != NULL)
+ {
+ if ((Magnitude = ELEMENT_MAG(pElement)) > Largest)
+ {
+ if (pElement->Row != Row)
+ {
+ Largest = Magnitude;
+ }
+ }
+ }
+
+ return Largest;
+}
+
+
+
+
+
+
+
+
+
+
+/*
+ * EXCHANGE ROWS
+ *
+ * Performs all required operations to exchange two rows. Those operations
+ * include: swap FirstInRow pointers, fixing up the NextInCol pointers,
+ * swapping row indexes in MatrixElements, and swapping Markowitz row
+ * counts.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Row1 <input> (int)
+ * Row index of one of the rows, becomes the smallest index.
+ * Row2 <input> (int)
+ * Row index of the other row, becomes the largest index.
+ *
+ * Local variables:
+ * Column (int)
+ * Column in which row elements are currently being exchanged.
+ * Row1Ptr (ElementPtr)
+ * Pointer to an element in Row1.
+ * Row2Ptr (ElementPtr)
+ * Pointer to an element in Row2.
+ * Element1 (ElementPtr)
+ * Pointer to the element in Row1 to be exchanged.
+ * Element2 (ElementPtr)
+ * Pointer to the element in Row2 to be exchanged.
+ */
+
+int spcRowExchange( MatrixPtr Matrix, int Row1, int Row2 )
+{
+ register ElementPtr Row1Ptr, Row2Ptr;
+ int Column;
+ ElementPtr Element1, Element2;
+
+ /* Begin `spcRowExchange'. */
+ if (Row1 > Row2)
+ {
+ SWAP(int, Row1, Row2);
+ }
+
+ Row1Ptr = Matrix->FirstInRow[Row1];
+ Row2Ptr = Matrix->FirstInRow[Row2];
+ while (Row1Ptr != NULL OR Row2Ptr != NULL)
+ {
+ /* Exchange elements in rows while traveling from left to right. */
+ if (Row1Ptr == NULL)
+ {
+ Column = Row2Ptr->Col;
+ Element1 = NULL;
+ Element2 = Row2Ptr;
+ Row2Ptr = Row2Ptr->NextInRow;
+ }
+ else if (Row2Ptr == NULL)
+ {
+ Column = Row1Ptr->Col;
+ Element1 = Row1Ptr;
+ Element2 = NULL;
+ Row1Ptr = Row1Ptr->NextInRow;
+ }
+ else if (Row1Ptr->Col < Row2Ptr->Col)
+ {
+ Column = Row1Ptr->Col;
+ Element1 = Row1Ptr;
+ Element2 = NULL;
+ Row1Ptr = Row1Ptr->NextInRow;
+ }
+ else if (Row1Ptr->Col > Row2Ptr->Col)
+ {
+ Column = Row2Ptr->Col;
+ Element1 = NULL;
+ Element2 = Row2Ptr;
+ Row2Ptr = Row2Ptr->NextInRow;
+ }
+ else /* Row1Ptr->Col == Row2Ptr->Col */
+ {
+ Column = Row1Ptr->Col;
+ Element1 = Row1Ptr;
+ Element2 = Row2Ptr;
+ Row1Ptr = Row1Ptr->NextInRow;
+ Row2Ptr = Row2Ptr->NextInRow;
+ }
+
+ ExchangeColElements( Matrix, Row1, Element1, Row2, Element2, Column);
+ } /* end of while(Row1Ptr != NULL OR Row2Ptr != NULL) */
+
+ if (Matrix->InternalVectorsAllocated)
+ {
+ SWAP( int, Matrix->MarkowitzRow[Row1], Matrix->MarkowitzRow[Row2]);
+ }
+ SWAP( ElementPtr, Matrix->FirstInRow[Row1], Matrix->FirstInRow[Row2]);
+ SWAP( int, Matrix->IntToExtRowMap[Row1], Matrix->IntToExtRowMap[Row2]);
+#if TRANSLATE
+ Matrix->ExtToIntRowMap[ Matrix->IntToExtRowMap[Row1] ] = Row1;
+ Matrix->ExtToIntRowMap[ Matrix->IntToExtRowMap[Row2] ] = Row2;
+#endif
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * EXCHANGE COLUMNS
+ *
+ * Performs all required operations to exchange two columns. Those operations
+ * include: swap FirstInCol pointers, fixing up the NextInRow pointers,
+ * swapping column indexes in MatrixElements, and swapping Markowitz
+ * column counts.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Col1 <input> (int)
+ * Column index of one of the columns, becomes the smallest index.
+ * Col2 <input> (int)
+ * Column index of the other column, becomes the largest index
+ *
+ * Local variables:
+ * Row (int)
+ * Row in which column elements are currently being exchanged.
+ * Col1Ptr (ElementPtr)
+ * Pointer to an element in Col1.
+ * Col2Ptr (ElementPtr)
+ * Pointer to an element in Col2.
+ * Element1 (ElementPtr)
+ * Pointer to the element in Col1 to be exchanged.
+ * Element2 (ElementPtr)
+ * Pointer to the element in Col2 to be exchanged.
+ */
+
+int spcColExchange( MatrixPtr Matrix, int Col1, int Col2 )
+{
+ register ElementPtr Col1Ptr, Col2Ptr;
+ int Row;
+ ElementPtr Element1, Element2;
+
+ /* Begin `spcColExchange'. */
+ if (Col1 > Col2)
+ {
+ SWAP(int, Col1, Col2);
+ }
+
+ Col1Ptr = Matrix->FirstInCol[Col1];
+ Col2Ptr = Matrix->FirstInCol[Col2];
+ while (Col1Ptr != NULL OR Col2Ptr != NULL)
+ {
+ /* Exchange elements in rows while traveling from top to bottom. */
+ if (Col1Ptr == NULL)
+ {
+ Row = Col2Ptr->Row;
+ Element1 = NULL;
+ Element2 = Col2Ptr;
+ Col2Ptr = Col2Ptr->NextInCol;
+ }
+ else if (Col2Ptr == NULL)
+ {
+ Row = Col1Ptr->Row;
+ Element1 = Col1Ptr;
+ Element2 = NULL;
+ Col1Ptr = Col1Ptr->NextInCol;
+ }
+ else if (Col1Ptr->Row < Col2Ptr->Row)
+ {
+ Row = Col1Ptr->Row;
+ Element1 = Col1Ptr;
+ Element2 = NULL;
+ Col1Ptr = Col1Ptr->NextInCol;
+ }
+ else if (Col1Ptr->Row > Col2Ptr->Row)
+ {
+ Row = Col2Ptr->Row;
+ Element1 = NULL;
+ Element2 = Col2Ptr;
+ Col2Ptr = Col2Ptr->NextInCol;
+ }
+ else /* Col1Ptr->Row == Col2Ptr->Row */
+ {
+ Row = Col1Ptr->Row;
+ Element1 = Col1Ptr;
+ Element2 = Col2Ptr;
+ Col1Ptr = Col1Ptr->NextInCol;
+ Col2Ptr = Col2Ptr->NextInCol;
+ }
+
+ ExchangeRowElements( Matrix, Col1, Element1, Col2, Element2, Row);
+ } /* end of while(Col1Ptr != NULL OR Col2Ptr != NULL) */
+
+ if (Matrix->InternalVectorsAllocated)
+ {
+ SWAP( int, Matrix->MarkowitzCol[Col1], Matrix->MarkowitzCol[Col2]);
+ }
+ SWAP( ElementPtr, Matrix->FirstInCol[Col1], Matrix->FirstInCol[Col2]);
+ SWAP( int, Matrix->IntToExtColMap[Col1], Matrix->IntToExtColMap[Col2]);
+#if TRANSLATE
+ Matrix->ExtToIntColMap[ Matrix->IntToExtColMap[Col1] ] = Col1;
+ Matrix->ExtToIntColMap[ Matrix->IntToExtColMap[Col2] ] = Col2;
+#endif
+
+ return 0;
+}
+
+
+
+
+
+
+
+/*
+ * EXCHANGE ROWS AND COLUMNS
+ *
+ * Exchanges two rows and two columns so that the selected pivot is moved to
+ * the upper left corner of the remaining submatrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * pPivot <input> (ElementPtr)
+ * Pointer to the current pivot.
+ * Step <input> (int)
+ * Index of the diagonal currently being eliminated.
+ *
+ * >>> Local variables:
+ * Col (int)
+ * Column where the pivot was found.
+ * Row (int)
+ * Row where the pivot was found.
+ * OldMarkowitzProd_Col (long)
+ * Markowitz product associated with the diagonal element in the row
+ * the pivot was found in.
+ * OldMarkowitzProd_Row (long)
+ * Markowitz product associated with the diagonal element in the column
+ * the pivot was found in.
+ * OldMarkowitzProd_Step (long)
+ * Markowitz product associated with the diagonal element that is being
+ * moved so that the pivot can be placed in the upper left-hand corner
+ * of the reduced submatrix.
+ */
+
+static int
+ExchangeRowsAndCols( MatrixPtr Matrix, ElementPtr pPivot, register int Step )
+{
+ register int Row, Col;
+ long OldMarkowitzProd_Step, OldMarkowitzProd_Row, OldMarkowitzProd_Col;
+
+
+ /* Begin `ExchangeRowsAndCols'. */
+ Row = pPivot->Row;
+ Col = pPivot->Col;
+ Matrix->PivotsOriginalRow = Row;
+ Matrix->PivotsOriginalCol = Col;
+
+ if ((Row == Step) AND (Col == Step))
+ {
+ return 0;
+ }
+
+ /* Exchange rows and columns. */
+ if (Row == Col)
+ {
+ spcRowExchange( Matrix, Step, Row );
+ spcColExchange( Matrix, Step, Col );
+ SWAP( long, Matrix->MarkowitzProd[Step], Matrix->MarkowitzProd[Row] );
+ SWAP( ElementPtr, Matrix->Diag[Row], Matrix->Diag[Step] );
+ }
+ else
+ {
+
+ /* Initialize variables that hold old Markowitz products. */
+ OldMarkowitzProd_Step = Matrix->MarkowitzProd[Step];
+ OldMarkowitzProd_Row = Matrix->MarkowitzProd[Row];
+ OldMarkowitzProd_Col = Matrix->MarkowitzProd[Col];
+
+ /* Exchange rows. */
+ if (Row != Step)
+ {
+ spcRowExchange( Matrix, Step, Row );
+ Matrix->NumberOfInterchangesIsOdd =
+ NOT Matrix->NumberOfInterchangesIsOdd;
+ Matrix->MarkowitzProd[Row] = Matrix->MarkowitzRow[Row] *
+ Matrix->MarkowitzCol[Row];
+
+ /* Update singleton count. */
+ if ((Matrix->MarkowitzProd[Row] == 0) != (OldMarkowitzProd_Row == 0))
+ {
+ if (OldMarkowitzProd_Row == 0)
+ {
+ Matrix->Singletons--;
+ }
+ else
+ {
+ Matrix->Singletons++;
+ }
+ }
+ }
+
+ /* Exchange columns. */
+ if (Col != Step)
+ {
+ spcColExchange( Matrix, Step, Col );
+ Matrix->NumberOfInterchangesIsOdd =
+ NOT Matrix->NumberOfInterchangesIsOdd;
+ Matrix->MarkowitzProd[Col] = Matrix->MarkowitzCol[Col] *
+ Matrix->MarkowitzRow[Col];
+
+ /* Update singleton count. */
+ if ((Matrix->MarkowitzProd[Col] == 0) != (OldMarkowitzProd_Col == 0))
+ {
+ if (OldMarkowitzProd_Col == 0)
+ {
+ Matrix->Singletons--;
+ }
+ else
+ {
+ Matrix->Singletons++;
+ }
+ }
+
+ Matrix->Diag[Col] = spcFindElementInCol( Matrix,
+ Matrix->FirstInCol + Col,
+ Col, Col, NO );
+ }
+ if (Row != Step)
+ {
+ Matrix->Diag[Row] = spcFindElementInCol( Matrix,
+ Matrix->FirstInCol + Row,
+ Row, Row, NO );
+ }
+ Matrix->Diag[Step] = spcFindElementInCol( Matrix,
+ Matrix->FirstInCol + Step,
+ Step, Step, NO );
+
+ /* Update singleton count. */
+ Matrix->MarkowitzProd[Step] = Matrix->MarkowitzCol[Step] *
+ Matrix->MarkowitzRow[Step];
+ if ((Matrix->MarkowitzProd[Step] == 0) != (OldMarkowitzProd_Step == 0))
+ {
+ if (OldMarkowitzProd_Step == 0)
+ {
+ Matrix->Singletons--;
+ }
+ else
+ {
+ Matrix->Singletons++;
+ }
+ }
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * EXCHANGE TWO ELEMENTS IN A COLUMN
+ *
+ * Performs all required operations to exchange two elements in a column.
+ * Those operations are: restring NextInCol pointers and swapping row indexes
+ * in the MatrixElements.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Row1 <input> (int)
+ * Row of top element to be exchanged.
+ * Element1 <input> (ElementPtr)
+ * Pointer to top element to be exchanged.
+ * Row2 <input> (int)
+ * Row of bottom element to be exchanged.
+ * Element2 <input> (ElementPtr)
+ * Pointer to bottom element to be exchanged.
+ * Column <input> (int)
+ * Column that exchange is to take place in.
+ *
+ * >>> Local variables:
+ * ElementAboveRow1 (ElementPtr *)
+ * Location of pointer which points to the element above Element1. This
+ * pointer is modified so that it points to correct element on exit.
+ * ElementAboveRow2 (ElementPtr *)
+ * Location of pointer which points to the element above Element2. This
+ * pointer is modified so that it points to correct element on exit.
+ * ElementBelowRow1 (ElementPtr)
+ * Pointer to element below Element1.
+ * ElementBelowRow2 (ElementPtr)
+ * Pointer to element below Element2.
+ * pElement (ElementPtr)
+ * Pointer used to traverse the column.
+ */
+
+static int
+ExchangeColElements( MatrixPtr Matrix, int Row1, register ElementPtr Element1, int Row2, register ElementPtr Element2, int Column )
+{
+ ElementPtr *ElementAboveRow1, *ElementAboveRow2;
+ ElementPtr ElementBelowRow1, ElementBelowRow2;
+ register ElementPtr pElement;
+
+ /* Begin `ExchangeColElements'. */
+ /* Search to find the ElementAboveRow1. */
+ ElementAboveRow1 = &(Matrix->FirstInCol[Column]);
+ pElement = *ElementAboveRow1;
+ while (pElement->Row < Row1)
+ {
+ ElementAboveRow1 = &(pElement->NextInCol);
+ pElement = *ElementAboveRow1;
+ }
+ if (Element1 != NULL)
+ {
+ ElementBelowRow1 = Element1->NextInCol;
+ if (Element2 == NULL)
+ {
+ /* Element2 does not exist, move Element1 down to Row2. */
+ if ( ElementBelowRow1 != NULL AND ElementBelowRow1->Row < Row2 )
+ {
+ /* Element1 must be removed from linked list and moved. */
+ *ElementAboveRow1 = ElementBelowRow1;
+
+ /* Search column for Row2. */
+ pElement = ElementBelowRow1;
+ do
+ {
+ ElementAboveRow2 = &(pElement->NextInCol);
+ pElement = *ElementAboveRow2;
+ }
+ while (pElement != NULL AND pElement->Row < Row2);
+
+ /* Place Element1 in Row2. */
+ *ElementAboveRow2 = Element1;
+ Element1->NextInCol = pElement;
+ *ElementAboveRow1 = ElementBelowRow1;
+ }
+ Element1->Row = Row2;
+ }
+ else
+ {
+ /* Element2 does exist, and the two elements must be exchanged. */
+ if ( ElementBelowRow1->Row == Row2)
+ {
+ /* Element2 is just below Element1, exchange them. */
+ Element1->NextInCol = Element2->NextInCol;
+ Element2->NextInCol = Element1;
+ *ElementAboveRow1 = Element2;
+ }
+ else
+ {
+ /* Element2 is not just below Element1 and must be searched for. */
+ pElement = ElementBelowRow1;
+ do
+ {
+ ElementAboveRow2 = &(pElement->NextInCol);
+ pElement = *ElementAboveRow2;
+ }
+ while (pElement->Row < Row2);
+
+ ElementBelowRow2 = Element2->NextInCol;
+
+ /* Switch Element1 and Element2. */
+ *ElementAboveRow1 = Element2;
+ Element2->NextInCol = ElementBelowRow1;
+ *ElementAboveRow2 = Element1;
+ Element1->NextInCol = ElementBelowRow2;
+ }
+ Element1->Row = Row2;
+ Element2->Row = Row1;
+ }
+ }
+ else
+ {
+ /* Element1 does not exist. */
+ ElementBelowRow1 = pElement;
+
+ /* Find Element2. */
+ if (ElementBelowRow1->Row != Row2)
+ {
+ do
+ {
+ ElementAboveRow2 = &(pElement->NextInCol);
+ pElement = *ElementAboveRow2;
+ }
+ while (pElement->Row < Row2);
+
+ /* Move Element2 to Row1. */
+ *ElementAboveRow2 = Element2->NextInCol;
+ *ElementAboveRow1 = Element2;
+ Element2->NextInCol = ElementBelowRow1;
+ }
+ Element2->Row = Row1;
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+/*
+ * EXCHANGE TWO ELEMENTS IN A ROW
+ *
+ * Performs all required operations to exchange two elements in a row.
+ * Those operations are: restring NextInRow pointers and swapping column
+ * indexes in the MatrixElements.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Col1 <input> (int)
+ * Col of left-most element to be exchanged.
+ * Element1 <input> (ElementPtr)
+ * Pointer to left-most element to be exchanged.
+ * Col2 <input> (int)
+ * Col of right-most element to be exchanged.
+ * Element2 <input> (ElementPtr)
+ * Pointer to right-most element to be exchanged.
+ * Row <input> (int)
+ * Row that exchange is to take place in.
+ *
+ * >>> Local variables:
+ * ElementLeftOfCol1 (ElementPtr *)
+ * Location of pointer which points to the element to the left of
+ * Element1. This pointer is modified so that it points to correct
+ * element on exit.
+ * ElementLeftOfCol2 (ElementPtr *)
+ * Location of pointer which points to the element to the left of
+ * Element2. This pointer is modified so that it points to correct
+ * element on exit.
+ * ElementRightOfCol1 (ElementPtr)
+ * Pointer to element right of Element1.
+ * ElementRightOfCol2 (ElementPtr)
+ * Pointer to element right of Element2.
+ * pElement (ElementPtr)
+ * Pointer used to traverse the row.
+ */
+
+static int
+ExchangeRowElements( MatrixPtr Matrix, int Col1, register ElementPtr Element1, int Col2, register ElementPtr Element2, int Row )
+{
+ ElementPtr *ElementLeftOfCol1, *ElementLeftOfCol2;
+ ElementPtr ElementRightOfCol1, ElementRightOfCol2;
+ register ElementPtr pElement;
+
+ /* Begin `ExchangeRowElements'. */
+ /* Search to find the ElementLeftOfCol1. */
+ ElementLeftOfCol1 = &(Matrix->FirstInRow[Row]);
+ pElement = *ElementLeftOfCol1;
+ while (pElement->Col < Col1)
+ {
+ ElementLeftOfCol1 = &(pElement->NextInRow);
+ pElement = *ElementLeftOfCol1;
+ }
+ if (Element1 != NULL)
+ {
+ ElementRightOfCol1 = Element1->NextInRow;
+ if (Element2 == NULL)
+ {
+ /* Element2 does not exist, move Element1 to right to Col2. */
+ if ( ElementRightOfCol1 != NULL AND ElementRightOfCol1->Col < Col2 )
+ {
+ /* Element1 must be removed from linked list and moved. */
+ *ElementLeftOfCol1 = ElementRightOfCol1;
+
+ /* Search Row for Col2. */
+ pElement = ElementRightOfCol1;
+ do
+ {
+ ElementLeftOfCol2 = &(pElement->NextInRow);
+ pElement = *ElementLeftOfCol2;
+ }
+ while (pElement != NULL AND pElement->Col < Col2);
+
+ /* Place Element1 in Col2. */
+ *ElementLeftOfCol2 = Element1;
+ Element1->NextInRow = pElement;
+ *ElementLeftOfCol1 = ElementRightOfCol1;
+ }
+ Element1->Col = Col2;
+ }
+ else
+ {
+ /* Element2 does exist, and the two elements must be exchanged. */
+ if ( ElementRightOfCol1->Col == Col2)
+ {
+ /* Element2 is just right of Element1, exchange them. */
+ Element1->NextInRow = Element2->NextInRow;
+ Element2->NextInRow = Element1;
+ *ElementLeftOfCol1 = Element2;
+ }
+ else
+ {
+ /* Element2 is not just right of Element1 and must be searched for. */
+ pElement = ElementRightOfCol1;
+ do
+ {
+ ElementLeftOfCol2 = &(pElement->NextInRow);
+ pElement = *ElementLeftOfCol2;
+ }
+ while (pElement->Col < Col2);
+
+ ElementRightOfCol2 = Element2->NextInRow;
+
+ /* Switch Element1 and Element2. */
+ *ElementLeftOfCol1 = Element2;
+ Element2->NextInRow = ElementRightOfCol1;
+ *ElementLeftOfCol2 = Element1;
+ Element1->NextInRow = ElementRightOfCol2;
+ }
+ Element1->Col = Col2;
+ Element2->Col = Col1;
+ }
+ }
+ else
+ {
+ /* Element1 does not exist. */
+ ElementRightOfCol1 = pElement;
+
+ /* Find Element2. */
+ if (ElementRightOfCol1->Col != Col2)
+ {
+ do
+ {
+ ElementLeftOfCol2 = &(pElement->NextInRow);
+ pElement = *ElementLeftOfCol2;
+ }
+ while (pElement->Col < Col2);
+
+ /* Move Element2 to Col1. */
+ *ElementLeftOfCol2 = Element2->NextInRow;
+ *ElementLeftOfCol1 = Element2;
+ Element2->NextInRow = ElementRightOfCol1;
+ }
+ Element2->Col = Col1;
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * PERFORM ROW AND COLUMN ELIMINATION ON REAL MATRIX
+ *
+ * Eliminates a single row and column of the matrix and leaves single row of
+ * the upper triangular matrix and a single column of the lower triangular
+ * matrix in its wake. Uses Gauss's method.
+ *
+ * >>> Argument:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * pPivot <input> (ElementPtr)
+ * Pointer to the current pivot.
+ *
+ * >>> Local variables:
+ * pLower (ElementPtr)
+ * Points to matrix element in lower triangular column.
+ * pSub (ElementPtr)
+ * Points to elements in the reduced submatrix.
+ * Row (int)
+ * Row index.
+ * pUpper (ElementPtr)
+ * Points to matrix element in upper triangular row.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+RealRowColElimination( MatrixPtr Matrix, register ElementPtr pPivot )
+{
+#if REAL
+ register ElementPtr pSub;
+ register int Row;
+ register ElementPtr pLower, pUpper;
+
+
+ /* Begin `RealRowColElimination'. */
+
+ /* Test for zero pivot. */
+ if (Abs(pPivot->Real) == 0.0)
+ {
+ (void)MatrixIsSingular( Matrix, pPivot->Row );
+ return 0;
+ }
+ /*jpc pPivot->Real = 1.0 / pPivot->Real; */
+
+ pUpper = pPivot->NextInRow;
+ while (pUpper != NULL)
+ {
+ /* Calculate upper triangular element. */
+ /*jpc pUpper->Real *= pPivot->Real; */
+ pUpper->Real /= pPivot->Real;
+
+ pSub = pUpper->NextInCol;
+ pLower = pPivot->NextInCol;
+ while (pLower != NULL)
+ {
+ Row = pLower->Row;
+
+ /* Find element in row that lines up with current lower triangular element. */
+ while (pSub != NULL AND pSub->Row < Row)
+ {
+ pSub = pSub->NextInCol;
+ }
+
+ /* Test to see if desired element was not found, if not, create fill-in. */
+ if (pSub == NULL OR pSub->Row > Row)
+ {
+ pSub = CreateFillin( Matrix, Row, pUpper->Col );
+ if (pSub == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ }
+ pSub->Real -= pUpper->Real * pLower->Real;
+ pSub = pSub->NextInCol;
+ pLower = pLower->NextInCol;
+ }
+ pUpper = pUpper->NextInRow;
+ }
+ return 0;
+#endif /* REAL */
+}
+
+
+
+
+
+
+
+
+
+/*
+ * PERFORM ROW AND COLUMN ELIMINATION ON COMPLEX MATRIX
+ *
+ * Eliminates a single row and column of the matrix and leaves single row of
+ * the upper triangular matrix and a single column of the lower triangular
+ * matrix in its wake. Uses Gauss's method.
+ *
+ * >>> Argument:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * pPivot <input> (ElementPtr)
+ * Pointer to the current pivot.
+ *
+ * >>> Local variables:
+ * pLower (ElementPtr)
+ * Points to matrix element in lower triangular column.
+ * pSub (ElementPtr)
+ * Points to elements in the reduced submatrix.
+ * Row (int)
+ * Row index.
+ * pUpper (ElementPtr)
+ * Points to matrix element in upper triangular row.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ */
+
+static int
+ComplexRowColElimination( MatrixPtr Matrix, register ElementPtr pPivot )
+{
+#if spCOMPLEX
+ register ElementPtr pSub;
+ register int Row;
+ register ElementPtr pLower, pUpper;
+
+ /* Begin `ComplexRowColElimination'. */
+
+ /* Test for zero pivot. */
+ if (ELEMENT_MAG(pPivot) == 0.0)
+ {
+ (void)MatrixIsSingular( Matrix, pPivot->Row );
+ return 0;
+ }
+ CMPLX_RECIPROCAL(*pPivot, *pPivot);
+
+ pUpper = pPivot->NextInRow;
+ while (pUpper != NULL)
+ {
+ /* Calculate upper triangular element. */
+ /* Cmplx expr: *pUpper = *pUpper * (1.0 / *pPivot). */
+ CMPLX_MULT_ASSIGN(*pUpper, *pPivot);
+
+ pSub = pUpper->NextInCol;
+ pLower = pPivot->NextInCol;
+ while (pLower != NULL)
+ {
+ Row = pLower->Row;
+
+ /* Find element in row that lines up with current lower triangular element. */
+ while (pSub != NULL AND pSub->Row < Row)
+ {
+ pSub = pSub->NextInCol;
+ }
+
+ /* Test to see if desired element was not found, if not, create fill-in. */
+ if (pSub == NULL OR pSub->Row > Row)
+ {
+ pSub = CreateFillin( Matrix, Row, pUpper->Col );
+ if (pSub == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return 0;
+ }
+ }
+
+ /* Cmplx expr: pElement -= *pUpper * pLower. */
+ CMPLX_MULT_SUBT_ASSIGN(*pSub, *pUpper, *pLower);
+ pSub = pSub->NextInCol;
+ pLower = pLower->NextInCol;
+ }
+ pUpper = pUpper->NextInRow;
+ }
+ return 0;
+#endif /* spCOMPLEX */
+}
+
+
+
+
+
+/*
+ * UPDATE MARKOWITZ NUMBERS
+ *
+ * Updates the Markowitz numbers after a row and column have been eliminated.
+ * Also updates singleton count.
+ *
+ * >>> Argument:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * pPivot <input> (ElementPtr)
+ * Pointer to the current pivot.
+ *
+ * >>> Local variables:
+ * Row (int)
+ * Row index.
+ * Col (int)
+ * Column index.
+ * ColPtr (ElementPtr)
+ * Points to matrix element in upper triangular column.
+ * RowPtr (ElementPtr)
+ * Points to matrix element in lower triangular row.
+ */
+
+static int
+UpdateMarkowitzNumbers( MatrixPtr Matrix, ElementPtr pPivot )
+{
+ register int Row, Col;
+ register ElementPtr ColPtr, RowPtr;
+ register int *MarkoRow = Matrix->MarkowitzRow, *MarkoCol = Matrix->MarkowitzCol;
+ double Product;
+
+ /* Begin `UpdateMarkowitzNumbers'. */
+
+ /* Update Markowitz numbers. */
+ for (ColPtr = pPivot->NextInCol; ColPtr != NULL; ColPtr = ColPtr->NextInCol)
+ {
+ Row = ColPtr->Row;
+ --MarkoRow[Row];
+
+ /* Form Markowitz product while being cautious of overflows. */
+ if ((MarkoRow[Row] > LARGEST_SHORT_INTEGER AND MarkoCol[Row] != 0) OR
+ (MarkoCol[Row] > LARGEST_SHORT_INTEGER AND MarkoRow[Row] != 0))
+ {
+ Product = MarkoCol[Row] * MarkoRow[Row];
+ if (Product >= LARGEST_LONG_INTEGER)
+ {
+ Matrix->MarkowitzProd[Row] = LARGEST_LONG_INTEGER;
+ }
+ else
+ {
+ Matrix->MarkowitzProd[Row] = (long)Product;
+ }
+ }
+ else
+ {
+ Matrix->MarkowitzProd[Row] = MarkoRow[Row] * MarkoCol[Row];
+ }
+ if (MarkoRow[Row] == 0)
+ {
+ Matrix->Singletons++;
+ }
+ }
+
+ for (RowPtr = pPivot->NextInRow; RowPtr != NULL; RowPtr = RowPtr->NextInRow)
+ {
+ Col = RowPtr->Col;
+ --MarkoCol[Col];
+
+ /* Form Markowitz product while being cautious of overflows. */
+ if ((MarkoRow[Col] > LARGEST_SHORT_INTEGER AND MarkoCol[Col] != 0) OR
+ (MarkoCol[Col] > LARGEST_SHORT_INTEGER AND MarkoRow[Col] != 0))
+ {
+ Product = MarkoCol[Col] * MarkoRow[Col];
+ if (Product >= LARGEST_LONG_INTEGER)
+ {
+ Matrix->MarkowitzProd[Col] = LARGEST_LONG_INTEGER;
+ }
+ else
+ {
+ Matrix->MarkowitzProd[Col] = (long)Product;
+ }
+ }
+ else
+ {
+ Matrix->MarkowitzProd[Col] = MarkoRow[Col] * MarkoCol[Col];
+ }
+ if ((MarkoCol[Col] == 0) AND (MarkoRow[Col] != 0))
+ {
+ Matrix->Singletons++;
+ }
+ }
+ return 0;
+}
+
+
+
+
+
+
+
+
+/*
+ * CREATE FILL-IN
+ *
+ * This routine is used to create fill-ins and splice them into the
+ * matrix.
+ *
+ * >>> Returns:
+ * Pointer to fill-in.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * Col <input> (int)
+ * Column index for element.
+ * Row <input> (int)
+ * Row index for element.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * ppElementAbove (ElementPtr *)
+ * This contains the address of the pointer to the element just above the
+ * one being created. It is used to speed the search and it is updated
+ * with address of the created element.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static ElementPtr
+CreateFillin( MatrixPtr Matrix, register int Row, int Col )
+{
+ register ElementPtr pElement, *ppElementAbove;
+ ElementPtr spcCreateElement();
+
+ /* Begin `CreateFillin'. */
+
+ /* Find Element above fill-in. */
+ ppElementAbove = &Matrix->FirstInCol[Col];
+ pElement = *ppElementAbove;
+ while (pElement != NULL)
+ {
+ if (pElement->Row < Row)
+ {
+ ppElementAbove = &pElement->NextInCol;
+ pElement = *ppElementAbove;
+ }
+ else
+ {
+ break; /* while loop */
+ }
+ }
+
+ /* End of search, create the element. */
+ pElement = spcCreateElement( Matrix, Row, Col, ppElementAbove, YES );
+
+ /* Update Markowitz counts and products. */
+ Matrix->MarkowitzProd[Row] = ++Matrix->MarkowitzRow[Row] *
+ Matrix->MarkowitzCol[Row];
+ if ((Matrix->MarkowitzRow[Row] == 1) AND (Matrix->MarkowitzCol[Row] != 0))
+ {
+ Matrix->Singletons--;
+ }
+ Matrix->MarkowitzProd[Col] = ++Matrix->MarkowitzCol[Col] *
+ Matrix->MarkowitzRow[Col];
+ if ((Matrix->MarkowitzRow[Col] != 0) AND (Matrix->MarkowitzCol[Col] == 1))
+ {
+ Matrix->Singletons--;
+ }
+
+ return pElement;
+}
+
+
+
+
+
+
+
+
+/*
+ * ZERO PIVOT ENCOUNTERED
+ *
+ * This routine is called when a singular matrix is found. It then
+ * records the current row and column and exits.
+ *
+ * >>> Returned:
+ * The error code spSINGULAR or spZERO_DIAG is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to matrix.
+ * Step <input> (int)
+ * Index of diagonal that is zero.
+ */
+
+static int
+MatrixIsSingular( MatrixPtr Matrix, int Step )
+{
+ /* Begin `MatrixIsSingular'. */
+
+ Matrix->SingularRow = Matrix->IntToExtRowMap[ Step ];
+ Matrix->SingularCol = Matrix->IntToExtColMap[ Step ];
+ return (Matrix->Error = spSINGULAR);
+}
+
+
+static int
+ZeroPivot( MatrixPtr Matrix, int Step )
+{
+ /* Begin `ZeroPivot'. */
+
+ Matrix->SingularRow = Matrix->IntToExtRowMap[ Step ];
+ Matrix->SingularCol = Matrix->IntToExtColMap[ Step ];
+ return (Matrix->Error = spZERO_DIAG);
+}
+
+
+
+
+
+
+#if ANNOTATE == FULL
+
+/*
+ *
+ * WRITE STATUS
+ *
+ * Write a summary of important variables to standard output.
+ */
+
+static
+WriteStatus( Matrix, Step )
+
+MatrixPtr Matrix;
+int Step;
+{
+ int I;
+
+ /* Begin `WriteStatus'. */
+
+ printf("Step = %1d ", Step);
+ printf(_("Pivot found at %1d,%1d using "), Matrix->PivotsOriginalRow,
+ Matrix->PivotsOriginalCol);
+ switch (Matrix->PivotSelectionMethod)
+ {
+ case 's':
+ printf("SearchForSingleton\n");
+ break;
+ case 'q':
+ printf("QuicklySearchDiagonal\n");
+ break;
+ case 'd':
+ printf("SearchDiagonal\n");
+ break;
+ case 'e':
+ printf("SearchEntireMatrix\n");
+ break;
+ }
+
+ printf("MarkowitzRow = ");
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ printf("%2d ", Matrix->MarkowitzRow[I]);
+ }
+ printf("\n");
+
+ printf("MarkowitzCol = ");
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ printf("%2d ", Matrix->MarkowitzCol[I]);
+ }
+ printf("\n");
+
+ printf("MarkowitzProduct = ");
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ printf("%2d ", Matrix->MarkowitzProd[I]);
+ }
+ printf("\n");
+
+ printf("Singletons = %2d\n", Matrix->Singletons);
+
+ printf("IntToExtRowMap = ");
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ printf("%2d ", Matrix->IntToExtRowMap[I]);
+ }
+ printf("\n");
+
+ printf("IntToExtColMap = ");
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ printf("%2d ", Matrix->IntToExtColMap[I]);
+ }
+ printf("\n");
+
+ printf("ExtToIntRowMap = ");
+ for (I = 1; I <= Matrix->ExtSize; I++)
+ {
+ printf("%2d ", Matrix->ExtToIntRowMap[I]);
+ }
+ printf("\n");
+
+ printf("ExtToIntColMap = ");
+ for (I = 1; I <= Matrix->ExtSize; I++)
+ {
+ printf("%2d ", Matrix->ExtToIntColMap[I]);
+ }
+ printf("\n\n");
+
+ /* spPrint((char *)Matrix, NO, YES); */
+
+ return;
+
+}
+#endif /* ANNOTATE == FULL */
diff --git a/modules/sparse/src/c/spFortran.c b/modules/sparse/src/c/spFortran.c
new file mode 100755
index 000000000..8b64280f2
--- /dev/null
+++ b/modules/sparse/src/c/spFortran.c
@@ -0,0 +1,1704 @@
+/*
+ * SPARSE FORTRAN MODULE
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This module contains routines that interface Sparse1.3 to a calling
+ * program written in fortran. Almost every externally available Sparse1.3
+ * routine has a counterpart defined in this file, with the name the
+ * same except the `sp' prefix is changed to `sf'. The spADD_ELEMENT
+ * and spADD_QUAD macros are also replaced with the sfAdd1 and sfAdd4
+ * functions defined in this file.
+ *
+ * To ease porting this file to different operating systems, the names of
+ * the functions can be easily redefined (search for `Routine Renaming').
+ * A simple example of a FORTRAN program that calls Sparse is included in
+ * this file (search for Example). When interfacing to a FORTRAN program,
+ * the ARRAY_OFFSET option should be set to NO (see spConfig.h).
+ *
+ * DISCLAIMER:
+ * These interface routines were written by a C programmer who has little
+ * experience with FORTRAN. The routines have had minimal testing.
+ * Any interface between two languages is going to have portability
+ * problems, this one is no exception.
+ *
+ *
+ * >>> User accessible functions contained in this file:
+ * sfCreate()
+ * sfDestroy()
+ * sfStripFills()
+ * sfClear()
+ * sfGetElement()
+ * sfGetAdmittance()
+ * sfGetQuad()
+ * sfGetOnes()
+ * sfAdd1Real()
+ * sfAdd1Imag()
+ * sfAdd1Complex()
+ * sfAdd4Real()
+ * sfAdd4Imag()
+ * sfAdd4Complex()
+ * sfOrderAndFactor()
+ * sfFactor()
+ * sfPartition()
+ * sfSolve()
+ * sfSolveTransposed()
+ * sfPrint()
+ * sfFileMatrix()
+ * sfFileVector()
+ * sfFileStats()
+ * sfMNA_Preorder()
+ * sfScale()
+ * sfMultiply()
+ * sfTransMultiply()
+ * sfDeterminant()
+ * sfError()
+ * sfWhereSingular()
+ * sfGetSize()
+ * sfSetReal()
+ * sfSetComplex()
+ * sfFillinCount()
+ * sfElementCount()
+ * sfDeleteRowAndCol()
+ * sfPseudoCondition()
+ * sfCondition()
+ * sfNorm()
+ * sfLargestElement()
+ * sfRoundoff()
+ */
+
+/*
+ * FORTRAN -- C COMPATIBILITY
+ *
+ * Fortran and C data types correspond in the following way:
+ * -- C -- -- FORTRAN --
+ * int INTEGER*4 or INTEGER*2 (machine dependent, usually int*4)
+ * long INTEGER*4
+ * float REAL
+ * double DOUBLE PRECISION (used by default in preference to float)
+ *
+ * The complex number format used by Sparse is compatible with that
+ * used by FORTRAN. C pointers are passed to FORTRAN as longs, they should
+ * not be used in any way in FORTRAN.
+ */
+
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and supporting
+ * documentation and that the authors and the University of California
+ * are properly credited. The authors and the University of California
+ * make no representations as to the suitability of this software for
+ * any purpose. It is provided `as is', without express or implied warranty.
+ */
+
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ * spFortran.h
+ * Definition of profiles
+ */
+
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spFortran.h"
+
+#ifdef FORTRAN
+
+
+
+
+
+
+/*
+ * Example of a FORTRAN Program Calling Sparse
+ *
+
+ int matrix, error, sfCreate, sfGetElement, spFactor
+ int element(10)
+ double precision rhs(4), solution(4)
+c
+ matrix = sfCreate(4,0,error)
+ element(1) = sfGetElement(matrix,1,1)
+ element(2) = sfGetElement(matrix,1,2)
+ element(3) = sfGetElement(matrix,2,1)
+ element(4) = sfGetElement(matrix,2,2)
+ element(5) = sfGetElement(matrix,2,3)
+ element(6) = sfGetElement(matrix,3,2)
+ element(7) = sfGetElement(matrix,3,3)
+ element(8) = sfGetElement(matrix,3,4)
+ element(9) = sfGetElement(matrix,4,3)
+ element(10) = sfGetElement(matrix,4,4)
+ call sfClear(matrix)
+ call sfAdd1Real(element(1), 2d0)
+ call sfAdd1Real(element(2), -1d0)
+ call sfAdd1Real(element(3), -1d0)
+ call sfAdd1Real(element(4), 3d0)
+ call sfAdd1Real(element(5), -1d0)
+ call sfAdd1Real(element(6), -1d0)
+ call sfAdd1Real(element(7), 3d0)
+ call sfAdd1Real(element(8), -1d0)
+ call sfAdd1Real(element(9), -1d0)
+ call sfAdd1Real(element(10), 3d0)
+ call sfprint(matrix, .false., .false.)
+ rhs(1) = 34d0
+ rhs(2) = 0d0
+ rhs(3) = 0d0
+ rhs(4) = 0d0
+ error = sfFactor(matrix)
+ call sfSolve(matrix, rhs, solution)
+ write (6, 10) rhs(1), rhs(2), rhs(3), rhs(4)
+ 10 format (f 10.2)
+ end
+
+ *
+ */
+
+
+
+
+
+
+long sfCreate(int *Size, int *Complex, int *Error )
+{
+ /* Begin `sfCreate'. */
+ return (long)spCreate(*Size, *Complex, Error );
+}
+
+
+void sfDestroy( long *Matrix )
+{
+ /* Begin `sfDestroy'. */
+ spDestroy((char *)*Matrix);
+ return;
+}
+
+
+
+
+
+
+#ifdef STRIP
+void sfStripFills( long *Matrix )
+{
+ /* Begin `sfStripFills'. */
+ spStripFills((char *)*Matrix);
+ return;
+}
+#endif
+
+
+
+
+
+
+
+/*
+ * CLEAR MATRIX
+ *
+ * Sets every element of the matrix to zero and clears the error flag.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix that is to be cleared.
+ */
+
+void sfClear( long *Matrix )
+{
+ /* Begin `sfClear'. */
+ spClear((char *)*Matrix);
+ return;
+}
+
+
+
+
+
+
+/*
+ * SINGLE ELEMENT ADDITION TO MATRIX BY INDEX
+ *
+ * Finds element [Row,Col] and returns a pointer to it. If element is
+ * not found then it is created and spliced into matrix. This routine
+ * is only to be used after spCreate() and before spMNA_Preorder(),
+ * spFactor() or spOrderAndFactor(). Returns a pointer to the
+ * Real portion of a MatrixElement. This pointer is later used by
+ * sfAddxxxxx() to directly access element.
+ *
+ * >>> Returns: [INTEGER]
+ * Returns a pointer to the element. This pointer is then used to directly
+ * access the element during successive builds.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix that the element is to be added to.
+ * Row <input> (int *) [INTEGER or INTEGER*2]
+ * Row index for element. Must be in the range of [0..Size] unless
+ * the options EXPANDABLE or TRANSLATE are used. Elements placed in
+ * row zero are discarded. In no case may Row be less than zero.
+ * Col <input> (int *) [INTEGER or INTEGER*2]
+ * Column index for element. Must be in the range of [0..Size] unless
+ * the options EXPANDABLE or TRANSLATE are used. Elements placed in
+ * column zero are discarded. In no case may Col be less than zero.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+long
+sfGetElement( long *Matrix, int *Row, int *Col )
+{
+ /* Begin `sfGetElement'. */
+ return (long)spGetElement((char *) * Matrix, *Row, *Col);
+}
+
+
+
+
+
+
+
+#ifdef QUAD_ELEMENT
+/*
+ * ADDITION OF ADMITTANCE TO MATRIX BY INDEX
+ *
+ * Performs same function as sfGetElement except rather than one
+ * element, all four Matrix elements for a floating component are
+ * added. This routine also works if component is grounded. Positive
+ * elements are placed at [Node1,Node2] and [Node2,Node1]. This
+ * routine is only to be used after sfCreate() and before
+ * sfMNA_Preorder(), sfFactor() or sfOrderAndFactor().
+ *
+ * >>> Returns: [INTEGER or INTEGER*2]
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix that component is to be entered in.
+ * Node1 <input> (int *) [INTEGER or INTEGER*2]
+ * Row and column indices for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Node zero is the
+ * ground node. In no case may Node1 be less than zero.
+ * Node2 <input> (int *) [INTEGER or INTEGER*2]
+ * Row and column indices for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Node zero is the
+ * ground node. In no case may Node2 be less than zero.
+ * Template <output> (long[4]) [INTEGER (4)]
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int
+sfGetAdmittance( long *Matrix, int *Node1, int *Node2, long Template[4] )
+{
+ /* Begin `spGetAdmittance'. */
+ return
+ ( spGetAdmittance((char *) * Matrix, *Node1, *Node2,
+ (struct spTemplate *)Template )
+ );
+}
+#endif /* QUAD_ELEMENT */
+
+
+
+
+
+
+
+
+
+#ifdef QUAD_ELEMENT
+/*
+ * ADDITION OF FOUR ELEMENTS TO MATRIX BY INDEX
+ *
+ * Similar to sfGetAdmittance, except that sfGetAdmittance only
+ * handles 2-terminal components, whereas sfGetQuad handles simple
+ * 4-terminals as well. These 4-terminals are simply generalized
+ * 2-terminals with the option of having the sense terminals different
+ * from the source and sink terminals. sfGetQuad adds four
+ * elements to the matrix. Positive elements occur at Row1,Col1
+ * Row2,Col2 while negative elements occur at Row1,Col2 and Row2,Col1.
+ * The routine works fine if any of the rows and columns are zero.
+ * This routine is only to be used after sfCreate() and before
+ * sfMNA_Preorder(), sfFactor() or sfOrderAndFactor()
+ * unless TRANSLATE is set true.
+ *
+ * >>> Returns: [INTEGER or INTEGER*2]
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix that component is to be entered in.
+ * Row1 <input> (int *) [INTEGER or INTEGER*2]
+ * First row index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Row1 be less than zero.
+ * Row2 <input> (int *) [INTEGER or INTEGER*2]
+ * Second row index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Row2 be less than zero.
+ * Col1 <input> (int *) [INTEGER or INTEGER*2]
+ * First column index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground column. In no case may Col1 be less than zero.
+ * Col2 <input> (int *) [INTEGER or INTEGER*2]
+ * Second column index for elements. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground column. In no case may Col2 be less than zero.
+ * Template <output> (long[4]) [INTEGER (4)]
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int
+sfGetQuad( long *Matrix, int *Row1, int *Row2, int *Col1, int *Col2, long Template[4] )
+{
+ /* Begin `spGetQuad'. */
+ return
+ ( spGetQuad( (char *) * Matrix, *Row1, *Row2, *Col1, *Col2,
+ (struct spTemplate *)Template )
+ );
+}
+#endif /* QUAD_ELEMENT */
+
+
+
+
+
+
+
+
+
+#ifdef QUAD_ELEMENT
+/*
+ * ADDITION OF FOUR STRUCTURAL ONES TO MATRIX BY INDEX
+ *
+ * Performs similar function to sfGetQuad() except this routine is
+ * meant for components that do not have an admittance representation.
+ *
+ * The following stamp is used:
+ * Pos Neg Eqn
+ * Pos [ . . 1 ]
+ * Neg [ . . -1 ]
+ * Eqn [ 1 -1 . ]
+ *
+ * >>> Returns: [INTEGER or INTEGER*2]
+ * Error code.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix that component is to be entered in.
+ * Pos <input> (int *) [INTEGER or INTEGER*2]
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Pos be less than zero.
+ * Neg <input> (int *) [INTEGER or INTEGER*2]
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Neg be less than zero.
+ * Eqn <input> (int *) [INTEGER or INTEGER*2]
+ * See stamp above. Must be in the range of [0..Size]
+ * unless the options EXPANDABLE or TRANSLATE are used. Zero is the
+ * ground row. In no case may Eqn be less than zero.
+ * Template <output> (long[4]) [INTEGER (4)]
+ * Collection of pointers to four elements that are later used to directly
+ * address elements. User must supply the template, this routine will
+ * fill it.
+ *
+ * Possible errors:
+ * spNO_MEMORY
+ * Error is not cleared in this routine.
+ */
+
+int
+sfGetOnes(long *Matrix, int *Pos, int *Neg, int *Eqn, long Template[4])
+{
+ /* Begin `sfGetOnes'. */
+ return
+ ( spGetOnes( (char *) * Matrix, *Pos, *Neg, *Eqn,
+ (struct spTemplate *)Template )
+ );
+}
+#endif /* QUAD_ELEMENT */
+
+
+
+
+
+
+
+/*
+ * ADD ELEMENT(S) DIRECTLY TO MATRIX
+ *
+ * Adds a value to an element or a set of four element in a matrix.
+ * These elements are referenced by pointer, and so must already have
+ * been created by spGetElement(), spGetAdmittance(), spGetQuad(), or
+ * spGetOnes().
+ *
+ * >>> Arguments:
+ * Element <input> (long *) [INTEGER]
+ * Pointer to the element that is to be added to.
+ * Template <input> (long[4]) [INTEGER (4)]
+ * Pointer to the element that is to be added to.
+ * Real <input> (spREAL *) [REAL or DOUBLE PRECISION]
+ * Real portion of the number to be added to the element.
+ * Imag <input> (spREAL *) [REAL or DOUBLE PRECISION]
+ * Imaginary portion of the number to be added to the element.
+ */
+
+void
+sfAdd1Real( long *Element, RealNumber *Real )
+{
+ /* Begin `sfAdd1Real'. */
+ *((RealNumber *)*Element) += *Real;
+}
+
+
+#ifdef spCOMPLEX
+
+void
+sfAdd1Imag( long *Element, RealNumber *Imag )
+{
+ /* Begin `sfAdd1Imag'. */
+ *(((RealNumber *)*Element) + 1) += *Imag;
+}
+
+
+void
+sfAdd1Complex( long *Element, RealNumber *Real, RealNumber *Imag )
+{
+ /* Begin `sfAdd1Complex'. */
+ *((RealNumber *)*Element) += *Real;
+ *(((RealNumber *)*Element) + 1) += *Imag;
+}
+#endif /* spCOMPLEX */
+
+
+#ifdef QUAD_ELEMENT
+
+void
+sfAdd4Real( long Template[4], RealNumber *Real )
+{
+ /* Begin `sfAdd4Real'. */
+ *((RealNumber *)Template[0]) += *Real;
+ *((RealNumber *)Template[1]) += *Real;
+ *((RealNumber *)Template[2]) -= *Real;
+ *((RealNumber *)Template[3]) -= *Real;
+}
+
+
+#ifdef spCOMPLEX
+
+void
+sfAdd4Imag( long Template[4], RealNumber *Imag )
+{
+ /* Begin `sfAdd4Imag'. */
+ *(((RealNumber *)Template[0]) + 1) += *Imag;
+ *(((RealNumber *)Template[1]) + 1) += *Imag;
+ *(((RealNumber *)Template[2]) + 1) -= *Imag;
+ *(((RealNumber *)Template[3]) + 1) -= *Imag;
+}
+
+
+void
+sfAdd4Complex( long Template[4], RealNumber *Real, RealNumber *Imag )
+{
+ /* Begin `sfAdd4Complex'. */
+ *((RealNumber *)Template[0]) += *Real;
+ *((RealNumber *)Template[1]) += *Real;
+ *((RealNumber *)Template[2]) -= *Real;
+ *((RealNumber *)Template[3]) -= *Real;
+ *(((RealNumber *)Template[0]) + 1) += *Imag;
+ *(((RealNumber *)Template[1]) + 1) += *Imag;
+ *(((RealNumber *)Template[2]) + 1) -= *Imag;
+ *(((RealNumber *)Template[3]) + 1) -= *Imag;
+}
+#endif /* spCOMPLEX */
+#endif /* QUAD_ELEMENT */
+
+
+
+
+
+
+/*
+ * ORDER AND FACTOR MATRIX
+ *
+ * This routine chooses a pivot order for the matrix and factors it
+ * into LU form. It handles both the initial factorization and subsequent
+ * factorizations when a reordering is desired. This is handled in a manner
+ * that is transparent to the user. The routine uses a variation of
+ * Gauss's method where the pivots are associated with L and the
+ * diagonal terms of U are one.
+ *
+ * >>> Returned: [INTEGER of INTEGER*2]
+ * The error code is returned. Possible errors are listed below.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * RHS <input> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * Representative right-hand side vector that is used to determine
+ * pivoting order when the right hand side vector is sparse. If
+ * RHS is a NULL pointer then the RHS vector is assumed to
+ * be full and it is not used when determining the pivoting
+ * order.
+ * RelThreshold <input> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * This number determines what the pivot relative threshold will
+ * be. It should be between zero and one. If it is one then the
+ * pivoting method becomes complete pivoting, which is very slow
+ * and tends to fill up the matrix. If it is set close to zero
+ * the pivoting method becomes strict Markowitz with no
+ * threshold. The pivot threshold is used to eliminate pivot
+ * candidates that would cause excessive element growth if they
+ * were used. Element growth is the cause of roundoff error.
+ * Element growth occurs even in well-conditioned matrices.
+ * Setting the RelThreshold large will reduce element growth and
+ * roundoff error, but setting it too large will cause execution
+ * time to be excessive and will result in a large number of
+ * fill-ins. If this occurs, accuracy can actually be degraded
+ * because of the large number of operations required on the
+ * matrix due to the large number of fill-ins. A good value seems
+ * to be 0.001. The default is chosen by giving a value larger
+ * than one or less than or equal to zero. This value should be
+ * increased and the matrix resolved if growth is found to be
+ * excessive. Changing the pivot threshold does not improve
+ * performance on matrices where growth is low, as is often the
+ * case with ill-conditioned matrices. Once a valid threshold is
+ * given, it becomes the new default. The default value of
+ * RelThreshold was chosen for use with nearly diagonally
+ * dominant matrices such as node- and modified-node admittance
+ * matrices. For these matrices it is usually best to use
+ * diagonal pivoting. For matrices without a strong diagonal, it
+ * is usually best to use a larger threshold, such as 0.01 or
+ * 0.1.
+ * AbsThreshold <input> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * The absolute magnitude an element must have to be considered
+ * as a pivot candidate, except as a last resort. This number
+ * should be set significantly smaller than the smallest diagonal
+ * element that is is expected to be placed in the matrix. If
+ * there is no reasonable prediction for the lower bound on these
+ * elements, then AbsThreshold should be set to zero.
+ * AbsThreshold is used to reduce the possibility of choosing as a
+ * pivot an element that has suffered heavy cancellation and as a
+ * result mainly consists of roundoff error. Once a valid
+ * threshold is given, it becomes the new default.
+ * DiagPivoting <input> (long *) [LOGICAL]
+ * A flag indicating that pivot selection should be confined to the
+ * diagonal if possible. If DiagPivoting is nonzero and if
+ * DIAGONAL_PIVOTING is enabled pivots will be chosen only from
+ * the diagonal unless there are no diagonal elements that satisfy
+ * the threshold criteria. Otherwise, the entire reduced
+ * submatrix is searched when looking for a pivot. The diagonal
+ * pivoting in Sparse is efficient and well refined, while the
+ * off-diagonal pivoting is not. For symmetric and near symmetric
+ * matrices, it is best to use diagonal pivoting because it
+ * results in the best performance when reordering the matrix and
+ * when factoring the matrix without ordering. If there is a
+ * considerable amount of nonsymmetry in the matrix, then
+ * off-diagonal pivoting may result in a better equation ordering
+ * simply because there are more pivot candidates to choose from.
+ * A better ordering results in faster subsequent factorizations.
+ * However, the initial pivot selection process takes considerably
+ * longer for off-diagonal pivoting.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spSINGULAR
+ * spSMALL_PIVOT
+ * Error is cleared in this function.
+ */
+
+int
+sfOrderAndFactor( long *Matrix, RealNumber RHS[], RealNumber *RelThreshold, RealNumber* AbsThreshold, long *DiagPivoting )
+{
+ /* Begin `sfOrderAndFactor'. */
+ return spOrderAndFactor( (char *) * Matrix, RHS, *RelThreshold,
+ *AbsThreshold, (SPBOOLEAN) * DiagPivoting );
+}
+
+
+
+
+
+
+
+/*
+ * FACTOR MATRIX
+ *
+ * This routine is the companion routine to spOrderAndFactor().
+ * Unlike sfOrderAndFactor(), sfFactor() cannot change the ordering.
+ * It is also faster than sfOrderAndFactor(). The standard way of
+ * using these two routines is to first use sfOrderAndFactor() for the
+ * initial factorization. For subsequent factorizations, sfFactor()
+ * is used if there is some assurance that little growth will occur
+ * (say for example, that the matrix is diagonally dominant). If
+ * sfFactor() is called for the initial factorization of the matrix,
+ * then sfOrderAndFactor() is automatically called with the default
+ * threshold. This routine uses "row at a time" LU factorization.
+ * Pivots are associated with the lower triangular matrix and the
+ * diagonals of the upper triangular matrix are ones.
+ *
+ * >>> Returned: [INTEGER or INTEGER*2]
+ * The error code is returned. Possible errors are listed below.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spSINGULAR
+ * spZERO_DIAG
+ * spSMALL_PIVOT
+ * Error is cleared in this function.
+ */
+
+int
+sfFactor( long *Matrix )
+{
+ /* Begin `sfFactor'. */
+ return spFactor((char *) * Matrix);
+}
+
+
+
+
+
+
+/*
+ * PARTITION MATRIX
+ *
+ * This routine determines the cost to factor each row using both
+ * direct and indirect addressing and decides, on a row-by-row basis,
+ * which addressing mode is fastest. This information is used in
+ * sfFactor() to speed the factorization.
+ *
+ * When factoring a previously ordered matrix using sfFactor(), Sparse
+ * operates on a row-at-a-time basis. For speed, on each step, the
+ * row being updated is copied into a full vector and the operations
+ * are performed on that vector. This can be done one of two ways,
+ * either using direct addressing or indirect addressing. Direct
+ * addressing is fastest when the matrix is relatively dense and
+ * indirect addressing is best when the matrix is quite sparse. The
+ * user selects the type of partition used with Mode. If Mode is set
+ * to spDIRECT_PARTITION, then the all rows are placed in the direct
+ * addressing partition. Similarly, if Mode is set to
+ * spINDIRECT_PARTITION, then the all rows are placed in the indirect
+ * addressing partition. By setting Mode to spAUTO_PARTITION, the
+ * user allows Sparse to select the partition for each row
+ * individually. sfFactor() generally runs faster if Sparse is
+ * allowed to choose its own partitioning, however choosing a
+ * partition is expensive. The time required to choose a partition is
+ * of the same order of the cost to factor the matrix. If you plan to
+ * factor a large number of matrices with the same structure, it is
+ * best to let Sparse choose the partition. Otherwise, you should
+ * choose the partition based on the predicted density of the matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * Mode <input> (int *) [INTEGER or INTEGER*2]
+ * Mode must be one of three special codes: spDIRECT_PARTITION,
+ * spINDIRECT_PARTITION, or spAUTO_PARTITION.
+ */
+
+void
+sfPartition( long *Matrix, int *Mode )
+{
+ /* Begin `sfPartition'. */
+ spPartition((char *)*Matrix, *Mode);
+}
+
+
+
+
+
+
+
+/*
+ * SOLVE MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and factored matrix. This
+ * routine assumes that the pivots are associated with the lower
+ * triangular (L) matrix and that the diagonal of the upper triangular
+ * (U) matrix consists of ones. This routine arranges the computation
+ * in different way than is traditionally used in order to exploit the
+ * sparsity of the right-hand side. See the reference in spRevision.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * RHS <input> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * RHS is the input data array, the right hand side. This data is
+ * undisturbed and may be reused for other solves.
+ * Solution <output> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * Solution is the output data array. This routine is constructed such that
+ * RHS and Solution can be the same array.
+ * iRHS <input> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * This argument is only necessary if matrix is complex and if
+ * spSEPARATED_COMPLEX_VECTOR is set true.
+ * iSolution <output> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. This argument is only necessary if matrix is complex
+ * and if spSEPARATED_COMPLEX_VECTOR is set true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+/*VARARGS3*/
+
+void
+sfSolve( long *Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ /* Begin `sfSolve'. */
+ spSolve( (char *)*Matrix, RHS, Solution IMAG_VECTORS );
+}
+
+
+
+
+
+
+#ifdef TRANSPOSE
+/*
+ * SOLVE TRANSPOSED MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and transposed factored
+ * matrix. This routine is useful when performing sensitivity analysis
+ * on a circuit using the adjoint method. This routine assumes that
+ * the pivots are associated with the untransposed lower triangular
+ * (L) matrix and that the diagonal of the untransposed upper
+ * triangular (U) matrix consists of ones.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * RHS <input> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * RHS is the input data array, the right hand side. This data is
+ * undisturbed and may be reused for other solves.
+ * Solution <output> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * Solution is the output data array. This routine is constructed such that
+ * RHS and Solution can be the same array.
+ * iRHS <input> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * If spSEPARATED_COMPLEX_VECTOR is set false, or if matrix is real, there
+ * is no need to supply this array.
+ * iSolution <output> (RealVector) [REAL (1) or DOUBLE PRECISION (1)]
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. If spSEPARATED_COMPLEX_VECTOR is set false, or if
+ * matrix is real, there is no need to supply this array.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+/*VARARGS3*/
+
+void
+sfSolveTransposed( long *Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ /* Begin `sfSolveTransposed'. */
+ spSolveTransposed( (char *)*Matrix, RHS, Solution IMAG_VECTORS );
+}
+#endif /* TRANSPOSE */
+
+
+
+
+
+#ifdef DOCUMENTATION
+/*
+ * PRINT MATRIX
+ *
+ * Formats and send the matrix to standard output. Some elementary
+ * statistics are also output. The matrix is output in a format that is
+ * readable by people.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * PrintReordered <input> (long *) [LOGICAL]
+ * Indicates whether the matrix should be printed out in its original
+ * form, as input by the user, or whether it should be printed in its
+ * reordered form, as used by the matrix routines. Zero indicates that
+ * the matrix should be printed as inputed, one indicates that it
+ * should be printed reordered.
+ * Data <input> (long *) [LOGICAL]
+ * Boolean flag that when false indicates that output should be
+ * compressed such that only the existence of an element should be
+ * indicated rather than giving the actual value. Thus 10 times as many
+ * can be printed on a row. A zero signifies that the matrix should
+ * be printed compressed. A one indicates that the matrix should be
+ * printed in all its glory.
+ * Header <input> (long *) [LOGICAL]
+ * Flag indicating that extra information such as the row and column
+ * numbers should be printed.
+ */
+
+void
+sfPrint( long *Matrix, long *Data, long *PrintReordered, long *Header )
+{
+ /* Begin `sfPrint'. */
+ spPrint( (char *)*Matrix, (int)*PrintReordered, (int)*Data, (int)*Header );
+}
+#endif /* DOCUMENTATION */
+
+
+
+
+
+
+#ifdef DOCUMENTATION
+/*
+ * OUTPUT MATRIX TO FILE
+ *
+ * Writes matrix to file in format suitable to be read back in by the
+ * matrix test program. Data is sent to a file with a fixed name because
+ * it is impossible to pass strings from FORTRAN to C in a manner that is
+ * portable.
+ *
+ * >>> Returns:
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments: [LOGICAL]
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * Reordered <input> (long *) [LOGICAL]
+ * Specifies whether matrix should be output in reordered form,
+ * or in original order.
+ * Data <input> (long *) [LOGICAL]
+ * Indicates that the element values should be output along with
+ * the indices for each element. This parameter must be true if
+ * matrix is to be read by the sparse test program.
+ * Header <input> (long *) [LOGICAL]
+ * Indicates that header is desired. This parameter must be true if
+ * matrix is to be read by the sparse test program.
+ */
+#define MATRIX_FILE_NAME "spMatrix"
+#define STATS_FILE_NAME "spStats"
+
+long
+sfFileMatrix( long *Matrix, long *Reordered, long *Data, long *Header )
+{
+ /* Begin `sfFileMatrix'. */
+ return spFileMatrix( (char *) * Matrix, MATRIX_FILE_NAME, "",
+ (int) * Reordered, (int) * Data, (int) * Header );
+}
+#endif /* DOCUMENTATION */
+
+
+
+#ifdef DOCUMENTATION
+/*
+ * OUTPUT SOURCE VECTOR TO FILE
+ *
+ * Writes vector to file in format suitable to be read back in by the
+ * matrix test program. This routine should be executed after the function
+ * sfFileMatrix.
+ *
+ * >>> Returns:
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *)
+ * Pointer to matrix.
+ * RHS <input> (RealNumber []) [REAL (1) or DOUBLE PRECISION (1)]
+ * Right-hand side vector. This is only the real portion if
+ * spSEPARATED_COMPLEX_VECTORS is true.
+ * iRHS <input> (RealNumber []) [REAL (1) or DOUBLE PRECISION (1)]
+ * Right-hand side vector, imaginary portion. Not necessary if matrix
+ * is real or if spSEPARATED_COMPLEX_VECTORS is set false.
+ */
+
+int
+sfFileVector( long *Matrix, RealVector RHS IMAG_RHS )
+{
+ /* Begin `sfFileVector'. */
+ return spFileVector( (char *) * Matrix, MATRIX_FILE_NAME, RHS IMAG_RHS );
+}
+#endif /* DOCUMENTATION */
+
+
+
+
+
+
+
+#ifdef DOCUMENTATION
+/*
+ * OUTPUT STATISTICS TO FILE
+ *
+ * Writes useful information concerning the matrix to a file. Should be
+ * executed after the matrix is factored.
+ *
+ * >>> Returns: [LOGICAL]
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ */
+
+int
+sfFileStats( long *Matrix )
+{
+ /* Begin `sfFileStats'. */
+ return spFileStats( (char *) * Matrix, STATS_FILE_NAME, "" );
+}
+#endif /* DOCUMENTATION */
+
+
+
+
+#ifdef MODIFIED_NODAL
+/*
+ * PREORDER MODIFIED NODE ADMITTANCE MATRIX TO REMOVE ZEROS FROM DIAGONAL
+ *
+ * This routine massages modified node admittance matrices to remove
+ * zeros from the diagonal. It takes advantage of the fact that the
+ * row and column associated with a zero diagonal usually have
+ * structural ones placed symmetricly. This routine should be used
+ * only on modified node admittance matrices and should be executed
+ * after the matrix has been built but before the factorization
+ * begins. It should be executed for the initial factorization only
+ * and should be executed before the rows have been linked. Thus it
+ * should be run before using spScale(), spMultiply(),
+ * spDeleteRowAndCol(), or spNorm().
+ *
+ * This routine exploits the fact that the structural one are placed
+ * in the matrix in symmetric twins. For example, the stamps for
+ * grounded and a floating voltage sources are
+ * grounded: floating:
+ * [ x x 1 ] [ x x 1 ]
+ * [ x x ] [ x x -1 ]
+ * [ 1 ] [ 1 -1 ]
+ * Notice for the grounded source, there is one set of twins, and for
+ * the grounded, there are two sets. We remove the zero from the diagonal
+ * by swapping the rows associated with a set of twins. For example:
+ * grounded: floating 1: floating 2:
+ * [ 1 ] [ 1 -1 ] [ x x 1 ]
+ * [ x x ] [ x x -1 ] [ 1 -1 ]
+ * [ x x 1 ] [ x x 1 ] [ x x -1 ]
+ *
+ * It is important to deal with any zero diagonals that only have one
+ * set of twins before dealing with those that have more than one because
+ * swapping row destroys the symmetry of any twins in the rows being
+ * swapped, which may limit future moves. Consider
+ * [ x x 1 ]
+ * [ x x -1 1 ]
+ * [ 1 -1 ]
+ * [ 1 ]
+ * There is one set of twins for diagonal 4 and two for diagonal3.
+ * Dealing with diagonal for first requires swapping rows 2 and 4.
+ * [ x x 1 ]
+ * [ 1 ]
+ * [ 1 -1 ]
+ * [ x x -1 1 ]
+ * We can now deal with diagonal 3 by swapping rows 1 and 3.
+ * [ 1 -1 ]
+ * [ 1 ]
+ * [ x x 1 ]
+ * [ x x -1 1 ]
+ * And we are done, there are no zeros left on the diagonal. However, if
+ * we originally dealt with diagonal 3 first, we could swap rows 2 and 3
+ * [ x x 1 ]
+ * [ 1 -1 ]
+ * [ x x -1 1 ]
+ * [ 1 ]
+ * Diagonal 4 no longer has a symmetric twin and we cannot continue.
+ *
+ * So we always take care of lone twins first. When none remain, we
+ * choose arbitrarily a set of twins for a diagonal with more than one set
+ * and swap the rows corresponding to that twin. We then deal with any
+ * lone twins that were created and repeat the procedure until no
+ * zero diagonals with symmetric twins remain.
+ *
+ * In this particular implementation, columns are swapped rather than rows.
+ * The algorithm used in this function was developed by Ken Kundert and
+ * Tom Quarles.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix to be preordered.
+ */
+
+void
+sfMNA_Preorder( long *Matrix )
+{
+ /* Begin `sfMNA_Preorder'. */
+ spMNA_Preorder( (char *)*Matrix );
+}
+#endif /* MODIFIED_NODAL */
+
+
+
+
+
+
+#ifdef SCALING
+/*
+ * SCALE MATRIX
+ *
+ * This function scales the matrix to enhance the possibility of
+ * finding a good pivoting order. Note that scaling enhances accuracy
+ * of the solution only if it affects the pivoting order, so it makes
+ * no sense to scale the matrix before spFactor(). If scaling is
+ * desired it should be done before spOrderAndFactor(). There
+ * are several things to take into account when choosing the scale
+ * factors. First, the scale factors are directly multiplied against
+ * the elements in the matrix. To prevent roundoff, each scale factor
+ * should be equal to an int power of the number base of the
+ * machine. Since most machines operate in base two, scale factors
+ * should be a power of two. Second, the matrix should be scaled such
+ * that the matrix of element uncertainties is equilibrated. Third,
+ * this function multiplies the scale factors by the elements, so if
+ * one row tends to have uncertainties 1000 times smaller than the
+ * other rows, then its scale factor should be 1024, not 1/1024.
+ * Fourth, to save time, this function does not scale rows or columns
+ * if their scale factors are equal to one. Thus, the scale factors
+ * should be normalized to the most common scale factor. Rows and
+ * columns should be normalized separately. For example, if the size
+ * of the matrix is 100 and 10 rows tend to have uncertainties near
+ * 1e-6 and the remaining 90 have uncertainties near 1e-12, then the
+ * scale factor for the 10 should be 1/1,048,576 and the scale factors
+ * for the remaining 90 should be 1. Fifth, since this routine
+ * directly operates on the matrix, it is necessary to apply the scale
+ * factors to the RHS and Solution vectors. It may be easier to
+ * simply use spOrderAndFactor() on a scaled matrix to choose the
+ * pivoting order, and then throw away the matrix. Subsequent
+ * factorizations, performed with spFactor(), will not need to have
+ * the RHS and Solution vectors descaled. Lastly, this function
+ * should not be executed before the function spMNA_Preorder.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix to be scaled.
+ * SolutionScaleFactors <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * The array of Solution scale factors. These factors scale the columns.
+ * All scale factors are real valued.
+ * RHS_ScaleFactors <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * The array of RHS scale factors. These factors scale the rows.
+ * All scale factors are real valued.
+ */
+
+void
+sfScale( long *Matrix, RealVector RHS_ScaleFactors, RealVector SolutionScaleFactors )
+{
+ /* Begin `sfScale'. */
+ spScale( (char *)*Matrix, RHS_ScaleFactors, SolutionScaleFactors );
+}
+#endif /* SCALING */
+
+
+
+
+
+
+#ifdef MULTIPLICATION
+/*
+ * MATRIX MULTIPLICATION
+ *
+ * Multiplies matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct. It should not be used
+ * before PreorderFoModifiedNodal().
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix.
+ * RHS <output> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * RHS is the right hand side. This is what is being solved for.
+ * Solution <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * Solution is the vector being multiplied by the matrix.
+ * iRHS <output> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+void
+sfMultiply( long *Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ /* Begin `sfMultiply'. */
+ spMultiply( (char *)*Matrix, RHS, Solution IMAG_VECTORS );
+}
+#endif /* MULTIPLICATION */
+
+
+
+
+
+
+#if MULTIPLICATION AND TRANSPOSE
+/*
+ * TRANSPOSED MATRIX MULTIPLICATION
+ *
+ * Multiplies transposed matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct. It should not be used
+ * before PreorderFoModifiedNodal().
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix.
+ * RHS <output> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * RHS is the right hand side. This is what is being solved for.
+ * Solution <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * Solution is the vector being multiplied by the matrix.
+ * iRHS <output> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector) [REAL(1) or DOUBLE PRECISION(1)]
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+void
+sfMultTransposed( long *Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ /* Begin `sfMultTransposed'. */
+ spMultTransposed( (char *)*Matrix, RHS, Solution IMAG_VECTORS );
+}
+#endif
+/* MULTIPLICATION AND TRANSPOSE */
+
+
+
+#ifdef DETERMINANT
+
+/*
+ * CALCULATE DETERMINANT
+ *
+ * This routine in capable of calculating the determinant of the
+ * matrix once the LU factorization has been performed. Hence, only
+ * use this routine after spFactor() and before spClear().
+ * The determinant equals the product of all the diagonal elements of
+ * the lower triangular matrix L, except that this product may need
+ * negating. Whether the product or the negative product equals the
+ * determinant is determined by the number of row and column
+ * interchanges performed. Note that the determinants of matrices can
+ * be very large or very small. On large matrices, the determinant
+ * can be far larger or smaller than can be represented by a floating
+ * point number. For this reason the determinant is scaled to a
+ * reasonable value and the logarithm of the scale factor is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * A pointer to the matrix for which the determinant is desired.
+ * pExponent <output> (int *) [INTEGER or INTEGER*2]
+ * The logarithm base 10 of the scale factor for the determinant. To
+ * find
+ * the actual determinant, Exponent should be added to the exponent of
+ * DeterminantReal.
+ * pDeterminant <output> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * The real portion of the determinant. This number is scaled to be
+ * greater than or equal to 1.0 and less than 10.0.
+ * piDeterminant <output> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * The imaginary portion of the determinant. When the matrix is real
+ * this pointer need not be supplied, nothing will be returned. This
+ * number is scaled to be greater than or equal to 1.0 and less than 10.0.
+ */
+
+#ifdef spCOMPLEX
+
+void
+sfDeterminant( long *Matrix, int *pExponent, RealNumber *pDeterminant, RealNumber *piDeterminant )
+{
+ /* Begin `sfDeterminant'. */
+ spDeterminant( (char *)*Matrix, pExponent, pDeterminant, piDeterminant );
+}
+
+#else /* spCOMPLEX */
+
+void
+sfDeterminant( long *Matrix, int *pExponent, RealNumber *pDeterminant )
+{
+ /* Begin `sfDeterminant'. */
+ spDeterminant( (char *)*Matrix, pExponent, pDeterminant );
+}
+#endif /* spCOMPLEX */
+#endif /* DETERMINANT */
+
+
+
+
+
+
+/*
+ * RETURN MATRIX ERROR STATUS
+ *
+ * This function is used to determine the error status of the given matrix.
+ *
+ * >>> Returned: [INTEGER or INTEGER*2]
+ * The error status of the given matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * The matrix for which the error status is desired.
+ */
+
+int
+sfError( long *Matrix )
+{
+ /* Begin `sfError'. */
+ return spError( (char *) * Matrix );
+}
+
+
+
+
+
+
+/*
+ * WHERE IS MATRIX SINGULAR
+ *
+ * This function returns the row and column number where the matrix was
+ * detected as singular or where a zero was detected on the diagonal.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * The matrix for which the error status is desired.
+ * pRow <output> (int *) [INTEGER or INTEGER*2]
+ * The row number.
+ * pCol <output> (int *) [INTEGER or INTEGER*2]
+ * The column number.
+ */
+
+void
+sfWhereSingular( long *Matrix, int *Row, int *Col )
+{
+ /* Begin `sfWhereSingular'. */
+ spWhereSingular( (char *)*Matrix, Row, Col );
+}
+
+
+
+
+
+/*
+ * MATRIX SIZE
+ *
+ * Returns the size of the matrix. Either the internal or external size of
+ * the matrix is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ * External <input> (SPBOOLEAN) [LOGICAL]
+ * If External is set true, the external size , i.e., the value of the
+ * largest external row or column number encountered is returned.
+ * Otherwise the true size of the matrix is returned. These two sizes
+ * may differ if the TRANSLATE option is set true.
+ */
+
+int
+sfGetSize( long *Matrix, long *External )
+{
+ /* Begin `sfGetSize'. */
+ return spGetSize( (char *) * Matrix, (SPBOOLEAN) * External );
+}
+
+
+
+
+
+
+
+
+/*
+ * SET MATRIX COMPLEX OR REAL
+ *
+ * Forces matrix to be either real or complex.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ */
+
+void
+sfSetReal( long *Matrix )
+{
+ /* Begin `sfSetReal'. */
+ spSetReal( (char *)*Matrix );
+}
+
+
+void
+sfSetComplex( long *Matrix )
+{
+ /* Begin `sfSetComplex'. */
+ spSetComplex( (char *)*Matrix );
+}
+
+
+
+
+
+
+
+
+
+/*
+ * ELEMENT OR FILL-IN COUNT
+ *
+ * Two functions used to return simple statistics. Either the number
+ * of total elements, or the number of fill-ins can be returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to matrix.
+ */
+
+int
+sfFillinCount( long *Matrix )
+{
+ /* Begin `sfFillinCount'. */
+ return spFillinCount( (char *) * Matrix );
+}
+
+
+int
+sfElementCount( long *Matrix )
+{
+ /* Begin `sfElementCount'. */
+ return spElementCount( (char *) * Matrix );
+}
+
+
+
+
+
+
+#if TRANSLATE AND DELETE
+
+/*
+ * DELETE A ROW AND COLUMN FROM THE MATRIX
+ *
+ * Deletes a row and a column from a matrix.
+ *
+ * Sparse will abort if an attempt is made to delete a row or column that
+ * doesn't exist.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix in which the row and column are to be deleted.
+ * Row <input> (int) [INTEGER or INTEGER*2]
+ * Row to be deleted.
+ * Col <input> (int) [INTEGER or INTEGER*2]
+ * Column to be deleted.
+ */
+
+void
+sfDeleteRowAndCol( long *Matrix, int *Row, int *Col )
+{
+ /* Begin `sfDeleteRowAndCol'. */
+ spDeleteRowAndCol( (char *)*Matrix, *Row, *Col );
+}
+#endif
+
+
+
+
+
+#ifdef PSEUDOCONDITION
+
+/*
+ * CALCULATE PSEUDOCONDITION
+ *
+ * Computes the magnitude of the ratio of the largest to the smallest
+ * pivots. This quantity is an indicator of ill-conditioning in the
+ * matrix. If this ratio is large, and if the matrix is scaled such
+ * that uncertainties in the RHS and the matrix entries are
+ * equilibrated, then the matrix is ill-conditioned. However, a small
+ * ratio does not necessarily imply that the matrix is
+ * well-conditioned. This routine must only be used after a matrix
+ * has been factored by sfOrderAndFactor() or sfFactor() and before it
+ * is cleared by sfClear() or spInitialize(). The pseudocondition is faster
+ * to compute than the condition number calculated by sfCondition(), but
+ * is not as informative.
+ *
+ * >>> Returns: [REAL or DOUBLE PRECISION]
+ * The magnitude of the ratio of the largest to smallest pivot used during
+ * previous factorization. If the matrix was singular, zero is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *)
+ * Pointer to the matrix.
+ */
+
+RealNumber sfPseudoCondition( long *Matrix )
+{
+ /* Begin `sfPseudoCondition'. */
+ return spPseudoCondition( (char *)Matrix );
+}
+#endif
+
+
+
+
+
+
+
+#ifdef CONDITION
+
+/*
+ * ESTIMATE CONDITION NUMBER
+ *
+ * Computes an estimate of the condition number using a variation on
+ * the LINPACK condition number estimation algorithm. This quantity is
+ * an indicator of ill-conditioning in the matrix. To avoid problems
+ * with overflow, the reciprocal of the condition number is returned.
+ * If this number is small, and if the matrix is scaled such that
+ * uncertainties in the RHS and the matrix entries are equilibrated,
+ * then the matrix is ill-conditioned. If the this number is near
+ * one, the matrix is well conditioned. This routine must only be
+ * used after a matrix has been factored by sfOrderAndFactor() or
+ * sfFactor() and before it is cleared by sfClear() or spInitialize().
+ *
+ * Unlike the LINPACK condition number estimator, this routines
+ * returns the L infinity condition number. This is an artifact of
+ * Sparse placing ones on the diagonal of the upper triangular matrix
+ * rather than the lower. This difference should be of no importance.
+ *
+ * References:
+ * A.K. Cline, C.B. Moler, G.W. Stewart, J.H. Wilkinson. An estimate
+ * for the condition number of a matrix. SIAM Journal on Numerical
+ * Analysis. Vol. 16, No. 2, pages 368-375, April 1979.
+ *
+ * J.J. Dongarra, C.B. Moler, J.R. Bunch, G.W. Stewart. LINPACK
+ * User's Guide. SIAM, 1979.
+ *
+ * Roger G. Grimes, John G. Lewis. Condition number estimation for
+ * sparse matrices. SIAM Journal on Scientific and Statistical
+ * Computing. Vol. 2, No. 4, pages 384-388, December 1981.
+ *
+ * Dianne Prost O'Leary. Estimating matrix condition numbers. SIAM
+ * Journal on Scientific and Statistical Computing. Vol. 1, No. 2,
+ * pages 205-209, June 1980.
+ *
+ * >>> Returns: [REAL or DOUBLE PRECISION]
+ * The reciprocal of the condition number. If the matrix was singular,
+ * zero is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (long *)
+ * Pointer to the matrix.
+ * NormOfMatrix <input> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * The L-infinity norm of the unfactored matrix as computed by
+ * spNorm().
+ * pError <output> (int *) [INTEGER or INTEGER*2]
+ * Used to return error code.
+ *
+ * >>> Possible errors:
+ * spSINGULAR
+ * spNO_MEMORY
+ */
+
+RealNumber sfCondition( long * Matrix, RealNumber *NormOfMatrix, int *pError )
+{
+ /* Begin `sfCondition'. */
+ return spCondition( (char *) * Matrix, *NormOfMatrix, pError );
+}
+
+
+
+/*
+ * L-INFINITY MATRIX NORM
+ *
+ * Computes the L-infinity norm of an unfactored matrix. It is a fatal
+ * error to pass this routine a factored matrix.
+ *
+ * One difficulty is that the rows may not be linked.
+ *
+ * >>> Returns: [REAL or DOUBLE PRECISION]
+ * The largest absolute row sum of matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *)
+ * Pointer to the matrix.
+ */
+
+RealNumber sfNorm( long *Matrix )
+{
+ /* Begin `sfNorm'. */
+ return spNorm( (char *) * Matrix );
+}
+#endif /* CONDITION */
+
+
+
+
+
+#ifdef STABILITY
+
+/*
+ * STABILITY OF FACTORIZATION
+ *
+ * The following routines are used to gauge the stability of a
+ * factorization. If the factorization is determined to be too unstable,
+ * then the matrix should be reordered. The routines compute quantities
+ * that are needed in the computation of a bound on the error attributed
+ * to any one element in the matrix during the factorization. In other
+ * words, there is a matrix E = [e_ij] of error terms such that A+E = LU.
+ * This routine finds a bound on |e_ij|. Erisman & Reid [1] showed that
+ * |e_ij| < 3.01 u rho m_ij, where u is the machine rounding unit,
+ * rho = max a_ij where the max is taken over every row i, column j, and
+ * step k, and m_ij is the number of multiplications required in the
+ * computation of l_ij if i > j or u_ij otherwise. Barlow [2] showed that
+ * rho < max_i || l_i ||_p max_j || u_j ||_q where 1/p + 1/q = 1.
+ *
+ * The first routine finds the magnitude on the largest element in the
+ * matrix. If the matrix has not yet been factored, the largest
+ * element is found by direct search. If the matrix is factored, a
+ * bound on the largest element in any of the reduced submatrices is
+ * computed using Barlow with p = oo and q = 1. The ratio of these
+ * two numbers is the growth, which can be used to determine if the
+ * pivoting order is adequate. A large growth implies that
+ * considerable error has been made in the factorization and that it
+ * is probably a good idea to reorder the matrix. If a large growth
+ * in encountered after using spFactor(), reconstruct the matrix and
+ * refactor using spOrderAndFactor(). If a large growth is
+ * encountered after using spOrderAndFactor(), refactor using
+ * spOrderAndFactor() with the pivot threshold increased, say to 0.1.
+ *
+ * Using only the size of the matrix as an upper bound on m_ij and
+ * Barlow's bound, the user can estimate the size of the matrix error
+ * terms e_ij using the bound of Erisman and Reid. The second routine
+ * computes a tighter bound (with more work) based on work by Gear
+ * [3], |e_ij| < 1.01 u rho (t c^3 + (1 + t)c^2) where t is the
+ * threshold and c is the maximum number of off-diagonal elements in
+ * any row of L. The expensive part of computing this bound is
+ * determining the maximum number of off-diagonals in L, which changes
+ * only when the order of the matrix changes. This number is computed
+ * and saved, and only recomputed if the matrix is reordered.
+ *
+ * [1] A. M. Erisman, J. K. Reid. Monitoring the stability of the
+ * triangular factorization of a sparse matrix. Numerische
+ * Mathematik. Vol. 22, No. 3, 1974, pp 183-186.
+ *
+ * [2] J. L. Barlow. A note on monitoring the stability of triangular
+ * decomposition of sparse matrices. "SIAM Journal of Scientific
+ * and Statistical Computing." Vol. 7, No. 1, January 1986, pp 166-168.
+ *
+ * [3] I. S. Duff, A. M. Erisman, J. K. Reid. "Direct Methods for Sparse
+ * Matrices." Oxford 1986. pp 99.
+ */
+
+/*
+ * LARGEST ELEMENT IN MATRIX
+ *
+ * >>> Returns: [REAL or DOUBLE PRECISION]
+ * If matrix is not factored, returns the magnitude of the largest element in
+ * the matrix. If the matrix is factored, a bound on the magnitude of the
+ * largest element in any of the reduced submatrices is returned.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix.
+ */
+
+RealNumber
+sfLargestElement( long *Matrix )
+{
+ /* Begin `sfLargestElement'. */
+ return spLargestElement( (char *)Matrix );
+}
+
+
+
+
+/*
+ * MATRIX ROUNDOFF ERROR
+ *
+ * >>> Returns: [REAL or DOUBLE PRECISION]
+ * Returns a bound on the magnitude of the largest element in E = A - LU.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix.
+ * Rho <input> (RealNumber *) [REAL or DOUBLE PRECISION]
+ * The bound on the magnitude of the largest element in any of the
+ * reduced submatrices. This is the number computed by the function
+ * spLargestElement() when given a factored matrix. If this number is
+ * negative, the bound will be computed automatically.
+ */
+
+RealNumber
+sfRoundoff( long *Matrix, RealNumber *Rho )
+{
+ /* Begin `sfRoundoff'. */
+ return spRoundoff( (char *) * Matrix, *Rho );
+}
+#endif
+
+#endif /* FORTRAN */
diff --git a/modules/sparse/src/c/spFortran.h b/modules/sparse/src/c/spFortran.h
new file mode 100755
index 000000000..67a1d18f1
--- /dev/null
+++ b/modules/sparse/src/c/spFortran.h
@@ -0,0 +1,124 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __SPFORTRAN_H__
+#define __SPFORTRAN_H__
+
+/*
+ * Routine Renaming
+ */
+#include "machine.h"
+#define sfCreate C2F(sfcreate)
+#define sfStripFills C2F(sfstripfills)
+#define sfDestroy C2F(sfdestroy)
+#define sfClear C2F(sfclear)
+#define sfGetElement C2F(sfgetelement)
+#define sfGetAdmittance C2F(sfgetadmittance)
+#define sfGetQuad C2F(sfgetquad)
+#define sfGetOnes C2F(sfgetones)
+#define sfAdd1Real C2F(sfadd1real)
+#define sfAdd1Imag C2F(sfadd1imag)
+#define sfAdd1Complex C2F(sfadd1complex)
+#define sfAdd4Real C2F(sfadd4real)
+#define sfAdd4Imag C2F(sfadd4imag)
+#define sfAdd4Complex C2F(sfadd4complex)
+#define sfOrderAndFactor C2F(sforderandfactor)
+#define sfFactor C2F(sffactor)
+#define sfPartition C2F(sfpartition)
+#define sfSolve C2F(sfsolve)
+#define sfSolveTransposed C2F(sfsolvetransposed)
+#define sfPrint C2F(sfprint)
+#define sfFileMatrix C2F(sffilematrix)
+#define sfFileVector C2F(sffilevector)
+#define sfFileStats C2F(sffilestats)
+#define sfMNA_Preorder C2F(sfmna_preorder)
+#define sfScale C2F(sfscale)
+#define sfMultiply C2F(sfmultiply)
+#define sfDeterminant C2F(sfdeterminant)
+#define sfError C2F(sferror)
+#define sfWhereSingular C2F(sfwheresingular)
+#define sfGetSize C2F(sfgetsize)
+#define sfSetReal C2F(sfsetreal)
+#define sfSetComplex C2F(sfsetcomplex)
+#define sfFillinCount C2F(sffillincount)
+#define sfElementCount C2F(sfelementcount)
+#define sfDeleteRowAndCol C2F(sfdeleterowandcol)
+#define sfPseudoCondition C2F(sfpseudocondition)
+#define sfCondition C2F(sfcondition)
+#define sfNorm C2F(sfnorm)
+#define sfLargestElement C2F(sflargestelement)
+#define sfRoundoff C2F(sfroundoff)
+
+/*
+ * MATRIX SPALLOCATION
+ *
+ * Allocates and initializes the data structures associated with a matrix.
+ *
+ * >>> Returned: [INTEGER]
+ * A pointer to the matrix is returned cast into an integer. This pointer
+ * is then passed and used by the other matrix routines to refer to a
+ * particular matrix. If an error occurs, the NULL pointer is returned.
+ *
+ * >>> Arguments:
+ * Size <input> (long *) [INTEGER]
+ * Size of matrix or estimate of size of matrix if matrix is EXPANDABLE.
+ * Complex <input> (int *) [INTEGER or INTEGER*2]
+ * Type of matrix. If Complex is 0 then the matrix is real, otherwise
+ * the matrix will be complex. Note that if the routines are not set up
+ * to handle the type of matrix requested, then a spPANIC error will occur.
+ * Further note that if a matrix will be both real and complex, it must
+ * be specified here as being complex.
+ * Error <output> (int *) [INTEGER or INTEGER*2]
+ * Returns error flag, needed because function spError() will not work
+ * correctly if spCreate() returns NULL.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ * spPANIC
+ * Error is cleared in this routine.
+ */
+
+long sfCreate(int *Size, int *Complex, int *Error );
+
+/*
+ * MATRIX DEALLOCATION
+ *
+ * Deallocates pointers and elements of Matrix.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix frame which is to be removed from memory.
+ */
+void sfDestroy( long *Matrix );
+
+
+/*
+ * STRIP FILL-INS FROM MATRIX
+ *
+ * Strips the matrix of all fill-ins.
+ *
+ * >>> Arguments:
+ * Matrix <input> (long *) [INTEGER]
+ * Pointer to the matrix to be stripped.
+ */
+
+void sfStripFills( long *Matrix );
+
+/**
+ * <long-description>
+ *
+ * @param Matrix
+ */
+void sfClear( long *Matrix );
+
+
+#endif /* __SPFORTRAN_H__ */
diff --git a/modules/sparse/src/c/spOutput.c b/modules/sparse/src/c/spOutput.c
new file mode 100755
index 000000000..ec39d29c1
--- /dev/null
+++ b/modules/sparse/src/c/spOutput.c
@@ -0,0 +1,907 @@
+/*
+ * MATRIX OUTPUT MODULE
+ *
+ * Author: Advisor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains the output-to-file and output-to-screen routines for
+ * the matrix package.
+ *
+ * >>> User accessible functions contained in this file:
+ * spPrint
+ * spFileMatrix
+ * spFileVector
+ * spFileStats
+ *
+ * >>> Other functions contained in this file:
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+#include <stdio.h>
+#include "spmalloc.h"
+#include "localization.h"
+#include "charEncoding.h"
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+
+
+
+
+
+#if DOCUMENTATION
+
+/*
+ * PRINT MATRIX
+ *
+ * Formats and send the matrix to standard output. Some elementary
+ * statistics are also output. The matrix is output in a format that is
+ * readable by people.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * PrintReordered <input> (int)
+ * Indicates whether the matrix should be printed out in its original
+ * form, as input by the user, or whether it should be printed in its
+ * reordered form, as used by the matrix routines. A zero indicates that
+ * the matrix should be printed as inputed, a one indicates that it
+ * should be printed reordered.
+ * Data <input> (int)
+ * Boolean flag that when false indicates that output should be
+ * compressed such that only the existence of an element should be
+ * indicated rather than giving the actual value. Thus 11 times as
+ * many can be printed on a row. A zero signifies that the matrix
+ * should be printed compressed. A one indicates that the matrix
+ * should be printed in all its glory.
+ * Header <input> (int)
+ * Flag indicating that extra information should be given, such as row
+ * and column numbers.
+ *
+ * >>> Local variables:
+ * Col (int)
+ * Column being printed.
+ * ElementCount (int)
+ * Variable used to count the number of nonzero elements in the matrix.
+ * LargestElement (RealNumber)
+ * The magnitude of the largest element in the matrix.
+ * LargestDiag (RealNumber)
+ * The magnitude of the largest diagonal in the matrix.
+ * Magnitude (RealNumber)
+ * The absolute value of the matrix element being printed.
+ * PrintOrdToIntColMap (int [])
+ * A translation array that maps the order that columns will be
+ * printed in (if not PrintReordered) to the internal column numbers.
+ * PrintOrdToIntRowMap (int [])
+ * A translation array that maps the order that rows will be
+ * printed in (if not PrintReordered) to the internal row numbers.
+ * pElement (ElementPtr)
+ * Pointer to the element in the matrix that is to be printed.
+ * pImagElements (ElementPtr [ ])
+ * Array of pointers to elements in the matrix. These pointers point
+ * to the elements whose real values have just been printed. They are
+ * used to quickly access those same elements so their imaginary values
+ * can be printed.
+ * Row (int)
+ * Row being printed.
+ * Size (int)
+ * The size of the matrix.
+ * SmallestDiag (RealNumber)
+ * The magnitude of the smallest diagonal in the matrix.
+ * SmallestElement (RealNumber)
+ * The magnitude of the smallest element in the matrix excluding zero
+ * elements.
+ * StartCol (int)
+ * The column number of the first column to be printed in the group of
+ * columns currently being printed.
+ * StopCol (int)
+ * The column number of the last column to be printed in the group of
+ * columns currently being printed.
+ * Top (int)
+ * The largest expected external row or column number.
+ */
+
+void spPrint(char *eMatrix, int PrintReordered, int Data, int Header )
+{
+ register int J = 0;
+ int I = 0, Row = 0, Col = 0, Size = 0, Top_ = 0, StartCol = 1, StopCol = 0, Columns = 0, ElementCount = 0;
+ double Magnitude = 0., SmallestDiag = 0., SmallestElement = 0.;
+ double LargestElement = 0.0, LargestDiag = 0.0;
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ ElementPtr pElement = NULL, pImagElements[PRINTER_WIDTH / 10 + 1];
+ int *PrintOrdToIntRowMap = NULL, *PrintOrdToIntColMap = NULL;
+
+ /* Begin `spPrint'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+ Size = Matrix->Size;
+
+ /* Create a packed external to internal row and column translation array. */
+# if TRANSLATE
+ Top_ = Matrix->AllocatedExtSize;
+#else
+ Top_ = Matrix->AllocatedSize;
+#endif
+ SPCALLOC( PrintOrdToIntRowMap, int, Top_ + 1 );
+ SPCALLOC( PrintOrdToIntColMap, int, Top_ + 1 );
+ if ( PrintOrdToIntRowMap == NULL OR PrintOrdToIntColMap == NULL)
+ {
+ Matrix->Error = spNO_MEMORY;
+ return;
+ }
+ for (I = 1; I <= Size; I++)
+ {
+ PrintOrdToIntRowMap[ Matrix->IntToExtRowMap[I] ] = I;
+ PrintOrdToIntColMap[ Matrix->IntToExtColMap[I] ] = I;
+ }
+
+ /* Pack the arrays. */
+ for (J = 1, I = 1; I <= Top_; I++)
+ {
+ if (PrintOrdToIntRowMap[I] != 0)
+ {
+ PrintOrdToIntRowMap[ J++ ] = PrintOrdToIntRowMap[ I ];
+ }
+ }
+ for (J = 1, I = 1; I <= Top_; I++)
+ {
+ if (PrintOrdToIntColMap[I] != 0)
+ {
+ PrintOrdToIntColMap[ J++ ] = PrintOrdToIntColMap[ I ];
+ }
+ }
+
+ /* Print header. */
+ if (Header)
+ {
+ printf(_("MATRIX SUMMARY\n\n"));
+ printf(_("Size of matrix = %1u x %1u.\n"), Size, Size);
+ if ( Matrix->Reordered AND PrintReordered )
+ {
+ printf(_("Matrix has been reordered.\n"));
+ }
+ putchar('\n');
+
+ if ( Matrix->Factored )
+ {
+ printf(_("Matrix after factorization:\n"));
+ }
+ else
+ {
+ printf(_("Matrix before factorization:\n"));
+ }
+
+ SmallestElement = LARGEST_REAL;
+ SmallestDiag = SmallestElement;
+ }
+
+ /* Determine how many columns to use. */
+ Columns = PRINTER_WIDTH;
+ if (Header)
+ {
+ Columns -= 5;
+ }
+ if (Data)
+ {
+ Columns = (Columns + 1) / 10;
+ }
+
+ /*
+ * Print matrix by printing groups of complete columns until all the columns
+ * are printed.
+ */
+ J = 0;
+ while ( J <= Size )
+
+ /* Calculate index of last column to printed in this group. */
+ {
+ StopCol = StartCol + Columns - 1;
+ if (StopCol > Size)
+ {
+ StopCol = Size;
+ }
+
+ /* Label the columns. */
+ if (Header)
+ {
+ if (Data)
+ {
+ printf(" ");
+ for (I = StartCol; I <= StopCol; I++)
+ {
+ if (PrintReordered)
+ {
+ Col = I;
+ }
+ else
+ {
+ Col = PrintOrdToIntColMap[I];
+ }
+ printf(" %9d", Matrix->IntToExtColMap[ Col ]);
+ }
+ printf("\n\n");
+ }
+ else
+ {
+ if (PrintReordered)
+ {
+ printf(_("Columns %1d to %1d.\n"), StartCol, StopCol);
+ }
+ else
+ {
+ printf(_("Columns %1d to %1d.\n"),
+ Matrix->IntToExtColMap[ PrintOrdToIntColMap[StartCol] ],
+ Matrix->IntToExtColMap[ PrintOrdToIntColMap[StopCol] ]);
+ }
+ }
+ }
+
+ /* Print every row ... */
+ for (I = 1; I <= Size; I++)
+ {
+ if (PrintReordered)
+ {
+ Row = I;
+ }
+ else
+ {
+ Row = PrintOrdToIntRowMap[I];
+ }
+
+ if (Header)
+ {
+ if (PrintReordered AND NOT Data)
+ {
+ printf("%4d", I);
+ }
+ else
+ {
+ printf("%4d", Matrix->IntToExtRowMap[ Row ]);
+ }
+ if (NOT Data)
+ {
+ putchar(' ');
+ }
+ }
+
+ /* ... in each column of the group. */
+ for (J = StartCol; J <= StopCol; J++)
+ {
+ if (PrintReordered)
+ {
+ Col = J;
+ }
+ else
+ {
+ Col = PrintOrdToIntColMap[J];
+ }
+
+ pElement = Matrix->FirstInCol[Col];
+ while (pElement != NULL AND pElement->Row != Row)
+ {
+ pElement = pElement->NextInCol;
+ }
+
+ if (Data)
+ {
+ pImagElements[J - StartCol] = pElement;
+ }
+
+ if (pElement != NULL)
+
+ /* Case where element exists */
+ {
+ if (Data)
+ {
+ printf(" %9.3lg", (double)pElement->Real);
+ }
+ else
+ {
+ putchar('x');
+ }
+
+ /* Update status variables */
+ if ( (Magnitude = ELEMENT_MAG(pElement)) > LargestElement )
+ {
+ LargestElement = Magnitude;
+ }
+ if ((Magnitude < SmallestElement) AND (Magnitude != 0.0))
+ {
+ SmallestElement = Magnitude;
+ }
+ ElementCount++;
+ }
+
+ /* Case where element is structurally zero */
+ else
+ {
+ if (Data)
+ {
+ printf(" ...");
+ }
+ else
+ {
+ putchar('.');
+ }
+ }
+ }
+ putchar('\n');
+
+#if spCOMPLEX
+ if (Matrix->Complex AND Data)
+ {
+ printf(" ");
+ for (J = StartCol; J <= StopCol; J++)
+ {
+ if (pImagElements[J - StartCol] != NULL)
+ {
+ printf(" %8.2lgj",
+ (double)pImagElements[J - StartCol]->Imag);
+ }
+ else
+ {
+ printf(" ");
+ }
+ }
+ putchar('\n');
+ }
+#endif /* spCOMPLEX */
+ }
+
+ /* Calculate index of first column in next group. */
+ StartCol = StopCol;
+ StartCol++;
+ putchar('\n');
+ }
+ if (Header)
+ {
+ printf(_("\nLargest element in matrix = %-1.4lg.\n"), LargestElement);
+ printf(_("Smallest element in matrix = %-1.4lg.\n"), SmallestElement);
+
+ /* Search for largest and smallest diagonal values */
+ for (I = 1; I <= Size; I++)
+ {
+ if (Matrix->Diag[I] != NULL)
+ {
+ Magnitude = ELEMENT_MAG( Matrix->Diag[I] );
+ if ( Magnitude > LargestDiag )
+ {
+ LargestDiag = Magnitude;
+ }
+ if ( Magnitude < SmallestDiag )
+ {
+ SmallestDiag = Magnitude;
+ }
+ }
+ }
+
+ /* Print the largest and smallest diagonal values */
+ if ( Matrix->Factored )
+ {
+ printf(_("\nLargest diagonal element = %-1.4lg.\n"), LargestDiag);
+ printf(_("Smallest diagonal element = %-1.4lg.\n"), SmallestDiag);
+ }
+ else
+ {
+ printf(_("\nLargest pivot element = %-1.4lg.\n"), LargestDiag);
+ printf(_("Smallest pivot element = %-1.4lg.\n"), SmallestDiag);
+ }
+
+ /* Calculate and print sparsity and number of fill-ins created. */
+ printf(_("\nDensity = %2.2lf%%.\n"), ((double)(ElementCount * 100)) /
+ ((double)(Size * Size)));
+ if (NOT Matrix->NeedsOrdering)
+ {
+ printf(_("Number of fill-ins = %1d.\n"), Matrix->Fillins);
+ }
+ }
+ putchar('\n');
+ (void)fflush(stdout);
+
+ SPFREE(PrintOrdToIntColMap);
+ SPFREE(PrintOrdToIntRowMap);
+ return;
+}
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * OUTPUT MATRIX TO FILE
+ *
+ * Writes matrix to file in format suitable to be read back in by the
+ * matrix test program.
+ *
+ * >>> Returns:
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * File <input> (char *)
+ * Name of file into which matrix is to be written.
+ * Label <input> (char *)
+ * String that is transferred to file and is used as a label.
+ * Reordered <input> (SPBOOLEAN)
+ * Specifies whether matrix should be output in reordered form,
+ * or in original order.
+ * Data <input> (SPBOOLEAN)
+ * Indicates that the element values should be output along with
+ * the indices for each element. This parameter must be true if
+ * matrix is to be read by the sparse test program.
+ * Header <input> (SPBOOLEAN)
+ * Indicates that header is desired. This parameter must be true if
+ * matrix is to be read by the sparse test program.
+ *
+ * >>> Local variables:
+ * Col (int)
+ * The original column number of the element being output.
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * pMatrixFile (FILE *)
+ * File pointer to the matrix file.
+ * Row (int)
+ * The original row number of the element being output.
+ * Size (int)
+ * The size of the matrix.
+ */
+
+int spFileMatrix(char * eMatrix, char * File, char * Label, int Reordered, int Data, int Header )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int I = 0, Size = 0;
+ register ElementPtr pElement = NULL;
+ int Row = 0, Col = 0, Err = 0;
+ FILE *pMatrixFile = NULL;
+
+ /* Begin `spFileMatrix'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+ /* Open file matrix file in write mode. */
+ wcfopen(pMatrixFile, File, "w");
+ if (pMatrixFile == NULL)
+ {
+ return 0;
+ }
+
+ /* Output header. */
+ Size = Matrix->Size;
+ if (Header)
+ {
+ if (Matrix->Factored AND Data)
+ {
+ Err = fprintf
+ ( pMatrixFile,
+ _("Warning : The following matrix is factored in to LU form.\n")
+ );
+ }
+ if (Err < 0)
+ {
+ return 0;
+ }
+ if (fprintf(pMatrixFile, "%s\n", Label) < 0)
+ {
+ return 0;
+ }
+ Err = fprintf( pMatrixFile, "%d\t%s\n", Size,
+ (Matrix->Complex ? "complex" : "real"));
+ if (Err < 0)
+ {
+ return 0;
+ }
+ }
+
+ /* Output matrix. */
+ if (NOT Data)
+ {
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ if (Reordered)
+ {
+ Row = pElement->Row;
+ Col = I;
+ }
+ else
+ {
+ Row = Matrix->IntToExtRowMap[pElement->Row];
+ Col = Matrix->IntToExtColMap[I];
+ }
+ pElement = pElement->NextInCol;
+ if (fprintf(pMatrixFile, "%d\t%d\n", Row, Col) < 0)
+ {
+ return 0;
+ }
+ }
+ }
+ /* Output terminator, a line of zeros. */
+ if (Header)
+ if (fprintf(pMatrixFile, "0\t0\n") < 0)
+ {
+ return 0;
+ }
+ }
+
+#if spCOMPLEX
+ if (Data AND Matrix->Complex)
+ {
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ if (Reordered)
+ {
+ Row = pElement->Row;
+ Col = I;
+ }
+ else
+ {
+ Row = Matrix->IntToExtRowMap[pElement->Row];
+ Col = Matrix->IntToExtColMap[I];
+ }
+ Err = fprintf
+ ( pMatrixFile, "%d\t%d\t%-.15lg\t%-.15lg\n",
+ Row, Col, (double)pElement->Real, (double)pElement->Imag
+ );
+ if (Err < 0)
+ {
+ return 0;
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+ /* Output terminator, a line of zeros. */
+ if (Header)
+ if (fprintf(pMatrixFile, "0\t0\t0.0\t0.0\n") < 0)
+ {
+ return 0;
+ }
+
+ }
+#endif /* spCOMPLEX */
+
+#if REAL
+ if (Data AND NOT Matrix->Complex)
+ {
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ Row = Matrix->IntToExtRowMap[pElement->Row];
+ Col = Matrix->IntToExtColMap[I];
+ Err = fprintf
+ ( pMatrixFile, "%d\t%d\t%-.15lg\n",
+ Row, Col, (double)pElement->Real
+ );
+ if (Err < 0)
+ {
+ return 0;
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+ /* Output terminator, a line of zeros. */
+ if (Header)
+ if (fprintf(pMatrixFile, "0\t0\t0.0\n") < 0)
+ {
+ return 0;
+ }
+
+ }
+#endif /* REAL */
+
+ /* Close file. */
+ if (fclose(pMatrixFile) < 0)
+ {
+ return 0;
+ }
+ return 1;
+}
+
+
+
+
+
+
+
+/*
+ * OUTPUT SOURCE VECTOR TO FILE
+ *
+ * Writes vector to file in format suitable to be read back in by the
+ * matrix test program. This routine should be executed after the function
+ * spFileMatrix.
+ *
+ * >>> Returns:
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * File <input> (char *)
+ * Name of file into which matrix is to be written.
+ * RHS <input> (RealNumber [])
+ * Right-hand side vector. This is only the real portion if
+ * spSEPARATED_COMPLEX_VECTORS is true.
+ * iRHS <input> (RealNumber [])
+ * Right-hand side vector, imaginary portion. Not necessary if matrix
+ * is real or if spSEPARATED_COMPLEX_VECTORS is set false.
+ *
+ * >>> Local variables:
+ * pMatrixFile (FILE *)
+ * File pointer to the matrix file.
+ * Size (int)
+ * The size of the matrix.
+ *
+ * >>> Obscure Macros
+ * IMAG_RHS
+ * Replaces itself with `, iRHS' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+int spFileVector(char *eMatrix, char *File, RealVector RHS IMAG_RHS )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int I, Size, Err;
+ FILE *pMatrixFile;
+
+ /* Begin `spFileVector'. */
+ ASSERT( IS_SPARSE( Matrix ) AND RHS != NULL)
+
+ /* Open File in append mode. */
+ wcfopen(pMatrixFile, File, "a");
+ if (pMatrixFile == NULL)
+ {
+ return 0;
+ }
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+#if spSEPARATED_COMPLEX_VECTORS
+ ASSERT(iRHS != NULL)
+ --RHS;
+ --iRHS;
+#else
+ RHS -= 2;
+#endif
+ }
+ else
+#endif /* spCOMPLEX */
+ --RHS;
+#endif /* NOT ARRAY_OFFSET */
+
+
+ /* Output vector. */
+ Size = Matrix->Size;
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = 1; I <= Size; I++)
+ {
+ Err = fprintf
+ ( pMatrixFile, "%-.15lg\t%-.15lg\n",
+ (double)RHS[I], (double)iRHS[I]
+ );
+ if (Err < 0)
+ {
+ return 0;
+ }
+ }
+#else
+ for (I = 1; I <= Size; I++)
+ {
+ Err = fprintf
+ ( pMatrixFile, "%-.15lg\t%-.15lg\n",
+ (double)RHS[2 * I], (double)RHS[2 * I + 1]
+ );
+ if (Err < 0)
+ {
+ return 0;
+ }
+ }
+#endif
+ }
+#endif /* spCOMPLEX */
+#if REAL AND spCOMPLEX
+ else
+#endif
+#if REAL
+ {
+ for (I = 1; I <= Size; I++)
+ {
+ if (fprintf(pMatrixFile, "%-.15lg\n", (double)RHS[I]) < 0)
+ {
+ return 0;
+ }
+ }
+ }
+#endif /* REAL */
+
+ /* Close file. */
+ if (fclose(pMatrixFile) < 0)
+ {
+ return 0;
+ }
+ return 1;
+}
+
+
+
+
+
+
+
+
+
+/*
+ * OUTPUT STATISTICS TO FILE
+ *
+ * Writes useful information concerning the matrix to a file. Should be
+ * executed after the matrix is factored.
+ *
+ * >>> Returns:
+ * One is returned if routine was successful, otherwise zero is returned.
+ * The calling function can query errno (the system global error variable)
+ * as to the reason why this routine failed.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * File <input> (char *)
+ * Name of file into which matrix is to be written.
+ * Label <input> (char *)
+ * String that is transferred to file and is used as a label.
+ *
+ * >>> Local variables:
+ * Data (RealNumber)
+ * The value of the matrix element being output.
+ * LargestElement (RealNumber)
+ * The largest element in the matrix.
+ * NumberOfElements (int)
+ * Number of nonzero elements in the matrix.
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * pStatsFile (FILE *)
+ * File pointer to the statistics file.
+ * Size (int)
+ * The size of the matrix.
+ * SmallestElement (RealNumber)
+ * The smallest element in the matrix excluding zero elements.
+ */
+
+int spFileStats(char *eMatrix, char *File, char *Label )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int Size, I;
+ register ElementPtr pElement;
+ int NumberOfElements;
+ RealNumber Data, LargestElement, SmallestElement;
+ FILE *pStatsFile;
+
+ /* Begin `spFileStats'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+
+ /* Open File in append mode. */
+ wcfopen(pStatsFile, File, "a");
+ if (pStatsFile == NULL)
+ {
+ return 0;
+ }
+
+ /* Output statistics. */
+ Size = Matrix->Size;
+ if (NOT Matrix->Factored)
+ {
+ fprintf(pStatsFile, _("Matrix has not been factored.\n"));
+ }
+ fprintf(pStatsFile, _("||| Starting new matrix |||\n"));
+ fprintf(pStatsFile, "%s\n", Label);
+ if (Matrix->Complex)
+ {
+ fprintf(pStatsFile, _("Matrix is complex.\n"));
+ }
+ else
+ {
+ fprintf(pStatsFile, _("Matrix is real.\n"));
+ }
+ fprintf(pStatsFile, " Size = %d\n", Size);
+
+ /* Search matrix. */
+ NumberOfElements = 0;
+ LargestElement = 0.0;
+ SmallestElement = LARGEST_REAL;
+
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ NumberOfElements++;
+ Data = ELEMENT_MAG(pElement);
+ if (Data > LargestElement)
+ {
+ LargestElement = Data;
+ }
+ if (Data < SmallestElement AND Data != 0.0)
+ {
+ SmallestElement = Data;
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+
+ SmallestElement = Min( SmallestElement, LargestElement );
+
+ /* Output remaining statistics. */
+ fprintf(pStatsFile, _(" Initial number of elements = %d\n"),
+ NumberOfElements - Matrix->Fillins);
+ fprintf(pStatsFile,
+ _(" Initial average number of elements per row = %lf\n"),
+ (double)(NumberOfElements - Matrix->Fillins) / (double)Size);
+ fprintf(pStatsFile, _(" Fill-ins = %d\n"), Matrix->Fillins);
+ fprintf(pStatsFile, _(" Average number of fill-ins per row = %lf%%\n"),
+ (double)Matrix->Fillins / (double)Size);
+ fprintf(pStatsFile, _(" Total number of elements = %d\n"),
+ NumberOfElements);
+ fprintf(pStatsFile, _(" Average number of elements per row = %lf\n"),
+ (double)NumberOfElements / (double)Size);
+ fprintf(pStatsFile, _(" Density = %lf%%\n"),
+ (double)(100.0 * NumberOfElements) / (double)(Size * Size));
+ fprintf(pStatsFile, _(" Relative Threshold = %e\n"), Matrix->RelThreshold);
+ fprintf(pStatsFile, _(" Absolute Threshold = %e\n"), Matrix->AbsThreshold);
+ fprintf(pStatsFile, _(" Largest Element = %e\n"), LargestElement);
+ fprintf(pStatsFile, _(" Smallest Element = %e\n\n\n"), SmallestElement);
+
+ /* Close file. */
+ (void)fclose(pStatsFile);
+ return 1;
+}
+#endif /* DOCUMENTATION */
diff --git a/modules/sparse/src/c/spSolve.c b/modules/sparse/src/c/spSolve.c
new file mode 100755
index 000000000..123560397
--- /dev/null
+++ b/modules/sparse/src/c/spSolve.c
@@ -0,0 +1,728 @@
+/*
+ * MATRIX SOLVE MODULE
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains the forward and backward substitution routines for
+ * the sparse matrix routines.
+ *
+ * >>> User accessible functions contained in this file:
+ * spSolve
+ * spSolveTransposed
+ *
+ * >>> Other functions contained in this file:
+ * SolveComplexMatrix
+ * SolveComplexTransposedMatrix
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+#define spINSIDE_SPARSE
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+
+
+static void SolveComplexMatrix( MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS );
+static void SolveComplexTransposedMatrix(MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS );
+
+
+/*
+ * SOLVE MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and factored matrix. This
+ * routine assumes that the pivots are associated with the lower
+ * triangular (L) matrix and that the diagonal of the upper triangular
+ * (U) matrix consists of ones. This routine arranges the computation
+ * in different way than is traditionally used in order to exploit the
+ * sparsity of the right-hand side. See the reference in spRevision.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * RHS is the input data array, the right hand side. This data is
+ * undisturbed and may be reused for other solves.
+ * Solution <output> (RealVector)
+ * Solution is the output data array. This routine is constructed such that
+ * RHS and Solution can be the same array.
+ * iRHS <input> (RealVector)
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * This argument is only necessary if matrix is complex and if
+ * spSEPARATED_COMPLEX_VECTOR is set true.
+ * iSolution <output> (RealVector)
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. This argument is only necessary if matrix is complex
+ * and if spSEPARATED_COMPLEX_VECTOR is set true.
+ *
+ * >>> Local variables:
+ * Intermediate (RealVector)
+ * Temporary storage for use in forward elimination and backward
+ * substitution. Commonly referred to as c, when the LU factorization
+ * equations are given as Ax = b, Lc = b, Ux = c Local version of
+ * Matrix->Intermediate, which was created during the initial
+ * factorization in function CreateInternalVectors() in the matrix
+ * factorization module.
+ * pElement (ElementPtr)
+ * Pointer used to address elements in both the lower and upper triangle
+ * matrices.
+ * pExtOrder (int *)
+ * Pointer used to sequentially access each entry in IntToExtRowMap
+ * and IntToExtColMap arrays. Used to quickly scramble and unscramble
+ * RHS and Solution to account for row and column interchanges.
+ * pPivot (ElementPtr)
+ * Pointer that points to current pivot or diagonal element.
+ * Size (int)
+ * Size of matrix. Made local to reduce indirection.
+ * Temp (RealNumber)
+ * Temporary storage for entries in arrays.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+/*VARARGS3*/
+
+
+void
+spSolve(char *eMatrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register RealVector Intermediate;
+ register RealNumber Temp;
+ register int I, *pExtOrder, Size;
+ ElementPtr pPivot;
+
+ /* Begin `spSolve'. */
+ ASSERT( IS_VALID(Matrix) AND IS_FACTORED(Matrix) );
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ SolveComplexMatrix( Matrix, RHS, Solution IMAG_VECTORS );
+ return;
+ }
+#endif
+
+#if REAL
+ Intermediate = Matrix->Intermediate;
+ Size = Matrix->Size;
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+ --RHS;
+ --Solution;
+#endif
+
+ /* Initialize Intermediate vector. */
+ pExtOrder = &Matrix->IntToExtRowMap[Size];
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I] = RHS[*(pExtOrder--)];
+ }
+
+ /* Forward elimination. Solves Lc = b.*/
+ for (I = 1; I <= Size; I++)
+ {
+
+ /* This step of the elimination is skipped if Temp equals zero. */
+ if ((Temp = Intermediate[I]) != 0.0)
+ {
+ pPivot = Matrix->Diag[I];
+ if ( pPivot != 0 && ELEMENT_MAG(pPivot) > Matrix->AbsThreshold )
+ {
+ /*jpc Intermediate[I] = (Temp *= pPivot->Real);*/
+ Intermediate[I] = (Temp /= pPivot->Real);
+
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ Intermediate[pElement->Row] -= Temp * pElement->Real;
+ pElement = pElement->NextInCol;
+ }
+ }
+ else
+ {
+ Intermediate[I] = 0.0;
+ }
+ }
+ }
+
+ /* Backward Substitution. Solves Ux = c.*/
+ /* modification for singular matrix a diagonal element can be a null pointer */
+
+ for (I = Size ; I > 0; I--)
+ {
+ Temp = Intermediate[I];
+ if ( Matrix->Diag[I] == 0) /* test for nul pointer */
+ {
+ Intermediate[I] = 0.0;
+ }
+ else
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ Temp -= pElement->Real * Intermediate[pElement->Col];
+ pElement = pElement->NextInRow;
+ }
+ Intermediate[I] = Temp;
+ }
+ }
+
+ /* Unscramble Intermediate vector while placing data in to Solution vector. */
+ pExtOrder = &Matrix->IntToExtColMap[Size];
+ for (I = Size; I > 0; I--)
+ {
+ Solution[*(pExtOrder--)] = Intermediate[I];
+ }
+
+ return;
+#endif /* REAL */
+}
+
+
+
+
+
+
+
+
+
+
+
+#if spCOMPLEX
+/*
+ * SOLVE COMPLEX MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and factored matrix. This
+ * routine assumes that the pivots are associated with the lower
+ * triangular (L) matrix and that the diagonal of the upper triangular
+ * (U) matrix consists of ones. This routine arranges the computation
+ * in different way than is traditionally used in order to exploit the
+ * sparsity of the right-hand side. See the reference in spRevision.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * RHS is the real portion of the input data array, the right hand
+ * side. This data is undisturbed and may be reused for other solves.
+ * Solution <output> (RealVector)
+ * Solution is the real portion of the output data array. This routine
+ * is constructed such that RHS and Solution can be the same
+ * array.
+ * iRHS <input> (RealVector)
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * If spSEPARATED_COMPLEX_VECTOR is set false, there is no need to
+ * supply this array.
+ * iSolution <output> (RealVector)
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. If spSEPARATED_COMPLEX_VECTOR is set false, there is no
+ * need to supply this array.
+ *
+ * >>> Local variables:
+ * Intermediate (ComplexVector)
+ * Temporary storage for use in forward elimination and backward
+ * substitution. Commonly referred to as c, when the LU factorization
+ * equations are given as Ax = b, Lc = b, Ux = c.
+ * Local version of Matrix->Intermediate, which was created during
+ * the initial factorization in function CreateInternalVectors() in the
+ * matrix factorization module.
+ * pElement (ElementPtr)
+ * Pointer used to address elements in both the lower and upper triangle
+ * matrices.
+ * pExtOrder (int *)
+ * Pointer used to sequentially access each entry in IntToExtRowMap
+ * and IntToExtColMap arrays. Used to quickly scramble and unscramble
+ * RHS and Solution to account for row and column interchanges.
+ * pPivot (ElementPtr)
+ * Pointer that points to current pivot or diagonal element.
+ * Size (int)
+ * Size of matrix. Made local to reduce indirection.
+ * Temp (ComplexNumber)
+ * Temporary storage for entries in arrays.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+static void
+SolveComplexMatrix( MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register ComplexVector Intermediate;
+ register int I, *pExtOrder, Size;
+ ElementPtr pPivot;
+ register ComplexVector ExtVector;
+ ComplexNumber Temp;
+
+ /* Begin `SolveComplexMatrix'. */
+
+ Size = Matrix->Size;
+ Intermediate = (ComplexVector)Matrix->Intermediate;
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spSEPARATED_COMPLEX_VECTORS
+ --RHS;
+ --iRHS;
+ --Solution;
+ --iSolution;
+#else
+ RHS -= 2;
+ Solution -= 2;
+#endif
+#endif
+
+ /* Initialize Intermediate vector. */
+ pExtOrder = &Matrix->IntToExtRowMap[Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I].Real = RHS[*(pExtOrder)];
+ Intermediate[I].Imag = iRHS[*(pExtOrder--)];
+ }
+#else
+ ExtVector = (ComplexVector)RHS;
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I] = ExtVector[*(pExtOrder--)];
+ }
+#endif
+
+ /* Forward substitution. Solves Lc = b.*/
+ for (I = 1; I <= Size; I++)
+ {
+ Temp = Intermediate[I];
+
+ /* This step of the substitution is skipped if Temp equals zero. */
+ if ((Temp.Real != 0.0) OR (Temp.Imag != 0.0))
+ {
+ pPivot = Matrix->Diag[I];
+ /* Cmplx expr: Temp *= (1.0 / Pivot). */
+ CMPLX_MULT_ASSIGN(Temp, *pPivot);
+ Intermediate[I] = Temp;
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: Intermediate[Element->Row] -= Temp * *Element. */
+ CMPLX_MULT_SUBT_ASSIGN(Intermediate[pElement->Row],
+ Temp, *pElement);
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+
+ /* Backward Substitution. Solves Ux = c.*/
+ for (I = Size; I > 0; I--)
+ {
+ Temp = Intermediate[I];
+ pElement = Matrix->Diag[I]->NextInRow;
+
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: Temp -= *Element * Intermediate[Element->Col]. */
+ CMPLX_MULT_SUBT_ASSIGN(Temp, *pElement, Intermediate[pElement->Col]);
+ pElement = pElement->NextInRow;
+ }
+ Intermediate[I] = Temp;
+ }
+
+ /* Unscramble Intermediate vector while placing data in to Solution vector. */
+ pExtOrder = &Matrix->IntToExtColMap[Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Size; I > 0; I--)
+ {
+ Solution[*(pExtOrder)] = Intermediate[I].Real;
+ iSolution[*(pExtOrder--)] = Intermediate[I].Imag;
+ }
+#else
+ ExtVector = (ComplexVector)Solution;
+ for (I = Size; I > 0; I--)
+ {
+ ExtVector[*(pExtOrder--)] = Intermediate[I];
+ }
+#endif
+
+ return;
+}
+#endif /* spCOMPLEX */
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#if TRANSPOSE
+/*
+ * SOLVE TRANSPOSED MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and transposed factored
+ * matrix. This routine is useful when performing sensitivity analysis
+ * on a circuit using the adjoint method. This routine assumes that
+ * the pivots are associated with the untransposed lower triangular
+ * (L) matrix and that the diagonal of the untransposed upper
+ * triangular (U) matrix consists of ones.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * RHS is the input data array, the right hand side. This data is
+ * undisturbed and may be reused for other solves.
+ * Solution <output> (RealVector)
+ * Solution is the output data array. This routine is constructed such that
+ * RHS and Solution can be the same array.
+ * iRHS <input> (RealVector)
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * If spSEPARATED_COMPLEX_VECTOR is set false, or if matrix is real, there
+ * is no need to supply this array.
+ * iSolution <output> (RealVector)
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. If spSEPARATED_COMPLEX_VECTOR is set false, or if
+ * matrix is real, there is no need to supply this array.
+ *
+ * >>> Local variables:
+ * Intermediate (RealVector)
+ * Temporary storage for use in forward elimination and backward
+ * substitution. Commonly referred to as c, when the LU factorization
+ * equations are given as Ax = b, Lc = b, Ux = c. Local version of
+ * Matrix->Intermediate, which was created during the initial
+ * factorization in function CreateInternalVectors() in the matrix
+ * factorization module.
+ * pElement (ElementPtr)
+ * Pointer used to address elements in both the lower and upper triangle
+ * matrices.
+ * pExtOrder (int *)
+ * Pointer used to sequentially access each entry in IntToExtRowMap
+ * and IntToExtRowMap arrays. Used to quickly scramble and unscramble
+ * RHS and Solution to account for row and column interchanges.
+ * pPivot (ElementPtr)
+ * Pointer that points to current pivot or diagonal element.
+ * Size (int)
+ * Size of matrix. Made local to reduce indirection.
+ * Temp (RealNumber)
+ * Temporary storage for entries in arrays.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+/*VARARGS3*/
+
+void
+spSolveTransposed( char *eMatrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register RealVector Intermediate;
+ register int I, *pExtOrder, Size;
+ ElementPtr pPivot;
+ RealNumber Temp;
+
+
+ /* Begin `spSolveTransposed'. */
+ ASSERT( IS_VALID(Matrix) AND IS_FACTORED(Matrix) );
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ SolveComplexTransposedMatrix( Matrix, RHS, Solution IMAG_VECTORS );
+ return;
+ }
+#endif
+
+#if REAL
+ Size = Matrix->Size;
+ Intermediate = Matrix->Intermediate;
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+ --RHS;
+ --Solution;
+#endif
+
+ /* Initialize Intermediate vector. */
+ pExtOrder = &Matrix->IntToExtColMap[Size];
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I] = RHS[*(pExtOrder--)];
+ }
+
+ /* Forward elimination. */
+ for (I = 1; I <= Size; I++)
+ {
+ /* This step of the elimination is skipped if Temp equals zero. */
+ if ((Temp = Intermediate[I]) != 0.0)
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ Intermediate[pElement->Col] -= Temp * pElement->Real;
+ pElement = pElement->NextInRow;
+ }
+
+ }
+ }
+
+ /* Backward Substitution. */
+ for (I = Size; I > 0; I--)
+ {
+ pPivot = Matrix->Diag[I];
+ Temp = Intermediate[I];
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ Temp -= pElement->Real * Intermediate[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+ Intermediate[I] = Temp * pPivot->Real;
+ }
+
+ /* Unscramble Intermediate vector while placing data in to Solution vector. */
+ pExtOrder = &Matrix->IntToExtRowMap[Size];
+ for (I = Size; I > 0; I--)
+ {
+ Solution[*(pExtOrder--)] = Intermediate[I];
+ }
+
+ return;
+#endif /* REAL */
+}
+#endif /* TRANSPOSE */
+
+
+
+
+
+
+
+
+
+
+#if TRANSPOSE AND spCOMPLEX
+/*
+ * SOLVE COMPLEX TRANSPOSED MATRIX EQUATION
+ *
+ * Performs forward elimination and back substitution to find the
+ * unknown vector from the RHS vector and transposed factored
+ * matrix. This routine is useful when performing sensitivity analysis
+ * on a circuit using the adjoint method. This routine assumes that
+ * the pivots are associated with the untransposed lower triangular
+ * (L) matrix and that the diagonal of the untransposed upper
+ * triangular (U) matrix consists of ones.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to matrix.
+ * RHS <input> (RealVector)
+ * RHS is the input data array, the right hand
+ * side. This data is undisturbed and may be reused for other solves.
+ * This vector is only the real portion if the matrix is complex and
+ * spSEPARATED_COMPLEX_VECTORS is set true.
+ * Solution <output> (RealVector)
+ * Solution is the real portion of the output data array. This routine
+ * is constructed such that RHS and Solution can be the same array.
+ * This vector is only the real portion if the matrix is complex and
+ * spSEPARATED_COMPLEX_VECTORS is set true.
+ * iRHS <input> (RealVector)
+ * iRHS is the imaginary portion of the input data array, the right
+ * hand side. This data is undisturbed and may be reused for other solves.
+ * If either spCOMPLEX or spSEPARATED_COMPLEX_VECTOR is set false, there
+ * is no need to supply this array.
+ * iSolution <output> (RealVector)
+ * iSolution is the imaginary portion of the output data array. This
+ * routine is constructed such that iRHS and iSolution can be
+ * the same array. If spCOMPLEX or spSEPARATED_COMPLEX_VECTOR is set
+ * false, there is no need to supply this array.
+ *
+ * >>> Local variables:
+ * Intermediate (ComplexVector)
+ * Temporary storage for use in forward elimination and backward
+ * substitution. Commonly referred to as c, when the LU factorization
+ * equations are given as Ax = b, Lc = b, Ux = c. Local version of
+ * Matrix->Intermediate, which was created during
+ * the initial factorization in function CreateInternalVectors() in the
+ * matrix factorization module.
+ * pElement (ElementPtr)
+ * Pointer used to address elements in both the lower and upper triangle
+ * matrices.
+ * pExtOrder (int *)
+ * Pointer used to sequentially access each entry in IntToExtRowMap
+ * and IntToExtColMap arrays. Used to quickly scramble and unscramble
+ * RHS and Solution to account for row and column interchanges.
+ * pPivot (ElementPtr)
+ * Pointer that points to current pivot or diagonal element.
+ * Size (int)
+ * Size of matrix. Made local to reduce indirection.
+ * Temp (ComplexNumber)
+ * Temporary storage for entries in arrays.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+static void
+SolveComplexTransposedMatrix(MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register ComplexVector Intermediate;
+ register int I, *pExtOrder, Size;
+ register ComplexVector ExtVector;
+ ElementPtr pPivot;
+ ComplexNumber Temp;
+
+ /* Begin `SolveComplexTransposedMatrix'. */
+
+ Size = Matrix->Size;
+ Intermediate = (ComplexVector)Matrix->Intermediate;
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spSEPARATED_COMPLEX_VECTORS
+ --RHS;
+ --iRHS;
+ --Solution;
+ --iSolution;
+#else
+ RHS -= 2;
+ Solution -= 2;
+#endif
+#endif
+
+ /* Initialize Intermediate vector. */
+ pExtOrder = &Matrix->IntToExtColMap[Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I].Real = RHS[*(pExtOrder)];
+ Intermediate[I].Imag = iRHS[*(pExtOrder--)];
+ }
+#else
+ ExtVector = (ComplexVector)RHS;
+ for (I = Size; I > 0; I--)
+ {
+ Intermediate[I] = ExtVector[*(pExtOrder--)];
+ }
+#endif
+
+ /* Forward elimination. */
+ for (I = 1; I <= Size; I++)
+ {
+ Temp = Intermediate[I];
+
+ /* This step of the elimination is skipped if Temp equals zero. */
+ if ((Temp.Real != 0.0) OR (Temp.Imag != 0.0))
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: Intermediate[Element->Col] -= Temp * *Element. */
+ CMPLX_MULT_SUBT_ASSIGN( Intermediate[pElement->Col],
+ Temp, *pElement);
+ pElement = pElement->NextInRow;
+ }
+ }
+ }
+
+ /* Backward Substitution. */
+ for (I = Size; I > 0; I--)
+ {
+ pPivot = Matrix->Diag[I];
+ Temp = Intermediate[I];
+ pElement = pPivot->NextInCol;
+
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: Temp -= Intermediate[Element->Row] * *Element. */
+ CMPLX_MULT_SUBT_ASSIGN(Temp, Intermediate[pElement->Row], *pElement);
+
+ pElement = pElement->NextInCol;
+ }
+ /* Cmplx expr: Intermediate = Temp * (1.0 / *pPivot). */
+ CMPLX_MULT(Intermediate[I], Temp, *pPivot);
+ }
+
+ /* Unscramble Intermediate vector while placing data in to Solution vector. */
+ pExtOrder = &Matrix->IntToExtRowMap[Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Size; I > 0; I--)
+ {
+ Solution[*(pExtOrder)] = Intermediate[I].Real;
+ iSolution[*(pExtOrder--)] = Intermediate[I].Imag;
+ }
+#else
+ ExtVector = (ComplexVector)Solution;
+ for (I = Size; I > 0; I--)
+ {
+ ExtVector[*(pExtOrder--)] = Intermediate[I];
+ }
+#endif
+
+ return;
+}
+#endif /* TRANSPOSE AND spCOMPLEX */
diff --git a/modules/sparse/src/c/spUtils.c b/modules/sparse/src/c/spUtils.c
new file mode 100755
index 000000000..5aab45e05
--- /dev/null
+++ b/modules/sparse/src/c/spUtils.c
@@ -0,0 +1,2344 @@
+/*
+ * MATRIX UTILITY MODULE
+ *
+ * Author: Advising professor:
+ * Kenneth S. Kundert Alberto Sangiovanni-Vincentelli
+ * UC Berkeley
+ *
+ * This file contains various optional utility routines.
+ *
+ * >>> User accessible functions contained in this file:
+ * spMNA_Preorder
+ * spScale
+ * spMultiply
+ * spMultTransposed
+ * spDeterminant
+ * spStrip
+ * spDeleteRowAndCol
+ * spPseudoCondition
+ * spCondition
+ * spNorm
+ * spLargestElement
+ * spRoundoff
+ *
+ * >>> Other functions contained in this file:
+ * CountTwins
+ * SwapCols
+ * ScaleComplexMatrix
+ * ComplexMatrixMultiply
+ * ComplexCondition
+ */
+
+
+/*
+ * Revision and copyright information.
+ *
+ * Copyright (c) 1985,86,87,88
+ * by Kenneth S. Kundert and the University of California.
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted,
+ * provided that the copyright notices appear in all copies and
+ * supporting documentation and that the authors and the University of
+ * California are properly credited. The authors and the University of
+ * California make no representations as to the suitability of this
+ * software for any purpose. It is provided `as is', without express
+ * or implied warranty.
+ */
+
+
+/*
+ * IMPORTS
+ *
+ * >>> Import descriptions:
+ * spConfig.h
+ * Macros that customize the sparse matrix routines.
+ * spmatrix.h
+ * Macros and declarations to be imported by the user.
+ * spDefs.h
+ * Matrix type and macro definitions for the sparse matrix routines.
+ */
+
+#define spINSIDE_SPARSE
+
+
+#include "spConfig.h"
+#include "spUtils.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spmalloc.h"
+#include "spBuild.h"
+
+static int CountTwins(MatrixPtr Matrix, int Col, ElementPtr *ppTwin1, ElementPtr *ppTwin2 );
+
+
+static int SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 );
+
+#if spCOMPLEX AND SCALING
+static void ScaleComplexMatrix( MatrixPtr Matrix, register RealVector RHS_ScaleFactors, register RealVector SolutionScaleFactors );
+#endif
+
+#if spCOMPLEX AND MULTIPLICATION
+static void ComplexMatrixMultiply( MatrixPtr Matrix, RealVector RHS , RealVector Solution IMAG_VECTORS );
+#endif
+
+#if spCOMPLEX AND MULTIPLICATION AND TRANSPOSE
+static void
+ComplexTransposedMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS );
+#endif
+
+#if spCOMPLEX
+static RealNumber ComplexCondition( MatrixPtr Matrix, RealNumber NormOfMatrix, int *pError );
+#endif
+
+#if MODIFIED_NODAL
+/*
+ * PREORDER MODIFIED NODE ADMITTANCE MATRIX TO REMOVE ZEROS FROM DIAGONAL
+ *
+ * This routine massages modified node admittance matrices to remove
+ * zeros from the diagonal. It takes advantage of the fact that the
+ * row and column associated with a zero diagonal usually have
+ * structural ones placed symmetricly. This routine should be used
+ * only on modified node admittance matrices and should be executed
+ * after the matrix has been built but before the factorization
+ * begins. It should be executed for the initial factorization only
+ * and should be executed before the rows have been linked. Thus it
+ * should be run before using spScale(), spMultiply(),
+ * spDeleteRowAndCol(), or spNorm().
+ *
+ * This routine exploits the fact that the structural ones are placed
+ * in the matrix in symmetric twins. For example, the stamps for
+ * grounded and a floating voltage sources are
+ * grounded: floating:
+ * [ x x 1 ] [ x x 1 ]
+ * [ x x ] [ x x -1 ]
+ * [ 1 ] [ 1 -1 ]
+ * Notice for the grounded source, there is one set of twins, and for
+ * the floating, there are two sets. We remove the zero from the diagonal
+ * by swapping the rows associated with a set of twins. For example:
+ * grounded: floating 1: floating 2:
+ * [ 1 ] [ 1 -1 ] [ x x 1 ]
+ * [ x x ] [ x x -1 ] [ 1 -1 ]
+ * [ x x 1 ] [ x x 1 ] [ x x -1 ]
+ *
+ * It is important to deal with any zero diagonals that only have one
+ * set of twins before dealing with those that have more than one because
+ * swapping row destroys the symmetry of any twins in the rows being
+ * swapped, which may limit future moves. Consider
+ * [ x x 1 ]
+ * [ x x -1 1 ]
+ * [ 1 -1 ]
+ * [ 1 ]
+ * There is one set of twins for diagonal 4 and two for diagonal 3.
+ * Dealing with diagonal 4 first requires swapping rows 2 and 4.
+ * [ x x 1 ]
+ * [ 1 ]
+ * [ 1 -1 ]
+ * [ x x -1 1 ]
+ * We can now deal with diagonal 3 by swapping rows 1 and 3.
+ * [ 1 -1 ]
+ * [ 1 ]
+ * [ x x 1 ]
+ * [ x x -1 1 ]
+ * And we are done, there are no zeros left on the diagonal. However, if
+ * we originally dealt with diagonal 3 first, we could swap rows 2 and 3
+ * [ x x 1 ]
+ * [ 1 -1 ]
+ * [ x x -1 1 ]
+ * [ 1 ]
+ * Diagonal 4 no longer has a symmetric twin and we cannot continue.
+ *
+ * So we always take care of lone twins first. When none remain, we
+ * choose arbitrarily a set of twins for a diagonal with more than one set
+ * and swap the rows corresponding to that twin. We then deal with any
+ * lone twins that were created and repeat the procedure until no
+ * zero diagonals with symmetric twins remain.
+ *
+ * In this particular implementation, columns are swapped rather than rows.
+ * The algorithm used in this function was developed by Ken Kundert and
+ * Tom Quarles.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix to be preordered.
+ *
+ * >>> Local variables;
+ * J (int)
+ * Column with zero diagonal being currently considered.
+ * pTwin1 (ElementPtr)
+ * Pointer to the twin found in the column belonging to the zero diagonal.
+ * pTwin2 (ElementPtr)
+ * Pointer to the twin found in the row belonging to the zero diagonal.
+ * belonging to the zero diagonal.
+ * AnotherPassNeeded (SPBOOLEAN)
+ * Flag indicating that at least one zero diagonal with symmetric twins
+ * remain.
+ * StartAt (int)
+ * Column number of first zero diagonal with symmetric twins.
+ * Swapped (SPBOOLEAN)
+ * Flag indicating that columns were swapped on this pass.
+ * Twins (int)
+ * Number of symmetric twins corresponding to current zero diagonal.
+ */
+#undef SPBOOLEAN
+#define SPBOOLEAN int
+
+void spMNA_Preorder( char * eMatrix )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int J, Size;
+ ElementPtr pTwin1, pTwin2;
+ int Twins, StartAt = 1;
+ SPBOOLEAN Swapped, AnotherPassNeeded;
+
+ /* Begin `spMNA_Preorder'. */
+ ASSERT( IS_VALID(Matrix) AND NOT Matrix->Factored );
+
+ if (Matrix->RowsLinked)
+ {
+ return;
+ }
+ Size = Matrix->Size;
+ Matrix->Reordered = YES;
+
+ do
+ {
+ AnotherPassNeeded = Swapped = NO;
+
+ /* Search for zero diagonals with lone twins. */
+ for (J = StartAt; J <= Size; J++)
+ {
+ if (Matrix->Diag[J] == NULL)
+ {
+ Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 );
+ if (Twins == 1)
+ {
+ /* Lone twins found, swap rows. */
+ SwapCols( Matrix, pTwin1, pTwin2 );
+ Swapped = YES;
+ }
+ else if ((Twins > 1) AND NOT AnotherPassNeeded)
+ {
+ AnotherPassNeeded = YES;
+ StartAt = J;
+ }
+ }
+ }
+
+ /* All lone twins are gone, look for zero diagonals with multiple twins. */
+ if (AnotherPassNeeded)
+ {
+ for (J = StartAt; NOT Swapped AND (J <= Size); J++)
+ {
+ if (Matrix->Diag[J] == NULL)
+ {
+ Twins = CountTwins( Matrix, J, &pTwin1, &pTwin2 );
+ SwapCols( Matrix, pTwin1, pTwin2 );
+ Swapped = YES;
+ }
+ }
+ }
+ }
+ while (AnotherPassNeeded);
+ return;
+}
+
+
+
+
+/*
+ * COUNT TWINS
+ *
+ * This function counts the number of symmetric twins associated with
+ * a zero diagonal and returns one set of twins if any exist. The
+ * count is terminated early at two.
+ */
+
+static int
+CountTwins( MatrixPtr Matrix, int Col, ElementPtr *ppTwin1, ElementPtr *ppTwin2 )
+{
+ int Row, Twins = 0;
+ ElementPtr pTwin1, pTwin2;
+
+ /* Begin `CountTwins'. */
+
+ pTwin1 = Matrix->FirstInCol[Col];
+ while (pTwin1 != NULL)
+ {
+ if (Abs(pTwin1->Real) == 1.0)
+ {
+ Row = pTwin1->Row;
+ pTwin2 = Matrix->FirstInCol[Row];
+ while ((pTwin2 != NULL) AND (pTwin2->Row != Col))
+ {
+ pTwin2 = pTwin2->NextInCol;
+ }
+ if ((pTwin2 != NULL) AND (Abs(pTwin2->Real) == 1.0))
+ {
+ /* Found symmetric twins. */
+ if (++Twins >= 2)
+ {
+ return Twins;
+ }
+ (*ppTwin1 = pTwin1)->Col = Col;
+ (*ppTwin2 = pTwin2)->Col = Row;
+ }
+ }
+ pTwin1 = pTwin1->NextInCol;
+ }
+ return Twins;
+}
+
+
+
+
+/*
+ * SWAP COLUMNS
+ *
+ * This function swaps two columns and is applicable before the rows are
+ * linked.
+ */
+
+static int
+SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 )
+{
+ int Col1 = pTwin1->Col, Col2 = pTwin2->Col;
+
+ /* Begin `SwapCols'. */
+
+ SWAP (ElementPtr, Matrix->FirstInCol[Col1], Matrix->FirstInCol[Col2]);
+ SWAP (int, Matrix->IntToExtColMap[Col1], Matrix->IntToExtColMap[Col2]);
+#if TRANSLATE
+ Matrix->ExtToIntColMap[Matrix->IntToExtColMap[Col2]] = Col2;
+ Matrix->ExtToIntColMap[Matrix->IntToExtColMap[Col1]] = Col1;
+#endif
+
+ Matrix->Diag[Col1] = pTwin2;
+ Matrix->Diag[Col2] = pTwin1;
+ Matrix->NumberOfInterchangesIsOdd = NOT Matrix->NumberOfInterchangesIsOdd;
+ return 0;
+}
+#endif /* MODIFIED_NODAL */
+
+#if SCALING
+/*
+ * SCALE MATRIX
+ *
+ * This function scales the matrix to enhance the possibility of
+ * finding a good pivoting order. Note that scaling enhances accuracy
+ * of the solution only if it affects the pivoting order, so it makes
+ * no sense to scale the matrix before spFactor(). If scaling is
+ * desired it should be done before spOrderAndFactor(). There
+ * are several things to take into account when choosing the scale
+ * factors. First, the scale factors are directly multiplied against
+ * the elements in the matrix. To prevent roundoff, each scale factor
+ * should be equal to an int power of the number base of the
+ * machine. Since most machines operate in base two, scale factors
+ * should be a power of two. Second, the matrix should be scaled such
+ * that the matrix of element uncertainties is equilibrated. Third,
+ * this function multiplies the scale factors by the elements, so if
+ * one row tends to have uncertainties 1000 times smaller than the
+ * other rows, then its scale factor should be 1024, not 1/1024.
+ * Fourth, to save time, this function does not scale rows or columns
+ * if their scale factors are equal to one. Thus, the scale factors
+ * should be normalized to the most common scale factor. Rows and
+ * columns should be normalized separately. For example, if the size
+ * of the matrix is 100 and 10 rows tend to have uncertainties near
+ * 1e-6 and the remaining 90 have uncertainties near 1e-12, then the
+ * scale factor for the 10 should be 1/1,048,576 and the scale factors
+ * for the remaining 90 should be 1. Fifth, since this routine
+ * directly operates on the matrix, it is necessary to apply the scale
+ * factors to the RHS and Solution vectors. It may be easier to
+ * simply use spOrderAndFactor() on a scaled matrix to choose the
+ * pivoting order, and then throw away the matrix. Subsequent
+ * factorizations, performed with spFactor(), will not need to have
+ * the RHS and Solution vectors descaled. Lastly, this function
+ * should not be executed before the function spMNA_Preorder.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix to be scaled.
+ * SolutionScaleFactors <input> (RealVector)
+ * The array of Solution scale factors. These factors scale the columns.
+ * All scale factors are real valued.
+ * RHS_ScaleFactors <input> (RealVector)
+ * The array of RHS scale factors. These factors scale the rows.
+ * All scale factors are real valued.
+ *
+ * >>> Local variables:
+ * lSize (int)
+ * Local version of the size of the matrix.
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * pExtOrder (int *)
+ * Pointer into either IntToExtRowMap or IntToExtColMap vector. Used to
+ * compensate for any row or column swaps that have been performed.
+ * ScaleFactor (RealNumber)
+ * The scale factor being used on the current row or column.
+ */
+
+
+
+
+void spScale(char *eMatrix, register RealVector RHS_ScaleFactors, register RealVector SolutionScaleFactors )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register int I, lSize, *pExtOrder;
+ RealNumber ScaleFactor;
+
+
+ /* Begin `spScale'. */
+ ASSERT( IS_VALID(Matrix) AND NOT Matrix->Factored );
+ if (NOT Matrix->RowsLinked)
+ {
+ spcLinkRows( Matrix );
+ }
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ ScaleComplexMatrix( Matrix, RHS_ScaleFactors, SolutionScaleFactors );
+ return;
+ }
+#endif
+
+#if REAL
+ lSize = Matrix->Size;
+
+ /* Correct pointers to arrays for ARRAY_OFFSET */
+#if NOT ARRAY_OFFSET
+ --RHS_ScaleFactors;
+ --SolutionScaleFactors;
+#endif
+
+ /* Scale Rows */
+ pExtOrder = &Matrix->IntToExtRowMap[1];
+ for (I = 1; I <= lSize; I++)
+ {
+ if ((ScaleFactor = RHS_ScaleFactors[*(pExtOrder++)]) != 1.0)
+ {
+ pElement = Matrix->FirstInRow[I];
+
+ while (pElement != NULL)
+ {
+ pElement->Real *= ScaleFactor;
+ pElement = pElement->NextInRow;
+ }
+ }
+ }
+
+ /* Scale Columns */
+ pExtOrder = &Matrix->IntToExtColMap[1];
+ for (I = 1; I <= lSize; I++)
+ {
+ if ((ScaleFactor = SolutionScaleFactors[*(pExtOrder++)]) != 1.0)
+ {
+ pElement = Matrix->FirstInCol[I];
+
+ while (pElement != NULL)
+ {
+ pElement->Real *= ScaleFactor;
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+ return;
+
+#endif /* REAL */
+}
+#endif /* SCALING */
+
+#if spCOMPLEX AND SCALING
+/*
+ * SCALE COMPLEX MATRIX
+ *
+ * This function scales the matrix to enhance the possibility of
+ * finding a good pivoting order. Note that scaling enhances accuracy
+ * of the solution only if it affects the pivoting order, so it makes
+ * no sense to scale the matrix before spFactor(). If scaling is
+ * desired it should be done before spOrderAndFactor(). There
+ * are several things to take into account when choosing the scale
+ * factors. First, the scale factors are directly multiplied against
+ * the elements in the matrix. To prevent roundoff, each scale factor
+ * should be equal to an int power of the number base of the
+ * machine. Since most machines operate in base two, scale factors
+ * should be a power of two. Second, the matrix should be scaled such
+ * that the matrix of element uncertainties is equilibrated. Third,
+ * this function multiplies the scale factors by the elements, so if
+ * one row tends to have uncertainties 1000 times smaller than the
+ * other rows, then its scale factor should be 1024, not 1/1024.
+ * Fourth, to save time, this function does not scale rows or columns
+ * if their scale factors are equal to one. Thus, the scale factors
+ * should be normalized to the most common scale factor. Rows and
+ * columns should be normalized separately. For example, if the size
+ * of the matrix is 100 and 10 rows tend to have uncertainties near
+ * 1e-6 and the remaining 90 have uncertainties near 1e-12, then the
+ * scale factor for the 10 should be 1/1,048,576 and the scale factors
+ * for the remaining 90 should be 1. Fifth, since this routine
+ * directly operates on the matrix, it is necessary to apply the scale
+ * factors to the RHS and Solution vectors. It may be easier to
+ * simply use spOrderAndFactor() on a scaled matrix to choose the
+ * pivoting order, and then throw away the matrix. Subsequent
+ * factorizations, performed with spFactor(), will not need to have
+ * the RHS and Solution vectors descaled. Lastly, this function
+ * should not be executed before the function spMNA_Preorder.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix to be scaled.
+ * SolutionScaleFactors <input> (RealVector)
+ * The array of Solution scale factors. These factors scale the columns.
+ * All scale factors are real valued.
+ * RHS_ScaleFactors <input> (RealVector)
+ * The array of RHS scale factors. These factors scale the rows.
+ * All scale factors are real valued.
+ *
+ * >>> Local variables:
+ * lSize (int)
+ * Local version of the size of the matrix.
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix.
+ * pExtOrder (int *)
+ * Pointer into either IntToExtRowMap or IntToExtColMap vector. Used to
+ * compensate for any row or column swaps that have been performed.
+ * ScaleFactor (RealNumber)
+ * The scale factor being used on the current row or column.
+ */
+
+static void
+ScaleComplexMatrix( MatrixPtr Matrix, register RealVector RHS_ScaleFactors, register RealVector SolutionScaleFactors )
+{
+ register ElementPtr pElement;
+ register int I, lSize, *pExtOrder;
+ RealNumber ScaleFactor;
+
+ /* Begin `ScaleComplexMatrix'. */
+ lSize = Matrix->Size;
+
+ /* Correct pointers to arrays for ARRAY_OFFSET */
+#if NOT ARRAY_OFFSET
+ --RHS_ScaleFactors;
+ --SolutionScaleFactors;
+#endif
+
+ /* Scale Rows */
+ pExtOrder = &Matrix->IntToExtRowMap[1];
+ for (I = 1; I <= lSize; I++)
+ {
+ if ((ScaleFactor = RHS_ScaleFactors[*(pExtOrder++)]) != 1.0)
+ {
+ pElement = Matrix->FirstInRow[I];
+
+ while (pElement != NULL)
+ {
+ pElement->Real *= ScaleFactor;
+ pElement->Imag *= ScaleFactor;
+ pElement = pElement->NextInRow;
+ }
+ }
+ }
+
+ /* Scale Columns */
+ pExtOrder = &Matrix->IntToExtColMap[1];
+ for (I = 1; I <= lSize; I++)
+ {
+ if ((ScaleFactor = SolutionScaleFactors[*(pExtOrder++)]) != 1.0)
+ {
+ pElement = Matrix->FirstInCol[I];
+
+ while (pElement != NULL)
+ {
+ pElement->Real *= ScaleFactor;
+ pElement->Imag *= ScaleFactor;
+ pElement = pElement->NextInCol;
+ }
+ }
+ }
+ return;
+}
+#endif /* SCALING AND spCOMPLEX */
+
+#if MULTIPLICATION
+/*
+ * MATRIX MULTIPLICATION
+ *
+ * Multiplies matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct. It should not be used
+ * before spMNA_Preorder().
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ * RHS <output> (RealVector)
+ * RHS is the right hand side. This is what is being solved for.
+ * Solution <input> (RealVector)
+ * Solution is the vector being multiplied by the matrix.
+ * iRHS <output> (RealVector)
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector)
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+void spMultiply(char *eMatrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register RealVector Vector;
+ register RealNumber Sum;
+ register int I, *pExtOrder;
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+
+ /* Begin `spMultiply'. */
+ ASSERT( IS_SPARSE( Matrix ) AND NOT Matrix->Factored );
+ if (NOT Matrix->RowsLinked)
+ {
+ spcLinkRows(Matrix);
+ }
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ ComplexMatrixMultiply( Matrix, RHS, Solution IMAG_VECTORS );
+ return;
+ }
+#endif
+
+#if REAL
+#if NOT ARRAY_OFFSET
+ /* Correct array pointers for ARRAY_OFFSET. */
+ --RHS;
+ --Solution;
+#endif
+
+ /* Initialize Intermediate vector with reordered Solution vector. */
+ Vector = Matrix->Intermediate;
+ pExtOrder = &Matrix->IntToExtColMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I] = Solution[*(pExtOrder--)];
+ }
+
+ pExtOrder = &Matrix->IntToExtRowMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInRow[I];
+ Sum = 0.0;
+
+ while (pElement != NULL)
+ {
+ Sum += pElement->Real * Vector[pElement->Col];
+ pElement = pElement->NextInRow;
+ }
+ RHS[*pExtOrder--] = Sum;
+ }
+ return;
+#endif /* REAL */
+}
+#endif /* MULTIPLICATION */
+
+#if spCOMPLEX AND MULTIPLICATION
+/*
+ * COMPLEX MATRIX MULTIPLICATION
+ *
+ * Multiplies matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix.
+ * RHS <output> (RealVector)
+ * RHS is the right hand side. This is what is being solved for.
+ * This is only the real portion of the right-hand side if the matrix
+ * is complex and spSEPARATED_COMPLEX_VECTORS is set true.
+ * Solution <input> (RealVector)
+ * Solution is the vector being multiplied by the matrix. This is only
+ * the real portion if the matrix is complex and
+ * spSEPARATED_COMPLEX_VECTORS is set true.
+ * iRHS <output> (RealVector)
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector)
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+static void
+ComplexMatrixMultiply( MatrixPtr Matrix, RealVector RHS , RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register ComplexVector Vector;
+ register ComplexNumber Sum;
+ register int I, *pExtOrder;
+
+ /* Begin `ComplexMatrixMultiply'. */
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spSEPARATED_COMPLEX_VECTORS
+ --RHS;
+ --iRHS;
+ --Solution;
+ --iSolution;
+#else
+ RHS -= 2;
+ Solution -= 2;
+#endif
+#endif
+
+ /* Initialize Intermediate vector with reordered Solution vector. */
+ Vector = (ComplexVector)Matrix->Intermediate;
+ pExtOrder = &Matrix->IntToExtColMap[Matrix->Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I].Real = Solution[*pExtOrder];
+ Vector[I].Imag = iSolution[*(pExtOrder--)];
+ }
+#else
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I] = ((ComplexVector)Solution)[*(pExtOrder--)];
+ }
+#endif
+
+ pExtOrder = &Matrix->IntToExtRowMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInRow[I];
+ Sum.Real = Sum.Imag = 0.0;
+
+ while (pElement != NULL)
+ {
+ /* Cmplx expression : Sum += Element * Vector[Col] */
+ CMPLX_MULT_ADD_ASSIGN( Sum, *pElement, Vector[pElement->Col] );
+ pElement = pElement->NextInRow;
+ }
+
+#if spSEPARATED_COMPLEX_VECTORS
+ RHS[*pExtOrder] = Sum.Real;
+ iRHS[*pExtOrder--] = Sum.Imag;
+#else
+ ((ComplexVector)RHS)[*pExtOrder--] = Sum;
+#endif
+ }
+ return;
+}
+#endif /* spCOMPLEX AND MULTIPLICATION */
+
+#if MULTIPLICATION AND TRANSPOSE
+/*
+ * TRANSPOSED MATRIX MULTIPLICATION
+ *
+ * Multiplies transposed matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct. It should not be used
+ * before spMNA_Preorder().
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ * RHS <output> (RealVector)
+ * RHS is the right hand side. This is what is being solved for.
+ * Solution <input> (RealVector)
+ * Solution is the vector being multiplied by the matrix.
+ * iRHS <output> (RealVector)
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector)
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+void spMultTransposed(char *eMatrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register RealVector Vector;
+ register RealNumber Sum;
+ register int I, *pExtOrder;
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+
+
+ /* Begin `spMultTransposed'. */
+ ASSERT( IS_SPARSE( Matrix ) AND NOT Matrix->Factored );
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ ComplexTransposedMatrixMultiply( Matrix, RHS, Solution IMAG_VECTORS );
+ return;
+ }
+#endif
+
+#if REAL
+#if NOT ARRAY_OFFSET
+ /* Correct array pointers for ARRAY_OFFSET. */
+ --RHS;
+ --Solution;
+#endif
+
+ /* Initialize Intermediate vector with reordered Solution vector. */
+ Vector = Matrix->Intermediate;
+ pExtOrder = &Matrix->IntToExtRowMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I] = Solution[*(pExtOrder--)];
+ }
+
+ pExtOrder = &Matrix->IntToExtColMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInCol[I];
+ Sum = 0.0;
+
+ while (pElement != NULL)
+ {
+ Sum += pElement->Real * Vector[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+ RHS[*pExtOrder--] = Sum;
+ }
+ return;
+#endif /* REAL */
+}
+#endif /* MULTIPLICATION AND TRANSPOSE */
+
+#if spCOMPLEX AND MULTIPLICATION AND TRANSPOSE
+/*
+ * COMPLEX TRANSPOSED MATRIX MULTIPLICATION
+ *
+ * Multiplies transposed matrix by solution vector to find source vector.
+ * Assumes matrix has not been factored. This routine can be used
+ * as a test to see if solutions are correct.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix.
+ * RHS <output> (RealVector)
+ * RHS is the right hand side. This is what is being solved for.
+ * This is only the real portion of the right-hand side if the matrix
+ * is complex and spSEPARATED_COMPLEX_VECTORS is set true.
+ * Solution <input> (RealVector)
+ * Solution is the vector being multiplied by the matrix. This is only
+ * the real portion if the matrix is complex and
+ * spSEPARATED_COMPLEX_VECTORS is set true.
+ * iRHS <output> (RealVector)
+ * iRHS is the imaginary portion of the right hand side. This is
+ * what is being solved for. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ * iSolution <input> (RealVector)
+ * iSolution is the imaginary portion of the vector being multiplied
+ * by the matrix. This is only necessary if the matrix is
+ * complex and spSEPARATED_COMPLEX_VECTORS is true.
+ *
+ * >>> Obscure Macros
+ * IMAG_VECTORS
+ * Replaces itself with `, iRHS, iSolution' if the options spCOMPLEX and
+ * spSEPARATED_COMPLEX_VECTORS are set, otherwise it disappears
+ * without a trace.
+ */
+
+static void
+ComplexTransposedMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution IMAG_VECTORS )
+{
+ register ElementPtr pElement;
+ register ComplexVector Vector;
+ register ComplexNumber Sum;
+ register int I, *pExtOrder;
+
+ /* Begin `ComplexMatrixMultiply'. */
+
+ /* Correct array pointers for ARRAY_OFFSET. */
+#if NOT ARRAY_OFFSET
+#if spSEPARATED_COMPLEX_VECTORS
+ --RHS;
+ --iRHS;
+ --Solution;
+ --iSolution;
+#else
+ RHS -= 2;
+ Solution -= 2;
+#endif
+#endif
+
+ /* Initialize Intermediate vector with reordered Solution vector. */
+ Vector = (ComplexVector)Matrix->Intermediate;
+ pExtOrder = &Matrix->IntToExtRowMap[Matrix->Size];
+
+#if spSEPARATED_COMPLEX_VECTORS
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I].Real = Solution[*pExtOrder];
+ Vector[I].Imag = iSolution[*(pExtOrder--)];
+ }
+#else
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ Vector[I] = ((ComplexVector)Solution)[*(pExtOrder--)];
+ }
+#endif
+
+ pExtOrder = &Matrix->IntToExtColMap[Matrix->Size];
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInCol[I];
+ Sum.Real = Sum.Imag = 0.0;
+
+ while (pElement != NULL)
+ {
+ /* Cmplx expression : Sum += Element * Vector[Row] */
+ CMPLX_MULT_ADD_ASSIGN( Sum, *pElement, Vector[pElement->Row] );
+ pElement = pElement->NextInCol;
+ }
+
+#if spSEPARATED_COMPLEX_VECTORS
+ RHS[*pExtOrder] = Sum.Real;
+ iRHS[*pExtOrder--] = Sum.Imag;
+#else
+ ((ComplexVector)RHS)[*pExtOrder--] = Sum;
+#endif
+ }
+ return;
+}
+#endif /* spCOMPLEX AND MULTIPLICATION AND TRANSPOSE */
+
+#if DETERMINANT
+/*
+ * CALCULATE DETERMINANT
+ *
+ * This routine in capable of calculating the determinant of the
+ * matrix once the LU factorization has been performed. Hence, only
+ * use this routine after spFactor() and before spClear().
+ * The determinant equals the product of all the diagonal elements of
+ * the lower triangular matrix L, except that this product may need
+ * negating. Whether the product or the negative product equals the
+ * determinant is determined by the number of row and column
+ * interchanges performed. Note that the determinants of matrices can
+ * be very large or very small. On large matrices, the determinant
+ * can be far larger or smaller than can be represented by a floating
+ * point number. For this reason the determinant is scaled to a
+ * reasonable value and the logarithm of the scale factor is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * A pointer to the matrix for which the determinant is desired.
+ * pExponent <output> (int *)
+ * The logarithm base 10 of the scale factor for the determinant. To find
+ * the actual determinant, Exponent should be added to the exponent of
+ * Determinant.
+ * pDeterminant <output> (RealNumber *)
+ * The real portion of the determinant. This number is scaled to be
+ * greater than or equal to 1.0 and less than 10.0.
+ * piDeterminant <output> (RealNumber *)
+ * The imaginary portion of the determinant. When the matrix is real
+ * this pointer need not be supplied, nothing will be returned. This
+ * number is scaled to be greater than or equal to 1.0 and less than 10.0.
+ *
+ * >>> Local variables:
+ * Norm (RealNumber)
+ * L-infinity norm of a complex number.
+ * Size (int)
+ * Local storage for Matrix->Size. Placed in a register for speed.
+ * Temp (RealNumber)
+ * Temporary storage for real portion of determinant.
+ */
+
+#if spCOMPLEX
+void
+spDeterminant( char *eMatrix, int *pExponent, register RealNumber *pDeterminant, RealNumber *piDeterminant )
+#else
+void
+spDeterminant( char *eMatrix, int *pExponent, register RealNumber *pDeterminant )
+#endif
+{
+ register MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int I, Size;
+ RealNumber Norm, nr, ni;
+ ComplexNumber Pivot, cDeterminant;
+
+#define NORM(a) (nr = Abs((a).Real), ni = Abs((a).Imag), Max(nr,ni))
+
+ /* Begin `spDeterminant'. */
+ ASSERT( IS_SPARSE( Matrix ) AND IS_FACTORED(Matrix) );
+ *pExponent = 0;
+
+ if (Matrix->Error == spSINGULAR)
+ {
+ *pDeterminant = 0.0;
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ *piDeterminant = 0.0;
+ }
+#endif
+ return;
+ }
+
+ Size = Matrix->Size;
+ I = 0;
+
+#if spCOMPLEX
+ if (Matrix->Complex) /* Complex Case. */
+ {
+ cDeterminant.Real = 1.0;
+ cDeterminant.Imag = 0.0;
+
+ while (++I <= Size)
+ {
+ CMPLX_RECIPROCAL( Pivot, *Matrix->Diag[I] );
+ CMPLX_MULT_ASSIGN( cDeterminant, Pivot );
+
+ /* Scale Determinant. */
+ Norm = NORM( cDeterminant );
+ if (Norm != 0.0)
+ {
+ while (Norm >= 1.0e12)
+ {
+ cDeterminant.Real *= 1.0e-12;
+ cDeterminant.Imag *= 1.0e-12;
+ *pExponent += 12;
+ Norm = NORM( cDeterminant );
+ }
+ while (Norm < 1.0e-12)
+ {
+ cDeterminant.Real *= 1.0e12;
+ cDeterminant.Imag *= 1.0e12;
+ *pExponent -= 12;
+ Norm = NORM( cDeterminant );
+ }
+ }
+ }
+
+ /* Scale Determinant again, this time to be between 1.0 <= x < 10.0. */
+ Norm = NORM( cDeterminant );
+ if (Norm != 0.0)
+ {
+ while (Norm >= 10.0)
+ {
+ cDeterminant.Real *= 0.1;
+ cDeterminant.Imag *= 0.1;
+ (*pExponent)++;
+ Norm = NORM( cDeterminant );
+ }
+ while (Norm < 1.0)
+ {
+ cDeterminant.Real *= 10.0;
+ cDeterminant.Imag *= 10.0;
+ (*pExponent)--;
+ Norm = NORM( cDeterminant );
+ }
+ }
+ if (Matrix->NumberOfInterchangesIsOdd)
+ {
+ CMPLX_NEGATE( cDeterminant );
+ }
+
+ *pDeterminant = cDeterminant.Real;
+ *piDeterminant = cDeterminant.Imag;
+ }
+#endif /* spCOMPLEX */
+#if REAL AND spCOMPLEX
+ else
+#endif
+#if REAL
+ {
+ /* Real Case. */
+ *pDeterminant = 1.0;
+
+ while (++I <= Size)
+ {
+ *pDeterminant /= Matrix->Diag[I]->Real;
+
+ /* Scale Determinant. */
+ if (*pDeterminant != 0.0)
+ {
+ while (Abs(*pDeterminant) >= 1.0e12)
+ {
+ *pDeterminant *= 1.0e-12;
+ *pExponent += 12;
+ }
+ while (Abs(*pDeterminant) < 1.0e-12)
+ {
+ *pDeterminant *= 1.0e12;
+ *pExponent -= 12;
+ }
+ }
+ }
+
+ /* Scale Determinant again, this time to be between 1.0 <= x < 10.0. */
+ if (*pDeterminant != 0.0)
+ {
+ while (Abs(*pDeterminant) >= 10.0)
+ {
+ *pDeterminant *= 0.1;
+ (*pExponent)++;
+ }
+ while (Abs(*pDeterminant) < 1.0)
+ {
+ *pDeterminant *= 10.0;
+ (*pExponent)--;
+ }
+ }
+ if (Matrix->NumberOfInterchangesIsOdd)
+ {
+ *pDeterminant = -*pDeterminant;
+ }
+ }
+#endif /* REAL */
+}
+#endif /* DETERMINANT */
+
+#if STRIP
+
+/*
+ * STRIP FILL-INS FROM MATRIX
+ *
+ * Strips the matrix of all fill-ins.
+ *
+ * >>> Arguments:
+ * Matrix <input> (char *)
+ * Pointer to the matrix to be stripped.
+ *
+ * >>> Local variables:
+ * pElement (ElementPtr)
+ * Pointer that is used to step through the matrix.
+ * ppElement (ElementPtr *)
+ * Pointer to the location of an ElementPtr. This location will be
+ * updated if a fill-in is stripped from the matrix.
+ * pFillin (ElementPtr)
+ * Pointer used to step through the lists of fill-ins while marking them.
+ * pLastFillin (ElementPtr)
+ * A pointer to the last fill-in in the list. Used to terminate a loop.
+ * pListNode (struct FillinListNodeStruct *)
+ * A pointer to a node in the FillinList linked-list.
+ */
+
+void spStripFills(char *eMatrix)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ struct FillinListNodeStruct *pListNode;
+
+ /* Begin `spStripFills'. */
+ ASSERT( IS_SPARSE( Matrix ) );
+ if (Matrix->Fillins == 0)
+ {
+ return;
+ }
+ Matrix->NeedsOrdering = YES;
+ Matrix->Elements -= Matrix->Fillins;
+ Matrix->Fillins = 0;
+
+ /* Mark the fill-ins. */
+ {
+ register ElementPtr pFillin, pLastFillin;
+
+ pListNode = Matrix->LastFillinListNode = Matrix->FirstFillinListNode;
+ Matrix->FillinsRemaining = pListNode->NumberOfFillinsInList;
+ Matrix->NextAvailFillin = pListNode->pFillinList;
+
+ while (pListNode != NULL)
+ {
+ pFillin = pListNode->pFillinList;
+ pLastFillin = &(pFillin[ pListNode->NumberOfFillinsInList - 1 ]);
+ while (pFillin <= pLastFillin)
+ {
+ (pFillin++)->Row = 0;
+ }
+ pListNode = pListNode->Next;
+ }
+ }
+
+ /* Unlink fill-ins by searching for elements marked with Row = 0. */
+ {
+ register ElementPtr pElement, *ppElement;
+ register int I, Size = Matrix->Size;
+
+ /* Unlink fill-ins in all columns. */
+ for (I = 1; I <= Size; I++)
+ {
+ ppElement = &(Matrix->FirstInCol[I]);
+ while ((pElement = *ppElement) != NULL)
+ {
+ if (pElement->Row == 0)
+ {
+ *ppElement = pElement->NextInCol; /* Unlink fill-in. */
+ if (Matrix->Diag[pElement->Col] == pElement)
+ {
+ Matrix->Diag[pElement->Col] = NULL;
+ }
+ }
+ else
+ {
+ ppElement = &pElement->NextInCol; /* Skip element. */
+ }
+ }
+ }
+
+ /* Unlink fill-ins in all rows. */
+ for (I = 1; I <= Size; I++)
+ {
+ ppElement = &(Matrix->FirstInRow[I]);
+ while ((pElement = *ppElement) != NULL)
+ {
+ if (pElement->Row == 0)
+ {
+ *ppElement = pElement->NextInRow; /* Unlink fill-in. */
+ }
+ else
+ {
+ ppElement = &pElement->NextInRow; /* Skip element. */
+ }
+ }
+ }
+ }
+ return;
+}
+#endif
+
+#if TRANSLATE AND DELETE
+/*
+ * DELETE A ROW AND COLUMN FROM THE MATRIX
+ *
+ * Deletes a row and a column from a matrix.
+ *
+ * Sparse will abort if an attempt is made to delete a row or column that
+ * doesn't exist.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix in which the row and column are to be deleted.
+ * Row <input> (int)
+ * Row to be deleted.
+ * Col <input> (int)
+ * Column to be deleted.
+ *
+ * >>> Local variables:
+ * ExtCol (int)
+ * The external column that is being deleted.
+ * ExtRow (int)
+ * The external row that is being deleted.
+ * pElement (ElementPtr)
+ * Pointer to an element in the matrix. Used when scanning rows and
+ * columns in order to eliminate elements from the last row or column.
+ * ppElement (ElementPtr *)
+ * Pointer to the location of an ElementPtr. This location will be
+ * filled with a NULL pointer if it is the new last element in its row
+ * or column.
+ * pElement (ElementPtr)
+ * Pointer to an element in the last row or column of the matrix.
+ * Size (int)
+ * The local version Matrix->Size, the size of the matrix.
+ */
+
+extern void spcRowExchange(MatrixPtr Matrix, int Row1, int Row2);
+extern void spcColExchange(MatrixPtr Matrix, int Col1, int Col2);
+
+void spDeleteRowAndCol( char *eMatrix, int Row, int Col )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement, *ppElement, pLastElement;
+ int Size, ExtRow, ExtCol;
+
+
+ /* Begin `spDeleteRowAndCol'. */
+
+ ASSERT( IS_SPARSE(Matrix) AND Row > 0 AND Col > 0 );
+ ASSERT( Row <= Matrix->ExtSize AND Col <= Matrix->ExtSize );
+
+ Size = Matrix->Size;
+ ExtRow = Row;
+ ExtCol = Col;
+ if (NOT Matrix->RowsLinked)
+ {
+ spcLinkRows( Matrix );
+ }
+
+ Row = Matrix->ExtToIntRowMap[Row];
+ Col = Matrix->ExtToIntColMap[Col];
+ ASSERT( Row > 0 AND Col > 0 );
+
+ /* Move Row so that it is the last row in the matrix. */
+ if (Row != Size)
+ {
+ spcRowExchange( Matrix, Row, Size );
+ }
+
+ /* Move Col so that it is the last column in the matrix. */
+ if (Col != Size)
+ {
+ spcColExchange( Matrix, Col, Size );
+ }
+
+ /* Correct Diag pointers. */
+ if (Row == Col)
+ SWAP( ElementPtr, Matrix->Diag[Row], Matrix->Diag[Size] )
+ else
+ {
+ Matrix->Diag[Row] = spcFindElementInCol( Matrix, Matrix->FirstInCol + Row,
+ Row, Row, NO );
+ Matrix->Diag[Col] = spcFindElementInCol( Matrix, Matrix->FirstInCol + Col,
+ Col, Col, NO );
+ }
+
+ /*
+ * Delete last row and column of the matrix.
+ */
+ /* Break the column links to every element in the last row. */
+ pLastElement = Matrix->FirstInRow[ Size ];
+ while (pLastElement != NULL)
+ {
+ ppElement = &(Matrix->FirstInCol[ pLastElement->Col ]);
+ while ((pElement = *ppElement) != NULL)
+ {
+ if (pElement == pLastElement)
+ {
+ *ppElement = NULL; /* Unlink last element in column. */
+ }
+ else
+ {
+ ppElement = &pElement->NextInCol; /* Skip element. */
+ }
+ }
+ pLastElement = pLastElement->NextInRow;
+ }
+
+ /* Break the row links to every element in the last column. */
+ pLastElement = Matrix->FirstInCol[ Size ];
+ while (pLastElement != NULL)
+ {
+ ppElement = &(Matrix->FirstInRow[ pLastElement->Row ]);
+ while ((pElement = *ppElement) != NULL)
+ {
+ if (pElement == pLastElement)
+ {
+ *ppElement = NULL; /* Unlink last element in row. */
+ }
+ else
+ {
+ ppElement = &pElement->NextInRow; /* Skip element. */
+ }
+ }
+ pLastElement = pLastElement->NextInCol;
+ }
+
+ /* Clean up some details. */
+ Matrix->Size = Size - 1;
+ Matrix->Diag[Size] = NULL;
+ Matrix->FirstInRow[Size] = NULL;
+ Matrix->FirstInCol[Size] = NULL;
+ Matrix->CurrentSize--;
+ Matrix->ExtToIntRowMap[ExtRow] = -1;
+ Matrix->ExtToIntColMap[ExtCol] = -1;
+ Matrix->NeedsOrdering = YES;
+
+ return;
+}
+#endif
+
+#if PSEUDOCONDITION
+/*
+ * CALCULATE PSEUDOCONDITION
+ *
+ * Computes the magnitude of the ratio of the largest to the smallest
+ * pivots. This quantity is an indicator of ill-conditioning in the
+ * matrix. If this ratio is large, and if the matrix is scaled such
+ * that uncertainties in the RHS and the matrix entries are
+ * equilibrated, then the matrix is ill-conditioned. However, a small
+ * ratio does not necessarily imply that the matrix is
+ * well-conditioned. This routine must only be used after a matrix has
+ * been factored by spOrderAndFactor() or spFactor() and before it is
+ * cleared by spClear() or spInitialize(). The pseudocondition is
+ * faster to compute than the condition number calculated by
+ * spCondition(), but is not as informative.
+ *
+ * >>> Returns:
+ * The magnitude of the ratio of the largest to smallest pivot used during
+ * previous factorization. If the matrix was singular, zero is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ */
+
+RealNumber spPseudoCondition(char *eMatrix)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int I;
+ register ArrayOfElementPtrs Diag;
+ RealNumber MaxPivot, MinPivot, Mag;
+
+ /* Begin `spPseudoCondition'. */
+
+ ASSERT( IS_SPARSE(Matrix) AND IS_FACTORED(Matrix) );
+ if (Matrix->Error == spSINGULAR OR Matrix->Error == spZERO_DIAG)
+ {
+ return 0.0;
+ }
+
+ Diag = Matrix->Diag;
+ MaxPivot = MinPivot = ELEMENT_MAG( Diag[1] );
+ for (I = 2; I <= Matrix->Size; I++)
+ {
+ Mag = ELEMENT_MAG( Diag[I] );
+ if (Mag > MaxPivot)
+ {
+ MaxPivot = Mag;
+ }
+ else if (Mag < MinPivot)
+ {
+ MinPivot = Mag;
+ }
+ }
+ ASSERT( MaxPivot > 0.0);
+ return MaxPivot / MinPivot;
+}
+#endif
+
+#if CONDITION
+/*
+ * ESTIMATE CONDITION NUMBER
+ *
+ * Computes an estimate of the condition number using a variation on
+ * the LINPACK condition number estimation algorithm. This quantity is
+ * an indicator of ill-conditioning in the matrix. To avoid problems
+ * with overflow, the reciprocal of the condition number is returned.
+ * If this number is small, and if the matrix is scaled such that
+ * uncertainties in the RHS and the matrix entries are equilibrated,
+ * then the matrix is ill-conditioned. If the this number is near
+ * one, the matrix is well conditioned. This routine must only be
+ * used after a matrix has been factored by spOrderAndFactor() or
+ * spFactor() and before it is cleared by spClear() or spInitialize().
+ *
+ * Unlike the LINPACK condition number estimator, this routines
+ * returns the L infinity condition number. This is an artifact of
+ * Sparse placing ones on the diagonal of the upper triangular matrix
+ * rather than the lower. This difference should be of no importance.
+ *
+ * References:
+ * A.K. Cline, C.B. Moler, G.W. Stewart, J.H. Wilkinson. An estimate
+ * for the condition number of a matrix. SIAM Journal on Numerical
+ * Analysis. Vol. 16, No. 2, pages 368-375, April 1979.
+ *
+ * J.J. Dongarra, C.B. Moler, J.R. Bunch, G.W. Stewart. LINPACK
+ * User's Guide. SIAM, 1979.
+ *
+ * Roger G. Grimes, John G. Lewis. Condition number estimation for
+ * sparse matrices. SIAM Journal on Scientific and Statistical
+ * Computing. Vol. 2, No. 4, pages 384-388, December 1981.
+ *
+ * Dianne Prost O'Leary. Estimating matrix condition numbers. SIAM
+ * Journal on Scientific and Statistical Computing. Vol. 1, No. 2,
+ * pages 205-209, June 1980.
+ *
+ * >>> Returns:
+ * The reciprocal of the condition number. If the matrix was singular,
+ * zero is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ * NormOfMatrix <input> (RealNumber)
+ * The L-infinity norm of the unfactored matrix as computed by
+ * spNorm().
+ * pError <output> (int *)
+ * Used to return error code.
+ *
+ * >>> Possible errors:
+ * spSINGULAR
+ * spNO_MEMORY
+ */
+
+RealNumber spCondition(char *eMatrix, RealNumber NormOfMatrix, int *pError)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register RealVector T, Tm;
+ register int I, K, Row;
+ ElementPtr pPivot;
+ int Size;
+ RealNumber E, Em, Wp, Wm, ASp, ASm, ASw, ASy, ASv, ASz, MaxY, ScaleFactor;
+ RealNumber Linpack, OLeary, InvNormOfInverse;
+#define SLACK 1e4
+
+ /* Begin `spCondition'. */
+
+ ASSERT( IS_SPARSE(Matrix) AND IS_FACTORED(Matrix) );
+ *pError = Matrix->Error;
+ if (Matrix->Error >= spFATAL)
+ {
+ return 0.0;
+ }
+ if (NormOfMatrix == 0.0)
+ {
+ *pError = spSINGULAR;
+ return 0.0;
+ }
+
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ return ComplexCondition( Matrix, NormOfMatrix, pError );
+ }
+#endif
+
+#if REAL
+ Size = Matrix->Size;
+ T = Matrix->Intermediate;
+#if spCOMPLEX
+ Tm = Matrix->Intermediate + Size;
+#else
+ Tm = SPALLOC( RealNumber, Size + 1 );
+ if (Tm == NULL)
+ {
+ *pError = spNO_MEMORY;
+ return 0.0;
+ }
+#endif
+ for (I = Size; I > 0; I--)
+ {
+ T[I] = 0.0;
+ }
+
+ /*
+ * Part 1. Ay = e.
+ * Solve Ay = LUy = e where e consists of +1 and -1 terms with the sign
+ * chosen to maximize the size of w in Lw = e. Since the terms in w can
+ * get very large, scaling is used to avoid overflow.
+ */
+
+ /* Forward elimination. Solves Lw = e while choosing e. */
+ E = 1.0;
+ for (I = 1; I <= Size; I++)
+ {
+ pPivot = Matrix->Diag[I];
+ if (T[I] < 0.0)
+ {
+ Em = -E;
+ }
+ else
+ {
+ Em = E;
+ }
+ Wm = (Em + T[I]) * pPivot->Real;
+ if (Abs(Wm) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), Abs(Wm) );
+ for (K = Size; K > 0; K--)
+ {
+ T[K] *= ScaleFactor;
+ }
+ E *= ScaleFactor;
+ Em *= ScaleFactor;
+ Wm = (Em + T[I]) * pPivot->Real;
+ }
+ Wp = (T[I] - Em) * pPivot->Real;
+ ASp = Abs(T[I] - Em);
+ ASm = Abs(Em + T[I]);
+
+ /* Update T for both values of W, minus value is placed in Tm. */
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ Row = pElement->Row;
+ Tm[Row] = T[Row] - (Wm * pElement->Real);
+ T[Row] -= (Wp * pElement->Real);
+ ASp += Abs(T[Row]);
+ ASm += Abs(Tm[Row]);
+ pElement = pElement->NextInCol;
+ }
+
+ /* If minus value causes more growth, overwrite T with its values. */
+ if (ASm > ASp)
+ {
+ T[I] = Wm;
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ T[pElement->Row] = Tm[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+ }
+ else
+ {
+ T[I] = Wp;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains w, and scale ||T|| to 1/SLACK. */
+ for (ASw = 0.0, I = Size; I > 0; I--)
+ {
+ ASw += Abs(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASw);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ T[I] *= ScaleFactor;
+ }
+ E *= ScaleFactor;
+ }
+
+ /* Backward Substitution. Solves Uy = w.*/
+ for (I = Size; I >= 1; I--)
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ T[I] -= pElement->Real * T[pElement->Col];
+ pElement = pElement->NextInRow;
+ }
+ if (Abs(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), Abs(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ T[K] *= ScaleFactor;
+ }
+ E *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains y, and scale ||T|| to 1/SLACK. */
+ for (ASy = 0.0, I = Size; I > 0; I--)
+ {
+ ASy += Abs(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASy);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ T[I] *= ScaleFactor;
+ }
+ ASy = 1.0 / SLACK;
+ E *= ScaleFactor;
+ }
+
+ /* Compute infinity-norm of T for O'Leary's estimate. */
+ for (MaxY = 0.0, I = Size; I > 0; I--)
+ if (MaxY < Abs(T[I]))
+ {
+ MaxY = Abs(T[I]);
+ }
+
+ /*
+ * Part 2. A* z = y where the * represents the transpose.
+ * Recall that A = LU implies A* = U* L*.
+ */
+
+ /* Forward elimination, U* v = y. */
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ T[pElement->Col] -= T[I] * pElement->Real;
+ pElement = pElement->NextInRow;
+ }
+ if (Abs(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), Abs(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ T[K] *= ScaleFactor;
+ }
+ ASy *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains v, and scale ||T|| to 1/SLACK. */
+ for (ASv = 0.0, I = Size; I > 0; I--)
+ {
+ ASv += Abs(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASv);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ T[I] *= ScaleFactor;
+ }
+ ASy *= ScaleFactor;
+ }
+
+ /* Backward Substitution, L* z = v. */
+ for (I = Size; I >= 1; I--)
+ {
+ pPivot = Matrix->Diag[I];
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ T[I] -= pElement->Real * T[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+ T[I] *= pPivot->Real;
+ if (Abs(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), Abs(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ T[K] *= ScaleFactor;
+ }
+ ASy *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains z. */
+ for (ASz = 0.0, I = Size; I > 0; I--)
+ {
+ ASz += Abs(T[I]);
+ }
+
+#if NOT spCOMPLEX
+ SPFREE( Tm );
+#endif
+
+ Linpack = ASy / ASz;
+ OLeary = E / MaxY;
+ InvNormOfInverse = Min( Linpack, OLeary );
+ return InvNormOfInverse / NormOfMatrix;
+#endif /* REAL */
+}
+
+#if spCOMPLEX
+/*
+ * ESTIMATE CONDITION NUMBER
+ *
+ * Complex version of spCondition().
+ *
+ * >>> Returns:
+ * The reciprocal of the condition number.
+ *
+ * >>> Arguments:
+ * Matrix <input> (MatrixPtr)
+ * Pointer to the matrix.
+ * NormOfMatrix <input> (RealNumber)
+ * The L-infinity norm of the unfactored matrix as computed by
+ * spNorm().
+ * pError <output> (int *)
+ * Used to return error code.
+ *
+ * >>> Possible errors:
+ * spNO_MEMORY
+ */
+
+static RealNumber
+ComplexCondition( MatrixPtr Matrix, RealNumber NormOfMatrix, int *pError )
+{
+ register ElementPtr pElement;
+ register ComplexVector T, Tm;
+ register int I, K, Row;
+ ElementPtr pPivot;
+ int Size;
+ RealNumber E, Em, ASp, ASm, ASw, ASy, ASv, ASz, MaxY, ScaleFactor;
+ RealNumber Linpack, OLeary, InvNormOfInverse;
+ ComplexNumber Wp, Wm;
+
+ /* Begin `ComplexCondition'. */
+
+ Size = Matrix->Size;
+ T = (ComplexVector)Matrix->Intermediate;
+ Tm = SPALLOC( ComplexNumber, Size + 1 );
+ if (Tm == NULL)
+ {
+ *pError = spNO_MEMORY;
+ return 0.0;
+ }
+ for (I = Size; I > 0; I--)
+ {
+ T[I].Real = T[I].Imag = 0.0;
+ }
+
+ /*
+ * Part 1. Ay = e.
+ * Solve Ay = LUy = e where e consists of +1 and -1 terms with the sign
+ * chosen to maximize the size of w in Lw = e. Since the terms in w can
+ * get very large, scaling is used to avoid overflow.
+ */
+
+ /* Forward elimination. Solves Lw = e while choosing e. */
+ E = 1.0;
+ for (I = 1; I <= Size; I++)
+ {
+ pPivot = Matrix->Diag[I];
+ if (T[I].Real < 0.0)
+ {
+ Em = -E;
+ }
+ else
+ {
+ Em = E;
+ }
+ Wm = T[I];
+ Wm.Real += Em;
+ ASm = CMPLX_1_NORM( Wm );
+ CMPLX_MULT_ASSIGN( Wm, *pPivot );
+ if (CMPLX_1_NORM(Wm) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), CMPLX_1_NORM(Wm) );
+ for (K = Size; K > 0; K--)
+ {
+ SCLR_MULT_ASSIGN( T[K], ScaleFactor );
+ }
+ E *= ScaleFactor;
+ Em *= ScaleFactor;
+ ASm *= ScaleFactor;
+ SCLR_MULT_ASSIGN( Wm, ScaleFactor );
+ }
+ Wp = T[I];
+ Wp.Real -= Em;
+ ASp = CMPLX_1_NORM( Wp );
+ CMPLX_MULT_ASSIGN( Wp, *pPivot );
+
+ /* Update T for both values of W, minus value is placed in Tm. */
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ Row = pElement->Row;
+ /* Cmplx expr: Tm[Row] = T[Row] - (Wp * *pElement). */
+ CMPLX_MULT_SUBT( Tm[Row], Wm, *pElement, T[Row] );
+ /* Cmplx expr: T[Row] -= Wp * *pElement. */
+ CMPLX_MULT_SUBT_ASSIGN( T[Row], Wm, *pElement );
+ ASp += CMPLX_1_NORM(T[Row]);
+ ASm += CMPLX_1_NORM(Tm[Row]);
+ pElement = pElement->NextInCol;
+ }
+
+ /* If minus value causes more growth, overwrite T with its values. */
+ if (ASm > ASp)
+ {
+ T[I] = Wm;
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ T[pElement->Row] = Tm[pElement->Row];
+ pElement = pElement->NextInCol;
+ }
+ }
+ else
+ {
+ T[I] = Wp;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains w, and scale ||T|| to 1/SLACK. */
+ for (ASw = 0.0, I = Size; I > 0; I--)
+ {
+ ASw += CMPLX_1_NORM(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASw);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ SCLR_MULT_ASSIGN( T[I], ScaleFactor );
+ }
+ E *= ScaleFactor;
+ }
+
+ /* Backward Substitution. Solves Uy = w.*/
+ for (I = Size; I >= 1; I--)
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: T[I] -= T[pElement->Col] * *pElement. */
+ CMPLX_MULT_SUBT_ASSIGN( T[I], T[pElement->Col], *pElement );
+ pElement = pElement->NextInRow;
+ }
+ if (CMPLX_1_NORM(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), CMPLX_1_NORM(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ SCLR_MULT_ASSIGN( T[K], ScaleFactor );
+ }
+ E *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains y, and scale ||T|| to 1/SLACK. */
+ for (ASy = 0.0, I = Size; I > 0; I--)
+ {
+ ASy += CMPLX_1_NORM(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASy);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ SCLR_MULT_ASSIGN( T[I], ScaleFactor );
+ }
+ ASy = 1.0 / SLACK;
+ E *= ScaleFactor;
+ }
+
+ /* Compute infinity-norm of T for O'Leary's estimate. */
+ for (MaxY = 0.0, I = Size; I > 0; I--)
+ if (MaxY < CMPLX_1_NORM(T[I]))
+ {
+ MaxY = CMPLX_1_NORM(T[I]);
+ }
+
+ /*
+ * Part 2. A* z = y where the * represents the transpose.
+ * Recall that A = LU implies A* = U* L*.
+ */
+
+ /* Forward elimination, U* v = y. */
+ for (I = 1; I <= Size; I++)
+ {
+ pElement = Matrix->Diag[I]->NextInRow;
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: T[pElement->Col] -= T[I] * *pElement. */
+ CMPLX_MULT_SUBT_ASSIGN( T[pElement->Col], T[I], *pElement );
+ pElement = pElement->NextInRow;
+ }
+ if (CMPLX_1_NORM(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), CMPLX_1_NORM(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ SCLR_MULT_ASSIGN( T[K], ScaleFactor );
+ }
+ ASy *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains v, and scale ||T|| to 1/SLACK. */
+ for (ASv = 0.0, I = Size; I > 0; I--)
+ {
+ ASv += CMPLX_1_NORM(T[I]);
+ }
+ ScaleFactor = 1.0 / (SLACK * ASv);
+ if (ScaleFactor < 0.5)
+ {
+ for (I = Size; I > 0; I--)
+ {
+ SCLR_MULT_ASSIGN( T[I], ScaleFactor );
+ }
+ ASy *= ScaleFactor;
+ }
+
+ /* Backward Substitution, L* z = v. */
+ for (I = Size; I >= 1; I--)
+ {
+ pPivot = Matrix->Diag[I];
+ pElement = pPivot->NextInCol;
+ while (pElement != NULL)
+ {
+ /* Cmplx expr: T[I] -= T[pElement->Row] * *pElement. */
+ CMPLX_MULT_SUBT_ASSIGN( T[I], T[pElement->Row], *pElement );
+ pElement = pElement->NextInCol;
+ }
+ CMPLX_MULT_ASSIGN( T[I], *pPivot );
+ if (CMPLX_1_NORM(T[I]) > SLACK)
+ {
+ ScaleFactor = 1.0 / Max( SQR( SLACK ), CMPLX_1_NORM(T[I]) );
+ for (K = Size; K > 0; K--)
+ {
+ SCLR_MULT_ASSIGN( T[K], ScaleFactor );
+ }
+ ASy *= ScaleFactor;
+ }
+ }
+
+ /* Compute 1-norm of T, which now contains z. */
+ for (ASz = 0.0, I = Size; I > 0; I--)
+ {
+ ASz += CMPLX_1_NORM(T[I]);
+ }
+
+ SPFREE( Tm );
+
+ Linpack = ASy / ASz;
+ OLeary = E / MaxY;
+ InvNormOfInverse = Min( Linpack, OLeary );
+ return InvNormOfInverse / NormOfMatrix;
+}
+#endif /* spCOMPLEX */
+
+/*
+ * L-INFINITY MATRIX NORM
+ *
+ * Computes the L-infinity norm of an unfactored matrix. It is a fatal
+ * error to pass this routine a factored matrix.
+ *
+ * One difficulty is that the rows may not be linked.
+ *
+ * >>> Returns:
+ * The largest absolute row sum of matrix.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ */
+
+RealNumber spNorm( char *eMatrix)
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register int I;
+ RealNumber Max = 0.0, AbsRowSum;
+
+ /* Begin `spNorm'. */
+ ASSERT( IS_SPARSE(Matrix) AND NOT IS_FACTORED(Matrix) );
+ if (NOT Matrix->RowsLinked)
+ {
+ spcLinkRows( Matrix );
+ }
+
+ /* Compute row sums. */
+#if REAL
+ if (NOT Matrix->Complex)
+ {
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInRow[I];
+ AbsRowSum = 0.0;
+ while (pElement != NULL)
+ {
+ AbsRowSum += Abs( pElement->Real );
+ pElement = pElement->NextInRow;
+ }
+ if (Max < AbsRowSum)
+ {
+ Max = AbsRowSum;
+ }
+ }
+ }
+#endif
+#if spCOMPLEX
+ if (Matrix->Complex)
+ {
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInRow[I];
+ AbsRowSum = 0.0;
+ while (pElement != NULL)
+ {
+ AbsRowSum += CMPLX_1_NORM( *pElement );
+ pElement = pElement->NextInRow;
+ }
+ if (Max < AbsRowSum)
+ {
+ Max = AbsRowSum;
+ }
+ }
+ }
+#endif
+ return Max;
+}
+#endif /* CONDITION */
+
+#if STABILITY
+/*
+ * STABILITY OF FACTORIZATION
+ *
+ * The following routines are used to gauge the stability of a
+ * factorization. If the factorization is determined to be too unstable,
+ * then the matrix should be reordered. The routines compute quantities
+ * that are needed in the computation of a bound on the error attributed
+ * to any one element in the matrix during the factorization. In other
+ * words, there is a matrix E = [e_ij] of error terms such that A+E = LU.
+ * This routine finds a bound on |e_ij|. Erisman & Reid [1] showed that
+ * |e_ij| < 3.01 u rho m_ij, where u is the machine rounding unit,
+ * rho = max a_ij where the max is taken over every row i, column j, and
+ * step k, and m_ij is the number of multiplications required in the
+ * computation of l_ij if i > j or u_ij otherwise. Barlow [2] showed that
+ * rho < max_i || l_i ||_p max_j || u_j ||_q where 1/p + 1/q = 1.
+ *
+ * The first routine finds the magnitude on the largest element in the
+ * matrix. If the matrix has not yet been factored, the largest
+ * element is found by direct search. If the matrix is factored, a
+ * bound on the largest element in any of the reduced submatrices is
+ * computed using Barlow with p = oo and q = 1. The ratio of these
+ * two numbers is the growth, which can be used to determine if the
+ * pivoting order is adequate. A large growth implies that
+ * considerable error has been made in the factorization and that it
+ * is probably a good idea to reorder the matrix. If a large growth
+ * in encountered after using spFactor(), reconstruct the matrix and
+ * refactor using spOrderAndFactor(). If a large growth is
+ * encountered after using spOrderAndFactor(), refactor using
+ * spOrderAndFactor() with the pivot threshold increased, say to 0.1.
+ *
+ * Using only the size of the matrix as an upper bound on m_ij and
+ * Barlow's bound, the user can estimate the size of the matrix error
+ * terms e_ij using the bound of Erisman and Reid. The second routine
+ * computes a tighter bound (with more work) based on work by Gear
+ * [3], |e_ij| < 1.01 u rho (t c^3 + (1 + t)c^2) where t is the
+ * threshold and c is the maximum number of off-diagonal elements in
+ * any row of L. The expensive part of computing this bound is
+ * determining the maximum number of off-diagonals in L, which changes
+ * only when the order of the matrix changes. This number is computed
+ * and saved, and only recomputed if the matrix is reordered.
+ *
+ * [1] A. M. Erisman, J. K. Reid. Monitoring the stability of the
+ * triangular factorization of a sparse matrix. Numerische
+ * Mathematik. Vol. 22, No. 3, 1974, pp 183-186.
+ *
+ * [2] J. L. Barlow. A note on monitoring the stability of triangular
+ * decomposition of sparse matrices. "SIAM Journal of Scientific
+ * and Statistical Computing." Vol. 7, No. 1, January 1986, pp 166-168.
+ *
+ * [3] I. S. Duff, A. M. Erisman, J. K. Reid. "Direct Methods for Sparse
+ * Matrices." Oxford 1986. pp 99.
+ */
+
+/*
+ * LARGEST ELEMENT IN MATRIX
+ *
+ * >>> Returns:
+ * If matrix is not factored, returns the magnitude of the largest element in
+ * the matrix. If the matrix is factored, a bound on the magnitude of the
+ * largest element in any of the reduced submatrices is returned.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ */
+
+RealNumber spLargestElement( char *eMatrix )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register int I;
+ RealNumber Mag, AbsColSum, Max = 0.0, MaxRow = 0.0, MaxCol = 0.0;
+ RealNumber Pivot;
+ ComplexNumber cPivot;
+ register ElementPtr pElement, pDiag;
+
+ /* Begin `spLargestElement'. */
+ ASSERT( IS_SPARSE(Matrix) );
+
+#if REAL
+ if (Matrix->Factored AND NOT Matrix->Complex)
+ {
+ if (Matrix->Error == spSINGULAR)
+ {
+ return 0.0;
+ }
+
+ /* Find the bound on the size of the largest element over all factorization. */
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ pDiag = Matrix->Diag[I];
+
+ /* Lower triangular matrix. */
+ Pivot = 1.0 / pDiag->Real;
+ Mag = Abs( Pivot );
+ if (Mag > MaxRow)
+ {
+ MaxRow = Mag;
+ }
+ pElement = Matrix->FirstInRow[I];
+ while (pElement != pDiag)
+ {
+ Mag = Abs( pElement->Real );
+ if (Mag > MaxRow)
+ {
+ MaxRow = Mag;
+ }
+ pElement = pElement->NextInRow;
+ }
+
+ /* Upper triangular matrix. */
+ pElement = Matrix->FirstInCol[I];
+ AbsColSum = 1.0; /* Diagonal of U is unity. */
+ while (pElement != pDiag)
+ {
+ AbsColSum += Abs( pElement->Real );
+ pElement = pElement->NextInCol;
+ }
+ if (AbsColSum > MaxCol)
+ {
+ MaxCol = AbsColSum;
+ }
+ }
+ }
+ else if (NOT Matrix->Complex)
+ {
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ Mag = Abs( pElement->Real );
+ if (Mag > Max)
+ {
+ Max = Mag;
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+ return Max;
+ }
+#endif
+#if spCOMPLEX
+ if (Matrix->Factored AND Matrix->Complex)
+ {
+ if (Matrix->Error == spSINGULAR)
+ {
+ return 0.0;
+ }
+
+ /* Find the bound on the size of the largest element over all factorization. */
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ pDiag = Matrix->Diag[I];
+
+ /* Lower triangular matrix. */
+ CMPLX_RECIPROCAL( cPivot, *pDiag );
+ Mag = CMPLX_1_NORM( cPivot );
+ if (Mag > MaxRow)
+ {
+ MaxRow = Mag;
+ }
+ pElement = Matrix->FirstInRow[I];
+ while (pElement != pDiag)
+ {
+ Mag = CMPLX_1_NORM( *pElement );
+ if (Mag > MaxRow)
+ {
+ MaxRow = Mag;
+ }
+ pElement = pElement->NextInRow;
+ }
+
+ /* Upper triangular matrix. */
+ pElement = Matrix->FirstInCol[I];
+ AbsColSum = 1.0; /* Diagonal of U is unity. */
+ while (pElement != pDiag)
+ {
+ AbsColSum += CMPLX_1_NORM( *pElement );
+ pElement = pElement->NextInCol;
+ }
+ if (AbsColSum > MaxCol)
+ {
+ MaxCol = AbsColSum;
+ }
+ }
+ }
+ else if (Matrix->Complex)
+ {
+ for (I = 1; I <= Matrix->Size; I++)
+ {
+ pElement = Matrix->FirstInCol[I];
+ while (pElement != NULL)
+ {
+ Mag = CMPLX_1_NORM( *pElement );
+ if (Mag > Max)
+ {
+ Max = Mag;
+ }
+ pElement = pElement->NextInCol;
+ }
+ }
+ return Max;
+ }
+#endif
+ return MaxRow * MaxCol;
+}
+
+
+
+
+/*
+ * MATRIX ROUNDOFF ERROR
+ *
+ * >>> Returns:
+ * Returns a bound on the magnitude of the largest element in E = A - LU.
+ *
+ * >>> Arguments:
+ * eMatrix <input> (char *)
+ * Pointer to the matrix.
+ * Rho <input> (RealNumber)
+ * The bound on the magnitude of the largest element in any of the
+ * reduced submatrices. This is the number computed by the function
+ * spLargestElement() when given a factored matrix. If this number is
+ * negative, the bound will be computed automatically.
+ */
+
+RealNumber spRoundoff(char *eMatrix, RealNumber Rho )
+{
+ MatrixPtr Matrix = (MatrixPtr)eMatrix;
+ register ElementPtr pElement;
+ register int Count, I, MaxCount = 0;
+ RealNumber Reid, Gear;
+
+ /* Begin `spRoundoff'. */
+ ASSERT( IS_SPARSE(Matrix) AND IS_FACTORED(Matrix) );
+
+ /* Compute Barlow's bound if it is not given. */
+ if (Rho < 0.0)
+ {
+ Rho = spLargestElement( eMatrix );
+ }
+
+ /* Find the maximum number of off-diagonals in L if not previously computed. */
+ if (Matrix->MaxRowCountInLowerTri < 0)
+ {
+ for (I = Matrix->Size; I > 0; I--)
+ {
+ pElement = Matrix->FirstInRow[I];
+ Count = 0;
+ while (pElement->Col < I)
+ {
+ Count++;
+ pElement = pElement->NextInRow;
+ }
+ if (Count > MaxCount)
+ {
+ MaxCount = Count;
+ }
+ }
+ Matrix->MaxRowCountInLowerTri = MaxCount;
+ }
+ else
+ {
+ MaxCount = Matrix->MaxRowCountInLowerTri;
+ }
+
+ /* Compute error bound. */
+ Gear = 1.01 * ((MaxCount + 1) * Matrix->RelThreshold + 1.0) * SQR(MaxCount);
+ Reid = 3.01 * Matrix->Size;
+
+ if (Gear < Reid)
+ {
+ return (MACHINE_RESOLUTION * Rho * Gear);
+ }
+ else
+ {
+ return (MACHINE_RESOLUTION * Rho * Reid);
+ }
+}
+#endif
diff --git a/modules/sparse/src/c/spUtils.h b/modules/sparse/src/c/spUtils.h
new file mode 100755
index 000000000..550204cd6
--- /dev/null
+++ b/modules/sparse/src/c/spUtils.h
@@ -0,0 +1,20 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+#include "spConfig.h"
+#include "spmatrix.h"
+#include "spDefs.h"
+#include "spmalloc.h"
+
+
+#if TRANSLATE AND DELETE
+void spDeleteRowAndCol( char *eMatrix, int Row, int Col );
+#endif
diff --git a/modules/sparse/src/c/sparse.rc b/modules/sparse/src/c/sparse.rc
new file mode 100755
index 000000000..5351fa355
--- /dev/null
+++ b/modules/sparse/src/c/sparse.rc
@@ -0,0 +1,95 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 5,5,2,0
+ PRODUCTVERSION 5,5,2,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040c04b0"
+ BEGIN
+ VALUE "FileDescription", "sparse module"
+ VALUE "FileVersion", "5, 5, 2, 0"
+ VALUE "InternalName", "sparse module"
+ VALUE "LegalCopyright", "Copyright (C) 2017"
+ VALUE "OriginalFilename", "sparse.dll"
+ VALUE "ProductName", "sparse module"
+ VALUE "ProductVersion", "5, 5, 2, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x40c, 1200
+ END
+END
+
+#endif // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/modules/sparse/src/c/sparse.vcxproj b/modules/sparse/src/c/sparse.vcxproj
new file mode 100755
index 000000000..d2d2d84e1
--- /dev/null
+++ b/modules/sparse/src/c/sparse.vcxproj
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{51240B08-5E4E-439B-B745-C870D5B513BF}</ProjectGuid>
+ <RootNamespace>sparse</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;../../includes;../../../core/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../sparse/includes;../../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;SPARSE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Make dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>elementary_functions_f.lib;core.lib;sparse_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;../../includes;../../../core/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../sparse/includes;../../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;SPARSE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Make dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>elementary_functions_f.lib;core.lib;sparse_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>.;../../includes;../../../core/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../sparse/includes;../../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;SPARSE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Make dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>elementary_functions_f.lib;core.lib;sparse_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>.;../../includes;../../../core/includes;../../../elementary_functions/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../sparse/includes;../../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;SPARSE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Make dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)sparse_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>elementary_functions_f.lib;core.lib;sparse_f.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="DllmainSparse.c" />
+ <ClCompile Include="..\..\sci_gateway\c\gw_sparse.c" />
+ <ClCompile Include="lu.c" />
+ <ClCompile Include="mspelm.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_bfinit.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_blkfc1i.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_blkslvi.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_fadj2sp.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_full.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_inpnvi.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_ludel.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_lufact.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_luget.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_lusolve.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_mfull.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_msparse.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_mspget.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_nnz.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_ordmmd.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_sfinit.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_sparse.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_spchol.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_spclean.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_spcompa.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_spget.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_spmatrix.c" />
+ <ClCompile Include="..\..\sci_gateway\c\sci_symfcti.c" />
+ <ClCompile Include="spAllocate.c" />
+ <ClCompile Include="spBuild.c" />
+ <ClCompile Include="spFactor.c" />
+ <ClCompile Include="spFortran.c" />
+ <ClCompile Include="spOutput.c" />
+ <ClCompile Include="spSolve.c" />
+ <ClCompile Include="spUtils.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\includes\dynlib_sparse.h" />
+ <ClInclude Include="..\..\includes\gw_sparse.h" />
+ <ClInclude Include="lu.h" />
+ <ClInclude Include="..\..\includes\sp.h" />
+ <ClInclude Include="spAllocate.h" />
+ <ClInclude Include="spBuild.h" />
+ <ClInclude Include="..\..\includes\spConfig.h" />
+ <ClInclude Include="..\..\includes\spDefs.h" />
+ <ClInclude Include="spFortran.h" />
+ <ClInclude Include="..\..\includes\spmalloc.h" />
+ <ClInclude Include="..\..\includes\spmatrix.h" />
+ <ClInclude Include="spUtils.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\locales\sparse.pot" />
+ <None Include="elementary_functions_f_Import.def" />
+ <None Include="core_import.def" />
+ <None Include="sparse_f_Import.def" />
+ <None Include="..\..\Makefile.am" />
+ <None Include="..\..\sparse.iss" />
+ <None Include="..\..\sci_gateway\sparse_gateway.xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="sparse.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
+ <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+ <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\elementary_functions\src\c\elementary_functions.vcxproj">
+ <Project>{5b110267-7c18-437c-b87d-dba2b50729e9}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\io\src\c\io.vcxproj">
+ <Project>{80c0f142-184b-4e08-a8ee-5e71437cf904}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
+ <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
+ <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/modules/sparse/src/c/sparse.vcxproj.filters b/modules/sparse/src/c/sparse.vcxproj.filters
new file mode 100755
index 000000000..f8711ee5f
--- /dev/null
+++ b/modules/sparse/src/c/sparse.vcxproj.filters
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{968ef63c-45c9-458a-bce5-80d1e94aa025}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{966ad96b-63fb-42e4-a449-acb6171b5cd0}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="localization">
+ <UniqueIdentifier>{1e5e4a67-45b3-4865-8796-982d5ec8b9d3}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies">
+ <UniqueIdentifier>{d85074bc-ea43-4d08-b82e-1f9339261da9}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies\Imports">
+ <UniqueIdentifier>{66020113-a1e6-4c04-8933-93169cb0b73e}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource File">
+ <UniqueIdentifier>{aad96794-92c3-45af-b435-1a419e873593}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="DllmainSparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\gw_sparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lu.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mspelm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_bfinit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_blkfc1i.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_blkslvi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_fadj2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_full.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_inpnvi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_ludel.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_lufact.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_luget.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_lusolve.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_mfull.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_msparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_mspget.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_nnz.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_ordmmd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_sfinit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_sparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_spchol.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_spclean.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_spcompa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_spget.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_spmatrix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\c\sci_symfcti.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spAllocate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spBuild.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spFactor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spFortran.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spOutput.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spSolve.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spUtils.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\includes\dynlib_sparse.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\gw_sparse.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="lu.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\sp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="spAllocate.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="spBuild.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\spConfig.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\spDefs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="spFortran.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\spmalloc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\includes\spmatrix.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="spUtils.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="core_import.def">
+ <Filter>Libraries Dependencies\Imports</Filter>
+ </None>
+ <None Include="sparse_f_Import.def">
+ <Filter>Libraries Dependencies\Imports</Filter>
+ </None>
+ <None Include="..\..\Makefile.am" />
+ <None Include="..\..\sparse.iss" />
+ <None Include="..\..\sci_gateway\sparse_gateway.xml" />
+ <None Include="..\..\locales\sparse.pot">
+ <Filter>localization</Filter>
+ </None>
+ <None Include="elementary_functions_f_Import.def">
+ <Filter>Libraries Dependencies\Imports</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="sparse.rc">
+ <Filter>Resource File</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/modules/sparse/src/c/sparse_f_Import.def b/modules/sparse/src/c/sparse_f_Import.def
new file mode 100755
index 000000000..09ea6d57d
--- /dev/null
+++ b/modules/sparse/src/c/sparse_f_Import.def
@@ -0,0 +1,31 @@
+LIBRARY sparse_f.dll
+
+
+EXPORTS
+; ---------------------------------------
+; sparse_f
+; ---------------------------------------
+scita2lpd_
+wspt_
+dspt_
+intbfinit_
+intblkfc1i_
+intblkslvi_
+intfadj2sp_
+intfull_
+intinpnvi_
+intludel_
+intlufact_
+intluget_
+intlusolve_
+intnnz_
+intordmmd_
+intsfinit_
+intsparse_
+intspchol_
+intspclean_
+intspcompa_
+intspget_
+intspmatrix_
+intspmax_
+intsymfcti_
diff --git a/modules/sparse/src/fortran/.deps/.dirstamp b/modules/sparse/src/fortran/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/src/fortran/.deps/.dirstamp
diff --git a/modules/sparse/src/fortran/.dirstamp b/modules/sparse/src/fortran/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/sparse/src/fortran/.dirstamp
diff --git a/modules/sparse/src/fortran/.libs/blkfc1.o b/modules/sparse/src/fortran/.libs/blkfc1.o
new file mode 100755
index 000000000..5f5fdcb81
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/blkfc1.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/blkfct.o b/modules/sparse/src/fortran/.libs/blkfct.o
new file mode 100755
index 000000000..dcc03d02c
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/blkfct.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/blkslv.o b/modules/sparse/src/fortran/.libs/blkslv.o
new file mode 100755
index 000000000..fbff9c299
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/blkslv.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dcompa.o b/modules/sparse/src/fortran/.libs/dcompa.o
new file mode 100755
index 000000000..989b0fa4d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dcompa.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dful2sp.o b/modules/sparse/src/fortran/.libs/dful2sp.o
new file mode 100755
index 000000000..ae74e7ba1
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dful2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dij2sp.o b/modules/sparse/src/fortran/.libs/dij2sp.o
new file mode 100755
index 000000000..259d619c4
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dij2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dperm.o b/modules/sparse/src/fortran/.libs/dperm.o
new file mode 100755
index 000000000..a040e7a45
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dperm.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dsmsp.o b/modules/sparse/src/fortran/.libs/dsmsp.o
new file mode 100755
index 000000000..2b855e501
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dsmsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dsosp.o b/modules/sparse/src/fortran/.libs/dsosp.o
new file mode 100755
index 000000000..daf2be267
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dsosp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspasp.o b/modules/sparse/src/fortran/.libs/dspasp.o
new file mode 100755
index 000000000..01c4a0658
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspasp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspcle.o b/modules/sparse/src/fortran/.libs/dspcle.o
new file mode 100755
index 000000000..f70d57584
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspcle.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspcsp.o b/modules/sparse/src/fortran/.libs/dspcsp.o
new file mode 100755
index 000000000..5c2f10b40
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspcsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspe2.o b/modules/sparse/src/fortran/.libs/dspe2.o
new file mode 100755
index 000000000..4777acf56
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspe2.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspful.o b/modules/sparse/src/fortran/.libs/dspful.o
new file mode 100755
index 000000000..f5e55fc70
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspful.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspis.o b/modules/sparse/src/fortran/.libs/dspis.o
new file mode 100755
index 000000000..02cc1df9e
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspis.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspisp.o b/modules/sparse/src/fortran/.libs/dspisp.o
new file mode 100755
index 000000000..2f35c76e4
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspisp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspmat.o b/modules/sparse/src/fortran/.libs/dspmat.o
new file mode 100755
index 000000000..c7136d3c7
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspmat.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspms.o b/modules/sparse/src/fortran/.libs/dspms.o
new file mode 100755
index 000000000..79348f887
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspms.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspmsp.o b/modules/sparse/src/fortran/.libs/dspmsp.o
new file mode 100755
index 000000000..1ee259cea
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspmsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspos.o b/modules/sparse/src/fortran/.libs/dspos.o
new file mode 100755
index 000000000..6420909e3
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspos.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dsposp.o b/modules/sparse/src/fortran/.libs/dsposp.o
new file mode 100755
index 000000000..f08ffd205
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dsposp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspssp.o b/modules/sparse/src/fortran/.libs/dspssp.o
new file mode 100755
index 000000000..26d5febf7
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspssp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspt.o b/modules/sparse/src/fortran/.libs/dspt.o
new file mode 100755
index 000000000..e7109cb52
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspt.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspxs.o b/modules/sparse/src/fortran/.libs/dspxs.o
new file mode 100755
index 000000000..3dc9d676a
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspxs.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/dspxsp.o b/modules/sparse/src/fortran/.libs/dspxsp.o
new file mode 100755
index 000000000..41d9efc23
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/dspxsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/findl.o b/modules/sparse/src/fortran/.libs/findl.o
new file mode 100755
index 000000000..4e75289b7
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/findl.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/inpnv.o b/modules/sparse/src/fortran/.libs/inpnv.o
new file mode 100755
index 000000000..c8f0bace7
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/inpnv.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/iperm.o b/modules/sparse/src/fortran/.libs/iperm.o
new file mode 100755
index 000000000..539896348
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/iperm.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/isort1.o b/modules/sparse/src/fortran/.libs/isort1.o
new file mode 100755
index 000000000..df9caf682
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/isort1.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lcompa.o b/modules/sparse/src/fortran/.libs/lcompa.o
new file mode 100755
index 000000000..0db1084d5
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lcompa.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lful2sp.o b/modules/sparse/src/fortran/.libs/lful2sp.o
new file mode 100755
index 000000000..86c445d36
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lful2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lij2sp.o b/modules/sparse/src/fortran/.libs/lij2sp.o
new file mode 100755
index 000000000..f9c1206c1
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lij2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lsosp.o b/modules/sparse/src/fortran/.libs/lsosp.o
new file mode 100755
index 000000000..de7c617e9
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lsosp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspasp.o b/modules/sparse/src/fortran/.libs/lspasp.o
new file mode 100755
index 000000000..c858f3244
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspasp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspcsp.o b/modules/sparse/src/fortran/.libs/lspcsp.o
new file mode 100755
index 000000000..d3c939e3d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspcsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspe2.o b/modules/sparse/src/fortran/.libs/lspe2.o
new file mode 100755
index 000000000..f81d66f84
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspe2.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspful.o b/modules/sparse/src/fortran/.libs/lspful.o
new file mode 100755
index 000000000..0a35a7e4a
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspful.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspis.o b/modules/sparse/src/fortran/.libs/lspis.o
new file mode 100755
index 000000000..4cf3010a9
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspis.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspisp.o b/modules/sparse/src/fortran/.libs/lspisp.o
new file mode 100755
index 000000000..f16f12e81
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspisp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspmat.o b/modules/sparse/src/fortran/.libs/lspmat.o
new file mode 100755
index 000000000..b9a5092cd
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspmat.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspops.o b/modules/sparse/src/fortran/.libs/lspops.o
new file mode 100755
index 000000000..369661eed
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspops.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspos.o b/modules/sparse/src/fortran/.libs/lspos.o
new file mode 100755
index 000000000..e53d8d75f
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspos.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lsposp.o b/modules/sparse/src/fortran/.libs/lsposp.o
new file mode 100755
index 000000000..3f4a3dc9b
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lsposp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspt.o b/modules/sparse/src/fortran/.libs/lspt.o
new file mode 100755
index 000000000..03f2cf657
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspt.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/lspxsp.o b/modules/sparse/src/fortran/.libs/lspxsp.o
new file mode 100755
index 000000000..2b24ad512
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/lspxsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/ordmmd.o b/modules/sparse/src/fortran/.libs/ordmmd.o
new file mode 100755
index 000000000..8b5a16b9d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/ordmmd.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/sp2col.o b/modules/sparse/src/fortran/.libs/sp2col.o
new file mode 100755
index 000000000..7b0e3e09d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/sp2col.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spcho1.o b/modules/sparse/src/fortran/.libs/spcho1.o
new file mode 100755
index 000000000..ff4abb10a
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spcho1.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spcho2.o b/modules/sparse/src/fortran/.libs/spcho2.o
new file mode 100755
index 000000000..189720d06
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spcho2.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spcompack.o b/modules/sparse/src/fortran/.libs/spcompack.o
new file mode 100755
index 000000000..5877cb1ae
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spcompack.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spextr.o b/modules/sparse/src/fortran/.libs/spextr.o
new file mode 100755
index 000000000..8ba2032fc
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spextr.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spextr1.o b/modules/sparse/src/fortran/.libs/spextr1.o
new file mode 100755
index 000000000..27c9fdf9f
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spextr1.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spif.o b/modules/sparse/src/fortran/.libs/spif.o
new file mode 100755
index 000000000..ea72fc52f
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spif.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spif1b.o b/modules/sparse/src/fortran/.libs/spif1b.o
new file mode 100755
index 000000000..bc514a5eb
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spif1b.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spifp.o b/modules/sparse/src/fortran/.libs/spifp.o
new file mode 100755
index 000000000..2471227bb
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spifp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spind.o b/modules/sparse/src/fortran/.libs/spind.o
new file mode 100755
index 000000000..7bd7b090f
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spind.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spisp.o b/modules/sparse/src/fortran/.libs/spisp.o
new file mode 100755
index 000000000..236b4750d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spisp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spord.o b/modules/sparse/src/fortran/.libs/spord.o
new file mode 100755
index 000000000..bea546f43
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spord.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spreshape.o b/modules/sparse/src/fortran/.libs/spreshape.o
new file mode 100755
index 000000000..01f6175b8
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spreshape.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spsort.o b/modules/sparse/src/fortran/.libs/spsort.o
new file mode 100755
index 000000000..414c07efc
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spsort.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/spt.o b/modules/sparse/src/fortran/.libs/spt.o
new file mode 100755
index 000000000..694810be4
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/spt.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/sputil.o b/modules/sparse/src/fortran/.libs/sputil.o
new file mode 100755
index 000000000..bfd5e5e9d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/sputil.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/symfct.o b/modules/sparse/src/fortran/.libs/symfct.o
new file mode 100755
index 000000000..9cc8bf36e
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/symfct.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/sz2ptr.o b/modules/sparse/src/fortran/.libs/sz2ptr.o
new file mode 100755
index 000000000..4becf201c
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/sz2ptr.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/ta2lpd.o b/modules/sparse/src/fortran/.libs/ta2lpd.o
new file mode 100755
index 000000000..3295e18d8
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/ta2lpd.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wcompa.o b/modules/sparse/src/fortran/.libs/wcompa.o
new file mode 100755
index 000000000..e58be9e05
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wcompa.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wful2sp.o b/modules/sparse/src/fortran/.libs/wful2sp.o
new file mode 100755
index 000000000..fd92e8873
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wful2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wij2sp.o b/modules/sparse/src/fortran/.libs/wij2sp.o
new file mode 100755
index 000000000..e105d87eb
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wij2sp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wperm.o b/modules/sparse/src/fortran/.libs/wperm.o
new file mode 100755
index 000000000..c4cc7f8bd
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wperm.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/writebuf.o b/modules/sparse/src/fortran/.libs/writebuf.o
new file mode 100755
index 000000000..e69a2f07a
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/writebuf.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wsmsp.o b/modules/sparse/src/fortran/.libs/wsmsp.o
new file mode 100755
index 000000000..d6b6e214c
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wsmsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wsosp.o b/modules/sparse/src/fortran/.libs/wsosp.o
new file mode 100755
index 000000000..1b8bcefab
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wsosp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspasp.o b/modules/sparse/src/fortran/.libs/wspasp.o
new file mode 100755
index 000000000..b145ddfb7
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspasp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspcle.o b/modules/sparse/src/fortran/.libs/wspcle.o
new file mode 100755
index 000000000..e9369b2b0
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspcle.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspcsp.o b/modules/sparse/src/fortran/.libs/wspcsp.o
new file mode 100755
index 000000000..b6efea7f6
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspcsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspe2.o b/modules/sparse/src/fortran/.libs/wspe2.o
new file mode 100755
index 000000000..3a1f5cc2d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspe2.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspful.o b/modules/sparse/src/fortran/.libs/wspful.o
new file mode 100755
index 000000000..8df50ec15
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspful.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspis.o b/modules/sparse/src/fortran/.libs/wspis.o
new file mode 100755
index 000000000..d84cdd1c6
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspis.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspisp.o b/modules/sparse/src/fortran/.libs/wspisp.o
new file mode 100755
index 000000000..b2377c4fe
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspisp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspmat.o b/modules/sparse/src/fortran/.libs/wspmat.o
new file mode 100755
index 000000000..73c98bd00
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspmat.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspms.o b/modules/sparse/src/fortran/.libs/wspms.o
new file mode 100755
index 000000000..ea105b63e
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspms.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspmsp.o b/modules/sparse/src/fortran/.libs/wspmsp.o
new file mode 100755
index 000000000..7121eb78b
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspmsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspos.o b/modules/sparse/src/fortran/.libs/wspos.o
new file mode 100755
index 000000000..5102def80
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspos.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wsposp.o b/modules/sparse/src/fortran/.libs/wsposp.o
new file mode 100755
index 000000000..a2f7aa6aa
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wsposp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspssp.o b/modules/sparse/src/fortran/.libs/wspssp.o
new file mode 100755
index 000000000..35926cb72
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspssp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspt.o b/modules/sparse/src/fortran/.libs/wspt.o
new file mode 100755
index 000000000..21785304f
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspt.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspxs.o b/modules/sparse/src/fortran/.libs/wspxs.o
new file mode 100755
index 000000000..a1c7567a6
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspxs.o
Binary files differ
diff --git a/modules/sparse/src/fortran/.libs/wspxsp.o b/modules/sparse/src/fortran/.libs/wspxsp.o
new file mode 100755
index 000000000..5d7265e1d
--- /dev/null
+++ b/modules/sparse/src/fortran/.libs/wspxsp.o
Binary files differ
diff --git a/modules/sparse/src/fortran/Core_f_Import.def b/modules/sparse/src/fortran/Core_f_Import.def
new file mode 100755
index 000000000..94e1e4082
--- /dev/null
+++ b/modules/sparse/src/fortran/Core_f_Import.def
@@ -0,0 +1,17 @@
+ LIBRARY core_f.dll
+
+
+EXPORTS
+;
+;core_f
+;
+funnam_
+indxg_
+indxgc_
+isany_
+ref2val_
+setref_
+
+
+
+
diff --git a/modules/sparse/src/fortran/Elementary_functions_Import.def b/modules/sparse/src/fortran/Elementary_functions_Import.def
new file mode 100755
index 000000000..4da45ea4d
--- /dev/null
+++ b/modules/sparse/src/fortran/Elementary_functions_Import.def
@@ -0,0 +1,8 @@
+ LIBRARY elementary_functions.dll
+
+
+EXPORTS
+;
+;elementary_functions
+unsfdcopy_
+int2db_ \ No newline at end of file
diff --git a/modules/sparse/src/fortran/Elementary_functions_f_Import.def b/modules/sparse/src/fortran/Elementary_functions_f_Import.def
new file mode 100755
index 000000000..7366e5649
--- /dev/null
+++ b/modules/sparse/src/fortran/Elementary_functions_f_Import.def
@@ -0,0 +1,14 @@
+ LIBRARY elementary_functions_f.dll
+
+
+EXPORTS
+;
+;elementary_functions_f
+iset_
+dset_
+entier_
+wscal_
+ddpow_
+wdpow_
+dwpow_
+wwpow_
diff --git a/modules/sparse/src/fortran/Output_stream_Import.def b/modules/sparse/src/fortran/Output_stream_Import.def
new file mode 100755
index 000000000..dfa96c443
--- /dev/null
+++ b/modules/sparse/src/fortran/Output_stream_Import.def
@@ -0,0 +1,10 @@
+ LIBRARY output_stream.dll
+
+
+EXPORTS
+;
+;output_stream
+basout_
+error_
+erro_
+msgs_
diff --git a/modules/sparse/src/fortran/Sparse_Import.def b/modules/sparse/src/fortran/Sparse_Import.def
new file mode 100755
index 000000000..7865186ae
--- /dev/null
+++ b/modules/sparse/src/fortran/Sparse_Import.def
@@ -0,0 +1,12 @@
+ LIBRARY sparse.dll
+
+
+EXPORTS
+
+; sparse
+
+lufact1_
+lusiz1_
+luget1_
+lusolve1_
+ludel1_ \ No newline at end of file
diff --git a/modules/sparse/src/fortran/blkfc1.f b/modules/sparse/src/fortran/blkfc1.f
new file mode 100755
index 000000000..fd9631c6f
--- /dev/null
+++ b/modules/sparse/src/fortran/blkfc1.f
@@ -0,0 +1,50 @@
+ SUBROUTINE BLKFC1 ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , level)
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER level
+c
+ INTEGER XLINDX(*) , XLNZ(*)
+ INTEGER IWORK(*) , LINDX(*) ,
+ & SNODE(*) , SPLIT(*) ,
+ & XSUPER(*)
+ INTEGER IFLAG , IWSIZ , NEQNS , NSUPER, TMPSIZ
+ DOUBLE PRECISION LNZ(*) , TMPVEC(*)
+c
+ EXTERNAL MMPY1, MMPY2 , MMPY4 , MMPY8
+ EXTERNAL SMXPY1, SMXPY2, SMXPY4, SMXPY8
+C
+C*********************************************************************
+C
+ if (level .eq. 1) then
+ call BLKFCT ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , MMPY1 ,
+ & SMXPY1 )
+ endif
+ if (level .eq. 2) then
+ call BLKFCT ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , MMPY2 ,
+ & SMXPY2 )
+ endif
+ if (level .eq. 4) then
+ call BLKFCT ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , MMPY4 ,
+ & SMXPY4 )
+ endif
+ if (level .eq. 8) then
+ call BLKFCT ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , MMPY8 ,
+ & SMXPY8 )
+ endif
+ return
+ end
diff --git a/modules/sparse/src/fortran/blkfc1.lo b/modules/sparse/src/fortran/blkfc1.lo
new file mode 100755
index 000000000..53040049f
--- /dev/null
+++ b/modules/sparse/src/fortran/blkfc1.lo
@@ -0,0 +1,12 @@
+# src/fortran/blkfc1.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/blkfc1.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/blkfct.f b/modules/sparse/src/fortran/blkfct.f
new file mode 100755
index 000000000..65c45878b
--- /dev/null
+++ b/modules/sparse/src/fortran/blkfct.f
@@ -0,0 +1,2098 @@
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: March 6, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C********* BLKFCT ..... BLOCK GENERAL SPARSE CHOLESKY *********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE CALLS THE BLOCK GENERAL SPARSE CHOLESKY ROUTINE,
+C BLKFC2.
+C
+C INPUT PARAMETERS:
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - SUPERNODE PARTITION.
+C SNODE - MAPS EACH COLUMN TO THE SUPERNODE CONTAINING
+C IT.
+C SPLIT - SPLITTING OF SUPERNODES SO THAT THEY FIT
+C INTO CACHE.
+C (XLINDX,LINDX) - ROW INDICES FOR EACH SUPERNODE (INCLUDING
+C THE DIAGONAL ELEMENTS).
+C (XLNZ,LNZ) - ON INPUT, CONTAINS MATRIX TO BE FACTORED.
+C IWSIZ - SIZE OF INTEGER WORKING STORAGE
+C TMPSIZ - SIZE OF FLOATING POINT WORKING STORAGE.
+C MMPYN - EXTERNAL ROUTINE: MATRIX-MATRIX MULTIPLY.
+C SMXPY - EXTERNAL ROUTINE: MATRIX-VECTOR MULTIPLY.
+C
+C OUTPUT PARAMETERS:
+C LNZ - ON OUTPUT, CONTAINS CHOLESKY FACTOR.
+C IFLAG - ERROR FLAG.
+C 0: SUCCESSFUL FACTORIZATION.
+C -1: NONPOSITIVE DIAGONAL ENCOUNTERED,
+C MATRIX IS NOT POSITIVE DEFINITE.
+C -2: INSUFFICIENT WORKING STORAGE
+C [TEMP(*)].
+C -3: INSUFFICIENT WORKING STORAGE
+C [IWORK(*)].
+C
+C WORKING PARAMETERS:
+C IWORK - INTEGER WORKING STORAGE OF LENGTH
+C 2*NEQNS + 2*NSUPER.
+C TMPVEC - DOUBLE PRECISION WORKING STORAGE OF LENGTH
+C NEQNS.
+C
+C***********************************************************************
+C
+ SUBROUTINE BLKFCT ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG , MMPYN ,
+ & SMXPY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ EXTERNAL MMPYN , SMXPY
+ INTEGER XLINDX(*) , XLNZ(*)
+ INTEGER IWORK(*) , LINDX(*) ,
+ & SNODE(*) , SPLIT(*) ,
+ & XSUPER(*)
+ INTEGER IFLAG , IWSIZ , NEQNS , NSUPER, TMPSIZ
+ DOUBLE PRECISION LNZ(*) , TMPVEC(*)
+C
+C*********************************************************************
+C
+ IFLAG = 0
+ IF ( IWSIZ .LT. 2*NEQNS+2*NSUPER ) THEN
+ IFLAG = -3
+ RETURN
+ ENDIF
+ CALL BLKFC2 ( NSUPER, XSUPER, SNODE , SPLIT , XLINDX,
+ & LINDX , XLNZ , LNZ ,
+ & IWORK(1) ,
+ & IWORK(NSUPER+1) ,
+ & IWORK(2*NSUPER+1) ,
+ & IWORK(2*NSUPER+NEQNS+1) ,
+ & TMPSIZ, TMPVEC, IFLAG , MMPYN , SMXPY )
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: March 6, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C********* BLKFC2 ..... BLOCK GENERAL SPARSE CHOLESKY *********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE FACTORS A SPARSE POSITIVE DEFINITE MATRIX.
+C THE COMPUTATION IS ORGANIZED AROUND KERNELS THAT PERFORM
+C SUPERNODE-TO-SUPERNODE UPDATES, I.E., BLOCK-TO-BLOCK UPDATES.
+C
+C INPUT PARAMETERS:
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - SUPERNODE PARTITION.
+C SNODE - MAPS EACH COLUMN TO THE SUPERNODE CONTAINING
+C IT.
+C SPLIT - SPLITTING OF SUPERNODES SO THAT THEY FIT
+C INTO CACHE.
+C (XLINDX,LINDX) - ROW INDICES FOR EACH SUPERNODE (INCLUDING
+C THE DIAGONAL ELEMENTS).
+C (XLNZ,LNZ) - ON INPUT, CONTAINS MATRIX TO BE FACTORED.
+C TMPSIZ - SIZE OF TEMPORARY WORKING STORAGE.
+C MMPYN - EXTERNAL ROUTINE: MATRIX-MATRIX MULTIPLY.
+C SMXPY - EXTERNAL ROUTINE: MATRIX-VECTOR MULTIPLY.
+C
+C OUTPUT PARAMETERS:
+C LNZ - ON OUTPUT, CONTAINS CHOLESKY FACTOR.
+C IFLAG - ERROR FLAG.
+C 0: SUCCESSFUL FACTORIZATION.
+C -1: NONPOSITIVE DIAGONAL ENCOUNTERED,
+C MATRIX IS NOT POSITIVE DEFINITE.
+C -2: INSUFFICIENT WORKING STORAGE
+C [TEMP(*)].
+C
+C WORKING PARAMETERS:
+C LINK - LINKS TOGETHER THE SUPERNODES IN A SUPERNODE
+C ROW.
+C LENGTH - LENGTH OF THE ACTIVE PORTION OF EACH
+C SUPERNODE.
+C INDMAP - VECTOR OF SIZE NEQNS INTO WHICH THE GLOBAL
+C INDICES ARE SCATTERED.
+C RELIND - MAPS LOCATIONS IN THE UPDATING COLUMNS TO
+C THE CORRESPONDING LOCATIONS IN THE UPDATED
+C COLUMNS. (RELIND IS GATHERED FROM INDMAP).
+C TEMP - REAL VECTOR FOR ACCUMULATING UPDATES. MUST
+C ACCOMODATE ALL COLUMNS OF A SUPERNODE.
+C
+C***********************************************************************
+C
+ SUBROUTINE BLKFC2 ( NSUPER, XSUPER, SNODE , SPLIT , XLINDX,
+ & LINDX , XLNZ , LNZ , LINK , LENGTH,
+ & INDMAP, RELIND, TMPSIZ, TEMP , IFLAG ,
+ & MMPYN , SMXPY )
+C
+C*********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ EXTERNAL MMPYN , SMXPY
+ INTEGER XLINDX(*) , XLNZ(*)
+ INTEGER INDMAP(*) , LENGTH(*) ,
+ & LINDX(*) , LINK(*) ,
+ & RELIND(*) , SNODE(*) ,
+ & SPLIT(*) , XSUPER(*)
+ INTEGER IFLAG , NSUPER, TMPSIZ
+ DOUBLE PRECISION LNZ(*) , TEMP(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER FJCOL , FKCOL , I , ILEN , ILPNT ,
+ & INDDIF, JLEN , JLPNT , JSUP , JXPNT ,
+ & KFIRST, KLAST , KLEN , KLPNT , KSUP ,
+ & KXPNT , LJCOL , NCOLUP, NJCOLS, NKCOLS,
+ & NXKSUP, NXTCOL, NXTSUP, STORE
+C
+C*********************************************************************
+C
+ IFLAG = 0
+C
+C -----------------------------------------------------------
+C INITIALIZE EMPTY ROW LISTS IN LINK(*) AND ZERO OUT TEMP(*).
+C -----------------------------------------------------------
+ DO 100 JSUP = 1, NSUPER
+ LINK(JSUP) = 0
+ 100 CONTINUE
+ DO 200 I = 1, TMPSIZ
+ TEMP(I) = 0.0D+00
+ 200 CONTINUE
+C
+C ---------------------------
+C FOR EACH SUPERNODE JSUP ...
+C ---------------------------
+ DO 600 JSUP = 1, NSUPER
+C
+C ------------------------------------------------
+C FJCOL ... FIRST COLUMN OF SUPERNODE JSUP.
+C LJCOL ... LAST COLUMN OF SUPERNODE JSUP.
+C NJCOLS ... NUMBER OF COLUMNS IN SUPERNODE JSUP.
+C JLEN ... LENGTH OF COLUMN FJCOL.
+C JXPNT ... POINTER TO INDEX OF FIRST
+C NONZERO IN COLUMN FJCOL.
+C ------------------------------------------------
+ FJCOL = XSUPER(JSUP)
+ NJCOLS = XSUPER(JSUP+1) - FJCOL
+ LJCOL = FJCOL + NJCOLS - 1
+ JLEN = XLNZ(FJCOL+1) - XLNZ(FJCOL)
+ JXPNT = XLINDX(JSUP)
+C
+C -----------------------------------------------------
+C SET UP INDMAP(*) TO MAP THE ENTRIES IN UPDATE COLUMNS
+C TO THEIR CORRESPONDING POSITIONS IN UPDATED COLUMNS,
+C RELATIVE THE BOTTOM OF EACH UPDATED COLUMN.
+C -----------------------------------------------------
+ CALL LDINDX ( JLEN, LINDX(JXPNT), INDMAP )
+C
+C -----------------------------------------
+C FOR EVERY SUPERNODE KSUP IN ROW(JSUP) ...
+C -----------------------------------------
+ KSUP = LINK(JSUP)
+ 300 IF ( KSUP .GT. 0 ) THEN
+ NXKSUP = LINK(KSUP)
+C
+C -------------------------------------------------------
+C GET INFO ABOUT THE CMOD(JSUP,KSUP) UPDATE.
+C
+C FKCOL ... FIRST COLUMN OF SUPERNODE KSUP.
+C NKCOLS ... NUMBER OF COLUMNS IN SUPERNODE KSUP.
+C KLEN ... LENGTH OF ACTIVE PORTION OF COLUMN FKCOL.
+C KXPNT ... POINTER TO INDEX OF FIRST NONZERO IN ACTIVE
+C PORTION OF COLUMN FJCOL.
+C -------------------------------------------------------
+ FKCOL = XSUPER(KSUP)
+ NKCOLS = XSUPER(KSUP+1) - FKCOL
+ KLEN = LENGTH(KSUP)
+ KXPNT = XLINDX(KSUP+1) - KLEN
+C
+C -------------------------------------------
+C PERFORM CMOD(JSUP,KSUP), WITH SPECIAL CASES
+C HANDLED DIFFERENTLY.
+C -------------------------------------------
+C
+ IF ( KLEN .NE. JLEN ) THEN
+C
+C -------------------------------------------
+C SPARSE CMOD(JSUP,KSUP).
+C
+C NCOLUP ... NUMBER OF COLUMNS TO BE UPDATED.
+C -------------------------------------------
+C
+ DO 400 I = 0, KLEN-1
+ NXTCOL = LINDX(KXPNT+I)
+ IF ( NXTCOL .GT. LJCOL ) GO TO 500
+ 400 CONTINUE
+ I = KLEN
+ 500 CONTINUE
+ NCOLUP = I
+C
+ IF ( NKCOLS .EQ. 1 ) THEN
+C
+C ----------------------------------------------
+C UPDATING TARGET SUPERNODE BY TRIVIAL
+C SUPERNODE (WITH ONE COLUMN).
+C
+C KLPNT ... POINTER TO FIRST NONZERO IN ACTIVE
+C PORTION OF COLUMN FKCOL.
+C ----------------------------------------------
+ KLPNT = XLNZ(FKCOL+1) - KLEN
+ CALL MMPYI ( KLEN, NCOLUP, LINDX(KXPNT),
+ & LNZ(KLPNT), XLNZ, LNZ, INDMAP )
+C
+ ELSE
+C
+C --------------------------------------------
+C KFIRST ... FIRST INDEX OF ACTIVE PORTION OF
+C SUPERNODE KSUP (FIRST COLUMN TO
+C BE UPDATED).
+C KLAST ... LAST INDEX OF ACTIVE PORTION OF
+C SUPERNODE KSUP.
+C --------------------------------------------
+C
+ KFIRST = LINDX(KXPNT)
+ KLAST = LINDX(KXPNT+KLEN-1)
+ INDDIF = INDMAP(KFIRST) - INDMAP(KLAST)
+C
+ IF ( INDDIF .LT. KLEN ) THEN
+C
+C ---------------------------------------
+C DENSE CMOD(JSUP,KSUP).
+C
+C ILPNT ... POINTER TO FIRST NONZERO IN
+C COLUMN KFIRST.
+C ILEN ... LENGTH OF COLUMN KFIRST.
+C ---------------------------------------
+ ILPNT = XLNZ(KFIRST)
+ ILEN = XLNZ(KFIRST+1) - ILPNT
+ CALL MMPY ( KLEN, NKCOLS, NCOLUP,
+ & SPLIT(FKCOL), XLNZ(FKCOL),
+ & LNZ, LNZ(ILPNT), ILEN, MMPYN )
+C
+ ELSE
+C
+C -------------------------------
+C GENERAL SPARSE CMOD(JSUP,KSUP).
+C COMPUTE CMOD(JSUP,KSUP) UPDATE
+C IN WORK STORAGE.
+C -------------------------------
+ STORE = KLEN * NCOLUP - NCOLUP *
+ & (NCOLUP-1) / 2
+ IF ( STORE .GT. TMPSIZ ) THEN
+ IFLAG = -2
+ RETURN
+ ENDIF
+ CALL MMPY ( KLEN, NKCOLS, NCOLUP,
+ & SPLIT(FKCOL), XLNZ(FKCOL),
+ & LNZ, TEMP, KLEN, MMPYN )
+C ----------------------------------------
+C GATHER INDICES OF KSUP RELATIVE TO JSUP.
+C ----------------------------------------
+ CALL IGATHR ( KLEN, LINDX(KXPNT),
+ & INDMAP, RELIND )
+C --------------------------------------
+C INCORPORATE THE CMOD(JSUP,KSUP) BLOCK
+C UPDATE INTO THE TO APPROPRIATE COLUMNS
+C OF L.
+C --------------------------------------
+ CALL ASSMB ( KLEN, NCOLUP, TEMP, RELIND,
+ & XLNZ(FJCOL), LNZ, JLEN )
+C
+ ENDIF
+C
+ ENDIF
+C
+ ELSE
+C
+C ----------------------------------------------
+C DENSE CMOD(JSUP,KSUP).
+C JSUP AND KSUP HAVE IDENTICAL STRUCTURE.
+C
+C JLPNT ... POINTER TO FIRST NONZERO IN COLUMN
+C FJCOL.
+C ----------------------------------------------
+ JLPNT = XLNZ(FJCOL)
+ CALL MMPY ( KLEN, NKCOLS, NJCOLS, SPLIT(FKCOL),
+ & XLNZ(FKCOL), LNZ, LNZ(JLPNT), JLEN,
+ & MMPYN )
+ NCOLUP = NJCOLS
+ IF ( KLEN .GT. NJCOLS ) THEN
+ NXTCOL = LINDX(JXPNT+NJCOLS)
+ ENDIF
+C
+ ENDIF
+C
+C ------------------------------------------------
+C LINK KSUP INTO LINKED LIST OF THE NEXT SUPERNODE
+C IT WILL UPDATE AND DECREMENT KSUP'S ACTIVE
+C LENGTH.
+C ------------------------------------------------
+ IF ( KLEN .GT. NCOLUP ) THEN
+ NXTSUP = SNODE(NXTCOL)
+ LINK(KSUP) = LINK(NXTSUP)
+ LINK(NXTSUP) = KSUP
+ LENGTH(KSUP) = KLEN - NCOLUP
+ ELSE
+ LENGTH(KSUP) = 0
+ ENDIF
+C
+C -------------------------------
+C NEXT UPDATING SUPERNODE (KSUP).
+C -------------------------------
+ KSUP = NXKSUP
+ GO TO 300
+C
+ ENDIF
+C
+C ----------------------------------------------
+C APPLY PARTIAL CHOLESKY TO THE COLUMNS OF JSUP.
+C ----------------------------------------------
+ CALL CHLSUP ( JLEN, NJCOLS, SPLIT(FJCOL), XLNZ(FJCOL), LNZ,
+ & IFLAG, MMPYN, SMXPY )
+ IF ( IFLAG .NE. 0 ) THEN
+ IFLAG = -1
+ RETURN
+ ENDIF
+C
+C -----------------------------------------------
+C INSERT JSUP INTO LINKED LIST OF FIRST SUPERNODE
+C IT WILL UPDATE.
+C -----------------------------------------------
+ IF ( JLEN .GT. NJCOLS ) THEN
+ NXTCOL = LINDX(JXPNT+NJCOLS)
+ NXTSUP = SNODE(NXTCOL)
+ LINK(JSUP) = LINK(NXTSUP)
+ LINK(NXTSUP) = JSUP
+ LENGTH(JSUP) = JLEN - NJCOLS
+ ELSE
+ LENGTH(JSUP) = 0
+ ENDIF
+C
+ 600 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** LDINDX .... LOAD INDEX VECTOR **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE COMPUTES THE SECOND INDEX VECTOR
+C USED TO IMPLEMENT THE DOUBLY-INDIRECT SAXPY-LIKE
+C LOOPS THAT ALLOW US TO ACCUMULATE UPDATE
+C COLUMNS DIRECTLY INTO FACTOR STORAGE.
+C
+C INPUT PARAMETERS -
+C JLEN - LENGTH OF THE FIRST COLUMN OF THE SUPERNODE,
+C INCLUDING THE DIAGONAL ENTRY.
+C LINDX - THE OFF-DIAGONAL ROW INDICES OF THE SUPERNODE,
+C I.E., THE ROW INDICES OF THE NONZERO ENTRIES
+C LYING BELOW THE DIAGONAL ENTRY OF THE FIRST
+C COLUMN OF THE SUPERNODE.
+C
+C OUTPUT PARAMETERS -
+C INDMAP - THIS INDEX VECTOR MAPS EVERY GLOBAL ROW INDEX
+C OF NONZERO ENTRIES IN THE FIRST COLUMN OF THE
+C SUPERNODE TO ITS POSITION IN THE INDEX LIST
+C RELATIVE TO THE LAST INDEX IN THE LIST. MORE
+C PRECISELY, IT GIVES THE DISTANCE OF EACH INDEX
+C FROM THE LAST INDEX IN THE LIST.
+C
+C***********************************************************************
+C
+ SUBROUTINE LDINDX ( JLEN, LINDX, INDMAP )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER JLEN
+ INTEGER LINDX(*), INDMAP(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER CURLEN, J , JSUB
+C
+C***********************************************************************
+C
+ CURLEN = JLEN
+ DO 200 J = 1, JLEN
+ JSUB = LINDX(J)
+ CURLEN = CURLEN - 1
+ INDMAP(JSUB) = CURLEN
+ 200 CONTINUE
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* MMPYI .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C MATRIX X HAS ONLY 1 COLUMN.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C IY(*) - IY(COL) POINTS TO THE BEGINNING OF COLUMN
+C RELIND(*) - RELATIVE INDICES.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPYI ( M , Q , XPNT , X , IY ,
+ & Y , RELIND )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER M , Q
+ INTEGER IY(*) , RELIND(*) ,
+ & XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER COL , I , ISUB , K , YLAST
+ DOUBLE PRECISION A
+C
+C***********************************************************************
+C
+ DO 200 K = 1, Q
+ COL = XPNT(K)
+ YLAST = IY(COL+1) - 1
+ A = - X(K)
+CDIR$ IVDEP
+ DO 100 I = K, M
+ ISUB = XPNT(I)
+ ISUB = YLAST - RELIND(ISUB)
+ Y(ISUB) = Y(ISUB) + A*X(I)
+ 100 CONTINUE
+ 200 CONTINUE
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************** MMPY .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C N - NUMBER OF COLUMNS IN X AND NUMBER OF ROWS
+C IN A.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C SPLIT(*) - BLOCK PARTITIONING OF X.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C LDY - LENGTH OF FIRST COLUMN OF Y.
+C MMPYN - EXTERNAL ROUTINE: MATRIX-MATRIX MULTIPLY,
+C WITH LEVEL N LOOP UNROLLING.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPY ( M , N , Q , SPLIT , XPNT ,
+ & X , Y , LDY , MMPYN )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ EXTERNAL MMPYN
+ INTEGER LDY , M , N , Q
+ INTEGER SPLIT(*) , XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER BLK , FSTCOL, NN
+C
+C***********************************************************************
+C
+ BLK = 1
+ FSTCOL = 1
+ 100 CONTINUE
+ IF ( FSTCOL .LE. N ) THEN
+ NN = SPLIT(BLK)
+ CALL MMPYN ( M, NN, Q, XPNT(FSTCOL), X, Y, LDY )
+ FSTCOL = FSTCOL + NN
+ BLK = BLK + 1
+ GO TO 100
+ ENDIF
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* MMPY1 .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C LOOP UNROLLING: LEVEL 1
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C N - NUMBER OF COLUMNS IN X AND NUMBER OF ROWS
+C IN A.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C LDY - LENGTH OF FIRST COLUMN OF Y.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPY1 ( M , N , Q , XPNT , X ,
+ & Y , LDY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER LDY , M , N , Q
+ INTEGER XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I1
+ INTEGER IY , IYLAST, IYSTRT, IYSTOP, LENY ,
+ & MM , XCOL , YCOL
+ DOUBLE PRECISION A1
+C
+C***********************************************************************
+C
+ MM = M
+ IYLAST = 0
+ LENY = LDY
+C ------------------------------------
+C TO COMPUTE EACH COLUMN YCOL OF Y ...
+C ------------------------------------
+ DO 300 YCOL = 1, Q
+ IYSTRT = IYLAST + 1
+ IYSTOP = IYSTRT + MM - 1
+ IYLAST = IYLAST + LENY
+C --------------------------------------------------
+C ... PERFORM THE APPROPRATE MATRIX VECTOR MULTIPLY:
+C X * A(*,YCOL).
+C --------------------------------------------------
+ DO 200 XCOL = 1, N
+ I1 = XPNT(XCOL+1) - MM
+ A1 = - X(I1)
+ DO 100 IY = IYSTRT, IYSTOP
+ Y(IY) = Y(IY) + A1 * X(I1)
+ I1 = I1 + 1
+ 100 CONTINUE
+ 200 CONTINUE
+ MM = MM - 1
+ LENY = LENY - 1
+ 300 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* MMPY2 .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C LOOP UNROLLING: LEVEL 2
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C N - NUMBER OF COLUMNS IN X AND NUMBER OF ROWS
+C IN A.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C LDY - LENGTH OF FIRST COLUMN OF Y.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPY2 ( M , N , Q , XPNT , X ,
+ & Y , LDY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER LDY , M , N , Q
+ INTEGER XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I1 , I2
+ INTEGER IY , IYLAST, IYSTRT, IYSTOP, LENY ,
+ & MM , REMAIN, XCOL , YCOL
+ DOUBLE PRECISION A1 , A2
+C
+ INTEGER LEVEL
+ PARAMETER ( LEVEL = 2 )
+C
+C***********************************************************************
+C
+C -----------------------------------------------------------
+C INITIAL OFFSETS, COLUMN LENGTHS, AND INDEX RANGE VARIABLES.
+C -----------------------------------------------------------
+ REMAIN = MOD ( N, LEVEL ) + 1
+ MM = M
+ IYLAST = 0
+ LENY = LDY
+C
+C ------------------------------------
+C TO COMPUTE EACH COLUMN YCOL OF Y ...
+C ------------------------------------
+C
+ DO 500 YCOL = 1, Q
+C
+ IYSTRT = IYLAST + 1
+ IYSTOP = IYSTRT + MM - 1
+ IYLAST = IYLAST + LENY
+C
+C --------------------------------------------------
+C ... PERFORM THE APPROPRATE MATRIX VECTOR MULTIPLY:
+C X * A(*,YCOL) WITH LEVEL 2 LOOP-UNROLLING.
+C --------------------------------------------------
+ GO TO ( 200, 100 ), REMAIN
+C
+ 100 CONTINUE
+ I1 = XPNT(1+1) - MM
+ A1 = - X(I1)
+ DO 150 IY = IYSTRT, IYSTOP
+ Y(IY) = Y(IY) + A1*X(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 200
+C
+ 200 CONTINUE
+ DO 400 XCOL = REMAIN, N, LEVEL
+ I1 = XPNT(XCOL+1) - MM
+ I2 = XPNT(XCOL+2) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ DO 300 IY = IYSTRT, IYSTOP
+ Y(IY) = ( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 300 CONTINUE
+ 400 CONTINUE
+C
+ MM = MM - 1
+ LENY = LENY - 1
+C
+ 500 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* MMPY4 .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C LOOP UNROLLING: LEVEL 4
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C N - NUMBER OF COLUMNS IN X AND NUMBER OF ROWS
+C IN A.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C LDY - LENGTH OF FIRST COLUMN OF Y.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPY4 ( M , N , Q , XPNT , X ,
+ & Y , LDY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER LDY , M , N , Q
+ INTEGER XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I1 , I2 , I3 , I4
+ INTEGER IY , IYLAST, IYSTRT, IYSTOP, LENY ,
+ & MM , REMAIN, XCOL , YCOL
+ DOUBLE PRECISION A1 , A2 , A3 , A4
+C
+ INTEGER LEVEL
+ PARAMETER ( LEVEL = 4 )
+C
+C***********************************************************************
+C
+C -----------------------------------------------------------
+C INITIAL OFFSETS, COLUMN LENGTHS, AND INDEX RANGE VARIABLES.
+C -----------------------------------------------------------
+ REMAIN = MOD ( N, LEVEL ) + 1
+ MM = M
+ IYLAST = 0
+ LENY = LDY
+C
+C ------------------------------------
+C TO COMPUTE EACH COLUMN YCOL OF Y ...
+C ------------------------------------
+C
+ DO 700 YCOL = 1, Q
+C
+ IYSTRT = IYLAST + 1
+ IYSTOP = IYSTRT + MM - 1
+ IYLAST = IYLAST + LENY
+C
+C --------------------------------------------------
+C ... PERFORM THE APPROPRATE MATRIX VECTOR MULTIPLY:
+C X * A(*,YCOL) WITH LEVEL 4 LOOP-UNROLLING.
+C --------------------------------------------------
+C
+ GO TO ( 400, 100, 200, 300 ), REMAIN
+C
+ 100 CONTINUE
+ I1 = XPNT(1+1) - MM
+ A1 = - X(I1)
+ DO 150 IY = IYSTRT, IYSTOP
+ Y(IY) = Y(IY) + A1*X(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 400
+C
+ 200 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ DO 250 IY = IYSTRT, IYSTOP
+ Y(IY) = ( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 250 CONTINUE
+ GO TO 400
+C
+ 300 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ DO 350 IY = IYSTRT, IYSTOP
+ Y(IY) = (( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ 350 CONTINUE
+ GO TO 400
+C
+ 400 CONTINUE
+ DO 600 XCOL = REMAIN, N, LEVEL
+ I1 = XPNT(XCOL+1) - MM
+ I2 = XPNT(XCOL+2) - MM
+ I3 = XPNT(XCOL+3) - MM
+ I4 = XPNT(XCOL+4) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ DO 500 IY = IYSTRT, IYSTOP
+ Y(IY) = ((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ 500 CONTINUE
+ 600 CONTINUE
+C
+ MM = MM - 1
+ LENY = LENY - 1
+C
+ 700 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* MMPY8 .... MATRIX-MATRIX MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE -
+C THIS ROUTINE PERFORMS A MATRIX-MATRIX MULTIPLY, Y = Y + XA,
+C ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE CHOLESKY
+C CODES.
+C
+C LOOP UNROLLING: LEVEL 8
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS IN X AND IN Y.
+C N - NUMBER OF COLUMNS IN X AND NUMBER OF ROWS
+C IN A.
+C Q - NUMBER OF COLUMNS IN A AND Y.
+C XPNT(*) - XPNT(J+1) POINTS ONE LOCATION BEYOND THE
+C END OF THE J-TH COLUMN OF X. XPNT IS ALSO
+C USED TO ACCESS THE ROWS OF A.
+C X(*) - CONTAINS THE COLUMNS OF X AND THE ROWS OF A.
+C LDY - LENGTH OF FIRST COLUMN OF Y.
+C
+C UPDATED PARAMETERS -
+C Y(*) - ON OUTPUT, Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMPY8 ( M , N , Q , XPNT , X ,
+ & Y , LDY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER LDY , M , N , Q
+ INTEGER XPNT(*)
+ DOUBLE PRECISION X(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I1 , I2 , I3 , I4 , I5 ,
+ & I6 , I7 , I8
+ INTEGER IY , IYLAST, IYSTRT, IYSTOP, LENY ,
+ & MM , REMAIN, XCOL , YCOL
+ DOUBLE PRECISION A1 , A2 , A3 , A4 , A5 ,
+ & A6 , A7 , A8
+C
+ INTEGER LEVEL
+ PARAMETER ( LEVEL = 8 )
+C
+C***********************************************************************
+C
+C -----------------------------------------------------------
+C INITIAL OFFSETS, COLUMN LENGTHS, AND INDEX RANGE VARIABLES.
+C -----------------------------------------------------------
+ REMAIN = MOD ( N, LEVEL ) + 1
+ MM = M
+ IYLAST = 0
+ LENY = LDY
+C
+C ------------------------------------
+C TO COMPUTE EACH COLUMN YCOL OF Y ...
+C ------------------------------------
+C
+ DO 1100 YCOL = 1, Q
+C
+ IYSTRT = IYLAST + 1
+ IYSTOP = IYSTRT + MM - 1
+ IYLAST = IYLAST + LENY
+C
+C --------------------------------------------------
+C ... PERFORM THE APPROPRATE MATRIX VECTOR MULTIPLY:
+C X * A(*,YCOL) WITH LEVEL 8 LOOP-UNROLLING.
+C --------------------------------------------------
+C
+ GO TO ( 800, 100, 200, 300, 400, 500, 600, 700 ), REMAIN
+C
+ 100 CONTINUE
+ I1 = XPNT(1+1) - MM
+ A1 = - X(I1)
+ DO 150 IY = IYSTRT, IYSTOP
+ Y(IY) = Y(IY) + A1*X(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 800
+C
+ 200 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ DO 250 IY = IYSTRT, IYSTOP
+ Y(IY) = ( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 250 CONTINUE
+ GO TO 800
+C
+ 300 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ DO 350 IY = IYSTRT, IYSTOP
+ Y(IY) = (( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ 350 CONTINUE
+ GO TO 800
+C
+ 400 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ I4 = XPNT(1+4) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ DO 450 IY = IYSTRT, IYSTOP
+ Y(IY) = ((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ 450 CONTINUE
+ GO TO 800
+C
+ 500 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ I4 = XPNT(1+4) - MM
+ I5 = XPNT(1+5) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ A5 = - X(I5)
+ DO 550 IY = IYSTRT, IYSTOP
+ Y(IY) = (((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4))
+ & + A5*X(I5)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ 550 CONTINUE
+ GO TO 800
+C
+ 600 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ I4 = XPNT(1+4) - MM
+ I5 = XPNT(1+5) - MM
+ I6 = XPNT(1+6) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ A5 = - X(I5)
+ A6 = - X(I6)
+ DO 650 IY = IYSTRT, IYSTOP
+ Y(IY) = ((((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4))
+ & + A5*X(I5)) + A6*X(I6)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ 650 CONTINUE
+ GO TO 800
+C
+ 700 CONTINUE
+ I1 = XPNT(1+1) - MM
+ I2 = XPNT(1+2) - MM
+ I3 = XPNT(1+3) - MM
+ I4 = XPNT(1+4) - MM
+ I5 = XPNT(1+5) - MM
+ I6 = XPNT(1+6) - MM
+ I7 = XPNT(1+7) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ A5 = - X(I5)
+ A6 = - X(I6)
+ A7 = - X(I7)
+ DO 750 IY = IYSTRT, IYSTOP
+ Y(IY) = (((((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4))
+ & + A5*X(I5)) + A6*X(I6))
+ & + A7*X(I7)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ I7 = I7 + 1
+ 750 CONTINUE
+ GO TO 800
+C
+ 800 CONTINUE
+ DO 1000 XCOL = REMAIN, N, LEVEL
+ I1 = XPNT(XCOL+1) - MM
+ I2 = XPNT(XCOL+2) - MM
+ I3 = XPNT(XCOL+3) - MM
+ I4 = XPNT(XCOL+4) - MM
+ I5 = XPNT(XCOL+5) - MM
+ I6 = XPNT(XCOL+6) - MM
+ I7 = XPNT(XCOL+7) - MM
+ I8 = XPNT(XCOL+8) - MM
+ A1 = - X(I1)
+ A2 = - X(I2)
+ A3 = - X(I3)
+ A4 = - X(I4)
+ A5 = - X(I5)
+ A6 = - X(I6)
+ A7 = - X(I7)
+ A8 = - X(I8)
+ DO 900 IY = IYSTRT, IYSTOP
+ Y(IY) = ((((((( (Y(IY))
+ & + A1*X(I1)) + A2*X(I2))
+ & + A3*X(I3)) + A4*X(I4))
+ & + A5*X(I5)) + A6*X(I6))
+ & + A7*X(I7)) + A8*X(I8)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ I7 = I7 + 1
+ I8 = I8 + 1
+ 900 CONTINUE
+ 1000 CONTINUE
+C
+ MM = MM - 1
+ LENY = LENY - 1
+C
+ 1100 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** IGATHR .... INTEGER GATHER OPERATION **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS A STANDARD INTEGER GATHER
+C OPERATION.
+C
+C INPUT PARAMETERS -
+C KLEN - LENGTH OF THE LIST OF GLOBAL INDICES.
+C LINDX - LIST OF GLOBAL INDICES.
+C INDMAP - INDEXED BY GLOBAL INDICES, IT CONTAINS THE
+C REQUIRED RELATIVE INDICES.
+C
+C OUTPUT PARAMETERS -
+C RELIND - LIST RELATIVE INDICES.
+C
+C***********************************************************************
+C
+ SUBROUTINE IGATHR ( KLEN , LINDX, INDMAP, RELIND )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER KLEN
+ INTEGER INDMAP(*), LINDX (*), RELIND(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER I
+C
+C***********************************************************************
+C
+CDIR$ IVDEP
+ DO 100 I = 1, KLEN
+ RELIND(I) = INDMAP(LINDX(I))
+ 100 CONTINUE
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************ ASSMB .... INDEXED ASSEMBLY OPERATION ************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS ROUTINE PERFORMS AN INDEXED ASSEMBLY (I.E., SCATTER-ADD)
+C OPERATION, ASSUMING DATA STRUCTURES USED IN SOME OF OUR SPARSE
+C CHOLESKY CODES.
+C
+C INPUT PARAMETERS:
+C M - NUMBER OF ROWS IN Y.
+C Q - NUMBER OF COLUMNS IN Y.
+C Y - BLOCK UPDATE TO BE INCORPORATED INTO FACTOR
+C STORAGE.
+C RELIND - RELATIVE INDICES FOR MAPPING THE UPDATES
+C ONTO THE TARGET COLUMNS.
+C XLNZ - POINTERS TO THE START OF EACH COLUMN IN THE
+C TARGET MATRIX.
+C
+C OUTPUT PARAMETERS:
+C LNZ - CONTAINS COLUMNS MODIFIED BY THE UPDATE
+C MATRIX.
+C
+C***********************************************************************
+C
+ SUBROUTINE ASSMB ( M , Q , Y , RELIND, XLNZ ,
+ & LNZ , LDA )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER LDA , M , Q
+ INTEGER XLNZ(*)
+ INTEGER RELIND(*)
+ DOUBLE PRECISION LNZ(*) , Y(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER ICOL , IL1 , IR , IY1 , LBOT1 ,
+ & YCOL , YOFF1
+C
+C***********************************************************************
+C
+C
+ YOFF1 = 0
+ DO 200 ICOL = 1, Q
+ YCOL = LDA - RELIND(ICOL)
+ LBOT1 = XLNZ(YCOL+1) - 1
+CDIR$ IVDEP
+ DO 100 IR = ICOL, M
+ IL1 = LBOT1 - RELIND(IR)
+ IY1 = YOFF1 + IR
+ LNZ(IL1) = LNZ(IL1) + Y(IY1)
+ Y(IY1) = 0.0D0
+ 100 CONTINUE
+ YOFF1 = IY1 - ICOL
+ 200 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** CHLSUP .... DENSE CHOLESKY WITHIN SUPERNODE **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS CHOLESKY
+C FACTORIZATION ON THE COLUMNS OF A SUPERNODE
+C THAT HAVE RECEIVED ALL UPDATES FROM COLUMNS
+C EXTERNAL TO THE SUPERNODE.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS (LENGTH OF THE FIRST COLUMN).
+C N - NUMBER OF COLUMNS IN THE SUPERNODE.
+C XPNT - XPNT(J+1) POINTS ONE LOCATION BEYOND THE END
+C OF THE J-TH COLUMN OF THE SUPERNODE.
+C X(*) - CONTAINS THE COLUMNS OF OF THE SUPERNODE TO
+C BE FACTORED.
+C SMXPY - EXTERNAL ROUTINE: MATRIX-VECTOR MULTIPLY.
+C
+C OUTPUT PARAMETERS -
+C X(*) - ON OUTPUT, CONTAINS THE FACTORED COLUMNS OF
+C THE SUPERNODE.
+C IFLAG - UNCHANGED IF THERE IS NO ERROR.
+C =1 IF NONPOSITIVE DIAGONAL ENTRY IS ENCOUNTERED.
+C
+C***********************************************************************
+C
+ SUBROUTINE CHLSUP ( M, N, SPLIT, XPNT, X, IFLAG, MMPYN,
+ & SMXPY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ EXTERNAL MMPYN, SMXPY
+C
+ INTEGER M, N, IFLAG
+C
+ INTEGER XPNT(*), SPLIT(*)
+C
+ DOUBLE PRECISION X(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER FSTCOL, JBLK , JPNT , MM , NN ,
+ & NXTCOL, Q
+C
+C***********************************************************************
+C
+ JBLK = 0
+ FSTCOL = 1
+ MM = M
+ JPNT = XPNT(FSTCOL)
+C
+C ----------------------------------------
+C FOR EACH BLOCK JBLK IN THE SUPERNODE ...
+C ----------------------------------------
+ 100 CONTINUE
+ IF ( FSTCOL .LE. N ) THEN
+ JBLK = JBLK + 1
+ NN = SPLIT(JBLK)
+C ------------------------------------------
+C ... PERFORM PARTIAL CHOLESKY FACTORIZATION
+C ON THE BLOCK.
+C ------------------------------------------
+ CALL PCHOL ( MM, NN, XPNT(FSTCOL), X, IFLAG, SMXPY )
+ IF ( IFLAG .EQ. 1 ) RETURN
+C ----------------------------------------------
+C ... APPLY THE COLUMNS IN JBLK TO ANY COLUMNS
+C OF THE SUPERNODE REMAINING TO BE COMPUTED.
+C ----------------------------------------------
+ NXTCOL = FSTCOL + NN
+ Q = N - NXTCOL + 1
+ MM = MM - NN
+ JPNT = XPNT(NXTCOL)
+ IF ( Q .GT. 0 ) THEN
+ CALL MMPYN ( MM, NN, Q, XPNT(FSTCOL), X, X(JPNT), MM )
+ ENDIF
+ FSTCOL = NXTCOL
+ GO TO 100
+ ENDIF
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** PCHOL .... DENSE PARTIAL CHOLESKY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS CHOLESKY
+C FACTORIZATION ON THE COLUMNS OF A SUPERNODE
+C THAT HAVE RECEIVED ALL UPDATES FROM COLUMNS
+C EXTERNAL TO THE SUPERNODE.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS (LENGTH OF THE FIRST COLUMN).
+C N - NUMBER OF COLUMNS IN THE SUPERNODE.
+C XPNT - XPNT(J+1) POINTS ONE LOCATION BEYOND THE END
+C OF THE J-TH COLUMN OF THE SUPERNODE.
+C X(*) - CONTAINS THE COLUMNS OF OF THE SUPERNODE TO
+C BE FACTORED.
+C SMXPY - EXTERNAL ROUTINE: MATRIX-VECTOR MULTIPLY.
+C
+C OUTPUT PARAMETERS -
+C X(*) - ON OUTPUT, CONTAINS THE FACTORED COLUMNS OF
+C THE SUPERNODE.
+C IFLAG - UNCHANGED IF THERE IS NO ERROR.
+C =1 IF NONPOSITIVE DIAGONAL ENTRY IS ENCOUNTERED.
+C
+C***********************************************************************
+C
+ SUBROUTINE PCHOL ( M, N, XPNT, X, IFLAG, SMXPY )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ EXTERNAL SMXPY
+C
+ INTEGER M, N, IFLAG
+C
+ INTEGER XPNT(*)
+C
+ DOUBLE PRECISION X(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER JPNT , JCOL , MM
+C
+ DOUBLE PRECISION DIAG
+ DOUBLE PRECISION MXDIAG
+C
+C***********************************************************************
+C
+C ------------------------------------------
+C FOR EVERY COLUMN JCOL IN THE SUPERNODE ...
+C ------------------------------------------
+ MM = M
+ JPNT = XPNT(1)
+ MXDIAG = 1.D+0
+ DO 100 JCOL = 1, N
+C
+C ----------------------------------
+C UPDATE JCOL WITH PREVIOUS COLUMNS.
+C ----------------------------------
+ IF ( JCOL .GT. 1 ) THEN
+ CALL SMXPY ( MM, JCOL-1, X(JPNT), XPNT, X )
+ ENDIF
+C
+C ---------------------------
+C COMPUTE THE DIAGONAL ENTRY.
+C ---------------------------
+ DIAG = X(JPNT)
+ MXDIAG = MAX ( MXDIAG , DIAG )
+ IF ( DIAG .LE. MIN(1.0D-15*MXDIAG, 1.0D-10) ) THEN
+ DIAG = 1.0D+128
+ ENDIF
+ DIAG = SQRT ( DIAG )
+ X(JPNT) = DIAG
+ DIAG = 1.0D+00 / DIAG
+C
+C ----------------------------------------------------
+C SCALE COLUMN JCOL WITH RECIPROCAL OF DIAGONAL ENTRY.
+C ----------------------------------------------------
+ MM = MM - 1
+ JPNT = JPNT + 1
+ CALL DSCAL ( MM, DIAG, X(JPNT),1)
+ JPNT = JPNT + MM
+C
+ 100 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** SMXPY1 .... MATRIX-VECTOR MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS A MATRIX-VECTOR MULTIPLY,
+C Y = Y + AX, ASSUMING DATA STRUCTURES USED IN
+C RECENTLY DEVELOPED SPARSE CHOLESKY CODES. THE
+C '1' SIGNIFIES NO LOOP UNROLLING, I.E.,
+C LOOP-UNROLLING TO LEVEL 1.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS.
+C N - NUMBER OF COLUMNS.
+C Y - M-VECTOR TO WHICH AX WILL BE ADDED.
+C APNT - INDEX VECTOR FOR A. XA(I) POINTS TO THE
+C FIRST NONZERO IN COLUMN I OF A.
+C Y - ON OUTPUT, CONTAINS Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE SMXPY1 ( M, N, Y, APNT, A )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER M, N
+C
+ INTEGER APNT(N)
+C
+ DOUBLE PRECISION Y(M), A(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I, II, J
+C
+ DOUBLE PRECISION AMULT
+C
+C***********************************************************************
+C
+ DO 200 J = 1, N
+ II = APNT(J+1) - M
+ AMULT = - A(II)
+ DO 100 I = 1, M
+ Y(I) = Y(I) + AMULT * A(II)
+ II = II + 1
+ 100 CONTINUE
+ 200 CONTINUE
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** SMXPY2 .... MATRIX-VECTOR MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS A MATRIX-VECTOR MULTIPLY,
+C Y = Y + AX, ASSUMING DATA STRUCTURES USED IN
+C RECENTLY DEVELOPED SPARSE CHOLESKY CODES. THE
+C '2' SIGNIFIES LEVEL 2 LOOP UNROLLING.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS.
+C N - NUMBER OF COLUMNS.
+C Y - M-VECTOR TO WHICH AX WILL BE ADDED.
+C APNT - INDEX VECTOR FOR A. XA(I) POINTS TO THE
+C FIRST NONZERO IN COLUMN I OF A.
+C Y - ON OUTPUT, CONTAINS Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE SMXPY2 ( M, N, Y, APNT, A )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER M, N, LEVEL
+C
+ INTEGER APNT(*)
+C
+ DOUBLE PRECISION Y(*), A(*)
+C
+ PARAMETER ( LEVEL = 2 )
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I, I1, I2,
+ & J, REMAIN
+C
+ DOUBLE PRECISION A1, A2
+C
+C***********************************************************************
+C
+ REMAIN = MOD ( N, LEVEL )
+C
+ GO TO ( 2000, 100 ), REMAIN+1
+C
+ 100 CONTINUE
+ I1 = APNT(1+1) - M
+ A1 = - A(I1)
+ DO 150 I = 1, M
+ Y(I) = Y(I) + A1*A(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 2000
+C
+ 2000 CONTINUE
+ DO 4000 J = REMAIN+1, N, LEVEL
+ I1 = APNT(J+1) - M
+ I2 = APNT(J+2) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ DO 3000 I = 1, M
+ Y(I) = ( (Y(I)) +
+ & A1*A(I1)) + A2*A(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 3000 CONTINUE
+ 4000 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** SMXPY4 .... MATRIX-VECTOR MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS A MATRIX-VECTOR MULTIPLY,
+C Y = Y + AX, ASSUMING DATA STRUCTURES USED IN
+C RECENTLY DEVELOPED SPARSE CHOLESKY CODES. THE
+C '4' SIGNIFIES LEVEL 4 LOOP UNROLLING.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS.
+C N - NUMBER OF COLUMNS.
+C Y - M-VECTOR TO WHICH AX WILL BE ADDED.
+C APNT - INDEX VECTOR FOR A. XA(I) POINTS TO THE
+C FIRST NONZERO IN COLUMN I OF A.
+C Y - ON OUTPUT, CONTAINS Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE SMXPY4 ( M, N, Y, APNT, A )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER M, N, LEVEL
+C
+ INTEGER APNT(*)
+C
+ DOUBLE PRECISION Y(*), A(*)
+C
+ PARAMETER ( LEVEL = 4 )
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I, I1, I2, I3, I4,
+ & J, REMAIN
+C
+ DOUBLE PRECISION A1, A2, A3, A4
+C
+C***********************************************************************
+C
+ REMAIN = MOD ( N, LEVEL )
+C
+ GO TO ( 2000, 100, 200, 300 ), REMAIN+1
+C
+ 100 CONTINUE
+ I1 = APNT(1+1) - M
+ A1 = - A(I1)
+ DO 150 I = 1, M
+ Y(I) = Y(I) + A1*A(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 2000
+C
+ 200 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ DO 250 I = 1, M
+ Y(I) = ( (Y(I))
+ & + A1*A(I1)) + A2*A(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 250 CONTINUE
+ GO TO 2000
+C
+ 300 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ DO 350 I = 1, M
+ Y(I) = (( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ 350 CONTINUE
+ GO TO 2000
+C
+ 2000 CONTINUE
+ DO 4000 J = REMAIN+1, N, LEVEL
+ I1 = APNT(J+1) - M
+ I2 = APNT(J+2) - M
+ I3 = APNT(J+3) - M
+ I4 = APNT(J+4) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ DO 3000 I = 1, M
+ Y(I) = ((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ 3000 CONTINUE
+ 4000 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** SMXPY8 .... MATRIX-VECTOR MULTIPLY **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS A MATRIX-VECTOR MULTIPLY,
+C Y = Y + AX, ASSUMING DATA STRUCTURES USED IN
+C RECENTLY DEVELOPED SPARSE CHOLESKY CODES. THE
+C '8' SIGNIFIES LEVEL 8 LOOP UNROLLING.
+C
+C INPUT PARAMETERS -
+C M - NUMBER OF ROWS.
+C N - NUMBER OF COLUMNS.
+C Y - M-VECTOR TO WHICH AX WILL BE ADDED.
+C APNT - INDEX VECTOR FOR A. APNT(I) POINTS TO THE
+C FIRST NONZERO IN COLUMN I OF A.
+C Y - ON OUTPUT, CONTAINS Y = Y + AX.
+C
+C***********************************************************************
+C
+ SUBROUTINE SMXPY8 ( M, N, Y, APNT, A )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER M, N, LEVEL
+C
+ INTEGER APNT(*)
+C
+ DOUBLE PRECISION Y(*), A(*)
+C
+ PARAMETER ( LEVEL = 8 )
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+C
+ INTEGER I, I1, I2, I3, I4, I5, I6, I7, I8,
+ & J, REMAIN
+C
+ DOUBLE PRECISION A1, A2, A3, A4, A5, A6, A7, A8
+C
+C***********************************************************************
+C
+ REMAIN = MOD ( N, LEVEL )
+C
+ GO TO ( 2000, 100, 200, 300,
+ & 400, 500, 600, 700 ), REMAIN+1
+C
+ 100 CONTINUE
+ I1 = APNT(1+1) - M
+ A1 = - A(I1)
+ DO 150 I = 1, M
+ Y(I) = Y(I) + A1*A(I1)
+ I1 = I1 + 1
+ 150 CONTINUE
+ GO TO 2000
+C
+ 200 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ DO 250 I = 1, M
+ Y(I) = ( (Y(I))
+ & + A1*A(I1)) + A2*A(I2)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ 250 CONTINUE
+ GO TO 2000
+C
+ 300 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ DO 350 I = 1, M
+ Y(I) = (( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ 350 CONTINUE
+ GO TO 2000
+C
+ 400 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ I4 = APNT(1+4) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ DO 450 I = 1, M
+ Y(I) = ((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ 450 CONTINUE
+ GO TO 2000
+C
+ 500 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ I4 = APNT(1+4) - M
+ I5 = APNT(1+5) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ A5 = - A(I5)
+ DO 550 I = 1, M
+ Y(I) = (((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4))
+ & + A5*A(I5)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ 550 CONTINUE
+ GO TO 2000
+C
+ 600 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ I4 = APNT(1+4) - M
+ I5 = APNT(1+5) - M
+ I6 = APNT(1+6) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ A5 = - A(I5)
+ A6 = - A(I6)
+ DO 650 I = 1, M
+ Y(I) = ((((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4))
+ & + A5*A(I5)) + A6*A(I6)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ 650 CONTINUE
+ GO TO 2000
+C
+ 700 CONTINUE
+ I1 = APNT(1+1) - M
+ I2 = APNT(1+2) - M
+ I3 = APNT(1+3) - M
+ I4 = APNT(1+4) - M
+ I5 = APNT(1+5) - M
+ I6 = APNT(1+6) - M
+ I7 = APNT(1+7) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ A5 = - A(I5)
+ A6 = - A(I6)
+ A7 = - A(I7)
+ DO 750 I = 1, M
+ Y(I) = (((((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4))
+ & + A5*A(I5)) + A6*A(I6))
+ & + A7*A(I7)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ I7 = I7 + 1
+ 750 CONTINUE
+ GO TO 2000
+C
+ 2000 CONTINUE
+ DO 4000 J = REMAIN+1, N, LEVEL
+ I1 = APNT(J+1) - M
+ I2 = APNT(J+2) - M
+ I3 = APNT(J+3) - M
+ I4 = APNT(J+4) - M
+ I5 = APNT(J+5) - M
+ I6 = APNT(J+6) - M
+ I7 = APNT(J+7) - M
+ I8 = APNT(J+8) - M
+ A1 = - A(I1)
+ A2 = - A(I2)
+ A3 = - A(I3)
+ A4 = - A(I4)
+ A5 = - A(I5)
+ A6 = - A(I6)
+ A7 = - A(I7)
+ A8 = - A(I8)
+ DO 3000 I = 1, M
+ Y(I) = ((((((( (Y(I))
+ & + A1*A(I1)) + A2*A(I2))
+ & + A3*A(I3)) + A4*A(I4))
+ & + A5*A(I5)) + A6*A(I6))
+ & + A7*A(I7)) + A8*A(I8)
+ I1 = I1 + 1
+ I2 = I2 + 1
+ I3 = I3 + 1
+ I4 = I4 + 1
+ I5 = I5 + 1
+ I6 = I6 + 1
+ I7 = I7 + 1
+ I8 = I8 + 1
+ 3000 CONTINUE
+ 4000 CONTINUE
+C
+ RETURN
+ END
diff --git a/modules/sparse/src/fortran/blkfct.lo b/modules/sparse/src/fortran/blkfct.lo
new file mode 100755
index 000000000..c8bad3c62
--- /dev/null
+++ b/modules/sparse/src/fortran/blkfct.lo
@@ -0,0 +1,12 @@
+# src/fortran/blkfct.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/blkfct.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/blkslv.f b/modules/sparse/src/fortran/blkslv.f
new file mode 100755
index 000000000..2a2ed65f2
--- /dev/null
+++ b/modules/sparse/src/fortran/blkslv.f
@@ -0,0 +1,104 @@
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C********* BLKSLV ... BLOCK TRIANGULAR SOLUTIONS **********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C GIVEN THE CHOLESKY FACTORIZATION OF A SPARSE SYMMETRIC
+C POSITIVE DEFINITE MATRIX, THIS SUBROUTINE PERFORMS THE
+C TRIANGULAR SOLUTION. IT USES OUTPUT FROM BLKFCT.
+C
+C INPUT PARAMETERS:
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - SUPERNODE PARTITION.
+C (XLINDX,LINDX) - ROW INDICES FOR EACH SUPERNODE.
+C (XLNZ,LNZ) - CHOLESKY FACTOR.
+C
+C UPDATED PARAMETERS:
+C RHS - ON INPUT, CONTAINS THE RIGHT HAND SIDE. ON
+C OUTPUT, CONTAINS THE SOLUTION.
+C
+C***********************************************************************
+C
+ SUBROUTINE BLKSLV ( NSUPER, XSUPER, XLINDX, LINDX , XLNZ ,
+ & LNZ , RHS )
+C
+C***********************************************************************
+C
+ INTEGER NSUPER
+ INTEGER LINDX(*) , XSUPER(*)
+ INTEGER XLINDX(*) , XLNZ(*)
+ DOUBLE PRECISION LNZ(*) , RHS(*)
+C
+C***********************************************************************
+C
+ INTEGER FJCOL , I , IPNT , IX , IXSTOP,
+ & IXSTRT, JCOL , JPNT , JSUP , LJCOL
+ DOUBLE PRECISION T
+C
+C***********************************************************************
+C
+ IF ( NSUPER .LE. 0 ) RETURN
+C
+C ------------------------
+C FORWARD SUBSTITUTION ...
+C ------------------------
+ FJCOL = XSUPER(1)
+ DO 300 JSUP = 1, NSUPER
+ LJCOL = XSUPER(JSUP+1) - 1
+ IXSTRT = XLNZ(FJCOL)
+ JPNT = XLINDX(JSUP)
+ DO 200 JCOL = FJCOL, LJCOL
+ IXSTOP = XLNZ(JCOL+1) - 1
+ T = RHS(JCOL)/LNZ(IXSTRT)
+ RHS(JCOL) = T
+ IPNT = JPNT + 1
+CDIR$ IVDEP
+ DO 100 IX = IXSTRT+1, IXSTOP
+ I = LINDX(IPNT)
+ RHS(I) = RHS(I) - T*LNZ(IX)
+ IPNT = IPNT + 1
+ 100 CONTINUE
+ IXSTRT = IXSTOP + 1
+ JPNT = JPNT + 1
+ 200 CONTINUE
+ FJCOL = LJCOL + 1
+ 300 CONTINUE
+C
+C -------------------------
+C BACKWARD SUBSTITUTION ...
+C -------------------------
+ LJCOL = XSUPER(NSUPER+1) - 1
+ DO 600 JSUP = NSUPER, 1, -1
+ FJCOL = XSUPER(JSUP)
+ IXSTOP = XLNZ(LJCOL+1) - 1
+ JPNT = XLINDX(JSUP) + (LJCOL - FJCOL)
+ DO 500 JCOL = LJCOL, FJCOL, -1
+ IXSTRT = XLNZ(JCOL)
+ IPNT = JPNT + 1
+ T = RHS(JCOL)
+CDIR$ IVDEP
+ DO 400 IX = IXSTRT+1, IXSTOP
+ I = LINDX(IPNT)
+ T = T - LNZ(IX)*RHS(I)
+ IPNT = IPNT + 1
+ 400 CONTINUE
+ RHS(JCOL) = T/LNZ(IXSTRT)
+ IXSTOP = IXSTRT - 1
+ JPNT = JPNT - 1
+ 500 CONTINUE
+ LJCOL = FJCOL - 1
+ 600 CONTINUE
+C
+ RETURN
+ END
diff --git a/modules/sparse/src/fortran/blkslv.lo b/modules/sparse/src/fortran/blkslv.lo
new file mode 100755
index 000000000..b28e95b2c
--- /dev/null
+++ b/modules/sparse/src/fortran/blkslv.lo
@@ -0,0 +1,12 @@
+# src/fortran/blkslv.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/blkslv.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/core_Import.def b/modules/sparse/src/fortran/core_Import.def
new file mode 100755
index 000000000..dbfdeba31
--- /dev/null
+++ b/modules/sparse/src/fortran/core_Import.def
@@ -0,0 +1,32 @@
+ LIBRARY core.dll
+
+
+EXPORTS
+
+; core
+com_
+vstk_
+stack_
+recu_
+iop_
+cha1_
+intersci_
+mtlbc_
+errgst_
+getrhsvar_
+createvar_
+putlhsvar_
+checkrhs_
+checklhs_
+getvectrow_
+getscalar_
+checkval_
+cremat_
+copyobj_
+;
+; explicit imports (COMMON) to fix warning LNK4049: locally defined symbol
+;
+adre_
+;
+
+
diff --git a/modules/sparse/src/fortran/dcompa.f b/modules/sparse/src/fortran/dcompa.f
new file mode 100755
index 000000000..cbfbad7c6
--- /dev/null
+++ b/modules/sparse/src/fortran/dcompa.f
@@ -0,0 +1,41 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) 1995-2007 - INRIA - Serge STEER
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ logical function dcompa(a,b,op)
+c compare two double precision numbers a and b
+c! calling sequence
+c logical function dcompa(a,b,op)
+c a,b : double precision numbers
+c op is an integer indicator of the comparison to perform
+c op=50 : a==b
+c op=59 : a<b
+c op=60 : a>b
+c op=119: a~=b
+c op=109: a<=b
+c op=110: a>=b
+c
+ double precision a,b
+ integer op
+ integer less,great,equal
+ logical l
+ data less/59/,great/60/,equal/50/
+ if(op.eq.less) then
+ l=a.lt.b
+ elseif(op.eq.great) then
+ l=a.gt.b
+ elseif(op.eq.equal) then
+ l=a.eq.b
+ elseif(op.eq.less+great) then
+ l=a.ne.b
+ elseif(op.eq.less+equal) then
+ l=a.le.b
+ elseif(op.eq.great+equal) then
+ l=a.ge.b
+ endif
+ dcompa=l
+ end
diff --git a/modules/sparse/src/fortran/dcompa.lo b/modules/sparse/src/fortran/dcompa.lo
new file mode 100755
index 000000000..f6b27916e
--- /dev/null
+++ b/modules/sparse/src/fortran/dcompa.lo
@@ -0,0 +1,12 @@
+# src/fortran/dcompa.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dcompa.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dful2sp.f b/modules/sparse/src/fortran/dful2sp.f
new file mode 100755
index 000000000..453ec1532
--- /dev/null
+++ b/modules/sparse/src/fortran/dful2sp.f
@@ -0,0 +1,28 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dful2sp(ma,na,a,nel,indr,r,zero)
+c converts a full matrix to a sparse representation
+
+ double precision a(ma,na),r(*),zero
+ integer indr(*)
+c
+ nel=0
+ do 5 i=1,ma
+ ni=0
+ do 4 j=1,na
+ if(a(i,j).ne.zero) then
+ nel=nel+1
+ indr(ma+nel)=j
+ r(nel)=a(i,j)
+ ni=ni+1
+ endif
+ 4 continue
+ indr(i)=ni
+ 5 continue
+ end
diff --git a/modules/sparse/src/fortran/dful2sp.lo b/modules/sparse/src/fortran/dful2sp.lo
new file mode 100755
index 000000000..538ad9caa
--- /dev/null
+++ b/modules/sparse/src/fortran/dful2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dful2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dful2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dij2sp.f b/modules/sparse/src/fortran/dij2sp.f
new file mode 100755
index 000000000..d3890870d
--- /dev/null
+++ b/modules/sparse/src/fortran/dij2sp.f
@@ -0,0 +1,108 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dij2sp(m,n,nel,ij,v,ind,nind,iw,ierr)
+c!purpose
+c generates a sparse matrix from (i,j), v description
+c!parameters
+c ierr=0 : ok
+c ierr=1 : almost on index in ij is greater than corresponding
+c dimension m or n
+c ierr=2 : not enough memory for ind
+c ierr=3 : doubly defined entry with different value
+c!
+ double precision v(nel)
+ integer ij(nel,2),ind(nind),iw(nel)
+c
+ ierr=0
+
+ if(nel.eq.0) then
+ call iset(m,0,ind,1)
+ return
+ endif
+c sort indexes
+ call spsort(ij,nel,iw)
+ call dperm(v,nel,iw)
+c
+ mm=ij(nel,1)
+ nm=ij(1,2)
+ if(nel.ge.2) then
+ do 01 k=2,nel
+ nm=max(nm,ij(k,2))
+ 01 continue
+ endif
+
+c eliminate zero entries, check for doubly defined entries
+c
+c eliminate leading zero entries
+ k0=0
+ 05 k0=k0+1
+ if (v(k0).eq.0.0d0.and.k0.lt.nel) goto 05
+ if (v(k0).eq.0.0d0) then
+ nel1=0
+ goto 10
+ endif
+
+ k1=1
+ ij(k1,1)=ij(k0,1)
+ ij(k1,2)=ij(k0,2)
+ v(k1)=v(k0)
+ if(nel.gt.k0) then
+ do 08 k=k0+1,nel
+ if (v(k).ne.0.0d0) then
+ if(ij(k,1).ne.ij(k1,1).or.ij(k,2).ne.ij(k1,2)) then
+ k1=k1+1
+ ij(k1,1)=ij(k,1)
+ ij(k1,2)=ij(k,2)
+ v(k1)=v(k)
+ else
+ v(k1) = v(k1) + v(k)
+c if(v(k1).ne.v(k)) then
+c ierr=3
+c return
+c endif
+ endif
+ endif
+ 08 continue
+ endif
+ nel1=k1
+
+
+c check dimensions
+ 10 continue
+ if(n.gt.0) then
+ if(n.lt.nm.or.m.lt.mm) then
+ ierr=1
+ return
+ endif
+ else
+ n=nm
+ m=mm
+ endif
+c check check memory
+ if(nind.lt.m+nel1) then
+ ierr=2
+ return
+ endif
+c compute nl the number of non zero entries for each row
+ i0=1
+ do 20 lp=1,m
+ i=i0-1
+ 21 i=i+1
+ if(i.le.nel1) then
+ if(ij(i,1).eq.lp) goto 21
+ endif
+ nl=i-i0
+ ind(lp)=nl
+ i0=i
+ 20 continue
+ call icopy(nel1,ij(1,2),1,ind(m+1),1)
+ nel=nel1
+ end
+
+
diff --git a/modules/sparse/src/fortran/dij2sp.lo b/modules/sparse/src/fortran/dij2sp.lo
new file mode 100755
index 000000000..aa7588773
--- /dev/null
+++ b/modules/sparse/src/fortran/dij2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dij2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dij2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dperm.f b/modules/sparse/src/fortran/dperm.f
new file mode 100755
index 000000000..68b89773e
--- /dev/null
+++ b/modules/sparse/src/fortran/dperm.f
@@ -0,0 +1,43 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dperm(vv,nv,ind)
+c apply an in-situ permutation
+ double precision vv(nv),x
+ integer ind(nv)
+c
+ x=vv(1)
+ i3=1
+ i0=1
+ i=i0
+ 10 continue
+ if(ind(i).eq.i0) then
+c end of a permutation cycle
+ vv(i)=x
+ ind(i)=-ind(i)
+c look for first positive ind(i)
+ i0=i3
+ 11 i0=i0+1
+ if(i0.gt.nv) goto 20
+ if(ind(i0).lt.0) goto 11
+c beginning of a permutation cycle
+ i3=i0
+ i=i0
+ x=vv(i0)
+ else
+ vv(i)=vv(ind(i))
+ ind(i)=-ind(i)
+ i=-ind(i)
+ endif
+ goto 10
+ 20 continue
+
+ do 30 i=1,nv
+ ind(i)=-ind(i)
+ 30 continue
+ end
diff --git a/modules/sparse/src/fortran/dperm.lo b/modules/sparse/src/fortran/dperm.lo
new file mode 100755
index 000000000..ca267e5a5
--- /dev/null
+++ b/modules/sparse/src/fortran/dperm.lo
@@ -0,0 +1,12 @@
+# src/fortran/dperm.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dperm.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dsmsp.f b/modules/sparse/src/fortran/dsmsp.f
new file mode 100755
index 000000000..d7a4f8a70
--- /dev/null
+++ b/modules/sparse/src/fortran/dsmsp.f
@@ -0,0 +1,68 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dsmsp(nrb,ncb,nca,b,mrb,a,nela,inda,c,mrc)
+c multiply a full matrix stored in b on right by a sparse
+c matrix stored in a,inda. Put result in c.
+c*** input
+c nrb actual number of rows in b.
+c ncb actual number of columns in b and row of a
+c nca actual number of columns in a and c
+c b a two-dimensional array containing all the
+c elements of the first matrix.
+c mrb row-dimension of b in calling routine.
+c a a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=nra number of non-zero elements in row i of a.
+c inda(nra+i) 1<=i<nela column index of i'th non-zero element of a.
+c mrc row dimension of c in calling routine.
+c***output
+c c a two-dimensional array containing all the
+c elements of the product matrix.
+c!
+ double precision a(*), b(mrb,ncb), c(mrc,nca)
+ integer inda(*)
+
+c nra,nca are number of rows,columns in a.
+ nra = ncb
+c nrc,ncc are number of rows,columns in c.
+ nrc = nrb
+ ncc = nca
+
+c clear c to zero.
+ 10 do 30 i=1,nrc
+ do 20 j=1,ncc
+ c(i,j) = 0.0d0
+ 20 continue
+ 30 continue
+c n2 will be pointer to end of row k of a.
+ n2 = 0
+c k will be row-index for a.
+ do 60 k=1,nra
+c pick out number of non-zeros in row k of a.
+ nir = inda(k)
+ if (nir.eq.0) go to 60
+c if no non-zeros skip processing of row k.
+c n1 will point to start of row k in a,n2 to end of row.
+ n1 = n2 + 1
+ n2 = n2 + nir
+c process row k of a,i.e.
+c form all products of b(i,k) with non-zero a(k,j),
+c add into c(i,j)
+c l points to non-zero elements in row k of a.
+ do 50 l=n1,n2
+ j = inda(nra+l)
+ do 40 i=1,nrb
+ c(i,j) = c(i,j) + b(i,k)*a(l)
+ 40 continue
+ 50 continue
+ 60 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/dsmsp.lo b/modules/sparse/src/fortran/dsmsp.lo
new file mode 100755
index 000000000..61c91af4f
--- /dev/null
+++ b/modules/sparse/src/fortran/dsmsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dsmsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dsmsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dsosp.f b/modules/sparse/src/fortran/dsosp.f
new file mode 100755
index 000000000..2882f8518
--- /dev/null
+++ b/modules/sparse/src/fortran/dsosp.f
@@ -0,0 +1,166 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dsosp(op,ma,na,a,mb,nb,b,nelb,indb,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of a full matrix A and a sparse matrix B
+c!parameters
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a: (ma,na) array
+c b : array.
+c Contain non zero elements of the B matrix
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c indb : b matrix control data:
+c indb(i) 1<=i<=mb contains the number of ith row non zero elements
+c of b
+c indb(mb+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelc column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision a(ma,na),b(*)
+ integer op,nr,nc,nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,j2
+ double precision t
+ logical dcompa,z
+ external dcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ t=a(1,1)
+ z=dcompa(t,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (dcompa(t,0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if (dcompa(t,b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ t=0.0d0
+ if(indb(1).eq.1) t=b(1)
+ z=dcompa(0.0d0,t,op)
+ do 20 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 12 j=1,nc
+ if (dcompa(a(i,j),t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ indc(i)=jc-kc
+ kc=jc
+ 20 continue
+ else
+ z=dcompa(0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 23 j=1,nc
+ if (dcompa(a(i,j),0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j2.eq.j) then
+ if (dcompa(a(i,j),b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (dcompa(a(i,j),0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/dsosp.lo b/modules/sparse/src/fortran/dsosp.lo
new file mode 100755
index 000000000..48c88d1eb
--- /dev/null
+++ b/modules/sparse/src/fortran/dsosp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dsosp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dsosp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspasp.f b/modules/sparse/src/fortran/dspasp.f
new file mode 100755
index 000000000..70cf9c34b
--- /dev/null
+++ b/modules/sparse/src/fortran/dspasp.f
@@ -0,0 +1,127 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspasp(nr,nc,a,nela,inda,b,nelb,indb,c,nelc,indc,ierr)
+c!pupose
+c add two sparse matrices.
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+
+ double precision a(*),b(*),c(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+ double precision t
+c
+ nelmx=nelc
+ ierr=0
+c clear indc.
+ do 1 i = 1,nr
+ indc(i) = 0
+ 1 continue
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 7
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 7
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index less than b-index transfer a-element to c.
+ 7 if (jc.gt.nelmx) go to 16
+ c(jc) = a(ja)
+ 8 continue
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index equals b-index add elements ,place sum in c.
+ 9 t = a(ja)+b(jb)
+c ignore sum element if zero.
+ jb = jb+1
+ if (t.eq.0.0d0) go to 11
+ if (jc.gt.nelmx) go to 16
+ c(jc) = t
+ go to 8
+c if a-index greater than b-index transfer b-element to c.
+ 10 if (jc.gt.nelmx) go to 16
+ c(jc) = b(jb)
+ indc(jc+kf)=j2
+ jb = jb+1
+ jc = jc+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (jb.gt.kb) go to 13
+ if (jc.gt.nelmx) go to 16
+ c(jc) = b(jb)
+ j2 = indb(jb+kf)
+ indc(jc+kf)=j2
+ jc = jc+1
+ jb = jb+1
+ go to 12
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspasp.lo b/modules/sparse/src/fortran/dspasp.lo
new file mode 100755
index 000000000..36f8d74d8
--- /dev/null
+++ b/modules/sparse/src/fortran/dspasp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspasp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspasp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspcle.f b/modules/sparse/src/fortran/dspcle.f
new file mode 100755
index 000000000..6ce018436
--- /dev/null
+++ b/modules/sparse/src/fortran/dspcle.f
@@ -0,0 +1,46 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspcle(ma,na,a,nela,inda,r,nelr,indr,abstol,reltol)
+c cleans a sparse matrix
+ integer inda(*),indr(*)
+ integer ma,na,nela,nelr
+ double precision a(*),r(*),abstol,reltol
+ double precision amax,aa
+c
+ amax=0.0d0
+ do 10 i=1,nela
+ amax=max(amax,abs(a(i)))
+ 10 continue
+c
+ i0=0
+ i1=i0
+ i=1
+ ni=inda(i)
+ indr(1)=0
+ nelr=0
+ do 40 k=1,nela
+ 38 i0=i0+1
+ if(i0-i1.le.ni) goto 39
+ i1=i0
+ i=i+1
+ ni=inda(i)
+ indr(i)=0
+ goto 38
+ 39 j=inda(ma+k)
+ aa=abs(a(k))
+ if(aa.ge.abstol.and.aa.gt.reltol*amax) then
+ nelr=nelr+1
+ indr(i)=indr(i)+1
+ indr(ma+nelr)=inda(ma+k)
+ r(nelr)=a(k)
+ endif
+ 40 continue
+ if(i.lt.ma) call iset(ma-i,0,indr(i+1),1)
+ end
+
diff --git a/modules/sparse/src/fortran/dspcle.lo b/modules/sparse/src/fortran/dspcle.lo
new file mode 100755
index 000000000..29ff43271
--- /dev/null
+++ b/modules/sparse/src/fortran/dspcle.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspcle.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspcle.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspcsp.f b/modules/sparse/src/fortran/dspcsp.f
new file mode 100755
index 000000000..8e222b6fa
--- /dev/null
+++ b/modules/sparse/src/fortran/dspcsp.f
@@ -0,0 +1,79 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspcsp(op,ma,na,a,nela,inda,mb,nb,b,nelb,indb,
+ $ c,nelc,indc)
+c!purpose
+c concatenation of two sparse matrices.
+c!parameters
+c op : integer flag which specifies the concatenation to perform
+c op=0 : row concatenation
+c op=1 : column concatenation
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a,b : arrays.
+c Contain non zero elements of first,second sparse matrices.
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mc contains the number of ith row non zero elements
+c of c
+c indc(mc+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision a(*),b(*),c(*)
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*)
+c
+c
+ if(op.eq.0) then
+c row concatenation
+ ia=1
+ ib=1
+ ic=1
+ do 20 i=1,ma
+ call icopy(inda(i),inda(ma+ia),1,indc(ma+ic),1)
+ call unsfdcopy(inda(i),a(ia),1,c(ic),1)
+ ic=ic+inda(i)
+ ia=ia+inda(i)
+ if (indb(i).gt.0) then
+ call unsfdcopy(indb(i),b(ib),1,c(ic),1)
+ do 10 k=1,indb(i)
+ indc(ma+ic)=indb(mb+ib)+na
+ ic=ic+1
+ ib=ib+1
+ 10 continue
+ endif
+ indc(i)=inda(i)+indb(i)
+ 20 continue
+ nelc=nela+nelb
+ else
+c column concatenation
+ call icopy(ma,inda,1,indc,1)
+ call icopy(nela,inda(ma+1),1,indc(ma+mb+1),1)
+ call unsfdcopy(nela,a,1,c,1)
+ call icopy(mb,indb,1,indc(ma+1),1)
+ call icopy(nelb,indb(mb+1),1,indc(ma+mb+1+nela),1)
+ call unsfdcopy(nelb,b,1,c(nela+1),1)
+ nelc=nela+nelb
+ endif
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/dspcsp.lo b/modules/sparse/src/fortran/dspcsp.lo
new file mode 100755
index 000000000..569845f72
--- /dev/null
+++ b/modules/sparse/src/fortran/dspcsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspcsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspcsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspe2.f b/modules/sparse/src/fortran/dspe2.f
new file mode 100755
index 000000000..4916ffe4c
--- /dev/null
+++ b/modules/sparse/src/fortran/dspe2.f
@@ -0,0 +1,66 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspe2(ma,na,a,nela,inda,i,ni,j,nj,
+ $ mr,nr,r,nelr,indr,ptr,ierr)
+c extract a submatrix from a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptr(*)
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision a(*),r(*)
+ logical allrow,allcol
+c
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ endif
+ ptr(1)=1
+ do 10 kk=1,ma
+ ptr(kk+1)=ptr(kk)+inda(kk)
+ 10 continue
+ jr=1
+ do 40 l=1,mr
+ indr(l)=0
+ if(allrow) then
+ ii=l
+ else
+ ii=i(l)
+ endif
+ if(inda(ii).eq.0) goto 40
+ if(allcol) then
+ indr(l)=inda(ii)
+ call icopy(inda(ii),inda(ma+ptr(ii)),1,indr(mr+jr),1)
+ call unsfdcopy(inda(ii),a(ptr(ii)),1,r(jr),1)
+ jr=jr+inda(ii)
+ else
+ do 30 k=1,nj
+ jj=j(k)
+ do 20 kk=ptr(ii),ptr(ii+1)-1
+ if(inda(ma+kk).eq.jj) then
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ r(jr)=a(kk)
+ jr=jr+1
+ goto 30
+ endif
+ 20 continue
+ 30 continue
+ endif
+ 40 continue
+ nelr=jr-1
+ return
+ end
+
diff --git a/modules/sparse/src/fortran/dspe2.lo b/modules/sparse/src/fortran/dspe2.lo
new file mode 100755
index 000000000..3995b572a
--- /dev/null
+++ b/modules/sparse/src/fortran/dspe2.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspe2.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspe2.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspful.f b/modules/sparse/src/fortran/dspful.f
new file mode 100755
index 000000000..1675ceae4
--- /dev/null
+++ b/modules/sparse/src/fortran/dspful.f
@@ -0,0 +1,27 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspful(ma,na,a,nela,inda,r)
+ double precision a(*),r(*)
+ integer ma,na,nela,inda(*)
+c
+ call dset(ma*na,0.0d0,r,1)
+ i0=0
+ i1=i0
+ i=1
+ do 10 k=1,nela
+ 08 i0=i0+1
+ if(i0-i1.gt.inda(i)) then
+ i1=i0
+ i=i+1
+ goto 08
+ endif
+ j=inda(ma+k)
+ r(1+(i-1)+(j-1)*ma)=a(k)
+ 10 continue
+ end
diff --git a/modules/sparse/src/fortran/dspful.lo b/modules/sparse/src/fortran/dspful.lo
new file mode 100755
index 000000000..194c1ef42
--- /dev/null
+++ b/modules/sparse/src/fortran/dspful.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspful.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspful.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspis.f b/modules/sparse/src/fortran/dspis.f
new file mode 100755
index 000000000..a2e752a97
--- /dev/null
+++ b/modules/sparse/src/fortran/dspis.f
@@ -0,0 +1,301 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspis(ma,na,a,nela,inda,i,ni,j,nj,
+ $ mb,nb,b,mr,nr,r,nelr,indr,ierr)
+c insert a full submatrix in a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*)
+ integer mb,nb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision a(*),r(*),b(mb,*)
+ logical allrow,allcol,bscal
+ integer findl
+ external findl
+c
+ nelmx=nelr
+ ierr=0
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+
+
+ if(allrow) then
+ mr=ma
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ bscal=mb*nb.eq.1.and.ma*na.gt.1
+ if(.not.bscal) then
+ if(mb*nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call iset(mb,0,indr,1)
+ jr=1
+ if(mb*nb.ne.0) then
+ do 04 l=1,mb
+ do 03 k=1,nb
+ if(b(l,k).ne.0.0d0) then
+ indr(mb+jr)=k
+ r(jr)=b(l,k)
+ indr(l)=indr(l)+1
+ jr=jr+1
+ endif
+ 03 continue
+ 04 continue
+ endif
+ nelr=jr-1
+ return
+ else
+ if(ma*na.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call iset(ma,0,indr,1)
+ jr=1
+ if(ma*na.ne.0) then
+ do 06 l=1,ma
+ do 05 k=1,na
+ if(b(1,1).ne.0.0d0) then
+ indr(ma+jr)=k
+ r(jr)=b(1,1)
+ indr(l)=indr(l)+1
+ jr=jr+1
+ endif
+ 05 continue
+ 06 continue
+ endif
+ nelr=jr-1
+ return
+ endif
+ elseif(allcol) then
+c a(i,:)=b
+ bscal=mb*nb.eq.1.and.na*ni.gt.1
+ jr=1
+ ja=1
+
+ do 21 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),a(ja),1,r(jr),1)
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(jr+nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ do 19 k1=1,nb
+ if(b(ii,k1).ne.0.0d0) then
+ indr(mr+jr)=k1
+ indr(l)=indr(l)+1
+ r(jr)=b(ii,k1)
+ jr=jr+1
+ endif
+ 19 continue
+ endif
+ else
+ if(na.gt.0) then
+ if(b(1,1).ne.0.0d0) then
+ if(jr+na.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ do 20 k1=1,na
+ indr(mr+jr)=k1
+ indr(l)=indr(l)+1
+ r(jr)=b(1,1)
+ jr=jr+1
+ 20 continue
+ endif
+ endif
+ endif
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ 21 continue
+ nelr=jr-1
+ if(nb.eq.0) mr=mr-ni
+ elseif(allrow) then
+c a(:,j)=b
+ bscal=mb*nb.eq.1.and.na*nj.gt.1
+ jr=1
+ ja=0
+ do 35 l=1,ma
+ ja1=1
+ nal=inda(l)
+ indr(l)=0
+ kr=1
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ r(jr)=a(ja+ja1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ kr=kr+1
+ else
+c the a(l,k) element is replaced by b(l,jj) element
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(b(l,jj).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(l,jj)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+ else
+ if(na.gt.0) then
+ if(b(1,1).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(1,1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+
+ endif
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ 31 continue
+ ja=ja+nal
+ 35 continue
+ nelr=jr-1
+ if(nb.eq.0) nr=nr-nj
+ return
+ else
+c a(i,j)=b
+ bscal=mb*nb.eq.1.and.ni*nj.gt.1
+ jr=1
+ ja=0
+ do 45 l=1,mr
+ ja1=1
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),a(ja+ja1),1,r(jr),1)
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ kr=1
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ r(jr)=a(ja+ja1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ kr=kr+1
+ else
+c * replace a(l,k) element by b(ii,jj) element if non
+c zero
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(b(ii,jj).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(ii,jj)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1
+ $ +1
+ else
+ if(na.gt.0) then
+ if(b(1,1).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(1,1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1
+ $ +1
+ endif
+ endif
+ 42 continue
+ endif
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
+
+
diff --git a/modules/sparse/src/fortran/dspis.lo b/modules/sparse/src/fortran/dspis.lo
new file mode 100755
index 000000000..8ebde0154
--- /dev/null
+++ b/modules/sparse/src/fortran/dspis.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspis.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspis.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspisp.f b/modules/sparse/src/fortran/dspisp.f
new file mode 100755
index 000000000..b6f113095
--- /dev/null
+++ b/modules/sparse/src/fortran/dspisp.f
@@ -0,0 +1,210 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspisp(ma,na,a,nela,inda,i,ni,j,nj,
+ $ mb,nb,b,nelb,indb,mr,nr,r,nelr,indr,ptrb,ierr)
+c extract a submatrix from a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptrb(*)
+ integer indb(*),mb,nb,nelb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision a(*),r(*),b(*)
+ logical allrow,allcol
+ integer findl
+ external findl
+c
+ mr=ni
+ nr=nj
+ ierr=0
+ nelmx=nelr
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ call icopy(mb+nelb,indb,1,indr,1)
+ call unsfdcopy(nelb,b,1,r,1)
+ nelr=nelb
+ return
+ elseif(allcol) then
+c a(i,:)=b
+ jr=1
+ jb=1
+ ja=1
+ call sz2ptr(indb,mb,ptrb)
+ do 20 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call unsfdcopy(indr(l),a(ja),1,r(jr),1)
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+ jb=ptrb(ii)
+ indr(l)=indb(ii)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call icopy(indr(l),indb(mb+jb),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),b(jb),1,r(jr),1)
+ jr=jr+indr(l)
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ 20 continue
+ nelr=jr-1
+ elseif(allrow) then
+c a(:,j)=b
+ jr=1
+ ja=0
+ jb=0
+ do 35 l=1,ma
+ ja1=1
+ nbl=indb(l)
+ nal=inda(l)
+ indr(l)=0
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=a(ja+ja1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c the a(l,k) element is replaced by b(l,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(jb+jb1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 31 continue
+ ja=ja+nal
+ jb=jb+nbl
+ 35 continue
+ nelr=jr-1
+ return
+ else
+c a(i,j)=b
+ jr=1
+ ja=0
+ call sz2ptr(indb,mb,ptrb)
+ do 45 l=1,mr
+ ja1=1
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),a(ja+ja1),1,r(jr),1)
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ jb=ptrb(ii)-1
+ jb1=1
+ nbl=indb(ii)
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element insert in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=a(ja+ja1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c * replace a(l,k) element by b(ii,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ r(jr)=b(jb+jb1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 42 continue
+ endif
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
+
diff --git a/modules/sparse/src/fortran/dspisp.lo b/modules/sparse/src/fortran/dspisp.lo
new file mode 100755
index 000000000..ffce5b673
--- /dev/null
+++ b/modules/sparse/src/fortran/dspisp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspisp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspisp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspmat.f b/modules/sparse/src/fortran/dspmat.f
new file mode 100755
index 000000000..e37a2f6c9
--- /dev/null
+++ b/modules/sparse/src/fortran/dspmat.f
@@ -0,0 +1,33 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspmat(ma,na,a,nela,inda,mr,indr,iw)
+c dspmat reshape a sparse matrix
+ integer inda(*),indr(*),iw(*)
+ integer ma,na,nela
+ double precision a(*)
+c
+ nr=(ma*na)/mr
+ ja=0
+ ki=1
+ kj=nela+1
+ do 20 i=1,ma
+ nira=inda(i)
+ if(nira.ne.0) then
+ do 10 j=1,nira
+ ija=i-1+(inda(ma+ja+j)-1)*ma
+ iw(kj)=int(ija/mr)+1
+ iw(ki)=ija-mr*(iw(kj)-1)+1
+ ki=ki+1
+ kj=kj+1
+ 10 continue
+ ja=ja+nira
+ endif
+ 20 continue
+ call dij2sp(mr,nr,nela,iw,a,indr,mr+nela,iw(2*nela+1),ierr)
+ end
diff --git a/modules/sparse/src/fortran/dspmat.lo b/modules/sparse/src/fortran/dspmat.lo
new file mode 100755
index 000000000..f4bfab17c
--- /dev/null
+++ b/modules/sparse/src/fortran/dspmat.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspmat.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspmat.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspms.f b/modules/sparse/src/fortran/dspms.f
new file mode 100755
index 000000000..429c56b30
--- /dev/null
+++ b/modules/sparse/src/fortran/dspms.f
@@ -0,0 +1,67 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspms(nra,nca,ncb,a,nela,inda,b,mrb,c,mrc)
+c**********************************************************
+c multiply sparse matrix stored in a,inda on right by full
+c matrix stored in b. put result in c.
+c*** input
+c nra actual row dimension of a and c matrix
+c nca actual column dimension of a and row dimension of b matrix
+c ncb actual column dimension of a and c matrices
+c a a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=nra number of non-zero elements in row i of a.
+c inda(nra+i) 1<=i<nela column index of i'th non-zero element of a.
+c b a two-dimensional array containing all the
+c elements of the second matrix.
+c mrb row-dimension of b in calling routine.
+c mrc row-dimension of c in calling routine.
+c*** output
+c c a two-dimensional array containing all the
+c elements of the product matrix.
+c!
+ double precision a(*), b(mrb,ncb), c(mrc,ncb)
+ integer inda(*)
+ double precision t
+c
+c nrc,ncc are number of rows,columns in c.
+ nrc = nra
+ ncc = ncb
+c clear c to zero.
+ 10 do 30 i=1,nrc
+ do 20 j=1,ncc
+ c(i,j) = 0.0d0
+ 20 continue
+ 30 continue
+c n2 will be pointer to end of row i of a.
+ n2 = 0
+c i will be row-index for a.
+ do 60 i=1,nra
+c pick out number of non-zero elements in row i.
+ nir = inda(i)
+c if no non-zeroes skip processing of row i of a.
+ if (nir.eq.0) go to 60
+c n1 points to start of row i in a,n2 to end.
+ n1 = n2 + 1
+ n2 = n2 + nir
+c process row i of a, i.e. form all products of non-zero a(i,l) with
+c b(l,j); put into c(i,j).
+c k points to non-zero elements in row i of a.
+ do 50 k=n1,n2
+ l = inda(nra+k)
+ t = a(k)
+ do 40 j=1,ncb
+ c(i,j) = c(i,j) + t*b(l,j)
+ 40 continue
+ 50 continue
+ 60 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspms.lo b/modules/sparse/src/fortran/dspms.lo
new file mode 100755
index 000000000..253645b33
--- /dev/null
+++ b/modules/sparse/src/fortran/dspms.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspms.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspms.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspmsp.f b/modules/sparse/src/fortran/dspmsp.f
new file mode 100755
index 000000000..7541fc896
--- /dev/null
+++ b/modules/sparse/src/fortran/dspmsp.f
@@ -0,0 +1,138 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspmsp(p,q,r,a,nela,inda,b,nelb,indb,c,nelc,indc,
+ $ ib,ic,x,xb,ierr)
+c multiply sparse matrices by the method of gustafson,acm t.o.m.s.
+c vol 4 (1978) p250.
+c*** input
+c p number of rows in a,
+c q number of columns in a
+c r number of columns in b
+c a a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=p number of non-zero elements in row i of a.
+c inda(p+i) 1<=i<nela column index of i'th non-zero element of a.
+
+c b,nelb,indb as a,nela,inda but for second matrix.
+c nelc maximum non zero element for the result
+
+c*** output
+c c,nelc,indc as a,nela,inda but for result matrix.
+c c a one-dimensional array containing the non-zero elements
+c of the product matrix,arranged row-by-row,but not
+c usually in order within rows.
+c ordering by increasing column number may be attained
+c by subsequently calling trsmgu twice,i.e.:
+c call trsmgu(c,mc,ic,ct,mct,ict)
+c call trsmgu(ct,mct,ic,c,mc,ic)
+c where ct,mct,ict are working storage areas of
+c same dimension as c,mc,ic respectively.
+c ierr =1 if space exceeded in c
+c =0 otherwise.
+c*** working storage parameters.
+c ib ib(i) is address in b of first element of row i of b.
+c ib(number of rows +1)=number of elements in b,+1.
+c ic as above,but for c.
+c x a one-dimensional array of size ge number of cols of c,
+c to contain elements of current row of c,
+c in full,i.e. non-sparse form.
+c xb an array of same size as x. xb(j)=i if element in row i,
+c column j of c is non-zero.
+c!
+ integer p, q, r, nela, nelb, nelc, ierr
+ double precision a(*), b(*), c(*), x(r)
+c the following may be changed on ibm/370 type machines by:-
+ integer inda(*), indb(*), ib(*), indc(*), ic(*), xb(r)
+
+ integer v, vp, vpppp4
+
+ ndc = nelc
+ ndmc = nelc + p
+ ib(1) = 1
+
+ do 20 i=1,q
+ ib(i+1) = ib(i) + indb(i)
+ 20 continue
+ ierr = 0
+ ip = 1
+c initialize the non-zero -element indicator for row i of c.
+ do 30 v=1,r
+ xb(v) = 0
+ 30 continue
+c process the rows of a.
+c inext will point to start of next row,i.e. row i+1
+ inext = 1
+ do 80 i=1,p
+ ic(i) = ip
+c istart points to start of current row.
+ istart = inext
+ inext = inext + inda(i)
+ i1 = istart
+ i2 = inext - 1
+ if (i1.gt.i2) go to 80
+c process row i of a.
+ do 60 jp=i1,i2
+c j is column-index of current element of a,i.e. row-index of row of b
+c to be processed.
+ jpppp4 = jp + p
+ j = inda(jpppp4)
+ i3 = ib(j)
+ i4 = ib(j+1) - 1
+ if (i3.gt.i4) go to 60
+c process row of b.
+ do 50 kp=i3,i4
+c k is column index of current element of b.
+ kppqp4 = kp + q
+ k = indb(kppqp4)
+c check if contribution already exixts to c(i,k)
+ if (xb(k).eq.i) go to 40
+c set column-index and non-zero indicator for new element of c.
+ ipppp4 = ip + p
+ if (ipppp4.gt.ndmc) then
+ ierr=1
+ return
+ endif
+ indc(ipppp4) = k
+ ip = ip + 1
+ xb(k) = i
+ x(k) = a(jp)*b(kp)
+ go to 50
+c add new contribution to existing element of c
+ 40 x(k) = x(k) + a(jp)*b(kp)
+ 50 continue
+ 60 continue
+c check for overflow in c.
+ if ((ip-1).gt.ndc) then
+ ierr=1
+ return
+ endif
+ i5 = ic(i)
+ i6 = ip - 1
+c extract non-zeros from current row of c (stored in x).
+ do 70 vp=i5,i6
+ vpppp4 = vp + p
+ v = indc(vpppp4)
+ c(vp) = x(v)
+ 70 continue
+ 80 continue
+c ic(p+1)= number of non-zeros in c,+1.
+ ic(p+1) = ip
+c extract control information in required form for indc.
+ do 90 i=1,p
+ indc(i) = ic(i+1) - ic(i)
+ if(indc(i).gt.1) then
+ call isort1(indc(p+ic(i)),indc(i),xb,1)
+ call dperm(c(ic(i)),indc(i),xb)
+ endif
+ 90 continue
+ nelc = ip - 1
+c sort column indices for each row
+ end
diff --git a/modules/sparse/src/fortran/dspmsp.lo b/modules/sparse/src/fortran/dspmsp.lo
new file mode 100755
index 000000000..a57960c6e
--- /dev/null
+++ b/modules/sparse/src/fortran/dspmsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspmsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspmsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspos.f b/modules/sparse/src/fortran/dspos.f
new file mode 100755
index 000000000..e64147fde
--- /dev/null
+++ b/modules/sparse/src/fortran/dspos.f
@@ -0,0 +1,202 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspos(op,ma,na,a,nela,inda,mb,nb,b,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of a sparse matrix A and a full matrix B.
+c!parameters
+c a : array.
+c Contain non zero elements of the A matrix
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c nela :integer: number of non zero elements of a
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=ma contains the number of ith row non zero elements
+c of a
+c inda(ma+i) 1<=i<=nela column index of each non zero element
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelb column index of each non zero element
+c b :(mb,nb) matrix
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision a(*),b(mb,nb)
+ integer op,nr,nc,nela,inda(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1
+ double precision t
+ logical dcompa,z
+ external dcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if( (ma.eq.1 .and. na.eq.1) .and. (mb.gt.1 .or. nb.gt.1) ) then
+c compare all element of b with scalar a
+ t=0.0d0
+ if(inda(1).eq.1) t=a(1)
+ z=dcompa(t,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 04 j=1,nc
+ if (dcompa(t,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 04 continue
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif((ma.gt.1 .or. na.gt.1) .and. (mb.eq.1 .and. nb.eq.1)) then
+c compare all elements of a with scalar b
+ t=b(1,1)
+ z=dcompa(0.0d0,t,op)
+ if (.not. z) then
+ call spcmps(op, ma, na, nela, a, inda, inda(ma+1),
+ $ t, nelc, indc, indc(ma+1), ierr)
+ return
+ endif
+
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if (dcompa(a(ja),t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=dcompa(0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ do 22 j=1,nc
+ if (dcompa(0.0d0,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ else
+ j1=inda(nr+ja)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if (dcompa(a(ja),b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ else
+ if (dcompa(0.0d0,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ ka=ka+inda(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
+ subroutine spcmps(op, A_m, A_n, A_nel, A_R, A_mnel, A_icol,
+ $ s, C_nelmax, C_mnel, C_icol, ierr)
+
+* comparizon A op scalaire (where "0 op s" is false)
+* added by bruno to speed up this operation
+ implicit none
+ integer op, A_m, A_n, A_nel, A_mnel(*), A_icol(*),
+ $ C_nelmax, C_mnel(*), C_icol(*), ierr
+ double precision A_R(*), s
+
+ integer kA, kAf, kC, i, k
+
+ kAf = 0
+ kC = 0
+ ierr = 0
+
+ do i = 1, A_m
+
+ kA = kAf + 1
+ kAf = kAf + A_mnel(i)
+ C_mnel(i) = 0
+
+ do k = kA, kAf
+ call cmp_and_update(A_R(k), s, op, C_mnel(i),
+ $ C_icol, A_icol(k), kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ enddo
+ enddo
+
+ C_nelmax = kC
+
+ end
diff --git a/modules/sparse/src/fortran/dspos.lo b/modules/sparse/src/fortran/dspos.lo
new file mode 100755
index 000000000..23f6f4f61
--- /dev/null
+++ b/modules/sparse/src/fortran/dspos.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspos.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspos.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dsposp.f b/modules/sparse/src/fortran/dsposp.f
new file mode 100755
index 000000000..c4032e87a
--- /dev/null
+++ b/modules/sparse/src/fortran/dsposp.f
@@ -0,0 +1,357 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dsposp(op,ma,na,a,nela,inda,mb,nb,b,nelb,indb,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of two sparse matrices.
+c!parameters
+c op : integer flag which specifies the comparison to perform
+c see routine dcompa for more precision
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a,b : arrays.
+c Contain non zero elements of first,second sparse matrices.
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision a(*),b(*),t
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1,j2
+ logical dcompa,z
+ external dcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+
+ if (ma.eq.mb .and. na.eq.nb .and. .not.dcompa(0.d0,0.d0,op)) then
+ call cmpsp(op, ma, na, nela, a, inda, inda(nr+1),
+ $ mb, nb, nelb, b, indb, indb(nr+1),
+ $ nelc, indc, indc(nr+1), ierr)
+ return
+ endif
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ t=0.0d0
+ if(inda(1).eq.1) t=a(1)
+ z=dcompa(t,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if (dcompa(t,b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ t=0.0d0
+ if(indb(1).eq.1) t=b(1)
+ z=dcompa(0.0d0,t,op)
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if (dcompa(a(ja),t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=dcompa(0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ nirb=indb(i)
+ ja=ka
+ jb=kb
+ jc=kc
+ if(nira.eq.0) then
+ if(nirb.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 21 j=1,nc
+ indc(nr+kc-1+j)=j
+ 21 continue
+ jc=kc+nc
+ endif
+ else
+ j2=indb(nr+jb)
+ do 22 j=1,nc
+ if(j2.eq.j) then
+ if (dcompa(0.0d0,b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ endif
+ else
+ if(nirb.eq.0) then
+ j1=inda(nr+ja)
+ do 23 j=1,nc
+ if(j1.eq.j) then
+ if (dcompa(a(ja),0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if(j2.eq.j) then
+ if (dcompa(a(ja),b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ else
+ if (dcompa(a(ja),0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ endif
+ else
+ if(j2.eq.j) then
+ if (dcompa(0.0d0,b(jb),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ endif
+ ka=ka+inda(i)
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
+ subroutine cmp_and_update(x, y, op, C_mnel_i, C_icol, j, kC,
+ $ C_nelmax, ierr)
+ double precision x, y
+ integer op, C_mnel_i, C_icol(*), j, kC, C_nelmax, ierr
+ logical dcompa
+ external dcompa
+
+ if ( dcompa(x, y, op) ) then
+ kC = kC + 1
+ if ( kC .gt. C_nelmax ) then
+ ierr = 1
+ return
+ endif
+ C_icol(kC) = j
+ C_mnel_i = C_mnel_i + 1
+ endif
+ end
+
+
+ subroutine cmpsp(op, A_m, A_n, A_nel, A_R, A_mnel, A_icol,
+ $ B_m, B_n, B_nel, B_R, B_mnel, B_icol,
+ $ C_nelmax, C_mnel, C_icol, ierr)
+
+ implicit none
+ integer op, A_m, A_n, A_nel, A_mnel(*), A_icol(*),
+ $ B_m, B_n, B_nel, B_mnel(*), B_icol(*),
+ $ C_nelmax, C_mnel(*), C_icol(*), ierr
+ double precision A_R(*), B_R(*)
+
+ integer kA, kAf, kB, kBf, kC, i, jA, jB, k
+
+ kAf = 0
+ kBf = 0
+ kC = 0
+ ierr = 0
+
+ do i = 1, A_m
+
+ kA = kAf + 1
+ kB = kBf + 1
+ kAf = kAf + A_mnel(i)
+ kBf = kBf + B_mnel(i)
+ C_mnel(i) = 0
+
+ 100 if ( kA .gt. kAf .or. kB .gt. kBf ) goto 300
+ jA = A_icol(kA)
+ jB = B_icol(kB)
+ 200 continue
+ if ( jA .lt. jB ) then
+ call cmp_and_update(A_R(kA), 0.d0, op, C_mnel(i),
+ $ C_icol, jA, kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ kA = kA + 1
+ if ( kA .gt. kAf ) goto 300
+ jA = A_icol(kA)
+ goto 200
+ elseif ( jA .gt. jB ) then
+ call cmp_and_update(0.d0, B_R(kB), op, C_mnel(i),
+ $ C_icol, jB, kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ kB = kB + 1
+ if ( kB .gt. kBf ) goto 300
+ jB = B_icol(kB)
+ goto 200
+ else ! jA = jB
+ call cmp_and_update(A_R(kA), B_R(kB), op, C_mnel(i),
+ $ C_icol, jA, kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ kA = kA + 1
+ kB = kB + 1
+ goto 100
+ endif
+ 300 continue
+ if ( kA .le. kAf) then
+ do k = kA, kAf
+ call cmp_and_update(A_R(k), 0.d0, op, C_mnel(i), C_icol,
+ $ A_icol(k), kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ enddo
+ else if ( kB .le. kBf ) then
+ do k = kB, kBf
+ call cmp_and_update(0.d0, B_R(k), op, C_mnel(i), C_icol,
+ $ B_icol(k), kC, C_nelmax, ierr)
+ if (ierr .eq. 1 ) return
+ enddo
+ endif
+
+ enddo
+
+ C_nelmax = kC
+
+ end
diff --git a/modules/sparse/src/fortran/dsposp.lo b/modules/sparse/src/fortran/dsposp.lo
new file mode 100755
index 000000000..ccf2f07eb
--- /dev/null
+++ b/modules/sparse/src/fortran/dsposp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dsposp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dsposp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspssp.f b/modules/sparse/src/fortran/dspssp.f
new file mode 100755
index 000000000..4f790f2a5
--- /dev/null
+++ b/modules/sparse/src/fortran/dspssp.f
@@ -0,0 +1,126 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspssp(nr,nc,a,nela,inda,b,nelb,indb,c,nelc,indc,ierr)
+c!pupose
+c c=a-b for sparse matrices
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+ double precision a(*),b(*),c(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+ double precision t
+c
+ nelmx=nelc
+ ierr=0
+c clear indc.
+ do 1 i = 1,nr
+ indc(i) = 0
+ 1 continue
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 7
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 7
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index less than b-index transfer a-element to c.
+ 7 if (jc.gt.nelmx) go to 16
+ c(jc) = a(ja)
+ 8 continue
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index equals b-index add elements ,place sum in c.
+ 9 t = a(ja)-b(jb)
+c ignore sum element if zero.
+ jb = jb+1
+ if (t.eq.0.0d0) go to 11
+ if (jc.gt.nelmx) go to 16
+ c(jc) = t
+ go to 8
+c if a-index greater than b-index transfer b-element to c.
+ 10 if (jc.gt.nelmx) go to 16
+ c(jc) = -b(jb)
+ indc(jc+kf)=j2
+ jb = jb+1
+ jc = jc+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (jb.gt.kb) go to 13
+ if (jc.gt.nelmx) go to 16
+ c(jc) = -b(jb)
+ j2 = indb(jb+kf)
+ indc(jc+kf)=j2
+ jc = jc+1
+ jb = jb+1
+ go to 12
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspssp.lo b/modules/sparse/src/fortran/dspssp.lo
new file mode 100755
index 000000000..4a5529e97
--- /dev/null
+++ b/modules/sparse/src/fortran/dspssp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspssp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspssp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspt.f b/modules/sparse/src/fortran/dspt.f
new file mode 100755
index 000000000..01114b303
--- /dev/null
+++ b/modules/sparse/src/fortran/dspt.f
@@ -0,0 +1,83 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspt(r,s,a,nela,inda,ia, at,iat,indat)
+c transpose a sparse matrix using a distribution count sort.
+c*** input
+c r,s number of rows,columns in a.
+c a a one-dimensional array containing the non-zero
+c elements of matrix a,arranged row-wise,but in
+c general not ordered within rows.
+c ma as in msmgus.
+c ia ia(i) is address in a of first element of row i of a.
+c ia(number of rows + 1) is number of elements in a,+1.
+c*** output
+c at a one-dimensional array containing non-zero elements
+c of matrix a transposed,arranged row-wise,and in
+c order within rows.
+c mat contains control information and column indices for at,
+c in same format as ma...see msmgus.
+c*** working storage.
+c iat iat(i) is address in at of first element in row i of at.
+c iat(s+1) contains number of elements in at,plus 1.
+ double precision a(*), at(nela)
+ integer inda(*), ia(*), indat(*), iat(*)
+ integer r, s
+c
+c determine column counts of matrix a(i.e row counts of at)
+c in array iat.
+c
+ do 10 i=1,s+1
+ iat(i) = 0
+ 10 continue
+
+c computes number of elements for each column
+ do 20 i=1,nela
+ k = inda(i+r)
+ iat(k) = iat(k) + 1
+ 20 continue
+c
+c calculate row pointers of at from column counts obtained above.
+c pointer for row i stored in location i+1.
+c
+ itemp1 = iat(1)
+ itemp2 = iat(2)
+ iat(2) = 1
+ if (s.le.1) go to 40
+ do 30 i=2,s
+ itemp3 = iat(i+1)
+ iat(i+1) = iat(i) + itemp1
+ itemp1 = itemp2
+ itemp2 = itemp3
+ 30 continue
+c
+c calculate column indices(in array indat) and numerical values (in array
+c at) of matrix a-transposed using the list pointers iat(i+1) which
+c always point to the next element to be entered in row i of at.
+ 40 do 60 i=1,r
+ j1 = ia(i)
+ j2 = ia(i+1) - 1
+ if (j1.gt.j2) go to 60
+ do 50 jp=j1,j2
+ j = inda(jp + r)
+ jpt = iat(j+1)
+ indat(jpt + s) = i
+ at(jpt) = a(jp)
+ iat(j+1) = jpt + 1
+ 50 continue
+ 60 continue
+c
+c now all row pointers iat for at have correct values except position 1.
+c fix it.
+ iat(1) = 1
+c extract needed control information in indat.
+ do 70 i=1,s
+ indat(i) = iat(i+1) - iat(i)
+ 70 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspt.lo b/modules/sparse/src/fortran/dspt.lo
new file mode 100755
index 000000000..dd5f34c21
--- /dev/null
+++ b/modules/sparse/src/fortran/dspt.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspt.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspt.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspxs.f b/modules/sparse/src/fortran/dspxs.f
new file mode 100755
index 000000000..49994a93e
--- /dev/null
+++ b/modules/sparse/src/fortran/dspxs.f
@@ -0,0 +1,95 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspxs(nr,nc,a,nela,inda,b,mb,c,nelc,indc,ierr)
+c!purpose
+c multiply a full and a sparse matrices elementwise
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ double precision a(*),b(mb,nc),c(*)
+ integer nr,nc,nela,inda(*),nelc,indc(*),ierr
+c
+ integer jc,ka,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c jc counts elements of c.
+ jc = 1
+c ka,are numbers in first i rows of a,b.
+ ka = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ jb = 1
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.nc) go to 11
+ j2 = jb
+ if ((j1-j2) .lt. 0) then
+ goto 11
+ elseif ((j1-j2) .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index equals b-index multiply elements ,place in c.
+ 9 continue
+ if (jc.gt.nelmx) go to 16
+ c(jc) = a(ja)*b(i,jb)
+ jb = jb+1
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index greater than b-index
+ 10 jb = jb+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspxs.lo b/modules/sparse/src/fortran/dspxs.lo
new file mode 100755
index 000000000..1c593b4a8
--- /dev/null
+++ b/modules/sparse/src/fortran/dspxs.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspxs.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspxs.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/dspxsp.f b/modules/sparse/src/fortran/dspxsp.f
new file mode 100755
index 000000000..1e07fc228
--- /dev/null
+++ b/modules/sparse/src/fortran/dspxsp.f
@@ -0,0 +1,104 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine dspxsp(nr,nc,a,nela,inda,b,nelb,indb,c,nelc,indc,ierr)
+c!purpose
+c multiply two sparse matrices elementwise
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ double precision a(*),b(*),c(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 11
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 11
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index equals b-index multiply elements ,place in c.
+ 9 continue
+ if (jc.gt.nelmx) go to 16
+ c(jc) = a(ja)*b(jb)
+ indc(jc+kf)=j1
+ jc = jc+1
+ jb = jb+1
+ go to 11
+c if a-index greater than b-index
+ 10 jb = jb+1
+ go to 6
+ 11 continue
+c end of row of a.
+ 12 jb=kb+1
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/dspxsp.lo b/modules/sparse/src/fortran/dspxsp.lo
new file mode 100755
index 000000000..a5dcf82f1
--- /dev/null
+++ b/modules/sparse/src/fortran/dspxsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/dspxsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/dspxsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/findl.f b/modules/sparse/src/fortran/findl.f
new file mode 100755
index 000000000..ac1b7c9cb
--- /dev/null
+++ b/modules/sparse/src/fortran/findl.f
@@ -0,0 +1,20 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ integer function findl(l,i,ni)
+
+ integer i(ni)
+ ii=0
+ if(ni.gt.0) then
+ do 11 k=1,ni
+ if(i(k).ne.l) goto 11
+ ii=k
+ 11 continue
+ endif
+ findl=ii
+ end
diff --git a/modules/sparse/src/fortran/findl.lo b/modules/sparse/src/fortran/findl.lo
new file mode 100755
index 000000000..adb729ede
--- /dev/null
+++ b/modules/sparse/src/fortran/findl.lo
@@ -0,0 +1,12 @@
+# src/fortran/findl.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/findl.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/inpnv.f b/modules/sparse/src/fortran/inpnv.f
new file mode 100755
index 000000000..448834515
--- /dev/null
+++ b/modules/sparse/src/fortran/inpnv.f
@@ -0,0 +1,72 @@
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C
+C ------------------------------------------------------
+C INPUT NUMERICAL VALUES INTO SPARSE DATA STRUCTURES ...
+C ------------------------------------------------------
+C
+ SUBROUTINE INPNV ( NEQNS, XADJF, ADJF, ANZF, PERM, INVP,
+ & NSUPER, XSUPER, XLINDX, LINDX,
+ & XLNZ, LNZ, OFFSET )
+C
+ INTEGER XADJF(*), ADJF(*)
+ DOUBLE PRECISION ANZF(*)
+ INTEGER PERM(*), INVP(*)
+ INTEGER NEQNS, NSUPER
+ INTEGER XSUPER(*), XLINDX(*), LINDX(*)
+ INTEGER XLNZ(*)
+ DOUBLE PRECISION LNZ(*)
+ INTEGER OFFSET(*)
+C
+ INTEGER I, II, J, JLEN, JSUPER, LAST, OLDJ
+C
+ DO 500 JSUPER = 1, NSUPER
+C
+C ----------------------------------------
+C FOR EACH SUPERNODE, DO THE FOLLOWING ...
+C ----------------------------------------
+C
+C -----------------------------------------------
+C FIRST GET OFFSET TO FACILITATE NUMERICAL INPUT.
+C -----------------------------------------------
+ JLEN = XLINDX(JSUPER+1) - XLINDX(JSUPER)
+ DO 100 II = XLINDX(JSUPER), XLINDX(JSUPER+1)-1
+ I = LINDX(II)
+ JLEN = JLEN - 1
+ OFFSET(I) = JLEN
+ 100 CONTINUE
+C
+ DO 400 J = XSUPER(JSUPER), XSUPER(JSUPER+1)-1
+C -----------------------------------------
+C FOR EACH COLUMN IN THE CURRENT SUPERNODE,
+C FIRST INITIALIZE THE DATA STRUCTURE.
+C -----------------------------------------
+ DO 200 II = XLNZ(J), XLNZ(J+1)-1
+ LNZ(II) = 0.0
+ 200 CONTINUE
+C
+C -----------------------------------
+C NEXT INPUT THE INDIVIDUAL NONZEROS.
+C -----------------------------------
+ OLDJ = PERM(J)
+ LAST = XLNZ(J+1) - 1
+ DO 300 II = XADJF(OLDJ), XADJF(OLDJ+1)-1
+ I = INVP(ADJF(II))
+ IF ( I .GE. J ) THEN
+ LNZ(LAST-OFFSET(I)) = ANZF(II)
+ ENDIF
+ 300 CONTINUE
+ 400 CONTINUE
+C
+ 500 CONTINUE
+ RETURN
+ END
diff --git a/modules/sparse/src/fortran/inpnv.lo b/modules/sparse/src/fortran/inpnv.lo
new file mode 100755
index 000000000..e76b5cb4e
--- /dev/null
+++ b/modules/sparse/src/fortran/inpnv.lo
@@ -0,0 +1,12 @@
+# src/fortran/inpnv.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/inpnv.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/iperm.f b/modules/sparse/src/fortran/iperm.f
new file mode 100755
index 000000000..2ffed6daa
--- /dev/null
+++ b/modules/sparse/src/fortran/iperm.f
@@ -0,0 +1,43 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine iperm(vv,nv,ind)
+c apply an in-situ permutation
+ integer vv(nv),x
+ integer ind(nv)
+c
+ x=vv(1)
+ i3=1
+ i0=1
+ i=i0
+ 10 continue
+ if(ind(i).eq.i0) then
+c end of a permutation cycle
+ vv(i)=x
+ ind(i)=-ind(i)
+c look for first positive ind(i)
+ i0=i3
+ 11 i0=i0+1
+ if(i0.gt.nv) goto 20
+ if(ind(i0).lt.0) goto 11
+c beginning of a permutation cycle
+ i3=i0
+ i=i0
+ x=vv(i0)
+ else
+ vv(i)=vv(ind(i))
+ ind(i)=-ind(i)
+ i=-ind(i)
+ endif
+ goto 10
+ 20 continue
+
+ do 30 i=1,nv
+ ind(i)=-ind(i)
+ 30 continue
+ end
diff --git a/modules/sparse/src/fortran/iperm.lo b/modules/sparse/src/fortran/iperm.lo
new file mode 100755
index 000000000..6e447b029
--- /dev/null
+++ b/modules/sparse/src/fortran/iperm.lo
@@ -0,0 +1,12 @@
+# src/fortran/iperm.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/iperm.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/isort1.f b/modules/sparse/src/fortran/isort1.f
new file mode 100755
index 000000000..39d5c7273
--- /dev/null
+++ b/modules/sparse/src/fortran/isort1.f
@@ -0,0 +1,151 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine isort1(count,n,index,flag)
+c
+c !purpose
+c isort sort integer array,maintaining an index array
+c
+c !calling sequence
+c subroutine isort1(count,n,index,flag)
+c integer n,index(n)
+c integer count(n),flag
+c
+c count : array to be sorted
+c n :size of count and index
+c index : array containing on return index of sorted array
+c flag : 1 : increasing order
+c 0 : decreasing order
+c
+c !method
+c quick sort method is used
+c !restriction
+c n must be less than 2**(50/2) ! due to lengh of work space mark
+c !
+ dimension mark(50),index(n)
+ integer count(n),av,x,flag
+c
+c set index array to original order .
+ do 10 i=1,n
+ index(i)=i
+ 10 continue
+c check that a trivial case has not been entered .
+ if(n.le.1) goto 300
+c 'm' is the length of segment which is short enough to enter
+c the final sorting routine. it may be easily changed.
+ m=12
+c set up initial values.
+ la=2
+ is=1
+ if=n
+ do 190 mloop=1,n
+c if segment is short enough sort with final sorting routine .
+ ifka=if-is
+ if((ifka+1).gt.m) goto 70
+c*********final sorting ***
+c ( a simple bubble sort )
+ is1=is+1
+ do 60 j=is1,if
+ i=j
+ 40 if(count(i-1).gt.count(i)) goto 60
+ if(count(i-1).lt.count(i)) goto 50
+ if(index(i-1).lt.index(i)) goto 60
+ 50 av=count(i-1)
+ count(i-1)=count(i)
+
+ count(i)=av
+ int=index(i-1)
+ index(i-1)=index(i)
+ index(i)=int
+ i=i-1
+ if(i.gt.is) goto 40
+ 60 continue
+ la=la-2
+ goto 170
+c ******* quicksort ********
+c select the number in the central position in the segment as
+c the test number.replace it with the number from the segment's
+c highest address.
+ 70 iy=(is+if)/2
+ x=count(iy)
+ intest=index(iy)
+ count(iy)=count(if)
+ index(iy)=index(if)
+c the markers 'i' and 'ifk' are used for the beginning and end
+c of the section not so far tested against the present value
+c of x .
+ k=1
+ ifk=if
+c we alternate between the outer loop that increases i and the
+c inner loop that reduces ifk, moving numbers and indices as
+c necessary, until they meet .
+ do 110 i=is,if
+ if(x.lt.count(i)) goto 110
+ if(x.gt.count(i)) goto 80
+ if(intest.gt.index(i)) goto 110
+ 80 if(i.ge.ifk) goto 120
+ count(ifk)=count(i)
+ index(ifk)=index(i)
+ k1=k
+ do 100 k=k1,ifka
+ ifk=if-k
+ if(count(ifk).lt.x) goto 100
+ if(count(ifk).gt.x) goto 90
+ if(intest.le.index(ifk)) goto 100
+ 90 if(i.ge.ifk) goto 130
+ count(i)=count(ifk)
+ index(i)=index(ifk)
+ go to 110
+ 100 continue
+ goto 120
+ 110 continue
+c return the test number to the position marked by the marker
+c which did not move last. it divides the initial segment into
+c 2 parts. any element in the first part is less than or equal
+c to any element in the second part, and they may now be sorted
+c independently .
+ 120 count(ifk)=x
+ index(ifk)=intest
+ ip=ifk
+ goto 140
+ 130 count(i)=x
+ index(i)=intest
+ ip=i
+c store the longer subdivision in workspace.
+ 140 if((ip-is).gt.(if-ip)) goto 150
+ mark(la)=if
+ mark(la-1)=ip+1
+ if=ip-1
+ goto 160
+ 150 mark(la)=ip-1
+ mark(la-1)=is
+ is=ip+1
+c find the length of the shorter subdivision.
+ 160 lngth=if-is
+ if(lngth.le.0) goto 180
+c if it contains more than one element supply it with workspace .
+ la=la+2
+ goto 190
+ 170 if(la.le.0) goto 200
+c obtain the address of the shortest segment awaiting quicksort
+ 180 if=mark(la)
+ is=mark(la-1)
+ 190 continue
+ 200 continue
+ if(flag.eq.0) goto 300
+ do 201 i=1,n/2
+ j=n+1-i
+ ii=index(i)
+ index(i)=index(j)
+ index(j)=ii
+ ii=count(i)
+ count(i)=count(j)
+ count(j)=ii
+ 201 continue
+ 300 return
+ end
diff --git a/modules/sparse/src/fortran/isort1.lo b/modules/sparse/src/fortran/isort1.lo
new file mode 100755
index 000000000..cc6e430e4
--- /dev/null
+++ b/modules/sparse/src/fortran/isort1.lo
@@ -0,0 +1,12 @@
+# src/fortran/isort1.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/isort1.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lcompa.f b/modules/sparse/src/fortran/lcompa.f
new file mode 100755
index 000000000..24d3e8cc8
--- /dev/null
+++ b/modules/sparse/src/fortran/lcompa.f
@@ -0,0 +1,29 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) 1995-2008 - INRIA - Serge STEER
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ logical function lcompa(a,b,op)
+c compare two boolean coded integer numbers a and b
+c! calling sequence
+c logical function dcompa(a,b,op)
+c a,b : boolean coded integer
+c op is an integer indicator of the comparison to perform
+c op=50 : a==b
+c op=119: a~=b
+c
+ integer a,b
+ integer op
+ integer less,great,equal
+ logical l
+ data less/59/,great/60/,equal/50/
+ if(op.eq.equal) then
+ l=a.eq.b
+ elseif(op.eq.less+great) then
+ l=a.ne.b
+ endif
+ lcompa=l
+ end
diff --git a/modules/sparse/src/fortran/lcompa.lo b/modules/sparse/src/fortran/lcompa.lo
new file mode 100755
index 000000000..6a9ec42a1
--- /dev/null
+++ b/modules/sparse/src/fortran/lcompa.lo
@@ -0,0 +1,12 @@
+# src/fortran/lcompa.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lcompa.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lful2sp.f b/modules/sparse/src/fortran/lful2sp.f
new file mode 100755
index 000000000..06252d741
--- /dev/null
+++ b/modules/sparse/src/fortran/lful2sp.f
@@ -0,0 +1,27 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lful2sp(ma,na,a,nel,indr)
+c converts a full matrix to a sparse representation
+
+ integer a(ma,na)
+ integer indr(*)
+c
+ nel=0
+ do 5 i=1,ma
+ ni=0
+ do 4 j=1,na
+ if(a(i,j).ne.0) then
+ nel=nel+1
+ indr(ma+nel)=j
+ ni=ni+1
+ endif
+ 4 continue
+ indr(i)=ni
+ 5 continue
+ end
diff --git a/modules/sparse/src/fortran/lful2sp.lo b/modules/sparse/src/fortran/lful2sp.lo
new file mode 100755
index 000000000..b46b9c13f
--- /dev/null
+++ b/modules/sparse/src/fortran/lful2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lful2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lful2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lij2sp.f b/modules/sparse/src/fortran/lij2sp.f
new file mode 100755
index 000000000..244a1543e
--- /dev/null
+++ b/modules/sparse/src/fortran/lij2sp.f
@@ -0,0 +1,125 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lij2sp(m,n,nel,ij,v,ind,nind,iw,ierr)
+ integer ij(nel,2),ind(nind),iw(nel),v(nel)
+c
+ ierr=0
+ if(nel.eq.0) then
+ call iset(m,0,ind,1)
+ return
+ endif
+ call spsort(ij,nel,iw)
+ call iperm(v,nel,iw)
+
+ mm=ij(nel,1)
+ nm=ij(1,2)
+ if(nel.ge.2) then
+ do 01 k=2,nel
+ nm=max(nm,ij(k,2))
+ 01 continue
+ endif
+
+c eliminate leading zero entries
+ k0=0
+ 05 k0=k0+1
+ if (v(k0).eq.0.and.k0.lt.nel) goto 05
+ if (v(k0).eq.0) then
+ nel1=0
+ goto 10
+ endif
+
+
+c check for doubly defined entries
+c
+
+ k1=1
+ ij(k1,1)=ij(k0,1)
+ ij(k1,2)=ij(k0,2)
+ v(k1)=v(k0)
+ if(nel.gt.k0) then
+ do 08 k=k0+1,nel
+ if (v(k).ne.0) then
+ if(ij(k,1).ne.ij(k1,1).or.ij(k,2).ne.ij(k1,2)) then
+ k1=k1+1
+ ij(k1,1)=ij(k,1)
+ ij(k1,2)=ij(k,2)
+ v(k1)=v(k)
+ else
+ if(v(k1).ne.v(k)) then
+ ierr=3
+ return
+ endif
+ endif
+ endif
+ 08 continue
+ endif
+ nel1=k1
+
+c check dimensions
+ 10 continue
+ if(n.gt.0) then
+ if(n.lt.nm.or.m.lt.mm) then
+ ierr=1
+ return
+ endif
+ else
+ n=nm
+ m=mm
+ endif
+ if(nind.lt.m+nel1) then
+ ierr=2
+ return
+ endif
+c compute nl the number of non zero entries for each row
+ i0=1
+ do 20 lp=1,m
+ i=i0-1
+ 21 i=i+1
+ if(i.le.nel1) then
+ if(ij(i,1).eq.lp) goto 21
+ endif
+ nl=i-i0
+ ind(lp)=nl
+ i0=i
+ 20 continue
+ call icopy(nel1,ij(1,2),1,ind(m+1),1)
+ nel=nel1
+ end
+
+
+
+ subroutine lij2sp1(m,n,nel,ij,ind,nind,iw,ierr)
+c the same as above without tests
+ integer ij(nel,2),ind(nind),iw(nel)
+c
+ ierr=0
+ if(nel.eq.0) then
+ call iset(m,0,ind,1)
+ return
+ endif
+ call spsort(ij,nel,iw)
+
+ if(nind.lt.m+nel) then
+ ierr=2
+ return
+ endif
+c compute nl the number of non zero entries for each row
+ i0=1
+ do 20 lp=1,m
+ i=i0-1
+ 21 i=i+1
+ if(i.le.nel) then
+ if(ij(i,1).eq.lp) goto 21
+ endif
+ nl=i-i0
+ ind(lp)=nl
+ i0=i
+ 20 continue
+ call icopy(nel,ij(1,2),1,ind(m+1),1)
+ end
diff --git a/modules/sparse/src/fortran/lij2sp.lo b/modules/sparse/src/fortran/lij2sp.lo
new file mode 100755
index 000000000..6b3750564
--- /dev/null
+++ b/modules/sparse/src/fortran/lij2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lij2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lij2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/linpack_f_Import.def b/modules/sparse/src/fortran/linpack_f_Import.def
new file mode 100755
index 000000000..8aa3c2f33
--- /dev/null
+++ b/modules/sparse/src/fortran/linpack_f_Import.def
@@ -0,0 +1,8 @@
+ LIBRARY linpack_f.dll
+
+
+EXPORTS
+
+; linpack_f
+
+icopy_ \ No newline at end of file
diff --git a/modules/sparse/src/fortran/lsosp.f b/modules/sparse/src/fortran/lsosp.f
new file mode 100755
index 000000000..c797d67f4
--- /dev/null
+++ b/modules/sparse/src/fortran/lsosp.f
@@ -0,0 +1,165 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lsosp(op,ma,na,a,mb,nb,nelb,indb,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of a full boolean matrix A and a sparse boolean
+c matrix B
+c!parameters
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a: (ma,na) array
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c indb : b matrix control data:
+c indb(i) 1<=i<=mb contains the number of ith row non zero elements
+c of b
+c indb(mb+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelc column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ integer a(ma,na)
+ integer op,nr,nc,nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,j2
+ integer t
+ logical lcompa,z
+ external lcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ t=a(1,1)
+ z=lcompa(t,0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (lcompa(t,0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if (lcompa(t,1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ t=0
+ if(indb(1).eq.1) t=1
+ z=lcompa(0,t,op)
+ do 20 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 12 j=1,nc
+ if (lcompa(a(i,j),t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ indc(i)=jc-kc
+ kc=jc
+ 20 continue
+ else
+ z=lcompa(0,0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 23 j=1,nc
+ if (lcompa(a(i,j),0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j2.eq.j) then
+ if (lcompa(a(i,j),1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (lcompa(a(i,j),0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/lsosp.lo b/modules/sparse/src/fortran/lsosp.lo
new file mode 100755
index 000000000..a02ab795f
--- /dev/null
+++ b/modules/sparse/src/fortran/lsosp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lsosp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lsosp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspasp.f b/modules/sparse/src/fortran/lspasp.f
new file mode 100755
index 000000000..deb00cfb0
--- /dev/null
+++ b/modules/sparse/src/fortran/lspasp.f
@@ -0,0 +1,117 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspasp(nr,nc,nela,inda,nelb,indb,nelc,indc,ierr)
+c!pupose
+c logical element wise or of two sparse boolean matrices.
+c!parameters
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c clear indc.
+ do 1 i = 1,nr
+ indc(i) = 0
+ 1 continue
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 7
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 7
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index less than b-index transfer a-element to c.
+ 7 if (jc.gt.nelmx) go to 16
+ 8 continue
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index equals b-index add elements ,place sum in c.
+ 9 continue
+ jb = jb+1
+ if (jc.gt.nelmx) go to 16
+ go to 8
+c if a-index greater than b-index transfer b-element to c.
+ 10 if (jc.gt.nelmx) go to 16
+ indc(jc+kf)=j2
+ jb = jb+1
+ jc = jc+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (jb.gt.kb) go to 13
+ if (jc.gt.nelmx) go to 16
+ j2 = indb(jb+kf)
+ indc(jc+kf)=j2
+ jc = jc+1
+ jb = jb+1
+ go to 12
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/lspasp.lo b/modules/sparse/src/fortran/lspasp.lo
new file mode 100755
index 000000000..2d7ca4961
--- /dev/null
+++ b/modules/sparse/src/fortran/lspasp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspasp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspasp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspcsp.f b/modules/sparse/src/fortran/lspcsp.f
new file mode 100755
index 000000000..29a402a71
--- /dev/null
+++ b/modules/sparse/src/fortran/lspcsp.f
@@ -0,0 +1,72 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspcsp(op,ma,na,nela,inda,mb,nb,nelb,indb,
+ $ nelc,indc)
+c!purpose
+c concatenation of two sparse boolean matrices.
+c!parameters
+c op : integer flag which specifies the concatenation to perform
+c op=0 : row concatenation
+c op=1 : column concatenation
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mc contains the number of ith row non zero elements
+c of c
+c indc(mc+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*)
+c
+c
+ if(op.eq.0) then
+c row concatenation
+ ia=1
+ ib=1
+ ic=1
+ do 20 i=1,ma
+ call icopy(inda(i),inda(ma+ia),1,indc(ma+ic),1)
+ ic=ic+inda(i)
+ ia=ia+inda(i)
+ if (indb(i).gt.0) then
+ do 10 k=1,indb(i)
+ indc(ma+ic)=indb(mb+ib)+na
+ ic=ic+1
+ ib=ib+1
+ 10 continue
+ endif
+ indc(i)=inda(i)+indb(i)
+ 20 continue
+ nelc=nela+nelb
+ else
+c column concatenation
+ call icopy(ma,inda,1,indc,1)
+ call icopy(nela,inda(ma+1),1,indc(ma+mb+1),1)
+ call icopy(mb,indb,1,indc(ma+1),1)
+ call icopy(nelb,indb(mb+1),1,indc(ma+mb+1+nela),1)
+ nelc=nela+nelb
+ endif
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/lspcsp.lo b/modules/sparse/src/fortran/lspcsp.lo
new file mode 100755
index 000000000..d00827064
--- /dev/null
+++ b/modules/sparse/src/fortran/lspcsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspcsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspcsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspe2.f b/modules/sparse/src/fortran/lspe2.f
new file mode 100755
index 000000000..1414cdf67
--- /dev/null
+++ b/modules/sparse/src/fortran/lspe2.f
@@ -0,0 +1,63 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspe2(ma,na,nela,inda,i,ni,j,nj,
+ $ mr,nr,nelr,indr,ptr,ierr)
+c extract a submatrix from a sparse boolean matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptr(*)
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ logical allrow,allcol
+c
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ endif
+ ptr(1)=1
+ do 10 kk=1,ma
+ ptr(kk+1)=ptr(kk)+inda(kk)
+ 10 continue
+ jr=1
+ do 40 l=1,mr
+ indr(l)=0
+ if(allrow) then
+ ii=l
+ else
+ ii=i(l)
+ endif
+ if(inda(ii).eq.0) goto 40
+ if(allcol) then
+ indr(l)=inda(ii)
+ call icopy(inda(ii),inda(ma+ptr(ii)),1,indr(mr+jr),1)
+ jr=jr+inda(ii)
+ else
+ do 30 k=1,nj
+ jj=j(k)
+ do 20 kk=ptr(ii),ptr(ii+1)-1
+ if(inda(ma+kk).eq.jj) then
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ goto 30
+ endif
+ 20 continue
+ 30 continue
+ endif
+ 40 continue
+ nelr=jr-1
+ return
+ end
+
diff --git a/modules/sparse/src/fortran/lspe2.lo b/modules/sparse/src/fortran/lspe2.lo
new file mode 100755
index 000000000..b404e14dc
--- /dev/null
+++ b/modules/sparse/src/fortran/lspe2.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspe2.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspe2.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspful.f b/modules/sparse/src/fortran/lspful.f
new file mode 100755
index 000000000..10ee27b60
--- /dev/null
+++ b/modules/sparse/src/fortran/lspful.f
@@ -0,0 +1,26 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspful(ma,na,nela,inda,r)
+ integer r(*)
+ integer ma,na,nela,inda(*)
+c
+ call iset(ma*na,0,r,1)
+ i0=0
+ i1=i0
+ i=1
+ do 10 k=1,nela
+ 08 i0=i0+1
+ if(i0-i1.le.inda(i)) goto 09
+ i1=i0
+ i=i+1
+ goto 08
+ 09 j=inda(ma+k)
+ r(1+(i-1)+(j-1)*ma)=1
+ 10 continue
+ end
diff --git a/modules/sparse/src/fortran/lspful.lo b/modules/sparse/src/fortran/lspful.lo
new file mode 100755
index 000000000..3bd47d76e
--- /dev/null
+++ b/modules/sparse/src/fortran/lspful.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspful.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspful.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspis.f b/modules/sparse/src/fortran/lspis.f
new file mode 100755
index 000000000..6de833ddb
--- /dev/null
+++ b/modules/sparse/src/fortran/lspis.f
@@ -0,0 +1,209 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspis(ma,na,nela,inda,i,ni,j,nj,
+ $ mb,nb,b,mr,nr,nelr,indr,ierr)
+c extract a submatrix from a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*)
+ integer mb,nb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ integer b(mb,*)
+ logical allrow,allcol
+ integer findl
+ external findl
+c
+ nelmx=nelr
+ ierr=0
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ if(mb*nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call iset(mb,0,indr,1)
+ jr=1
+ if(mb*nb.ne.0) then
+ do 04 l=1,mb
+ do 03 k=1,nb
+ if(b(l,k).ne.0) then
+ indr(mb+jr)=k
+ indr(l)=indr(l)+1
+ jr=jr+1
+ endif
+ 03 continue
+ 04 continue
+ endif
+ nelr=jr-1
+ return
+ elseif(allcol) then
+c a(i,:)=b
+ jr=1
+ ja=1
+ do 20 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+ if(nb.gt.0) then
+ if(jr+nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ do 19 k1=1,nb
+ if(b(ii,k1).ne.0) then
+ indr(mr+jr)=k1
+ indr(l)=indr(l)+1
+ jr=jr+1
+ endif
+ 19 continue
+ endif
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ 20 continue
+ nelr=jr-1
+ if(nb.eq.0) mr=mr-ni
+ elseif(allrow) then
+c a(:,j)=b
+ jr=1
+ ja=0
+ do 35 l=1,ma
+ ja1=1
+ nal=inda(l)
+ indr(l)=0
+ kr=1
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ kr=kr+1
+ else
+c the a(l,k) element is replaced by b(l,jj) element
+ if(nb.gt.0) then
+ if(b(l,jj).ne.0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ 31 continue
+ ja=ja+nal
+ 35 continue
+ nelr=jr-1
+ if(nb.eq.0) nr=nr-nj
+ return
+ else
+c a(i,j)=b
+ jr=1
+ ja=0
+ do 45 l=1,mr
+ ja1=1
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr),1)
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ kr=1
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ kr=kr+1
+ else
+c * replace a(l,k) element by b(ii,jj) element if non zero
+ if(nb.gt.0) then
+ if(b(ii,jj).ne.0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=kr
+ jr=jr+1
+ endif
+ kr=kr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 42 continue
+ endif
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
+
+
diff --git a/modules/sparse/src/fortran/lspis.lo b/modules/sparse/src/fortran/lspis.lo
new file mode 100755
index 000000000..61fb89b04
--- /dev/null
+++ b/modules/sparse/src/fortran/lspis.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspis.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspis.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspisp.f b/modules/sparse/src/fortran/lspisp.f
new file mode 100755
index 000000000..7ab1a63d8
--- /dev/null
+++ b/modules/sparse/src/fortran/lspisp.f
@@ -0,0 +1,202 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspisp(ma,na,nela,inda,i,ni,j,nj,
+ $ mb,nb,nelb,indb,mr,nr,nelr,indr,ptrb,ierr)
+c extract a submatrix from a sparse boolean matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptrb(*)
+ integer indb(*),mb,nelb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ logical allrow,allcol
+ integer findl
+ external findl
+c
+ mr=ni
+ nr=nj
+ ierr=0
+ nelmx=nelr
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ call icopy(mb+nelb,indb,1,indr,1)
+ nelr=nelb
+ return
+ elseif(allcol) then
+c a(i,:)=b
+ jr=1
+ jb=1
+ ja=1
+ call sz2ptr(indb,mb,ptrb)
+ do 20 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+ jb=ptrb(ii)
+ indr(l)=indb(ii)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call icopy(indr(l),indb(mb+jb),1,indr(mr+jr),1)
+ jr=jr+indr(l)
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ 20 continue
+ nelr=jr-1
+ elseif(allrow) then
+c a(:,j)=b
+ jr=1
+ ja=0
+ jb=0
+ do 35 l=1,ma
+ ja1=1
+ nbl=indb(l)
+ nal=inda(l)
+ indr(l)=0
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c the a(l,k) element is replaced by b(l,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 31 continue
+ ja=ja+nal
+ jb=jb+nbl
+ 35 continue
+ nelr=jr-1
+ return
+ else
+c a(i,j)=b
+ jr=1
+ ja=0
+ call sz2ptr(indb,mb,ptrb)
+ do 45 l=1,mr
+ ja1=1
+
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr),1)
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ jb=ptrb(ii)-1
+ jb1=1
+ nbl=indb(ii)
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element insert in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c * replace a(l,k) element by b(ii,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 42 continue
+ endif
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
+
diff --git a/modules/sparse/src/fortran/lspisp.lo b/modules/sparse/src/fortran/lspisp.lo
new file mode 100755
index 000000000..9d3214cd3
--- /dev/null
+++ b/modules/sparse/src/fortran/lspisp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspisp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspisp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspmat.f b/modules/sparse/src/fortran/lspmat.f
new file mode 100755
index 000000000..eee4218fc
--- /dev/null
+++ b/modules/sparse/src/fortran/lspmat.f
@@ -0,0 +1,33 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspmat(ma,na,nela,inda,mr,indr,iw)
+c lspmat reshape a sparse boolean matrix
+ integer inda(*),indr(*),iw(*)
+ integer ma,na,nela
+c
+ nr=(ma*na)/mr
+ ja=0
+ ki=1
+ kj=nela+1
+ do 20 i=1,ma
+ nira=inda(i)
+ if(nira.ne.0) then
+ do 10 j=1,nira
+ ija=i-1+(inda(ma+ja+j)-1)*ma
+ iw(kj)=int(ija/mr)+1
+ iw(ki)=ija-mr*(iw(kj)-1)+1
+ ki=ki+1
+ kj=kj+1
+ 10 continue
+ ja=ja+nira
+ endif
+ 20 continue
+c lij2sp (m, n, nel, ij,v,ind,nind, iw, ierr)
+ call lij2sp1(mr,nr,nela,iw,indr,mr+nela,iw(2*nela+1),ierr)
+ end
diff --git a/modules/sparse/src/fortran/lspmat.lo b/modules/sparse/src/fortran/lspmat.lo
new file mode 100755
index 000000000..069a670bb
--- /dev/null
+++ b/modules/sparse/src/fortran/lspmat.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspmat.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspmat.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspops.f b/modules/sparse/src/fortran/lspops.f
new file mode 100755
index 000000000..4dd505b54
--- /dev/null
+++ b/modules/sparse/src/fortran/lspops.f
@@ -0,0 +1,1165 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspops
+c
+c operations on boolean sparse matrices
+c
+ include 'stack.h'
+ integer op
+c
+ integer iadr,sadr
+c
+ integer star,dstar,dot,colon
+ integer less,great,equal,ou,et,non
+ integer insert,extrac
+ integer top0
+ logical isany
+c
+ data star/47/,dstar/62/,dot/51/,colon/44/
+ data less/59/,great/60/,equal/50/
+ data ou/57/,et/58/,non/61/
+ data insert/2/,extrac/3/
+c
+ iadr(l)=l+l-1
+ sadr(l)=(l/2)+1
+c
+ op=fin
+c
+ if (ddt .eq. 4) then
+ call writebufspc(buf,fin)
+ call basout(io,wte,' lspops op: '//buf(1:4))
+ endif
+c
+ top0=top
+ lw=lstk(top+1)+1
+ if(op.eq.extrac) goto 70
+ if(op.eq.insert) goto 80
+
+ it2=0
+ goto (04,03,02,01) rhs
+ call error(39)
+ return
+c
+ 01 il4=iadr(lstk(top))
+ if(istk(il4).lt.0) il4=iadr(istk(il4+1))
+ m4=istk(il4+1)
+ n4=istk(il4+2)
+ it4=istk(il4+3)
+ if(istk(il4).eq.6) then
+ nel4=istk(il4+4)
+ irc4=il4+5
+ l4=sadr(irc4+m4+nel4)
+ else
+ nel4=m4*n4
+ l4=sadr(il4+4)
+ endif
+ mn4=m4*n4
+ top=top-1
+c
+ 02 il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.6) then
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ else
+ l3=sadr(il3+4)
+ nel3=m3*n3
+ endif
+ mn3=m3*n3
+ top=top-1
+c
+ 03 il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ if(istk(il2).eq.6) then
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ else
+ l2=sadr(il2+4)
+ nel2=m2*n2
+ endif
+ mn2=m2*n2
+ top=top-1
+c
+ 04 il1=iadr(lstk(top))
+ il1r=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+ it1=istk(il1+3)
+ if(istk(il1).eq.6) then
+ nel1=istk(il1+4)
+ irc1=il1+5
+ l1=sadr(irc1+m1+nel1)
+ else
+ l1=sadr(il1+4)
+ nel1=m1*n1
+ endif
+ mn1=m1*n1
+ top=top-1
+c
+c operations binaires et ternaires
+c --------------------------------
+c
+ top=top+1
+ itr=max(it1,it2)
+c
+ fun = 0
+c
+c column concatenation
+ if(op.eq.1) goto 65
+c row concatenation
+ if(op.eq.4) goto 66
+c : + - * / \ = '
+ goto(07,07,07,07,07,07,130,05,05,60) op+1-colon
+ if(op.eq.ou.or.op.eq.et) goto 20
+ if(op.eq.non) goto 30
+c
+ 05 if(op.eq.dstar) goto 07
+ if(op.ge.3*dot+star) goto 07
+ if(op.ge.2*dot+star) goto 07
+ if(op.ge.less+equal) goto 130
+ if(op.ge.dot+star) goto 07
+ if(op.ge.less) goto 130
+
+ 06 call error(43)
+ return
+c
+ 07 fin=-fin
+ top=top0
+ go to 999
+c
+c ou/et logique
+ 20 if(istk(il1).ne.6.or.istk(il2).ne.6) then
+ fin=-fin
+ top=top0
+ go to 999
+ endif
+ if(mn1.eq.1.and.mn2.gt.1) then
+ top=top0
+ fin=-fin
+ return
+ elseif(mn2.eq.1.and.mn1.gt.1) then
+ top=top0
+ fin=-fin
+ return
+ else if (n1 .ne. n2.or.m1.ne.m2) then
+ call error(60)
+ return
+ endif
+ irc=iadr(lw)
+ nelmx=iadr(lstk(bot))-irc-m1-10
+ lw=sadr(irc+m1+nelmx)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel=nelmx
+ if(fin.eq.ou) then
+ call lspasp(m1,n1,nel1,istk(irc1),nel2,istk(irc2),nel,
+ $ istk(irc),ierr)
+ else
+ call lspxsp(m1,n1,nel1,istk(irc1),nel2,istk(irc2),nel,
+ $ istk(irc),ierr)
+ endif
+ if(ierr.ne.0) then
+ call error(17)
+ return
+ endif
+ istk(il1+3)=0
+ istk(il1+4)=nel
+ call icopy(m1+nel,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+nel)
+ lstk(top+1)=l1
+ go to 999
+
+c NOT
+ 30 continue
+ lw=iadr(lstk(top+1))
+ err=sadr(lw+m1*n1-nel1+m1)-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+
+ istk(il1+4)=m1*n1-nel1
+ ij2=lw
+ ij1=irc1+m1
+c may be improved
+ do 35 i=0,m1-1
+ do 31 j=1,n1
+ istk(ij2+j-1)=j
+ 31 continue
+ do 32 j=1,istk(irc1+i)
+ istk(ij2+istk(ij1+j-1)-1)=0
+ 32 continue
+ j1=0
+ do 33 j=1,n1
+ if(istk(ij2+j-1).ne.0) then
+ j1=j1+1
+ istk(ij2+j1-1)=istk(ij2+j-1)
+ endif
+ 33 continue
+ ij2=ij2+j1
+ ij1=ij1+istk(irc1+i)
+ istk(irc1+i)=n1-istk(irc1+i)
+ 35 continue
+ call icopy(ij2-lw,istk(lw),1,istk(irc1+m1),1)
+ lstk(top+1)=sadr(irc1+m1+ij2-lw)
+ goto 999
+
+c
+c
+c transposition
+ 60 istk(il1+1)=n1
+ istk(il1+2)=m1
+ if(nel1.eq.0) then
+ lw=sadr(il1+5+n1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call iset(n1,0,istk(il1+5),1)
+ lstk(top+1)=lw
+ goto 999
+ endif
+ ia=iadr(lw)
+ iat=ia+m1+1
+ irc=iat+n1+1
+ lw=sadr(irc+n1+nel1)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ istk(ia)=1
+ do 61 i=1,m1
+ istk(ia+i)=istk(ia+i-1)+istk(irc1+i-1)
+ 61 continue
+ call lspt(m1,n1,nel1,istk(irc1),istk(ia),
+ $ istk(iat),istk(irc))
+ call icopy(n1+nel1,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+n1+nel1)
+ lstk(top+1)=l1
+ goto 999
+c
+c concatenation [a b]
+ 65 continue
+ if(m1.lt.0.or.m2.lt.0) then
+ call error(14)
+ return
+ endif
+ if(m2.eq.0) then
+ return
+ elseif(m1.eq.0) then
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ lstk(top+1)=l1
+ return
+ elseif(m1.ne.m2) then
+ call error(5)
+ return
+ endif
+ if(istk(il1).ne.6.or.istk(il2).ne.6) then
+ top=top0
+ fin=-fin
+ return
+ endif
+c
+ nelr=nel1+nel2
+ istk(il1+2)=n1+n2
+ istk(il1+3)=0
+ istk(il1+4)=nelr
+ irc=iadr(lw)
+ lw=sadr(irc+m1+nelr)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call lspcsp(0,m1,n1,nel1,istk(irc1),
+ $ m2,n2,nel2,istk(irc2),
+ $ nelr,istk(irc))
+ call icopy(m1+nelr,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+nelr)
+ lstk(top+1)=l1
+ return
+c
+c concatenation [a;b]
+ 66 continue
+ if(n1.lt.0.or.n2.lt.0) then
+ call error(14)
+ return
+ endif
+ if(n2.eq.0) then
+ goto 999
+ elseif(n1.eq.0)then
+ call icopy(5+m2+nel2,istk(il2),1,istk(il1),1)
+ l1=sadr(il1+5+m2+nel2)
+ lstk(top+1)=l1
+ goto 999
+ elseif(n1.ne.n2) then
+ call error(6)
+ return
+ endif
+ if(istk(il1).ne.6.or.istk(il2).ne.6) then
+ top=top0
+ fin=-fin
+ return
+ endif
+
+
+ nelr=nel1+nel2
+ istk(il1+1)=m1+m2
+ istk(il1+3)=0
+ istk(il1+4)=nelr
+ irc=iadr(lw)
+ lw=sadr(irc+m1+m2+nelr)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call lspcsp(1,m1,n1,nel1,istk(irc1),
+ $ m2,n2,nel2,istk(irc2),
+ $ nelr,istk(irc))
+ call icopy(m1+m2+nelr,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+m1+m2+nelr)
+ lstk(top+1)=l1
+ goto 999
+c
+c extraction
+c
+ 70 continue
+ if(rhs.gt.2) goto 75
+c arg2(arg1)
+c get arg2
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ mn2=m2*n2
+ top=top-1
+c get arg1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+c
+ if(mn2.eq.0) then
+c . arg2=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m2.lt.0) then
+c . arg2=eye
+ call error(14)
+ return
+ elseif(m1.lt.0) then
+c . arg2(:), just reshape to column vector
+ if(n2.eq.1) then
+ call icopy(5+m2+nel2,istk(il2),1,istk(ilrs),1)
+ l1=sadr(ilrs+5+m2+nel2)
+ lstk(top+1)=l1
+ else
+c . reshape to column vector
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=mn2
+ istk(ilrs+2)=1
+ istk(ilrs+3)=0
+ istk(ilrs+4)=nel2
+ irc1=ilrs+5
+ l1=sadr(ilrs+5+m2*n2+nel2)
+
+ ircr=iadr(lw)
+ iw=ircr+m2*n2+nel2
+ lw=sadr(iw+3*nel2)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ call lspmat(m2,n2,nel2,istk(irc2),m2*n2,istk(ircr),istk(iw))
+ call icopy(m2*n2+nel2,istk(ircr),1,istk(irc1),1)
+ lstk(top+1)=l1
+ endif
+ return
+ elseif(m2.gt.1.and.n2.gt.1) then
+c . call macro coded operation
+ top=top0
+ fin=-fin
+ return
+ endif
+c check and convert indices variable
+ call indxg(il1,mn2,ilr,mi,mx,lw,1)
+ if(err.gt.0) return
+ if(mx.gt.mn2) then
+ call error(21)
+ return
+ endif
+ 72 if(mi.eq.0) then
+c arg2([])
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ endif
+c set output sizes
+ if (m2 .gt. 1.or.m1.lt.0) then
+c . column vector
+ m=mi
+ n=-1
+ mr = mi
+ nr = 1
+ else
+c . row vector
+ m=-1
+ n=mi
+ nr = mi
+ mr = 1
+ endif
+ lptr=iadr(lw)
+ irc=lptr+m2+1
+ lw=sadr(irc+mr)
+ nelr=iadr(lstk(bot))-iadr(lw)
+ if(nelr.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lw=sadr(irc+mr+nelr)
+ nel=nelr
+
+ call lspe2(m2,n2,nel2,istk(irc2),
+ $ istk(ilr),m,istk(ilr),n,mr,nr,
+ $ nelr,istk(irc),istk(lptr),ierr)
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=0
+ istk(ilrs+4)=nelr
+ call icopy(m+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ lstk(top+1)=l1
+ go to 999
+
+c
+c arg3(arg1,arg2)
+ 75 if(rhs.gt.3) then
+ call error(36)
+ return
+ endif
+c get arg3
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ mn3=m3*n3
+ top=top-1
+c get arg2
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ top=top-1
+c get arg1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+
+ if(mn3.eq.0) then
+c . arg3=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m3.lt.0) then
+c .arg3=eye
+ call error(14)
+ return
+ endif
+c check and convert indices variables
+ call indxg(il1,m3,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr=mxi
+ else
+ mr=mi
+ endif
+ call indxg(il2,n3,ilj,nj,mxj,lw,1)
+ if(err.gt.0) return
+ if(nj.lt.0) then
+ nr=mxj
+ else
+ nr=nj
+ endif
+c
+ 76 continue
+ mn=mr*nr
+ if(mn.eq.0) then
+c . arg1=[] or arg2=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ endif
+ lptr=iadr(lw)
+ irc=lptr+m3+1
+ lw=sadr(irc+mr)
+ nelr=iadr(lstk(bot))-iadr(lw)
+ if(nelr.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lw=sadr(irc+mr+nelr)
+ nel=nelr
+ call lspe2(m3,n3,nel3,istk(irc3),istk(ili),mi,
+ $ istk(ilj),nj,mr,nr,nelr,istk(irc),istk(lptr),ierr)
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=0
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ lstk(top+1)=l1
+ go to 999
+c
+c insert
+ 80 continue
+ if(rhs.eq.4) goto 90
+c arg3(arg1)=arg2
+c get arg3
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.6) then
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn3=m3*n3
+
+c get arg2
+ top=top-1
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+ n2=istk(il2+2)
+ it2=istk(il2+3)
+ if(istk(il2).eq.6) then
+ nel2=istk(il2+4)
+ irc2=il2+5
+ l2=sadr(irc2+m2+nel2)
+ elseif(istk(il2).eq.4) then
+ l2=il2+3
+ nel2=m2*n2
+ elseif(istk(il2).eq.1.and.m2*n2.eq.0) then
+ l2=sadr(il2+4)
+ nel2=m2*n2
+ istk(il2)=4
+ l2=il2+3
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn2=m2*n2
+
+c get arg1
+ top=top-1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ if (istk(il1).eq.10.or.istk(il1).eq.15) then
+ top=top0
+ fin=-fin
+ return
+ endif
+ m1=istk(il1+1)
+ n1=istk(il1+2)
+
+
+ if (m2.eq.0) then
+c . arg3(arg1)=[] -->[]
+ if(m1.eq.-1) then
+c . arg3(:)=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m1.eq.0) then
+c . arg3([])=[] --> arg3
+ call icopy(5+m3+nel3,istk(il3),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m3+nel3)
+ lstk(top+1)=l
+ goto 999
+ else
+c . arg3(arg1)=[]
+ if(istk(il1).eq.4.and.m3.eq.m1.and.n3.eq.n1) then
+ if(.not.isany(il1)) then
+c . arg3([])=[] --> arg3
+ call icopy(5+m3+nel3,istk(il3),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m3+nel3)
+ lstk(top+1)=l
+ goto 999
+ endif
+ endif
+c . arg3(arg1)=[] -->arg3(compl(arg1),:)
+ if(m3.gt.1.and.n3.gt.1) then
+c . call macro coded op to reshape and insert
+ top=top0
+ fin=-fin
+ return
+ else
+ call indxgc(il1,mn3,ilr,mi,mx,lw)
+ if(err.gt.0) return
+ l2=l3
+ n2=n3
+ m2=m3
+ mn2=m2*n2
+ it2=it3
+ nel2=nel3
+ irc2=irc3
+c . call extraction
+ goto 72
+ endif
+ endif
+ elseif(m2.lt.0.or.m3.lt.0) then
+c . arg3=eye,arg2=eye
+ call error(14)
+ return
+ elseif(m1.lt.0) then
+c . arg3(:)=arg2 reshape arg2 according to arg3
+ if(mn2.ne.mn3) then
+ call error(15)
+ return
+ endif
+ if(m2.ne.m3) then
+ top=top0
+ fin=-fin
+ return
+ endif
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=m3
+ istk(ilrs+2)=n3
+ call icopy(2+m2+nel2,istk(il2+3),1,istk(ilrs+3),1)
+ l1=sadr(ilrs+5+m2+nel2)
+ lstk(top+1)=l1
+ return
+ elseif(m3.gt.1.and.n3.gt.1) then
+c . arg3(arg1)=arg2 with arg3 not a vector
+ top=top0
+ fin=-fin
+ return
+ endif
+ call indxg(il1,mn3,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.eq.0) then
+c . arg3([])=arg2
+ call error(15)
+ return
+ endif
+ if(mi.ne.mn2) then
+ call error(15)
+ return
+ endif
+c
+ if (n3.gt.1.and.m3.gt.1) then
+c . arg3 is not a vector
+ if(n2.gt.1.and.m2.gt.1) then
+ call error(15)
+ return
+ endif
+ if(mxi.gt.m3*n3) then
+ call error(21)
+ return
+ endif
+ mr=m3
+ nr=n3
+ elseif (n3.le.1.and.n2.le.1) then
+c . arg3 and arg2 are column vectors
+ mr=max(m3,mxi)
+ nr=max(n3,1)
+ elseif (m3.le.1.and.m2.le.1) then
+c . row vectors
+ nr=max(n3,mxi)
+ mr=max(m3,1)
+ else
+c . arg3 and arg2 dimensions dont agree
+ call error(15)
+ return
+ endif
+
+c set output sizes
+ if (m3 .gt. 1.or.m1.lt.0) then
+c . column vector
+ m=mi
+ n=-1
+ mr = mi
+ nr = 1
+ else
+c . row vector
+ m=-1
+ n=mi
+ nr = mi
+ mr = 1
+ endif
+c
+ lptr=iadr(lw)
+ irc=lptr+mr+1
+ nelr=iadr(lstk(bot))-irc-mr
+ if(nelr.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lw=sadr(irc+mr+nelr)
+ nel=nelr
+ if(istk(il3).eq.6) then
+ if(istk(il2).eq.6) then
+ call lspisp(m3,n3,nel3,istk(irc3),istk(ili),m,istk(ili),n,m2
+ $ ,n2,nel2,istk(irc2),mr,nr,nelr,istk(irc),istk(lptr)
+ $ ,ierr)
+ elseif(istk(il2).eq.4) then
+ call lspis(m3,n3,nel3,istk(irc3),istk(ili),m,istk(ili),n,m2
+ $ ,n2,istk(l2),mr,nr,nelr,istk(irc),ierr)
+ endif
+ endif
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=0
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ lstk(top+1)=l1
+ go to 999
+c
+ 90 continue
+c arg4(arg1,arg2)=arg3
+c get arg4
+ il4=iadr(lstk(top))
+ if(istk(il4).lt.0) il4=iadr(istk(il4+1))
+ m4=istk(il4+1)
+ n4=istk(il4+2)
+ it4=istk(il4+3)
+ if(istk(il4).eq.6) then
+ nel4=istk(il4+4)
+ irc4=il4+5
+ l4=sadr(irc4+m4+nel4)
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn4=m4*n4
+c get arg3
+ top=top-1
+ il3=iadr(lstk(top))
+ if(istk(il3).lt.0) il3=iadr(istk(il3+1))
+ m3=istk(il3+1)
+ n3=istk(il3+2)
+ it3=istk(il3+3)
+ if(istk(il3).eq.6) then
+ nel3=istk(il3+4)
+ irc3=il3+5
+ l3=sadr(irc3+m3+nel3)
+ elseif(istk(il3).eq.4) then
+ nel3=m3*n3
+ l3=il3+3
+ elseif(istk(il3).eq.1.and.m3*n3.eq.0) then
+ l3=sadr(il3+4)
+ nel3=m3*n3
+ istk(il3)=4
+ l3=il3+3
+ else
+ top=top0
+ fin=-fin
+ return
+ endif
+ mn3=m3*n3
+c get arg2
+ top=top-1
+ il2=iadr(lstk(top))
+ if(istk(il2).lt.0) il2=iadr(istk(il2+1))
+ m2=istk(il2+1)
+c get arg1
+ top=top-1
+ il1=iadr(lstk(top))
+ ilrs=il1
+ if(istk(il1).lt.0) il1=iadr(istk(il1+1))
+ m1=istk(il1+1)
+
+ if (m3.eq.0) then
+c . arg4(arg1,arg2)=[]
+ if(m1.eq.-1.and.m2.eq.-1) then
+c . arg4(:,:)=[] -->[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ elseif(m1.eq.0.or.m2.eq.0) then
+c . arg4([],arg2)=[], arg4(arg1,[])=[] --> arg4
+ call icopy(5+m4+nel4,istk(il4),1,istk(ilrs),1)
+ l=sadr(ilrs+5+m4+nel4)
+ lstk(top+1)=l
+ goto 999
+ elseif(m2.eq.-1) then
+c . arg3(arg1,:)=[] --> arg3(compl(arg1),:)
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ if(err.gt.0) return
+ mr=mi
+ call indxg(il2,n4,ilj,nj,mxj,lw,1)
+ if(err.gt.0) return
+ if(nj.lt.0) then
+ nr=mxj
+ else
+ nr=nj
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ mn3=m3*n3
+ it3=it4
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ elseif(m1.eq.-1) then
+c . arg3(:,arg2)=[] --> arg3(:,compl(arg2))
+ call indxgc(il2,n4,ilj,nj,mxj,lw)
+ if(err.gt.0) return
+ nr=nj
+ call indxg(il1,m4,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr=mxi
+ else
+ mr=mi
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ mn3=m3*n3
+ it3=it4
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ else
+c . arg4(arg1,arg2)=[]
+ lw1=lw
+ call indxgc(il2,n4,ilj,nj,mxj,lw)
+ if(err.gt.0) return
+ nr=nj
+ if(nj.eq.0) then
+c . arg4(arg1,1:n4)=[]
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ lw2=lw
+ if(err.gt.0) return
+ mr=mi
+c . arg2=1:n4
+ if(mi.eq.0) then
+c . arg4(1:m4,1:n4)=[]
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=1
+ istk(ilrs+1)=0
+ istk(ilrs+2)=0
+ istk(ilrs+3)=0
+ lstk(top+1)=sadr(ilrs+4)+1
+ goto 999
+ else
+c . arg4(arg1,1:n4)=[]
+c . replace arg2 by ":"
+ il2=iadr(lw2)
+ istk(il2)=1
+ istk(il2+1)=-1
+ istk(il2+2)=-1
+ istk(il2+3)=0
+c .
+ lw=lw2+2
+ call indxg(il2,n4,ilj,nj,mxj,lw,1)
+ if(err.gt.0) return
+ if(nj.lt.0) then
+ nr=mxj
+ else
+ nr=nj
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ it3=it4
+ mn3=m3*n3
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ endif
+ else
+ lw=lw1
+ call indxgc(il1,m4,ili,mi,mxi,lw)
+ if(err.gt.0) return
+ if(mi.eq.0) then
+c . arg4(1:m4,arg2)=[]
+ call indxg(il1,m4,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr=mxi
+ else
+ mr=mi
+ endif
+ l3=l4
+ n3=n4
+ m3=m4
+ it3=it4
+ mn3=m3*n3
+ irc3=irc4
+ nel3=nel4
+c . call extraction
+ goto 76
+ else
+ call error(15)
+ return
+ endif
+ endif
+ endif
+ elseif(m3.lt.0.or.m4.lt.0) then
+c . arg3=eye , arg4=eye
+ call error(14)
+ return
+ elseif(m1.eq.-1.and.m2.eq.-1) then
+c . arg4(:,:)=arg3
+ if(mn3.ne.mn4) then
+ call error(15)
+ return
+ endif
+ if(m3.ne.m4) then
+ top=top0
+ fin=-fin
+ return
+ endif
+c . reshape arg3 according to arg4
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=m4
+ istk(ilrs+2)=n4
+ call icopy(2+m3+nel3,istk(il3+3),1,istk(ilrs+3),1)
+ l1=sadr(ilrs+5+m3+nel3)
+ lstk(top+1)=l1
+ return
+ endif
+
+ call indxg(il1,m4,ili,mi,mxi,lw,1)
+ if(err.gt.0) return
+ if(mi.lt.0) then
+ mr1=mxi
+ else
+ mr1=mi
+ endif
+ call indxg(il2,n4,ilj,mj,mxj,lw,1)
+ if(err.gt.0) return
+ if(mj.lt.0) then
+ nr1=mxj
+ else
+ nr1=mj
+ endif
+ if(mr1.eq.0.or.nr1.eq.0) then
+ call error(15)
+ return
+ endif
+ if(mr1.ne.m3.or.nr1.ne.n3) then
+c . sizes of arg1 or arg2 dont agree with arg3 sizes
+ call error(15)
+ return
+ endif
+ mr=max(m4,mxi)
+ nr=max(n4,mxj)
+c
+ lptr=iadr(lw)
+ irc=lptr+mr+1
+ nelr=iadr(lstk(bot))-irc-mr
+ if(nelr.le.0) then
+ err=lw-lstk(bot)
+ call error(17)
+ return
+ endif
+ lw=sadr(irc+mr+nelr)
+ nel=nelr
+ if(istk(il4).eq.6) then
+ if(istk(il3).eq.6) then
+ call lspisp(m4,n4,nel4,istk(irc4),istk(ili),mi,istk(ilj),mj,
+ $ m3,n3,nel3,istk(irc3),mr,nr,nelr,istk(irc),istk(lptr)
+ $ ,ierr)
+ elseif(istk(il3).eq.4) then
+ l3=il3+3
+ call lspis(m4,n4,nel4,istk(irc4),istk(ili),mi,istk(ilj),mj
+ $ ,m3,n3,istk(l3),mr,nr,nelr,istk(irc),ierr)
+ endif
+ endif
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ ilrs=iadr(lstk(top))
+ istk(ilrs)=6
+ istk(ilrs+1)=mr
+ istk(ilrs+2)=nr
+ istk(ilrs+3)=0
+ istk(ilrs+4)=nelr
+ call icopy(mr+nelr,istk(irc),1,istk(ilrs+5),1)
+ l1=sadr(ilrs+5+mr+nelr)
+ lstk(top+1)=l1
+ go to 999
+c
+ 130 continue
+c comparaisons
+ if(mn2.eq.0.and.mn1.eq.0) then
+ if(op.eq.equal.or.op.eq.less+great) then
+ il1=iadr(lstk(top))
+ istk(il1)=4
+ istk(il1+1)=1
+ istk(il1+2)=1
+ istk(il1+3)=1
+ if(op.eq.less+great) istk(il1+3)=0
+ lstk(top+1)=sadr(il1+4)
+ goto 999
+ else
+ call error(60)
+ return
+ endif
+ endif
+ if(mn1.ne.1.and.mn2.ne.1) then
+ if(n1.ne.n2.or.m1.ne.m2) then
+ if(op.eq.equal.or.op.eq.less+great) then
+ il1=iadr(lstk(top))
+ istk(il1)=4
+ istk(il1+1)=1
+ istk(il1+2)=1
+ istk(il1+3)=0
+ if(op.eq.less+great) istk(il1+3)=1
+ lstk(top+1)=sadr(il1+4)
+ return
+ else
+ call error(60)
+ return
+ endif
+ endif
+ endif
+ if(istk(il1).ne.4.and.istk(il1).ne.6.or.istk(il2).ne.4.and
+ $ .istk(il2).ne.6) then
+ top=top0
+ fin=-fin
+ return
+ endif
+c
+ mr=m1
+ nr=n1
+ if(m1*n1.eq.1) then
+ mr=m2
+ nr=n2
+ endif
+ irc=iadr(lw)
+ nelmx=(iadr(lstk(bot))-irc-mr-10)
+ lw=sadr(irc+mr+nelmx)
+ err=lw-lstk(bot)
+ if(err.gt.0) then
+ call error(17)
+ return
+ endif
+ nel=nelmx
+ if(istk(il1).eq.4) then
+ l1=il1+3
+ call lsosp(op,m1,n1,istk(l1),m2,n2,nel2,istk(irc2),nel,istk(irc
+ $ ),ierr)
+ elseif(istk(il2).eq.4) then
+ l2=il2+3
+ call lspos(op,m1,n1,nel1,istk(irc1),
+ $ m2,n2,istk(l2),nel,istk(irc),ierr)
+ else
+ call lsposp(op,m1,n1,nel1,istk(irc1),
+ $ m2,n2,nel2,istk(irc2),
+ $ nel,istk(irc),ierr)
+ endif
+ if(ierr.ne.0) then
+ buf='not enough memory'
+ call error(9999)
+ return
+ endif
+ il1=iadr(lstk(top))
+ istk(il1)=6
+ istk(il1+1)=mr
+ istk(il1+2)=nr
+ istk(il1+3)=0
+ istk(il1+4)=nel
+ irc1=il1+5
+ call icopy(mr+nel,istk(irc),1,istk(irc1),1)
+ l1=sadr(irc1+mr+nel)
+ lstk(top+1)=l1
+ go to 999
+c
+ 999 return
+ end
+
+
+
diff --git a/modules/sparse/src/fortran/lspops.lo b/modules/sparse/src/fortran/lspops.lo
new file mode 100755
index 000000000..c0c0ff51a
--- /dev/null
+++ b/modules/sparse/src/fortran/lspops.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspops.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspops.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspos.f b/modules/sparse/src/fortran/lspos.f
new file mode 100755
index 000000000..323172bba
--- /dev/null
+++ b/modules/sparse/src/fortran/lspos.f
@@ -0,0 +1,162 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspos(op,ma,na,nela,inda,mb,nb,b,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of a sparse boolean matrix A and a full boolean
+c matrix B.
+c!parameters
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c nela :integer: number of non zero elements of a
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=ma contains the number of ith row non zero elements
+c of a
+c inda(ma+i) 1<=i<=nela column index of each non zero element
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelb column index of each non zero element
+c b :(mb,nb) matrix
+c ierr : if non zero initial value of nelc is to small
+c !
+ integer b(mb,nb)
+ integer op,nr,nc,nela,inda(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1
+ integer t
+ logical lcompa,z
+ external lcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ t=0
+ if(inda(1).eq.1) t=1
+ z=lcompa(t,0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 04 j=1,nc
+ if (lcompa(t,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 04 continue
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ t=b(1,1)
+ z=lcompa(0,t,op)
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if (lcompa(1,t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=lcompa(0,0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ do 22 j=1,nc
+ if (lcompa(0,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ else
+ j1=inda(nr+ja)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if (lcompa(1,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ else
+ if (lcompa(0,b(i,j),op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ ka=ka+inda(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
diff --git a/modules/sparse/src/fortran/lspos.lo b/modules/sparse/src/fortran/lspos.lo
new file mode 100755
index 000000000..138d2999d
--- /dev/null
+++ b/modules/sparse/src/fortran/lspos.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspos.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspos.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lsposp.f b/modules/sparse/src/fortran/lsposp.f
new file mode 100755
index 000000000..52225d33a
--- /dev/null
+++ b/modules/sparse/src/fortran/lsposp.f
@@ -0,0 +1,256 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lsposp(op,ma,na,nela,inda,mb,nb,nelb,indb,
+ $ nelc,indc,ierr)
+c!purpose
+c compare the elements of two sparse boolean matrices.
+c!parameters
+c op : integer flag which specifies the comparison to perform
+c see routine dcompa for more precision
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1,j2
+ integer t
+ logical lcompa,z
+ external lcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ t=0
+ if(inda(1).eq.1) t=1
+ z=lcompa(t,0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if (lcompa(t,1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ t=0
+ if(indb(1).eq.1) t=1
+ z=lcompa(0,t,op)
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if (lcompa(1,t,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=lcompa(0,0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ nirb=indb(i)
+ ja=ka
+ jb=kb
+ jc=kc
+ if(nira.eq.0) then
+ if(nirb.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 21 j=1,nc
+ indc(nr+kc-1+j)=j
+ 21 continue
+ jc=kc+nc
+ endif
+ else
+ j2=indb(nr+jb)
+ do 22 j=1,nc
+ if(j2.eq.j) then
+ if (lcompa(0,1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ endif
+ else
+ if(nirb.eq.0) then
+ j1=inda(nr+ja)
+ do 23 j=1,nc
+ if(j1.eq.j) then
+ if (lcompa(1,0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if(j2.eq.j) then
+ if (lcompa(1,1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ else
+ if (lcompa(1,0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ endif
+ else
+ if(j2.eq.j) then
+ if (lcompa(0,1,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ endif
+ ka=ka+inda(i)
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/lsposp.lo b/modules/sparse/src/fortran/lsposp.lo
new file mode 100755
index 000000000..2f70debfa
--- /dev/null
+++ b/modules/sparse/src/fortran/lsposp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lsposp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lsposp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspt.f b/modules/sparse/src/fortran/lspt.f
new file mode 100755
index 000000000..5faac967a
--- /dev/null
+++ b/modules/sparse/src/fortran/lspt.f
@@ -0,0 +1,81 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspt(r,s,nela,inda,ia,iat,indat)
+c transpose a sparse boolean matrix using a distribution count sort.
+c*** input
+c r,s number of rows,columns in a.
+c a a one-dimensional array containing the non-zero
+c elements of matrix a,arranged row-wise,but in
+c general not ordered within rows.
+c ma as in msmgus.
+c ia ia(i) is address in a of first element of row i of a.
+c ia(number of rows + 1) is number of elements in a,+1.
+c*** output
+c at a one-dimensional array containing non-zero elements
+c of matrix a transposed,arranged row-wise,and in
+c order within rows.
+c mat contains control information and column indices for at,
+c in same format as ma...see msmgus.
+c*** working storage.
+c iat iat(i) is address in at of first element in row i of at.
+c iat(s+1) contains number of elements in at,plus 1.
+ integer inda(*), ia(*), indat(*), iat(*)
+ integer r, s
+c
+c determine column counts of matrix a(i.e row counts of at)
+c in array iat.
+c
+ do 10 i=1,s+1
+ iat(i) = 0
+ 10 continue
+
+c computes number of elements for each column
+ do 20 i=1,nela
+ k = inda(i+r)
+ iat(k) = iat(k) + 1
+ 20 continue
+c
+c calculate row pointers of at from column counts obtained above.
+c pointer for row i stored in location i+1.
+c
+ itemp1 = iat(1)
+ itemp2 = iat(2)
+ iat(2) = 1
+ if (s.le.1) go to 40
+ do 30 i=2,s
+ itemp3 = iat(i+1)
+ iat(i+1) = iat(i) + itemp1
+ itemp1 = itemp2
+ itemp2 = itemp3
+ 30 continue
+c
+c calculate column indices(in array indat) and numerical values (in array
+c at) of matrix a-transposed using the list pointers iat(i+1) which
+c always point to the next element to be entered in row i of at.
+ 40 do 60 i=1,r
+ j1 = ia(i)
+ j2 = ia(i+1) - 1
+ if (j1.gt.j2) go to 60
+ do 50 jp=j1,j2
+ j = inda(jp + r)
+ jpt = iat(j+1)
+ indat(jpt + s) = i
+ iat(j+1) = jpt + 1
+ 50 continue
+ 60 continue
+c
+c now all row pointers iat for at have correct values except position 1.
+c fix it.
+ iat(1) = 1
+c extract needed control information in indat.
+ do 70 i=1,s
+ indat(i) = iat(i+1) - iat(i)
+ 70 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/lspt.lo b/modules/sparse/src/fortran/lspt.lo
new file mode 100755
index 000000000..487c83aed
--- /dev/null
+++ b/modules/sparse/src/fortran/lspt.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspt.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspt.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/lspxsp.f b/modules/sparse/src/fortran/lspxsp.f
new file mode 100755
index 000000000..529db7df8
--- /dev/null
+++ b/modules/sparse/src/fortran/lspxsp.f
@@ -0,0 +1,102 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine lspxsp(nr,nc,nela,inda,nelb,indb,nelc,indc,ierr)
+c!purpose
+c logical element wise and for two sparse matrices
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 11
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 11
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index equals b-index multiply elements ,place in c.
+ 9 continue
+ if (jc.gt.nelmx) go to 16
+ indc(jc+kf)=j1
+ jc = jc+1
+ jb = jb+1
+ go to 11
+c if a-index greater than b-index
+ 10 jb = jb+1
+ go to 6
+ 11 continue
+c end of row of a.
+ 12 jb=kb+1
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/lspxsp.lo b/modules/sparse/src/fortran/lspxsp.lo
new file mode 100755
index 000000000..748dcccef
--- /dev/null
+++ b/modules/sparse/src/fortran/lspxsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/lspxsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/lspxsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/ordmmd.f b/modules/sparse/src/fortran/ordmmd.f
new file mode 100755
index 000000000..7ee1b3ce2
--- /dev/null
+++ b/modules/sparse/src/fortran/ordmmd.f
@@ -0,0 +1,891 @@
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C**** ORDMMD ..... MULTIPLE MINIMUM EXTERNAL DEGREE ************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE CALLS LIU'S MULTIPLE MINIMUM DEGREE
+C ROUTINE.
+C
+C INPUT PARAMETERS -
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE.
+C IWSIZ - SIZE OF INTEGER WORKING STORAGE.
+C
+C OUTPUT PARAMETERS -
+C PERM - THE MINIMUM DEGREE ORDERING.
+C INVP - THE INVERSE OF PERM.
+C NOFSUB - AN UPPER BOUND ON THE NUMBER OF NONZERO
+C SUBSCRIPTS FOR THE COMPRESSED STORAGE SCHEME.
+C IFLAG - ERROR FLAG.
+C 0: SUCCESSFUL ORDERING
+C -1: INSUFFICIENT WORKING STORAGE
+C [IWORK(*)].
+C
+C WORKING PARAMETERS -
+C IWORK - INTEGER WORKSPACE OF LENGTH 4*NEQNS.
+C
+C***********************************************************************
+C
+ SUBROUTINE ORDMMD ( NEQNS , XADJ , ADJNCY, INVP , PERM ,
+ 1 IWSIZ , IWORK , NOFSUB, IFLAG )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(1), INVP(1) , IWORK(1) , PERM(1)
+ INTEGER XADJ(1)
+ INTEGER DELTA , IFLAG , IWSIZ , MAXINT, NEQNS ,
+ & NOFSUB
+C
+C*********************************************************************
+C
+ IFLAG = 0
+ IF ( IWSIZ .LT. 4*NEQNS ) THEN
+ IFLAG = -1
+ RETURN
+ ENDIF
+C
+C DELTA - TOLERANCE VALUE FOR MULTIPLE ELIMINATION.
+C MAXINT - MAXIMUM MACHINE REPRESENTABLE (SHORT) INTEGER
+C (ANY SMALLER ESTIMATE WILL DO) FOR MARKING
+C NODES.
+C
+ DELTA = 0
+ MAXINT = 32767
+ CALL GENMMD ( NEQNS , XADJ , ADJNCY, INVP , PERM ,
+ 1 DELTA ,
+ 1 IWORK(1) ,
+ 1 IWORK(NEQNS+1) ,
+ 1 IWORK(2*NEQNS+1) ,
+ 1 IWORK(3*NEQNS+1) ,
+ 1 MAXINT, NOFSUB )
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C--- SPARSPAK-A (ANSI FORTRAN) RELEASE III --- NAME = GENMMD
+C (C) UNIVERSITY OF WATERLOO JANUARY 1984
+C***********************************************************************
+C***********************************************************************
+C**** GENMMD ..... MULTIPLE MINIMUM EXTERNAL DEGREE ************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE IMPLEMENTS THE MINIMUM DEGREE
+C ALGORITHM. IT MAKES USE OF THE IMPLICIT REPRESENTATION
+C OF ELIMINATION GRAPHS BY QUOTIENT GRAPHS, AND THE
+C NOTION OF INDISTINGUISHABLE NODES. IT ALSO IMPLEMENTS
+C THE MODIFICATIONS BY MULTIPLE ELIMINATION AND MINIMUM
+C EXTERNAL DEGREE.
+C ---------------------------------------------
+C CAUTION - THE ADJACENCY VECTOR ADJNCY WILL BE
+C DESTROYED.
+C ---------------------------------------------
+C
+C INPUT PARAMETERS -
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE.
+C DELTA - TOLERANCE VALUE FOR MULTIPLE ELIMINATION.
+C MAXINT - MAXIMUM MACHINE REPRESENTABLE (SHORT) INTEGER
+C (ANY SMALLER ESTIMATE WILL DO) FOR MARKING
+C NODES.
+C
+C OUTPUT PARAMETERS -
+C PERM - THE MINIMUM DEGREE ORDERING.
+C INVP - THE INVERSE OF PERM.
+C NOFSUB - AN UPPER BOUND ON THE NUMBER OF NONZERO
+C SUBSCRIPTS FOR THE COMPRESSED STORAGE SCHEME.
+C
+C WORKING PARAMETERS -
+C DHEAD - VECTOR FOR HEAD OF DEGREE LISTS.
+C INVP - USED TEMPORARILY FOR DEGREE FORWARD LINK.
+C PERM - USED TEMPORARILY FOR DEGREE BACKWARD LINK.
+C QSIZE - VECTOR FOR SIZE OF SUPERNODES.
+C LLIST - VECTOR FOR TEMPORARY LINKED LISTS.
+C MARKER - A TEMPORARY MARKER VECTOR.
+C
+C PROGRAM SUBROUTINES -
+C MMDELM, MMDINT, MMDNUM, MMDUPD.
+C
+C***********************************************************************
+C
+ SUBROUTINE GENMMD ( NEQNS, XADJ, ADJNCY, INVP, PERM,
+ 1 DELTA, DHEAD, QSIZE, LLIST, MARKER,
+ 1 MAXINT, NOFSUB )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(1), DHEAD(1) , INVP(1) , LLIST(1) ,
+ 1 MARKER(1), PERM(1) , QSIZE(1)
+ INTEGER XADJ(1)
+ INTEGER DELTA , EHEAD , I , MAXINT, MDEG ,
+ 1 MDLMT , MDNODE, NEQNS , NEXTMD, NOFSUB,
+ 1 NUM, TAG
+C
+C***********************************************************************
+C
+ IF ( NEQNS .LE. 0 ) RETURN
+C
+C ------------------------------------------------
+C INITIALIZATION FOR THE MINIMUM DEGREE ALGORITHM.
+C ------------------------------------------------
+ NOFSUB = 0
+ CALL MMDINT ( NEQNS, XADJ, ADJNCY, DHEAD, INVP, PERM,
+ 1 QSIZE, LLIST, MARKER )
+C
+C ----------------------------------------------
+C NUM COUNTS THE NUMBER OF ORDERED NODES PLUS 1.
+C ----------------------------------------------
+ NUM = 1
+C
+C -----------------------------
+C ELIMINATE ALL ISOLATED NODES.
+C -----------------------------
+ NEXTMD = DHEAD(1)
+ 100 CONTINUE
+ IF ( NEXTMD .LE. 0 ) GO TO 200
+ MDNODE = NEXTMD
+ NEXTMD = INVP(MDNODE)
+ MARKER(MDNODE) = MAXINT
+ INVP(MDNODE) = - NUM
+ NUM = NUM + 1
+ GO TO 100
+C
+ 200 CONTINUE
+C ----------------------------------------
+C SEARCH FOR NODE OF THE MINIMUM DEGREE.
+C MDEG IS THE CURRENT MINIMUM DEGREE;
+C TAG IS USED TO FACILITATE MARKING NODES.
+C ----------------------------------------
+ IF ( NUM .GT. NEQNS ) GO TO 1000
+ TAG = 1
+ DHEAD(1) = 0
+ MDEG = 2
+ 300 CONTINUE
+ IF ( DHEAD(MDEG) .GT. 0 ) GO TO 400
+ MDEG = MDEG + 1
+ GO TO 300
+ 400 CONTINUE
+C -------------------------------------------------
+C USE VALUE OF DELTA TO SET UP MDLMT, WHICH GOVERNS
+C WHEN A DEGREE UPDATE IS TO BE PERFORMED.
+C -------------------------------------------------
+ MDLMT = MDEG + DELTA
+ EHEAD = 0
+C
+ 500 CONTINUE
+ MDNODE = DHEAD(MDEG)
+ IF ( MDNODE .GT. 0 ) GO TO 600
+ MDEG = MDEG + 1
+ IF ( MDEG .GT. MDLMT ) GO TO 900
+ GO TO 500
+ 600 CONTINUE
+C ----------------------------------------
+C REMOVE MDNODE FROM THE DEGREE STRUCTURE.
+C ----------------------------------------
+ NEXTMD = INVP(MDNODE)
+ DHEAD(MDEG) = NEXTMD
+ IF ( NEXTMD .GT. 0 ) PERM(NEXTMD) = - MDEG
+ INVP(MDNODE) = - NUM
+ NOFSUB = NOFSUB + MDEG + QSIZE(MDNODE) - 2
+ IF ( NUM+QSIZE(MDNODE) .GT. NEQNS ) GO TO 1000
+C ----------------------------------------------
+C ELIMINATE MDNODE AND PERFORM QUOTIENT GRAPH
+C TRANSFORMATION. RESET TAG VALUE IF NECESSARY.
+C ----------------------------------------------
+ TAG = TAG + 1
+ IF ( TAG .LT. MAXINT ) GO TO 800
+ TAG = 1
+ DO 700 I = 1, NEQNS
+ IF ( MARKER(I) .LT. MAXINT ) MARKER(I) = 0
+ 700 CONTINUE
+ 800 CONTINUE
+ CALL MMDELM ( MDNODE, XADJ, ADJNCY, DHEAD, INVP,
+ 1 PERM, QSIZE, LLIST, MARKER, MAXINT,
+ 1 TAG )
+ NUM = NUM + QSIZE(MDNODE)
+ LLIST(MDNODE) = EHEAD
+ EHEAD = MDNODE
+ IF ( DELTA .GE. 0 ) GO TO 500
+ 900 CONTINUE
+C -------------------------------------------
+C UPDATE DEGREES OF THE NODES INVOLVED IN THE
+C MINIMUM DEGREE NODES ELIMINATION.
+C -------------------------------------------
+ IF ( NUM .GT. NEQNS ) GO TO 1000
+ CALL MMDUPD ( EHEAD, NEQNS, XADJ, ADJNCY, DELTA, MDEG,
+ 1 DHEAD, INVP, PERM, QSIZE, LLIST, MARKER,
+ 1 MAXINT, TAG )
+ GO TO 300
+C
+ 1000 CONTINUE
+ CALL MMDNUM ( NEQNS, PERM, INVP, QSIZE )
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C--- SPARSPAK-A (ANSI FORTRAN) RELEASE III --- NAME = MMDINT
+C (C) UNIVERSITY OF WATERLOO JANUARY 1984
+C***********************************************************************
+C***********************************************************************
+C*** MMDINT ..... MULT MINIMUM DEGREE INITIALIZATION ***********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS INITIALIZATION FOR THE
+C MULTIPLE ELIMINATION VERSION OF THE MINIMUM DEGREE
+C ALGORITHM.
+C
+C INPUT PARAMETERS -
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - ADJACENCY STRUCTURE.
+C
+C OUTPUT PARAMETERS -
+C (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE.
+C QSIZE - SIZE OF SUPERNODE (INITIALIZED TO ONE).
+C LLIST - LINKED LIST.
+C MARKER - MARKER VECTOR.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMDINT ( NEQNS, XADJ, ADJNCY, DHEAD, DFORW,
+ 1 DBAKW, QSIZE, LLIST, MARKER )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(1), DBAKW(1) , DFORW(1) , DHEAD(1) ,
+ 1 LLIST(1) , MARKER(1), QSIZE(1)
+ INTEGER XADJ(1)
+ INTEGER FNODE , NDEG , NEQNS , NODE
+C
+C***********************************************************************
+C
+ DO 100 NODE = 1, NEQNS
+ DHEAD(NODE) = 0
+ QSIZE(NODE) = 1
+ MARKER(NODE) = 0
+ LLIST(NODE) = 0
+ 100 CONTINUE
+C ------------------------------------------
+C INITIALIZE THE DEGREE DOUBLY LINKED LISTS.
+C ------------------------------------------
+ DO 200 NODE = 1, NEQNS
+ NDEG = XADJ(NODE+1) - XADJ(NODE) + 1
+ FNODE = DHEAD(NDEG)
+ DFORW(NODE) = FNODE
+ DHEAD(NDEG) = NODE
+ IF ( FNODE .GT. 0 ) DBAKW(FNODE) = NODE
+ DBAKW(NODE) = - NDEG
+ 200 CONTINUE
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C--- SPARSPAK-A (ANSI FORTRAN) RELEASE III --- NAME = MMDELM
+C (C) UNIVERSITY OF WATERLOO JANUARY 1984
+C***********************************************************************
+C***********************************************************************
+C** MMDELM ..... MULTIPLE MINIMUM DEGREE ELIMINATION ***********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE ELIMINATES THE NODE MDNODE OF
+C MINIMUM DEGREE FROM THE ADJACENCY STRUCTURE, WHICH
+C IS STORED IN THE QUOTIENT GRAPH FORMAT. IT ALSO
+C TRANSFORMS THE QUOTIENT GRAPH REPRESENTATION OF THE
+C ELIMINATION GRAPH.
+C
+C INPUT PARAMETERS -
+C MDNODE - NODE OF MINIMUM DEGREE.
+C MAXINT - ESTIMATE OF MAXIMUM REPRESENTABLE (SHORT)
+C INTEGER.
+C TAG - TAG VALUE.
+C
+C UPDATED PARAMETERS -
+C (XADJ,ADJNCY) - UPDATED ADJACENCY STRUCTURE.
+C (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE.
+C QSIZE - SIZE OF SUPERNODE.
+C MARKER - MARKER VECTOR.
+C LLIST - TEMPORARY LINKED LIST OF ELIMINATED NABORS.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMDELM ( MDNODE, XADJ, ADJNCY, DHEAD, DFORW,
+ 1 DBAKW, QSIZE, LLIST, MARKER, MAXINT,
+ 1 TAG )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(1), DBAKW(1) , DFORW(1) , DHEAD(1) ,
+ 1 LLIST(1) , MARKER(1), QSIZE(1)
+ INTEGER XADJ(1)
+ INTEGER ELMNT , I , ISTOP , ISTRT , J ,
+ 1 JSTOP , JSTRT , LINK , MAXINT, MDNODE,
+ 1 NABOR , NODE , NPV , NQNBRS, NXNODE,
+ 1 PVNODE, RLMT , RLOC , RNODE , TAG ,
+ 1 XQNBR
+C
+C***********************************************************************
+C
+C -----------------------------------------------
+C FIND REACHABLE SET AND PLACE IN DATA STRUCTURE.
+C -----------------------------------------------
+ MARKER(MDNODE) = TAG
+ ISTRT = XADJ(MDNODE)
+ ISTOP = XADJ(MDNODE+1) - 1
+C -------------------------------------------------------
+C ELMNT POINTS TO THE BEGINNING OF THE LIST OF ELIMINATED
+C NABORS OF MDNODE, AND RLOC GIVES THE STORAGE LOCATION
+C FOR THE NEXT REACHABLE NODE.
+C -------------------------------------------------------
+ ELMNT = 0
+ RLOC = ISTRT
+ RLMT = ISTOP
+ DO 200 I = ISTRT, ISTOP
+ NABOR = ADJNCY(I)
+ IF ( NABOR .EQ. 0 ) GO TO 300
+ IF ( MARKER(NABOR) .GE. TAG ) GO TO 200
+ MARKER(NABOR) = TAG
+ IF ( DFORW(NABOR) .LT. 0 ) GO TO 100
+ ADJNCY(RLOC) = NABOR
+ RLOC = RLOC + 1
+ GO TO 200
+ 100 CONTINUE
+ LLIST(NABOR) = ELMNT
+ ELMNT = NABOR
+ 200 CONTINUE
+ 300 CONTINUE
+C -----------------------------------------------------
+C MERGE WITH REACHABLE NODES FROM GENERALIZED ELEMENTS.
+C -----------------------------------------------------
+ IF ( ELMNT .LE. 0 ) GO TO 1000
+ ADJNCY(RLMT) = - ELMNT
+ LINK = ELMNT
+ 400 CONTINUE
+ JSTRT = XADJ(LINK)
+ JSTOP = XADJ(LINK+1) - 1
+ DO 800 J = JSTRT, JSTOP
+ NODE = ADJNCY(J)
+ LINK = - NODE
+ IF (NODE .lt. 0) then
+ goto 400
+ ELSEIF (NODE .eq. 0) then
+ goto 900
+ else
+ goto 500
+ endif
+ 500 CONTINUE
+ IF ( MARKER(NODE) .GE. TAG .OR.
+ 1 DFORW(NODE) .LT. 0 ) GO TO 800
+ MARKER(NODE) = TAG
+C ---------------------------------
+C USE STORAGE FROM ELIMINATED NODES
+C IF NECESSARY.
+C ---------------------------------
+ 600 CONTINUE
+ IF ( RLOC .LT. RLMT ) GO TO 700
+ LINK = - ADJNCY(RLMT)
+ RLOC = XADJ(LINK)
+ RLMT = XADJ(LINK+1) - 1
+ GO TO 600
+ 700 CONTINUE
+ ADJNCY(RLOC) = NODE
+ RLOC = RLOC + 1
+ 800 CONTINUE
+ 900 CONTINUE
+ ELMNT = LLIST(ELMNT)
+ GO TO 300
+ 1000 CONTINUE
+ IF ( RLOC .LE. RLMT ) ADJNCY(RLOC) = 0
+C --------------------------------------------------------
+C FOR EACH NODE IN THE REACHABLE SET, DO THE FOLLOWING ...
+C --------------------------------------------------------
+ LINK = MDNODE
+ 1100 CONTINUE
+ ISTRT = XADJ(LINK)
+ ISTOP = XADJ(LINK+1) - 1
+ DO 1700 I = ISTRT, ISTOP
+ RNODE = ADJNCY(I)
+ LINK = - RNODE
+ IF (RNODE .lt. 0) then
+ goto 1100
+ ELSEIF (RNODE .eq. 0) then
+ goto 1800
+ else
+ goto 1200
+ endif
+ 1200 CONTINUE
+C --------------------------------------------
+C IF RNODE IS IN THE DEGREE LIST STRUCTURE ...
+C --------------------------------------------
+ PVNODE = DBAKW(RNODE)
+ IF ( PVNODE .EQ. 0 .OR.
+ 1 PVNODE .EQ. (-MAXINT) ) GO TO 1300
+C -------------------------------------
+C THEN REMOVE RNODE FROM THE STRUCTURE.
+C -------------------------------------
+ NXNODE = DFORW(RNODE)
+ IF ( NXNODE .GT. 0 ) DBAKW(NXNODE) = PVNODE
+ IF ( PVNODE .GT. 0 ) DFORW(PVNODE) = NXNODE
+ NPV = - PVNODE
+ IF ( PVNODE .LT. 0 ) DHEAD(NPV) = NXNODE
+ 1300 CONTINUE
+C ----------------------------------------
+C PURGE INACTIVE QUOTIENT NABORS OF RNODE.
+C ----------------------------------------
+ JSTRT = XADJ(RNODE)
+ JSTOP = XADJ(RNODE+1) - 1
+ XQNBR = JSTRT
+ DO 1400 J = JSTRT, JSTOP
+ NABOR = ADJNCY(J)
+ IF ( NABOR .EQ. 0 ) GO TO 1500
+ IF ( MARKER(NABOR) .GE. TAG ) GO TO 1400
+ ADJNCY(XQNBR) = NABOR
+ XQNBR = XQNBR + 1
+ 1400 CONTINUE
+ 1500 CONTINUE
+C ----------------------------------------
+C IF NO ACTIVE NABOR AFTER THE PURGING ...
+C ----------------------------------------
+ NQNBRS = XQNBR - JSTRT
+ IF ( NQNBRS .GT. 0 ) GO TO 1600
+C -----------------------------
+C THEN MERGE RNODE WITH MDNODE.
+C -----------------------------
+ QSIZE(MDNODE) = QSIZE(MDNODE) + QSIZE(RNODE)
+ QSIZE(RNODE) = 0
+ MARKER(RNODE) = MAXINT
+ DFORW(RNODE) = - MDNODE
+ DBAKW(RNODE) = - MAXINT
+ GO TO 1700
+ 1600 CONTINUE
+C --------------------------------------
+C ELSE FLAG RNODE FOR DEGREE UPDATE, AND
+C ADD MDNODE AS A NABOR OF RNODE.
+C --------------------------------------
+ DFORW(RNODE) = NQNBRS + 1
+ DBAKW(RNODE) = 0
+ ADJNCY(XQNBR) = MDNODE
+ XQNBR = XQNBR + 1
+ IF ( XQNBR .LE. JSTOP ) ADJNCY(XQNBR) = 0
+C
+ 1700 CONTINUE
+ 1800 CONTINUE
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C--- SPARSPAK-A (ANSI FORTRAN) RELEASE III --- NAME = MMDNUM
+C (C) UNIVERSITY OF WATERLOO JANUARY 1984
+C***********************************************************************
+C***********************************************************************
+C***** MMDNUM ..... MULTI MINIMUM DEGREE NUMBERING *************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE PERFORMS THE FINAL STEP IN
+C PRODUCING THE PERMUTATION AND INVERSE PERMUTATION
+C VECTORS IN THE MULTIPLE ELIMINATION VERSION OF THE
+C MINIMUM DEGREE ORDERING ALGORITHM.
+C
+C INPUT PARAMETERS -
+C NEQNS - NUMBER OF EQUATIONS.
+C QSIZE - SIZE OF SUPERNODES AT ELIMINATION.
+C
+C UPDATED PARAMETERS -
+C INVP - INVERSE PERMUTATION VECTOR. ON INPUT,
+C IF QSIZE(NODE)=0, THEN NODE HAS BEEN MERGED
+C INTO THE NODE -INVP(NODE); OTHERWISE,
+C -INVP(NODE) IS ITS INVERSE LABELLING.
+C
+C OUTPUT PARAMETERS -
+C PERM - THE PERMUTATION VECTOR.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMDNUM ( NEQNS, PERM, INVP, QSIZE )
+C
+C***********************************************************************
+C
+ INTEGER INVP(1) , PERM(1) , QSIZE(1)
+ INTEGER FATHER, NEQNS , NEXTF , NODE , NQSIZE,
+ 1 NUM , ROOT
+C
+C***********************************************************************
+C
+ DO 100 NODE = 1, NEQNS
+ NQSIZE = QSIZE(NODE)
+ IF ( NQSIZE .LE. 0 ) PERM(NODE) = INVP(NODE)
+ IF ( NQSIZE .GT. 0 ) PERM(NODE) = - INVP(NODE)
+ 100 CONTINUE
+C ------------------------------------------------------
+C FOR EACH NODE WHICH HAS BEEN MERGED, DO THE FOLLOWING.
+C ------------------------------------------------------
+ DO 500 NODE = 1, NEQNS
+ IF ( PERM(NODE) .GT. 0 ) GO TO 500
+C -----------------------------------------
+C TRACE THE MERGED TREE UNTIL ONE WHICH HAS
+C NOT BEEN MERGED, CALL IT ROOT.
+C -----------------------------------------
+ FATHER = NODE
+ 200 CONTINUE
+ IF ( PERM(FATHER) .GT. 0 ) GO TO 300
+ FATHER = - PERM(FATHER)
+ GO TO 200
+ 300 CONTINUE
+C -----------------------
+C NUMBER NODE AFTER ROOT.
+C -----------------------
+ ROOT = FATHER
+ NUM = PERM(ROOT) + 1
+ INVP(NODE) = - NUM
+ PERM(ROOT) = NUM
+C ------------------------
+C SHORTEN THE MERGED TREE.
+C ------------------------
+ FATHER = NODE
+ 400 CONTINUE
+ NEXTF = - PERM(FATHER)
+ IF ( NEXTF .LE. 0 ) GO TO 500
+ PERM(FATHER) = - ROOT
+ FATHER = NEXTF
+ GO TO 400
+ 500 CONTINUE
+C ----------------------
+C READY TO COMPUTE PERM.
+C ----------------------
+ DO 600 NODE = 1, NEQNS
+ NUM = - INVP(NODE)
+ INVP(NODE) = NUM
+ PERM(NUM) = NODE
+ 600 CONTINUE
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C--- SPARSPAK-A (ANSI FORTRAN) RELEASE III --- NAME = MMDUPD
+C (C) UNIVERSITY OF WATERLOO JANUARY 1984
+C***********************************************************************
+C***********************************************************************
+C***** MMDUPD ..... MULTIPLE MINIMUM DEGREE UPDATE *************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE - THIS ROUTINE UPDATES THE DEGREES OF NODES
+C AFTER A MULTIPLE ELIMINATION STEP.
+C
+C INPUT PARAMETERS -
+C EHEAD - THE BEGINNING OF THE LIST OF ELIMINATED
+C NODES (I.E., NEWLY FORMED ELEMENTS).
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - ADJACENCY STRUCTURE.
+C DELTA - TOLERANCE VALUE FOR MULTIPLE ELIMINATION.
+C MAXINT - MAXIMUM MACHINE REPRESENTABLE (SHORT)
+C INTEGER.
+C
+C UPDATED PARAMETERS -
+C MDEG - NEW MINIMUM DEGREE AFTER DEGREE UPDATE.
+C (DHEAD,DFORW,DBAKW) - DEGREE DOUBLY LINKED STRUCTURE.
+C QSIZE - SIZE OF SUPERNODE.
+C LLIST - WORKING LINKED LIST.
+C MARKER - MARKER VECTOR FOR DEGREE UPDATE.
+C TAG - TAG VALUE.
+C
+C***********************************************************************
+C
+ SUBROUTINE MMDUPD ( EHEAD, NEQNS, XADJ, ADJNCY, DELTA,
+ 1 MDEG, DHEAD, DFORW, DBAKW, QSIZE,
+ 1 LLIST, MARKER, MAXINT, TAG )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(1), DBAKW(1) , DFORW(1) , DHEAD(1) ,
+ 1 LLIST(1) , MARKER(1), QSIZE(1)
+ INTEGER XADJ(1)
+ INTEGER DEG , DEG0 , DELTA , EHEAD , ELMNT ,
+ 1 ENODE , FNODE , I , IQ2 , ISTOP ,
+ 1 ISTRT , J , JSTOP , JSTRT , LINK ,
+ 1 MAXINT, MDEG , MDEG0 , MTAG , NABOR ,
+ 1 NEQNS , NODE , Q2HEAD, QXHEAD, TAG
+C
+C***********************************************************************
+C
+ MDEG0 = MDEG + DELTA
+ ELMNT = EHEAD
+ 100 CONTINUE
+C -------------------------------------------------------
+C FOR EACH OF THE NEWLY FORMED ELEMENT, DO THE FOLLOWING.
+C (RESET TAG VALUE IF NECESSARY.)
+C -------------------------------------------------------
+ IF ( ELMNT .LE. 0 ) RETURN
+ MTAG = TAG + MDEG0
+ IF ( MTAG .LT. MAXINT ) GO TO 300
+ TAG = 1
+ DO 200 I = 1, NEQNS
+ IF ( MARKER(I) .LT. MAXINT ) MARKER(I) = 0
+ 200 CONTINUE
+ MTAG = TAG + MDEG0
+ 300 CONTINUE
+C ---------------------------------------------
+C CREATE TWO LINKED LISTS FROM NODES ASSOCIATED
+C WITH ELMNT: ONE WITH TWO NABORS (Q2HEAD) IN
+C ADJACENCY STRUCTURE, AND THE OTHER WITH MORE
+C THAN TWO NABORS (QXHEAD). ALSO COMPUTE DEG0,
+C NUMBER OF NODES IN THIS ELEMENT.
+C ---------------------------------------------
+ Q2HEAD = 0
+ QXHEAD = 0
+ DEG0 = 0
+ LINK = ELMNT
+ 400 CONTINUE
+ ISTRT = XADJ(LINK)
+ ISTOP = XADJ(LINK+1) - 1
+ DO 700 I = ISTRT, ISTOP
+ ENODE = ADJNCY(I)
+ LINK = - ENODE
+ IF (ENODE .lt. 0) then
+ goto 400
+ ELSEIF (ENODE .eq. 0) then
+ goto 800
+ else
+ goto 500
+ endif
+C
+ 500 CONTINUE
+ IF ( QSIZE(ENODE) .EQ. 0 ) GO TO 700
+ DEG0 = DEG0 + QSIZE(ENODE)
+ MARKER(ENODE) = MTAG
+C ----------------------------------
+C IF ENODE REQUIRES A DEGREE UPDATE,
+C THEN DO THE FOLLOWING.
+C ----------------------------------
+ IF ( DBAKW(ENODE) .NE. 0 ) GO TO 700
+C ---------------------------------------
+C PLACE EITHER IN QXHEAD OR Q2HEAD LISTS.
+C ---------------------------------------
+ IF ( DFORW(ENODE) .EQ. 2 ) GO TO 600
+ LLIST(ENODE) = QXHEAD
+ QXHEAD = ENODE
+ GO TO 700
+ 600 CONTINUE
+ LLIST(ENODE) = Q2HEAD
+ Q2HEAD = ENODE
+ 700 CONTINUE
+ 800 CONTINUE
+C --------------------------------------------
+C FOR EACH ENODE IN Q2 LIST, DO THE FOLLOWING.
+C --------------------------------------------
+ ENODE = Q2HEAD
+ IQ2 = 1
+ 900 CONTINUE
+ IF ( ENODE .LE. 0 ) GO TO 1500
+ IF ( DBAKW(ENODE) .NE. 0 ) GO TO 2200
+ TAG = TAG + 1
+ DEG = DEG0
+C ------------------------------------------
+C IDENTIFY THE OTHER ADJACENT ELEMENT NABOR.
+C ------------------------------------------
+ ISTRT = XADJ(ENODE)
+ NABOR = ADJNCY(ISTRT)
+ IF ( NABOR .EQ. ELMNT ) NABOR = ADJNCY(ISTRT+1)
+C ------------------------------------------------
+C IF NABOR IS UNELIMINATED, INCREASE DEGREE COUNT.
+C ------------------------------------------------
+ LINK = NABOR
+ IF ( DFORW(NABOR) .LT. 0 ) GO TO 1000
+ DEG = DEG + QSIZE(NABOR)
+ GO TO 2100
+ 1000 CONTINUE
+C --------------------------------------------
+C OTHERWISE, FOR EACH NODE IN THE 2ND ELEMENT,
+C DO THE FOLLOWING.
+C --------------------------------------------
+ ISTRT = XADJ(LINK)
+ ISTOP = XADJ(LINK+1) - 1
+ DO 1400 I = ISTRT, ISTOP
+ NODE = ADJNCY(I)
+ LINK = - NODE
+ IF ( NODE .EQ. ENODE ) GO TO 1400
+ IF (NODE .lt. 0) then
+ goto 1000
+ ELSEIF (NODE .eq. 0) then
+ goto 2100
+ else
+ goto 1100
+ endif
+
+C
+ 1100 CONTINUE
+ IF ( QSIZE(NODE) .EQ. 0 ) GO TO 1400
+ IF ( MARKER(NODE) .GE. TAG ) GO TO 1200
+C -------------------------------------
+C CASE WHEN NODE IS NOT YET CONSIDERED.
+C -------------------------------------
+ MARKER(NODE) = TAG
+ DEG = DEG + QSIZE(NODE)
+ GO TO 1400
+ 1200 CONTINUE
+C ----------------------------------------
+C CASE WHEN NODE IS INDISTINGUISHABLE FROM
+C ENODE. MERGE THEM INTO A NEW SUPERNODE.
+C ----------------------------------------
+ IF ( DBAKW(NODE) .NE. 0 ) GO TO 1400
+ IF ( DFORW(NODE) .NE. 2 ) GO TO 1300
+ QSIZE(ENODE) = QSIZE(ENODE) +
+ 1 QSIZE(NODE)
+ QSIZE(NODE) = 0
+ MARKER(NODE) = MAXINT
+ DFORW(NODE) = - ENODE
+ DBAKW(NODE) = - MAXINT
+ GO TO 1400
+ 1300 CONTINUE
+C --------------------------------------
+C CASE WHEN NODE IS OUTMATCHED BY ENODE.
+C --------------------------------------
+ IF ( DBAKW(NODE) .EQ.0 )
+ 1 DBAKW(NODE) = - MAXINT
+ 1400 CONTINUE
+ GO TO 2100
+ 1500 CONTINUE
+C ------------------------------------------------
+C FOR EACH ENODE IN THE QX LIST, DO THE FOLLOWING.
+C ------------------------------------------------
+ ENODE = QXHEAD
+ IQ2 = 0
+ 1600 CONTINUE
+ IF ( ENODE .LE. 0 ) GO TO 2300
+ IF ( DBAKW(ENODE) .NE. 0 ) GO TO 2200
+ TAG = TAG + 1
+ DEG = DEG0
+C ---------------------------------
+C FOR EACH UNMARKED NABOR OF ENODE,
+C DO THE FOLLOWING.
+C ---------------------------------
+ ISTRT = XADJ(ENODE)
+ ISTOP = XADJ(ENODE+1) - 1
+ DO 2000 I = ISTRT, ISTOP
+ NABOR = ADJNCY(I)
+ IF ( NABOR .EQ. 0 ) GO TO 2100
+ IF ( MARKER(NABOR) .GE. TAG ) GO TO 2000
+ MARKER(NABOR) = TAG
+ LINK = NABOR
+C ------------------------------
+C IF UNELIMINATED, INCLUDE IT IN
+C DEG COUNT.
+C ------------------------------
+ IF ( DFORW(NABOR) .LT. 0 ) GO TO 1700
+ DEG = DEG + QSIZE(NABOR)
+ GO TO 2000
+ 1700 CONTINUE
+C -------------------------------
+C IF ELIMINATED, INCLUDE UNMARKED
+C NODES IN THIS ELEMENT INTO THE
+C DEGREE COUNT.
+C -------------------------------
+ JSTRT = XADJ(LINK)
+ JSTOP = XADJ(LINK+1) - 1
+ DO 1900 J = JSTRT, JSTOP
+ NODE = ADJNCY(J)
+ LINK = - NODE
+ IF (NODE .lt. 0) then
+ goto 1700
+ ELSEIF (NODE .eq. 0) then
+ goto 2000
+ else
+ goto 1800
+ endif
+C
+ 1800 CONTINUE
+ IF ( MARKER(NODE) .GE. TAG )
+ 1 GO TO 1900
+ MARKER(NODE) = TAG
+ DEG = DEG + QSIZE(NODE)
+ 1900 CONTINUE
+ 2000 CONTINUE
+ 2100 CONTINUE
+C -------------------------------------------
+C UPDATE EXTERNAL DEGREE OF ENODE IN DEGREE
+C STRUCTURE, AND MDEG (MIN DEG) IF NECESSARY.
+C -------------------------------------------
+ DEG = DEG - QSIZE(ENODE) + 1
+ FNODE = DHEAD(DEG)
+ DFORW(ENODE) = FNODE
+ DBAKW(ENODE) = - DEG
+ IF ( FNODE .GT. 0 ) DBAKW(FNODE) = ENODE
+ DHEAD(DEG) = ENODE
+ IF ( DEG .LT. MDEG ) MDEG = DEG
+ 2200 CONTINUE
+C ----------------------------------
+C GET NEXT ENODE IN CURRENT ELEMENT.
+C ----------------------------------
+ ENODE = LLIST(ENODE)
+ IF ( IQ2 .EQ. 1 ) GO TO 900
+ GO TO 1600
+ 2300 CONTINUE
+C -----------------------------
+C GET NEXT ELEMENT IN THE LIST.
+C -----------------------------
+ TAG = MTAG
+ ELMNT = LLIST(ELMNT)
+ GO TO 100
+C
+ END
diff --git a/modules/sparse/src/fortran/ordmmd.lo b/modules/sparse/src/fortran/ordmmd.lo
new file mode 100755
index 000000000..775b9333e
--- /dev/null
+++ b/modules/sparse/src/fortran/ordmmd.lo
@@ -0,0 +1,12 @@
+# src/fortran/ordmmd.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/ordmmd.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/sp2col.f b/modules/sparse/src/fortran/sp2col.f
new file mode 100755
index 000000000..c3d4c7084
--- /dev/null
+++ b/modules/sparse/src/fortran/sp2col.f
@@ -0,0 +1,44 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine sp2col(m,n,ind,nel,indr)
+c given a sparse matrix storage information sp2col compute the
+c storage of the column conversion of the original matrix
+c!parameters
+c m : number of rows of original matrix
+c n : number of columns of original matrix
+c ind :
+c ind(i) contains the number of non zero elements in the
+c original matrix ith row
+c ind(m+j) contains the column number of jth non zero elements
+c (non zeros elements are counted row by row)
+c nel : total number of non zero elements
+c indr:
+c ind(i) contains the number of non zero elements in the
+c resulting vector ith row (must be 0 or 1)
+c indr(m*n+j) contains the old position of the jth non zero
+c element
+ integer ind(*),indr(*)
+c
+ call iset(m*n,0,indr,1)
+ k0=0
+ k1=0
+ do 20 i=1,m
+ ni=ind(i)
+ if (ni.gt.0) then
+ do 10 k=1,ni
+ j=ind(m+k0+k)
+ indr(i+(j-1)*m)=1
+ k1=k1+1
+ indr(m*n+k0+k)=k1
+ 10 continue
+ k0=k0+ni
+ endif
+ 20 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/sp2col.lo b/modules/sparse/src/fortran/sp2col.lo
new file mode 100755
index 000000000..87e9ede45
--- /dev/null
+++ b/modules/sparse/src/fortran/sp2col.lo
@@ -0,0 +1,12 @@
+# src/fortran/sp2col.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sp2col.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/sparse_f.rc b/modules/sparse/src/fortran/sparse_f.rc
new file mode 100755
index 000000000..4d5659802
--- /dev/null
+++ b/modules/sparse/src/fortran/sparse_f.rc
@@ -0,0 +1,96 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+//#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 5,5,2,0
+ PRODUCTVERSION 5,5,2,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040c04b0"
+ BEGIN
+ VALUE "FileDescription", "sparse_f module"
+ VALUE "FileVersion", "5, 5, 2, 0"
+ VALUE "InternalName", "sparse_f module"
+ VALUE "LegalCopyright", "Copyright (C) 2017"
+ VALUE "OriginalFilename", "sparse_f.dll"
+ VALUE "ProductName", "sparse_f module"
+ VALUE "ProductVersion", "5, 5, 2, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x40c, 1200
+ END
+END
+
+#endif // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/modules/sparse/src/fortran/sparse_f.vfproj b/modules/sparse/src/fortran/sparse_f.vfproj
new file mode 100755
index 000000000..c9d96726d
--- /dev/null
+++ b/modules/sparse/src/fortran/sparse_f.vfproj
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject ProjectType="typeDynamicLibrary" ProjectCreator="Intel Fortran" Keyword="Dll" Version="11.0" ProjectIdGuid="{13082624-97F9-47DB-A9A1-AD7D6BF3856A}">
+ <Platforms>
+ <Platform Name="Win32"/>
+ <Platform Name="x64"/></Platforms>
+ <Configurations>
+ <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)bin\" IntermediateDirectory="$(ProjectDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
+ <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
+ <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\$(ProjectName).dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="sparse_f.def" GenerateDebugInformation="true" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\$(ProjectName).lib" LinkDLL="true" AdditionalDependencies="../../../../bin/blasplus.lib core.lib elementary_functions_f.lib sparse.lib output_stream.lib elementary_functions.lib linpack_f.lib core_f.lib"/>
+ <Tool Name="VFResourceCompilerTool"/>
+ <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
+ <Tool Name="VFCustomBuildTool"/>
+ <Tool Name="VFPreLinkEventTool" CommandLine="setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+&quot;$(SolutionDir)bin\dumpexts&quot; -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd .." Description="Build $(ProjectName).def"/>
+ <Tool Name="VFPreBuildEventTool" CommandLine="lib /DEF:&quot;$(InputDir)core_import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)core.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Elementary_functions_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Sparse_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sparse.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Elementary_functions.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Output_stream.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)linpack_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)linpack_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)core_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)core_f.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build dependencies"/>
+ <Tool Name="VFPostBuildEventTool"/>
+ <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
+ <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)bin\" IntermediateDirectory="$(ProjectDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
+ <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDLL"/>
+ <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\$(ProjectName).dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="sparse_f.def" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\$(ProjectName).lib" LinkDLL="true" AdditionalDependencies="../../../../bin/blasplus.lib core.lib elementary_functions_f.lib sparse.lib output_stream.lib elementary_functions.lib linpack_f.lib core_f.lib"/>
+ <Tool Name="VFResourceCompilerTool"/>
+ <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
+ <Tool Name="VFCustomBuildTool"/>
+ <Tool Name="VFPreLinkEventTool" CommandLine="setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+&quot;$(SolutionDir)bin\dumpexts&quot; -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd .." Description="Build $(ProjectName).def"/>
+ <Tool Name="VFPreBuildEventTool" CommandLine="lib /DEF:&quot;$(InputDir)core_import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)core.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Elementary_functions_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Sparse_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)sparse.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Elementary_functions.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)Output_stream.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)linpack_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)linpack_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)core_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)core_f.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build dependencies"/>
+ <Tool Name="VFPostBuildEventTool"/>
+ <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
+ <Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)bin\" IntermediateDirectory="$(ProjectDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
+ <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
+ <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\$(ProjectName).dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="sparse_f.def" GenerateDebugInformation="true" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\$(ProjectName).lib" LinkDLL="true" AdditionalDependencies="../../../../bin/blasplus.lib core.lib elementary_functions_f.lib sparse.lib output_stream.lib elementary_functions.lib linpack_f.lib core_f.lib"/>
+ <Tool Name="VFResourceCompilerTool"/>
+ <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
+ <Tool Name="VFCustomBuildTool"/>
+ <Tool Name="VFPreLinkEventTool" CommandLine="setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+&quot;$(SolutionDir)bin\dumpexts&quot; -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd .." Description="Build $(ProjectName).def"/>
+ <Tool Name="VFPreBuildEventTool" CommandLine="lib /DEF:&quot;$(InputDir)core_import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)core.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Elementary_functions_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Sparse_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sparse.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Elementary_functions.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Output_stream.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)linpack_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)linpack_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)core_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)core_f.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build dependencies"/>
+ <Tool Name="VFPostBuildEventTool"/>
+ <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
+ <Configuration Name="Release|x64" OutputDirectory="$(SolutionDir)bin\" IntermediateDirectory="$(ProjectDir)$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">
+ <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDLL"/>
+ <Tool Name="VFLinkerTool" OutputFile="$(SolutionDir)bin\$(ProjectName).dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="sparse_f.def" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\$(ProjectName).lib" LinkDLL="true" AdditionalDependencies="../../../../bin/blasplus.lib core.lib elementary_functions_f.lib sparse.lib output_stream.lib elementary_functions.lib linpack_f.lib core_f.lib"/>
+ <Tool Name="VFResourceCompilerTool"/>
+ <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
+ <Tool Name="VFCustomBuildTool"/>
+ <Tool Name="VFPreLinkEventTool" CommandLine="setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+&quot;$(SolutionDir)bin\dumpexts&quot; -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd .." Description="Build $(ProjectName).def"/>
+ <Tool Name="VFPreBuildEventTool" CommandLine="lib /DEF:&quot;$(InputDir)core_import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)core.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Elementary_functions_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Sparse_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)sparse.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Elementary_functions_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Elementary_functions.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)Output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)Output_stream.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)linpack_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)linpack_f.lib&quot; 1&gt;NUL 2&gt;NUL
+lib /DEF:&quot;$(InputDir)core_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)core_f.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build dependencies"/>
+ <Tool Name="VFPostBuildEventTool"/>
+ <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
+ <Files>
+ <Filter Name="Header Files" Filter="fi;fd"/>
+ <Filter Name="Libraries Dependencies">
+ <File RelativePath=".\Core_f_Import.def"/>
+ <File RelativePath=".\core_import.def"/>
+ <File RelativePath=".\Elementary_functions_f_Import.def"/>
+ <File RelativePath=".\Elementary_functions_Import.def"/>
+ <File RelativePath=".\linpack_f_Import.def"/>
+ <File RelativePath=".\Output_stream_Import.def"/>
+ <File RelativePath=".\Sparse_Import.def"/></Filter>
+ <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ <File RelativePath=".\sparse_f.rc"/></Filter>
+ <Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
+ <File RelativePath="blkfc1.f"/>
+ <File RelativePath="blkfct.f"/>
+ <File RelativePath="blkslv.f"/>
+ <File RelativePath="dcompa.f"/>
+ <File RelativePath="dful2sp.f"/>
+ <File RelativePath="dij2sp.f"/>
+ <File RelativePath="dperm.f"/>
+ <File RelativePath="dsmsp.f"/>
+ <File RelativePath="dsosp.f"/>
+ <File RelativePath="dspasp.f"/>
+ <File RelativePath="dspcle.f"/>
+ <File RelativePath="dspcsp.f"/>
+ <File RelativePath="dspe2.f"/>
+ <File RelativePath="dspful.f"/>
+ <File RelativePath="dspis.f"/>
+ <File RelativePath="dspisp.f"/>
+ <File RelativePath="dspmat.f"/>
+ <File RelativePath="dspms.f"/>
+ <File RelativePath="dspmsp.f"/>
+ <File RelativePath="dspos.f"/>
+ <File RelativePath="dsposp.f"/>
+ <File RelativePath="dspssp.f"/>
+ <File RelativePath="dspt.f"/>
+ <File RelativePath="dspxs.f"/>
+ <File RelativePath="dspxsp.f"/>
+ <File RelativePath="findl.f"/>
+ <File RelativePath="inpnv.f"/>
+ <File RelativePath="iperm.f"/>
+ <File RelativePath="isort1.f"/>
+ <File RelativePath="lcompa.f"/>
+ <File RelativePath="lful2sp.f"/>
+ <File RelativePath="lij2sp.f"/>
+ <File RelativePath="lsosp.f"/>
+ <File RelativePath="lspasp.f"/>
+ <File RelativePath="lspcsp.f"/>
+ <File RelativePath="lspe2.f"/>
+ <File RelativePath="lspful.f"/>
+ <File RelativePath="lspis.f"/>
+ <File RelativePath="lspisp.f"/>
+ <File RelativePath="lspmat.f"/>
+ <File RelativePath="lspops.f"/>
+ <File RelativePath="lspos.f"/>
+ <File RelativePath="lsposp.f"/>
+ <File RelativePath="lspt.f"/>
+ <File RelativePath="lspxsp.f"/>
+ <File RelativePath="ordmmd.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_bfinit.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_blkfc1i.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_blkslvi.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_fadj2sp.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_full.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_inpnvi.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_ludel.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_lufact.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_luget.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_lusolve.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_nnz.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_ordmmd.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_sfinit.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_sparse.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_spchol.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_spclean.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_spcompa.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_spget.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_spmatrix.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_symfcti.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\sci_f_ta2lpd.f"/>
+ <File RelativePath="sp2col.f"/>
+ <File RelativePath="spcho1.f"/>
+ <File RelativePath="spcho2.f"/>
+ <File RelativePath="spcompack.f"/>
+ <File RelativePath="spextr.f"/>
+ <File RelativePath="spextr1.f"/>
+ <File RelativePath="spif.f"/>
+ <File RelativePath="spif1b.f"/>
+ <File RelativePath="spifp.f"/>
+ <File RelativePath="spind.f"/>
+ <File RelativePath="spisp.f"/>
+ <File RelativePath="..\..\sci_gateway\fortran\spops.f"/>
+ <File RelativePath="spord.f"/>
+ <File RelativePath="spreshape.f"/>
+ <File RelativePath="spsort.f"/>
+ <File RelativePath="spt.f"/>
+ <File RelativePath="sputil.f"/>
+ <File RelativePath="symfct.f"/>
+ <File RelativePath="sz2ptr.f"/>
+ <File RelativePath=".\ta2lpd.f"/>
+ <File RelativePath="wcompa.f"/>
+ <File RelativePath="wful2sp.f"/>
+ <File RelativePath="wij2sp.f"/>
+ <File RelativePath="wperm.f"/>
+ <File RelativePath=".\writebuf.f"/>
+ <File RelativePath="wsmsp.f"/>
+ <File RelativePath="wsosp.f"/>
+ <File RelativePath="wspasp.f"/>
+ <File RelativePath="wspcle.f"/>
+ <File RelativePath="wspcsp.f"/>
+ <File RelativePath="wspe2.f"/>
+ <File RelativePath="wspful.f"/>
+ <File RelativePath="wspis.f"/>
+ <File RelativePath="wspisp.f"/>
+ <File RelativePath="wspmat.f"/>
+ <File RelativePath="wspms.f"/>
+ <File RelativePath="wspmsp.f"/>
+ <File RelativePath="wspos.f"/>
+ <File RelativePath="wsposp.f"/>
+ <File RelativePath="wspssp.f"/>
+ <File RelativePath="wspt.f"/>
+ <File RelativePath="wspxs.f"/>
+ <File RelativePath="wspxsp.f"/></Filter>
+ <File RelativePath="..\..\Makefile.am"/>
+ <File RelativePath="..\..\sci_gateway\sparse_gateway.xml"/></Files>
+ <Globals/></VisualStudioProject>
diff --git a/modules/sparse/src/fortran/sparse_f2c.vcxproj b/modules/sparse/src/fortran/sparse_f2c.vcxproj
new file mode 100755
index 000000000..4741972ea
--- /dev/null
+++ b/modules/sparse/src/fortran/sparse_f2c.vcxproj
@@ -0,0 +1,511 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>sparse_f</ProjectName>
+ <ProjectGuid>{13082624-97F9-47DB-A9A1-AD7D6BF3856A}</ProjectGuid>
+ <RootNamespace>sparse_f2c</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ <Import Project="..\..\..\..\Visual-Studio-settings\f2c.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Message>Build dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Sparse_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Output_stream_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Output_stream.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linpack_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SPARSE_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Build $(ProjectName).def</Message>
+ <Command>setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+"$(SolutionDir)bin\dumpexts" -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd ..
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;elementary_functions_f.lib;sparse.lib;output_stream.lib;elementary_functions.lib;linpack_f.lib;core_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>sparse_f.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <PreBuildEvent>
+ <Message>Build dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Sparse_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Output_stream_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Output_stream.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linpack_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreBuildEvent>
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SPARSE_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Build $(ProjectName).def</Message>
+ <Command>setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+"$(SolutionDir)bin\dumpexts" -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd ..
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;elementary_functions_f.lib;sparse.lib;output_stream.lib;elementary_functions.lib;linpack_f.lib;core_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>sparse_f.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Message>Build dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Sparse_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Output_stream_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Output_stream.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linpack_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SPARSE_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Build $(ProjectName).def</Message>
+ <Command>setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+"$(SolutionDir)bin\dumpexts" -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd ..
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;elementary_functions_f.lib;sparse.lib;output_stream.lib;elementary_functions.lib;linpack_f.lib;core_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>sparse_f.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <PreBuildEvent>
+ <Message>Build dependencies</Message>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Sparse_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Elementary_functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Elementary_functions.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)Output_stream_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)Output_stream.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)linpack_f.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+ </PreBuildEvent>
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../../libs/f2c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SPARSE_F2C_EXPORTS;FORDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <PreLinkEvent>
+ <Message>Build $(ProjectName).def</Message>
+ <Command>setlocal EnableDelayedExpansion
+cd $(ConfigurationName)
+set LIST_OBJ=
+for %%f in (*.obj) do set LIST_OBJ=!LIST_OBJ! %%f
+"$(SolutionDir)bin\dumpexts" -o $(ProjectName).def $(ProjectName).dll %LIST_OBJ%
+copy $(ProjectName).def ..\$(ProjectName).def &gt;nul
+del *.def &gt;nul
+cd ..
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;elementary_functions_f.lib;sparse.lib;output_stream.lib;elementary_functions.lib;linpack_f.lib;core_f.lib;../../../../bin/blasplus.lib;../../../../bin/libf2c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>sparse_f.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_bfinit.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_blkfc1i.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_blkslvi.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_fadj2sp.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_full.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_inpnvi.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ludel.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_lufact.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_luget.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_lusolve.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_nnz.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ordmmd.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_sfinit.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_sparse.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spchol.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spclean.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spcompa.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spget.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spmatrix.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_symfcti.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ta2lpd.c" />
+ <ClCompile Include="blkfc1.c" />
+ <ClCompile Include="blkfct.c" />
+ <ClCompile Include="blkslv.c" />
+ <ClCompile Include="dcompa.c" />
+ <ClCompile Include="dful2sp.c" />
+ <ClCompile Include="dij2sp.c" />
+ <ClCompile Include="dperm.c" />
+ <ClCompile Include="dsmsp.c" />
+ <ClCompile Include="dsosp.c" />
+ <ClCompile Include="dspasp.c" />
+ <ClCompile Include="dspcle.c" />
+ <ClCompile Include="dspcsp.c" />
+ <ClCompile Include="dspe2.c" />
+ <ClCompile Include="dspful.c" />
+ <ClCompile Include="dspis.c" />
+ <ClCompile Include="dspisp.c" />
+ <ClCompile Include="dspmat.c" />
+ <ClCompile Include="dspms.c" />
+ <ClCompile Include="dspmsp.c" />
+ <ClCompile Include="dspos.c" />
+ <ClCompile Include="dsposp.c" />
+ <ClCompile Include="dspssp.c" />
+ <ClCompile Include="dspt.c" />
+ <ClCompile Include="dspxs.c" />
+ <ClCompile Include="dspxsp.c" />
+ <ClCompile Include="findl.c" />
+ <ClCompile Include="inpnv.c" />
+ <ClCompile Include="iperm.c" />
+ <ClCompile Include="isort1.c" />
+ <ClCompile Include="lcompa.c" />
+ <ClCompile Include="lful2sp.c" />
+ <ClCompile Include="lij2sp.c" />
+ <ClCompile Include="lsosp.c" />
+ <ClCompile Include="lspasp.c" />
+ <ClCompile Include="lspcsp.c" />
+ <ClCompile Include="lspe2.c" />
+ <ClCompile Include="lspful.c" />
+ <ClCompile Include="lspis.c" />
+ <ClCompile Include="lspisp.c" />
+ <ClCompile Include="lspmat.c" />
+ <ClCompile Include="lspops.c" />
+ <ClCompile Include="lspos.c" />
+ <ClCompile Include="lsposp.c" />
+ <ClCompile Include="lspt.c" />
+ <ClCompile Include="lspxsp.c" />
+ <ClCompile Include="ordmmd.c" />
+ <ClCompile Include="sp2col.c" />
+ <ClCompile Include="spcho1.c" />
+ <ClCompile Include="spcho2.c" />
+ <ClCompile Include="spcompack.c" />
+ <ClCompile Include="spextr.c" />
+ <ClCompile Include="spextr1.c" />
+ <ClCompile Include="spif.c" />
+ <ClCompile Include="spif1b.c" />
+ <ClCompile Include="spifp.c" />
+ <ClCompile Include="spind.c" />
+ <ClCompile Include="spisp.c" />
+ <ClCompile Include="..\..\sci_gateway\fortran\spops.c" />
+ <ClCompile Include="spord.c" />
+ <ClCompile Include="spreshape.c" />
+ <ClCompile Include="spsort.c" />
+ <ClCompile Include="spt.c" />
+ <ClCompile Include="sputil.c" />
+ <ClCompile Include="symfct.c" />
+ <ClCompile Include="sz2ptr.c" />
+ <ClCompile Include="ta2lpd.c" />
+ <ClCompile Include="wcompa.c" />
+ <ClCompile Include="wful2sp.c" />
+ <ClCompile Include="wij2sp.c" />
+ <ClCompile Include="wperm.c" />
+ <ClCompile Include="writebuf.c" />
+ <ClCompile Include="wsmsp.c" />
+ <ClCompile Include="wsosp.c" />
+ <ClCompile Include="wspasp.c" />
+ <ClCompile Include="wspcle.c" />
+ <ClCompile Include="wspcsp.c" />
+ <ClCompile Include="wspe2.c" />
+ <ClCompile Include="wspful.c" />
+ <ClCompile Include="wspis.c" />
+ <ClCompile Include="wspisp.c" />
+ <ClCompile Include="wspmat.c" />
+ <ClCompile Include="wspms.c" />
+ <ClCompile Include="wspmsp.c" />
+ <ClCompile Include="wspos.c" />
+ <ClCompile Include="wsposp.c" />
+ <ClCompile Include="wspssp.c" />
+ <ClCompile Include="wspt.c" />
+ <ClCompile Include="wspxs.c" />
+ <ClCompile Include="wspxsp.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_bfinit.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_blkfc1i.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_blkslvi.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_fadj2sp.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_full.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_inpnvi.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ludel.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_lufact.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_luget.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_lusolve.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_nnz.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ordmmd.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_sfinit.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_sparse.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spchol.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spclean.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spcompa.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spget.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spmatrix.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_symfcti.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ta2lpd.f" />
+ <f2c_rule Include="blkfc1.f" />
+ <f2c_rule Include="blkfct.f" />
+ <f2c_rule Include="blkslv.f" />
+ <f2c_rule Include="dcompa.f" />
+ <f2c_rule Include="dful2sp.f" />
+ <f2c_rule Include="dij2sp.f" />
+ <f2c_rule Include="dperm.f" />
+ <f2c_rule Include="dsmsp.f" />
+ <f2c_rule Include="dsosp.f" />
+ <f2c_rule Include="dspasp.f" />
+ <f2c_rule Include="dspcle.f" />
+ <f2c_rule Include="dspcsp.f" />
+ <f2c_rule Include="dspe2.f" />
+ <f2c_rule Include="dspful.f" />
+ <f2c_rule Include="dspis.f" />
+ <f2c_rule Include="dspisp.f" />
+ <f2c_rule Include="dspmat.f" />
+ <f2c_rule Include="dspms.f" />
+ <f2c_rule Include="dspmsp.f" />
+ <f2c_rule Include="dspos.f" />
+ <f2c_rule Include="dsposp.f" />
+ <f2c_rule Include="dspssp.f" />
+ <f2c_rule Include="dspt.f" />
+ <f2c_rule Include="dspxs.f" />
+ <f2c_rule Include="dspxsp.f" />
+ <f2c_rule Include="findl.f" />
+ <f2c_rule Include="inpnv.f" />
+ <f2c_rule Include="iperm.f" />
+ <f2c_rule Include="isort1.f" />
+ <f2c_rule Include="lcompa.f" />
+ <f2c_rule Include="lful2sp.f" />
+ <f2c_rule Include="lij2sp.f" />
+ <f2c_rule Include="lsosp.f" />
+ <f2c_rule Include="lspasp.f" />
+ <f2c_rule Include="lspcsp.f" />
+ <f2c_rule Include="lspe2.f" />
+ <f2c_rule Include="lspful.f" />
+ <f2c_rule Include="lspis.f" />
+ <f2c_rule Include="lspisp.f" />
+ <f2c_rule Include="lspmat.f" />
+ <f2c_rule Include="lspops.f" />
+ <f2c_rule Include="lspos.f" />
+ <f2c_rule Include="lsposp.f" />
+ <f2c_rule Include="lspt.f" />
+ <f2c_rule Include="lspxsp.f" />
+ <f2c_rule Include="ordmmd.f" />
+ <f2c_rule Include="sp2col.f" />
+ <f2c_rule Include="spcho1.f" />
+ <f2c_rule Include="spcho2.f" />
+ <f2c_rule Include="spcompack.f" />
+ <f2c_rule Include="spextr.f" />
+ <f2c_rule Include="spextr1.f" />
+ <f2c_rule Include="spif.f" />
+ <f2c_rule Include="spif1b.f" />
+ <f2c_rule Include="spifp.f" />
+ <f2c_rule Include="spind.f" />
+ <f2c_rule Include="spisp.f" />
+ <f2c_rule Include="..\..\sci_gateway\fortran\spops.f" />
+ <f2c_rule Include="spord.f" />
+ <f2c_rule Include="spreshape.f" />
+ <f2c_rule Include="spsort.f" />
+ <f2c_rule Include="spt.f" />
+ <f2c_rule Include="sputil.f" />
+ <f2c_rule Include="symfct.f" />
+ <f2c_rule Include="sz2ptr.f" />
+ <f2c_rule Include="ta2lpd.f" />
+ <f2c_rule Include="wcompa.f" />
+ <f2c_rule Include="wful2sp.f" />
+ <f2c_rule Include="wij2sp.f" />
+ <f2c_rule Include="wperm.f" />
+ <f2c_rule Include="writebuf.f" />
+ <f2c_rule Include="wsmsp.f" />
+ <f2c_rule Include="wsosp.f" />
+ <f2c_rule Include="wspasp.f" />
+ <f2c_rule Include="wspcle.f" />
+ <f2c_rule Include="wspcsp.f" />
+ <f2c_rule Include="wspe2.f" />
+ <f2c_rule Include="wspful.f" />
+ <f2c_rule Include="wspis.f" />
+ <f2c_rule Include="wspisp.f" />
+ <f2c_rule Include="wspmat.f" />
+ <f2c_rule Include="wspms.f" />
+ <f2c_rule Include="wspmsp.f" />
+ <f2c_rule Include="wspos.f" />
+ <f2c_rule Include="wsposp.f" />
+ <f2c_rule Include="wspssp.f" />
+ <f2c_rule Include="wspt.f" />
+ <f2c_rule Include="wspxs.f" />
+ <f2c_rule Include="wspxsp.f" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\Makefile.am" />
+ <None Include="..\..\sci_gateway\sparse_gateway.xml" />
+ <None Include="Core_f_Import.def" />
+ <None Include="Elementary_functions_f_Import.def" />
+ <None Include="Elementary_functions_Import.def" />
+ <None Include="core_import.def" />
+ <None Include="linpack_f_Import.def" />
+ <None Include="Output_stream_Import.def" />
+ <None Include="Sparse_Import.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
+ <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ <Import Project="..\..\..\..\Visual-Studio-settings\f2c.targets" />
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/modules/sparse/src/fortran/sparse_f2c.vcxproj.filters b/modules/sparse/src/fortran/sparse_f2c.vcxproj.filters
new file mode 100755
index 000000000..0041d1e15
--- /dev/null
+++ b/modules/sparse/src/fortran/sparse_f2c.vcxproj.filters
@@ -0,0 +1,708 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Fortran files">
+ <UniqueIdentifier>{681fc28a-0bc5-42aa-9171-959ec1b9f6f3}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies">
+ <UniqueIdentifier>{4c37c49a-06b8-4398-a116-76103e8161d7}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="blkfc1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="blkfct.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="blkslv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dcompa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dful2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dij2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dperm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dsmsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dsosp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspasp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspcle.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspcsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspe2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspful.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspis.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspisp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspmat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspms.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspmsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspos.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dsposp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspssp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspxs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dspxsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="findl.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="inpnv.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="iperm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="isort1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lcompa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lful2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lij2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lsosp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspasp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspcsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspe2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspful.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspis.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspisp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspmat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspops.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspos.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lsposp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="lspxsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ordmmd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="sp2col.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spcho1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spcho2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spcompack.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spextr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spextr1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spif.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spif1b.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spifp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spind.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spisp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\spops.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spord.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spreshape.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spsort.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="spt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="sputil.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="symfct.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="sz2ptr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ta2lpd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wcompa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wful2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wij2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wperm.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="writebuf.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wsmsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wsosp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspasp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspcle.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspcsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspe2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspful.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspis.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspisp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspmat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspms.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspmsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspos.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wsposp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspssp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspxs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wspxsp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_bfinit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_blkfc1i.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_blkslvi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_fadj2sp.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_full.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_inpnvi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ludel.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_lufact.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_luget.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_lusolve.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_nnz.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ordmmd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_sfinit.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_sparse.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spchol.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spclean.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spcompa.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spget.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_spmatrix.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_symfcti.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ta2lpd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <f2c_rule Include="blkfc1.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="blkfct.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="blkslv.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dcompa.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dful2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dij2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dperm.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dsmsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dsosp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspasp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspcle.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspcsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspe2.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspful.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspis.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspisp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspmat.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspms.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspmsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspos.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dsposp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspssp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspt.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspxs.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="dspxsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="findl.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="inpnv.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="iperm.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="isort1.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lcompa.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lful2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lij2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lsosp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspasp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspcsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspe2.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspful.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspis.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspisp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspmat.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspops.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspos.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lsposp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspt.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="lspxsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="ordmmd.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="sp2col.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spcho1.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spcho2.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spcompack.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spextr.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spextr1.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spif.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spif1b.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spifp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spind.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spisp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\spops.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spord.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spreshape.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spsort.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="spt.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="sputil.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="symfct.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="sz2ptr.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="ta2lpd.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wcompa.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wful2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wij2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wperm.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="writebuf.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wsmsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wsosp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspasp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspcle.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspcsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspe2.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspful.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspis.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspisp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspmat.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspms.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspmsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspos.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wsposp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspssp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspt.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspxs.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="wspxsp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_bfinit.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_blkfc1i.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_blkslvi.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_fadj2sp.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_full.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_inpnvi.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ludel.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_lufact.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_luget.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_lusolve.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_nnz.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ordmmd.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_sfinit.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_sparse.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spchol.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spclean.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spcompa.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spget.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_spmatrix.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_symfcti.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ta2lpd.f">
+ <Filter>Fortran files</Filter>
+ </f2c_rule>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\..\Makefile.am" />
+ <None Include="..\..\sci_gateway\sparse_gateway.xml" />
+ <None Include="Elementary_functions_f_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="Elementary_functions_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="core_import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="Output_stream_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="Sparse_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="linpack_f_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ <None Include="Core_f_Import.def">
+ <Filter>Libraries Dependencies</Filter>
+ </None>
+ </ItemGroup>
+</Project>
diff --git a/modules/sparse/src/fortran/spcho1.f b/modules/sparse/src/fortran/spcho1.f
new file mode 100755
index 000000000..27592393d
--- /dev/null
+++ b/modules/sparse/src/fortran/spcho1.f
@@ -0,0 +1,107 @@
+ SUBROUTINE SPCHO1 (NEQNS,A,NNZA,INDA,XADJF,PERM,INVP,
+ & colcnt,snode,nnzl,nsub,nsuper,xsuper,
+ & iwork,xadj,adjncy,indlnz,lnz,diag,ierr)
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER IWSIZ,NEQNS,NNZA, NSUPER,iflag
+ INTEGER I,I0,nnzc,nnzl,nsub
+C
+ INTEGER ADJNCY(NNZA), COLCNT(NEQNS) ,SNODE(NEQNS)
+ INTEGER INVP(NEQNS) , IWORK(7*NEQNS+3),PERM(NEQNS)
+ INTEGER XADJ(NEQNS+1),XSUPER(NEQNS+1),xadjf(neqns+1)
+ INTEGER INDA(NNZA+NEQNS),indlnz(nnza+neqns)
+ DOUBLE PRECISION A(NNZA),LNZ(NNZA),diag(neqns)
+c
+ iwsiz=7*neqns+3
+ xadjf(1)=1
+ do 100 i=2,neqns
+ 100 xadjf(i)=xadjf(i-1)+inda(i-1)
+ xadjf(neqns+1)=nnza+1
+c
+ call dspt(neqns,neqns,a,nnza,inda,xadjf,lnz,iwork,indlnz)
+ ierr=5
+ do 107 i=1,nnza
+ if (a(i) .ne. lnz(i) ) then
+ ierr=1
+ return
+ endif
+ 107 continue
+ do 108 i=1,neqns
+ if (xadjf(i) .ne. iwork(i)) then
+ ierr=1
+ return
+ endif
+ 108 continue
+c
+c A -DIAG(A)
+c
+ i0=0
+ i1=i0
+ i=1
+ ierr=0
+ idiag0=0
+ nnzc=nnza-neqns
+ if (inda(neqns+1) .ne. 1 .or. inda(neqns+nnza) .ne. neqns
+ & .or. inda(neqns).eq. 0 ) then
+ ierr=1
+ return
+ endif
+ do 10 k=1,nnza
+ 08 i0=i0+1
+ if(i0-i1.gt.inda(i)) then
+ i1=i0
+ i=i+1
+ goto 08
+ endif
+ j=inda(neqns+k)
+ if (i .eq. j) then
+ if (idiag0+1 .ne. i) then
+ ierr=1
+ return
+ endif
+ idiag0=i
+ diag(i)=-a(k)
+ endif
+ 10 continue
+c
+ do 200 i=1,neqns
+ iwork(i)=1
+ 200 iwork(i+neqns)=i
+ call dspasp(neqns,neqns,a,nnza,inda,
+ & diag,neqns,iwork,lnz,nnzc,indlnz,ierr)
+ xadj(1)=1
+ do 210 i=2,neqns
+ 210 xadj(i)=xadj(i-1)+indlnz(i-1)
+ xadj(neqns+1)=nnzc+1
+ DO 310 i=1,nnzc
+ 310 adjncy(i)=indlnz(neqns+i)
+C***********************************************************************
+C PURPOSE - THIS ROUTINE CALLS LIU'S MULTIPLE MINIMUM DEGREE ROUTINE.
+C***********************************************************************
+C
+ CALL ORDMMD ( NEQNS , XADJ , adjncy, INVP ,PERM,
+ 1 IWSIZ , IWORK , NSUB, IFLAG )
+C***********************************************************************
+C PURPOSE:
+C THIS SUBROUTINE COMPUTES THE STORAGE REQUIREMENTS AND SETS UP
+C PRELIMINARY DATA STRUCTURES FOR THE SYMBOLIC FACTORIZATION.
+C CAUTION: THE ADJACENCY VECTOR ADJNCY WILL BE DESTROYED
+ DO 410 i=1,nnza-neqns
+ 410 adjncy(i)=indlnz(neqns+i)
+
+
+C
+C NOTE:
+C THIS VERSION PRODUCES THE MAXIMAL SUPERNODE PARTITION (I.E.,
+C THE ONE WITH THE FEWEST POSSIBLE SUPERNODES).
+C
+ CALL SFINIT(NEQNS , NNZc , XADJ , ADJNCY, PERM ,
+ & INVP , COLCNT, NNZL , NSUB , NSUPER,
+ & SNODE , XSUPER, IWSIZ , IWORK , IFLAG )
+ return
+ end
+c-------------------------------------------------------------------
+
diff --git a/modules/sparse/src/fortran/spcho1.lo b/modules/sparse/src/fortran/spcho1.lo
new file mode 100755
index 000000000..e129abb75
--- /dev/null
+++ b/modules/sparse/src/fortran/spcho1.lo
@@ -0,0 +1,12 @@
+# src/fortran/spcho1.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spcho1.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spcho2.f b/modules/sparse/src/fortran/spcho2.f
new file mode 100755
index 000000000..cbacba607
--- /dev/null
+++ b/modules/sparse/src/fortran/spcho2.f
@@ -0,0 +1,57 @@
+ SUBROUTINE SPCHO2 ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ ,
+ & IWORK , TMPSIZ, TMPVEC,indlnz,nnzl,nsub)
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER level
+c
+ INTEGER XLINDX(nsuper+1) , XLNZ(neqns+1)
+ INTEGER IWORK(2*neqns+2*nsuper), LINDX(nsub),
+ & SNODE(neqns) , SPLIT(neqns) ,
+ & XSUPER(nsuper+1),indlnz(neqns+nnzl)
+ INTEGER IFLAG , IWSIZ , NEQNS , NSUPER, TMPSIZ
+ DOUBLE PRECISION LNZ(nnzl) , TMPVEC(tmpsiz)
+C***********************************************************************
+C PURPOSE:
+C THIS SUBROUTINE CALLS THE BLOCK GENERAL SPARSE CHOLESKY ROUTINE,
+C BLKFC2.
+C
+ iwsiz=2*neqns+2*nsuper
+ level = 8
+ CALL BLKFC1 ( NEQNS , NSUPER, XSUPER, SNODE , SPLIT ,
+ & XLINDX, LINDX , XLNZ , LNZ , IWSIZ ,
+ & IWORK , TMPSIZ, TMPVEC, IFLAG ,level)
+c********************************************************************
+ do 1110 i=2,neqns+1
+ 1110 indlnz(i-1)=xlnz(i)-xlnz(i-1)
+ call icopy (xlindx(nsuper+1)-1,lindx,1,indlnz(neqns+1),1)
+ i=1
+ do 1140 j=1,neqns
+ if (i .eq. nsuper+1) go to 1141
+ if ((xlnz(j+1)-xlnz(j) .eq. xlindx(i+1)-xlindx(i))
+ & .and. (indlnz(neqns+xlnz(j)) .eq. j)) go to 1120
+ l=xlindx(nsuper+1)-xlindx(i)+(xlnz(j+1)-xlnz(j))
+ call icopy(l,lindx(xlindx(i)-(xlnz(j+1)-xlnz(j))),
+ & 1,indlnz(neqns+xlnz(j)),1)
+ i=i-1
+ 1120 continue
+ i=i+1
+ 1140 continue
+ go to 1135
+ 1141 k=xlnz(neqns+1)-xlnz(j)
+ i=1
+ ii=1
+ 1125 if (i.gt.k) go to 1135
+ do 1130 j=1,ii
+ indlnz(neqns+xlnz(neqns+1)-i)=neqns-j+1
+ 1130 i=i+1
+ ii=ii+1
+ go to 1125
+ 1135 continue
+ return
+ end
+C**********************************************************************
diff --git a/modules/sparse/src/fortran/spcho2.lo b/modules/sparse/src/fortran/spcho2.lo
new file mode 100755
index 000000000..3df701f39
--- /dev/null
+++ b/modules/sparse/src/fortran/spcho2.lo
@@ -0,0 +1,12 @@
+# src/fortran/spcho2.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spcho2.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spcompack.f b/modules/sparse/src/fortran/spcompack.f
new file mode 100755
index 000000000..0bc1820a8
--- /dev/null
+++ b/modules/sparse/src/fortran/spcompack.f
@@ -0,0 +1,46 @@
+C**********************************************************************
+ SUBROUTINE SPCOMPACK ( NEQNS , NSUPER, NSUB, NNZ, XLINDX, LINDX ,
+ & XLNZ , ADJNCY)
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+C
+ INTEGER NEQNS, NSUPER, NSUB
+c
+ INTEGER XLINDX(nsuper+1), XLNZ(neqns+1)
+ INTEGER LINDX(nsub) , ADJNCY(nnz)
+C***********************************************************************
+C PURPOSE:
+C THIS SUBROUTINE Convert a compact adjacency representation into
+C a standard adjacency form
+C*******************************************************************
+
+ call icopy (nsub,lindx,1,adjncy,1)
+ i=1
+ do 1140 j=1,neqns
+ if (i .eq. nsuper+1) go to 1141
+ if ((xlnz(j+1)-xlnz(j) .eq. xlindx(i+1)-xlindx(i))
+ & .and. (adjncy(xlnz(j)) .eq. j)) go to 1120
+ l=xlindx(nsuper+1)-xlindx(i)+(xlnz(j+1)-xlnz(j))
+ call icopy(l,lindx(xlindx(i)-(xlnz(j+1)-xlnz(j))),
+ & 1,adjncy(xlnz(j)),1)
+ i=i-1
+ 1120 continue
+ i=i+1
+ 1140 continue
+ go to 1135
+ 1141 k=xlnz(neqns+1)-xlnz(j)
+ i=1
+ ii=1
+ 1125 if (i.gt.k) go to 1135
+ do 1130 j=1,ii
+ adjncy(xlnz(neqns+1)-i) = neqns-j+1
+ 1130 i=i+1
+ ii=ii+1
+ go to 1125
+ 1135 continue
+ return
+ end
+C**********************************************************************
diff --git a/modules/sparse/src/fortran/spcompack.lo b/modules/sparse/src/fortran/spcompack.lo
new file mode 100755
index 000000000..f4d835c86
--- /dev/null
+++ b/modules/sparse/src/fortran/spcompack.lo
@@ -0,0 +1,12 @@
+# src/fortran/spcompack.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spcompack.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spextr.f b/modules/sparse/src/fortran/spextr.f
new file mode 100755
index 000000000..d7715b104
--- /dev/null
+++ b/modules/sparse/src/fortran/spextr.f
@@ -0,0 +1,156 @@
+ subroutine spextr(A_m, A_n, A_nel, A_mnel, A_icol, A_R, A_I,
+ $ B_m, B_n, B_nel, B_mnel, B_icol, B_R, B_I,
+ $ it, i, ni, j, nj, nel_max, ptr, p, ierr)
+*
+* PURPOSE
+* perform a sparse matrix extraction, ie, computes the
+* sparse matrix B such that : B = A(i,j) where i and
+* j are vectors of indices of length ni and nj respectively.
+*
+* depending upon the argument it, A may be (and so B) :
+* a/ a boolean sparse (it = -1). In this case the arrays
+* A_R, A_I, B_R, B_I are not used.
+* b/ a real sparse (it = 0). The arrays A_I and B_I are not used.
+*
+* c/ a complex sparse (it = 1)
+*
+* CAUTION
+* nel_max is the maximum non zeros elements authorized
+* for B => if this limit is not enough the error
+* indicator ierr is set to -1 (else 0)
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer A_m, A_n, A_nel, A_mnel(*), A_icol(*)
+ integer B_m, B_n, B_nel, B_mnel(*), B_icol(*)
+ integer it, i(*), ni, j(*), nj, nel_max, ptr(*), p(*), ierr
+ double precision A_R(*), A_I(*), B_R(*), B_I(*)
+
+* internal vars
+ integer k, kk, ka, kb, ib, ia, ja, ptrb
+ logical allrow, allcol, j_in_order
+
+* external functions and subroutines called
+ integer dicho_search, dicho_search_bis
+ logical is_in_order
+ external dicho_search, dicho_search_bis, is_in_order, qsorti,
+ $ insert_in_order, icopy, unsfdcopy, sz2ptr
+
+ ierr = 0
+ allrow = ni.lt.0 ! ni < 0 for a A(:,j) extraction
+ allcol = nj.lt.0 ! nj < 0 for a A(i,:) extraction
+
+ if (allrow) then
+ ni = A_m
+ endif
+
+ if (allcol) then
+ nj = A_n
+ else
+ j_in_order = is_in_order(j, nj)
+ if ( .not. j_in_order ) call qsorti(j, p, nj)
+ endif
+
+ B_m = ni
+ B_n = nj
+
+ call sz2ptr(A_mnel, A_m, ptr)
+
+ kb = 1
+ do ib = 1, B_m
+ B_mnel(ib) = 0
+
+ if (allrow) then
+ ia = ib
+ else
+ ia = i(ib)
+ endif
+
+ if ( A_mnel(ia) .gt. 0 ) then
+
+ if (allcol) then
+ if ( kb+A_mnel(ia) .ge. nel_max ) then ! not enough memory
+ ierr = -1
+ return
+ endif
+ B_mnel(ib) = A_mnel(ia)
+ call icopy(A_mnel(ia), A_icol(ptr(ia)), 1, B_icol(kb), 1)
+ if ( it .ge. 0 )
+ $ call unsfdcopy(A_mnel(ia), A_R(ptr(ia)), 1, B_R(kb), 1)
+ if ( it .eq. 1 )
+ $ call unsfdcopy(A_mnel(ia), A_I(ptr(ia)), 1, B_I(kb), 1)
+ kb = kb + A_mnel(ia)
+
+ elseif ( nj .gt. A_mnel(ia) .and. j_in_order ) then
+ ! algorithm with loop on the row ia of A
+ do ka = ptr(ia), ptr(ia+1)-1
+ ja = A_icol(ka)
+ k = dicho_search(ja, j, nj)
+ if ( k .ne. 0 ) then ! we have found (the smallest) k such that ja = j(k)
+ 100 if (kb .gt. nel_max) then ! not enough memory
+ ierr = -1
+ return
+ endif
+ B_mnel(ib) = B_mnel(ib) + 1
+ B_icol(kb) = k
+ if ( it .ge. 0 ) B_R(kb) = A_R(ka)
+ if ( it .eq. 1 ) B_I(kb) = A_I(ka)
+ kb = kb + 1
+ if ( k .lt. nj) then ! verify if j(k+1) = ja
+ k = k + 1
+ if ( j(k) .eq. ja ) goto 100
+ endif
+ endif
+ enddo
+
+ elseif ( nj .gt. 2*A_mnel(ia) .and. .not.j_in_order ) then
+ ! algorithm with loop on the row ia of A but the array
+ ! j is not in order : nevertheless we may work with j(p(.)) where
+ ! p is the permutation which reorders the array j
+ ptrb = kb
+ do ka = ptr(ia), ptr(ia+1)-1
+ ja = A_icol(ka)
+ k = dicho_search_bis(ja, j, p, nj)
+ if ( k .ne. 0 ) then ! we have found (the smallest) k such that ja = j(p(k))
+ 200 if (kb .gt. nel_max) then ! not enough memory
+ ierr = -1
+ return
+ endif
+ B_mnel(ib) = B_mnel(ib) + 1
+ call insert_in_order( B_icol, ptrb, kb, p(k), it,
+ $ B_R, B_I, A_R(ka), A_I(ka) )
+ kb = kb + 1
+ if ( k .lt. nj) then ! verify if j(p(k+1)) = ja
+ k = k + 1
+ if ( j(p(k)) .eq. ja ) goto 200
+ endif
+ endif
+ enddo
+
+ else
+ ! algorithm with loop on j(1),...,j(nj)
+ do k = 1, nj
+ kk = dicho_search(j(k), A_icol(ptr(ia)), A_mnel(ia))
+ if ( kk .ne. 0 ) then ! we have found kk such that j(k) = A_icol(ptr(ia)-1+kk)
+ ka = kk + ptr(ia) - 1
+ if (kb .gt. nel_max) then ! not enough memory
+ ierr = -1
+ return
+ endif
+ B_mnel(ib) = B_mnel(ib) + 1
+ B_icol(kb) = k
+ if ( it .ge. 0 ) B_R(kb) = A_R(ka)
+ if ( it .eq. 1 ) B_I(kb) = A_I(ka)
+ kb = kb + 1
+ endif
+ enddo
+ endif
+ endif
+ enddo
+
+ B_nel = kb - 1
+
+ end
+
diff --git a/modules/sparse/src/fortran/spextr.lo b/modules/sparse/src/fortran/spextr.lo
new file mode 100755
index 000000000..5a13ce5b4
--- /dev/null
+++ b/modules/sparse/src/fortran/spextr.lo
@@ -0,0 +1,12 @@
+# src/fortran/spextr.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spextr.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spextr1.f b/modules/sparse/src/fortran/spextr1.f
new file mode 100755
index 000000000..570c062b6
--- /dev/null
+++ b/modules/sparse/src/fortran/spextr1.f
@@ -0,0 +1,113 @@
+ subroutine spextr1(A_m, A_n, A_nel, A_mnel, A_icol, A_R, A_I,
+ $ B_m, B_n, B_nel, B_mnel, B_icol, B_R, B_I,
+ $ it, i, ni, nel_max, ptr, ierr)
+*
+* PURPOSE
+* perform the sparse matrix extraction B = A(i)
+* where i is a vector of indices of length ni
+*
+* With one vector of index, the extraction operation must be
+* meant as if A would be stacked as a big sparse
+* column vector...
+*
+* depending upon the argument it, A may be (and so B) :
+* a/ a boolean sparse (it = -1). In this case the arrays
+* A_R, A_I, B_R, B_I are not used.
+* b/ a real sparse (it = 0). The arrays A_I and B_I are not used.
+*
+* c/ a complex sparse (it = 1)
+*
+* CAUTION
+* nel_max is the maximum non zeros elements authorized
+* for B => if this limit is not enough the error
+* indicator ierr is set to -1 (else 0)
+*
+* AUTHOR
+* Bruno Pincon
+
+ implicit none
+ integer A_m, A_n, A_nel, A_mnel(*), A_icol(*)
+ integer B_m, B_n, B_nel, B_mnel(*), B_icol(*)
+ integer it, i(*), ni, nel_max, ptr(*), ierr
+ double precision A_R(*), A_I(*), B_R(*), B_I(*)
+
+* internal vars
+ integer k, ka, kb, ia, ja, ii
+
+* external functions and subroutines called
+ integer dicho_search
+ external dicho_search, sz2ptr
+
+ ierr = 0
+ if ( ni.lt.0 ) then ! the case B = A(:) is not treated by this routine
+ ierr = -2 ! but via the reshape routine (spmat). So this error
+ return ! must not appeared
+ endif
+
+ kb = 1
+
+ if (A_m .eq. 1) then ! B must be in this case a row vector
+ do k = 1, ni
+ ka = dicho_search(i(k), A_icol(1), A_mnel(1) )
+ if (ka .ne. 0) then
+ if (kb .gt. nel_max) then ! test memoire
+ ierr = -1
+ return
+ endif
+ B_icol(kb) = k
+ if (it .ge. 0) B_R(kb) = A_R(ka)
+ if (it .eq. 1) B_I(kb) = A_I(ka)
+ kb = kb + 1
+ endif
+ enddo
+ B_mnel(1) = kb - 1
+
+ else
+ call sz2ptr(A_mnel, A_m-1, ptr) ! need ptr to access fastly at the beginning of a row
+
+ if (A_n .gt. 1) then
+ do k = 1, ni
+ ii = i(k)
+ ia = mod(ii-1, A_m) + 1
+ ja = (ii-1)/A_m + 1
+ ka = dicho_search(ja, A_icol(ptr(ia)), A_mnel(ia) )
+
+ if (ka .ne. 0) then
+ if (kb .gt. nel_max) then ! test memoire
+ ierr = -1
+ return
+ endif
+ ka = ka + ptr(ia) - 1
+ B_mnel(k) = 1
+ B_icol(kb) = 1
+ if (it .ge. 0) B_R(kb) = A_R(ka)
+ if (it .eq. 1) B_I(kb) = A_I(ka)
+ kb = kb + 1
+ else
+ B_mnel(k) = 0
+ endif
+ enddo
+ else ! A is a sparse column => binary (dicho) search not useful
+ do k = 1, ni
+ ii = i(k)
+ if ( A_mnel(ii) .gt. 0 ) then
+ if (kb .gt. nel_max) then ! test memoire
+ ierr = -1
+ return
+ endif
+ ka = ptr(ii)
+ B_mnel(k) = 1
+ B_icol(kb) = 1
+ if (it .ge. 0) B_R(kb) = A_R(ka)
+ if (it .eq. 1) B_I(kb) = A_I(ka)
+ kb = kb + 1
+ else
+ B_mnel(k) = 0
+ endif
+ enddo
+ endif
+ endif
+
+ B_nel = kb - 1
+
+ end
diff --git a/modules/sparse/src/fortran/spextr1.lo b/modules/sparse/src/fortran/spextr1.lo
new file mode 100755
index 000000000..6be1990a2
--- /dev/null
+++ b/modules/sparse/src/fortran/spextr1.lo
@@ -0,0 +1,12 @@
+# src/fortran/spextr1.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spextr1.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spif.f b/modules/sparse/src/fortran/spif.f
new file mode 100755
index 000000000..c8152e496
--- /dev/null
+++ b/modules/sparse/src/fortran/spif.f
@@ -0,0 +1,139 @@
+ subroutine spif(A_m, A_n, A_nel, A_it, A_mnel, A_icol, A_R, A_I,
+ $ B_m, B_n, B_it, B_R, B_I,
+ $ C_m, C_n, C_nel, C_it, C_mnel, C_icol, C_R, C_I,
+ $ i, pi, ni, j, pj, nj, nelmax, ierr)
+
+*
+* PURPOSE
+* do the scilab operation A(i,j) = B : where A is a sparse matrix
+* (real if it = 0, complex if it=1), B is a full matrix and i and
+* j are 2 arrays of indices i(1..ni), j(1..nj).
+* The result being stored in C (a sparse). nelmax is the max number of
+* elements for the resulting matrix C.
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer A_m, A_n, A_nel, A_it, A_mnel(*), A_icol(*),
+ $ B_m, B_n, B_it,
+ $ C_m, C_n, C_nel, C_it, C_mnel(*), C_icol(*),
+ $ i(*), pi(*), ni, j(*), pj(*), nj, nelmax, ierr
+ double precision A_R(*), A_I(*), B_R(B_m,*), B_I(B_m,*),
+ $ C_R(*), C_I(*)
+
+* local var
+ logical allrow, allcol, B_is_scalar
+ integer ii, i1, i2, imax, k, ka, kc, A_mnel_ii
+
+* external functions and subroutines
+ logical is_in_order
+ external is_in_order, isorti, set_perm_id, copy_fullrow2sprow,
+ $ insert_row, iset, copy_sprow
+
+ ierr = 0
+ allrow = ni.lt.0 ! ni < 0 for A(:,j) = B
+ allcol = nj.lt.0 ! nj < 0 for A(i,:) = B
+
+ if (allrow) then
+ ni = A_m
+ else
+ if ( .not. is_in_order(i, ni) ) then
+ call isorti(i, pi, ni)
+ else
+ call set_perm_id(pi, ni)
+ endif
+ imax = i(pi(ni))
+ endif
+
+ if (allcol) then
+ nj = A_n
+ else
+ if ( .not. is_in_order(j, nj) ) then
+ call isorti(j, pj, nj)
+ else
+ call set_perm_id(pj, nj)
+ endif
+ endif
+
+ if ( (B_m .eq. 1) .and. (B_n .eq.1) ) then
+ B_is_scalar = .true.
+ B_m = ni
+ B_n = nj
+ else
+ B_is_scalar = .false.
+ endif
+
+ ka = 1
+ kc = 1
+
+ if (allrow .and. allcol) then ! *** A(:,:) = B
+ call iset(A_m, 0, C_mnel, 1)
+ do ii = 1, B_m
+ call copy_fullrow2sprow(ii, kc, C_it, C_mnel(ii), C_icol,
+ $ C_R, C_I, B_m, B_n, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+ if (ierr .ne. 0) return
+ enddo
+
+ elseif (allrow) then ! *** A(:,j) = B
+ call iset(A_m, 0, C_mnel, 1)
+ do ii = 1, A_m
+ call insert_row(ka, A_it, A_mnel(ii), A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel(ii), C_icol, C_R, C_I,
+ $ j, pj, nj, ii, B_m, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+ if (ierr .ne. 0) return
+ enddo
+
+ else ! *** A(i,:) = B or A(i,j) = B
+ call iset(imax, 0, C_mnel, 1)
+ i1 = 1
+
+ k = 1
+* loop on k from 1 to ni but some values must be skiped
+ 100 ii = i(pi(k))
+ if (k .lt. ni) then
+ if (i(pi(k+1)) .eq. ii) then
+ k = k+1
+ goto 100
+ endif
+ endif
+ i2 = min(ii-1, A_m)
+ call copy_sprow(i1,i2, ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ if (allcol) then ! *** A(i,:) = B
+ call copy_fullrow2sprow(pi(k), kc, C_it, C_mnel(ii),
+ $ C_icol, C_R, C_I,
+ $ B_m, B_n, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+ ka = ka + A_mnel(ii)
+ else ! *** A(i,j) = B
+ if ( ii .gt. A_m ) then
+ A_mnel_ii = 0
+ else
+ A_mnel_ii = A_mnel(ii)
+ endif
+ call insert_row(ka, A_it, A_mnel_ii, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel(ii), C_icol, C_R, C_I,
+ $ j, pj, nj, pi(k), B_m, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+ endif
+ if (ierr .ne. 0) return
+ i1 = ii+1
+
+ k = k+1
+ if (k .le. ni) goto 100
+* endloop on k
+ i1 = i(pi(ni))+1
+ i2 = A_m
+ call copy_sprow(i1,i2, ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+ endif
+
+ C_nel = kc-1
+
+ end
diff --git a/modules/sparse/src/fortran/spif.lo b/modules/sparse/src/fortran/spif.lo
new file mode 100755
index 000000000..e5e42b332
--- /dev/null
+++ b/modules/sparse/src/fortran/spif.lo
@@ -0,0 +1,12 @@
+# src/fortran/spif.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spif.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spif1b.f b/modules/sparse/src/fortran/spif1b.f
new file mode 100755
index 000000000..f3ab4641e
--- /dev/null
+++ b/modules/sparse/src/fortran/spif1b.f
@@ -0,0 +1,127 @@
+ subroutine spif1b(A_m, A_n, A_nel, A_it, A_mnel, A_icol, A_R, A_I,
+ $ B_nel, B_mnel, B_icol, C_it,C_R,C_I,C_is_scalar,
+ $ D_nel, D_it, D_mnel, D_icol, D_R, D_I,
+ $ nelmax, p, q, ierr)
+
+*
+* PURPOSE
+* do the scilab operation A(B) = C : where A is a sparse matrix
+* (real if it = 0, complex if it=1), C is a full vector (or a scalar)
+* and B is a boolean sparse matrix
+* The result being stored in D (a sparse). nelmax is the max number of
+* elements for the resulting matrix D.
+*
+* Here B must have the same dimensions than A and the vector C must have
+* B_nel components (or only one).
+*
+* AUTHOR
+* Bruno Pincon
+*
+*
+ implicit none
+ integer A_m, A_n, A_nel, A_it, A_mnel(*), A_icol(*),
+ $ B_nel, B_mnel(*), B_icol(*), C_it, D_it, D_nel, D_mnel(*),
+ $ D_icol(*), nelmax, p(*), q(*), ierr
+ logical C_is_scalar
+ double precision A_R(*), A_I(*), C_R(*), C_I(*), D_R(*), D_I(*)
+
+ integer kA, kB, kD, i, in, l, j, j1, j2, kamax
+ double precision Ck_R, Ck_I
+
+ if (C_is_scalar) then
+ Ck_R = C_R(1)
+ if (C_it .eq. 1) then
+ Ck_I = C_I(1)
+ else
+ Ck_I = C_R(1) ! for the bad trick ....
+ endif
+ else
+* compute the permutation q to insert row by row (because the order is column
+* wize and the scilab sparse format is row oriented)
+ call iset(A_n+1,0,p,1)
+ do kB = 1, B_nel
+ j = B_icol(kB)
+ p(j+1) = p(j+1) + 1
+ enddo
+ p(1) = 1
+ do j = 2, A_n
+ p(j) = p(j-1) + p(j)
+ enddo
+ do kB = 1, B_nel
+ j = B_icol(kB)
+ q(kB) = p(j)
+ p(j) = p(j) + 1
+ enddo
+ endif
+
+ ierr = 0
+ kA = 1
+ kB = 1
+ kD = 1
+
+ i = 1
+ do while ( i .le. A_m )
+ if (B_mnel(i) .eq. 0) then
+ in = i+1
+ 10 continue
+ if ( in .le. A_m ) then
+ if (B_mnel(in) .eq. 0) then
+ in = in + 1
+ goto 10
+ endif
+ endif
+ call copy_sprow(i,in-1, kA, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kD, D_it, D_mnel, D_icol, D_R, D_I,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ i = in
+ else
+ D_mnel(i) = 0
+ kamax = ka + A_mnel(i) - 1
+ j1 = 1
+ do l = 1, B_mnel(i)
+ j2 = B_icol(kB)
+ call insert_j1j2(j1, j2-1, A_it, A_icol, A_R, A_I, kA,
+ $ kamax, D_it, D_mnel(i), D_icol, D_R, D_I, kD,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ ! insertion de l'élément de C(kB) ds D(i,j2) si non nul
+ if (.not. C_is_scalar) then
+ Ck_R = C_R(q(kB))
+ if (C_it .eq. 1) then
+ Ck_I = C_I(q(kB))
+ else
+ Ck_I = Ck_R ! for the bad trick
+ endif
+ endif
+
+ if ( Ck_R .ne. 0.d0 .or. Ck_I .ne. 0.d0 ) then
+ if (kD .gt. nelmax) then ! but test if there is enough memory before
+ ierr = -1
+ return
+ endif
+ D_mnel(i) = D_mnel(i) + 1
+ D_icol(kD) = j2
+ D_R(kD) = Ck_R
+ if (D_it .eq. 1) then
+ if (C_it .eq. 1) then
+ D_I(kD) = Ck_I
+ else
+ D_I(kD) = 0.d0
+ endif
+ endif
+ kD = kD + 1
+ endif
+ kB = kB + 1
+ j1 = j2 + 1
+ enddo
+ call insert_j1j2(j1, A_n, A_it, A_icol, A_R, A_I, kA,
+ $ kamax, D_it, D_mnel(i), D_icol, D_R, D_I, kD,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ i = i + 1
+ endif
+ enddo
+ D_nel = kD - 1
+
+ end
diff --git a/modules/sparse/src/fortran/spif1b.lo b/modules/sparse/src/fortran/spif1b.lo
new file mode 100755
index 000000000..d70cd554c
--- /dev/null
+++ b/modules/sparse/src/fortran/spif1b.lo
@@ -0,0 +1,12 @@
+# src/fortran/spif1b.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spif1b.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spifp.f b/modules/sparse/src/fortran/spifp.f
new file mode 100755
index 000000000..90a76466d
--- /dev/null
+++ b/modules/sparse/src/fortran/spifp.f
@@ -0,0 +1,69 @@
+ subroutine spifp(A_m, A_n, A_nel, A_mnel, A_icol, A_R, A_I, A_it,
+ $ i, ni, j, nj, ptr, ka, B_it, B_R, B_I, flag)
+*
+* PURPOSE
+* look if in place insertion is possible and
+* if yes perform it.
+*
+* PARAMETERS
+* work arrays : ptr (size A_m), ka (size(ni x nj))
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer A_m, A_n, A_nel, A_mnel(*), A_icol(*)
+ integer A_it, i(*), ni, j(*), nj, ptr(*), ka(ni,*), B_it, flag
+ double precision A_R(*), A_I(*), B_R(ni,*), B_I(ni,*)
+
+* internal vars
+ integer ii, jj, ia, ja, k, pl
+
+* external functions and subroutines called
+ integer dicho_search
+ external dicho_search, sz2ptr
+
+ call sz2ptr(A_mnel, A_m-1, ptr)
+
+ do ii = 1, ni
+ ia = i(ii)
+ ! Check before the insertion. See bug #10126
+ if ( ia .gt. A_m ) then
+ flag = 0
+ return
+ endif
+ do jj = 1, nj
+ ! we can not insert a zero so we test if B(ii,jj) = 0 or not.
+ ! note : if B is real B_I(ii,jj) = B_R(ii,jj) so the following bad trick works...
+ if (B_R(ii,jj).eq.0.d0 .and. B_I(ii,jj).eq.0.d0) then
+ flag = 0
+ return
+ endif
+ ja = j(jj)
+ pl = dicho_search(ja, A_icol(ptr(ia)), A_mnel(ia))
+ if ( pl .ne. 0 ) then
+ ka(ii,jj) = pl + ptr(ia) - 1
+ else
+ flag = 0
+ return
+ endif
+ enddo
+ enddo
+
+ do jj = 1, nj
+ do ii = 1, ni
+ k = ka(ii,jj)
+ A_R(k) = B_R(ii,jj)
+ if (A_it .eq. 1) then
+ if (B_it .eq. 1) then
+ A_I(k) = B_I(ii,jj)
+ else
+ A_I(k) = 0.d0
+ endif
+ endif
+ enddo
+ enddo
+
+ flag = 1
+
+ end
diff --git a/modules/sparse/src/fortran/spifp.lo b/modules/sparse/src/fortran/spifp.lo
new file mode 100755
index 000000000..65d115396
--- /dev/null
+++ b/modules/sparse/src/fortran/spifp.lo
@@ -0,0 +1,12 @@
+# src/fortran/spifp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spifp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spind.f b/modules/sparse/src/fortran/spind.f
new file mode 100755
index 000000000..4f2e459f7
--- /dev/null
+++ b/modules/sparse/src/fortran/spind.f
@@ -0,0 +1,22 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine spind(i,xadj,nb,nza)
+c converts adjacency into sparse matrix
+ integer*4 i(*),xadj(*)
+ integer*4 nb,ii,io,nza,k
+ io=0
+ do 100 k=1,nb
+ ii=xadj(k+1)-xadj(k)
+ do 200 j=1,ii
+ io = io + 1
+ i(io) = k
+ 200 continue
+ 100 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/spind.lo b/modules/sparse/src/fortran/spind.lo
new file mode 100755
index 000000000..e1a2bb86f
--- /dev/null
+++ b/modules/sparse/src/fortran/spind.lo
@@ -0,0 +1,12 @@
+# src/fortran/spind.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spind.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spisp.f b/modules/sparse/src/fortran/spisp.f
new file mode 100755
index 000000000..8a788876d
--- /dev/null
+++ b/modules/sparse/src/fortran/spisp.f
@@ -0,0 +1,153 @@
+ subroutine spisp(A_m, A_n, A_nel, A_it, A_mnel, A_icol, A_R, A_I,
+ $ B_m, B_n, B_nel, B_it, B_mnel, B_icol, B_R, B_I,
+ $ C_m, C_n, C_nel, C_it, C_mnel, C_icol, C_R, C_I,
+ $ B_ptr_row, i, pi, ni, j, pj, nj, nelmax, ierr)
+
+*
+* PURPOSE
+* do the scilab operation A(i,j) = B : where A is a sparse matrix
+* (real if it = 0, complex if it=1), and B is a sparse matrix and i and
+* j are 2 arrays of indices i(1..ni), j(1..nj).
+* The result being stored in C (a sparse). nelmax is the max number of
+* elements for the resulting matrix C.
+*
+* B_m must be equal to ni and B_n to nj
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer A_m, A_n, A_nel, A_it, A_mnel(*), A_icol(*),
+ $ B_m, B_n, B_nel, B_it, B_mnel(*), B_icol(*), B_ptr_row(*),
+ $ C_m, C_n, C_nel, C_it, C_mnel(*), C_icol(*),
+ $ i(*), pi(*), ni, j(*), pj(*), nj, nelmax, ierr
+ double precision A_R(*), A_I(*), B_R(*), B_I(*),
+ $ C_R(*), C_I(*)
+
+* local var
+ logical allrow, allcol
+ integer ii, i1, i2, imax, ib, k, ka, kb, kc, A_mnel_ii, nbe
+
+* external functions and subroutines
+ logical is_in_order
+ external is_in_order, isorti, set_perm_id,
+ $ insert_sprow, iset, copy_sprow, sz2ptr
+
+ ierr = 0
+ allrow = ni.lt.0 ! ni < 0 for A(:,j) = B
+ allcol = nj.lt.0 ! nj < 0 for A(i,:) = B
+
+ if (allrow) then
+ ni = A_m
+ else
+ call sz2ptr(B_mnel, B_m, B_ptr_row)
+ if ( .not. is_in_order(i, ni) ) then
+ call isorti(i, pi, ni)
+ else
+ call set_perm_id(pi, ni)
+ endif
+ imax = i(pi(ni))
+ endif
+
+ if (allcol) then
+ nj = A_n
+ else
+ if ( .not. is_in_order(j, nj) ) then
+ call isorti(j, pj, nj)
+ else
+ call set_perm_id(pj, nj)
+ endif
+ endif
+
+ ka = 1
+ kb = 1
+ kc = 1
+
+ if (allrow .and. allcol) then ! *** A(:,:) = B
+ call copy_sprow(1, A_m, kb, B_it, B_mnel, B_icol, B_R, B_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+ elseif (allrow) then ! *** A(:,j) = B
+ call iset(A_m, 0, C_mnel, 1)
+ do ii = 1, A_m
+ call insert_sprow(ka, A_it, A_mnel(ii), A_icol, A_R, A_I,
+ $ kb, B_it, B_mnel(ii), B_icol, B_R, B_I,
+ $ kc, C_it, C_mnel(ii), C_icol, C_R, C_I,
+ $ j, pj, nj, nelmax, ierr)
+ if (ierr .ne. 0) return
+ kb = kb + B_mnel(ii)
+ enddo
+
+ else ! *** A(i,:) = B or A(i,j) = B
+ call iset(imax, 0, C_mnel, 1)
+ i1 = 1
+
+ k = 1
+* loop on k from 1 to ni but some values must be skiped
+ 100 ii = i(pi(k))
+ if (k .lt. ni) then
+ if (i(pi(k+1)) .eq. ii) then
+ k = k+1
+ goto 100
+ endif
+ endif
+ ib = pi(k) ! corresponding row of B
+ i2 = min(ii-1, A_m)
+ if ( i1 .le. i2 ) then
+ call copy_sprow(i1,i2,ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ endif
+
+ kb = B_ptr_row(ib)
+ if (allcol) then ! *** A(i,:) = B
+
+* copy the sparse row ib of B for the row ii of C
+* (this could be done by copy_sprow with a little modif...)
+ nbe = B_mnel(ib)
+ if (kc + nbe .gt. nelmax) then
+ ierr = -1
+ return
+ endif
+ C_mnel(ii) = nbe
+ call icopy( nbe, B_icol(kb), 1, C_icol(kc), 1)
+ call unsfdcopy(nbe, B_R(kb), 1, C_R(kc), 1)
+ if (C_it .eq. 1) then ! C is complex
+ if (B_it .eq. 1) then ! B is complex
+ call unsfdcopy(nbe, B_I(kb), 1, C_I(kc), 1)
+ else ! B is real
+ call dset(nbe, 0.d0, C_I(kc), 1)
+ endif
+ endif
+ ka = ka + A_mnel(ii)
+ kc = kc + nbe
+ else ! *** A(i,j) = B
+ if ( ii .gt. A_m ) then
+ A_mnel_ii = 0
+ else
+ A_mnel_ii = A_mnel(ii)
+ endif
+
+ call insert_sprow(ka, A_it, A_mnel_ii, A_icol, A_R, A_I,
+ $ kb, B_it, B_mnel(ib), B_icol, B_R, B_I,
+ $ kc, C_it, C_mnel(ii), C_icol, C_R, C_I,
+ $ j, pj, nj, nelmax, ierr)
+ endif
+ if (ierr .ne. 0) return
+
+ i1 = ii+1
+
+ k = k+1
+ if (k .le. ni) goto 100
+* endloop on k
+ i1 = i(pi(ni))+1
+ i2 = A_m
+ call copy_sprow(i1,i2, ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+ endif
+
+ C_nel = kc-1
+
+ end
diff --git a/modules/sparse/src/fortran/spisp.lo b/modules/sparse/src/fortran/spisp.lo
new file mode 100755
index 000000000..e7e06cc3e
--- /dev/null
+++ b/modules/sparse/src/fortran/spisp.lo
@@ -0,0 +1,12 @@
+# src/fortran/spisp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spisp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spord.f b/modules/sparse/src/fortran/spord.f
new file mode 100755
index 000000000..8e95178dd
--- /dev/null
+++ b/modules/sparse/src/fortran/spord.f
@@ -0,0 +1,31 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ integer function spord(r11,r12,r21,r22)
+c!purpose
+c test function for dspsort wspsort et lspsort
+c!
+ integer r11,r12,r21,r22,r
+c returns
+c 1 :if record r1 is greater than r2
+c -1 :if record r1 is less than r2
+c 0 :if record r1 is equal to r2
+ if(r11.gt.r21) then
+ r=1
+ elseif(r11.lt.r21) then
+ r=-1
+ elseif(r12.gt.r22) then
+ r=1
+ elseif(r12.lt.r22) then
+ r=-1
+ else
+ r=0
+ endif
+ spord=-r
+ return
+ end
diff --git a/modules/sparse/src/fortran/spord.lo b/modules/sparse/src/fortran/spord.lo
new file mode 100755
index 000000000..bf5f35562
--- /dev/null
+++ b/modules/sparse/src/fortran/spord.lo
@@ -0,0 +1,12 @@
+# src/fortran/spord.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spord.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spreshape.f b/modules/sparse/src/fortran/spreshape.f
new file mode 100755
index 000000000..c6dff3c55
--- /dev/null
+++ b/modules/sparse/src/fortran/spreshape.f
@@ -0,0 +1,79 @@
+ subroutine spreshape(A_m, A_n, A_mnel, A_icol, A_R, A_I,
+ $ B_m, B_n, B_mnel, B_icol, B_R, B_I,
+ $ nel, it, ij, ptr, p)
+*
+* PURPOSE
+* reshape a sparse matrix, ie, computes the
+* sparse matrix B such that : B = matrix(A, m_B, n_B)
+* with m_B * n_B = m_A * n_A (this condition being
+* verified at the calling level)
+*
+* depending upon the argument it, A may be (and so B) :
+* a/ a boolean sparse (it = -1). In this case the arrays
+* R_A, I_A, R_B, I_B are not used.
+* b/ a real sparse (it = 0). The arrays I_A and I_B are not used.
+*
+* c/ a complex sparse (it = 1)
+*
+* ptr : work array of size max(A_n,B_m)+1
+* p : work arrays of size (nel)
+* ij: work array of size (2,nel)
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer A_m, A_n, A_mnel(*), A_icol(*)
+ integer B_m, B_n, B_mnel(*), B_icol(*)
+ integer nel, it, ij(2,*), ptr(*), p(*)
+ double precision A_R(*), A_I(*), B_R(*), B_I(*)
+
+* internal vars
+ integer i,j, k, l, ka, kb, num
+
+* 1/ stack the matrix indices by column order
+ call iset(A_n+1, 0, ptr, 1)
+ do k = 1, nel
+ j = A_icol(k)
+ ptr(j+1) = ptr(j+1) + 1
+ enddo
+ ptr(1) = 1
+ do j = 2, A_n
+ ptr(j) = ptr(j) + ptr(j-1)
+ enddo
+
+ ka = 0
+ do i = 1, A_m
+ do l = 1, A_mnel(i)
+ ka = ka + 1
+ j = A_icol(ka)
+ k = ptr(j)
+ ij(1,k) = i
+ ij(2,k) = j
+ p(k) = ka
+ ptr(j) = ptr(j) + 1
+ enddo
+ enddo
+
+* 2/ applies the reshaping onto the indices and computes B_mnel
+ call iset(B_m, 0, B_mnel, 1) ! init B_mnel to 0
+ do k = 1, nel
+ num = ij(1,k) + (ij(2,k)-1)*A_m - 1
+ ij(2,k) = num/B_m + 1
+ ij(1,k) = num+1 - B_m*(ij(2,k)-1)
+ B_mnel(ij(1,k)) = B_mnel(ij(1,k)) + 1
+ enddo
+
+* 3/ computes the others parts of B
+ call sz2ptr(B_mnel, B_m, ptr)
+ do k = 1, nel
+ i = ij(1,k)
+ kb = ptr(i)
+ B_icol(kb) = ij(2,k)
+ if ( it .ge. 0 ) B_R(kb) = A_R(p(k))
+ if ( it .eq. 1 ) B_I(kb) = A_I(p(k))
+ ptr(i) = ptr(i) + 1
+ enddo
+
+ end
+
diff --git a/modules/sparse/src/fortran/spreshape.lo b/modules/sparse/src/fortran/spreshape.lo
new file mode 100755
index 000000000..ecb8181b8
--- /dev/null
+++ b/modules/sparse/src/fortran/spreshape.lo
@@ -0,0 +1,12 @@
+# src/fortran/spreshape.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spreshape.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spsort.f b/modules/sparse/src/fortran/spsort.f
new file mode 100755
index 000000000..42fd4ee31
--- /dev/null
+++ b/modules/sparse/src/fortran/spsort.f
@@ -0,0 +1,153 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine spsort(count,n,index)
+c!purpose
+c spsort sort 2 column integer array,maintaining an index array
+c
+c!calling sequence
+c subroutine spsort(count,n,index)
+c integer n,index(n)
+c integer count(n)
+c
+c count : 2 column array to be sorted
+c n :size of count and index
+c index : array containing on return index of sorted array
+c
+c!method
+c quick sort method is used
+c!restriction
+c n must be less than 2**(50/2) ! due to lengh of work space mark
+ dimension mark(50),index(n)
+ integer count(n,2),av(2),x(2)
+ integer spord
+ external spord
+c
+c set index array to original order .
+ do 10 i=1,n
+ index(i)=i
+ 10 continue
+c check that a trivial case has not been entered .
+ if(n.eq.1)goto 200
+ if(n.ge.1)go to 30
+ goto 200
+c 'm' is the length of segment which is short enough to enter
+c the final sorting routine. it may be easily changed.
+ 30 m=12
+c set up initial values.
+ la=2
+ is=1
+ if=n
+ do 190 mloop=1,n
+c if segment is short enough sort with final sorting routine .
+ ifka=if-is
+ if((ifka+1).gt.m)goto 70
+c********* final sorting ***
+c ( a simple bubble sort )
+ is1=is+1
+ do 60 j=is1,if
+ i=j
+ 40 continue
+ it=spord(count(i-1,1),count(i-1,2),count(i,1),count(i,2))
+ if(it.gt.0)goto 60
+ if(it.lt.0)goto 50
+ if(index(i-1).lt.index(i))goto 60
+ 50 av(1)=count(i-1,1)
+ av(2)=count(i-1,2)
+ count(i-1,1)=count(i,1)
+ count(i,1)=av(1)
+ count(i-1,2)=count(i,2)
+ count(i,2)=av(2)
+
+ int=index(i-1)
+ index(i-1)=index(i)
+ index(i)=int
+ i=i-1
+ if(i.gt.is)goto 40
+ 60 continue
+ la=la-2
+ goto 170
+c ******* quicksort ********
+c select the number in the central position in the segment as
+c the test number.replace it with the number from the segment's
+c highest address.
+ 70 iy=(is+if)/2
+ x(1)=count(iy,1)
+ x(2)=count(iy,2)
+ intest=index(iy)
+ count(iy,1)=count(if,1)
+ count(iy,2)=count(if,2)
+ index(iy)=index(if)
+c the markers 'i' and 'ifk' are used for the beginning and end
+c of the section not so far tested against the present value
+c of x .
+ k=1
+ ifk=if
+c we alternate between the outer loop that increases i and the
+c inner loop that reduces ifk, moving numbers and indices as
+c necessary, until they meet .
+ do 110 i=is,if
+ it=spord(x(1),x(2),count(i,1),count(i,2))
+ if(it.lt.0)goto 110
+ if(it.gt.0)goto 80
+ if(intest.gt.index(i))goto 110
+ 80 if(i.ge.ifk)goto 120
+ count(ifk,1)=count(i,1)
+ count(ifk,2)=count(i,2)
+ index(ifk)=index(i)
+ k1=k
+ do 100 k=k1,ifka
+ ifk=if-k
+ it=spord(count(ifk,1),count(ifk,2),x(1),x(2))
+ if(it.lt.0)goto 100
+ if(it.gt.0)goto 90
+ if(intest.le.index(ifk))goto 100
+ 90 if(i.ge.ifk)goto 130
+ count(i,1)=count(ifk,1)
+ count(i,2)=count(ifk,2)
+ index(i)=index(ifk)
+ go to 110
+ 100 continue
+ goto 120
+ 110 continue
+c return the test number to the position marked by the marker
+c which did not move last. it divides the initial segment into
+c 2 parts. any element in the first part is less than or equal
+c to any element in the second part, and they may now be sorted
+c independently .
+ 120 count(ifk,1)=x(1)
+ count(ifk,2)=x(2)
+ index(ifk)=intest
+ ip=ifk
+ goto 140
+ 130 count(i,1)=x(1)
+ count(i,2)=x(2)
+ index(i)=intest
+ ip=i
+c store the longer subdivision in workspace.
+ 140 if((ip-is).gt.(if-ip))goto 150
+ mark(la)=if
+ mark(la-1)=ip+1
+ if=ip-1
+ goto 160
+ 150 mark(la)=ip-1
+ mark(la-1)=is
+ is=ip+1
+c find the length of the shorter subdivision.
+ 160 lngth=if-is
+ if(lngth.le.0)goto 180
+c if it contains more than one element supply it with workspace .
+ la=la+2
+ goto 190
+ 170 if(la.le.0)goto 200
+c obtain the address of the shortest segment awaiting quicksort
+ 180 if=mark(la)
+ is=mark(la-1)
+ 190 continue
+ 200 return
+ end
diff --git a/modules/sparse/src/fortran/spsort.lo b/modules/sparse/src/fortran/spsort.lo
new file mode 100755
index 000000000..38949782a
--- /dev/null
+++ b/modules/sparse/src/fortran/spsort.lo
@@ -0,0 +1,12 @@
+# src/fortran/spsort.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spsort.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/spt.f b/modules/sparse/src/fortran/spt.f
new file mode 100755
index 000000000..a4720b30e
--- /dev/null
+++ b/modules/sparse/src/fortran/spt.f
@@ -0,0 +1,63 @@
+ subroutine spt(m, n, nel, it, ptr,
+ $ A_R, A_I, A_mnel, A_icol,
+ $ At_R, At_I, At_mnel, At_icol)
+*
+* PURPOSE T
+* transpose a sparse (scilab) matrix : At = A
+*
+* PARAMETERS
+* inputs
+* m : number of rows of A
+* n : number of columns of A
+* nel : integer, number of non-nul elements of A
+* it : -1 for a sparse boolean, 0 a sparse real and 1 for a complex sparse
+* A_R : double float array (1..nel), values of the non nul elements
+* stored row by row with increasing column indices within a row
+* A_I : the same for complex values (case it =1)
+* A_icol : integer array (1..nel), columns indices : A_icol(k)
+* is column indice of the element stored in A_R(k)
+* A_mnel : integer array (1..n) A_mnel(i) is the number of non
+* nul elements of row i
+*
+* outputs
+* At_R, At_I, At_icol, At_mnel : the same for the transposed matrix
+*
+* work array : ptr of size n
+*
+* AUTHOR
+* Bruno Pincon
+*
+ implicit none
+ integer m, n, nel, it, ptr(*)
+ integer A_icol(nel), A_mnel(m), At_icol(nel), At_mnel(n)
+ double precision A_R(nel), A_I(nel), At_R(nel), At_I(nel)
+
+ integer i, j, ka, kb, l
+
+* compute At_mnel (At_mnel(i) = number of non nul elements of row i of At)
+ call iset(n, 0, At_mnel, 1) ! init At_mnel with 0
+ do ka = 1, nel
+ j = A_icol(ka)
+ At_mnel(j) = At_mnel(j) + 1
+ enddo
+
+* now compute ptr(i) such that it is the index in At_icol
+* (and At_R and At_I) of the first non nul element of row i of At
+ call sz2ptr(At_mnel, n-1, ptr)
+
+* now transpose
+ ka = 0
+ do i = 1, m
+ do l = 1, A_mnel(i)
+ ka = ka + 1
+ j = A_icol(ka)
+ kb = ptr(j)
+ At_icol(kb) = i
+ if ( it .ge. 0 ) At_R(kb) = A_R(ka)
+ if ( it .eq. 1 ) At_I(kb) = A_I(ka)
+ ptr(j) = ptr(j) + 1
+ enddo
+ enddo
+
+ end
+
diff --git a/modules/sparse/src/fortran/spt.lo b/modules/sparse/src/fortran/spt.lo
new file mode 100755
index 000000000..853610047
--- /dev/null
+++ b/modules/sparse/src/fortran/spt.lo
@@ -0,0 +1,12 @@
+# src/fortran/spt.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/spt.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/sputil.f b/modules/sparse/src/fortran/sputil.f
new file mode 100755
index 000000000..aab37a20a
--- /dev/null
+++ b/modules/sparse/src/fortran/sputil.f
@@ -0,0 +1,735 @@
+* this file contains some utility routines for some sparse
+* operations (extraction / insertion)
+*
+* I will comment a little more in the future
+* (bruno december 2004)
+*
+
+ subroutine set_perm_id(p, n)
+ implicit none
+ integer p(*), n
+ integer i
+ do i = 1, n
+ p(i) = i
+ enddo
+ end ! subroutine set_perm_id
+
+
+ subroutine insert_row(ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ j, p, nj, ib, B_m, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+
+* ka, kc : pointent sur les debuts de ligne de A et C
+
+ implicit none
+ integer ka, A_it, A_mnel, A_icol(*), kc, C_it, C_mnel, C_icol(*),
+ $ j(*), p(*), nj, ib, nelmax, ierr, B_m, B_it
+ logical B_is_scalar
+ double precision A_R(*), A_i(*), C_R(*), C_I(*),
+ $ B_R(B_m,*), B_I(B_m,*)
+
+* local vars
+ integer j1, j2, jp, k, kamax
+ double precision Bij_R, Bij_I
+* external functions and subroutines
+ external insert_j1j2
+
+ if (B_is_scalar) then
+ Bij_R = B_R(1,1)
+ if (B_it .eq. 1) Bij_I = B_I(1,1)
+ endif
+
+* indice max pour la ligne de A
+ kamax = ka + A_mnel - 1
+ j1 = 1
+
+ k = 1
+* loop on k from 1 to nj but some values must be skiped
+ 100 jp = j(p(k))
+ if ( k .lt. nj ) then
+ if ( j(p(k+1)) .eq. jp ) then
+ k = k+1
+ goto 100
+ endif
+ endif
+
+ j2 = jp - 1
+ call insert_j1j2(j1, j2, A_it, A_icol, A_R, A_I, ka,
+ $ kamax, C_it, C_mnel, C_icol, C_R, C_I, kc,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+
+ ! insertion de B ...
+ if (kc .gt. nelmax) then ! test if there is enough memory
+ ierr = -1
+ return
+ endif
+
+ if ( .not. B_is_scalar ) then
+ Bij_R = B_R(ib,p(k))
+ if (B_it .eq. 1) Bij_I = B_I(ib,p(k))
+ endif
+
+ if (C_it .eq. 0) then ! real case
+ if ( Bij_R .ne. 0 ) then
+ C_icol(kc) = jp
+ C_mnel = C_mnel + 1
+ C_R(kc) = Bij_R
+ kc = kc + 1
+ endif
+
+ elseif (B_it .eq. 0) then ! complex case but B is real
+ if ( Bij_R .ne. 0.d0 ) then
+ C_R(kc) = Bij_R
+ C_I(kc) = 0.d0
+ C_icol(kc) = jp
+ C_mnel = C_mnel + 1
+ kc = kc + 1
+ endif
+
+ else ! complex case , B complex
+ if ( Bij_R.ne.0.d0 .or. Bij_I.ne.0.d0 ) then
+ C_R(kc) = Bij_R
+ C_I(kc) = Bij_I
+ C_icol(kc) = jp
+ C_mnel = C_mnel + 1
+ kc = kc + 1
+ endif
+ endif
+
+ j1 = jp + 1
+ k = k + 1
+ if (k .le. nj) goto 100
+* endloop on k
+
+ j2 = A_icol(kamax)
+ call insert_j1j2(j1, j2, A_it, A_icol, A_R, A_I, ka,
+ $ kamax, C_it, C_mnel, C_icol, C_R, C_I, kc,
+ $ nelmax, ierr)
+
+ end ! subroutine insert_row
+
+
+ subroutine copy_sprow(i1,i2, ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ nelmax, ierr)
+*
+* recopie les lignes i1 à i2 de A sur C
+*
+ implicit none
+ integer i1, i2, ka, A_it, A_mnel(*), A_icol(*),
+ $ kc, C_it, C_mnel(*), C_icol(*),
+ $ nelmax, ierr
+ double precision A_R(*), A_I(*), C_R(*), C_I(*)
+
+* local vars
+ integer nbe, i, n
+* external functions and subroutines
+ external icopy, unsfdcopy
+
+ if (i1 .gt. i2) return ! a mettre au niveau de l'appelant ?
+
+ nbe = 0
+ do i = i1, i2
+ nbe = nbe + A_mnel(i)
+ enddo
+ if (kc + nbe .gt. nelmax) then
+ ierr = -1
+ return
+ endif
+
+ n = i2 - i1 + 1
+ call icopy(n, A_mnel(i1), 1, C_mnel(i1), 1)
+ call icopy(nbe, A_icol(ka), 1, C_icol(kc), 1)
+ if (C_it .ge. 0) then
+ call unsfdcopy(nbe, A_R(ka), 1, C_R(kc), 1)
+ if (C_it .eq. 1) then ! C is complex
+ if (A_it .eq. 1) then ! A is complex
+ call unsfdcopy(nbe, A_I(ka), 1, C_I(kc), 1)
+ else ! A is real
+ call dset(nbe, 0.d0, C_I(kc), 1)
+ endif
+ endif
+ endif
+
+ ! mise à jour de ka et kc
+ ka = ka + nbe
+ kc = kc + nbe
+
+ end ! subroutine copy_sprow
+
+
+ subroutine insert_j1j2(j1, j2, A_it, A_icol, A_R, A_I, ka, kamax,
+ $ C_it, C_mnel, C_icol, C_R, C_I, kc,
+ $ nelmax, ierr)
+*
+* insere les coefs de la ligne A dans C dont les indices de
+* colonnes sont compris entre j1 et j2
+
+ implicit none
+ integer j1, j2, A_it, A_icol(*), ka, kamax, C_it, C_mnel,
+ $ C_icol(*), kc, nelmax, ierr
+ double precision A_R(*), A_I(*), C_R(*), C_I(*)
+
+* local var
+ integer j
+
+ if ( ka .gt. kamax ) return
+
+* goto the first element with column index >= j1
+ do while ( A_icol(ka) .lt. j1 )
+ ka = ka + 1
+ if (ka .gt. kamax) return
+ enddo
+
+ j = A_icol(ka)
+ do while (j .le. j2) ! add a new element to C
+ if (kc .gt. nelmax) then ! but test if there is enough memory before
+ ierr = -1
+ return
+ endif
+ C_icol(kc) = j
+ C_R(kc) = A_R(ka)
+ if ( C_it .eq. 1 ) then ! C is complex
+ if ( A_it .eq. 0 ) then ! A is real
+ C_I(kc) = 0.d0
+ else ! A is complex
+ C_I(kc) = A_I(ka)
+ endif
+ endif
+ kc = kc + 1 ! number of the next element of C
+ C_mnel = C_mnel + 1 ! increment the number of nnz of the row for C
+ ka = ka + 1
+ if ( ka .gt. kamax ) return
+ j = A_icol(ka)
+ enddo
+
+ end ! subroutine insert_j1j2
+
+
+ subroutine copy_fullrow2sprow(i, kc, C_it, C_mnel, C_icol, C_R,
+ $ C_I, B_m, B_n, B_it, B_R, B_I,
+ $ B_is_scalar, nelmax, ierr)
+ implicit none
+ integer i, kc, C_it, C_mnel, C_icol(*), B_m, B_n, B_it, nelmax,
+ $ ierr
+ logical B_is_scalar
+ double precision C_R(*), C_I(*), B_R(B_m,*), B_I(B_m,*)
+ integer j
+ double precision Bij_R, Bij_I
+
+ if (B_is_scalar) then
+ Bij_R = B_R(1,1)
+ if (B_it .eq. 1) Bij_I = B_I(1,1)
+ endif
+
+ do j = 1, B_n
+
+ if (kc .gt. nelmax) then ! test if enough memory
+ ierr = -1
+ return
+ endif
+
+ if ( .not. B_is_scalar ) then
+ Bij_R = B_R(i,j)
+ if (B_it .eq. 1) Bij_I = B_I(i,j)
+ endif
+
+ if (C_it .eq. 0) then ! real case (ie A and B are real)
+ if ( Bij_R .ne. 0.d0 ) then
+ C_icol(kc) = j
+ C_R(kc) = Bij_R
+ C_mnel = C_mnel + 1
+ kc = kc + 1
+ endif
+
+ else ! C_it = 1 this is the complex case (but B may be real or complex)
+ if (B_it .eq. 0) then ! B is real
+ if ( Bij_R .ne. 0.d0 ) then
+ C_icol(kc) = j
+ C_R(kc) = Bij_R
+ C_I(kc) = 0.d0
+ C_mnel = C_mnel + 1
+ kc = kc + 1
+ endif
+ else ! B is complex
+ if ( Bij_R.ne.0.d0 .or. Bij_I.ne.0.d0 ) then
+ C_icol(kc) = j
+ C_R(kc) = Bij_R
+ C_I(kc) = Bij_I
+ C_mnel = C_mnel + 1
+ kc = kc + 1
+ endif
+ endif
+ endif
+
+ enddo
+
+ end ! subroutine copy_fullrow2sprow
+
+ subroutine isorti(ix, p, n)
+
+ implicit none
+ integer n, ix(n), p(n)
+
+ integer i, j, pivot, temp
+ call set_perm_id(p, n)
+
+ do i = 2, n
+ pivot = ix(p(i))
+ temp = p(i)
+ j = i-1
+ 10 continue
+ if ( ix(p(j)) .gt. pivot ) then
+ p(j+1) = p(j)
+ j = j-1
+ if ( j .ge. 1 ) goto 10
+ endif
+ p(j+1) = temp
+ enddo
+
+ end ! subroutine isorti
+
+
+ integer function dicho_search(jj, val, n)
+*
+* PURPOSE
+* val(1..n) being a increasing array, this
+* routines by the mean of a dichotomic search computes
+* the smallest indice of jj in val, ie the smallest
+* integer k such that val(k) = jj or return 0 if jj
+* is not in val.
+*
+* EXAMPLE
+* if val = [1 4 5 5 8 8 12] we must
+* get k = 3 if jj = 5
+* k = 5 if jj = 8
+* k = 0 if jj = 3
+* etc...
+*
+* code brings by Bruno to speed up sparse extraction
+
+ implicit none
+ integer jj, n, val(n)
+
+ integer k, k1, k2
+
+ if ( n .lt. 1 ) then ! void search array
+ dicho_search = 0
+ return
+ endif
+
+ if ( val(1) .le. jj .and. jj .le. val(n) ) then
+* find k such that jj = val(k) by a dicho search
+ k1 = 1
+ k2 = n
+ do while ( k2 - k1 .gt. 1 )
+ k = (k1 + k2)/2
+ if ( jj .le. val(k) ) then
+ k2 = k
+ else
+ k1 = k
+ endif
+ enddo
+* here we know that val(k1) <= jj <= val(k2) with k2 = k1 + 1
+ if (jj .eq. val(k1)) then
+ dicho_search = k1
+ else if (jj .eq. val(k2)) then
+ dicho_search = k2
+ else
+ dicho_search = 0
+ endif
+ else
+ dicho_search = 0
+ endif
+
+ end
+
+ integer function dicho_search_bis(jj, val, p, n)
+*
+* PURPOSE
+* same operation than the previus function but here
+* the array val is in increasing order through the
+* the permutation p, ie we have :
+* val(p(1)) <= val(p(2)) <= ... <= val(p(n))
+*
+* code brings by Bruno to speed up sparse extraction
+
+ implicit none
+ integer jj, n, val(n), p(n)
+
+ integer k, k1, k2
+
+ if ( n .lt. 1 ) then ! void search array
+ dicho_search_bis = 0
+ return
+ endif
+
+ if ( val(p(1)) .le. jj .and. jj .le. val(p(n)) ) then
+* find the smallest k such that jj = val(p(k)) by a dicho search
+ k1 = 1
+ k2 = n
+ do while ( k2 - k1 .gt. 1 )
+ k = (k1 + k2)/2
+ if ( jj .le. val(p(k)) ) then
+ k2 = k
+ else
+ k1 = k
+ endif
+ enddo
+* here we know that val(p(k1)) <= jj <= val(p(k2)) with k2 = k1 + 1
+ if (jj .eq. val(p(k1))) then
+ dicho_search_bis = k1
+ else if (jj .eq. val(p(k2))) then
+ dicho_search_bis = k2
+ else
+ dicho_search_bis = 0
+ endif
+ else
+ dicho_search_bis = 0
+ endif
+
+ end
+
+ logical function is_in_order(val, n)
+*
+* PURPOSE
+* test if the array val(1..n) is in increasing order
+*
+* code brings by Bruno to speed up sparse extraction
+*
+ implicit none
+ integer n, val(n), i
+
+ is_in_order = .true.
+
+ do i = 2, n
+ if ( val(i) .lt. val(i-1) ) then
+ is_in_order = .false.
+ return
+ endif
+ enddo
+
+ end
+
+
+ subroutine insert_in_order(icol, kleft, kright, ind, it, B_R, B_I,
+ $ val_re, val_im)
+*
+* expliquer ....
+*
+ implicit none
+ integer icol(*), kleft, kright, ind, it
+ double precision B_R(*), B_I(*), val_re, val_im
+
+ integer k
+
+ k = kright
+ if (k .gt. kleft) then ! a caution due to the fortran evaluation of .and.
+ do while (k .gt. kleft .and. icol(k-1) .gt. ind)
+ icol(k) = icol(k-1)
+ if (it .ge. 0) B_R(k) = B_R(k-1)
+ if (it .eq. 1) B_I(k) = B_I(k-1)
+ k = k-1
+ enddo
+ endif
+ icol(k) = ind
+ if (it .ge. 0) B_R(k) = val_re
+ if (it .eq. 1) B_I(k) = val_im
+
+ end
+
+
+**********************************************************************
+*
+* subroutine added by Bruno (Feb 20 2006 to speed up the
+* sparse(i,j) = sparse insertion
+*
+ subroutine insert_sprow(ka, A_it, A_mnel, A_icol, A_R, A_I,
+ $ kb, B_it, B_mnel, B_icol, B_R, B_I,
+ $ kc, C_it, C_mnel, C_icol, C_R, C_I,
+ $ j, p, nj, nelmax, ierr)
+
+* ka, kb, kc : pointent sur les debuts de ligne de A, B et C
+* kb is not modified
+* ka is equal to kamax+1 on output (indice pointer on the next row of A)
+* kc is modified (on output it is the index of the future next element of C)
+*
+ implicit none
+ integer ka, A_it, A_mnel, A_icol(*),
+ $ kb, B_it, B_mnel, B_icol(*),
+ $ kc, C_it, C_mnel, C_icol(*),
+ $ j(*), p(*), nj, nelmax, ierr
+ double precision A_R(*), A_i(*), B_R(*), B_I(*), C_R(*), C_I(*)
+
+* local vars
+ integer j1, j2, jp, k, kamax, num
+* external functions and subroutines
+ external dicho_search
+ integer dicho_search
+ external insert_j1j2
+
+* indice max pour la ligne de A
+ kamax = ka + A_mnel - 1
+ j1 = 1
+
+ k = 1
+* loop on k from 1 to nj but some values must be skiped
+ 100 jp = j(p(k))
+ if ( k .lt. nj ) then
+ if ( j(p(k+1)) .eq. jp ) then
+ k = k+1
+ goto 100
+ endif
+ endif
+
+ j2 = jp - 1
+ if ( j1 .le. j2 ) then
+ call insert_j1j2(j1, j2, A_it, A_icol, A_R, A_I, ka,
+ $ kamax, C_it, C_mnel, C_icol, C_R, C_I, kc,
+ $ nelmax, ierr)
+ if (ierr .ne. 0) return
+ endif
+
+ ! insertion de B (ib, p(k))
+ num = dicho_search(p(k), B_icol(kb), B_mnel)
+ if ( num .ne. 0 ) then ! B(ib,p(k)) is not zero insert it in C
+ num = kb + num - 1
+ if (kc .gt. nelmax) then ! test if there is enough memory
+ ierr = -1
+ return
+ endif
+
+ C_icol(kc) = jp
+ C_mnel = C_mnel + 1
+ C_R(kc) = B_R(num)
+
+ if ( C_it .eq. 1 ) then ! C is complex
+ if (B_it .eq. 0) then ! but B is real
+ C_I(kc) = 0.d0
+ else ! complex case , B complex
+ C_I(kc) = B_I(num)
+ endif
+ endif
+ kc = kc + 1
+ endif
+
+ j1 = jp + 1
+ k = k + 1
+ if (k .le. nj) goto 100
+* endloop on k
+
+ j2 = A_icol(kamax)
+ if ( j1 .le. j2 ) then
+ call insert_j1j2(j1, j2, A_it, A_icol, A_R, A_I, ka,
+ $ kamax, C_it, C_mnel, C_icol, C_R, C_I, kc,
+ $ nelmax, ierr)
+ endif
+
+ ka = kamax + 1
+
+ end ! subroutine insert_sprow
+
+
+
+ SUBROUTINE QSORTI (X, IND, N)
+ INTEGER N, X(N), IND(N)
+C
+C***********************************************************
+C
+C ROBERT RENKA
+C OAK RIDGE NATL. LAB.
+C
+C THIS SUBROUTINE USES AN ORDER N*LOG(N) QUICK SORT TO
+C SORT AN INTEGER ARRAY X INTO INCREASING ORDER. THE ALGOR-
+C ITHM IS AS FOLLOWS. IND IS INITIALIZED TO THE ORDERED
+C SEQUENCE OF INDICES 1,...,N, AND ALL INTERCHANGES ARE
+C APPLIED TO IND. X IS DIVIDED INTO TWO PORTIONS BY PICKING
+C A CENTRAL ELEMENT T. THE FIRST AND LAST ELEMENTS ARE COM-
+C PARED WITH T, AND INTERCHANGES ARE APPLIED AS NECESSARY SO
+C THAT THE THREE VALUES ARE IN ASCENDING ORDER. INTER-
+C CHANGES ARE THEN APPLIED SO THAT ALL ELEMENTS GREATER THAN
+C T ARE IN THE UPPER PORTION OF THE ARRAY AND ALL ELEMENTS
+C LESS THAN T ARE IN THE LOWER PORTION. THE UPPER AND LOWER
+C INDICES OF ONE OF THE PORTIONS ARE SAVED IN LOCAL ARRAYS,
+C AND THE PROCESS IS REPEATED ITERATIVELY ON THE OTHER
+C PORTION. WHEN A PORTION IS COMPLETELY SORTED, THE PROCESS
+C BEGINS AGAIN BY RETRIEVING THE INDICES BOUNDING ANOTHER
+C UNSORTED PORTION.
+C
+C INPUT PARAMETERS - N - LENGTH OF THE ARRAY X.
+C
+C X - VECTOR OF LENGTH N TO BE SORTED.
+C
+C IND - VECTOR OF LENGTH .GE. N.
+C
+C N AND X ARE NOT ALTERED BY THIS ROUTINE.
+C
+C OUTPUT PARAMETER - IND - SEQUENCE OF INDICES 1,...,N
+C PERMUTED IN THE SAME FASHION AS X
+C WOULD BE. THUS, THE ORDERING ON
+C X IS DEFINED BY Y(I) = X(IND(I)).
+C
+C INTRINSIC FUNCTIONS CALLED BY QSORTI - IFIX, FLOAT
+C
+C***********************************************************
+C
+C NOTE -- IU AND IL MUST BE DIMENSIONED .GE. LOG(N) WHERE
+C LOG HAS BASE 2.
+C
+C***********************************************************
+C
+ INTEGER IU(21), IL(21)
+ INTEGER M, I, J, K, L, IJ, IT, ITT, INDX, T
+ REAL R
+C
+C LOCAL PARAMETERS -
+C
+C IU,IL = TEMPORARY STORAGE FOR THE UPPER AND LOWER
+C INDICES OF PORTIONS OF THE ARRAY X
+C M = INDEX FOR IU AND IL
+C I,J = LOWER AND UPPER INDICES OF A PORTION OF X
+C K,L = INDICES IN THE RANGE I,...,J
+C IJ = RANDOMLY CHOSEN INDEX BETWEEN I AND J
+C IT,ITT = TEMPORARY STORAGE FOR INTERCHANGES IN IND
+C INDX = TEMPORARY INDEX FOR X
+C R = PSEUDO RANDOM NUMBER FOR GENERATING IJ
+C T = CENTRAL ELEMENT OF X
+C
+ IF (N .LE. 0) RETURN
+C
+C INITIALIZE IND, M, I, J, AND R
+C
+ DO 1 I = 1,N
+ 1 IND(I) = I
+ M = 1
+ I = 1
+ J = N
+ R = .375
+C
+C TOP OF LOOP
+C
+ 2 IF (I .GE. J) GO TO 10
+ IF (R .GT. .5898437) GO TO 3
+ R = R + .0390625
+ GO TO 4
+ 3 R = R - .21875
+C
+C INITIALIZE K
+C
+ 4 K = I
+C
+C SELECT A CENTRAL ELEMENT OF X AND SAVE IT IN T
+C
+ IJ = I + IFIX(R*FLOAT(J-I))
+ IT = IND(IJ)
+ T = X(IT)
+C
+C IF THE FIRST ELEMENT OF THE ARRAY IS GREATER THAN T,
+C INTERCHANGE IT WITH T
+C
+ INDX = IND(I)
+ IF (X(INDX) .LE. T) GO TO 5
+ IND(IJ) = INDX
+ IND(I) = IT
+ IT = INDX
+ T = X(IT)
+C
+C INITIALIZE L
+C
+ 5 L = J
+C
+C IF THE LAST ELEMENT OF THE ARRAY IS LESS THAN T,
+C INTERCHANGE IT WITH T
+C
+ INDX = IND(J)
+ IF (X(INDX) .GE. T) GO TO 7
+ IND(IJ) = INDX
+ IND(J) = IT
+ IT = INDX
+ T = X(IT)
+C
+C IF THE FIRST ELEMENT OF THE ARRAY IS GREATER THAN T,
+C INTERCHANGE IT WITH T
+C
+ INDX = IND(I)
+ IF (X(INDX) .LE. T) GO TO 7
+ IND(IJ) = INDX
+ IND(I) = IT
+ IT = INDX
+ T = X(IT)
+ GO TO 7
+C
+C INTERCHANGE ELEMENTS K AND L
+C
+ 6 ITT = IND(L)
+ IND(L) = IND(K)
+ IND(K) = ITT
+C
+C FIND AN ELEMENT IN THE UPPER PART OF THE ARRAY WHICH IS
+C NOT LARGER THAN T
+C
+ 7 L = L - 1
+ INDX = IND(L)
+ IF (X(INDX) .GT. T) GO TO 7
+C
+C FIND AN ELEMENT IN THE LOWER PART OF THE ARRAY WHCIH IS
+C NOT SMALLER THAN T
+C
+ 8 K = K + 1
+ INDX = IND(K)
+ IF (X(INDX) .LT. T) GO TO 8
+C
+C IF K .LE. L, INTERCHANGE ELEMENTS K AND L
+C
+ IF (K .LE. L) GO TO 6
+C
+C SAVE THE UPPER AND LOWER SUBSCRIPTS OF THE PORTION OF THE
+C ARRAY YET TO BE SORTED
+C
+ IF (L-I .LE. J-K) GO TO 9
+ IL(M) = I
+ IU(M) = L
+ I = K
+ M = M + 1
+ GO TO 11
+C
+ 9 IL(M) = K
+ IU(M) = J
+ J = L
+ M = M + 1
+ GO TO 11
+C
+C BEGIN AGAIN ON ANOTHER UNSORTED PORTION OF THE ARRAY
+C
+ 10 M = M - 1
+ IF (M .EQ. 0) RETURN
+ I = IL(M)
+ J = IU(M)
+C
+ 11 IF (J-I .GE. 11) GO TO 4
+ IF (I .EQ. 1) GO TO 2
+ I = I - 1
+C
+C SORT ELEMENTS I+1,...,J. NOTE THAT 1 .LE. I .LT. J AND
+C J-I .LT. 11.
+C
+ 12 I = I + 1
+ IF (I .EQ. J) GO TO 10
+ INDX = IND(I+1)
+ T = X(INDX)
+ IT = INDX
+ INDX = IND(I)
+ IF (X(INDX) .LE. T) GO TO 12
+ K = I
+C
+ 13 IND(K+1) = IND(K)
+ K = K - 1
+ INDX = IND(K)
+ IF (T .LT. X(INDX)) GO TO 13
+ IND(K+1) = IT
+ GO TO 12
+ END
+
+
diff --git a/modules/sparse/src/fortran/sputil.lo b/modules/sparse/src/fortran/sputil.lo
new file mode 100755
index 000000000..7f77e6e58
--- /dev/null
+++ b/modules/sparse/src/fortran/sputil.lo
@@ -0,0 +1,12 @@
+# src/fortran/sputil.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sputil.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/symfct.f b/modules/sparse/src/fortran/symfct.f
new file mode 100755
index 000000000..60a05e0f8
--- /dev/null
+++ b/modules/sparse/src/fortran/symfct.f
@@ -0,0 +1,1911 @@
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: January 12, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************** SFINIT ..... SET UP FOR SYMB. FACT. ************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE COMPUTES THE STORAGE REQUIREMENTS AND SETS UP
+C PRELIMINARY DATA STRUCTURES FOR THE SYMBOLIC FACTORIZATION.
+C
+C NOTE:
+C THIS VERSION PRODUCES THE MAXIMAL SUPERNODE PARTITION (I.E.,
+C THE ONE WITH THE FEWEST POSSIBLE SUPERNODES).
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C NNZA - LENGTH OF ADJACENCY STRUCTURE.
+C XADJ(*) - ARRAY OF LENGTH NEQNS+1, CONTAINING POINTERS
+C TO THE ADJACENCY STRUCTURE.
+C ADJNCY(*) - ARRAY OF LENGTH XADJ(NEQNS+1)-1, CONTAINING
+C THE ADJACENCY STRUCTURE.
+C PERM(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C POSTORDERING.
+C INVP(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C INVERSE OF THE POSTORDERING.
+C IWSIZ - SIZE OF INTEGER WORKING STORAGE.
+C
+C OUTPUT PARAMETERS:
+C COLCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE NUMBER
+C OF NONZEROS IN EACH COLUMN OF THE FACTOR,
+C INCLUDING THE DIAGONAL ENTRY.
+C NNZL - NUMBER OF NONZEROS IN THE FACTOR, INCLUDING
+C THE DIAGONAL ENTRIES.
+C NSUB - NUMBER OF SUBSCRIPTS.
+C NSUPER - NUMBER OF SUPERNODES (<= NEQNS).
+C SNODE(*) - ARRAY OF LENGTH NEQNS FOR RECORDING
+C SUPERNODE MEMBERSHIP.
+C XSUPER(*) - ARRAY OF LENGTH NEQNS+1, CONTAINING THE
+C SUPERNODE PARTITIONING.
+C IFLAG(*) - ERROR FLAG.
+C 0: SUCCESSFUL SF INITIALIZATION.
+C -1: INSUFFICENT WORKING STORAGE
+C [IWORK(*)].
+C
+C WORK PARAMETERS:
+C IWORK(*) - INTEGER WORK ARRAY OF LENGTH 7*NEQNS+3.
+C
+C FIRST CREATED ON NOVEMEBER 14, 1994.
+C LAST UPDATED ON January 12, 1995.
+C
+C***********************************************************************
+C
+ SUBROUTINE SFINIT ( NEQNS , NNZA , XADJ , ADJNCY, PERM ,
+ & INVP , COLCNT, NNZL , NSUB , NSUPER,
+ & SNODE , XSUPER, IWSIZ , IWORK , IFLAG )
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER IFLAG , IWSIZ , NNZA , NEQNS , NNZL ,
+ & NSUB , NSUPER
+ INTEGER ADJNCY(NNZA) , COLCNT(NEQNS) ,
+ & INVP(NEQNS) , IWORK(7*NEQNS+3),
+ & PERM(NEQNS) , SNODE(NEQNS) ,
+ & XADJ(NEQNS+1) , XSUPER(NEQNS+1)
+C
+C***********************************************************************
+C
+C --------------------------------------------------------
+C RETURN IF THERE IS INSUFFICIENT INTEGER WORKING STORAGE.
+C --------------------------------------------------------
+ IFLAG = 0
+ IF ( IWSIZ .LT. 7*NEQNS+3 ) THEN
+ IFLAG = -1
+ RETURN
+ ENDIF
+C
+C ------------------------------------------
+C COMPUTE ELIMINATION TREE AND POSTORDERING.
+C ------------------------------------------
+ CALL ETORDR ( NEQNS , XADJ , ADJNCY, PERM , INVP ,
+ & IWORK(1) ,
+ & IWORK(NEQNS+1) ,
+ & IWORK(2*NEQNS+1) ,
+ & IWORK(3*NEQNS+1) )
+C
+C ---------------------------------------------
+C COMPUTE ROW AND COLUMN FACTOR NONZERO COUNTS.
+C ---------------------------------------------
+ CALL FCNTHN ( NEQNS , NNZA , XADJ , ADJNCY, PERM ,
+ & INVP , IWORK(1) , SNODE , COLCNT,
+ & NNZL ,
+ & IWORK(NEQNS+1) ,
+ & IWORK(2*NEQNS+1) ,
+ & XSUPER ,
+ & IWORK(3*NEQNS+1) ,
+ & IWORK(4*NEQNS+2) ,
+ & IWORK(5*NEQNS+3) ,
+ & IWORK(6*NEQNS+4) )
+C
+C ---------------------------------------------------------
+C REARRANGE CHILDREN SO THAT THE LAST CHILD HAS THE MAXIMUM
+C NUMBER OF NONZEROS IN ITS COLUMN OF L.
+C ---------------------------------------------------------
+ CALL CHORDR ( NEQNS , XADJ , ADJNCY, PERM , INVP ,
+ & COLCNT,
+ & IWORK(1) ,
+ & IWORK(NEQNS+1) ,
+ & IWORK(2*NEQNS+1) ,
+ & IWORK(3*NEQNS+1) )
+C
+C ----------------
+C FIND SUPERNODES.
+C ----------------
+ CALL FSUP1 ( NEQNS , IWORK(1) , COLCNT, NSUB ,
+ & NSUPER, SNODE )
+ CALL FSUP2 ( NEQNS , NSUPER, IWORK(1) , SNODE ,
+ & XSUPER )
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C********** ETORDR ..... ELIMINATION TREE REORDERING ***********
+C***********************************************************************
+C***********************************************************************
+C
+C WRITTEN BY JOSEPH LIU (JUL 17, 1985)
+C
+C PURPOSE:
+C TO DETERMINE AN EQUIVALENT REORDERING BASED ON THE STRUCTURE OF
+C THE ELIMINATION TREE. A POSTORDERING OF THE GIVEN ELIMINATION
+C TREE IS RETURNED.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE.
+C
+C UPDATED PARAMETERS:
+C (PERM,INVP) - ON INPUT, THE GIVEN PERM AND INVERSE PERM
+C VECTORS. ON OUTPUT, THE NEW PERM AND
+C INVERSE PERM VECTORS OF THE EQUIVALENT
+C ORDERING.
+C
+C OUTPUT PARAMETERS:
+C PARENT - THE PARENT VECTOR OF THE ELIMINATION TREE
+C ASSOCIATED WITH THE NEW ORDERING.
+C
+C WORKING PARAMETERS:
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHER VECTOR.
+C INVPOS - THE INVERSE PERM VECTOR FOR THE
+C POSTORDERING.
+C
+C PROGRAM SUBROUTINES:
+C BETREE, ETPOST, ETREE , INVINV.
+C
+C***********************************************************************
+C
+ SUBROUTINE ETORDR ( NEQNS , XADJ , ADJNCY, PERM , INVP ,
+ & PARENT, FSON , BROTHR, INVPOS )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(*) , BROTHR(*) ,
+ & FSON(*) , INVP(*) ,
+ & INVPOS(*) , PARENT(*) ,
+ & PERM(*)
+C
+ INTEGER XADJ(*)
+ INTEGER NEQNS
+C
+C***********************************************************************
+C
+C -----------------------------
+C COMPUTE THE ELIMINATION TREE.
+C -----------------------------
+ CALL ETREE ( NEQNS, XADJ, ADJNCY, PERM, INVP, PARENT, INVPOS )
+C
+C --------------------------------------------------------
+C COMPUTE A BINARY REPRESENTATION OF THE ELIMINATION TREE.
+C --------------------------------------------------------
+ CALL BETREE ( NEQNS, PARENT, FSON, BROTHR )
+C
+C -------------------------------
+C POSTORDER THE ELIMINATION TREE.
+C -------------------------------
+ CALL ETPOST ( NEQNS, FSON, BROTHR, INVPOS, PARENT, PERM )
+C
+C --------------------------------------------------------
+C COMPOSE THE ORIGINAL ORDERING WITH THE NEW POSTORDERING.
+C --------------------------------------------------------
+ CALL INVINV ( NEQNS, INVP, INVPOS, PERM )
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C**************** ETREE ..... ELIMINATION TREE *****************
+C***********************************************************************
+C***********************************************************************
+C
+C WRITTEN BY JOSEPH LIU (JUL 17, 1985)
+C
+C PURPOSE:
+C TO DETERMINE THE ELIMINATION TREE FROM A GIVEN ORDERING AND
+C THE ADJACENCY STRUCTURE. THE PARENT VECTOR IS RETURNED.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE.
+C (PERM,INVP) - PERMUTATION AND INVERSE PERMUTATION VECTORS
+C
+C OUTPUT PARAMETERS:
+C PARENT - THE PARENT VECTOR OF THE ELIMINATION TREE.
+C
+C WORKING PARAMETERS:
+C ANCSTR - THE ANCESTOR VECTOR.
+C
+C***********************************************************************
+C
+ SUBROUTINE ETREE ( NEQNS , XADJ , ADJNCY, PERM , INVP ,
+ & PARENT, ANCSTR )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(*) , ANCSTR(*) ,
+ & INVP(*) , PARENT(*) ,
+ & PERM(*)
+C
+ INTEGER NEQNS
+ INTEGER XADJ(*)
+C
+C***********************************************************************
+C
+ INTEGER I , J , JSTOP , JSTRT , NBR ,
+ & NEXT , NODE
+C
+C***********************************************************************
+C
+ IF ( NEQNS .LE. 0 ) RETURN
+C
+ DO 400 I = 1, NEQNS
+ PARENT(I) = 0
+ ANCSTR(I) = 0
+ NODE = PERM(I)
+C
+ JSTRT = XADJ(NODE)
+ JSTOP = XADJ(NODE+1) - 1
+ IF ( JSTRT .LE. JSTOP ) THEN
+ DO 300 J = JSTRT, JSTOP
+ NBR = ADJNCY(J)
+ NBR = INVP(NBR)
+ IF ( NBR .LT. I ) THEN
+C -------------------------------------------
+C FOR EACH NBR, FIND THE ROOT OF ITS CURRENT
+C ELIMINATION TREE. PERFORM PATH COMPRESSION
+C AS THE SUBTREE IS TRAVERSED.
+C -------------------------------------------
+ 100 CONTINUE
+ IF ( ANCSTR(NBR) .EQ. I ) GO TO 300
+ IF ( ANCSTR(NBR) .GT. 0 ) THEN
+ NEXT = ANCSTR(NBR)
+ ANCSTR(NBR) = I
+ NBR = NEXT
+ GO TO 100
+ ENDIF
+C --------------------------------------------
+C NOW, NBR IS THE ROOT OF THE SUBTREE. MAKE I
+C THE PARENT NODE OF THIS ROOT.
+C --------------------------------------------
+ PARENT(NBR) = I
+ ANCSTR(NBR) = I
+ ENDIF
+ 300 CONTINUE
+ ENDIF
+ 400 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** BETREE ..... BINARY TREE REPRESENTATION OF ETREE *******
+C***********************************************************************
+C***********************************************************************
+C
+C WRITTEN BY JOSEPH LIU (JUL 17, 1985)
+C
+C PURPOSE:
+C TO DETERMINE THE BINARY TREE REPRESENTATION OF THE ELIMINATION
+C TREE GIVEN BY THE PARENT VECTOR. THE RETURNED REPRESENTATION
+C WILL BE GIVEN BY THE FIRST-SON AND BROTHER VECTORS. THE ROOT
+C OF THE BINARY TREE IS ALWAYS NEQNS.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C PARENT - THE PARENT VECTOR OF THE ELIMINATION TREE.
+C IT IS ASSUMED THAT PARENT(I) > I EXCEPT OF
+C THE ROOTS.
+C
+C OUTPUT PARAMETERS:
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHER VECTOR.
+C
+C***********************************************************************
+C
+ SUBROUTINE BETREE ( NEQNS , PARENT, FSON , BROTHR )
+C
+C***********************************************************************
+C
+ INTEGER BROTHR(*) , FSON(*) ,
+ & PARENT(*)
+C
+ INTEGER NEQNS
+C
+C***********************************************************************
+C
+ INTEGER LROOT , NODE , NDPAR
+C
+C***********************************************************************
+C
+ IF ( NEQNS .LE. 0 ) RETURN
+C
+ DO 100 NODE = 1, NEQNS
+ FSON(NODE) = 0
+ BROTHR(NODE) = 0
+ 100 CONTINUE
+ LROOT = NEQNS
+C ------------------------------------------------------------
+C FOR EACH NODE := NEQNS-1 STEP -1 DOWNTO 1, DO THE FOLLOWING.
+C ------------------------------------------------------------
+ IF ( NEQNS .LE. 1 ) RETURN
+ DO 300 NODE = NEQNS-1, 1, -1
+ NDPAR = PARENT(NODE)
+ IF ( NDPAR .LE. 0 .OR. NDPAR .EQ. NODE ) THEN
+C -------------------------------------------------
+C NODE HAS NO PARENT. GIVEN STRUCTURE IS A FOREST.
+C SET NODE TO BE ONE OF THE ROOTS OF THE TREES.
+C -------------------------------------------------
+ BROTHR(LROOT) = NODE
+ LROOT = NODE
+ ELSE
+C -------------------------------------------
+C OTHERWISE, BECOMES FIRST SON OF ITS PARENT.
+C -------------------------------------------
+ BROTHR(NODE) = FSON(NDPAR)
+ FSON(NDPAR) = NODE
+ ENDIF
+ 300 CONTINUE
+ BROTHR(LROOT) = 0
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C*************** ETPOST ..... ETREE POSTORDERING ***************
+C***********************************************************************
+C***********************************************************************
+C
+C WRITTEN BY JOSEPH LIU (SEPT 17, 1986)
+C
+C PURPOSE:
+C BASED ON THE BINARY REPRESENTATION (FIRST-SON,BROTHER) OF
+C THE ELIMINATION TREE, A POSTORDERING IS DETERMINED. THE
+C CORRESPONDING PARENT VECTOR IS ALSO MODIFIED TO REFLECT
+C THE REORDERING.
+C
+C INPUT PARAMETERS:
+C ROOT - ROOT OF THE ELIMINATION TREE (USUALLY IT
+C IS NEQNS).
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHR VECTOR.
+C
+C UPDATED PARAMETERS:
+C PARENT - THE PARENT VECTOR.
+C
+C OUTPUT PARAMETERS:
+C INVPOS - INVERSE PERMUTATION FOR THE POSTORDERING.
+C
+C WORKING PARAMETERS:
+C STACK - THE STACK FOR POSTORDER TRAVERSAL OF THE
+C TREE.
+C
+C***********************************************************************
+C
+ SUBROUTINE ETPOST ( ROOT , FSON , BROTHR, INVPOS, PARENT,
+ & STACK )
+C
+C***********************************************************************
+C
+ INTEGER BROTHR(*) , FSON(*) ,
+ & INVPOS(*) , PARENT(*) ,
+ & STACK(*)
+C
+ INTEGER ROOT
+C
+C***********************************************************************
+C
+ INTEGER ITOP , NDPAR , NODE , NUM , NUNODE
+C
+C***********************************************************************
+C
+ NUM = 0
+ ITOP = 0
+ NODE = ROOT
+C -------------------------------------------------------------
+C TRAVERSE ALONG THE FIRST SONS POINTER AND PUSH THE TREE NODES
+C ALONG THE TRAVERSAL INTO THE STACK.
+C -------------------------------------------------------------
+ 100 CONTINUE
+ ITOP = ITOP + 1
+ STACK(ITOP) = NODE
+ NODE = FSON(NODE)
+ IF ( NODE .GT. 0 ) GO TO 100
+C ----------------------------------------------------------
+C IF POSSIBLE, POP A TREE NODE FROM THE STACK AND NUMBER IT.
+C ----------------------------------------------------------
+ 200 CONTINUE
+ IF ( ITOP .LE. 0 ) GO TO 300
+ NODE = STACK(ITOP)
+ ITOP = ITOP - 1
+ NUM = NUM + 1
+ INVPOS(NODE) = NUM
+C ----------------------------------------------------
+C THEN, TRAVERSE TO ITS YOUNGER BROTHER IF IT HAS ONE.
+C ----------------------------------------------------
+ NODE = BROTHR(NODE)
+ IF ( NODE .LE. 0 ) GO TO 200
+ GO TO 100
+C
+ 300 CONTINUE
+C ------------------------------------------------------------
+C DETERMINE THE NEW PARENT VECTOR OF THE POSTORDERING. BROTHR
+C IS USED TEMPORARILY FOR THE NEW PARENT VECTOR.
+C ------------------------------------------------------------
+ DO 400 NODE = 1, NUM
+ NUNODE = INVPOS(NODE)
+ NDPAR = PARENT(NODE)
+ IF ( NDPAR .GT. 0 ) NDPAR = INVPOS(NDPAR)
+ BROTHR(NUNODE) = NDPAR
+ 400 CONTINUE
+C
+ DO 500 NUNODE = 1, NUM
+ PARENT(NUNODE) = BROTHR(NUNODE)
+ 500 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Joseph W.H. Liu
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C*********** INVINV ..... CONCATENATION OF TWO INVP ************
+C***********************************************************************
+C***********************************************************************
+C
+C WRITTEN BY JOSEPH LIU (JUL 17, 1985)
+C
+C PURPOSE:
+C TO PERFORM THE MAPPING OF
+C ORIGINAL-INVP --> INTERMEDIATE-INVP --> NEW INVP
+C AND THE RESULTING ORDERING REPLACES INVP. THE NEW PERMUTATION
+C VECTOR PERM IS ALSO COMPUTED.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C INVP2 - THE SECOND INVERSE PERMUTATION VECTOR.
+C
+C UPDATED PARAMETERS:
+C INVP - THE FIRST INVERSE PERMUTATION VECTOR. ON
+C OUTPUT, IT CONTAINS THE NEW INVERSE
+C PERMUTATION.
+C
+C OUTPUT PARAMETER:
+C PERM - NEW PERMUTATION VECTOR (CAN BE THE SAME AS
+C INVP2).
+C
+C***********************************************************************
+C
+ SUBROUTINE INVINV ( NEQNS , INVP , INVP2 , PERM )
+C
+C***********************************************************************
+C
+ INTEGER INVP(*) , INVP2(*) ,
+ & PERM(*)
+C
+ INTEGER NEQNS
+C
+C***********************************************************************
+C
+ INTEGER I , INTERM, NODE
+C
+C***********************************************************************
+C
+ DO 100 I = 1, NEQNS
+ INTERM = INVP(I)
+ INVP(I) = INVP2(INTERM)
+ 100 CONTINUE
+C
+ DO 200 I = 1, NEQNS
+ NODE = INVP(I)
+ PERM(NODE) = I
+ 200 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C********** CHORDR ..... CHILD REORDERING ***********
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C REARRANGE THE CHILDREN OF EACH VERTEX SO THAT THE LAST ONE
+C MAXIMIZES (AMONG THE CHILDREN) THE NUMBER OF NONZEROS IN THE
+C CORRESPONDING COLUMN OF L. ALSO DETERMINE AN NEW POSTORDERING
+C BASED ON THE STRUCTURE OF THE MODIFIED ELIMINATION TREE.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C (XADJ,ADJNCY) - THE ADJACENCY STRUCTURE.
+C
+C UPDATED PARAMETERS:
+C (PERM,INVP) - ON INPUT, THE GIVEN PERM AND INVERSE PERM
+C VECTORS. ON OUTPUT, THE NEW PERM AND
+C INVERSE PERM VECTORS OF THE NEW
+C POSTORDERING.
+C COLCNT - COLUMN COUNTS IN L UNDER INITIAL ORDERING;
+C MODIFIED TO REFLECT THE NEW ORDERING.
+C
+C OUTPUT PARAMETERS:
+C PARENT - THE PARENT VECTOR OF THE ELIMINATION TREE
+C ASSOCIATED WITH THE NEW ORDERING.
+C
+C WORKING PARAMETERS:
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHER VECTOR.
+C INVPOS - THE INVERSE PERM VECTOR FOR THE
+C POSTORDERING.
+C
+C PROGRAM SUBROUTINES:
+C BTREE2, EPOST2, INVINV.
+C
+C***********************************************************************
+C
+ SUBROUTINE CHORDR ( NEQNS , XADJ , ADJNCY, PERM , INVP ,
+ & COLCNT, PARENT, FSON , BROTHR, INVPOS )
+C
+C***********************************************************************
+C
+ INTEGER ADJNCY(*) , BROTHR(*) ,
+ & COLCNT(*) , FSON(*) ,
+ & INVP(*) , INVPOS(*) ,
+ & PARENT(*) , PERM(*)
+C
+ INTEGER XADJ(*)
+ INTEGER NEQNS
+C
+C***********************************************************************
+C
+C ----------------------------------------------------------
+C COMPUTE A BINARY REPRESENTATION OF THE ELIMINATION TREE,
+C SO THAT EACH "LAST CHILD" MAXIMIZES AMONG ITS SIBLINGS THE
+C NUMBER OF NONZEROS IN THE CORRESPONDING COLUMNS OF L.
+C ----------------------------------------------------------
+ CALL BTREE2 ( NEQNS , PARENT, COLCNT, FSON , BROTHR,
+ & INVPOS )
+C
+C ----------------------------------------------------
+C POSTORDER THE ELIMINATION TREE (USING THE NEW BINARY
+C REPRESENTATION.
+C ----------------------------------------------------
+ CALL EPOST2 ( NEQNS , FSON , BROTHR, INVPOS, PARENT,
+ & COLCNT, PERM )
+C
+C --------------------------------------------------------
+C COMPOSE THE ORIGINAL ORDERING WITH THE NEW POSTORDERING.
+C --------------------------------------------------------
+ CALL INVINV ( NEQNS , INVP , INVPOS, PERM )
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: January 12, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** BTREE2 ..... BINARY TREE REPRESENTATION OF ETREE *******
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C TO DETERMINE A BINARY TREE REPRESENTATION OF THE ELIMINATION
+C TREE, FOR WHICH EVERY "LAST CHILD" HAS THE MAXIMUM POSSIBLE
+C COLUMN NONZERO COUNT IN THE FACTOR. THE RETURNED REPRESENTATION
+C WILL BE GIVEN BY THE FIRST-SON AND BROTHER VECTORS. THE ROOT OF
+C THE BINARY TREE IS ALWAYS NEQNS.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C PARENT - THE PARENT VECTOR OF THE ELIMINATION TREE.
+C IT IS ASSUMED THAT PARENT(I) > I EXCEPT OF
+C THE ROOTS.
+C COLCNT - COLUMN NONZERO COUNTS OF THE FACTOR.
+C
+C OUTPUT PARAMETERS:
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHER VECTOR.
+C
+C WORKING PARAMETERS:
+C LSON - LAST SON VECTOR.
+C
+C***********************************************************************
+C
+ SUBROUTINE BTREE2 ( NEQNS , PARENT, COLCNT, FSON , BROTHR,
+ & LSON )
+C
+C***********************************************************************
+C
+ INTEGER BROTHR(*) , COLCNT(*) ,
+ & FSON(*) , LSON(*) ,
+ & PARENT(*)
+C
+ INTEGER NEQNS
+C
+C***********************************************************************
+C
+ INTEGER LROOT , NODE , NDLSON, NDPAR
+C
+C***********************************************************************
+C
+ IF ( NEQNS .LE. 0 ) RETURN
+C
+ DO 100 NODE = 1, NEQNS
+ FSON(NODE) = 0
+ BROTHR(NODE) = 0
+ LSON(NODE) = 0
+ 100 CONTINUE
+ LROOT = NEQNS
+C ------------------------------------------------------------
+C FOR EACH NODE := NEQNS-1 STEP -1 DOWNTO 1, DO THE FOLLOWING.
+C ------------------------------------------------------------
+ IF ( NEQNS .LE. 1 ) RETURN
+ DO 300 NODE = NEQNS-1, 1, -1
+ NDPAR = PARENT(NODE)
+ IF ( NDPAR .LE. 0 .OR. NDPAR .EQ. NODE ) THEN
+C -------------------------------------------------
+C NODE HAS NO PARENT. GIVEN STRUCTURE IS A FOREST.
+C SET NODE TO BE ONE OF THE ROOTS OF THE TREES.
+C -------------------------------------------------
+ BROTHR(LROOT) = NODE
+ LROOT = NODE
+ ELSE
+C -------------------------------------------
+C OTHERWISE, BECOMES FIRST SON OF ITS PARENT.
+C -------------------------------------------
+ NDLSON = LSON(NDPAR)
+ IF ( NDLSON .NE. 0 ) THEN
+ IF ( COLCNT(NODE) .GE. COLCNT(NDLSON) ) THEN
+ BROTHR(NODE) = FSON(NDPAR)
+ FSON(NDPAR) = NODE
+ ELSE
+ BROTHR(NDLSON) = NODE
+ LSON(NDPAR) = NODE
+ ENDIF
+ ELSE
+ FSON(NDPAR) = NODE
+ LSON(NDPAR) = NODE
+ ENDIF
+ ENDIF
+ 300 CONTINUE
+ BROTHR(LROOT) = 0
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C*************** EPOST2 ..... ETREE POSTORDERING #2 ***************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C BASED ON THE BINARY REPRESENTATION (FIRST-SON,BROTHER) OF THE
+C ELIMINATION TREE, A POSTORDERING IS DETERMINED. THE
+C CORRESPONDING PARENT AND COLCNT VECTORS ARE ALSO MODIFIED TO
+C REFLECT THE REORDERING.
+C
+C INPUT PARAMETERS:
+C ROOT - ROOT OF THE ELIMINATION TREE (USUALLY IT
+C IS NEQNS).
+C FSON - THE FIRST SON VECTOR.
+C BROTHR - THE BROTHR VECTOR.
+C
+C UPDATED PARAMETERS:
+C PARENT - THE PARENT VECTOR.
+C COLCNT - COLUMN NONZERO COUNTS OF THE FACTOR.
+C
+C OUTPUT PARAMETERS:
+C INVPOS - INVERSE PERMUTATION FOR THE POSTORDERING.
+C
+C WORKING PARAMETERS:
+C STACK - THE STACK FOR POSTORDER TRAVERSAL OF THE
+C TREE.
+C
+C***********************************************************************
+C
+ SUBROUTINE EPOST2 ( ROOT , FSON , BROTHR, INVPOS, PARENT,
+ & COLCNT, STACK )
+C
+C***********************************************************************
+C
+ INTEGER BROTHR(*) , COLCNT(*) ,
+ & FSON(*) , INVPOS(*) ,
+ & PARENT(*) , STACK(*)
+C
+ INTEGER ROOT
+C
+C***********************************************************************
+C
+ INTEGER ITOP , NDPAR , NODE , NUM , NUNODE
+C
+C***********************************************************************
+C
+ NUM = 0
+ ITOP = 0
+ NODE = ROOT
+C -------------------------------------------------------------
+C TRAVERSE ALONG THE FIRST SONS POINTER AND PUSH THE TREE NODES
+C ALONG THE TRAVERSAL INTO THE STACK.
+C -------------------------------------------------------------
+ 100 CONTINUE
+ ITOP = ITOP + 1
+ STACK(ITOP) = NODE
+ NODE = FSON(NODE)
+ IF ( NODE .GT. 0 ) GO TO 100
+C ----------------------------------------------------------
+C IF POSSIBLE, POP A TREE NODE FROM THE STACK AND NUMBER IT.
+C ----------------------------------------------------------
+ 200 CONTINUE
+ IF ( ITOP .LE. 0 ) GO TO 300
+ NODE = STACK(ITOP)
+ ITOP = ITOP - 1
+ NUM = NUM + 1
+ INVPOS(NODE) = NUM
+C ----------------------------------------------------
+C THEN, TRAVERSE TO ITS YOUNGER BROTHER IF IT HAS ONE.
+C ----------------------------------------------------
+ NODE = BROTHR(NODE)
+ IF ( NODE .LE. 0 ) GO TO 200
+ GO TO 100
+C
+ 300 CONTINUE
+C ------------------------------------------------------------
+C DETERMINE THE NEW PARENT VECTOR OF THE POSTORDERING. BROTHR
+C IS USED TEMPORARILY FOR THE NEW PARENT VECTOR.
+C ------------------------------------------------------------
+ DO 400 NODE = 1, NUM
+ NUNODE = INVPOS(NODE)
+ NDPAR = PARENT(NODE)
+ IF ( NDPAR .GT. 0 ) NDPAR = INVPOS(NDPAR)
+ BROTHR(NUNODE) = NDPAR
+ 400 CONTINUE
+C
+ DO 500 NUNODE = 1, NUM
+ PARENT(NUNODE) = BROTHR(NUNODE)
+ 500 CONTINUE
+C
+C ----------------------------------------------
+C PERMUTE COLCNT(*) TO REFLECT THE NEW ORDERING.
+C ----------------------------------------------
+ DO 600 NODE = 1, NUM
+ NUNODE = INVPOS(NODE)
+ STACK(NUNODE) = COLCNT(NODE)
+ 600 CONTINUE
+C
+ DO 700 NODE = 1, NUM
+ COLCNT(NODE) = STACK(NODE)
+ 700 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: January 12, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************** FCNTHN ..... FIND NONZERO COUNTS ***************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE DETERMINES THE ROW COUNTS AND COLUMN COUNTS IN
+C THE CHOLESKY FACTOR. IT USES A DISJOINT SET UNION ALGORITHM.
+C
+C TECHNIQUES:
+C 1) SUPERNODE DETECTION.
+C 2) PATH HALVING.
+C 3) NO UNION BY RANK.
+C
+C NOTES:
+C 1) ASSUMES A POSTORDERING OF THE ELIMINATION TREE.
+C
+C INPUT PARAMETERS:
+C (I) NEQNS - NUMBER OF EQUATIONS.
+C (I) ADJLEN - LENGTH OF ADJACENCY STRUCTURE.
+C (I) XADJ(*) - ARRAY OF LENGTH NEQNS+1, CONTAINING POINTERS
+C TO THE ADJACENCY STRUCTURE.
+C (I) ADJNCY(*) - ARRAY OF LENGTH XADJ(NEQNS+1)-1, CONTAINING
+C THE ADJACENCY STRUCTURE.
+C (I) PERM(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C POSTORDERING.
+C (I) INVP(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C INVERSE OF THE POSTORDERING.
+C (I) ETPAR(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C ELIMINATION TREE OF THE POSTORDERED MATRIX.
+C
+C OUTPUT PARAMETERS:
+C (I) ROWCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE NUMBER
+C OF NONZEROS IN EACH ROW OF THE FACTOR,
+C INCLUDING THE DIAGONAL ENTRY.
+C (I) COLCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE NUMBER
+C OF NONZEROS IN EACH COLUMN OF THE FACTOR,
+C INCLUDING THE DIAGONAL ENTRY.
+C (I) NLNZ - NUMBER OF NONZEROS IN THE FACTOR, INCLUDING
+C THE DIAGONAL ENTRIES.
+C
+C WORK PARAMETERS:
+C (I) SET(*) - ARRAY OF LENGTH NEQNS USED TO MAINTAIN THE
+C DISJOINT SETS (I.E., SUBTREES).
+C (I) PRVLF(*) - ARRAY OF LENGTH NEQNS USED TO RECORD THE
+C PREVIOUS LEAF OF EACH ROW SUBTREE.
+C (I) LEVEL(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING THE LEVEL
+C (DISTANCE FROM THE ROOT).
+C (I) WEIGHT(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING WEIGHTS
+C USED TO COMPUTE COLUMN COUNTS.
+C (I) FDESC(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING THE
+C FIRST (I.E., LOWEST-NUMBERED) DESCENDANT.
+C (I) NCHILD(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING THE
+C NUMBER OF CHILDREN.
+C (I) PRVNBR(*) - ARRAY OF LENGTH NEQNS USED TO RECORD THE
+C PREVIOUS ``LOWER NEIGHBOR'' OF EACH NODE.
+C
+C FIRST CREATED ON APRIL 12, 1990.
+C LAST UPDATED ON JANUARY 12, 1995.
+C
+C***********************************************************************
+C
+ SUBROUTINE FCNTHN ( NEQNS , ADJLEN, XADJ , ADJNCY, PERM ,
+ & INVP , ETPAR , ROWCNT, COLCNT, NLNZ ,
+ & SET , PRVLF , LEVEL , WEIGHT, FDESC ,
+ & NCHILD, PRVNBR )
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER ADJLEN, NEQNS , NLNZ
+ INTEGER ADJNCY(ADJLEN) , COLCNT(NEQNS) ,
+ & ETPAR(NEQNS) , FDESC(0:NEQNS),
+ & INVP(NEQNS) , LEVEL(0:NEQNS),
+ & NCHILD(0:NEQNS) , PERM(NEQNS) ,
+ & PRVLF(NEQNS) , PRVNBR(NEQNS) ,
+ & ROWCNT(NEQNS) , SET(NEQNS) ,
+ & WEIGHT(0:NEQNS)
+ INTEGER XADJ(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER HINBR , IFDESC, J , JSTOP , JSTRT ,
+ & K , LAST1 , LAST2 , LCA , LFLAG ,
+ & LOWNBR, OLDNBR, PARENT, PLEAF , TEMP ,
+ & XSUP
+C
+C***********************************************************************
+C
+C --------------------------------------------------
+C COMPUTE LEVEL(*), FDESC(*), NCHILD(*).
+C INITIALIZE ROWCNT(*), COLCNT(*),
+C SET(*), PRVLF(*), WEIGHT(*), PRVNBR(*).
+C --------------------------------------------------
+CSS Next line added, because XSUP may be indetermined below see
+CSS other CSS comment
+ XSUP = 0
+ LEVEL(0) = 0
+ DO 100 K = NEQNS, 1, -1
+ ROWCNT(K) = 1
+ COLCNT(K) = 0
+ SET(K) = K
+ PRVLF(K) = 0
+ LEVEL(K) = LEVEL(ETPAR(K)) + 1
+ WEIGHT(K) = 1
+ FDESC(K) = K
+ NCHILD(K) = 0
+ PRVNBR(K) = 0
+ 100 CONTINUE
+ NCHILD(0) = 0
+ FDESC(0) = 0
+ DO 200 K = 1, NEQNS
+ PARENT = ETPAR(K)
+ WEIGHT(PARENT) = 0
+ NCHILD(PARENT) = NCHILD(PARENT) + 1
+ IFDESC = FDESC(K)
+ IF ( IFDESC .LT. FDESC(PARENT) ) THEN
+ FDESC(PARENT) = IFDESC
+ ENDIF
+ 200 CONTINUE
+C ------------------------------------
+C FOR EACH ``LOW NEIGHBOR'' LOWNBR ...
+C ------------------------------------
+ DO 600 LOWNBR = 1, NEQNS
+ LFLAG = 0
+ IFDESC = FDESC(LOWNBR)
+ OLDNBR = PERM(LOWNBR)
+ JSTRT = XADJ(OLDNBR)
+ JSTOP = XADJ(OLDNBR+1) - 1
+C -----------------------------------------------
+C FOR EACH ``HIGH NEIGHBOR'', HINBR OF LOWNBR ...
+C -----------------------------------------------
+ DO 500 J = JSTRT, JSTOP
+ HINBR = INVP(ADJNCY(J))
+ IF ( HINBR .GT. LOWNBR ) THEN
+ IF ( IFDESC .GT. PRVNBR(HINBR) ) THEN
+C -------------------------
+C INCREMENT WEIGHT(LOWNBR).
+C -------------------------
+ WEIGHT(LOWNBR) = WEIGHT(LOWNBR) + 1
+ PLEAF = PRVLF(HINBR)
+C -----------------------------------------
+C IF HINBR HAS NO PREVIOUS ``LOW NEIGHBOR''
+C THEN ...
+C -----------------------------------------
+ IF ( PLEAF .EQ. 0 ) THEN
+C -----------------------------------------
+C ... ACCUMULATE LOWNBR-->HINBR PATH LENGTH
+C IN ROWCNT(HINBR).
+C -----------------------------------------
+ ROWCNT(HINBR) = ROWCNT(HINBR) +
+ & LEVEL(LOWNBR) - LEVEL(HINBR)
+ ELSE
+C -----------------------------------------
+C ... OTHERWISE, LCA <-- FIND(PLEAF), WHICH
+C IS THE LEAST COMMON ANCESTOR OF PLEAF
+C AND LOWNBR.
+C (PATH HALVING.)
+C -----------------------------------------
+ LAST1 = PLEAF
+ LAST2 = SET(LAST1)
+ LCA = SET(LAST2)
+ 300 CONTINUE
+ IF ( LCA .NE. LAST2 ) THEN
+ SET(LAST1) = LCA
+ LAST1 = LCA
+ LAST2 = SET(LAST1)
+ LCA = SET(LAST2)
+ GO TO 300
+ ENDIF
+C -------------------------------------
+C ACCUMULATE PLEAF-->LCA PATH LENGTH IN
+C ROWCNT(HINBR).
+C DECREMENT WEIGHT(LCA).
+C -------------------------------------
+ ROWCNT(HINBR) = ROWCNT(HINBR)
+ & + LEVEL(LOWNBR) - LEVEL(LCA)
+ WEIGHT(LCA) = WEIGHT(LCA) - 1
+ ENDIF
+C ----------------------------------------------
+C LOWNBR NOW BECOMES ``PREVIOUS LEAF'' OF HINBR.
+C ----------------------------------------------
+ PRVLF(HINBR) = LOWNBR
+ LFLAG = 1
+ ENDIF
+C --------------------------------------------------
+C LOWNBR NOW BECOMES ``PREVIOUS NEIGHBOR'' OF HINBR.
+C --------------------------------------------------
+ PRVNBR(HINBR) = LOWNBR
+ ENDIF
+ 500 CONTINUE
+C ----------------------------------------------------
+C DECREMENT WEIGHT ( PARENT(LOWNBR) ).
+C SET ( P(LOWNBR) ) <-- SET ( P(LOWNBR) ) + SET(XSUP).
+C ----------------------------------------------------
+ PARENT = ETPAR(LOWNBR)
+ WEIGHT(PARENT) = WEIGHT(PARENT) - 1
+ IF ( LFLAG .EQ. 1 .OR.
+ & NCHILD(LOWNBR) .GE. 2 ) THEN
+ XSUP = LOWNBR
+ ENDIF
+CSS original code was "SET(XSUP) = PARENT"
+ IF (XSUP.gt.0) SET(XSUP) = PARENT
+ 600 CONTINUE
+C ---------------------------------------------------------
+C USE WEIGHTS TO COMPUTE COLUMN (AND TOTAL) NONZERO COUNTS.
+C ---------------------------------------------------------
+ NLNZ = 0
+ DO 700 K = 1, NEQNS
+ TEMP = COLCNT(K) + WEIGHT(K)
+ COLCNT(K) = TEMP
+ NLNZ = NLNZ + TEMP
+ PARENT = ETPAR(K)
+ IF ( PARENT .NE. 0 ) THEN
+ COLCNT(PARENT) = COLCNT(PARENT) + TEMP
+ ENDIF
+ 700 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C**************** FSUP1 ..... FIND SUPERNODES #1 *****************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE IS THE FIRST OF TWO ROUTINES FOR FINDING A
+C MAXIMAL SUPERNODE PARTITION. IT RETURNS ONLY THE NUMBER OF
+C SUPERNODES NSUPER AND THE SUPERNODE MEMBERSHIP VECTOR SNODE(*),
+C WHICH IS OF LENGTH NEQNS. THE VECTORS OF LENGTH NSUPER ARE
+C COMPUTED SUBSEQUENTLY BY THE COMPANION ROUTINE FSUP2.
+C
+C METHOD AND ASSUMPTIONS:
+C THIS ROUTINE USES THE ELIMINATION TREE AND THE FACTOR COLUMN
+C COUNTS TO COMPUTE THE SUPERNODE PARTITION; IT ALSO ASSUMES A
+C POSTORDERING OF THE ELIMINATION TREE.
+C
+C INPUT PARAMETERS:
+C (I) NEQNS - NUMBER OF EQUATIONS.
+C (I) ETPAR(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C ELIMINATION TREE OF THE POSTORDERED MATRIX.
+C (I) COLCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C FACTOR COLUMN COUNTS: I.E., THE NUMBER OF
+C NONZERO ENTRIES IN EACH COLUMN OF L
+C (INCLUDING THE DIAGONAL ENTRY).
+C
+C OUTPUT PARAMETERS:
+C (I) NOFSUB - NUMBER OF SUBSCRIPTS.
+C (I) NSUPER - NUMBER OF SUPERNODES (<= NEQNS).
+C (I) SNODE(*) - ARRAY OF LENGTH NEQNS FOR RECORDING
+C SUPERNODE MEMBERSHIP.
+C
+C FIRST CREATED ON JANUARY 18, 1992.
+C LAST UPDATED ON NOVEMBER 11, 1994.
+C
+C***********************************************************************
+C
+ SUBROUTINE FSUP1 ( NEQNS , ETPAR , COLCNT, NOFSUB, NSUPER,
+ & SNODE )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER NEQNS , NOFSUB, NSUPER
+ INTEGER COLCNT(*) , ETPAR(*) ,
+ & SNODE(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER KCOL
+C
+C***********************************************************************
+C
+C --------------------------------------------
+C COMPUTE THE FUNDAMENTAL SUPERNODE PARTITION.
+C --------------------------------------------
+ NSUPER = 1
+ SNODE(1) = 1
+ NOFSUB = COLCNT(1)
+ DO 300 KCOL = 2, NEQNS
+ IF ( ETPAR(KCOL-1) .EQ. KCOL ) THEN
+ IF ( COLCNT(KCOL-1) .EQ. COLCNT(KCOL)+1 ) THEN
+ SNODE(KCOL) = NSUPER
+ GO TO 300
+ ENDIF
+ ENDIF
+ NSUPER = NSUPER + 1
+ SNODE(KCOL) = NSUPER
+ NOFSUB = NOFSUB + COLCNT(KCOL)
+ 300 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C**************** FSUP2 ..... FIND SUPERNODES #2 *****************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE IS THE SECOND OF TWO ROUTINES FOR FINDING A
+C MAXIMAL SUPERNODE PARTITION. IT'S SOLE PURPOSE IS TO
+C CONSTRUCT THE NEEDED VECTOR OF LENGTH NSUPER: XSUPER(*). THE
+C FIRST ROUTINE FSUP1 COMPUTES THE NUMBER OF SUPERNODES AND THE
+C SUPERNODE MEMBERSHIP VECTOR SNODE(*), WHICH IS OF LENGTH NEQNS.
+C
+C
+C ASSUMPTIONS:
+C THIS ROUTINE ASSUMES A POSTORDERING OF THE ELIMINATION TREE. IT
+C ALSO ASSUMES THAT THE OUTPUT FROM FSUP1 IS AVAILABLE.
+C
+C INPUT PARAMETERS:
+C (I) NEQNS - NUMBER OF EQUATIONS.
+C (I) NSUPER - NUMBER OF SUPERNODES (<= NEQNS).
+C (I) ETPAR(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE
+C ELIMINATION TREE OF THE POSTORDERED MATRIX.
+C (I) SNODE(*) - ARRAY OF LENGTH NEQNS FOR RECORDING
+C SUPERNODE MEMBERSHIP.
+C
+C OUTPUT PARAMETERS:
+C (I) XSUPER(*) - ARRAY OF LENGTH NSUPER+1, CONTAINING THE
+C SUPERNODE PARTITIONING.
+C
+C FIRST CREATED ON JANUARY 18, 1992.
+C LAST UPDATED ON NOVEMEBER 22, 1994.
+C
+C***********************************************************************
+C
+ SUBROUTINE FSUP2 ( NEQNS , NSUPER, ETPAR , SNODE , XSUPER )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER NEQNS , NSUPER
+ INTEGER ETPAR(*) , SNODE(*) ,
+ & XSUPER(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER KCOL , KSUP , LSTSUP
+C
+C***********************************************************************
+C
+C -------------------------------------------------
+C COMPUTE THE SUPERNODE PARTITION VECTOR XSUPER(*).
+C -------------------------------------------------
+ LSTSUP = NSUPER + 1
+ DO 100 KCOL = NEQNS, 1, -1
+ KSUP = SNODE(KCOL)
+ IF ( KSUP .NE. LSTSUP ) THEN
+ XSUPER(LSTSUP) = KCOL + 1
+ ENDIF
+ LSTSUP = KSUP
+ 100 CONTINUE
+ XSUPER(1) = 1
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: February 13, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* SYMFCT ..... SYMBOLIC FACTORIZATION **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS ROUTINE CALLS SYMFC2 WHICH PERFORMS SUPERNODAL SYMBOLIC
+C FACTORIZATION ON A REORDERED LINEAR SYSTEM.
+C
+C INPUT PARAMETERS:
+C (I) NEQNS - NUMBER OF EQUATIONS
+C (I) ADJLEN - LENGTH OF THE ADJACENCY LIST.
+C (I) XADJ(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING POINTERS
+C TO THE ADJACENCY STRUCTURE.
+C (I) ADJNCY(*) - ARRAY OF LENGTH XADJ(NEQNS+1)-1 CONTAINING
+C THE ADJACENCY STRUCTURE.
+C (I) PERM(*) - ARRAY OF LENGTH NEQNS CONTAINING THE
+C POSTORDERING.
+C (I) INVP(*) - ARRAY OF LENGTH NEQNS CONTAINING THE
+C INVERSE OF THE POSTORDERING.
+C (I) COLCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE NUMBER
+C OF NONZEROS IN EACH COLUMN OF THE FACTOR,
+C INCLUDING THE DIAGONAL ENTRY.
+C (I) NSUPER - NUMBER OF SUPERNODES.
+C (I) XSUPER(*) - ARRAY OF LENGTH NSUPER+1, CONTAINING THE
+C FIRST COLUMN OF EACH SUPERNODE.
+C (I) SNODE(*) - ARRAY OF LENGTH NEQNS FOR RECORDING
+C SUPERNODE MEMBERSHIP.
+C (I) NOFSUB - NUMBER OF SUBSCRIPTS TO BE STORED IN
+C LINDX(*).
+C (I) IWSIZ - SIZE OF INTEGER WORKING STORAGE.
+C
+C OUTPUT PARAMETERS:
+C (I) XLINDX - ARRAY OF LENGTH NEQNS+1, CONTAINING POINTERS
+C INTO THE SUBSCRIPT VECTOR.
+C (I) LINDX - ARRAY OF LENGTH MAXSUB, CONTAINING THE
+C COMPRESSED SUBSCRIPTS.
+C (I) XLNZ - COLUMN POINTERS FOR L.
+C (I) FLAG - ERROR FLAG:
+C 0 - NO ERROR.
+C -1 - INSUFFICIENT INTEGER WORKING SPACE.
+C -2 - INCONSISTANCY IN THE INPUT.
+C
+C WORKING PARAMETERS:
+C (I) IWORK - WORKING ARRAY OF LENGTH NSUPER+2*NEQNS.
+C
+C***********************************************************************
+C
+ SUBROUTINE SYMFCT ( NEQNS , ADJLEN, XADJ , ADJNCY, PERM ,
+ & INVP , COLCNT, NSUPER, XSUPER, SNODE ,
+ & NOFSUB, XLINDX, LINDX , XLNZ , IWSIZ ,
+ & IWORK ,
+ & FLAG )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER ADJLEN, FLAG , IWSIZ , NEQNS , NOFSUB,
+ & NSUPER
+ INTEGER ADJNCY(ADJLEN), COLCNT(NEQNS) ,
+ & INVP(NEQNS) ,
+ & IWORK(NSUPER+2*NEQNS+1),
+ & LINDX(NOFSUB) ,
+ & PERM(NEQNS) , SNODE(NEQNS) ,
+ & XSUPER(NSUPER+1)
+ INTEGER XADJ(NEQNS+1) , XLINDX(NSUPER+1),
+ & XLNZ(NEQNS+1)
+C
+C***********************************************************************
+C
+ FLAG = 0
+ IF ( IWSIZ .LT. NSUPER+2*NEQNS+1 ) THEN
+ FLAG = -1
+ RETURN
+ ENDIF
+ CALL SYMFC2 ( NEQNS , ADJLEN, XADJ , ADJNCY, PERM ,
+ & INVP , COLCNT, NSUPER, XSUPER, SNODE ,
+ & NOFSUB, XLINDX, LINDX , XLNZ ,
+ & IWORK(1) ,
+ & IWORK(NSUPER+1) ,
+ & IWORK(NSUPER+NEQNS+2) ,
+ & FLAG )
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: February 13, 1995
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C************* SYMFC2 ..... SYMBOLIC FACTORIZATION **************
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS ROUTINE PERFORMS SUPERNODAL SYMBOLIC FACTORIZATION ON A
+C REORDERED LINEAR SYSTEM. IT ASSUMES ACCESS TO THE COLUMNS
+C COUNTS, SUPERNODE PARTITION, AND SUPERNODAL ELIMINATION TREE
+C ASSOCIATED WITH THE FACTOR MATRIX L.
+C
+C INPUT PARAMETERS:
+C (I) NEQNS - NUMBER OF EQUATIONS
+C (I) ADJLEN - LENGTH OF THE ADJACENCY LIST.
+C (I) XADJ(*) - ARRAY OF LENGTH NEQNS+1 CONTAINING POINTERS
+C TO THE ADJACENCY STRUCTURE.
+C (I) ADJNCY(*) - ARRAY OF LENGTH XADJ(NEQNS+1)-1 CONTAINING
+C THE ADJACENCY STRUCTURE.
+C (I) PERM(*) - ARRAY OF LENGTH NEQNS CONTAINING THE
+C POSTORDERING.
+C (I) INVP(*) - ARRAY OF LENGTH NEQNS CONTAINING THE
+C INVERSE OF THE POSTORDERING.
+C (I) COLCNT(*) - ARRAY OF LENGTH NEQNS, CONTAINING THE NUMBER
+C OF NONZEROS IN EACH COLUMN OF THE FACTOR,
+C INCLUDING THE DIAGONAL ENTRY.
+C (I) NSUPER - NUMBER OF SUPERNODES.
+C (I) XSUPER(*) - ARRAY OF LENGTH NSUPER+1, CONTAINING THE
+C FIRST COLUMN OF EACH SUPERNODE.
+C (I) SNODE(*) - ARRAY OF LENGTH NEQNS FOR RECORDING
+C SUPERNODE MEMBERSHIP.
+C (I) NOFSUB - NUMBER OF SUBSCRIPTS TO BE STORED IN
+C LINDX(*).
+C
+C OUTPUT PARAMETERS:
+C (I) XLINDX - ARRAY OF LENGTH NEQNS+1, CONTAINING POINTERS
+C INTO THE SUBSCRIPT VECTOR.
+C (I) LINDX - ARRAY OF LENGTH MAXSUB, CONTAINING THE
+C COMPRESSED SUBSCRIPTS.
+C (I) XLNZ - COLUMN POINTERS FOR L.
+C (I) FLAG - ERROR FLAG:
+C 0 - NO ERROR.
+C 1 - INCONSISTANCY IN THE INPUT.
+C
+C WORKING PARAMETERS:
+C (I) MRGLNK - ARRAY OF LENGTH NSUPER, CONTAINING THE
+C CHILDREN OF EACH SUPERNODE AS A LINKED LIST.
+C (I) RCHLNK - ARRAY OF LENGTH NEQNS+1, CONTAINING THE
+C CURRENT LINKED LIST OF MERGED INDICES (THE
+C "REACH" SET).
+C (I) MARKER - ARRAY OF LENGTH NEQNS USED TO MARK INDICES
+C AS THEY ARE INTRODUCED INTO EACH SUPERNODE'S
+C INDEX SET.
+C
+C***********************************************************************
+C
+ SUBROUTINE SYMFC2 ( NEQNS , ADJLEN, XADJ , ADJNCY, PERM ,
+ & INVP , COLCNT, NSUPER, XSUPER, SNODE ,
+ & NOFSUB, XLINDX, LINDX , XLNZ , MRGLNK,
+ & RCHLNK, MARKER, FLAG )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER ADJLEN, FLAG , NEQNS , NOFSUB, NSUPER
+ INTEGER ADJNCY(ADJLEN), COLCNT(NEQNS) ,
+ & INVP(NEQNS) , MARKER(NEQNS) ,
+ & MRGLNK(NSUPER), LINDX(NOFSUB) ,
+ & PERM(NEQNS) , RCHLNK(0:NEQNS),
+ & SNODE(NEQNS) , XSUPER(NSUPER+1)
+ INTEGER XADJ(NEQNS+1) , XLINDX(NSUPER+1),
+ & XLNZ(NEQNS+1)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER FSTCOL, HEAD , I , JNZBEG, JNZEND,
+ & JPTR , JSUP , JWIDTH, KNZ , KNZBEG,
+ & KNZEND, KPTR , KSUP , LENGTH, LSTCOL,
+ & NEWI , NEXTI , NODE , NZBEG , NZEND ,
+ & PCOL , PSUP , POINT , TAIL , WIDTH
+C
+C***********************************************************************
+C
+ FLAG = 0
+ IF ( NEQNS .LE. 0 ) RETURN
+C
+C ---------------------------------------------------
+C INITIALIZATIONS ...
+C NZEND : POINTS TO THE LAST USED SLOT IN LINDX.
+C TAIL : END OF LIST INDICATOR
+C (IN RCHLNK(*), NOT MRGLNK(*)).
+C MRGLNK : CREATE EMPTY LISTS.
+C MARKER : "UNMARK" THE INDICES.
+C ---------------------------------------------------
+ NZEND = 0
+ HEAD = 0
+ TAIL = NEQNS + 1
+ POINT = 1
+ DO 50 I = 1, NEQNS
+ MARKER(I) = 0
+ XLNZ(I) = POINT
+ POINT = POINT + COLCNT(I)
+ 50 CONTINUE
+ XLNZ(NEQNS+1) = POINT
+ POINT = 1
+ DO 100 KSUP = 1, NSUPER
+ MRGLNK(KSUP) = 0
+ FSTCOL = XSUPER(KSUP)
+ XLINDX(KSUP) = POINT
+ POINT = POINT + COLCNT(FSTCOL)
+ 100 CONTINUE
+ XLINDX(NSUPER+1) = POINT
+C
+C ---------------------------
+C FOR EACH SUPERNODE KSUP ...
+C ---------------------------
+ DO 1000 KSUP = 1, NSUPER
+C
+C ---------------------------------------------------------
+C INITIALIZATIONS ...
+C FSTCOL : FIRST COLUMN OF SUPERNODE KSUP.
+C LSTCOL : LAST COLUMN OF SUPERNODE KSUP.
+C KNZ : WILL COUNT THE NONZEROS OF L IN COLUMN KCOL.
+C RCHLNK : INITIALIZE EMPTY INDEX LIST FOR KCOL.
+C ---------------------------------------------------------
+ FSTCOL = XSUPER(KSUP)
+ LSTCOL = XSUPER(KSUP+1) - 1
+ WIDTH = LSTCOL - FSTCOL + 1
+ LENGTH = COLCNT(FSTCOL)
+ KNZ = 0
+ RCHLNK(HEAD) = TAIL
+ JSUP = MRGLNK(KSUP)
+C
+C -------------------------------------------------
+C IF KSUP HAS CHILDREN IN THE SUPERNODAL E-TREE ...
+C -------------------------------------------------
+ IF ( JSUP .GT. 0 ) THEN
+C ---------------------------------------------
+C COPY THE INDICES OF THE FIRST CHILD JSUP INTO
+C THE LINKED LIST, AND MARK EACH WITH THE VALUE
+C KSUP.
+C ---------------------------------------------
+ JWIDTH = XSUPER(JSUP+1) - XSUPER(JSUP)
+ JNZBEG = XLINDX(JSUP) + JWIDTH
+ JNZEND = XLINDX(JSUP+1) - 1
+ DO 200 JPTR = JNZEND, JNZBEG, -1
+ NEWI = LINDX(JPTR)
+ KNZ = KNZ+1
+ MARKER(NEWI) = KSUP
+ RCHLNK(NEWI) = RCHLNK(HEAD)
+ RCHLNK(HEAD) = NEWI
+ 200 CONTINUE
+C ------------------------------------------
+C FOR EACH SUBSEQUENT CHILD JSUP OF KSUP ...
+C ------------------------------------------
+ JSUP = MRGLNK(JSUP)
+ 300 CONTINUE
+ IF ( JSUP .NE. 0 .AND. KNZ .LT. LENGTH ) THEN
+C ----------------------------------------
+C MERGE THE INDICES OF JSUP INTO THE LIST,
+C AND MARK NEW INDICES WITH VALUE KSUP.
+C ----------------------------------------
+ JWIDTH = XSUPER(JSUP+1) - XSUPER(JSUP)
+ JNZBEG = XLINDX(JSUP) + JWIDTH
+ JNZEND = XLINDX(JSUP+1) - 1
+ NEXTI = HEAD
+ DO 500 JPTR = JNZBEG, JNZEND
+ NEWI = LINDX(JPTR)
+ 400 CONTINUE
+ I = NEXTI
+ NEXTI = RCHLNK(I)
+ IF ( NEWI .GT. NEXTI ) GO TO 400
+ IF ( NEWI .LT. NEXTI ) THEN
+ KNZ = KNZ+1
+ RCHLNK(I) = NEWI
+ RCHLNK(NEWI) = NEXTI
+ MARKER(NEWI) = KSUP
+ NEXTI = NEWI
+ ENDIF
+ 500 CONTINUE
+ JSUP = MRGLNK(JSUP)
+ GO TO 300
+ ENDIF
+ ENDIF
+C ---------------------------------------------------
+C STRUCTURE OF A(*,FSTCOL) HAS NOT BEEN EXAMINED YET.
+C "SORT" ITS STRUCTURE INTO THE LINKED LIST,
+C INSERTING ONLY THOSE INDICES NOT ALREADY IN THE
+C LIST.
+C ---------------------------------------------------
+ IF ( KNZ .LT. LENGTH ) THEN
+ NODE = PERM(FSTCOL)
+ KNZBEG = XADJ(NODE)
+ KNZEND = XADJ(NODE+1) - 1
+ DO 700 KPTR = KNZBEG, KNZEND
+ NEWI = ADJNCY(KPTR)
+ NEWI = INVP(NEWI)
+ IF ( NEWI .GT. FSTCOL .AND.
+ & MARKER(NEWI) .NE. KSUP ) THEN
+C --------------------------------
+C POSITION AND INSERT NEWI IN LIST
+C AND MARK IT WITH KCOL.
+C --------------------------------
+ NEXTI = HEAD
+ 600 CONTINUE
+ I = NEXTI
+ NEXTI = RCHLNK(I)
+ IF ( NEWI .GT. NEXTI ) GO TO 600
+ KNZ = KNZ + 1
+ RCHLNK(I) = NEWI
+ RCHLNK(NEWI) = NEXTI
+ MARKER(NEWI) = KSUP
+ ENDIF
+ 700 CONTINUE
+ ENDIF
+C ------------------------------------------------------------
+C IF KSUP HAS NO CHILDREN, INSERT FSTCOL INTO THE LINKED LIST.
+C ------------------------------------------------------------
+ IF ( RCHLNK(HEAD) .NE. FSTCOL ) THEN
+ RCHLNK(FSTCOL) = RCHLNK(HEAD)
+ RCHLNK(HEAD) = FSTCOL
+ KNZ = KNZ + 1
+ ENDIF
+C
+C --------------------------------------------
+C COPY INDICES FROM LINKED LIST INTO LINDX(*).
+C --------------------------------------------
+ NZBEG = NZEND + 1
+ NZEND = NZEND + KNZ
+ IF ( NZEND+1 .NE. XLINDX(KSUP+1) ) GO TO 8000
+ I = HEAD
+ DO 800 KPTR = NZBEG, NZEND
+ I = RCHLNK(I)
+ LINDX(KPTR) = I
+ 800 CONTINUE
+C
+C ---------------------------------------------------
+C IF KSUP HAS A PARENT, INSERT KSUP INTO ITS PARENT'S
+C "MERGE" LIST.
+C ---------------------------------------------------
+ IF ( LENGTH .GT. WIDTH ) THEN
+ PCOL = LINDX ( XLINDX(KSUP) + WIDTH )
+ PSUP = SNODE(PCOL)
+ MRGLNK(KSUP) = MRGLNK(PSUP)
+ MRGLNK(PSUP) = KSUP
+ ENDIF
+C
+ 1000 CONTINUE
+C
+ RETURN
+C
+C -----------------------------------------------
+C INCONSISTENCY IN DATA STRUCTURE WAS DISCOVERED.
+C -----------------------------------------------
+ 8000 CONTINUE
+ FLAG = -2
+ RETURN
+C
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** BFINIT ..... INITIALIZATION FOR BLOCK FACTORIZATION ******
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE COMPUTES ITEMS NEEDED BY THE LEFT-LOOKING
+C BLOCK-TO-BLOCK CHOLESKY FACTORITZATION ROUTINE BLKFCT.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - INTEGER ARRAY OF SIZE (NSUPER+1) CONTAINING
+C THE SUPERNODE PARTITIONING.
+C SNODE - SUPERNODE MEMBERSHIP.
+C (XLINDX,LINDX) - ARRAYS DESCRIBING THE SUPERNODAL STRUCTURE.
+C CACHSZ - CACHE SIZE (IN KBYTES).
+C
+C OUTPUT PARAMETERS:
+C TMPSIZ - SIZE OF WORKING STORAGE REQUIRED BY BLKFCT.
+C SPLIT - SPLITTING OF SUPERNODES SO THAT THEY FIT
+C INTO CACHE.
+C
+C***********************************************************************
+C
+ SUBROUTINE BFINIT ( NEQNS , NSUPER, XSUPER, SNODE , XLINDX,
+ & LINDX , CACHSZ, TMPSIZ, SPLIT )
+C
+C***********************************************************************
+C
+ INTEGER CACHSZ, NEQNS , NSUPER, TMPSIZ
+ INTEGER XLINDX(*) , XSUPER(*)
+ INTEGER LINDX (*) , SNODE (*) ,
+ & SPLIT(*)
+C
+C***********************************************************************
+C
+C ---------------------------------------------------
+C DETERMINE FLOATING POINT WORKING SPACE REQUIREMENT.
+C ---------------------------------------------------
+ CALL FNTSIZ ( NSUPER, XSUPER, SNODE , XLINDX, LINDX ,
+ & TMPSIZ )
+C
+C -------------------------------
+C PARTITION SUPERNODES FOR CACHE.
+C -------------------------------
+ CALL FNSPLT ( NEQNS , NSUPER, XSUPER, XLINDX, CACHSZ,
+ & SPLIT )
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C****** FNTSIZ ..... COMPUTE WORK STORAGE SIZE FOR BLKFCT ******
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE DETERMINES THE SIZE OF THE WORKING STORAGE
+C REQUIRED BY BLKFCT.
+C
+C INPUT PARAMETERS:
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - INTEGER ARRAY OF SIZE (NSUPER+1) CONTAINING
+C THE SUPERNODE PARTITIONING.
+C SNODE - SUPERNODE MEMBERSHIP.
+C (XLINDX,LINDX) - ARRAYS DESCRIBING THE SUPERNODAL STRUCTURE.
+C
+C OUTPUT PARAMETERS:
+C TMPSIZ - SIZE OF WORKING STORAGE REQUIRED BY BLKFCT.
+C
+C***********************************************************************
+C
+ SUBROUTINE FNTSIZ ( NSUPER, XSUPER, SNODE , XLINDX,
+ & LINDX , TMPSIZ )
+C
+C***********************************************************************
+C
+ INTEGER NSUPER, TMPSIZ
+ INTEGER XLINDX(*) , XSUPER(*)
+ INTEGER LINDX (*) , SNODE (*)
+C
+ INTEGER BOUND , CLEN , CURSUP, I , IBEGIN, IEND ,
+ & KSUP , LENGTH, NCOLS , NXTSUP,
+ & TSIZE , WIDTH
+C
+C***********************************************************************
+C
+C RETURNS SIZE OF TEMP ARRAY USED BY BLKFCT FACTORIZATION ROUTINE.
+C NOTE THAT THE VALUE RETURNED IS AN ESTIMATE, THOUGH IT IS USUALLY
+C TIGHT.
+C
+C ----------------------------------------
+C COMPUTE SIZE OF TEMPORARY STORAGE VECTOR
+C NEEDED BY BLKFCT.
+C ----------------------------------------
+ TMPSIZ = 0
+ DO 500 KSUP = NSUPER, 1, -1
+ NCOLS = XSUPER(KSUP+1) - XSUPER(KSUP)
+ IBEGIN = XLINDX(KSUP) + NCOLS
+ IEND = XLINDX(KSUP+1) - 1
+ LENGTH = IEND - IBEGIN + 1
+ BOUND = LENGTH * (LENGTH + 1) / 2
+ IF ( BOUND .GT. TMPSIZ ) THEN
+ CURSUP = SNODE(LINDX(IBEGIN))
+ CLEN = XLINDX(CURSUP+1) - XLINDX(CURSUP)
+ WIDTH = 0
+ DO 400 I = IBEGIN, IEND
+ NXTSUP = SNODE(LINDX(I))
+ IF ( NXTSUP .EQ. CURSUP ) THEN
+ WIDTH = WIDTH + 1
+ IF ( I .EQ. IEND ) THEN
+ IF ( CLEN .GT. LENGTH ) THEN
+ TSIZE = LENGTH * WIDTH -
+ & (WIDTH - 1) * WIDTH / 2
+ TMPSIZ = MAX ( TSIZE , TMPSIZ )
+ ENDIF
+ ENDIF
+ ELSE
+ IF ( CLEN .GT. LENGTH ) THEN
+ TSIZE = LENGTH * WIDTH -
+ & (WIDTH - 1) * WIDTH / 2
+ TMPSIZ = MAX ( TSIZE , TMPSIZ )
+ ENDIF
+ LENGTH = LENGTH - WIDTH
+ BOUND = LENGTH * (LENGTH + 1) / 2
+ IF ( BOUND .LE. TMPSIZ ) GO TO 500
+ WIDTH = 1
+ CURSUP = NXTSUP
+ CLEN = XLINDX(CURSUP+1) - XLINDX(CURSUP)
+ ENDIF
+ 400 CONTINUE
+ ENDIF
+ 500 CONTINUE
+C
+ RETURN
+ END
+C***********************************************************************
+C***********************************************************************
+C
+C Version: 0.3
+C Last modified: December 27, 1994
+C Authors: Esmond G. Ng and Barry W. Peyton
+C
+C Mathematical Sciences Section, Oak Ridge National Laboratory
+C
+C***********************************************************************
+C***********************************************************************
+C**** FNSPLT ..... COMPUTE FINE PARTITIONING OF SUPERNODES *****
+C***********************************************************************
+C***********************************************************************
+C
+C PURPOSE:
+C THIS SUBROUTINE DETERMINES A FINE PARTITIONING OF SUPERNODES
+C WHEN THERE IS A CACHE AVAILABLE ON THE MACHINE. THE FINE
+C PARTITIONING IS CHOSEN SO THAT DATA RE-USE IS MAXIMIZED.
+C
+C INPUT PARAMETERS:
+C NEQNS - NUMBER OF EQUATIONS.
+C NSUPER - NUMBER OF SUPERNODES.
+C XSUPER - INTEGER ARRAY OF SIZE (NSUPER+1) CONTAINING
+C THE SUPERNODE PARTITIONING.
+C XLINDX - INTEGER ARRAY OF SIZE (NSUPER+1) CONTAINING
+C POINTERS IN THE SUPERNODE INDICES.
+C CACHSZ - CACHE SIZE IN KILO BYTES.
+C IF THERE IS NO CACHE, SET CACHSZ = 0.
+C
+C OUTPUT PARAMETERS:
+C SPLIT - INTEGER ARRAY OF SIZE NEQNS CONTAINING THE
+C FINE PARTITIONING.
+C
+C***********************************************************************
+C
+ SUBROUTINE FNSPLT ( NEQNS , NSUPER, XSUPER, XLINDX,
+ & CACHSZ, SPLIT )
+C
+C***********************************************************************
+C
+C -----------
+C PARAMETERS.
+C -----------
+ INTEGER CACHSZ, NEQNS , NSUPER
+ INTEGER XSUPER(*), SPLIT(*)
+ INTEGER XLINDX(*)
+C
+C ----------------
+C LOCAL VARIABLES.
+C ----------------
+ INTEGER CACHE , CURCOL, FSTCOL, HEIGHT, KCOL ,
+ 1 KSUP , LSTCOL, NCOLS , NXTBLK, USED ,
+ 1 WIDTH
+C
+C *******************************************************************
+C
+C --------------------------------------------
+C COMPUTE THE NUMBER OF 8-BYTE WORDS IN CACHE.
+C --------------------------------------------
+ IF ( CACHSZ .LE. 0 ) THEN
+ CACHE = 2 000 000 000
+ ELSE
+ CACHE = ( FLOAT(CACHSZ) * 1024. / 8. ) * 0.9
+ ENDIF
+C
+C ---------------
+C INITIALIZATION.
+C ---------------
+ DO 100 KCOL = 1, NEQNS
+ SPLIT(KCOL) = 0
+ 100 CONTINUE
+C
+C ---------------------------
+C FOR EACH SUPERNODE KSUP ...
+C ---------------------------
+ DO 1000 KSUP = 1, NSUPER
+C -----------------------
+C ... GET SUPERNODE INFO.
+C -----------------------
+ HEIGHT = XLINDX(KSUP+1) - XLINDX(KSUP)
+ FSTCOL = XSUPER(KSUP)
+ LSTCOL = XSUPER(KSUP+1) - 1
+ WIDTH = LSTCOL - FSTCOL + 1
+ NXTBLK = FSTCOL
+C --------------------------------------
+C ... UNTIL ALL COLUMNS OF THE SUPERNODE
+C HAVE BEEN PROCESSED ...
+C --------------------------------------
+ CURCOL = FSTCOL - 1
+ 200 CONTINUE
+C -------------------------------------------
+C ... PLACE THE FIRST COLUMN(S) IN THE CACHE.
+C -------------------------------------------
+ CURCOL = CURCOL + 1
+ IF ( CURCOL .LT. LSTCOL ) THEN
+ CURCOL = CURCOL + 1
+ NCOLS = 2
+ USED = 3 * HEIGHT - 1
+ HEIGHT = HEIGHT - 2
+ ELSE
+ NCOLS = 1
+ USED = 2 * HEIGHT
+ HEIGHT = HEIGHT - 1
+ ENDIF
+C
+C --------------------------------------
+C ... WHILE THE CACHE IS NOT FILLED AND
+C THERE ARE COLUMNS OF THE SUPERNODE
+C REMAINING TO BE PROCESSED ...
+C --------------------------------------
+ 300 CONTINUE
+ IF ( USED+HEIGHT .LT. CACHE .AND.
+ & CURCOL .LT. LSTCOL ) THEN
+C --------------------------------
+C ... ADD ANOTHER COLUMN TO CACHE.
+C --------------------------------
+ CURCOL = CURCOL + 1
+ NCOLS = NCOLS + 1
+ USED = USED + HEIGHT
+ HEIGHT = HEIGHT - 1
+ GO TO 300
+ ENDIF
+C -------------------------------------
+C ... RECORD THE NUMBER OF COLUMNS THAT
+C FILLED THE CACHE.
+C -------------------------------------
+ SPLIT(NXTBLK) = NCOLS
+ NXTBLK = NXTBLK + 1
+C --------------------------
+C ... GO PROCESS NEXT BLOCK.
+C --------------------------
+ IF ( CURCOL .LT. LSTCOL ) GO TO 200
+ 1000 CONTINUE
+C
+ RETURN
+ END
diff --git a/modules/sparse/src/fortran/symfct.lo b/modules/sparse/src/fortran/symfct.lo
new file mode 100755
index 000000000..a980bc994
--- /dev/null
+++ b/modules/sparse/src/fortran/symfct.lo
@@ -0,0 +1,12 @@
+# src/fortran/symfct.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/symfct.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/sz2ptr.f b/modules/sparse/src/fortran/sz2ptr.f
new file mode 100755
index 000000000..30a0eddc3
--- /dev/null
+++ b/modules/sparse/src/fortran/sz2ptr.f
@@ -0,0 +1,15 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine sz2ptr(ind,m,ptr)
+ integer ind(m),ptr(*)
+ ptr(1)=1
+ do 10 i=1,m
+ ptr(i+1)=ptr(i)+ind(i)
+ 10 continue
+ end
diff --git a/modules/sparse/src/fortran/sz2ptr.lo b/modules/sparse/src/fortran/sz2ptr.lo
new file mode 100755
index 000000000..40bb12420
--- /dev/null
+++ b/modules/sparse/src/fortran/sz2ptr.lo
@@ -0,0 +1,12 @@
+# src/fortran/sz2ptr.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/sz2ptr.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/ta2lpd.f b/modules/sparse/src/fortran/ta2lpd.f
new file mode 100755
index 000000000..9b3a756cf
--- /dev/null
+++ b/modules/sparse/src/fortran/ta2lpd.f
@@ -0,0 +1,64 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c Copyright (C) DIGITEO 2010 - Yann COLLETTE
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+ subroutine ta2lpd(tail,head,ma,n,lp,la,ls)
+c
+c ta2lpd computes the adjacency vectors lp, la and ls
+c from vectors tail and head for a directed graph
+c NO CHECKING IS MADE on tail, head and n
+c input: tail(ma) = tail nodes
+c head(ma) = head nodes
+c ma = number of edges
+c n = number of nodes
+c output: lp(n+1) = pointer vector
+c la(ma) = vector of arcs
+c ls(ma) = vector of corresponding head nodes
+c
+ integer tail(ma),head(ma),ma,n
+ integer lp(*),la(ma),ls(ma)
+c
+ integer iarc,inode
+c
+c first computation of lp
+c lp(i+1) = number of tail nodes
+c = number of arcs with tail node i+1
+c
+ do 1,inode=1,n+1
+ lp(inode)=0
+ 1 continue
+ do 2,iarc=1,ma
+ lp(tail(iarc)+1)=lp(tail(iarc)+1)+1
+ 2 continue
+c
+c second computation of lp
+c lp(i) = pointer to the first arc
+c with tail i in sorted tail
+c
+ lp(1)=1
+ do 3,inode=2,n
+ lp(inode)=lp(inode-1)+lp(inode)
+ 3 continue
+c
+c computation of la and ls
+c
+ do 4,iarc=1,ma
+ inode=tail(iarc)
+ la(lp(inode))=iarc
+ ls(lp(inode))=head(iarc)
+ lp(inode)=lp(inode)+1
+ 4 continue
+c
+c last computation of lp
+c
+ do 5,inode=n,1,-1
+ lp(inode+1)=lp(inode)
+ 5 continue
+ lp(1)=1
+ end
diff --git a/modules/sparse/src/fortran/ta2lpd.lo b/modules/sparse/src/fortran/ta2lpd.lo
new file mode 100755
index 000000000..d4ebafcc1
--- /dev/null
+++ b/modules/sparse/src/fortran/ta2lpd.lo
@@ -0,0 +1,12 @@
+# src/fortran/ta2lpd.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/ta2lpd.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wcompa.f b/modules/sparse/src/fortran/wcompa.f
new file mode 100755
index 000000000..69ab889b5
--- /dev/null
+++ b/modules/sparse/src/fortran/wcompa.f
@@ -0,0 +1,30 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) 1995-2008 - INRIA - Serger STEER
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ logical function wcompa(ar,ai,br,bi,op)
+c compare two double precision complex numbers a and b
+c! calling sequence
+c logical function dcompa(ar,ai,br,bi,op)
+c ar,ai : real and imaginary part of a
+c br,bi : real and imaginary part of b
+c op is an integer indicator of the comparison to perform
+c op=50 : a==b
+c op=119: a~=b
+c
+ double precision ar,ai,br,bi
+ integer op
+ integer less,great,equal
+ logical l
+ data less/59/,great/60/,equal/50/
+ if(op.eq.equal) then
+ l=ar.eq.br.and.ai.eq.bi
+ elseif(op.eq.less+great) then
+ l=ar.ne.br.or.ai.ne.bi
+ endif
+ wcompa=l
+ end
diff --git a/modules/sparse/src/fortran/wcompa.lo b/modules/sparse/src/fortran/wcompa.lo
new file mode 100755
index 000000000..f697cd374
--- /dev/null
+++ b/modules/sparse/src/fortran/wcompa.lo
@@ -0,0 +1,12 @@
+# src/fortran/wcompa.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wcompa.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wful2sp.f b/modules/sparse/src/fortran/wful2sp.f
new file mode 100755
index 000000000..0881e6aab
--- /dev/null
+++ b/modules/sparse/src/fortran/wful2sp.f
@@ -0,0 +1,29 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wful2sp(ma,na,ar,ai,nel,indr,rr,ri,zeror,zeroi)
+c converts a full matrix to a sparse representation
+ double precision ar(ma,na),ai(ma,na),rr(*),ri(*)
+ double precision zeror,zeroi
+ integer indr(*)
+c
+ nel=0
+ do 5 i=1,ma
+ ni=0
+ do 4 j=1,na
+ if(ar(i,j).ne.zeror.or.ai(i,j).ne.zeroi) then
+ nel=nel+1
+ indr(ma+nel)=j
+ rr(nel)=ar(i,j)
+ ri(nel)=ai(i,j)
+ ni=ni+1
+ endif
+ 4 continue
+ indr(i)=ni
+ 5 continue
+ end
diff --git a/modules/sparse/src/fortran/wful2sp.lo b/modules/sparse/src/fortran/wful2sp.lo
new file mode 100755
index 000000000..aa349050b
--- /dev/null
+++ b/modules/sparse/src/fortran/wful2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wful2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wful2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wij2sp.f b/modules/sparse/src/fortran/wij2sp.f
new file mode 100755
index 000000000..402b1f585
--- /dev/null
+++ b/modules/sparse/src/fortran/wij2sp.f
@@ -0,0 +1,99 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wij2sp(m,n,nel,ij,vr,vi,ind,nind,iw,ierr)
+ double precision vr(nel),vi(nel)
+ integer ij(nel,2),ind(nind),iw(nel)
+c
+ ierr=0
+ if(nel.eq.0) then
+ call iset(m,0,ind,1)
+ return
+ endif
+ call spsort(ij,nel,iw)
+ call wperm(vr,vi,nel,iw)
+c
+ mm=ij(nel,1)
+ nm=ij(1,2)
+ if(nel.ge.2) then
+ do 01 k=2,nel
+ nm=max(nm,ij(k,2))
+ 01 continue
+ endif
+
+c eliminate zero entries, check for doubly defined entries
+c
+c eliminate leading zero entries
+ k0=0
+ 05 k0=k0+1
+ if (vr(k0).eq.0.0d0.and.vi(k0).eq.0.0d0.and.k0.lt.nel) goto 05
+ if (vr(k0).eq.0.0d0.and.vi(k0).eq.0.0d0) then
+ nel1=0
+ goto 10
+ endif
+
+ k1=1
+ ij(k1,1)=ij(k0,1)
+ ij(k1,2)=ij(k0,2)
+ vr(k1)=vr(k0)
+ vi(k1)=vi(k0)
+ if(nel.gt.k0) then
+ do 08 k=k0+1,nel
+ if (vr(k).ne.0.0d0.or.vi(k).ne.0.0d0) then
+ if(ij(k,1).ne.ij(k1,1).or.ij(k,2).ne.ij(k1,2)) then
+ k1=k1+1
+ ij(k1,1)=ij(k,1)
+ ij(k1,2)=ij(k,2)
+ vr(k1)=vr(k)
+ vi(k1)=vi(k)
+ else
+ vr(k1) = vr(k1) + vr(k)
+ vi(k1) = vi(k1) + vi(k)
+c if(vr(k1).ne.vr(k).or.vi(k1).ne.vi(k)) then
+c ierr=3
+c return
+c endif
+ endif
+ endif
+ 08 continue
+ endif
+ nel1=k1
+
+ 10 continue
+
+ if(n.gt.0) then
+ if(n.lt.nm.or.m.lt.mm) then
+ ierr=1
+ return
+ endif
+ else
+ n=nm
+ m=mm
+ endif
+ if(nind.lt.m+nel1) then
+ ierr=2
+ return
+ endif
+c calcul du nombre d'element non nul par lignes et tri par colonne
+c
+ i0=1
+ do 20 lp=1,m
+ i=i0-1
+ 21 i=i+1
+ if(i.le.nel1) then
+ if(ij(i,1).eq.lp) goto 21
+ endif
+ nl=i-i0
+c nl est le nombre d'element dans la ligne
+ ind(lp)=nl
+ i0=i
+ 20 continue
+ call icopy(nel1,ij(1,2),1,ind(m+1),1)
+ nel=nel1
+ end
+
diff --git a/modules/sparse/src/fortran/wij2sp.lo b/modules/sparse/src/fortran/wij2sp.lo
new file mode 100755
index 000000000..a4c6eb04a
--- /dev/null
+++ b/modules/sparse/src/fortran/wij2sp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wij2sp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wij2sp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wperm.f b/modules/sparse/src/fortran/wperm.f
new file mode 100755
index 000000000..a298e0da9
--- /dev/null
+++ b/modules/sparse/src/fortran/wperm.f
@@ -0,0 +1,47 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wperm(vr,vi,nv,ind)
+c apply an in-situ permutation
+ double precision vr(nv),vi(nv),xr,xi
+ integer ind(nv)
+c
+ xr=vr(1)
+ xi=vi(1)
+ i3=1
+ i0=1
+ i=i0
+ 10 continue
+ if(ind(i).eq.i0) then
+c end of a permutation cycle
+ vr(i)=xr
+ vi(i)=xi
+ ind(i)=-ind(i)
+c look for first positive ind(i)
+ i0=i3
+ 11 i0=i0+1
+ if(i0.gt.nv) goto 20
+ if(ind(i0).lt.0) goto 11
+c beginning of a permutation cycle
+ i3=i0
+ i=i0
+ xr=vr(i0)
+ xi=vi(i0)
+ else
+ vr(i)=vr(ind(i))
+ vi(i)=vi(ind(i))
+ ind(i)=-ind(i)
+ i=-ind(i)
+ endif
+ goto 10
+ 20 continue
+
+ do 30 i=1,nv
+ ind(i)=-ind(i)
+ 30 continue
+ end
diff --git a/modules/sparse/src/fortran/wperm.lo b/modules/sparse/src/fortran/wperm.lo
new file mode 100755
index 000000000..370f0c039
--- /dev/null
+++ b/modules/sparse/src/fortran/wperm.lo
@@ -0,0 +1,12 @@
+# src/fortran/wperm.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wperm.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/writebuf.f b/modules/sparse/src/fortran/writebuf.f
new file mode 100755
index 000000000..44d24197c
--- /dev/null
+++ b/modules/sparse/src/fortran/writebuf.f
@@ -0,0 +1,19 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) 2007-2008 - INRIA - Allan CORNET
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+c ====================================
+ subroutine writebufspc(buffer,finval)
+
+ character*(*) buffer
+ integer finval
+
+ write(buffer(1:4),'(i4)') finval
+
+ end
+c ====================================
diff --git a/modules/sparse/src/fortran/writebuf.lo b/modules/sparse/src/fortran/writebuf.lo
new file mode 100755
index 000000000..cc24d4394
--- /dev/null
+++ b/modules/sparse/src/fortran/writebuf.lo
@@ -0,0 +1,12 @@
+# src/fortran/writebuf.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/writebuf.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wsmsp.f b/modules/sparse/src/fortran/wsmsp.f
new file mode 100755
index 000000000..824e72d6b
--- /dev/null
+++ b/modules/sparse/src/fortran/wsmsp.f
@@ -0,0 +1,88 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wsmsp(nrb,ncb,nca,br,bi,mrb,ar,ai,nela,inda,cr,ci,
+ $ mrc,itb,ita)
+c multiply a full complex matrix stored in b on right by a sparse
+c complex matrix stored in a,inda. Put result in c.
+c*** input
+c nrb actual number of rows in b.
+c ncb actual number of columns in b and row of a
+c nca actual number of columns in a and c
+c br,bi a two-dimensional array containing all the
+c elements of the first matrix.
+c mrb row-dimension of b in calling routine.
+c ar,ai a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=nra number of non-zero elements in row i of a.
+c inda(nra+i) 1<=i<nela column index of i'th non-zero element of a.
+c mrc row dimension of c in calling routine.
+c ita real/complex a matrix type
+c set ita=0 if a is real
+c itb real/complex b matrix type
+c set itb=0 if b is real
+c***output
+c cr,ci a two-dimensional array containing all the
+c elements of the product matrix.
+c!
+ double precision ar(nela),ai(nela), br(mrb,ncb),bi(mrb,ncb)
+ double precision cr(mrc,nca),ci(mrc,nca)
+ integer inda(*)
+
+c nra,nca are number of rows,columns in a.
+ nra = ncb
+c nrc,ncc are number of rows,columns in c.
+ nrc = nrb
+ ncc = nca
+
+c clear c to zero.
+ 10 do 30 i=1,nrc
+ do 20 j=1,ncc
+ cr(i,j) = 0.0d0
+ ci(i,j) = 0.0d0
+ 20 continue
+ 30 continue
+c n2 will be pointer to end of row k of a.
+ n2 = 0
+c k will be row-index for a.
+ do 60 k=1,nra
+c pick out number of non-zeros in row k of a.
+ nir = inda(k)
+ if (nir.eq.0) go to 60
+c if no non-zeros skip processing of row k.
+c n1 will point to start of row k in a,n2 to end of row.
+ n1 = n2 + 1
+ n2 = n2 + nir
+c process row k of a,i.e.
+c form all products of b(i,k) with non-zero a(k,j),
+c add into c(i,j)
+c l points to non-zero elements in row k of a.
+ do 50 l=n1,n2
+ j = inda(nra+l)
+ if(ita.eq.0) then
+ do 40 i=1,nrb
+ cr(i,j) = cr(i,j) + br(i,k)*ar(l)
+ ci(i,j) = ci(i,j) + bi(i,k)*ar(l)
+ 40 continue
+ elseif(itb.eq.0) then
+ do 41 i=1,nrb
+ cr(i,j) = cr(i,j) + br(i,k)*ar(l)
+ ci(i,j) = ci(i,j) + br(i,k)*ai(l)
+ 41 continue
+ else
+ do 42 i=1,nrb
+ cr(i,j) = cr(i,j) + br(i,k)*ar(l)-bi(i,k)*ai(l)
+ ci(i,j) = ci(i,j) + bi(i,k)*ar(l)+br(i,k)*ai(l)
+ 42 continue
+ endif
+ 50 continue
+ 60 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/wsmsp.lo b/modules/sparse/src/fortran/wsmsp.lo
new file mode 100755
index 000000000..a605ea14b
--- /dev/null
+++ b/modules/sparse/src/fortran/wsmsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wsmsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wsmsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wsosp.f b/modules/sparse/src/fortran/wsosp.f
new file mode 100755
index 000000000..3c9c865f0
--- /dev/null
+++ b/modules/sparse/src/fortran/wsosp.f
@@ -0,0 +1,202 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wsosp(op,ma,na,ar,ai,mb,nb,br,bi,nelb,indb,
+ $ nelc,indc,ierr,ita,itb)
+c!purpose
+c compare the elements of a full matrix A and a sparse matrix B
+c!parameters
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a: (ma,na) array
+c b : array.
+c Contain non zero elements of the B matrix
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c indb : b matrix control data:
+c indb(i) 1<=i<=mb contains the number of ith row non zero elements
+c of b
+c indb(mb+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelc column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision ar(ma,na),ai(ma,na),br(nelb),bi(nelb)
+ integer op,nr,nc,nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,j2
+ double precision tr,ti,tai,tbi
+ logical wcompa,z,z1
+ external wcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ tr=ar(1,1)
+ if(ita.ne.0) ti=ai(1,1)
+ z=wcompa(tr,ti,0.0d0,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (wcompa(tr,ti,0.0d0,0.0d0,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if(itb.eq.0) then
+ z1=wcompa(tr,ti,br(jb),0.0d0,op)
+ else
+ z1=wcompa(tr,ti,br(jb),bi(jb),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ tr=0.0d0
+ ti=0.0d0
+ if(indb(1).eq.1) then
+ tr=br(1)
+ if(itb.ne.0) ti=bi(1)
+ endif
+ z=wcompa(0.0d0,0.0d0,tr,ti,op)
+ do 20 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 12 j=1,nc
+ if(ita.eq.0) then
+ z1=wcompa(ar(i,j),0.0d0,tr,ti,op)
+ else
+ z1=wcompa(ar(i,j),ai(i,j),tr,ti,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ indc(i)=jc-kc
+ kc=jc
+ 20 continue
+ else
+ z=wcompa(0.0d0,0.0d0,0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+c . no non zero elements in the ith row of b
+ do 23 j=1,nc
+ if(ita.eq.0) then
+ z1=wcompa(ar(i,j),0.0d0,0.0d0,0.0d0,op)
+ else
+ z1=wcompa(ar(i,j),ai(i,j),0.0d0,0.0d0,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j2.eq.j) then
+ if(ita.eq.0) then
+ tai=0.0d0
+ else
+ tai=ai(i,j)
+ endif
+ if(itb.eq.0) then
+ tbi=0.0d0
+ else
+ tbi=bi(jb)
+ endif
+ if (wcompa(ar(i,j),tai,br(jb),tbi,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if(ita.eq.0) then
+ z1=wcompa(ar(i,j),0.0d0,0.0d0,0.0d0,op)
+ else
+ z1=wcompa(ar(i,j),ai(i,j),0.0d0,0.0d0,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/wsosp.lo b/modules/sparse/src/fortran/wsosp.lo
new file mode 100755
index 000000000..38b7bbba4
--- /dev/null
+++ b/modules/sparse/src/fortran/wsosp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wsosp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wsosp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspasp.f b/modules/sparse/src/fortran/wspasp.f
new file mode 100755
index 000000000..971c8f50b
--- /dev/null
+++ b/modules/sparse/src/fortran/wspasp.f
@@ -0,0 +1,153 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspasp(nr,nc,ar,ai,nela,inda,br,bi,nelb,indb,cr,ci,
+ $ nelc,indc,ia,ib,ierr)
+c!pupose
+c add two sparse complex matrices.
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c ia : on input specifies if a has an imaginary part
+c ia=0 : no imaginary part
+c ia=1 : the imaginary part of a is stored in ai
+c ib : on input specifies if b has an imaginary part
+c ib=0 : no imaginary part
+c ib=1 : the imaginary part of b is stored in bi
+c!
+ double precision ar(nela),ai(nela),br(nelb),bi(nelb),cr(*),ci(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+ double precision tr,ti
+c
+ nelmx=nelc
+ ierr=0
+c clear indc.
+ do 1 i = 1,nr
+ indc(i) = 0
+ 1 continue
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 7
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 7
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index less than b-index transfer a-element to c.
+ 7 if (jc.gt.nelmx) go to 16
+ cr(jc) = ar(ja)
+ if(ia.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = ai(ja)
+ endif
+ 8 continue
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index equals b-index add elements ,place sum in c.
+ 9 tr = ar(ja)+br(jb)
+ ti=0.0d0
+ if(ia.ne.0) ti=ti+ai(ja)
+ if(ib.ne.0) ti=ti+bi(jb)
+c ignore sum element if zero.
+ jb = jb+1
+ if (tr.eq.0.0d0.and.ti.eq.0.0d0) go to 11
+ if (jc.gt.nelmx) go to 16
+ cr(jc) = tr
+ ci(jc) = ti
+ go to 8
+c if a-index greater than b-index transfer b-element to c.
+ 10 if (jc.gt.nelmx) go to 16
+ cr(jc) = br(jb)
+ if(ib.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = bi(jb)
+ endif
+ indc(jc+kf)=j2
+ jb = jb+1
+ jc = jc+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (jb.gt.kb) go to 13
+ if (jc.gt.nelmx) go to 16
+ cr(jc) = br(jb)
+ if(ib.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = bi(jb)
+ endif
+ j2 = indb(jb+kf)
+ indc(jc+kf)=j2
+ jc = jc+1
+ jb = jb+1
+ go to 12
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspasp.lo b/modules/sparse/src/fortran/wspasp.lo
new file mode 100755
index 000000000..9e6e8fc3a
--- /dev/null
+++ b/modules/sparse/src/fortran/wspasp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspasp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspasp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspcle.f b/modules/sparse/src/fortran/wspcle.f
new file mode 100755
index 000000000..142f51290
--- /dev/null
+++ b/modules/sparse/src/fortran/wspcle.f
@@ -0,0 +1,47 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspcle(ma,na,ar,ai,nela,inda,rr,ri,nelr,indr,
+ $ abstol,reltol)
+c cleans a sparse matrix
+c!
+ integer inda(*),indr(*)
+ integer ma,na,nela,nelr
+ double precision ar(nela), ai(nela),rr(*),ri(*),abstol,reltol
+ double precision amax,aa
+c
+ amax=0.0d0
+ do 10 i=1,nela
+ amax=max(amax,abs(ar(i))+abs(ai(i)))
+ 10 continue
+c
+ i0=0
+ i1=i0
+ i=1
+ ni=inda(i)
+ nelr=0
+ do 40 k=1,nela
+ 38 i0=i0+1
+ if(i0-i1.le.ni) goto 39
+ i1=i0
+ indr(i)=0
+ i=i+1
+ ni=inda(i)
+ goto 38
+ 39 j=inda(ma+k)
+ aa=abs(ar(k))+abs(ai(k))
+ if(aa.ge.abstol.and.aa.gt.reltol*amax) then
+ nelr=nelr+1
+ indr(i)=indr(i)+1
+ indr(ma+nelr)=inda(ma+k)
+ rr(nelr)=ar(k)
+ ri(nelr)=ai(k)
+ endif
+ 40 continue
+ end
+
diff --git a/modules/sparse/src/fortran/wspcle.lo b/modules/sparse/src/fortran/wspcle.lo
new file mode 100755
index 000000000..9a3bfab71
--- /dev/null
+++ b/modules/sparse/src/fortran/wspcle.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspcle.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspcle.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspcsp.f b/modules/sparse/src/fortran/wspcsp.f
new file mode 100755
index 000000000..deb43edeb
--- /dev/null
+++ b/modules/sparse/src/fortran/wspcsp.f
@@ -0,0 +1,99 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspcsp(op,ma,na,ar,ai,nela,inda,mb,nb,br,bi,nelb,indb,
+ $ cr,ci,nelc,indc,ita,itb)
+c!purpose
+c concatenation of two sparse matrices.
+c!parameters
+c op : integer flag which specifies the concatenation to perform
+c op=0 : row concatenation
+c op=1 : column concatenation
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c a,b : arrays.
+c Contain non zero elements of first,second sparse matrices.
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mc contains the number of ith row non zero elements
+c of c
+c indc(mc+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision ar(*),ai(*),br(*),bi(*),cr(*),ci(*)
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*)
+c
+c
+ if(op.eq.0) then
+c row concatenation
+ ia=1
+ ib=1
+ ic=1
+ do 20 i=1,ma
+ call icopy(inda(i),inda(ma+ia),1,indc(ma+ic),1)
+ call unsfdcopy(inda(i),ar(ia),1,cr(ic),1)
+ if(ita.eq.0) then
+ call dset(inda(i),0.0d0,ci(ic),1)
+ else
+ call unsfdcopy(inda(i),ai(ia),1,ci(ic),1)
+ endif
+ ic=ic+inda(i)
+ ia=ia+inda(i)
+ if (indb(i).gt.0) then
+ call unsfdcopy(indb(i),br(ib),1,cr(ic),1)
+ if(itb.eq.0) then
+ call dset(indb(i),0.0d0,ci(ic),1)
+ else
+ call unsfdcopy(indb(i),bi(ib),1,ci(ic),1)
+ endif
+ do 10 k=1,indb(i)
+ indc(ma+ic)=indb(mb+ib)+na
+ ic=ic+1
+ ib=ib+1
+ 10 continue
+ endif
+ indc(i)=inda(i)+indb(i)
+ 20 continue
+ nelc=nela+nelb
+ else
+c column concatenation
+ call icopy(ma,inda,1,indc,1)
+ call icopy(mb,indb,1,indc(ma+1),1)
+ call icopy(nela,inda(ma+1),1,indc(ma+mb+1),1)
+ call icopy(nelb,indb(mb+1),1,indc(ma+mb+1+nela),1)
+ call unsfdcopy(nela,ar,1,cr,1)
+ if(ita.eq.0) then
+ call dset(nela,0.0d0,ci,1)
+ else
+ call unsfdcopy(nela,ai,1,ci,1)
+ endif
+ call unsfdcopy(nelb,br,1,cr(nela+1),1)
+ if(itb.eq.0) then
+ call dset(nelb,0.0d0,ci(nela+1),1)
+ else
+ call unsfdcopy(nelb,bi,1,ci(nela+1),1)
+ endif
+ nelc=nela+nelb
+ endif
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/wspcsp.lo b/modules/sparse/src/fortran/wspcsp.lo
new file mode 100755
index 000000000..1982a6af8
--- /dev/null
+++ b/modules/sparse/src/fortran/wspcsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspcsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspcsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspe2.f b/modules/sparse/src/fortran/wspe2.f
new file mode 100755
index 000000000..ada576512
--- /dev/null
+++ b/modules/sparse/src/fortran/wspe2.f
@@ -0,0 +1,70 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspe2(ma,na,ar,ai,nela,inda,i,ni,j,nj,
+ $ mr,nr,rr,ri,nelr,indr,ptr,ierr)
+c extract a submatrix from a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptr(*)
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision ar(nela),ai(nela),rr(*),ri(*)
+ logical allrow,allcol
+c
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ endif
+ ptr(1)=1
+ do 10 kk=1,ma
+ ptr(kk+1)=ptr(kk)+inda(kk)
+ 10 continue
+ jr=1
+ do 40 l=1,mr
+ indr(l)=0
+ if(allrow) then
+ ii=l
+ else
+ ii=i(l)
+ endif
+ if(inda(ii).eq.0) goto 40
+ if(allcol) then
+ indr(l)=inda(ii)
+ call icopy(inda(ii),inda(ma+ptr(ii)),1,indr(mr+jr),1)
+ call unsfdcopy(inda(ii),ar(ptr(ii)),1,rr(jr),1)
+ call unsfdcopy(inda(ii),ai(ptr(ii)),1,ri(jr),1)
+ jr=jr+inda(ii)
+ else
+ do 30 k=1,nj
+ jj=j(k)
+ do 20 kk=ptr(ii),ptr(ii+1)-1
+ if(inda(ma+kk).eq.jj) then
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ rr(jr)=ar(kk)
+ ri(jr)=ai(kk)
+ jr=jr+1
+ goto 30
+ endif
+ 20 continue
+ 30 continue
+ endif
+ 40 continue
+ nelr=jr-1
+ return
+ end
+
+
+
diff --git a/modules/sparse/src/fortran/wspe2.lo b/modules/sparse/src/fortran/wspe2.lo
new file mode 100755
index 000000000..a4b8d0e76
--- /dev/null
+++ b/modules/sparse/src/fortran/wspe2.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspe2.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspe2.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspful.f b/modules/sparse/src/fortran/wspful.f
new file mode 100755
index 000000000..7420d02dd
--- /dev/null
+++ b/modules/sparse/src/fortran/wspful.f
@@ -0,0 +1,30 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspful(ma,na,ar,ai,nela,inda,rr,ri)
+
+ double precision ar(nela),ai(nela),rr(*),ri(*)
+ integer ma,na,nela,inda(*)
+c
+ call dset(ma*na,0.0d0,rr,1)
+ call dset(ma*na,0.0d0,ri,1)
+ i0=0
+ i1=i0
+ i=1
+ do 10 k=1,nela
+ 08 i0=i0+1
+ if(i0-i1.gt.inda(i)) then
+ i1=i0
+ i=i+1
+ goto 08
+ endif
+ j=inda(ma+k)
+ rr(1+(i-1)+(j-1)*ma)=ar(k)
+ ri(1+(i-1)+(j-1)*ma)=ai(k)
+ 10 continue
+ end
diff --git a/modules/sparse/src/fortran/wspful.lo b/modules/sparse/src/fortran/wspful.lo
new file mode 100755
index 000000000..2c446278a
--- /dev/null
+++ b/modules/sparse/src/fortran/wspful.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspful.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspful.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspis.f b/modules/sparse/src/fortran/wspis.f
new file mode 100755
index 000000000..4c243a6d2
--- /dev/null
+++ b/modules/sparse/src/fortran/wspis.f
@@ -0,0 +1,399 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspis(ma,na,ar,ai,nela,inda,i,ni,j,nj,
+ $ mb,nb,br,bi,mr,nr,rr,ri,nelr,indr,ierr,ita,itb)
+c insert a full submatrix in a sparse matrix
+c !
+ integer inda(*),indr(*),i(*),j(*)
+ integer mb,nb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision ar(nela),ai(nela),rr(*),ri(*),br(mb,*),bi(mb,*)
+ double precision t
+ logical allrow,allcol,bscal
+ integer findl
+ external findl
+c
+ nelmx=nelr
+ ierr=0
+ mr=ni
+ nr=nj
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ bscal=mb*nb.eq.1.and.ma*na.gt.1
+ if(.not.bscal) then
+ if(mb*nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call iset(mb,nb,indr,1)
+ jr=1
+ if(mb*nb.ne.0) then
+
+ do 04 l=1,mb
+ do 03 k=1,nb
+ indr(mb+jr)=k
+ rr(jr)=br(l,k)
+ if(itb.ne.0) then
+ ri(jr)=bi(l,k)
+ else
+ ri(jr)=0.0d0
+ endif
+ jr=jr+1
+ 03 continue
+ 04 continue
+ endif
+ nelr=mb*nb
+ else
+ if(ma*na.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call iset(ma,0,indr,1)
+ jr=1
+ if(ma*na.ne.0) then
+ do 06 l=1,ma
+ do 05 k=1,na
+ if(br(1,1).ne.0.0d0) then
+ indr(ma+jr)=k
+ rr(jr)=br(1,1)
+ if(itb.ne.0) then
+ ri(jr)=bi(1,1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ jr=jr+1
+ endif
+ 05 continue
+ 06 continue
+ endif
+ nelr=jr-1
+ endif
+ elseif(allcol) then
+c a(i,:)=b
+ bscal=mb*nb.eq.1.and.na*ni.gt.1
+ jr=1
+ ja=1
+ do 20 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),ar(ja),1,rr(jr),1)
+ if(ita.ne.0) then
+ call unsfdcopy(indr(l),ai(ja),1,ri(jr),1)
+ else
+ call dset(indr(l),0.0d0,ri(jr),1)
+ endif
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+c indr(l)=nb ????
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(jr+nb.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ if(itb.eq.0) then
+ do 10 k1=1,nb
+ if(br(ii,k1).ne.0.0d0) then
+ indr(mr+jr)=k1
+ rr(jr)=br(ii,k1)
+ ri(jr)=0.0d0
+ jr=jr+1
+ endif
+ 10 continue
+ else
+ do 11 k1=1,nb
+ if(abs(br(ii,k1))+abs(bi(ii,k1)).ne.0.0d0)
+ $ then
+ indr(mr+jr)=k1
+ rr(jr)=br(ii,k1)
+ ri(jr)=bi(ii,k1)
+ jr=jr+1
+ endif
+ 11 continue
+ endif
+ endif
+ else
+ if(na.gt.0) then
+ if(jr+na.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ if(itb.eq.0) then
+ if(br(1,1).ne.0.0d0) then
+ do 12 k1=1,na
+ indr(mr+jr)=k1
+ rr(jr)=br(1,1)
+ ri(jr)=0.0d0
+ jr=jr+1
+ 12 continue
+ endif
+ else
+ if(abs(br(1,1))+abs(bi(1,1)).ne.0.0d0) then
+ do 13 k1=1,na
+ indr(mr+jr)=k1
+ rr(jr)=br(1,1)
+ ri(jr)=bi(1,1)
+ jr=jr+1
+ 13 continue
+ endif
+ endif
+ endif
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ endif
+ 20 continue
+ nelr=jr-1
+ elseif(allrow) then
+c a(:,j)=b
+ bscal=mb*nb.eq.1.and.na*nj.gt.1
+ jr=1
+ ja=0
+ do 35 l=1,ma
+ ja1=1
+ nal=inda(l)
+ indr(l)=0
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ rr(jr)=ar(ja+ja1)
+ if(ita.ne.0) then
+ ri(jr)=ai(ja+ja1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c the a(l,k) element is replaced by b(l,jj) element
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(itb.eq.0) then
+ if(br(l,jj).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(l,jj)
+ ri(jr)=0.0d0
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ else
+ if(abs(br(l,jj))+abs(bi(l,jj)).ne.0.0d0
+ $ ) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(l,jj)
+ ri(jr)=bi(l,jj)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ endif
+ endif
+ else
+ if(itb.eq.0) then
+ if(br(1,1).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(1,1)
+ ri(jr)=0.0d0
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ else
+ if(abs(br(1,1))+abs(bi(1,1)).ne.0.0d0)
+ $ then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(1,1)
+ ri(jr)=bi(1,1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ endif
+ endif
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ 31 continue
+ ja=ja+nal
+ 35 continue
+ nelr=jr-1
+ return
+ else
+c a(i,j)=b
+ bscal=mb*nb.eq.1.and.ni*nj.gt.1
+ jr=1
+ ja=0
+ do 45 l=1,mr
+ ja1=1
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr)
+ $ ,1)
+ call unsfdcopy(indr(l),ar(ja+ja1),1,rr(jr),1)
+ if(ita.ne.0) then
+ call unsfdcopy(indr(l),ai(ja+ja1),1,ri(jr),1)
+ else
+ call dset(indr(l),0.0d0,ri(jr),1)
+ endif
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ rr(jr)=ar(ja+ja1)
+ if(ita.ne.0) then
+ ri(jr)=ai(ja+ja1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c * replace a(l,k) element by b(ii,jj) element if non
+c zero
+ if(.not.bscal) then
+ if(nb.gt.0) then
+ if(itb.eq.0) then
+ if(br(ii,jj).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(ii,jj)
+ ri(jr)=0.0d0
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ else
+ t=abs(br(ii,jj))+abs(bi(ii,jj))
+ if(t.ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(ii,jj)
+ ri(jr)=bi(ii,jj)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ endif
+ endif
+ else
+ if(itb.eq.0) then
+ if(br(1,1).ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(1,1)
+ ri(jr)=0.0d0
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ else
+ t=abs(br(1,1))+abs(bi(1,1))
+ if(t.ne.0.0d0) then
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(1,1)
+ ri(jr)=bi(1,1)
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ endif
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1
+ $ =ja1+1
+ endif
+ 42 continue
+ endif
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
+
+
diff --git a/modules/sparse/src/fortran/wspis.lo b/modules/sparse/src/fortran/wspis.lo
new file mode 100755
index 000000000..265a9dbf0
--- /dev/null
+++ b/modules/sparse/src/fortran/wspis.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspis.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspis.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspisp.f b/modules/sparse/src/fortran/wspisp.f
new file mode 100755
index 000000000..0466b49ff
--- /dev/null
+++ b/modules/sparse/src/fortran/wspisp.f
@@ -0,0 +1,252 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspisp(ma,na,ar,ai,nela,inda,i,ni,j,nj,
+ $ mb,nb,br,bi,nelb,indb,mr,nr,rr,ri,nelr,indr,ptrb,
+ $ ierr,ita,itb)
+c extract a submatrix from a sparse matrix
+c!
+ integer inda(*),indr(*),i(*),j(*),ptrb(*)
+ integer indb(*),mb,nb,nelb
+ integer ma,na,ni,nj,mr,nr,nela,nelr,ierr
+ double precision ar(nela),ai(nela),rr(*),ri(*),br(nelb),bi(nelb)
+ logical allrow,allcol
+ integer findl
+ external findl
+c
+ mr=ni
+ nr=nj
+ ierr=0
+ nelmx=nelr
+ allrow=ni.lt.0
+ allcol=nj.lt.0
+ if(allrow) then
+ mr=ma
+ ni=mr
+ else
+ mi=0
+ do 01 kk=1,ni
+ mi=max(mi,i(kk))
+ 01 continue
+ mr=max(ma,mi)
+ endif
+ if(allcol) then
+ nr=na
+ nj=na
+ else
+ mj=0
+ do 02 kk=1,nj
+ mj=max(mj,j(kk))
+ 02 continue
+ nr=max(na,mj)
+ endif
+ if (allrow.and.allcol) then
+c a(:,:)=b
+ call icopy(mb+nelb,indb,1,indr,1)
+ call unsfdcopy(nelb,br,1,rr,1)
+ if(itb.ne.0) then
+ call unsfdcopy(nelb,bi,1,ri,1)
+ else
+ call dset(nelb,0.0d0,ri,1)
+ endif
+ nelr=nelb
+ return
+ elseif(allcol) then
+c a(i,:)=b
+ jr=1
+ jb=1
+ ja=1
+ call sz2ptr(indb,mb,ptrb)
+ do 20 l=1,mr
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c this line is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja),1,indr(mr+jr),1)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call unsfdcopy(indr(l),ar(ja),1,rr(jr),1)
+ if(ita.ne.0) then
+ call unsfdcopy(indr(l),ai(ja),1,ri(jr),1)
+ else
+ call dset(indr(l),0.0d0,ri(jr),1)
+ endif
+ jr=jr+indr(l)
+ ja=ja+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+c all this line is replaced by corresponding b line
+ jb=ptrb(ii)
+ indr(l)=indb(ii)
+ if(jr+indr(l).gt.nelmx) then
+ ierr=1
+ return
+ endif
+ call icopy(indr(l),indb(mb+jb),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),br(jb),1,rr(jr),1)
+ if(itb.ne.0) then
+ call unsfdcopy(indr(l),bi(jb),1,ri(jr),1)
+ else
+ call dset(indr(l),0.0d0,ri(jr),1)
+ endif
+ jr=jr+indr(l)
+ if(l.le.ma) then
+ ja=ja+inda(l)
+ endif
+ endif
+ 20 continue
+ nelr=jr-1
+ elseif(allrow) then
+c a(:,j)=b
+ jr=1
+ ja=0
+ jb=0
+ do 35 l=1,ma
+ ja1=1
+ nbl=indb(l)
+ nal=inda(l)
+ indr(l)=0
+ do 31 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c the a(l,k) element is not modified insert it in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=ar(ja+ja1)
+ if(ita.ne.0) then
+ ri(jr)=ai(ja+ja1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c the a(l,k) element is replaced by b(l,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(jb+jb1)
+ if(itb.ne.0) then
+ ri(jr)=bi(jb+jb1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 31 continue
+ ja=ja+nal
+ jb=jb+nbl
+ 35 continue
+ nelr=jr-1
+ return
+ else
+c a(i,j)=b
+ jr=1
+ ja=0
+ call sz2ptr(indb,mb,ptrb)
+ do 45 l=1,mr
+ ja1=1
+ if(l.le.ma) then
+ nal=inda(l)
+ else
+ nal=0
+ endif
+ indr(l)=0
+ ii=findl(l,i,ni)
+ if(ii.eq.0) then
+c * the a(l,:) is not modified
+ if(l.le.ma) then
+ indr(l)=inda(l)
+ call icopy(indr(l),inda(ma+ja+ja1),1,indr(mr+jr),1)
+ call unsfdcopy(indr(l),ar(ja+ja1),1,rr(jr),1)
+ if(ita.ne.0) then
+ call unsfdcopy(indr(l),ai(ja+ja1),1,ri(jr),1)
+ else
+ call dset(indr(l),0.0d0,ri(jr),1)
+ endif
+ jr=jr+indr(l)
+ ja1=ja1+indr(l)
+ else
+ indr(l)=0
+ endif
+ else
+ jb=ptrb(ii)-1
+ jb1=1
+ nbl=indb(ii)
+ do 42 k=1,nr
+ jj=findl(k,j,nj)
+ if(jj.eq.0) then
+c * insert a(l,k) element insert in r if non zero
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) then
+c * a(l,k) element is non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=ar(ja+ja1)
+ if(ita.ne.0) then
+ ri(jr)=ai(ja+ja1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ ja1=ja1+1
+ endif
+ else
+c * replace a(l,k) element by b(ii,jj) element if non zero
+ jb1=findl(jj,indb(mb+jb+1),nbl)
+ if(jb1.ne.0) then
+c * b(l,jj) element if non zero
+ if(jr+1.gt.nelmx) then
+ ierr=1
+ return
+ endif
+ rr(jr)=br(jb+jb1)
+ if(itb.ne.0) then
+ ri(jr)=bi(jb+jb1)
+ else
+ ri(jr)=0.0d0
+ endif
+ indr(l)=indr(l)+1
+ indr(mr+jr)=k
+ jr=jr+1
+ endif
+ if(ja1.le.nal.and.inda(ma+ja+ja1).eq.k) ja1=ja1+1
+ endif
+ 42 continue
+ endif
+c bug fixed by Ramine
+c ja=ja+na
+ ja=ja+nal
+ 45 continue
+ nelr=jr-1
+ endif
+ end
diff --git a/modules/sparse/src/fortran/wspisp.lo b/modules/sparse/src/fortran/wspisp.lo
new file mode 100755
index 000000000..1249bf6cf
--- /dev/null
+++ b/modules/sparse/src/fortran/wspisp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspisp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspisp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspmat.f b/modules/sparse/src/fortran/wspmat.f
new file mode 100755
index 000000000..32331c79b
--- /dev/null
+++ b/modules/sparse/src/fortran/wspmat.f
@@ -0,0 +1,33 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspmat(ma,na,ar,ai,nela,inda,mr,indr,iw)
+c dspmat reshape a sparse matrix
+ integer inda(*),indr(*),iw(*)
+ integer ma,na,nela
+ double precision ar(*),ai(*)
+c
+ nr=(ma*na)/mr
+ ja=0
+ ki=1
+ kj=nela+1
+ do 20 i=1,ma
+ nira=inda(i)
+ if(nira.ne.0) then
+ do 10 j=1,nira
+ ija=i-1+(inda(ma+ja+j)-1)*ma
+ iw(kj)=int(ija/mr)+1
+ iw(ki)=ija-mr*(iw(kj)-1)+1
+ ki=ki+1
+ kj=kj+1
+ 10 continue
+ ja=ja+nira
+ endif
+ 20 continue
+ call wij2sp(mr,nr,nela,iw,ar,ai,indr,mr+nela,iw(2*nela+1),ierr)
+ end
diff --git a/modules/sparse/src/fortran/wspmat.lo b/modules/sparse/src/fortran/wspmat.lo
new file mode 100755
index 000000000..42ca32ae6
--- /dev/null
+++ b/modules/sparse/src/fortran/wspmat.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspmat.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspmat.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspms.f b/modules/sparse/src/fortran/wspms.f
new file mode 100755
index 000000000..7da907f5d
--- /dev/null
+++ b/modules/sparse/src/fortran/wspms.f
@@ -0,0 +1,87 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspms(nra,nca,ncb,ar,ai,nela,inda,br,bi,mrb,cr,ci,
+ $ mrc,ita,itb)
+c**********************************************************
+c multiply sparse matrix stored in a,inda on right by full
+c matrix stored in b. put result in c.
+c*** input
+c nra actual row dimension of a and c matrix
+c nca actual column dimension of a and row dimension of b matrix
+c ncb actual column dimension of a and c matrices
+c ar,ai a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=nra number of non-zero elements in row i of a.
+c inda(nra+i) 1<=i<nela column index of i'th non-zero element of a.
+c br,bi a two-dimensional array containing all the
+c elements of the second matrix.
+c mrb row-dimension of b in calling routine.
+c mrc row-dimension of c in calling routine.
+c ita real/complex a matrix type
+c set ita=0 if a is real
+c itb real/complex b matrix type
+c set itb=0 if b is real
+c*** output
+c cr,ci a two-dimensional array containing all the
+c elements of the product matrix.
+c!
+ double precision ar(nela),ai(nela), br(mrb,ncb),bi(mrb,ncb)
+ double precision cr(mrc,ncb),ci(mrc,ncb)
+ integer inda(*)
+ double precision tr,ti
+c
+c nrc,ncc are number of rows,columns in c.
+ nrc = nra
+ ncc = ncb
+c clear c to zero.
+ 10 do 30 i=1,nrc
+ do 20 j=1,ncc
+ cr(i,j) = 0.0d0
+ ci(i,j) = 0.0d0
+ 20 continue
+ 30 continue
+c n2 will be pointer to end of row i of a.
+ n2 = 0
+c i will be row-index for a.
+ do 60 i=1,nra
+c pick out number of non-zero elements in row i.
+ nir = inda(i)
+c if no non-zeroes skip processing of row i of a.
+ if (nir.eq.0) go to 60
+c n1 points to start of row i in a,n2 to end.
+ n1 = n2 + 1
+ n2 = n2 + nir
+c process row i of a, i.e. form all products of non-zero a(i,l) with
+c b(l,j); put into c(i,j).
+c k points to non-zero elements in row i of a.
+ do 50 k=n1,n2
+ l = inda(nra+k)
+ tr = ar(k)
+ if(ita.eq.0) then
+ ti=0.0d0
+ else
+ ti = ai(k)
+ endif
+ if(itb.eq.0) then
+ do 40 j=1,ncb
+ cr(i,j) = cr(i,j) + tr*br(l,j)
+ ci(i,j) = ci(i,j) + ti*br(l,j)
+ 40 continue
+ else
+ do 41 j=1,ncb
+ cr(i,j) = cr(i,j) + tr*br(l,j)-ti*bi(l,j)
+ ci(i,j) = ci(i,j) + tr*bi(l,j)+ti*br(l,j)
+ 41 continue
+ endif
+ 50 continue
+ 60 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspms.lo b/modules/sparse/src/fortran/wspms.lo
new file mode 100755
index 000000000..f83a9e796
--- /dev/null
+++ b/modules/sparse/src/fortran/wspms.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspms.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspms.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspmsp.f b/modules/sparse/src/fortran/wspmsp.f
new file mode 100755
index 000000000..ab1bea0bf
--- /dev/null
+++ b/modules/sparse/src/fortran/wspmsp.f
@@ -0,0 +1,159 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspmsp(p,q,r,ar,ai,nela,inda,br,bi,nelb,indb,
+ $ cr,ci,nelc,indc,
+ $ ib,ic,xr,xi,xb,ita,itb,ierr)
+c multiply complex sparse matrices by the method of gustafson,acm t.o.m.s.
+c vol 4 (1978) p250.
+c*** input
+c p number of rows in a,
+c q number of columns in a
+c r number of columns in b
+c a a one-dimensional array containing the non-zero elements
+c of the first matrix,arranged row-wise, but not
+c necessarily in order within rows.
+c nela number of non-zero elements in a
+c inda(i) 1<=i<=p number of non-zero elements in row i of a.
+c inda(p+i) 1<=i<nela column index of i'th non-zero element of a.
+
+c b,nelb,indb as a,nela,inda but for second matrix.
+c nelc maximum non zero element for the result
+
+c*** output
+c c,nelc,indc as a,nela,inda but for result matrix.
+c c a one-dimensional array containing the non-zero elements
+c of the product matrix,arranged row-by-row,but not
+c usually in order within rows.
+c ordering by increasing column number may be attained
+c by subsequently calling trsmgu twice,i.e.:
+c call trsmgu(c,mc,ic,ct,mct,ict)
+c call trsmgu(ct,mct,ic,c,mc,ic)
+c where ct,mct,ict are working storage areas of
+c same dimension as c,mc,ic respectively.
+c ierr =1 if space exceeded in c
+c =0 otherwise.
+c*** working storage parameters.
+c ib ib(i) is address in b of first element of row i of b.
+c ib(number of rows +1)=number of elements in b,+1.
+c ic as above,but for c.
+c x a one-dimensional array of size ge number of cols of c,
+c to contain elements of current row of c,
+c in full,i.e. non-sparse form.
+c xb an array of same size as x. xb(j)=i if element in row i,
+c column j of c is non-zero.
+c!
+ integer p, q, r, nela, nelb, nelc, ierr
+ double precision ar(nela),ai(nela), br(nelb),bi(nelb)
+ double precision cr(*),ci(*), xr(r),xi(r)
+c the following may be changed on ibm/370 type machines by:-
+ integer inda(*), indb(*), ib(*), indc(*), ic(*), xb(r)
+
+ integer v, vp, vpppp4
+
+ ndc = nelc
+ ndmc = nelc + p
+ ib(1) = 1
+
+ do 20 i=1,q
+ ib(i+1) = ib(i) + indb(i)
+ 20 continue
+ ierr = 0
+ ip = 1
+c initialize the non-zero -element indicator for row i of c.
+ do 30 v=1,r
+ xb(v) = 0
+ 30 continue
+c process the rows of a.
+c inext will point to start of next row,i.e. row i+1
+ inext = 1
+ do 80 i=1,p
+ ic(i) = ip
+c istart points to start of current row.
+ istart = inext
+ inext = inext + inda(i)
+ i1 = istart
+ i2 = inext - 1
+ if (i1.gt.i2) go to 80
+c process row i of a.
+ do 60 jp=i1,i2
+c j is column-index of current element of a,i.e. row-index of row of b
+c to be processed.
+ jpppp4 = jp + p
+ j = inda(jpppp4)
+ i3 = ib(j)
+ i4 = ib(j+1) - 1
+ if (i3.gt.i4) go to 60
+c process row of b.
+ do 50 kp=i3,i4
+c k is column index of current element of b.
+ kppqp4 = kp + q
+ k = indb(kppqp4)
+c check if contribution already exixts to c(i,k)
+ if (xb(k).eq.i) go to 40
+c set column-index and non-zero indicator for new element of c.
+ ipppp4 = ip + p
+ if (ipppp4.gt.ndmc) then
+ ierr=1
+ return
+ endif
+ indc(ipppp4) = k
+ ip = ip + 1
+ xb(k) = i
+ if(ita.eq.0) then
+ xr(k) = ar(jp)*br(kp)
+ xi(k) = ar(jp)*bi(kp)
+ elseif(itb.eq.0) then
+ xr(k) = ar(jp)*br(kp)
+ xi(k) = ai(jp)*br(kp)
+ else
+ xr(k) = ar(jp)*br(kp) - ai(jp)*bi(kp)
+ xi(k) = ar(jp)*bi(kp) + ai(jp)*br(kp)
+ endif
+ go to 50
+c add new contribution to existing element of c
+ 40 continue
+ if(ita.eq.0) then
+ xr(k) = xr(k) + ar(jp)*br(kp)
+ xi(k) = xi(k) + ar(jp)*bi(kp)
+ elseif(itb.eq.0) then
+ xr(k) = xr(k) + ar(jp)*br(kp)
+ xi(k) = xi(k) + ai(jp)*br(kp)
+ else
+ xr(k) = xr(k) + ar(jp)*br(kp) - ai(jp)*bi(kp)
+ xi(k) = xi(k) + ar(jp)*bi(kp) + ai(jp)*br(kp)
+ endif
+ 50 continue
+ 60 continue
+c check for overflow in c.
+ if ((ip-1).gt.ndc) then
+ ierr=1
+ return
+ endif
+ i5 = ic(i)
+ i6 = ip - 1
+c extract non-zeros from current row of c (stored in x).
+ do 70 vp=i5,i6
+ vpppp4 = vp + p
+ v = indc(vpppp4)
+ cr(vp) = xr(v)
+ ci(vp) = xi(v)
+ 70 continue
+ 80 continue
+c ic(p+1)= number of non-zeros in c,+1.
+ ic(p+1) = ip
+c extract control information in required form for indc.
+ do 90 i=1,p
+ indc(i) = ic(i+1) - ic(i)
+ if(indc(i).gt.1) then
+ call isort1(indc(p+ic(i)),indc(i),xb,1)
+ call wperm(cr(ic(i)),ci(ic(i)),indc(i),xb)
+ endif
+ 90 continue
+ nelc = ip - 1
+ end
diff --git a/modules/sparse/src/fortran/wspmsp.lo b/modules/sparse/src/fortran/wspmsp.lo
new file mode 100755
index 000000000..112931d05
--- /dev/null
+++ b/modules/sparse/src/fortran/wspmsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspmsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspmsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspos.f b/modules/sparse/src/fortran/wspos.f
new file mode 100755
index 000000000..ed01dcb63
--- /dev/null
+++ b/modules/sparse/src/fortran/wspos.f
@@ -0,0 +1,199 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspos(op,ma,na,ar,ai,nela,inda,mb,nb,br,bi,
+ $ nelc,indc,ierr,ita,itb)
+c!purpose
+c compare the elements of a sparse matrix A and a full matrix B.
+c!parameters
+c a : array.
+c Contain non zero elements of the A matrix
+c ma,na: row and column dimension of the a matrix
+c mb,nb: row and column dimension of the b matrix
+c nela :integer: number of non zero elements of a
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=ma contains the number of ith row non zero elements
+c of a
+c inda(ma+i) 1<=i<=nela column index of each non zero element
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=mr contains the number of ith row non zero elements
+c of c
+c indc(mr+i) 1<=i<=nelb column index of each non zero element
+c b :(mb,nb) matrix
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision ar(nela),ai(nela),br(mb,nb),bi(mb,nb)
+ integer op,nr,nc,nela,inda(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1
+ double precision tr,ti,tai,tbi
+ logical wcompa,z,z1
+ external wcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ tr=0.0d0
+ ti=0.0d0
+ if(inda(1).eq.1) then
+ tr=ar(1)
+ ti=ai(1)
+ endif
+ z=wcompa(tr,ti,0.0d0,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ jc=kc
+ do 04 j=1,nc
+ if(itb.eq.0) then
+ z1=wcompa(tr,ti,br(i,j),0.0d0,op)
+ else
+ z1=wcompa(tr,ti,br(i,j),bi(i,j),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 04 continue
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ tr=br(1,1)
+ ti=0.0d0
+ if(itb.ne.0) ti=bi(1,1)
+ z=wcompa(0.0d0,0.0d0,tr,ti,op)
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if(ita.eq.0) then
+ z1=wcompa(ar(ja),0.0d0,tr,ti,op)
+ else
+ z1=wcompa(ar(ja),ai(ja),tr,ti,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=wcompa(0.0d0,0.0d0,0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ do 22 j=1,nc
+ if(itb.eq.0) then
+ z1=wcompa(0.0d0,0.0d0,br(i,j),0.0d0,op)
+ else
+ z1=wcompa(0.0d0,0.0d0,br(i,j),bi(i,j),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ else
+ j1=inda(nr+ja)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if(ita.eq.0) then
+ tai=0.0d0
+ else
+ tai=ai(ja)
+ endif
+ if(itb.eq.0) then
+ tbi=0.0d0
+ else
+ tbi=bi(i,j)
+ endif
+ if (wcompa(ar(ja),tai,br(i,j),tbi,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ else
+ if(itb.eq.0) then
+ z1=wcompa(0.0d0,0.0d0,br(i,j),0.0d0,op)
+ else
+ z1=wcompa(0.0d0,0.0d0,br(i,j),bi(i,j),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ ka=ka+inda(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
diff --git a/modules/sparse/src/fortran/wspos.lo b/modules/sparse/src/fortran/wspos.lo
new file mode 100755
index 000000000..f024302fa
--- /dev/null
+++ b/modules/sparse/src/fortran/wspos.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspos.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspos.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wsposp.f b/modules/sparse/src/fortran/wsposp.f
new file mode 100755
index 000000000..e0c9d77d6
--- /dev/null
+++ b/modules/sparse/src/fortran/wsposp.f
@@ -0,0 +1,307 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wsposp(op,ma,na,ar,ai,nela,inda,mb,nb,br,bi,nelb,indb,
+ $ nelc,indc,ierr,ita,itb)
+c!purpose
+c compare the elements of two complex sparse matrices.
+c!parameters
+c op : integer flag which specifies the comparison to perform
+c see routine dcompa for more precision
+c ma,na: row and column dimension of the a matrix
+c a,b : arrays.
+c Contain non zero elements of first,second sparse matrices.
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c !
+ double precision ar(nela),ai(nela),br(nelb),bi(nelb)
+ integer op,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,i,ja,j1,j2
+ double precision tr,ti,tai,tbi
+ logical wcompa,z,z1
+ external wcompa
+c
+ nr=max(ma,mb)
+ nc=max(na,nb)
+c
+ nelmx=nelc
+ ierr=0
+
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 1
+ kb = 1
+ kc = 1
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ if(ma*na.eq.1.and.mb*nb.gt.1) then
+c compare all element of b with scalar a
+ tr=0.0d0
+ ti=0.0d0
+ if(inda(1).eq.1) then
+ tr=ar(1)
+ if(ita.eq.1) ti=ai(1)
+ endif
+ z=wcompa(tr,ti,0.0d0,0.0d0,op)
+ do 10 i=1,nr
+ indc(i)=0
+ nirb=indb(i)
+ jb=kb
+ jc=kc
+ if(nirb.eq.0) then
+ do 03 j=1,nc
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 03 continue
+ else
+ j2=indb(nr+jb)
+ do 04 j=1,nc
+ if(j2.eq.j) then
+ if(itb.eq.0) then
+ z1=wcompa(tr,ti,br(jb),0.0d0,op)
+ else
+ z1=wcompa(tr,ti,br(jb),bi(jb),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ else
+ if (z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 04 continue
+ endif
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 10 continue
+
+ elseif(ma*na.gt.1.and.mb*nb.eq.1) then
+c compare all elements of a with scalar b
+ tr=0.0d0
+ ti=0.0d0
+ if(indb(1).eq.1) then
+ tr=br(1)
+ if(itb.ne.0) ti=bi(1)
+ endif
+ z=wcompa(0.0d0,0.0d0,tr,ti,op)
+ do 20 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ ja=ka
+ jc=kc
+ if(nira.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 11 j=1,nc
+ indc(nr+kc-1+j)=j
+ 11 continue
+ jc=kc+nc
+ endif
+ else
+ j1=inda(nr+ja)
+ do 12 j=1,nc
+ if(j1.eq.j) then
+ if(ita.eq.0) then
+ z1=wcompa(ar(ja),0.0d0,tr,ti,op)
+ else
+ z1=wcompa(ar(ja),ai(ja),tr,ti,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 12 continue
+ endif
+ indc(i)=jc-kc
+ ka=ka+nira
+ kc=jc
+ 20 continue
+ else
+ z=wcompa(0.0d0,0.0d0,0.0d0,0.0d0,op)
+ do 30 i=1,nr
+ indc(i)=0
+ nira=inda(i)
+ nirb=indb(i)
+ ja=ka
+ jb=kb
+ jc=kc
+ if(nira.eq.0) then
+ if(nirb.eq.0) then
+ if(z) then
+ if(kc+nc.gt.nelmx) goto 99
+ indc(i)=nc
+ do 21 j=1,nc
+ indc(nr+kc-1+j)=j
+ 21 continue
+ jc=kc+nc
+ endif
+ else
+ j2=indb(nr+jb)
+ do 22 j=1,nc
+ if(j2.eq.j) then
+ if(itb.eq.0) then
+ z1=wcompa(0.0d0,0.0d0,br(jb),0.0d0,op)
+ else
+ z1=wcompa(0.0d0,0.0d0,br(jb),bi(jb),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 22 continue
+ endif
+ else
+ if(nirb.eq.0) then
+ j1=inda(nr+ja)
+ do 23 j=1,nc
+ if(j1.eq.j) then
+ if(ita.eq.0) then
+ z1=wcompa(ar(ja),0.0d0,0.0d0,0.0d0,op)
+ else
+ z1=wcompa(ar(ja),ai(ja),0.0d0,0.0d0,op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ 23 continue
+ else
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ do 24 j=1,nc
+ if(j1.eq.j) then
+ if(j2.eq.j) then
+ if(ita.eq.0) then
+ tai=0.0d0
+ else
+ tai=ai(ja)
+ endif
+ if(itb.eq.0) then
+ tbi=0.0d0
+ else
+ tbi=bi(jb)
+ endif
+ if (wcompa(ar(ja),tai,br(jb),tbi,op)) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j1=inda(nr+ja)
+ j2=indb(nr+jb)
+ else
+ if(ita.eq.0) then
+ z1=wcompa(ar(ja),0.0d0,0.0d0,0.0d0,op)
+ else
+ z1=wcompa(ar(ja),ai(ja),0.0d0,0.0d0,op)
+ endif
+
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(ja-ka+1.lt.nira) ja=ja+1
+ j1=inda(nr+ja)
+ endif
+ else
+ if(j2.eq.j) then
+ if(itb.eq.0) then
+ z1=wcompa(0.0d0,0.0d0,br(jb),0.0d0,op)
+ else
+ z1=wcompa(0.0d0,0.0d0,br(jb),bi(jb),op)
+ endif
+ if (z1) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ if(jb-kb+1.lt.nirb) jb=jb+1
+ j2=indb(nr+jb)
+ elseif(z) then
+ if(jc+1.gt.nelmx) goto 99
+ indc(nr+jc)=j
+ jc=jc+1
+ endif
+ endif
+ 24 continue
+ endif
+ endif
+ ka=ka+inda(i)
+ kb=kb+indb(i)
+ indc(i)=jc-kc
+ kc=jc
+ 30 continue
+ endif
+ nelc = jc-1
+ return
+c error messages.
+ 99 ierr=1
+c no more place for c
+
+ return
+ end
+
+
diff --git a/modules/sparse/src/fortran/wsposp.lo b/modules/sparse/src/fortran/wsposp.lo
new file mode 100755
index 000000000..3b8a05ae6
--- /dev/null
+++ b/modules/sparse/src/fortran/wsposp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wsposp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wsposp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspssp.f b/modules/sparse/src/fortran/wspssp.f
new file mode 100755
index 000000000..706249cbd
--- /dev/null
+++ b/modules/sparse/src/fortran/wspssp.f
@@ -0,0 +1,153 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspssp(nr,nc,ar,ai,nela,inda,br,bi,nelb,indb,cr,ci,
+ $ nelc,indc,ia,ib,ierr)
+c!pupose
+c c=a-b for sparse complex matrices
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c ia : on input specifies if a has an imaginary part
+c ia=0 : no imaginary part
+c ia=1 : the imaginary part of a is stored in ai
+c ib : on input specifies if b has an imaginary part
+c ib=0 : no imaginary part
+c ib=1 : the imaginary part of b is stored in bi
+c!
+ double precision ar(nela),ai(nela),br(nelb),bi(nelb),cr(*),ci(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+ double precision tr,ti
+c
+ nelmx=nelc
+ ierr=0
+c clear indc.
+ do 1 i = 1,nr
+ indc(i) = 0
+ 1 continue
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 7
+ j2 = indb(jb+kf)
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 7
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index less than b-index transfer a-element to c.
+ 7 if (jc.gt.nelmx) go to 16
+ cr(jc) = ar(ja)
+ if(ia.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = ai(ja)
+ endif
+ 8 continue
+ indc(jc+kf)=j1
+ jc = jc+1
+ go to 11
+c if a-index equals b-index add elements ,place sum in c.
+ 9 tr = ar(ja)-br(jb)
+ ti=0.0d0
+ if(ia.ne.0) ti=ti+ai(ja)
+ if(ib.ne.0) ti=ti-bi(jb)
+c ignore sum element if zero.
+ jb = jb+1
+ if (tr.eq.0.0d0.and.ti.eq.0.0d0) go to 11
+ if (jc.gt.nelmx) go to 16
+ cr(jc) = tr
+ ci(jc) = ti
+ go to 8
+c if a-index greater than b-index transfer b-element to c.
+ 10 if (jc.gt.nelmx) go to 16
+ cr(jc) = -br(jb)
+ if(ib.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = -bi(jb)
+ endif
+ indc(jc+kf)=j2
+ jb = jb+1
+ jc = jc+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (jb.gt.kb) go to 13
+ if (jc.gt.nelmx) go to 16
+ cr(jc) = -br(jb)
+ if(ib.eq.0) then
+ ci(jc) = 0.0d0
+ else
+ ci(jc) = -bi(jb)
+ endif
+ j2 = indb(jb+kf)
+ indc(jc+kf)=j2
+ jc = jc+1
+ jb = jb+1
+ go to 12
+ 13 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspssp.lo b/modules/sparse/src/fortran/wspssp.lo
new file mode 100755
index 000000000..3dc7f9af8
--- /dev/null
+++ b/modules/sparse/src/fortran/wspssp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspssp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspssp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspt.f b/modules/sparse/src/fortran/wspt.f
new file mode 100755
index 000000000..021ed11e9
--- /dev/null
+++ b/modules/sparse/src/fortran/wspt.f
@@ -0,0 +1,84 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspt(r,s,ar,ai,nela,inda,ia, atr,ati,iat,indat)
+c transpose a sparse matrix using a distribution count sort.
+c*** input
+c r,s number of rows,columns in a.
+c ar,ai a one-dimensional array containing the non-zero
+c elements of matrix a,arranged row-wise,but in
+c general not ordered within rows.
+c ma as in msmgus.
+c ia ia(i) is address in a of first element of row i of a.
+c ia(number of rows + 1) is number of elements in a,+1.
+c*** output
+c atr,ati a one-dimensional array containing non-zero elements
+c of matrix a transposed,arranged row-wise,and in
+c order within rows.
+c mat contains control information and column indices for at,
+c in same format as ma...see msmgus.
+c*** working storage.
+c iat iat(i) is address in at of first element in row i of at.
+c iat(s+1) contains number of elements in at,plus 1.
+ double precision ar(nela), ai(nela), atr(nela),ati(nela)
+ integer inda(*), ia(*), indat(*), iat(*)
+ integer r, s
+c
+c determine column counts of matrix a(i.e row counts of at)
+c in array iat.
+c
+ do 10 i=1,s+1
+ iat(i) = 0
+ 10 continue
+
+c computes number of elements for each column
+ do 20 i=1,nela
+ k = inda(i+r)
+ iat(k) = iat(k) + 1
+ 20 continue
+c
+c calculate row pointers of at from column counts obtained above.
+c pointer for row i stored in location i+1.
+c
+ itemp1 = iat(1)
+ itemp2 = iat(2)
+ iat(2) = 1
+ if (s.le.1) go to 40
+ do 30 i=2,s
+ itemp3 = iat(i+1)
+ iat(i+1) = iat(i) + itemp1
+ itemp1 = itemp2
+ itemp2 = itemp3
+ 30 continue
+c
+c calculate column indices(in array indat) and numerical values (in array
+c at) of matrix a-transposed using the list pointers iat(i+1) which
+c always point to the next element to be entered in row i of at.
+ 40 do 60 i=1,r
+ j1 = ia(i)
+ j2 = ia(i+1) - 1
+ if (j1.gt.j2) go to 60
+ do 50 jp=j1,j2
+ j = inda(jp + r)
+ jpt = iat(j+1)
+ indat(jpt + s) = i
+ atr(jpt) = ar(jp)
+ ati(jpt) = ai(jp)
+ iat(j+1) = jpt + 1
+ 50 continue
+ 60 continue
+c
+c now all row pointers iat for at have correct values except position 1.
+c fix it.
+ iat(1) = 1
+c extract needed control information in indat.
+ do 70 i=1,s
+ indat(i) = iat(i+1) - iat(i)
+ 70 continue
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspt.lo b/modules/sparse/src/fortran/wspt.lo
new file mode 100755
index 000000000..d44968d08
--- /dev/null
+++ b/modules/sparse/src/fortran/wspt.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspt.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspt.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspxs.f b/modules/sparse/src/fortran/wspxs.f
new file mode 100755
index 000000000..72e56f81a
--- /dev/null
+++ b/modules/sparse/src/fortran/wspxs.f
@@ -0,0 +1,107 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspxs(nr,nc,ar,ai,nela,inda,br,bi,mb,cr,ci,nelc,indc,
+ $ ierr,it1,it2)
+c!purpose
+c multiply a full and a sparse matrices elementwise
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ double precision ar(nela),ai(nela),br(mb,nc),bi(mb,nc)
+ double precision cr(*),ci(*),ti
+ integer nr,nc,nela,inda(*),nelc,indc(*),ierr
+c
+ integer jc,ka,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c jc counts elements of c.
+ jc = 1
+c ka,are numbers in first i rows of a,b.
+ ka = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ jb = 1
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.nc) go to 11
+ j2 = jb
+ CRES=j1-j2
+ if (CRES .lt. 0) then
+ goto 11
+ elseif (CRES .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index equals b-index multiply elements ,place in c.
+ 9 continue
+ if (jc.gt.nelmx) go to 16
+ if(it1.eq.0) then
+ ci(jc) = ar(ja)*bi(i,jb)
+ cr(jc) = ar(ja)*br(i,jb)
+ elseif(it2.eq.0) then
+ cr(jc) = ar(ja)*br(i,jb)
+ ci(jc) = ai(ja)*br(i,jb)
+ else
+ ti=ai(ja)
+ ci(jc) = ti*br(i,jb) + ar(ja)*bi(i,jb)
+ cr(jc) = ar(ja)*br(i,jb) - ti*bi(i,jb)
+ endif
+ indc(jc+kf)=j1
+ jc = jc+1
+ jb = jb+1
+ go to 11
+c if a-index greater than b-index
+ 10 jb = jb+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspxs.lo b/modules/sparse/src/fortran/wspxs.lo
new file mode 100755
index 000000000..3637ea5b4
--- /dev/null
+++ b/modules/sparse/src/fortran/wspxs.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspxs.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspxs.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/src/fortran/wspxsp.f b/modules/sparse/src/fortran/wspxsp.f
new file mode 100755
index 000000000..e7fe04cf0
--- /dev/null
+++ b/modules/sparse/src/fortran/wspxsp.f
@@ -0,0 +1,114 @@
+c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+c Copyright (C) INRIA
+c
+c This file must be used under the terms of the CeCILL.
+c This source file is licensed as described in the file COPYING, which
+c you should have received as part of this distribution. The terms
+c are also available at
+c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ subroutine wspxsp(nr,nc,ar,ai,nela,inda,br,bi,nelb,indb,cr,ci,
+ $ nelc,indc,ierr,it1,it2)
+c!purpose
+c multiply two sparse matrices elementwise
+c!parameters
+c a,b,c : arrays.
+c Contain non zero elements of first,second and sum matrices.
+c nr : integer: row dimension of a b c matrices
+c nc : integer: column dimension of a b c matrices
+c nela :integer: number of non zero elements of a
+c nelb :integer: number of non zero elements of b
+c nelc :integer:
+c on entry maximum number of non zero elements of c
+c on return number of non zero elements of c
+c inda : a matrix control data:
+c inda(i) 1<=i<=nr contains the number of ith row non zero elements
+c of a
+c inda(m+i) 1<=i<=nela column index of each non zero element
+c indb : b matrix control data:
+c indb(i) 1<=i<=nr contains the number of ith row non zero elements
+c of b
+c indb(m+i) 1<=i<=nelb column index of each non zero element
+c
+c indc : on return contains c matrix control data:
+c indc(i) 1<=i<=nr contains the number of ith row non zero elements
+c of c
+c indc(m+i) 1<=i<=nelb column index of each non zero element
+c ierr : if non zero initial value of nelc is to small
+c!
+ double precision ar(nela),ai(nela),br(nelb),bi(nelb)
+ double precision cr(*),ci(*)
+ integer nr,nc,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
+c
+ integer jc,ka,kb,jb,kf,i,ka1,ja,j1,j2,nold
+c
+ nelmx=nelc
+ ierr=0
+c jc counts elements of c.
+ jc = 1
+c ka,kb are numbers in first i rows of a,b.
+ ka = 0
+ kb = 0
+c kf is number of control data in a,b or c.
+ kf = nr
+c jb counts elements of b.
+ jb = 1
+c i counts rows of a,b,c.
+ do 15 i=1,nr
+ kb = kb+indb(i)
+c nira is number in row i of a.
+ nira = inda(i)
+ if (nira.eq.0) go to 12
+ ka1 = ka+1
+ ka = ka+nira
+c ja counts elements of a.
+ do 11 ja= ka1,ka
+ 6 j1 = inda(ja+kf)
+c at end of b-row transfer rest of a-row.
+ if (jb.gt.kb) go to 11
+ j2 = indb(jb+kf)
+ if ((j1-j2) .lt. 0) then
+ goto 11
+ elseif ((j1-j2) .eq. 0) then
+ goto 9
+ else
+ goto 10
+ endif
+c if a-index equals b-index multiply elements ,place in c.
+ 9 continue
+ if (jc.gt.nelmx) go to 16
+ if(it1.eq.0) then
+ cr(jc) = ar(ja)*br(jb)
+ ci(jc) = ar(ja)*bi(jb)
+ elseif(it2.eq.0) then
+ cr(jc) = ar(ja)*br(jb)
+ ci(jc) = ai(ja)*br(jb)
+ else
+ cr(jc) = ar(ja)*br(jb)-ai(ja)*bi(jb)
+ ci(jc) = ai(ja)*br(jb)+ar(ja)*bi(jb)
+ endif
+ indc(jc+kf)=j1
+ jc = jc+1
+ jb = jb+1
+ go to 11
+c if a-index greater than b-index
+ 10 jb = jb+1
+ go to 6
+ 11 continue
+c end of row of a. transfer rest of row of b.
+ 12 jb=kb+1
+ if (i.gt.1) go to 14
+ nold = jc-1
+c nirc is number in row i of c.
+ nirc = jc-1
+ go to 15
+ 14 nirc = jc-1-nold
+ nold = jc-1
+ 15 indc(i)=nirc
+ nelc = jc-1
+ return
+c error messages.
+ 16 ierr=1
+c no more place for c
+
+ return
+ end
diff --git a/modules/sparse/src/fortran/wspxsp.lo b/modules/sparse/src/fortran/wspxsp.lo
new file mode 100755
index 000000000..03c568a14
--- /dev/null
+++ b/modules/sparse/src/fortran/wspxsp.lo
@@ -0,0 +1,12 @@
+# src/fortran/wspxsp.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/wspxsp.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_10126.dia.ref b/modules/sparse/tests/nonreg_tests/bug_10126.dia.ref
new file mode 100755
index 000000000..346c29248
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_10126.dia.ref
@@ -0,0 +1,23 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 10126 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10126
+//
+// <-- Short Description -->
+// sparse matrix insertion was failing (segfault and/or wrong results)
+A=sprand(5,5,1);
+A(7,1)=1; //A is correctly reshaped and the insertion is ok
+B=full(A);
+assert_checkequal(B(7,1),1);
+assert_checkequal(size(A),[7,5]);
+A(10,1)=2; // Was either doing a segfault or producing a bad result
+B=full(A);
+assert_checkequal(B(10,1),2);
+assert_checkequal(size(A),[10,5]);
diff --git a/modules/sparse/tests/nonreg_tests/bug_10126.tst b/modules/sparse/tests/nonreg_tests/bug_10126.tst
new file mode 100755
index 000000000..1e537de2f
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_10126.tst
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 10126 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10126
+//
+// <-- Short Description -->
+// sparse matrix insertion was failing (segfault and/or wrong results)
+
+A=sprand(5,5,1);
+A(7,1)=1; //A is correctly reshaped and the insertion is ok
+B=full(A);
+assert_checkequal(B(7,1),1);
+assert_checkequal(size(A),[7,5]);
+
+A(10,1)=2; // Was either doing a segfault or producing a bad result
+B=full(A);
+assert_checkequal(B(10,1),2);
+assert_checkequal(size(A),[10,5]); \ No newline at end of file
diff --git a/modules/sparse/tests/nonreg_tests/bug_10271.dia.ref b/modules/sparse/tests/nonreg_tests/bug_10271.dia.ref
new file mode 100755
index 000000000..281722f19
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_10271.dia.ref
@@ -0,0 +1,22 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 10271 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10271
+//
+// <-- Short Description -->
+// ordmmd now checks the consistency of the third input argument with the
+// input matrix defined by the two first input arguments.
+A = ReadHBSparse(SCI+"/modules/umfpack/examples/ex14.rua");
+[xadj, iadj, val] = sp2adj(A);
+n = floor(size(A, "r")/2);
+refMsg = msprintf(_(" The provided ""n"" does not correspond to the matrix defined by xadj and iadj"));
+assert_checkerror("[perm, invp, nofsub] = ordmmd(xadj, iadj, n);", refMsg);
diff --git a/modules/sparse/tests/nonreg_tests/bug_10271.tst b/modules/sparse/tests/nonreg_tests/bug_10271.tst
new file mode 100755
index 000000000..375ccf963
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_10271.tst
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 10271 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10271
+//
+// <-- Short Description -->
+// ordmmd now checks the consistency of the third input argument with the
+// input matrix defined by the two first input arguments.
+
+A = ReadHBSparse(SCI+"/modules/umfpack/examples/ex14.rua");
+
+[xadj, iadj, val] = sp2adj(A);
+n = floor(size(A, "r")/2);
+
+refMsg = msprintf(_(" The provided ""n"" does not correspond to the matrix defined by xadj and iadj"));
+assert_checkerror("[perm, invp, nofsub] = ordmmd(xadj, iadj, n);", refMsg);
diff --git a/modules/sparse/tests/nonreg_tests/bug_11612.dia.ref b/modules/sparse/tests/nonreg_tests/bug_11612.dia.ref
new file mode 100755
index 000000000..78dc6bafb
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_11612.dia.ref
@@ -0,0 +1,106 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 11612 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=11612
+//
+// <-- Short Description -->
+// index of the max value of a negative sparse was wrong
+a = -1 * rand(3,2);
+a(2) = 0;
+A = sparse(a);
+[m, i] = max(a);
+[m1, i1] = max(A);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a');
+[m1, i1] = max(A');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a(:));
+[m1, i1] = max(A(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a(:)');
+[m1, i1] = max(A(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+a = [-3 -4;0 -1;-5 -6];
+A = sparse(a);
+[m, i] = max(a);
+[m1, i1] = max(A);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a');
+[m1, i1] = max(A');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a(:));
+[m1, i1] = max(A(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(a(:)');
+[m1, i1] = max(A(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+b = [-5 0;-1 -6];
+B = sparse(b);
+[m, i] = max(b);
+[m1, i1] = max(B);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(b');
+[m1, i1] = max(B');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(b(:));
+[m1, i1] = max(B(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(b(:)');
+[m1, i1] = max(B(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+s = rand(3,2);
+s(2) = 0;
+S = sparse(s);
+[m, i] = min(s);
+[m1, i1] = min(S);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = min(s');
+[m1, i1] = min(S');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = min(s(:));
+[m1, i1] = min(S(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = min(s(:)');
+[m1, i1] = min(S(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+v = [1 4;7 6];
+V = sparse(v);
+[m, i] = max(v);
+[m1, i1] = max(V);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(v');
+[m1, i1] = max(V');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(v(:));
+[m1, i1] = max(V(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+[m, i] = max(v(:)');
+[m1, i1] = max(V(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
diff --git a/modules/sparse/tests/nonreg_tests/bug_11612.tst b/modules/sparse/tests/nonreg_tests/bug_11612.tst
new file mode 100755
index 000000000..6cc03a727
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_11612.tst
@@ -0,0 +1,128 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 11612 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=11612
+//
+// <-- Short Description -->
+// index of the max value of a negative sparse was wrong
+
+a = -1 * rand(3,2);
+a(2) = 0;
+A = sparse(a);
+[m, i] = max(a);
+[m1, i1] = max(A);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a');
+[m1, i1] = max(A');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a(:));
+[m1, i1] = max(A(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a(:)');
+[m1, i1] = max(A(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+a = [-3 -4;0 -1;-5 -6];
+A = sparse(a);
+[m, i] = max(a);
+[m1, i1] = max(A);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a');
+[m1, i1] = max(A');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a(:));
+[m1, i1] = max(A(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(a(:)');
+[m1, i1] = max(A(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+b = [-5 0;-1 -6];
+B = sparse(b);
+[m, i] = max(b);
+[m1, i1] = max(B);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(b');
+[m1, i1] = max(B');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(b(:));
+[m1, i1] = max(B(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(b(:)');
+[m1, i1] = max(B(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+s = rand(3,2);
+s(2) = 0;
+S = sparse(s);
+[m, i] = min(s);
+[m1, i1] = min(S);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = min(s');
+[m1, i1] = min(S');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = min(s(:));
+[m1, i1] = min(S(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = min(s(:)');
+[m1, i1] = min(S(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+v = [1 4;7 6];
+V = sparse(v);
+[m, i] = max(v);
+[m1, i1] = max(V);
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(v');
+[m1, i1] = max(V');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(v(:));
+[m1, i1] = max(V(:));
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
+
+[m, i] = max(v(:)');
+[m1, i1] = max(V(:)');
+assert_checkequal(m1,m);
+assert_checkequal(i1,i);
diff --git a/modules/sparse/tests/nonreg_tests/bug_11618.dia.ref b/modules/sparse/tests/nonreg_tests/bug_11618.dia.ref
new file mode 100755
index 000000000..ceffb94f2
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_11618.dia.ref
@@ -0,0 +1,30 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 11618 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=11618
+//
+// <-- Short Description -->
+// if A is a complex sparse matrix, A(:) returned wrong values
+A = [0 %i;1 2]
+ A =
+
+ 0 i
+ 1. 2.
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [1 0; 3 %i];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [%i 3; 0 1];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+A = [1 %i;%i 0];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
diff --git a/modules/sparse/tests/nonreg_tests/bug_11618.tst b/modules/sparse/tests/nonreg_tests/bug_11618.tst
new file mode 100755
index 000000000..a0858286f
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_11618.tst
@@ -0,0 +1,32 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 11618 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=11618
+//
+// <-- Short Description -->
+// if A is a complex sparse matrix, A(:) returned wrong values
+
+A = [0 %i;1 2]
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+
+A = [1 0; 3 %i];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+
+A = [%i 3; 0 1];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
+
+A = [1 %i;%i 0];
+A1 = sparse(A);
+assert_checkequal(full(A1(:)), A(:));
diff --git a/modules/sparse/tests/nonreg_tests/bug_2003.dia.ref b/modules/sparse/tests/nonreg_tests/bug_2003.dia.ref
new file mode 100755
index 000000000..38fa22af0
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2003.dia.ref
@@ -0,0 +1,35 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 2003 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2003
+//
+// <-- Short Description -->
+//lusolve crashes scilab when handle has been freed
+a=[0.2,0.6,0.6,0.2,0.3;
+0.8,0.8,0.7,0.2,0.9;
+0,0.7,0.7,0.2,0.2;
+0.3,0.9,0.2,0.9,0.3;
+0.7,0.1,0.5,0.7,0.4];
+b=[0.3;0.6;0.5;0.3;0.6];
+A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);
+if norm(a*x-b)>1d-10 then bugmes();quit;end
+[P,L,U,Q]=luget(h);
+if norm(P*L*U*Q-A)>1d-10 then bugmes();quit;end
+ludel(h)
+if execstr('x=lusolve(h,b);','errcatch')<>247 then bugmes();quit;end
+if execstr('ludel(h);','errcatch')<>247 then bugmes();quit;end
+if execstr('[P,L,U,Q]=luget(h);','errcatch')<>247 then bugmes();quit;end
+//try to allocate a lot of handles
+for k=1:20
+ [h1,rk]=lufact(A);
+end
+x=lusolve(h1,b);
+if norm(a*x-b)>1d-10 then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_2003.tst b/modules/sparse/tests/nonreg_tests/bug_2003.tst
new file mode 100755
index 000000000..550d760e2
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2003.tst
@@ -0,0 +1,41 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 2003 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2003
+//
+// <-- Short Description -->
+//lusolve crashes scilab when handle has been freed
+
+a=[0.2,0.6,0.6,0.2,0.3;
+0.8,0.8,0.7,0.2,0.9;
+0,0.7,0.7,0.2,0.2;
+0.3,0.9,0.2,0.9,0.3;
+0.7,0.1,0.5,0.7,0.4];
+b=[0.3;0.6;0.5;0.3;0.6];
+A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);
+if norm(a*x-b)>1d-10 then pause,end
+[P,L,U,Q]=luget(h);
+if norm(P*L*U*Q-A)>1d-10 then pause,end
+ludel(h)
+if execstr('x=lusolve(h,b);','errcatch')<>247 then pause,end
+if execstr('ludel(h);','errcatch')<>247 then pause,end
+if execstr('[P,L,U,Q]=luget(h);','errcatch')<>247 then pause,end
+
+//try to allocate a lot of handles
+for k=1:20
+ [h1,rk]=lufact(A);
+end
+
+x=lusolve(h1,b);
+if norm(a*x-b)>1d-10 then pause,end
diff --git a/modules/sparse/tests/nonreg_tests/bug_2277.dia.ref b/modules/sparse/tests/nonreg_tests/bug_2277.dia.ref
new file mode 100755
index 000000000..a3bc13099
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2277.dia.ref
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 2277 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2277
+//
+// <-- Short Description -->
+// Scilab has a bug with the SPARSE command. When the "values vector" in the
+// row/column representation is COMPLEX the routine fails to build the sparse
+// matrix correctly. This seems to occur always when the first AND third entry of
+// this vector are zero.
+// The other bug is that when other elements are zero (not the third, the fifth for
+// example) they are still stored in the sparse representation.
+// This is very problematic for people doing finite element calculations with scilab!
+ij = [1,3;1,7;3,3;4,4;5,3;6,10;7,1;7,9;8,10;9,6;9,7;9,9;10,10] ;
+v = [1 0 0 4:13]'*%i;
+A = sparse(ij,v,[10 10]);
+[ij2,v2,mn] = spget(A);
+if or(v2<>[1 4:13]'*%i) then bugmes();quit;end
+ij(2:3,:) = [];
+if or(ij<>ij2) then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_2277.tst b/modules/sparse/tests/nonreg_tests/bug_2277.tst
new file mode 100755
index 000000000..8f639a004
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2277.tst
@@ -0,0 +1,32 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 2277 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2277
+//
+// <-- Short Description -->
+// Scilab has a bug with the SPARSE command. When the "values vector" in the
+// row/column representation is COMPLEX the routine fails to build the sparse
+// matrix correctly. This seems to occur always when the first AND third entry of
+// this vector are zero.
+// The other bug is that when other elements are zero (not the third, the fifth for
+// example) they are still stored in the sparse representation.
+// This is very problematic for people doing finite element calculations with scilab!
+
+ij = [1,3;1,7;3,3;4,4;5,3;6,10;7,1;7,9;8,10;9,6;9,7;9,9;10,10] ;
+v = [1 0 0 4:13]'*%i;
+A = sparse(ij,v,[10 10]);
+[ij2,v2,mn] = spget(A);
+
+if or(v2<>[1 4:13]'*%i) then pause,end
+
+ij(2:3,:) = [];
+if or(ij<>ij2) then pause,end
diff --git a/modules/sparse/tests/nonreg_tests/bug_2430.dia.ref b/modules/sparse/tests/nonreg_tests/bug_2430.dia.ref
new file mode 100755
index 000000000..f9f71c7bd
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2430.dia.ref
@@ -0,0 +1,18 @@
+// <-- Non-regression test for bug 2430 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2430
+//
+// <-- Short Description -->
+// Wrong results when solving linear systems when the matrix
+// is sparse and 1x1, and rhs is compatible and sparse.
+// In the example below, M\b and full(M)\b give a wrong result,
+// whereas M\full(b) and full(M)\full(b) are ok.
+//
+// Strangely, when the size of b is less than 10, then all
+// cases give the correct answer !
+// Scilab Project - Serge Steer
+// Copyright INRIA 2007
+// Date : June 2007
+b = sparse(1:16);
+if or(abs(full(2\b)-2\full(b)) >= 100*%eps) then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_2430.tst b/modules/sparse/tests/nonreg_tests/bug_2430.tst
new file mode 100755
index 000000000..dfd1a35ab
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_2430.tst
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 2430 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2430
+//
+// <-- Short Description -->
+// Wrong results when solving linear systems when the matrix
+// is sparse and 1x1, and rhs is compatible and sparse.
+// In the example below, M\b and full(M)\b give a wrong result,
+// whereas M\full(b) and full(M)\full(b) are ok.
+//
+// Strangely, when the size of b is less than 10, then all
+// cases give the correct answer !
+
+b = sparse(1:16);
+if or(abs(full(2\b)-2\full(b)) >= 100*%eps) then pause,end
diff --git a/modules/sparse/tests/nonreg_tests/bug_3006.dia.ref b/modules/sparse/tests/nonreg_tests/bug_3006.dia.ref
new file mode 100755
index 000000000..9f5f2b5c8
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3006.dia.ref
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 3006 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=3006
+//
+// <-- Short Description -->
+// submatrix assignment impossible when the matrix is indexed with a boolean array of falses
+a=sparse([1 2;3 4]);a_ref=a;
+a(1,[%f %f])=[];
+if or(a<>a_ref) then bugmes();quit;end
+a([%f %f],1)=[];
+if or(a<>a_ref) then bugmes();quit;end
+a([%f %f],[%f %f])=[];
+if or(a<>a_ref) then bugmes();quit;end
+a(1,$:1)=[];
+if or(a<>a_ref) then bugmes();quit;end
+a($:1,1)=[];
+if or(a<>a_ref) then bugmes();quit;end
+a($:1,$:1)=[];
+if or(a<>a_ref) then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_3006.tst b/modules/sparse/tests/nonreg_tests/bug_3006.tst
new file mode 100755
index 000000000..47a74071c
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3006.tst
@@ -0,0 +1,32 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 3006 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=3006
+//
+// <-- Short Description -->
+// submatrix assignment impossible when the matrix is indexed with a boolean array of falses
+
+a=sparse([1 2;3 4]);a_ref=a;
+
+a(1,[%f %f])=[];
+if or(a<>a_ref) then pause,end
+a([%f %f],1)=[];
+if or(a<>a_ref) then pause,end
+a([%f %f],[%f %f])=[];
+if or(a<>a_ref) then pause,end
+
+a(1,$:1)=[];
+if or(a<>a_ref) then pause,end
+a($:1,1)=[];
+if or(a<>a_ref) then pause,end
+a($:1,$:1)=[];
+if or(a<>a_ref) then pause,end
diff --git a/modules/sparse/tests/nonreg_tests/bug_3025.dia.ref b/modules/sparse/tests/nonreg_tests/bug_3025.dia.ref
new file mode 100755
index 000000000..6112f97a2
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3025.dia.ref
@@ -0,0 +1,18 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 2277 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2277
+//
+// <-- Short Description -->
+//lusolve produces erroneous results with Scilab5 (it was ok on Scilab4)
+A=sparse([2,2;2,4;3,3;3,7;4,2;4,4;6,6;6,8;7,3;7,7;8,6;8,8],..
+ [-1;1;-1;1;1;-1;-1;1;1;-1;1;-1],[10,10]) ;
+[ptr,rkA]=lufact(A);
+x=lusolve(ptr,zeros(10,1));ludel(ptr);
+if norm(A*x)>1d-14 then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_3025.tst b/modules/sparse/tests/nonreg_tests/bug_3025.tst
new file mode 100755
index 000000000..2581230c9
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3025.tst
@@ -0,0 +1,24 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 2277 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=2277
+//
+// <-- Short Description -->
+//lusolve produces erroneous results with Scilab5 (it was ok on Scilab4)
+
+A=sparse([2,2;2,4;3,3;3,7;4,2;4,4;6,6;6,8;7,3;7,7;8,6;8,8],..
+ [-1;1;-1;1;1;-1;-1;1;1;-1;1;-1],[10,10]) ;
+[ptr,rkA]=lufact(A);
+x=lusolve(ptr,zeros(10,1));ludel(ptr);
+if norm(A*x)>1d-14 then pause,end
+
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_3263.dia.ref b/modules/sparse/tests/nonreg_tests/bug_3263.dia.ref
new file mode 100755
index 000000000..c8b12ceff
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3263.dia.ref
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 3263 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=3263
+//
+// <-- Short Description -->
+// ludel(h) fails @ rev. 25935
+a=[0.2,0.6,0.6,0.2,0.3;
+0.8,0.8,0.7,0.2,0.9;
+0,0.7,0.7,0.2,0.2;
+0.3,0.9,0.2,0.9,0.3;
+0.7,0.1,0.5,0.7,0.4];
+b=[0.3;0.6;0.5;0.3;0.6];
+A=sparse(a);
+[h,rk]=lufact(A);
+x=lusolve(h,b);
+if norm(a*x-b)>1d-10 then bugmes();quit;end
+[P,L,U,Q]=luget(h);
+if norm(P*L*U*Q-A)>1d-10 then bugmes();quit;end
+ierr = execstr('ludel(h);','errcatch');
+if ierr <> 0 then bugmes();quit;end;
diff --git a/modules/sparse/tests/nonreg_tests/bug_3263.tst b/modules/sparse/tests/nonreg_tests/bug_3263.tst
new file mode 100755
index 000000000..ea020d0d7
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_3263.tst
@@ -0,0 +1,41 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 3263 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=3263
+//
+// <-- Short Description -->
+// ludel(h) fails @ rev. 25935
+
+
+a=[0.2,0.6,0.6,0.2,0.3;
+0.8,0.8,0.7,0.2,0.9;
+0,0.7,0.7,0.2,0.2;
+0.3,0.9,0.2,0.9,0.3;
+0.7,0.1,0.5,0.7,0.4];
+
+b=[0.3;0.6;0.5;0.3;0.6];
+
+A=sparse(a);
+
+[h,rk]=lufact(A);
+
+x=lusolve(h,b);
+
+if norm(a*x-b)>1d-10 then pause,end
+
+[P,L,U,Q]=luget(h);
+
+if norm(P*L*U*Q-A)>1d-10 then pause,end
+
+ierr = execstr('ludel(h);','errcatch');
+if ierr <> 0 then pause,end;
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_4654.dia.ref b/modules/sparse/tests/nonreg_tests/bug_4654.dia.ref
new file mode 100755
index 000000000..8aec8ff16
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_4654.dia.ref
@@ -0,0 +1,18 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Yann COLLETTE <yann.collette@scilab.fr>
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 4654 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4654
+//
+// <-- Short Description -->
+// max of an empty sparse matrix makes Scilab hangs
+[v, ij] = max(sprand(50,50,0));
+assert_checkequal(v, 0);
+assert_checkequal(ij, [1 1]);
diff --git a/modules/sparse/tests/nonreg_tests/bug_4654.tst b/modules/sparse/tests/nonreg_tests/bug_4654.tst
new file mode 100755
index 000000000..4e29bd8fa
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_4654.tst
@@ -0,0 +1,22 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Yann COLLETTE <yann.collette@scilab.fr>
+// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 4654 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4654
+//
+// <-- Short Description -->
+// max of an empty sparse matrix makes Scilab hangs
+
+[v, ij] = max(sprand(50,50,0));
+
+assert_checkequal(v, 0);
+assert_checkequal(ij, [1 1]);
diff --git a/modules/sparse/tests/nonreg_tests/bug_4783.dia.ref b/modules/sparse/tests/nonreg_tests/bug_4783.dia.ref
new file mode 100755
index 000000000..30ca1d1c7
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_4783.dia.ref
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - INRIA - Serge Steer
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 4783 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4783
+//
+// <-- Short Description -->
+// comparison between sparse complex matrix and a full one is wrong when the sparse matrix contains a full zero row.
+C=sparse([1 1+2*%i;0 0]);
+D=full(C);
+if ~and(full(D==C)) then bugmes();quit;end
+if or(full(D<>C)) then bugmes();quit;end
+if ~and(full(C==D)) then bugmes();quit;end
+if or(full(C<>D)) then bugmes();quit;end
+//real case = OK
+C=sparse([1 2;0 0]);
+D=full(C);
+if ~and(full(D==C)) then bugmes();quit;end
+if or(full(D<>C)) then bugmes();quit;end
+if ~and(full(C==D)) then bugmes();quit;end
+if or(full(C<>D)) then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_4783.tst b/modules/sparse/tests/nonreg_tests/bug_4783.tst
new file mode 100755
index 000000000..84df9609a
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_4783.tst
@@ -0,0 +1,33 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - INRIA - Serge Steer
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 4783 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4783
+//
+// <-- Short Description -->
+// comparison between sparse complex matrix and a full one is wrong when the sparse matrix contains a full zero row.
+
+C=sparse([1 1+2*%i;0 0]);
+D=full(C);
+if ~and(full(D==C)) then pause,end
+if or(full(D<>C)) then pause,end
+if ~and(full(C==D)) then pause,end
+if or(full(C<>D)) then pause,end
+
+
+//real case = OK
+C=sparse([1 2;0 0]);
+D=full(C);
+if ~and(full(D==C)) then pause,end
+if or(full(D<>C)) then pause,end
+if ~and(full(C==D)) then pause,end
+if or(full(C<>D)) then pause,end
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_490.dia.ref b/modules/sparse/tests/nonreg_tests/bug_490.dia.ref
new file mode 100755
index 000000000..3d9259a59
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_490.dia.ref
@@ -0,0 +1,18 @@
+// ============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// ============================================================================
+// <-- Non-regression test for bug 490 -->
+// Please note that it is store under the request feature of Scilab
+//
+// <-- Bugzilla URL -->
+// http://requestzilla.scilab.org/show_bug.cgi?id=490
+//
+// <-- Short Description -->
+// Wrong size detection in sparse matrix
+toto = spzeros(2^16, 2^16);
+toto(1, 8) =toto(1, 8)+5;
+toto(1, 8) =toto(1, 8)+5;
+if toto(1, 8) == []; then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_490.tst b/modules/sparse/tests/nonreg_tests/bug_490.tst
new file mode 100755
index 000000000..c7e1ceb53
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_490.tst
@@ -0,0 +1,23 @@
+// ============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// ============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 490 -->
+// Please note that it is store under the request feature of Scilab
+//
+// <-- Bugzilla URL -->
+// http://requestzilla.scilab.org/show_bug.cgi?id=490
+//
+// <-- Short Description -->
+// Wrong size detection in sparse matrix
+
+toto = spzeros(2^16, 2^16);
+toto(1, 8) =toto(1, 8)+5;
+toto(1, 8) =toto(1, 8)+5;
+if toto(1, 8) == []; then pause, end
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_6401.dia.ref b/modules/sparse/tests/nonreg_tests/bug_6401.dia.ref
new file mode 100755
index 000000000..86d5a69d1
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6401.dia.ref
@@ -0,0 +1,31 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 6401 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6401
+//
+// <-- Short Description -->
+// chfact() returned a error
+a = [1,0,0;
+0,1,0;
+0,0,1];
+aa = sparse(a);
+ierr = execstr('chfact(aa)','errcatch');
+if ierr <> 0 then bugmes();quit;end
+xadj= [ 1. ; 1. ; 1. ; 1. ];
+adjncy = [];
+neqns = 3. ;
+ierr = execstr('[perm,invp,nofsub]=ordmmd(xadj,adjncy,neqns)','errcatch');
+if ierr <> 0 then bugmes();quit;end
+refperm = [ 3. ; 2. ; 1. ];
+refinvp = [ 3. ; 2. ; 1. ];
+refnofsub = 0;
+if refperm <> perm then bugmes();quit;end
+if refinvp <> invp then bugmes();quit;end
+if refnofsub <> nofsub then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_6401.tst b/modules/sparse/tests/nonreg_tests/bug_6401.tst
new file mode 100755
index 000000000..147dcdf78
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6401.tst
@@ -0,0 +1,39 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 6401 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6401
+//
+// <-- Short Description -->
+// chfact() returned a error
+
+a = [1,0,0;
+0,1,0;
+0,0,1];
+
+aa = sparse(a);
+ierr = execstr('chfact(aa)','errcatch');
+if ierr <> 0 then pause,end
+
+xadj= [ 1. ; 1. ; 1. ; 1. ];
+adjncy = [];
+neqns = 3. ;
+ierr = execstr('[perm,invp,nofsub]=ordmmd(xadj,adjncy,neqns)','errcatch');
+if ierr <> 0 then pause,end
+
+refperm = [ 3. ; 2. ; 1. ];
+refinvp = [ 3. ; 2. ; 1. ];
+refnofsub = 0;
+if refperm <> perm then pause,end
+if refinvp <> invp then pause,end
+if refnofsub <> nofsub then pause,end
+
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_6412.dia.ref b/modules/sparse/tests/nonreg_tests/bug_6412.dia.ref
new file mode 100755
index 000000000..8650bc25d
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6412.dia.ref
@@ -0,0 +1,19 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Yann COLLETTE <yann.collette@scilab.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 6412 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6412
+//
+// <-- Short Description -->
+// the function sp2adj was not working
+A = sprand(100,50,.05);
+[xadj,adjncy,anz]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,adjncy,anz,[n,m]);
+if norm(A-p)~=0 then bugmes();quit;end
diff --git a/modules/sparse/tests/nonreg_tests/bug_6412.tst b/modules/sparse/tests/nonreg_tests/bug_6412.tst
new file mode 100755
index 000000000..341151f51
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6412.tst
@@ -0,0 +1,22 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Yann COLLETTE <yann.collette@scilab.fr>
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 6412 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6412
+//
+// <-- Short Description -->
+// the function sp2adj was not working
+
+A = sprand(100,50,.05);
+[xadj,adjncy,anz]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,adjncy,anz,[n,m]);
+if norm(A-p)~=0 then pause, end
diff --git a/modules/sparse/tests/nonreg_tests/bug_6427.dia.ref b/modules/sparse/tests/nonreg_tests/bug_6427.dia.ref
new file mode 100755
index 000000000..f339a1018
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6427.dia.ref
@@ -0,0 +1,15 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 6427 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6427
+//
+// <-- Short Description -->
+// full([%T %F]) returns an error
+assert_checkequal(full([%T %F]), [%T %F]);
diff --git a/modules/sparse/tests/nonreg_tests/bug_6427.tst b/modules/sparse/tests/nonreg_tests/bug_6427.tst
new file mode 100755
index 000000000..40581fa8f
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6427.tst
@@ -0,0 +1,18 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 6427 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6427
+//
+// <-- Short Description -->
+// full([%T %F]) returns an error
+
+assert_checkequal(full([%T %F]), [%T %F]);
diff --git a/modules/sparse/tests/nonreg_tests/bug_6827.dia.ref b/modules/sparse/tests/nonreg_tests/bug_6827.dia.ref
new file mode 100755
index 000000000..8b8a94e9c
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6827.dia.ref
@@ -0,0 +1,30 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - DIGITEO - Yann COLLETTE <yann.collette@scilab.org>
+// Copyright (C) 2012 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 6827 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6827
+//
+// <-- Short Description -->
+// the function spchol was returning a wrong error message if X is complex
+X=[3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0. ; ...
+ 0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0. ; ...
+ 0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0. ; ...
+ 2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0. ; ...
+ 0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4. ; ...
+ 0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0. ; ...
+ 2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0. ; ...
+ 0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0. ; ...
+ 2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0. ; ...
+ 0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0. ; ...
+ 0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+X(1,1) = X(1,1) + %i;
+X = sparse(X);
+msgerr = msprintf(gettext("Wrong type for argument #%d: Real matrix expected.\n"), 1);
+assert_checkerror('[R,P] = spchol(X);', msgerr);
diff --git a/modules/sparse/tests/nonreg_tests/bug_6827.tst b/modules/sparse/tests/nonreg_tests/bug_6827.tst
new file mode 100755
index 000000000..815765d34
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_6827.tst
@@ -0,0 +1,36 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010 - DIGITEO - Yann COLLETTE <yann.collette@scilab.org>
+// Copyright (C) 2012 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 6827 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=6827
+//
+// <-- Short Description -->
+// the function spchol was returning a wrong error message if X is complex
+
+X=[3., 0., 0., 2., 0., 0., 2., 0., 2., 0., 0. ; ...
+ 0., 5., 4., 0., 0., 0., 0., 0., 0., 0., 0. ; ...
+ 0., 4., 5., 0., 0., 0., 0., 0., 0., 0., 0. ; ...
+ 2., 0., 0., 3., 0., 0., 2., 0., 2., 0., 0. ; ...
+ 0., 0., 0., 0. , 5., 0., 0., 0., 0., 0., 4. ; ...
+ 0., 0., 0., 0., 0., 4., 0., 3., 0., 3., 0. ; ...
+ 2., 0., 0., 2., 0., 0., 3., 0., 2., 0., 0. ; ...
+ 0., 0., 0., 0., 0., 3., 0., 4., 0., 3., 0. ; ...
+ 2., 0., 0., 2., 0., 0., 2., 0., 3., 0., 0. ; ...
+ 0., 0., 0., 0., 0., 3., 0., 3., 0., 4., 0. ; ...
+ 0., 0., 0., 0., 4., 0., 0., 0., 0., 0., 5.];
+
+X(1,1) = X(1,1) + %i;
+X = sparse(X);
+
+msgerr = msprintf(gettext("Wrong type for argument #%d: Real matrix expected.\n"), 1);
+assert_checkerror('[R,P] = spchol(X);', msgerr);
+
diff --git a/modules/sparse/tests/nonreg_tests/bug_8511.dia.ref b/modules/sparse/tests/nonreg_tests/bug_8511.dia.ref
new file mode 100755
index 000000000..1c040989c
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_8511.dia.ref
@@ -0,0 +1,20 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 8511 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8511
+//
+// <-- Short Description -->
+// sprand uses rand and grand functions, and internal state of the random number
+// generator is changed
+grand("setsd",0);
+state1=rand("seed");
+A = sprand(5,5,.05);
+state2=rand("seed");
+assert_checkequal(state1,state2);
diff --git a/modules/sparse/tests/nonreg_tests/bug_8511.tst b/modules/sparse/tests/nonreg_tests/bug_8511.tst
new file mode 100755
index 000000000..9d95384c7
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_8511.tst
@@ -0,0 +1,23 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 8511 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=8511
+//
+// <-- Short Description -->
+// sprand uses rand and grand functions, and internal state of the random number
+// generator is changed
+
+grand("setsd",0);
+state1=rand("seed");
+A = sprand(5,5,.05);
+state2=rand("seed");
+assert_checkequal(state1,state2);
diff --git a/modules/sparse/tests/nonreg_tests/bug_9780.dia.ref b/modules/sparse/tests/nonreg_tests/bug_9780.dia.ref
new file mode 100755
index 000000000..dfcc47937
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_9780.dia.ref
@@ -0,0 +1,23 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// <-- Non-regression test for bug 9780 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=9780
+//
+// <-- Short Description -->
+// gmres does not run with complex systems
+n_eqns=3;
+tol=1.e-6;
+rstr=n_eqns;
+maxi=5000;
+M=eye(n_eqns,n_eqns)+%i*eye(n_eqns,n_eqns);
+x0=zeros(n_eqns,1);
+A=rand(n_eqns,n_eqns)+%i*rand(n_eqns,n_eqns);
+b=rand(n_eqns,1);
+assert_checktrue(execstr("gmres(A,b,rstr,tol,maxi,M,x0)-[0.4336542-0.8855630*%i;-0.9532019+0.9207990*%i;0.5351043-0.3759549*%i]","errcatch") == 0);
diff --git a/modules/sparse/tests/nonreg_tests/bug_9780.tst b/modules/sparse/tests/nonreg_tests/bug_9780.tst
new file mode 100755
index 000000000..c5fc6499e
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_9780.tst
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - Scilab Enterprises - Charlotte HECQUET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+// <-- Non-regression test for bug 9780 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=9780
+//
+// <-- Short Description -->
+// gmres does not run with complex systems
+
+n_eqns=3;
+tol=1.e-6;
+rstr=n_eqns;
+maxi=5000;
+M=eye(n_eqns,n_eqns)+%i*eye(n_eqns,n_eqns);
+x0=zeros(n_eqns,1);
+A=rand(n_eqns,n_eqns)+%i*rand(n_eqns,n_eqns);
+b=rand(n_eqns,1);
+assert_checktrue(execstr("gmres(A,b,rstr,tol,maxi,M,x0)-[0.4336542-0.8855630*%i;-0.9532019+0.9207990*%i;0.5351043-0.3759549*%i]","errcatch") == 0);
diff --git a/modules/sparse/tests/nonreg_tests/bug_9999.dia.ref b/modules/sparse/tests/nonreg_tests/bug_9999.dia.ref
new file mode 100755
index 000000000..01c9e5c24
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_9999.dia.ref
@@ -0,0 +1,19 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 9999 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=9999
+//
+// <-- Short Description -->
+// The sparse() and ^ operators mix could fail.
+A=[1 2 ; 3 4];
+res = sparse(A)^0 == sparse(A^0);
+assert_checkequal(res, sparse([%t %t ; %t %t]));
diff --git a/modules/sparse/tests/nonreg_tests/bug_9999.tst b/modules/sparse/tests/nonreg_tests/bug_9999.tst
new file mode 100755
index 000000000..fcf095460
--- /dev/null
+++ b/modules/sparse/tests/nonreg_tests/bug_9999.tst
@@ -0,0 +1,21 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 9999 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=9999
+//
+// <-- Short Description -->
+// The sparse() and ^ operators mix could fail.
+
+A=[1 2 ; 3 4];
+res = sparse(A)^0 == sparse(A^0);
+
+assert_checkequal(res, sparse([%t %t ; %t %t]));
diff --git a/modules/sparse/tests/unit_tests/adj2sp.dia.ref b/modules/sparse/tests/unit_tests/adj2sp.dia.ref
new file mode 100755
index 000000000..f386117a3
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/adj2sp.dia.ref
@@ -0,0 +1,57 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+//
+// Check the adjacency representation of a simple matrix
+xadj = [1 3 4 7 9 11]';
+iadj = [3 5 3 1 2 4 3 5 1 4]';
+v = [1 2 3 4 5 6 7 8 9 10]';
+B=adj2sp(xadj,iadj,v);
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+C=sparse(A);
+assert_checkequal ( and(B==C) , %t );
+//
+// Check the adjacency representation of a simple matrix
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+C=adj2sp(xadj,iadj,v);
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+assert_checkequal ( and(B==C) , %t );
+//
+// Test the C=adj2sp(xadj,iadj,v,mn) calling sequence
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+mn=[7 10];
+C=adj2sp(xadj,iadj,v,mn);
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+assert_checkequal ( and(B==C) , %t );
diff --git a/modules/sparse/tests/unit_tests/adj2sp.tst b/modules/sparse/tests/unit_tests/adj2sp.tst
new file mode 100755
index 000000000..0961dec16
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/adj2sp.tst
@@ -0,0 +1,59 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+//
+// Check the adjacency representation of a simple matrix
+xadj = [1 3 4 7 9 11]';
+iadj = [3 5 3 1 2 4 3 5 1 4]';
+v = [1 2 3 4 5 6 7 8 9 10]';
+B=adj2sp(xadj,iadj,v);
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+C=sparse(A);
+assert_checkequal ( and(B==C) , %t );
+//
+// Check the adjacency representation of a simple matrix
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+C=adj2sp(xadj,iadj,v);
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+assert_checkequal ( and(B==C) , %t );
+//
+// Test the C=adj2sp(xadj,iadj,v,mn) calling sequence
+xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+iadj = [2 5 2 3 1 2 7 6]';
+v = [3 7 5 3 6 5 2 3]';
+mn=[7 10];
+C=adj2sp(xadj,iadj,v,mn);
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+assert_checkequal ( and(B==C) , %t );
+
diff --git a/modules/sparse/tests/unit_tests/conjgrad.dia.ref b/modules/sparse/tests/unit_tests/conjgrad.dia.ref
new file mode 100755
index 000000000..6708187f6
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad.dia.ref
@@ -0,0 +1,349 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//-------------------------------------------------------
+// PCG
+// Test with 2 input arguments and all output arguments
+A = [10 1; 1 10];
+b = [11; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg");
+xexpected = [1; 1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+A2 = [100 1; 1 10];
+b2 = [101; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="pcg", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="pcg", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+A3 = [100 1; 1 0.0101];
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="pcg", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "pcg", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+b3 = [0; 0];
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "pcg");
+xexpected2 = [0; 0];
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+A4 = [
+1. 0.5000000000000001110223 0.3333333333333334258519 0.2500000000000000555112 0.2000000000000000666134
+0.4999999999999982236432 0.3333333333333319825620 0.2499999999999988897770 0.1999999999999990951682 0.1666666666666659080143
+0.3333333333333320380731 0.2499999999999990563104 0.1999999999999992617017 0.1666666666666660745477 0.1428571428571423496123
+0.2499999999999990285549 0.1999999999999993449684 0.1666666666666661855700 0.1428571428571424883902 0.1249999999999996808109
+0.1999999999999991506794 0.1666666666666660745477 0.1428571428571424328791 0.1249999999999996669331 0.11111111111111082739
+];
+b4 = ones(5, 1);
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "pcg", %M=M, tol=%eps, maxIter=3);
+expected = [
+5
+-120
+630
+-1120
+630 ];
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+C = [
+1. 0.5000000000000001110223 0.3333333333333334258519 0.2500000000000000555112 0.2000000000000000666134
+0. 0.288675134594810367528 0.2886751345948112557060 0.2598076211353305131624 0.2309401076758494653074
+0. 0. 0.0745355992499937836104 0.1118033988749897594817 0.1277753129999876502421
+0. 0. 0. 0.0188982236504644136865 0.0377964473009222076683
+0. 0. 0. 0. 0.0047619047619250291087
+];
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "pcg", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Well-conditionned problem
+A5 = [ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b5 = ones(10, 1);
+[x, fail, err, iter, res] = conjgrad(A5, b5, "pcg", 1d-12, 10);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+//-------------------------------------------------------
+// CGS
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="cgs", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="cgs", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="cgs", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "cgs", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "cgs");
+xexpected2 = [0; 0];
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "cgs", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "cgs", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+A5 = [ 94 0 0 0 0 28 0 0 32 20
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+[x, fail, err, iter, res] = conjgrad(A5, b5, "cgs", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 11 );
+//-------------------------------------------------------
+// BICG
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicg", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicg", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="bicg", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "bicg", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "bicg");
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicg", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicg", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 8 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+[x, fail, err, iter, res] = conjgrad(A5, b5, "bicg", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+//-------------------------------------------------------
+// BICGSTAB
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicgstab", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicgstab", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="bicgstab", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "bicgstab", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "bicgstab");
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicgstab", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 1 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicgstab", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 9 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+[x, fail, err, iter, res] = conjgrad(A5, b5, "bicgstab", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+//-------------------------------------------------------
+// Error checks
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"),"conjgrad",2,7);
+assert_checkerror("conjgrad(A);", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d.\n"),"conjgrad",1);
+assert_checkerror("conjgrad(""string"", b);", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"conjgrad",1);
+assert_checkerror("conjgrad(ones(5, 4), b);", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: A matrix expected.\n"),"conjgrad",2);
+assert_checkerror("conjgrad(A, ""string"");", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Column vector expected.\n"),"conjgrad",2);
+assert_checkerror("conjgrad(A, A);", refMsg);
+refMsg = msprintf(_("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",2,1);
+assert_checkerror("conjgrad(A, b4);", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Single String expected.\n"),"conjgrad",3);
+assert_checkerror("conjgrad(A, b, 1d-12, 15);", refMsg);
+refMsg = msprintf(_("%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"),"conjgrad",3,"pcg","cgs","bicg","bicgstab");
+assert_checkerror("conjgrad(A, b, ""gmres"", 1d-12, 15);", refMsg);
diff --git a/modules/sparse/tests/unit_tests/conjgrad.tst b/modules/sparse/tests/unit_tests/conjgrad.tst
new file mode 100755
index 000000000..6039e2a36
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad.tst
@@ -0,0 +1,368 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+
+//-------------------------------------------------------
+// PCG
+
+// Test with 2 input arguments and all output arguments
+A = [10 1; 1 10];
+b = [11; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg");
+xexpected = [1; 1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "pcg", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+A2 = [100 1; 1 10];
+b2 = [101; 11];
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="pcg", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="pcg", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+A3 = [100 1; 1 0.0101];
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="pcg", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "pcg", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+b3 = [0; 0];
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "pcg");
+xexpected2 = [0; 0];
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+A4 = [
+1. 0.5000000000000001110223 0.3333333333333334258519 0.2500000000000000555112 0.2000000000000000666134
+0.4999999999999982236432 0.3333333333333319825620 0.2499999999999988897770 0.1999999999999990951682 0.1666666666666659080143
+0.3333333333333320380731 0.2499999999999990563104 0.1999999999999992617017 0.1666666666666660745477 0.1428571428571423496123
+0.2499999999999990285549 0.1999999999999993449684 0.1666666666666661855700 0.1428571428571424883902 0.1249999999999996808109
+0.1999999999999991506794 0.1666666666666660745477 0.1428571428571424328791 0.1249999999999996669331 0.11111111111111082739
+];
+b4 = ones(5, 1);
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "pcg", %M=M, tol=%eps, maxIter=3);
+expected = [
+5
+-120
+630
+-1120
+630 ];
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+C = [
+1. 0.5000000000000001110223 0.3333333333333334258519 0.2500000000000000555112 0.2000000000000000666134
+0. 0.288675134594810367528 0.2886751345948112557060 0.2598076211353305131624 0.2309401076758494653074
+0. 0. 0.0745355992499937836104 0.1118033988749897594817 0.1277753129999876502421
+0. 0. 0. 0.0188982236504644136865 0.0377964473009222076683
+0. 0. 0. 0. 0.0047619047619250291087
+];
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "pcg", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Well-conditionned problem
+A5 = [ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b5 = ones(10, 1);
+[x, fail, err, iter, res] = conjgrad(A5, b5, "pcg", 1d-12, 10);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+
+//-------------------------------------------------------
+// CGS
+
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "cgs", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="cgs", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="cgs", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="cgs", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "cgs", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "cgs");
+xexpected2 = [0; 0];
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "cgs", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "cgs", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+A5 = [ 94 0 0 0 0 28 0 0 32 20
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+[x, fail, err, iter, res] = conjgrad(A5, b5, "cgs", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 11 );
+
+//-------------------------------------------------------
+// BICG
+
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicg", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicg", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicg", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="bicg", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "bicg", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "bicg");
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicg", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 2 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicg", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 8 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+[x, fail, err, iter, res] = conjgrad(A5, b5, "bicg", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+
+//-------------------------------------------------------
+// BICGSTAB
+
+// Test with 2 input arguments and all output arguments
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab");
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// Test with 3 input arguments and all output arguments
+tol = 100*%eps;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checktrue ( err <= tol);
+// Test with 4 input arguments and all output arguments
+maxit = 10;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit);
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// Test with 5 input arguments and all output arguments
+M1 = [1 0; 0 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 6 input arguments and all output arguments
+M2 = M1;
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1, M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with 7 input arguments and all output arguments
+x0 = [1; 1];
+[xcomputed, flag, err, iter, res] = conjgrad(A, b, "bicgstab", tol, maxit, M1, M2, x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test with non-positional input parameters so that 0 iteration can happen
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicgstab", maxIter=0);
+assert_checkequal ( iter , 0 );
+// Test with non-positional input parameters so that 1 iteration is sufficient
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, method="bicgstab", tol=0.1);
+assert_checkequal ( iter , 1 );
+// Test with non-positional input parameters so that pre-conditionning is necessary
+M = A3;
+[xcomputed, flag, err, iter, res] = conjgrad(A3, b2, method="bicgstab", tol, maxit,%M=M, maxIter=5, tol=%eps);
+assert_checkequal ( flag , 0 );
+// Test with non-positional input parameters so that good initialization generates 0 iterations
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b2, "bicgstab", x0=[1;1]);
+assert_checkequal ( iter , 0 );
+// Test the special case where b = 0
+[xcomputed, flag, err, iter, res] = conjgrad(A2, b3, "bicgstab");
+assert_checkalmostequal ( xcomputed , xexpected2 , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// Try a hard case where preconditionning is necessary
+// This is the Hilbert 5x5 matrix : A = 1/(testmatrix("hilb",5))
+M = A4;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicgstab", %M=M, tol=%eps, maxIter=3);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 1 );
+// Try a difficult case where preconditionning is necessary
+// Use two pre-conditionning matrices.
+// This is the Cholesky factorization of the matrix A : C = chol(A)
+M1 = C';
+M2 = C;
+[xcomputed, flag, err, iter, res] = conjgrad(A4, b4, "bicgstab", %M=M1, %M2=M2, tol=%eps, maxIter=10);
+assert_checkalmostequal ( xcomputed , expected, 1.e8*%eps );
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 9 );
+// Well-conditionned problem with a nonsymmetric matrix (top-right element)
+[x, fail, err, iter, res] = conjgrad(A5, b5, "bicgstab", 1d-12, 15);
+assert_checkequal ( flag , 0 );
+assert_checkequal ( iter , 10 );
+
+
+
+//-------------------------------------------------------
+// Error checks
+
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"),"conjgrad",2,7);
+assert_checkerror("conjgrad(A);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong type for input argument #%d.\n"),"conjgrad",1);
+assert_checkerror("conjgrad(""string"", b);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Square matrix expected.\n"),"conjgrad",1);
+assert_checkerror("conjgrad(ones(5, 4), b);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: A matrix expected.\n"),"conjgrad",2);
+assert_checkerror("conjgrad(A, ""string"");", refMsg);
+
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Column vector expected.\n"),"conjgrad",2);
+assert_checkerror("conjgrad(A, A);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong size for input argument #%d: Same size as input argument #%d expected.\n"),"conjgrad",2,1);
+assert_checkerror("conjgrad(A, b4);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Single String expected.\n"),"conjgrad",3);
+assert_checkerror("conjgrad(A, b, 1d-12, 15);", refMsg);
+
+refMsg = msprintf(_("%s: Wrong value for input argument #%d: %s, %s, %s or %s expected.\n"),"conjgrad",3,"pcg","cgs","bicg","bicgstab");
+assert_checkerror("conjgrad(A, b, ""gmres"", 1d-12, 15);", refMsg);
diff --git a/modules/sparse/tests/unit_tests/conjgrad_function.dia.ref b/modules/sparse/tests/unit_tests/conjgrad_function.dia.ref
new file mode 100755
index 000000000..518691729
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_function.dia.ref
@@ -0,0 +1,68 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//------------------------------------------------------------------
+// PCG
+// Numerical tests
+// Case where A is given as a function computing the right-hand side
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+function y=Afunction(x)
+ mymatrix=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y=mymatrix*x
+endfunction
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// CGS
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>11 then bugmes();quit;end
+if err > 100**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICG
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICGSTAB
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"bicgstab");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10000**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>8 then bugmes();quit;end
+if err > 1000**3*%eps then bugmes();quit;end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_function.tst b/modules/sparse/tests/unit_tests/conjgrad_function.tst
new file mode 100755
index 000000000..d6dadd462
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_function.tst
@@ -0,0 +1,76 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+
+//------------------------------------------------------------------
+// PCG
+
+// Numerical tests
+// Case where A is given as a function computing the right-hand side
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+function y=Afunction(x)
+ mymatrix=[ 94 0 0 0 0 28 0 0 32 0
+ 0 59 13 5 0 0 0 10 0 0
+ 0 13 72 34 2 0 0 0 0 65
+ 0 5 34 114 0 0 0 0 0 55
+ 0 0 2 0 70 0 28 32 12 0
+ 28 0 0 0 0 87 20 0 33 0
+ 0 0 0 0 28 20 71 39 0 0
+ 0 10 0 0 32 0 39 46 8 0
+ 32 0 0 0 12 33 0 8 82 11
+ 0 0 65 55 0 0 0 0 11 100];
+ y=mymatrix*x
+endfunction
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// CGS
+
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>11 then pause,end
+if err > 100**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICG
+
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICGSTAB
+
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Afunction,b,"bicgstab");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10000**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>8 then pause,end
+if err > 1000**3*%eps then pause,end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_list.dia.ref b/modules/sparse/tests/unit_tests/conjgrad_list.dia.ref
new file mode 100755
index 000000000..ac27aa75e
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_list.dia.ref
@@ -0,0 +1,103 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//------------------------------------------------------------------
+// PCG
+// Numerical tests
+// Case where A is given as a function computing the right-hand side
+mymatrix=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+function y=Atimesx(x,mymatrix)
+ y=mymatrix*x
+endfunction
+// With the default 10 iterations, the algorithm performs well
+Alist = list(Atimesx,mymatrix)
+ Alist =
+
+
+ Alist(1)
+
+[y]=function(x,mymatrix)
+
+ Alist(2)
+
+
+ column 1 to 9
+
+ 94. 0. 0. 0. 0. 28. 0. 0. 32.
+ 0. 59. 13. 5. 0. 0. 0. 10. 0.
+ 0. 13. 72. 34. 2. 0. 0. 0. 0.
+ 0. 5. 34. 114. 0. 0. 0. 0. 0.
+ 0. 0. 2. 0. 70. 0. 28. 32. 12.
+ 28. 0. 0. 0. 0. 87. 20. 0. 33.
+ 0. 0. 0. 0. 28. 20. 71. 39. 0.
+ 0. 10. 0. 0. 32. 0. 39. 46. 8.
+ 32. 0. 0. 0. 12. 33. 0. 8. 82.
+ 0. 0. 65. 55. 0. 0. 0. 0. 11.
+
+ column 10
+
+ 0.
+ 0.
+ 65.
+ 55.
+ 0.
+ 0.
+ 0.
+ 0.
+ 11.
+ 100.
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// CGS
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>11 then bugmes();quit;end
+if err > 100**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICG
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICGSTAB
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>8 then bugmes();quit;end
+if err > 1000**3*%eps then bugmes();quit;end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_list.tst b/modules/sparse/tests/unit_tests/conjgrad_list.tst
new file mode 100755
index 000000000..e1c1af719
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_list.tst
@@ -0,0 +1,76 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+
+//------------------------------------------------------------------
+// PCG
+
+// Numerical tests
+// Case where A is given as a function computing the right-hand side
+mymatrix=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+function y=Atimesx(x,mymatrix)
+ y=mymatrix*x
+endfunction
+// With the default 10 iterations, the algorithm performs well
+Alist = list(Atimesx,mymatrix)
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// CGS
+
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>11 then pause,end
+if err > 100**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICG
+
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICGSTAB
+
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Alist,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>8 then pause,end
+if err > 1000**3*%eps then pause,end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_numerical.dia.ref b/modules/sparse/tests/unit_tests/conjgrad_numerical.dia.ref
new file mode 100755
index 000000000..bacd6d08d
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_numerical.dia.ref
@@ -0,0 +1,108 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//------------------------------------------------------------------
+// PCG
+// Numerical tests
+//Well conditionned problem
+A=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+// With a tolerance of 1.e-3, there are 5 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg",tol);
+if fail<>0 then bugmes();quit;end
+if iter>10 then bugmes();quit;end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg",tol,maxIter);
+if fail<>1 then bugmes();quit;end
+if iter<>maxIter then bugmes();quit;end
+//------------------------------------------------------------------
+// CGS
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>11 then bugmes();quit;end
+if err > 100**3*%eps then bugmes();quit;end
+// With a tolerance of 1.e-3, there are 3 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",tol);
+if fail<>0 then bugmes();quit;end
+if iter>10 then bugmes();quit;end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",tol,maxIter);
+if fail<>1 then bugmes();quit;end
+if iter<>maxIter then bugmes();quit;end
+//------------------------------------------------------------------
+// BICG
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+// With a tolerance of 1.e-3, there are 5 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg",tol);
+if fail<>0 then bugmes();quit;end
+if iter>10 then bugmes();quit;end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg",tol,maxIter);
+if fail<>1 then bugmes();quit;end
+if iter<>maxIter then bugmes();quit;end
+//------------------------------------------------------------------
+// BICGSTAB
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>8 then bugmes();quit;end
+if err > 1000**3*%eps then bugmes();quit;end
+// With a tolerance of 1.e-3, there are 3 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab",tol);
+if fail<>0 then bugmes();quit;end
+if iter>10 then bugmes();quit;end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab",tol,maxIter);
+if fail<>1 then bugmes();quit;end
+if iter<>maxIter then bugmes();quit;end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_numerical.tst b/modules/sparse/tests/unit_tests/conjgrad_numerical.tst
new file mode 100755
index 000000000..a1e93135d
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_numerical.tst
@@ -0,0 +1,116 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+
+//------------------------------------------------------------------
+// PCG
+
+// Numerical tests
+//Well conditionned problem
+A=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+// With a tolerance of 1.e-3, there are 5 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg",tol);
+if fail<>0 then pause,end
+if iter>10 then pause,end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"pcg",tol,maxIter);
+if fail<>1 then pause,end
+if iter<>maxIter then pause,end
+
+//------------------------------------------------------------------
+// CGS
+
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>11 then pause,end
+if err > 100**3*%eps then pause,end
+// With a tolerance of 1.e-3, there are 3 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",tol);
+if fail<>0 then pause,end
+if iter>10 then pause,end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"cgs",tol,maxIter);
+if fail<>1 then pause,end
+if iter<>maxIter then pause,end
+
+//------------------------------------------------------------------
+// BICG
+
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+// With a tolerance of 1.e-3, there are 5 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg",tol);
+if fail<>0 then pause,end
+if iter>10 then pause,end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicg",tol,maxIter);
+if fail<>1 then pause,end
+if iter<>maxIter then pause,end
+
+//------------------------------------------------------------------
+// BICGSTAB
+
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>8 then pause,end
+if err > 1000**3*%eps then pause,end
+// With a tolerance of 1.e-3, there are 3 iterations and the status is "success"
+tol=1.d-3;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab",tol);
+if fail<>0 then pause,end
+if iter>10 then pause,end
+// With a tolerance of %eps but only 5 iterations allowed, the status is "fail"
+tol=%eps;
+maxIter = 5;
+[xcomputed, fail, err, iter, res]=conjgrad(A,b,"bicgstab",tol,maxIter);
+if fail<>1 then pause,end
+if iter<>maxIter then pause,end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_sparse.dia.ref b/modules/sparse/tests/unit_tests/conjgrad_sparse.dia.ref
new file mode 100755
index 000000000..491bc2407
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_sparse.dia.ref
@@ -0,0 +1,65 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//------------------------------------------------------------------
+// PCG
+// Numerical tests
+// Case where A is sparse
+A=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+Asparse = sparse(A);
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// CGS
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>11 then bugmes();quit;end
+if err > 100**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICG
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>10 then bugmes();quit;end
+if err > 10**3*%eps then bugmes();quit;end
+//------------------------------------------------------------------
+// BICGSTAB
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then bugmes();quit;end
+if fail<>0 then bugmes();quit;end
+if iter<>8 then bugmes();quit;end
+if err > 1000**3*%eps then bugmes();quit;end
diff --git a/modules/sparse/tests/unit_tests/conjgrad_sparse.tst b/modules/sparse/tests/unit_tests/conjgrad_sparse.tst
new file mode 100755
index 000000000..dfe585baa
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/conjgrad_sparse.tst
@@ -0,0 +1,73 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added cgs, bicg and bicgstab
+// Copyright (C) 2008 - INRIA - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+
+//------------------------------------------------------------------
+// PCG
+
+// Numerical tests
+// Case where A is sparse
+A=[ 94 0 0 0 0 28 0 0 32 0
+0 59 13 5 0 0 0 10 0 0
+0 13 72 34 2 0 0 0 0 65
+0 5 34 114 0 0 0 0 0 55
+0 0 2 0 70 0 28 32 12 0
+28 0 0 0 0 87 20 0 33 0
+0 0 0 0 28 20 71 39 0 0
+0 10 0 0 32 0 39 46 8 0
+32 0 0 0 12 33 0 8 82 11
+0 0 65 55 0 0 0 0 11 100];
+b = [154.
+87.
+186.
+208.
+144.
+168.
+158.
+135.
+178.
+231.];
+Asparse = sparse(A);
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"pcg");
+xexpected=ones(10,1);
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// CGS
+
+// CGS needs 11 iterations to converge
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"cgs",maxIter=11);
+if norm(xcomputed-xexpected)>100**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>11 then pause,end
+if err > 100**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICG
+
+// With the default 10 iterations, the algorithm performs well
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"bicg");
+if norm(xcomputed-xexpected)>10**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>10 then pause,end
+if err > 10**3*%eps then pause,end
+
+//------------------------------------------------------------------
+// BICGSTAB
+
+// BICGSTAB only needs 8 iterations to converge to the required tol, but is less accurate on arrival.
+[xcomputed, fail, err, iter, res]=conjgrad(Asparse,b,"bicgstab");
+if norm(xcomputed-xexpected)>10000**3*%eps then pause,end
+if fail<>0 then pause,end
+if iter<>8 then pause,end
+if err > 1000**3*%eps then pause,end
diff --git a/modules/sparse/tests/unit_tests/lsparse.dia.ref b/modules/sparse/tests/unit_tests/lsparse.dia.ref
new file mode 100755
index 000000000..2947beae8
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/lsparse.dia.ref
@@ -0,0 +1,382 @@
+// Copyright INRIA
+mode(5)
+lines(0)
+zer=sparse([],[],[6,6]);
+//
+//
+//-------------------------------------------------------------
+//test des primitives sparse, full
+//-------------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[5 6]);B=full(b);
+if or(full(a<>0)<>(A<>0)) then bugmes();quit;end
+if or(full(b<>0)<>(B<>0)) then bugmes();quit;end
+if or(full(b>0)<>(B>0)) then bugmes();quit;end
+if or(full(b<0)<>(B<0)) then bugmes();quit;end
+if or(full(a>100)<>(A>100)) then bugmes();quit;end
+if sparse(B>0)<>(b>0) then bugmes();quit;end
+if sparse(B<0)<>(b<0) then bugmes();quit;end
+//-------------------------------------------------------------
+//test de la primitives spget
+//-------------------------------------------------------------
+//-----------------------------------------------
+// | and & tests
+//-----------------------------------------------
+// -- sparse sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (a|b)<>(A|B) then bugmes();quit;end
+if (a&b)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|b)<>(A|B) then bugmes();quit;end
+if (a&b)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (a|b)<>(A|B) then bugmes();quit;end
+if (a&b)<>(A&B) then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|b)<>(A|B) then bugmes();quit;end
+if (a&b)<>(A&B) then bugmes();quit;end
+// -- sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (a|B)<>(A|B) then bugmes();quit;end
+if (a&B)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|B)<>(A|B) then bugmes();quit;end
+if (a&B)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (a|B)<>(A|B) then bugmes();quit;end
+if (a&B)<>(A&B) then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|B)<>(A|B) then bugmes();quit;end
+if (a&B)<>(A&B) then bugmes();quit;end
+// -- full sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (A|b)<>(A|B) then bugmes();quit;end
+if (A&b)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (A|b)<>(A|B) then bugmes();quit;end
+if (A&b)<>(A&B) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (A|b)<>(A|B) then bugmes();quit;end
+if (A&b)<>(A&B) then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (A|b)<>(A|B) then bugmes();quit;end
+if (A&b)<>(A&B) then bugmes();quit;end
+// ----------------------------------------------------------
+// test de la transposition
+//-----------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full(a')<>full(a)') then bugmes();quit;end
+if or(full(b')<>full(b)') then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full(a')<>full(a)') then bugmes();quit;end
+if or(full(b')<>full(b)') then bugmes();quit;end
+// ----------------------------------------------------------
+// test des concatenation
+//-----------------------------------------------------------
+// sparse sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full([a])<>A) then bugmes();quit;end
+if or(full([a b])<>[A B]) then bugmes();quit;end
+if or(full([a;b])<>[A;B]) then bugmes();quit;end
+if or(full([a []])<>A) then bugmes();quit;end
+if or(full([a;[]])<>A) then bugmes();quit;end
+// sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full([a B])<>[A B]) then bugmes();quit;end
+if or(full([a;B])<>[A;B]) then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full([a B])<>[A B]) then bugmes();quit;end
+if or(full([a;B])<>[A;B]) then bugmes();quit;end
+// full sparse
+if or(full([A b])<>[A B]) then bugmes();quit;end
+if or(full([A;b])<>[A;B]) then bugmes();quit;end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full([A b])<>[A B]) then bugmes();quit;end
+if or(full([B;b])<>[A;B]) then bugmes();quit;end
+// ----------------------------------------------------------
+// test des extractions
+//-----------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;af=full(a);
+if or(full(a(1,3))<>af(1,3)) then bugmes();quit;end
+if or(full(a(1,4))<>af(1,4)) then bugmes();quit;end
+if or(full(a(1,:))<>af(1,:)) then bugmes();quit;end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);v=v<>0;vf=full(v);
+if or(full(v(:))<>vf(:)) then bugmes();quit;end
+if or(full(v(3:4))<>vf(3:4)) then bugmes();quit;end
+if or(full(v([1 5]))<>vf([1 5])) then bugmes();quit;end
+if or(full(v([4 3]))<>vf([4 3])) then bugmes();quit;end
+if or(full(v([4 4]))<>vf([4 4])) then bugmes();quit;end
+if or(full(v([1 1]))<>vf([1 1])) then bugmes();quit;end
+v=v';vf=vf';
+if or(full(v(:))<>vf(:)) then bugmes();quit;end
+if or(full(v(3:4))<>vf(3:4)) then bugmes();quit;end
+if or(full(v([1 5]))<>vf([1 5])) then bugmes();quit;end
+if or(full(v([4 3]))<>vf([4 3])) then bugmes();quit;end
+if or(full(v([4 4]))<>vf([4 4])) then bugmes();quit;end
+if or(full(v([1 1]))<>vf([1 1])) then bugmes();quit;end
+// full line insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;af=full(a);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);vt=vt<>0;
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6])<>0;
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6])<>0;
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// insert zero vector
+vt=sparse([],[],[1,6])<>0;
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);b=b<>0;
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);b=b<>0;
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);v=v<>0;
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);b=b<>0;
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);b=b<>0;
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+b=sparse([1 2;1 3;3 3],-(1:3),[3,3]);b=b<>0;
+a1=a;a1(1,1)=sparse(%t);A=full(a);A(1,1)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,6)=sparse(%t);A=full(a);A(1,6)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,8)=sparse(%t);A=full(a);A(1,8)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+//sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+vt=[%t %f %t %t %t %t];
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t];
+a1=a;a1([1 3],:)=b;A=full(a);A([1 3],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);A([3 1],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t;%t %f %t %f %t %t];
+a1=a;a1([1 3 1],:)=b;A=full(a);A([1 3 1],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+v=[%t %f %t %t %t %t]';
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);A(:,3)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);A(:,7)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);A(:,8)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t]';
+a1=a;a1(:,[1 3])=b;A=full(a);A(:,[1 3])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);A(:,[3 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t;%f %t %t %t %t %f]';
+a1=a;a1(:,[1 3 1])=b;A=full(a);A(:,[1 3 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+b=[%t %t %f;%f %t %f;%t %t %t];
+a1=a;a1(1,1)=%t;A=full(a);A(1,1)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,6)=%t;A=full(a);A(1,6)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,8)=%t;A=full(a);A(1,8)=%t;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+// vector insertion
+v=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);v=v<>0;
+v1=v;v1(1)=%f;V=full(v);V(1)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=%t;V=full(v);V(2)=%t;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=%f;V=full(v);V(8)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=[%t;%t;%f];V=full(v);V([1 2 8])=[%t;%t;%f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then bugmes();quit;end
+v1=v;v1(1)=sparse(%f);V=full(v);V(1)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=sparse(%f);V=full(v);V(2)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=sparse(%f);V=full(v);V(8)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=sparse([%f;%t;%f]);V=full(v);V([1 2 8])=[%f;%t;%f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 1])=sparse([%f;%f;%f]);V=full(v);V([1 2 1])=[%f;%f;%f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then bugmes();quit;end
+v1=v;v1(:)=(sparse([2 1],44,[6 1])<>0);V=full(v);V(:)=[%f;%t;%f;%f;%f;%f];
+if or(full(v1)<>V) then bugmes();quit;end
+v=v';
+v1=v;v1(1)=%f;V=full(v);V(1)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=%f;V=full(v);V(2)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=%f;V=full(v);V(8)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=[%t %f %f];V=full(v);V([1 2 8])=[%t %f %f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(1)=sparse(%f);V=full(v);V(1)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=sparse(%f);V=full(v);V(2)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=sparse(%f);V=full(v);V(8)=%f;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=sparse([%f %t %f]);V=full(v);V([1 2 8])=[%f %t %f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 1])=sparse([%f %f %f]);V=full(v);V([1 2 1])=[%f %f %f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=(sparse([1 2],44,[1,6]))<>0;V=full(v);V(:)=[%f %t %f %f %f %f];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(1)=[];V=full(v);V(1)=[];
+if or(full(v1)<>V) then bugmes();quit;end
+//test des comparaisons
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6])<>0;
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6])<>0;;
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+a=sparse([1 1;3 1;6 1],[10 11 12],[6 1])<>0;
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+a=a';
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6])<>0;
+b=sparse([1 6;1 2;5 5],[10;-1;-1],[5 6])<>0;
+if a==b<>%f then bugmes();quit;end
+if a<>b<>%t then bugmes();quit;end
diff --git a/modules/sparse/tests/unit_tests/lsparse.tst b/modules/sparse/tests/unit_tests/lsparse.tst
new file mode 100755
index 000000000..7f1dfcfea
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/lsparse.tst
@@ -0,0 +1,391 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+mode(5)
+lines(0)
+zer=sparse([],[],[6,6]);
+//
+//
+//-------------------------------------------------------------
+//test des primitives sparse, full
+//-------------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[5 6]);B=full(b);
+if or(full(a<>0)<>(A<>0)) then pause,end
+if or(full(b<>0)<>(B<>0)) then pause,end
+if or(full(b>0)<>(B>0)) then pause,end
+if or(full(b<0)<>(B<0)) then pause,end
+if or(full(a>100)<>(A>100)) then pause,end
+if sparse(B>0)<>(b>0) then pause,end
+if sparse(B<0)<>(b<0) then pause,end
+//-------------------------------------------------------------
+//test de la primitives spget
+//-------------------------------------------------------------
+//-----------------------------------------------
+// | and & tests
+//-----------------------------------------------
+// -- sparse sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (a|b)<>(A|B) then pause,end
+if (a&b)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|b)<>(A|B) then pause,end
+if (a&b)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (a|b)<>(A|B) then pause,end
+if (a&b)<>(A&B) then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|b)<>(A|B) then pause,end
+if (a&b)<>(A&B) then pause,end
+// -- sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (a|B)<>(A|B) then pause,end
+if (a&B)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|B)<>(A|B) then pause,end
+if (a&B)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (a|B)<>(A|B) then pause,end
+if (a&B)<>(A&B) then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (a|B)<>(A|B) then pause,end
+if (a&B)<>(A&B) then pause,end
+// -- full sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if (A|b)<>(A|B) then pause,end
+if (A&b)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (A|b)<>(A|B) then pause,end
+if (A&b)<>(A&B) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+if (A|b)<>(A|B) then pause,end
+if (A&b)<>(A&B) then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if (A|b)<>(A|B) then pause,end
+if (A&b)<>(A&B) then pause,end
+// ----------------------------------------------------------
+// test de la transposition
+//-----------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full(a')<>full(a)') then pause,end
+if or(full(b')<>full(b)') then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full(a')<>full(a)') then pause,end
+if or(full(b')<>full(b)') then pause,end
+// ----------------------------------------------------------
+// test des concatenation
+//-----------------------------------------------------------
+// sparse sparse
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full([a])<>A) then pause,end
+if or(full([a b])<>[A B]) then pause,end
+if or(full([a;b])<>[A;B]) then pause,end
+if or(full([a []])<>A) then pause,end
+if or(full([a;[]])<>A) then pause,end
+// sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;A=full(a);
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b<>0;B=full(b);
+if or(full([a B])<>[A B]) then pause,end
+if or(full([a;B])<>[A;B]) then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full([a B])<>[A B]) then pause,end
+if or(full([a;B])<>[A;B]) then pause,end
+// full sparse
+if or(full([A b])<>[A B]) then pause,end
+if or(full([A;b])<>[A;B]) then pause,end
+b=sparse([1 6;1 2;5 5],[-1;-1;-1],[6 6]);b=b>0;B=full(b);
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a>100;A=full(a);
+if or(full([A b])<>[A B]) then pause,end
+if or(full([B;b])<>[A;B]) then pause,end
+// ----------------------------------------------------------
+// test des extractions
+//-----------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;af=full(a);
+if or(full(a(1,3))<>af(1,3)) then pause,end
+if or(full(a(1,4))<>af(1,4)) then pause,end
+if or(full(a(1,:))<>af(1,:)) then pause,end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);v=v<>0;vf=full(v);
+if or(full(v(:))<>vf(:)) then pause,end
+if or(full(v(3:4))<>vf(3:4)) then pause,end
+if or(full(v([1 5]))<>vf([1 5])) then pause,end
+if or(full(v([4 3]))<>vf([4 3])) then pause,end
+if or(full(v([4 4]))<>vf([4 4])) then pause,end
+if or(full(v([1 1]))<>vf([1 1])) then pause,end
+v=v';vf=vf';
+if or(full(v(:))<>vf(:)) then pause,end
+if or(full(v(3:4))<>vf(3:4)) then pause,end
+if or(full(v([1 5]))<>vf([1 5])) then pause,end
+if or(full(v([4 3]))<>vf([4 3])) then pause,end
+if or(full(v([4 4]))<>vf([4 4])) then pause,end
+if or(full(v([1 1]))<>vf([1 1])) then pause,end
+// full line insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;af=full(a);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);vt=vt<>0;
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6])<>0;
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6])<>0;
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+// insert zero vector
+vt=sparse([],[],[1,6])<>0;
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);b=b<>0;
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);b=b<>0;
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);v=v<>0;
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);b=b<>0;
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);b=b<>0;
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+b=sparse([1 2;1 3;3 3],-(1:3),[3,3]);b=b<>0;
+a1=a;a1(1,1)=sparse(%t);A=full(a);A(1,1)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,6)=sparse(%t);A=full(a);A(1,6)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,8)=sparse(%t);A=full(a);A(1,8)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+//sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+vt=[%t %f %t %t %t %t];
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then pause,end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t];
+a1=a;a1([1 3],:)=b;A=full(a);A([1 3],:)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);A([3 1],:)=b;
+if or(full(a1)<>A) then pause,end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t;%t %f %t %f %t %t];
+a1=a;a1([1 3 1],:)=b;A=full(a);A([1 3 1],:)=b;
+if or(full(a1)<>A) then pause,end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+v=[%t %f %t %t %t %t]';
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);A(:,3)=v;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);A(:,7)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);A(:,8)=v;
+if or(full(a1)<>A) then pause,end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t]';
+a1=a;a1(:,[1 3])=b;A=full(a);A(:,[1 3])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);A(:,[3 1])=b;
+if or(full(a1)<>A) then pause,end
+b=[%t %f %t %t %t %t;%f %f %t %t %f %t;%f %t %t %t %t %f]';
+a1=a;a1(:,[1 3 1])=b;A=full(a);A(:,[1 3 1])=b;
+if or(full(a1)<>A) then pause,end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);a=a<>0;
+b=[%t %t %f;%f %t %f;%t %t %t];
+a1=a;a1(1,1)=%t;A=full(a);A(1,1)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,6)=%t;A=full(a);A(1,6)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,8)=%t;A=full(a);A(1,8)=%t;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=b;
+if or(full(a1)<>A) then pause,end
+// vector insertion
+v=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);v=v<>0;
+v1=v;v1(1)=%f;V=full(v);V(1)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=%t;V=full(v);V(2)=%t;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=%f;V=full(v);V(8)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=[%t;%t;%f];V=full(v);V([1 2 8])=[%t;%t;%f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then pause,end
+v1=v;v1(1)=sparse(%f);V=full(v);V(1)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=sparse(%f);V=full(v);V(2)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=sparse(%f);V=full(v);V(8)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=sparse([%f;%t;%f]);V=full(v);V([1 2 8])=[%f;%t;%f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 1])=sparse([%f;%f;%f]);V=full(v);V([1 2 1])=[%f;%f;%f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then pause,end
+v1=v;v1(:)=(sparse([2 1],44,[6 1])<>0);V=full(v);V(:)=[%f;%t;%f;%f;%f;%f];
+if or(full(v1)<>V) then pause,end
+v=v';
+v1=v;v1(1)=%f;V=full(v);V(1)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=%f;V=full(v);V(2)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=%f;V=full(v);V(8)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=[%t %f %f];V=full(v);V([1 2 8])=[%t %f %f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(1)=sparse(%f);V=full(v);V(1)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=sparse(%f);V=full(v);V(2)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=sparse(%f);V=full(v);V(8)=%f;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=sparse([%f %t %f]);V=full(v);V([1 2 8])=[%f %t %f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 1])=sparse([%f %f %f]);V=full(v);V([1 2 1])=[%f %f %f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=(sparse([1 2],44,[1,6]))<>0;V=full(v);V(:)=[%f %t %f %f %f %f];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(1)=[];V=full(v);V(1)=[];
+if or(full(v1)<>V) then pause,end
+//test des comparaisons
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6])<>0;
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6])<>0;;
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+a=sparse([1 1;3 1;6 1],[10 11 12],[6 1])<>0;
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+a=a';
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6])<>0;
+b=sparse([1 6;1 2;5 5],[10;-1;-1],[5 6])<>0;
+if a==b<>%f then pause,end
+if a<>b<>%t then pause,end
+
diff --git a/modules/sparse/tests/unit_tests/ordmmd.dia.ref b/modules/sparse/tests/unit_tests/ordmmd.dia.ref
new file mode 100755
index 000000000..a49b2d395
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/ordmmd.dia.ref
@@ -0,0 +1,21 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5/8 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+[xadj,iadj,val]=sp2adj(A);
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+assert_checkequal(perm,[5;4;3;2;1]);
+assert_checkequal(invp,[5;4;3;2;1]);
+assert_checkequal(nofsub,8);
diff --git a/modules/sparse/tests/unit_tests/ordmmd.tst b/modules/sparse/tests/unit_tests/ordmmd.tst
new file mode 100755
index 000000000..6c90c3d45
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/ordmmd.tst
@@ -0,0 +1,24 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+
+
+A = [
+4. 1. 2. 0.5 2.
+1. 0.5 0. 0. 0.
+2. 0. 3. 0. 0.
+0.5 0. 0. 5/8 0.
+2. 0. 0. 0. 16.
+];
+A = sparse(A);
+[xadj,iadj,val]=sp2adj(A);
+n = size(A,"r");
+[perm,invp,nofsub]=ordmmd(xadj,iadj,n);
+assert_checkequal(perm,[5;4;3;2;1]);
+assert_checkequal(invp,[5;4;3;2;1]);
+assert_checkequal(nofsub,8);
diff --git a/modules/sparse/tests/unit_tests/qmr.dia.ref b/modules/sparse/tests/unit_tests/qmr.dia.ref
new file mode 100755
index 000000000..e2c564039
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/qmr.dia.ref
@@ -0,0 +1,645 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 Scilab Enterprises Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// unit tests for qmr() function
+// =============================================================================
+warning('off')
+// ----------------
+// If A is a matrix
+// ----------------
+// 1. Interface
+// ============
+assert_checkerror( "qmr()", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr(1)", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([1 2;3 4])", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([1 2;3 4;5 6],[1;1;1])", "%s: Wrong size for input argument #%d: Square matrix expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([1 2;3 4;5 6],[1 1 1])", "%s: Wrong size for input argument #%d: Square matrix expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([1 2;3 4],[1 1])", "%s: Wrong size for input argument #%d: Column vector expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([%t %t;%t %t],[1;1])", "%s: Wrong type for input argument #%d : A real or complex matrix or a sparse matrix or a function expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([],[])", "%s: Wrong size for input argument #%d: Column vector expected.\n", 10000, "qmr", 2);
+// 2. Test with 2 input arguments and all output arguments
+// =======================================================
+assert_checkfalse(execstr("qmr([10 1;1 10],""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", 2);
+assert_checkerror("qmr([10 1;1 10],""t"")", refMsg);
+A=[10,1;1,10];
+b=[11;11];
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// 3. Test with 3 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+assert_checkfalse(execstr("qmr(A, b,""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", 3);
+assert_checkerror("qmr(A, b,""t"")", refMsg);
+x0=[0.5;0.5];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 4. Test with 4 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+assert_checkfalse(execstr("qmr(A, b, x0, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", 4);
+assert_checkerror("qmr(A, b, x0, ""t"")", refMsg);
+M1=[1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+// 5.Test with 5 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+assert_checkfalse(execstr("qmr(A, b, x0, M1, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, M1, ""t"")", refMsg);
+M2=[1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 6.Test with 6 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0 = [0.5;0.5];
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, M2, ""t"")", refMsg);
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, %i)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, M2, %i)", refMsg);
+maxit = 10;
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2,maxit);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 7.Test with 7 input arguments and all output arguments
+// =======================================================
+A=[10,1;1,10];
+b=[11;11];
+tol = 100*%eps;
+maxit = 10;
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+x0=[0.5;0.5];
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, maxit, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"), "qmr", 7);
+assert_checkerror("qmr(A, b, x0, M1, M2, maxit, ""t"")", refMsg);
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, maxit, %i)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"), "qmr", 7);
+assert_checkerror("qmr(A, b, x0, M1, M2, maxit, %i)", refMsg);
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2,maxit,tol);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 8. Test with non-positionnal input parameters so that good initialization generates 0 iterations
+// =================================================================================================
+A=[100,1;1,10.];
+b=[101;11];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0=[0.5;0.5]);
+assert_checkequal ( iter , 2 );
+// 9. Test the special case where b=0
+// ====================================
+A=[100,1;1,10.];
+b=[0;0];
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0;0];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+// 10. A is a sparse matrix
+// =========================
+A = sparse([10 1;1 10]);
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+// 11. A is a complex full matrix
+// =========================
+A = [10 1;1 10] + %i * [1 10;10 1];
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0454545-0.0454545*%i;0.0454545-0.0454545*%i];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+// 12. A is a complex sparse matrix
+// =========================
+A = sparse([10 1;1 10] + %i * [1 10;10 1]);
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0454545-0.0454545*%i;0.0454545-0.0454545*%i];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+// 13. b is a complex column vector
+// =========================
+A = [10 1;1 10];
+b = %i * ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=%i .* [0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+// 14. b is a complex sparse column vector
+// =========================
+A = [10 1;1 10];
+b = sparse(%i * ones(2,1));
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=%i .* [0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+// 15. x0 is complex column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=%i.*[0.5;0.5];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 16. x0 is sparse column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=sparse([0.5;0.5]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 17. x0 is complex sparse column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=sparse(%i .* [0.5;0.5]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 18. M1 is complex matrix
+// ========================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=%i .* [1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 19. M1 is sparse matrix
+// =======================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=sparse([1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 20. M1 is complex sparse matrix
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=sparse(%i .* [1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 21. M2 is complex matrix
+// ========================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=%i .* [1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 22. M2 is sparse matrix
+// =======================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=sparse([1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 23. M2 is complex sparse matrix
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=sparse(%i .* [1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// --------------------
+// If A is a function
+// -------------------
+// 1. Interface
+// =============
+function y = func_A(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+assert_checkfalse(execstr("qmr(func_A)","errcatch") == 0);
+lasterror(execstr("10000","errcatch") == 0);
+// 2. Test with 2 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+assert_checkfalse(execstr("qmr(funcA_notransp, b)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function %s expected.\n"), "qmr", 2, "A");
+assert_checkerror("qmr(funcA_notransp, b)", refMsg);
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+// 3. Test with 3 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0=[0.01;0.05];
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 4. Test with 4 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.5];
+M1=[1,0;0,1];
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 5 Test with 5 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.5];
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 6 Test with 6 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.05];
+M1=[1,0;0,1];
+M2 = eye(2,2);
+maxit = 10;
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2,maxit);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// 7 Test with 7 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+tol = 100*%eps;
+maxit = 10;
+M1=[1,0;0,1];
+M2 = eye(2,2);
+x0=[0.01;0.05];
+xexpected=[1;1];
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test : A is a matrix, M1 is a function, M2 is a matrix (default)
+// ===============================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+xexpected=[1;1];
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+assert_checkfalse(execstr("qmr(A, b, x0, functionM1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong prototype of input argument #%d: If M1 is function, use the header M1(x,t) instead M1(x).\n"), "qmr", 4);
+assert_checkerror("qmr(A, b, x0, functionM1)", refMsg);
+assert_checkfalse(execstr("qmr(A, b, x0, functionM1, 1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, functionM1, 1)", refMsg);
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test : A is a matrix, M1 is a function, M2 is a matrix
+// ======================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+M2 = eye(2,2);
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test : A is a matrix, M1 is a matrix, M2 is a function
+// ======================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+M1 = eye(2,2);
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+assert_checkfalse(execstr("qmr(A, b, x0, M1, functionM2)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong prototype of input argument #%d: If M2 is function, use the header M2(x,t) instead M2(x).\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, M1, functionM2)", refMsg);
+assert_checkfalse(execstr("qmr(A, b, x0, M2, functionM2, 1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, functionM2, 1)", refMsg);
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test : A is a matrix, M1 and M2 are functions
+// ==============================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+// Test : A, M1 and M2 are functions
+// ==================================
+b = [11;11];
+x0 = [0.01;0.05];
+maxit = 10;
+tol = 100*%eps;
+function y = funA(x,t)
+ A = [10 1;1 10];
+ if (t=="notransp") then
+ y = A*x;
+ elseif (t=="transp") then
+ y = A'*x;
+ end
+endfunction
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,funM1,funM2,maxit,tol);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionA(x)
+ A = [10 1;1 10];
+ y = A*x;
+endfunction
+function y = functionAt(x)
+ A = [10 1;1 10];
+ y = A'*x;
+endfunction
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+xexpected=[1;1];
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,funM1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,funM1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,funM1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,functionM1,functionM1t,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,functionM1,functionM1t,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
diff --git a/modules/sparse/tests/unit_tests/qmr.tst b/modules/sparse/tests/unit_tests/qmr.tst
new file mode 100755
index 000000000..4c3364dac
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/qmr.tst
@@ -0,0 +1,772 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 Scilab Enterprises Adeline CARNIS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+// unit tests for qmr() function
+// =============================================================================
+warning('off')
+
+// ----------------
+// If A is a matrix
+// ----------------
+
+// 1. Interface
+// ============
+assert_checkerror( "qmr()", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr(1)", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([1 2;3 4])", "%s: Wrong number of input arguments: At least %d expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([1 2;3 4;5 6],[1;1;1])", "%s: Wrong size for input argument #%d: Square matrix expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([1 2;3 4;5 6],[1 1 1])", "%s: Wrong size for input argument #%d: Square matrix expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([1 2;3 4],[1 1])", "%s: Wrong size for input argument #%d: Column vector expected.\n", 10000, "qmr", 2);
+assert_checkerror( "qmr([%t %t;%t %t],[1;1])", "%s: Wrong type for input argument #%d : A real or complex matrix or a sparse matrix or a function expected.\n", 10000, "qmr", 1);
+assert_checkerror( "qmr([],[])", "%s: Wrong size for input argument #%d: Column vector expected.\n", 10000, "qmr", 2);
+
+// 2. Test with 2 input arguments and all output arguments
+// =======================================================
+assert_checkfalse(execstr("qmr([10 1;1 10],""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", 2);
+assert_checkerror("qmr([10 1;1 10],""t"")", refMsg);
+
+A=[10,1;1,10];
+b=[11;11];
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+
+// 3. Test with 3 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+assert_checkfalse(execstr("qmr(A, b,""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse column vector expected.\n"), "qmr", 3);
+assert_checkerror("qmr(A, b,""t"")", refMsg);
+
+x0=[0.5;0.5];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 4. Test with 4 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+
+assert_checkfalse(execstr("qmr(A, b, x0, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", 4);
+assert_checkerror("qmr(A, b, x0, ""t"")", refMsg);
+
+M1=[1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed,xexpected,%eps);
+
+// 5.Test with 5 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real or complex, full or sparse, square matrix or a function expected.\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, M1, ""t"")", refMsg);
+
+M2=[1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 6.Test with 6 input arguments and all output arguments
+// ======================================================
+A=[10,1;1,10];
+b=[11;11];
+x0 = [0.5;0.5];
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, M2, ""t"")", refMsg);
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, %i)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, M2, %i)", refMsg);
+
+maxit = 10;
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2,maxit);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 7.Test with 7 input arguments and all output arguments
+// =======================================================
+A=[10,1;1,10];
+b=[11;11];
+tol = 100*%eps;
+maxit = 10;
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+x0=[0.5;0.5];
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, maxit, ""t"")" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: Scalar expected.\n"), "qmr", 7);
+assert_checkerror("qmr(A, b, x0, M1, M2, maxit, ""t"")", refMsg);
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, M2, maxit, %i)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A real scalar expected.\n"), "qmr", 7);
+assert_checkerror("qmr(A, b, x0, M1, M2, maxit, %i)", refMsg);
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,M2,maxit,tol);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 8. Test with non-positionnal input parameters so that good initialization generates 0 iterations
+// =================================================================================================
+A=[100,1;1,10.];
+b=[101;11];
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0=[0.5;0.5]);
+assert_checkequal ( iter , 2 );
+
+// 9. Test the special case where b=0
+// ====================================
+A=[100,1;1,10.];
+b=[0;0];
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0;0];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0 );
+assert_checktrue ( err <= %eps );
+assert_checkequal ( iter , 0 );
+
+// 10. A is a sparse matrix
+// =========================
+A = sparse([10 1;1 10]);
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+
+// 11. A is a complex full matrix
+// =========================
+A = [10 1;1 10] + %i * [1 10;10 1];
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0454545-0.0454545*%i;0.0454545-0.0454545*%i];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+
+// 12. A is a complex sparse matrix
+// =========================
+A = sparse([10 1;1 10] + %i * [1 10;10 1]);
+b = ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=[0.0454545-0.0454545*%i;0.0454545-0.0454545*%i];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+
+// 13. b is a complex column vector
+// =========================
+A = [10 1;1 10];
+b = %i * ones(2,1);
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=%i .* [0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+
+// 14. b is a complex sparse column vector
+// =========================
+A = [10 1;1 10];
+b = sparse(%i * ones(2,1));
+[xcomputed, flag, err, iter, res]=qmr(A,b);
+xexpected=%i .* [0.0909091;0.0909091];
+assert_checkalmostequal ( xcomputed , xexpected , 1e-1);
+assert_checkequal ( flag , 0);
+assert_checkalmostequal ( err , 1.110d-16, 1e-1);
+assert_checkequal ( iter, 1);
+
+// 15. x0 is complex column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=%i.*[0.5;0.5];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 16. x0 is sparse column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=sparse([0.5;0.5]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 17. x0 is complex sparse column vector
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=sparse(%i .* [0.5;0.5]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 18. M1 is complex matrix
+// ========================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=%i .* [1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 19. M1 is sparse matrix
+// =======================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=sparse([1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 20. M1 is complex sparse matrix
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=sparse(%i .* [1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 21. M2 is complex matrix
+// ========================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=%i .* [1,0;0,1];
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 22. M2 is sparse matrix
+// =======================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=sparse([1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 23. M2 is complex sparse matrix
+// ===============================
+A=[10,1;1,10];
+b=[11;11];
+x0=[0.5;0.5];
+M1=[1,0;0,1];
+M2=sparse(%i .* [1,0;0,1]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, x0, M1, M2);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+
+// --------------------
+// If A is a function
+// -------------------
+
+// 1. Interface
+// =============
+function y = func_A(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+assert_checkfalse(execstr("qmr(func_A)","errcatch") == 0);
+lasterror(execstr("10000","errcatch") == 0);
+
+// 2. Test with 2 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+assert_checkfalse(execstr("qmr(funcA_notransp, b)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function %s expected.\n"), "qmr", 2, "A");
+assert_checkerror("qmr(funcA_notransp, b)", refMsg);
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+assert_checkequal ( flag , 0);
+assert_checkequal ( err , 0);
+assert_checkequal ( iter, 1);
+
+// 3. Test with 3 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0=[0.01;0.05];
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 4. Test with 4 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.5];
+M1=[1,0;0,1];
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 5 Test with 5 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.5];
+M1=[1,0;0,1];
+M2=[1,0;0,1];
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 6 Test with 6 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+x0 = [0.01;0.05];
+M1=[1,0;0,1];
+M2 = eye(2,2);
+maxit = 10;
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2,maxit);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// 7 Test with 7 input arguments and all output arguments
+// =======================================================
+b = [11;11];
+tol = 100*%eps;
+maxit = 10;
+M1=[1,0;0,1];
+M2 = eye(2,2);
+x0=[0.01;0.05];
+xexpected=[1;1];
+
+function y = func_qmr(x,t)
+ Amat = [10,1;1,10];
+ if (t == 'notransp') then
+ y = Amat*x;
+ elseif (t == 'transp') then
+ y = Amat'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = funcA_notransp(x)
+ Amat = [10,1;1,10];
+ y = Amat*x;
+endfunction
+
+function y = funcA_transp(x)
+ Amat = [10,1;1,10];
+ y = Amat'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funcA_notransp,funcA_transp,b,x0,M1,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// Test : A is a matrix, M1 is a function, M2 is a matrix (default)
+// ===============================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+xexpected=[1;1];
+
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+
+assert_checkfalse(execstr("qmr(A, b, x0, functionM1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong prototype of input argument #%d: If M1 is function, use the header M1(x,t) instead M1(x).\n"), "qmr", 4);
+assert_checkerror("qmr(A, b, x0, functionM1)", refMsg);
+
+assert_checkfalse(execstr("qmr(A, b, x0, functionM1, 1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, functionM1, 1)", refMsg);
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// Test : A is a matrix, M1 is a function, M2 is a matrix
+// ======================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+M2 = eye(2,2);
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1,M2,maxit,tol);
+
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t,M2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// Test : A is a matrix, M1 is a matrix, M2 is a function
+// ======================================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+M1 = eye(2,2);
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+
+assert_checkfalse(execstr("qmr(A, b, x0, M1, functionM2)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong prototype of input argument #%d: If M2 is function, use the header M2(x,t) instead M2(x).\n"), "qmr", 5);
+assert_checkerror("qmr(A, b, x0, M1, functionM2)", refMsg);
+
+assert_checkfalse(execstr("qmr(A, b, x0, M2, functionM2, 1)" ,"errcatch") == 0);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: A transpose of the function expected.\n"), "qmr", 6);
+assert_checkerror("qmr(A, b, x0, M1, functionM2, 1)", refMsg);
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,M1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// Test : A is a matrix, M1 and M2 are functions
+// ==============================================
+A = [10 1;1 10];
+b = [11;11];
+x0 = [0.01;0.05];
+maxit = 10;
+tol = 100*%eps;
+xexpected=[1;1];
+
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,funM1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(A,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+// Test : A, M1 and M2 are functions
+// ==================================
+b = [11;11];
+x0 = [0.01;0.05];
+maxit = 10;
+tol = 100*%eps;
+
+function y = funA(x,t)
+ A = [10 1;1 10];
+ if (t=="notransp") then
+ y = A*x;
+ elseif (t=="transp") then
+ y = A'*x;
+ end
+endfunction
+
+function y = funM1(x,t)
+ M1 = eye(2,2);
+ if (t=="notransp") then
+ y = M1*x;
+ elseif (t=="transp") then
+ y = M1'*x;
+ end
+endfunction
+
+function y = funM2(x,t)
+ M2 = eye(2,2);
+ if (t=="notransp") then
+ y = M2*x;
+ elseif (t=="transp") then
+ y = M2'*x;
+ end
+endfunction
+
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,funM1,funM2,maxit,tol);
+xexpected=[1;1];
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+function y = functionA(x)
+ A = [10 1;1 10];
+ y = A*x;
+endfunction
+
+function y = functionAt(x)
+ A = [10 1;1 10];
+ y = A'*x;
+endfunction
+
+function y = functionM1(x)
+ M1 = eye(2,2);
+ y = M1*x;
+endfunction
+
+function y = functionM1t(x)
+ M1 = eye(2,2);
+ y = M1'*x;
+endfunction
+
+function y = functionM2(x)
+ M2 = eye(2,2);
+ y = M2*x;
+endfunction
+
+function y = functionM2t(x)
+ M2 = eye(2,2);
+ y = M2'*x;
+endfunction
+
+xexpected=[1;1];
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,functionM1,functionM1t,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,funM1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,funM1,functionM2,functionM2t,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,funM1,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(functionA,functionAt,b,x0,functionM1,functionM1t,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
+
+[xcomputed, flag, err, iter, res]=qmr(funA,b,x0,functionM1,functionM1t,funM2,maxit,tol);
+assert_checkalmostequal ( xcomputed , xexpected , %eps);
diff --git a/modules/sparse/tests/unit_tests/sp2adj.dia.ref b/modules/sparse/tests/unit_tests/sp2adj.dia.ref
new file mode 100755
index 000000000..c0c2ec7af
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sp2adj.dia.ref
@@ -0,0 +1,65 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+//
+// Check the adjacency representation of a simple matrix
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+B=sparse(A);
+mn=size(B);
+[xadj,iadj,v]=sp2adj(B);
+m = max(iadj);
+n = size(xadj,"*")-1;
+assert_checkequal ( mn(1) , m );
+assert_checkequal ( mn(2) , n );
+expected_xadj = [1 3 4 7 9 11]';
+expected_iadj = [3 5 3 1 2 4 3 5 1 4]';
+expected_v = [1 2 3 4 5 6 7 8 9 10]';
+assert_checkequal ( and(expected_xadj == xadj) , %t );
+assert_checkequal ( and(expected_iadj == iadj) , %t );
+assert_checkequal ( and(expected_v == v) , %t );
+// j is the column index
+for j = 1 : size(xadj,"*")-1
+ irows = iadj(xadj(j):xadj(j+1)-1);
+ vcolj = v(xadj(j):xadj(j+1)-1);
+end
+//
+// Check the adjacency representation of a simple matrix
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+mn=size(B);
+[xadj,iadj,v]=sp2adj(B);
+m = max(iadj);
+n = size(xadj,"*")-1;
+assert_checkequal ( mn(1) , m );
+assert_checkequal ( mn(2) , n );
+expected_xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+expected_iadj = [2 5 2 3 1 2 7 6]';
+expected_v = [3 7 5 3 6 5 2 3]';
+assert_checkequal ( and(expected_xadj == xadj) , %t );
+assert_checkequal ( and(expected_iadj == iadj) , %t );
+assert_checkequal ( and(expected_v == v) , %t );
+//
+// Check that sp2adj matches adj2sp
+A = sprand(100,50,.05);
+[xadj,iadj,v]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,iadj,v,[n,m]);
+assert_checkequal ( and(A-p==0) , %t );
diff --git a/modules/sparse/tests/unit_tests/sp2adj.tst b/modules/sparse/tests/unit_tests/sp2adj.tst
new file mode 100755
index 000000000..8d641ceac
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sp2adj.tst
@@ -0,0 +1,67 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+//
+// Check the adjacency representation of a simple matrix
+A = [
+0 0 4 0 9
+0 0 5 0 0
+1 3 0 7 0
+0 0 6 0 10
+2 0 0 8 0
+];
+B=sparse(A);
+mn=size(B);
+[xadj,iadj,v]=sp2adj(B);
+m = max(iadj);
+n = size(xadj,"*")-1;
+assert_checkequal ( mn(1) , m );
+assert_checkequal ( mn(2) , n );
+expected_xadj = [1 3 4 7 9 11]';
+expected_iadj = [3 5 3 1 2 4 3 5 1 4]';
+expected_v = [1 2 3 4 5 6 7 8 9 10]';
+assert_checkequal ( and(expected_xadj == xadj) , %t );
+assert_checkequal ( and(expected_iadj == iadj) , %t );
+assert_checkequal ( and(expected_v == v) , %t );
+// j is the column index
+for j = 1 : size(xadj,"*")-1
+ irows = iadj(xadj(j):xadj(j+1)-1);
+ vcolj = v(xadj(j):xadj(j+1)-1);
+end
+//
+// Check the adjacency representation of a simple matrix
+A = [
+0 0 0 0 0 6 0 0 0 0
+3 0 5 0 0 0 0 5 0 0
+0 0 0 3 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 7 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 3
+0 0 0 0 0 0 0 0 2 0
+];
+B=sparse(A);
+mn=size(B);
+[xadj,iadj,v]=sp2adj(B);
+m = max(iadj);
+n = size(xadj,"*")-1;
+assert_checkequal ( mn(1) , m );
+assert_checkequal ( mn(2) , n );
+expected_xadj = [1 2 3 4 5 5 6 6 7 8 9]';
+expected_iadj = [2 5 2 3 1 2 7 6]';
+expected_v = [3 7 5 3 6 5 2 3]';
+assert_checkequal ( and(expected_xadj == xadj) , %t );
+assert_checkequal ( and(expected_iadj == iadj) , %t );
+assert_checkequal ( and(expected_v == v) , %t );
+//
+// Check that sp2adj matches adj2sp
+A = sprand(100,50,.05);
+[xadj,iadj,v]= sp2adj(A);
+[n,m]=size(A);
+p = adj2sp(xadj,iadj,v,[n,m]);
+assert_checkequal ( and(A-p==0) , %t );
+
diff --git a/modules/sparse/tests/unit_tests/sparse-insert.dia.ref b/modules/sparse/tests/unit_tests/sparse-insert.dia.ref
new file mode 100755
index 000000000..1dda488f3
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparse-insert.dia.ref
@@ -0,0 +1,22 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - S/E - Antoine Elias
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+a1=a;
+a1(1,:)=vt;
+assert_checkequal(vt, a1(1,:));
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+a1=a;
+b=-[1 2 3;4 5 6;7 8 9];
+a1(1:3,1:3)=b;
+assert_checkequal(a1(1:3,1:3), sparse(b));
+a = sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],[%t,%t,%t,%t,%t,%t,%t,%t,%t],[6 6]);
+vt = sparse([1 2;1 3;1 4;1 6],[%f,%f;%f,%f],[1,6]);
+a1=a;
+a1(1,:)=vt;
+assert_checkequal(a1(1,:), vt);
diff --git a/modules/sparse/tests/unit_tests/sparse-insert.tst b/modules/sparse/tests/unit_tests/sparse-insert.tst
new file mode 100755
index 000000000..d0c9e79e1
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparse-insert.tst
@@ -0,0 +1,27 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - S/E - Antoine Elias
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+a1=a;
+a1(1,:)=vt;
+assert_checkequal(vt, a1(1,:));
+
+
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+a1=a;
+b=-[1 2 3;4 5 6;7 8 9];
+a1(1:3,1:3)=b;
+assert_checkequal(a1(1:3,1:3), sparse(b));
+
+a = sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],[%t,%t,%t,%t,%t,%t,%t,%t,%t],[6 6]);
+vt = sparse([1 2;1 3;1 4;1 6],[%f,%f;%f,%f],[1,6]);
+a1=a;
+a1(1,:)=vt;
+assert_checkequal(a1(1,:), vt);
diff --git a/modules/sparse/tests/unit_tests/sparse.dia.ref b/modules/sparse/tests/unit_tests/sparse.dia.ref
new file mode 100755
index 000000000..525798652
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparse.dia.ref
@@ -0,0 +1,779 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+mode(5)
+lines(0)
+ij=[1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6];
+v=[1;2;3;4;5;6;7;8;9];
+ij1=[1 6;1 2;6 5];
+v1=[-1;-1;-1];
+vc=v+%i*(21:29)';
+v1c=v1+%i*[0;0.3;-1.2];
+zer=sparse([],[],[6,6]);
+//
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[-1;-1;-1],[6 6]);
+ma=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9),[6 6]);
+mb=sparse([1 6;1 2;6 5],-[-1;-1;-1],[6 6]);
+ac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+bc=sparse([1 6;1 2;6 5],[-1;-1;-1]+%i*[0;0.3;-1.2],[6 6]);
+mac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9)-%i*(21:29),[6 6]);
+mbc=sparse([1 6;1 2;6 5],[1;1;1]+%i*[0;-0.3;1.2],[6 6]);
+//
+if %t then
+//-------------------------------------------------------------
+//test des primitives sparse, full
+//--------------------------------------------------------------
+// -- for real matrix
+if or(full(sparse(0.3))<>0.3) then bugmes();quit;end
+v=0*ones(1,3);v(3)=5;v(1)=1;
+if or(full(sparse([1 1;1 3],[1 5]))<>v) then bugmes();quit;end
+v=0*ones(1,300);v(300)=5;v(1)=1;
+if or(full(sparse([1 1;1 300],[1 5]))<>v) then bugmes();quit;end
+v=0*ones(3,1);v(3)=5;v(1)=1;
+if or(full(sparse([1 1;3 1],[1 5]))<>v) then bugmes();quit;end
+v=0*ones(300,1);v(300)=5;v(1)=1;
+if or(full(sparse([1 1;300 1],[1 5]))<>v) then bugmes();quit;end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+a=[0,0,3,0,2,1;;5,0,0,4,0,0;0,0,0,0,0,0;0,0,7,6,0,0;8,0,0,0,0,0;0,0,0,0,0,9];
+if or(full(sp)<>a) then bugmes();quit;end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[8 6]);a(8,6)=0;
+if or(full(sp)<>a) then bugmes();quit;end
+if or(full(sparse([],[],[4 10]))<>0*ones(4,10)) then bugmes();quit;end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+a=[0;10;11;12;0;13];
+if or(full(v)<>a) then bugmes();quit;end
+v=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+a=[0,10,11,12,0,13];
+if or(full(v)<>a) then bugmes();quit;end
+// -- for complex matrix
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+a=[0,0,3+%i*23,0,2+%i*22,1+%i*21
+ 5+%i*25,0,0,4+%i*24,0,0
+ 0,0,0,0,0,0
+ 0,0,7+%i*27,6+%i*26,0,0
+ 8+%i*28,0,0,0,0,0
+ 0,0,0,0,0,9+%i*29];
+if or(full(sp)<>a) then bugmes();quit;end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[8 6]);
+a(8,6)=0;
+if or(full(sp)<>a) then bugmes();quit;end
+v=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+a=[0;10-%i*3;11;12+%i*5;0;13+%i*0.5];
+if or(full(v)<>a) then bugmes();quit;end
+v=sparse([1 2;1 3;1 4;1 6],[10-3*%i;11;12+5*%i;13+0.5*%i],[1,6]);
+a=[0,10-%i*3,11,12+%i*5,0,13+%i*0.5];
+if or(full(v)<>a) then bugmes();quit;end
+//-------------------------------------------------------------
+//test de la primitives spget
+//--------------------------------------------------------------
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+[ij,v]=spget(sp);
+if or(ij<>[1,3;1,5;1,6;2,1;2,4;4,3;4,4;5,1;6,6])|or(v<>[3;2;1;5;4;7;6;8;9]) then bugmes();quit;end
+zer=sparse([],[],[6,6]);[ij,v]=spget(zer);
+if ij<>[]|v<>[] then bugmes();quit;end
+//-----------------------------------------------
+// addition and subtraction tests
+//-----------------------------------------------
+// -- real real
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[-1;-1;-1],[6 6]);
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+ma=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9),[6 6]);
+mb=sparse([1 6;1 2;6 5],-[-1;-1;-1],[6 6]);
+zer=sparse([],[],[6,6]);
+ac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+bc=sparse([1 6;1 2;6 5],[-1;-1;-1]+%i*[0;0.3;-1.2],[6 6]);
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+vct=sparse([1 2;1 3;1 4;1 6],[10-3*%i;11;12+5*%i;13+0.5*%i],[1,6]);
+mac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9)-%i*(21:29),[6 6]);
+mbc=sparse([1 6;1 2;6 5],[1;1;1]+%i*[0;-0.3;1.2],[6 6]);
+if or(full(v+sparse([],[],[6,1]))<>full(v)) then bugmes();quit;end
+if or(full(sparse([],[],[6,1])+v)<>full(v)) then bugmes();quit;end
+if or(full(v+v)<>full(v)+full(v)) then bugmes();quit;end
+if or(full(v-v)<>full(v)-full(v)) then bugmes();quit;end
+if or(full(vt+sparse([],[],[1,6]))<>full(vt)) then bugmes();quit;end
+if or(full(vt+vt)<>full(vt)+full(vt)) then bugmes();quit;end
+if or(full(vt-vt)<>full(vt)-full(vt)) then bugmes();quit;end
+if or(full(zer+zer)<>0*ones(6,6)) then bugmes();quit;end
+if or(full(a+a)<>full(a)+full(a)) then bugmes();quit;end
+if or(full(b+b)<>full(b)+full(b)) then bugmes();quit;end
+if or(full(a+zer)<>full(a)) then bugmes();quit;end
+if or(full(zer+a)<>full(a)) then bugmes();quit;end
+if or(full(b+a)<>full(b)+full(a)) then bugmes();quit;end
+if or(full(a+b)<>full(b)+full(a)) then bugmes();quit;end
+if or(full(a+ma)<>full(a)+full(ma)) then bugmes();quit;end
+if or(full(a-a)<>full(a)-full(a)) then bugmes();quit;end
+if or(full(a-ma)<>full(a)-full(ma)) then bugmes();quit;end
+if or(full(b-mb)<>full(b)-full(mb)) then bugmes();quit;end
+if or(full(a-zer)<>full(a)) then bugmes();quit;end
+if or(full(zer-a)<>-full(a)) then bugmes();quit;end
+if or(full(a-mb)<>full(a)-full(mb)) then bugmes();quit;end
+// -- real complex
+if or(full(sparse([],[],[6,1])+vc)<>full(vc)) then bugmes();quit;end
+if or(full(v+vc)<>full(v)+full(vc)) then bugmes();quit;end
+if or(full(v-vc)<>full(v)-full(vc)) then bugmes();quit;end
+if or(full(vt+vct)<>full(vt)+full(vct)) then bugmes();quit;end
+if or(full(vt-vct)<>full(vt)-full(vct)) then bugmes();quit;end
+if or(full(a+ac)<>full(a)+full(ac)) then bugmes();quit;end
+if or(full(b+bc)<>full(b)+full(bc)) then bugmes();quit;end
+if or(full(a+bc)<>full(a)+full(bc)) then bugmes();quit;end
+if or(full(zer+ac)<>full(zer)+full(ac)) then bugmes();quit;end
+if or(full(b+ac)<>full(b)+full(ac)) then bugmes();quit;end
+if or(full(a-ac)<>full(a)-full(ac)) then bugmes();quit;end
+if or(full(b-bc)<>full(b)-full(bc)) then bugmes();quit;end
+if or(full(a-bc)<>full(a)-full(bc)) then bugmes();quit;end
+if or(full(zer-ac)<>full(zer)-full(ac)) then bugmes();quit;end
+if or(full(b-ac)<>full(b)-full(ac)) then bugmes();quit;end
+// -- complex real
+if or(full(vc+v)<>full(vc)+full(v)) then bugmes();quit;end
+if or(full(vc-v)<>full(vc)-full(v)) then bugmes();quit;end
+if or(full(vct+vt)<>full(vct)+full(vt)) then bugmes();quit;end
+if or(full(vct-vt)<>full(vct)-full(vt)) then bugmes();quit;end
+if or(full(ac+a)<>full(ac)+full(a)) then bugmes();quit;end
+if or(full(bc+b)<>full(bc)+full(b)) then bugmes();quit;end
+if or(full(ac+b)<>full(ac)+full(b)) then bugmes();quit;end
+if or(full(ac+zer)<>full(zer)+full(ac)) then bugmes();quit;end
+if or(full(bc+a)<>full(bc)+full(a)) then bugmes();quit;end
+if or(full(ac-a)<>full(ac)-full(a)) then bugmes();quit;end
+if or(full(bc-b)<>full(bc)-full(b)) then bugmes();quit;end
+if or(full(ac-b)<>full(ac)-full(b)) then bugmes();quit;end
+if or(full(ac-zer)<>-full(zer)+full(ac)) then bugmes();quit;end
+if or(full(bc-a)<>full(bc)-full(a)) then bugmes();quit;end
+// -- complex complex
+if or(full(vc+vc)<>full(vc)+full(vc)) then bugmes();quit;end
+if or(full(vc-vc)<>full(vc)-full(vc)) then bugmes();quit;end
+if or(full(vct+vct)<>full(vct)+full(vct)) then bugmes();quit;end
+if or(full(vct-vct)<>full(vct)-full(vct)) then bugmes();quit;end
+if or(full(ac+ac)<>full(ac)+full(ac)) then bugmes();quit;end
+if or(full(bc+bc)<>full(bc)+full(bc)) then bugmes();quit;end
+if or(full(ac+bc)<>full(ac)+full(bc)) then bugmes();quit;end
+if or(full(bc+ac)<>full(bc)+full(ac)) then bugmes();quit;end
+if or(full(ac-ac)<>full(zer)) then bugmes();quit;end
+if or(full(bc-bc)<>full(zer)) then bugmes();quit;end
+if or(full(ac-bc)<>full(ac)-full(bc)) then bugmes();quit;end
+if or(full(bc-ac)<>full(bc)-full(ac)) then bugmes();quit;end
+// sparse full and full sparse operation (soft coded apoerations)
+if or(full(a+1)<>full(a)+1) then bugmes();quit;end
+if or(full(1+a)<>full(a)+1) then bugmes();quit;end
+if or(full(a+ones(6,6))<>full(a)+ones(6,6)) then bugmes();quit;end
+if or(full(ones(6,6)+a)<>full(a)+ones(6,6)) then bugmes();quit;end
+if or(full(a+2*eye())<>full(a)+2*eye()) then bugmes();quit;end
+if or(full(2*eye()+a)<>full(a)+2*eye()) then bugmes();quit;end
+if or(full(a-1)<>full(a)-1) then bugmes();quit;end
+if or(full(1-a)<>1-full(a)) then bugmes();quit;end
+if or(full(a-ones(6,6))<>full(a)-ones(6,6)) then bugmes();quit;end
+if or(full(ones(6,6)-a)<>ones(6,6)-full(a)) then bugmes();quit;end
+if or(full(a-2*eye())<>full(a)-2*eye()) then bugmes();quit;end
+if or(full(2*eye()-a)<>2*eye()-full(a)) then bugmes();quit;end
+if or(full(ac+1)<>full(ac)+1) then bugmes();quit;end
+if or(full(1+ac)<>full(ac)+1) then bugmes();quit;end
+if or(full(ac+ones(6,6))<>full(ac)+ones(6,6)) then bugmes();quit;end
+if or(full(ones(6,6)+ac)<>full(ac)+ones(6,6)) then bugmes();quit;end
+if or(full(ac+2*eye())<>full(ac)+2*eye()) then bugmes();quit;end
+if or(full(2*eye()+ac)<>full(ac)+2*eye()) then bugmes();quit;end
+if or(full(ac-1)<>full(ac)-1) then bugmes();quit;end
+if or(full(1-ac)<>1-full(ac)) then bugmes();quit;end
+if or(full(ac-ones(6,6))<>full(ac)-ones(6,6)) then bugmes();quit;end
+if or(full(ones(6,6)-ac)<>ones(6,6)-full(ac)) then bugmes();quit;end
+if or(full(ac-2*eye())<>full(ac)-2*eye()) then bugmes();quit;end
+if or(full(2*eye()-ac)<>2*eye()-full(ac)) then bugmes();quit;end
+if or(full(ac+full(bc))<>full(ac)+full(bc)) then bugmes();quit;end
+if or(full(ac-full(bc))<>full(ac)-full(bc)) then bugmes();quit;end
+if or(full(full(ac)+full(bc))<>full(ac)+full(bc)) then bugmes();quit;end
+end
+if %t then
+//-----------------------------------------------
+// multiplication tests
+//-----------------------------------------------
+// real x real
+// sparse scalar , saclar sparse
+if or(full(a*2)<>full(a)*2) then bugmes();quit;end
+if or(full(2*a)<>full(a)*2) then bugmes();quit;end
+if a*[]<>[] then bugmes();quit;end
+if []*a<>[] then bugmes();quit;end
+c=rand(6,6);
+if norm(a*c-full(a)*c) >100*%eps then bugmes();quit;end
+if norm(c*a-c*full(a)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if or(full(zer*zer)<>full(zer)) then bugmes();quit;end
+if or(full(a*zer)<>full(zer)) then bugmes();quit;end
+if or(full(zer*a)<>full(zer)) then bugmes();quit;end
+if norm(full(a*a)-full(a)*full(a),1)>100*%eps then bugmes();quit;end
+if norm(full(b*b)-full(b)*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(a*b)-full(a)*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(b*a)-full(b)*full(a),1)>100*%eps then bugmes();quit;end
+// complex x real real x complex
+// sparse scalar , scalar sparse
+if or(full(ac*2)<>full(ac)*2) then bugmes();quit;end
+if or(full(2*ac)<>full(ac)*2) then bugmes();quit;end
+if norm(full((2+%i)*a)-(2+%i)*full(a),1) >100*%eps then bugmes();quit;end
+if norm(full(a*(2+%i))-(2+%i)*full(a),1) >100*%eps then bugmes();quit;end
+if ac*[]<>[] then bugmes();quit;end
+if []*ac<>[] then bugmes();quit;end
+c=rand(6,6);
+cc=c+rand(6,6)*%i;
+if norm(ac*c-full(ac)*c) >100*%eps then bugmes();quit;end
+if norm(cc*a-cc*full(a)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if or(full(ac*zer)<>full(zer)) then bugmes();quit;end
+if or(full(zer*ac)<>full(zer)) then bugmes();quit;end
+if norm(full(ac*a)-full(ac)*full(a),1)>100*%eps then bugmes();quit;end
+if norm(full(bc*b)-full(bc)*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(a*bc)-full(a)*full(bc),1)>100*%eps then bugmes();quit;end
+if norm(full(b*ac)-full(b)*full(ac),1)>100*%eps then bugmes();quit;end
+// // complex x complex
+if norm(ac*cc-full(ac)*cc) >100*%eps then bugmes();quit;end
+if norm(cc*ac-cc*full(ac)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if norm(full(ac*ac)-full(ac)*full(ac),1)>100*%eps then bugmes();quit;end
+if norm(full(bc*bc)-full(bc)*full(bc),1)>100*%eps then bugmes();quit;end
+if norm(full(bc*ac)-full(bc)*full(ac),1)>100*%eps then bugmes();quit;end
+//----------------------------------------------------------
+// element wise multiplication tests
+//----------------------------------------------------------
+if or(full(ac.*2)<>full(ac)*2) then bugmes();quit;end
+if or(full((2).*ac)<>full(ac)*2) then bugmes();quit;end
+if a.*[]<>[] then bugmes();quit;end
+if [].*a<>[] then bugmes();quit;end
+c=rand(6,6);
+//if norm(a*c-full(a)*c) >100*%eps then bugmes();quit;end
+//if norm(c*a-c*full(a)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if or(full(zer.*zer)<>full(zer)) then bugmes();quit;end
+if or(full(a.*zer)<>full(zer)) then bugmes();quit;end
+if or(full(zer.*a)<>full(zer)) then bugmes();quit;end
+if norm(full(a.*a)-full(a).*full(a),1)>100*%eps then bugmes();quit;end
+if norm(full(b.*b)-full(b).*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(a.*b)-full(a).*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(b.*a)-full(b).*full(a),1)>100*%eps then bugmes();quit;end
+// complex x real real x complex
+// sparse scalar , scalar sparse
+if norm(full((2+%i).*a)-(2+%i).*full(a),1) >100*%eps then bugmes();quit;end
+if norm(full(a.*(2+%i))-(2+%i).*full(a),1) >100*%eps then bugmes();quit;end
+if ac.*[]<>[] then bugmes();quit;end
+if [].*ac<>[] then bugmes();quit;end
+c=rand(6,6);
+cc=c+rand(6,6)*%i;
+if norm(full(ac.*c)-full(ac).*c) >100*%eps then bugmes();quit;end
+if norm(full(cc.*a)-cc.*full(a)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if or(full(ac.*zer)<>full(zer)) then bugmes();quit;end
+if or(full(zer.*ac)<>full(zer)) then bugmes();quit;end
+if norm(full(ac.*a)-full(ac).*full(a),1)>100*%eps then bugmes();quit;end
+if norm(full(bc.*b)-full(bc).*full(b),1)>100*%eps then bugmes();quit;end
+if norm(full(a.*bc)-full(a).*full(bc),1)>100*%eps then bugmes();quit;end
+if norm(full(b.*ac)-full(b).*full(ac),1)>100*%eps then bugmes();quit;end
+// // complex x complex
+if norm(ac.*cc-full(ac).*cc) >100*%eps then bugmes();quit;end
+if norm(cc.*ac-cc.*full(ac)) >100*%eps then bugmes();quit;end
+// sparse sparse
+if norm(full(ac.*ac)-full(ac).*full(ac),1)>100*%eps then bugmes();quit;end
+if norm(full(bc.*bc)-full(bc).*full(bc),1)>100*%eps then bugmes();quit;end
+if norm(full(bc.*ac)-full(bc).*full(ac),1)>100*%eps then bugmes();quit;end
+// ----------------------------------------------------------
+// test de la transposition
+//-----------------------------------------------------------
+if or(full(a')<>full(a)') then bugmes();quit;end
+if or(full(ac')<>full(ac)') then bugmes();quit;end
+if or(full(zer')<>full(zer)' ) then bugmes();quit;end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+if or(full(v')<>full(v)') then bugmes();quit;end
+if or(full((v')')<>full(v)) then bugmes();quit;end
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+if or(full(vc')<>full(vc)') then bugmes();quit;end
+if or(full((vc')')<>full(vc)) then bugmes();quit;end
+// ----------------------------------------------------------
+// test des concatenation
+//-----------------------------------------------------------
+if or(full([a])<>full(a)) then bugmes();quit;end
+if or(full([a b])<>[full(a) full(b)]) then bugmes();quit;end
+if or(full([a;b])<>[full(a);full(b)]) then bugmes();quit;end
+if or(full([a []])<>full(a)) then bugmes();quit;end
+if or(full([a;[]])<>full(a)) then bugmes();quit;end
+if or(full([a zer])<>[full(a) full(zer)]) then bugmes();quit;end
+if or(full([zer;b])<>[full(zer);full(b)]) then bugmes();quit;end
+if or(full([ac])<>full(ac)) then bugmes();quit;end
+if or(full([ac b])<>[full(ac) full(b)]) then bugmes();quit;end
+if or(full([ac;b])<>[full(ac);full(b)]) then bugmes();quit;end
+if or(full([ac []])<>full(ac)) then bugmes();quit;end
+if or(full([ac;[]])<>full(ac)) then bugmes();quit;end
+if or(full([a bc])<>[full(a) full(bc)]) then bugmes();quit;end
+if or(full([a;bc])<>[full(a);full(bc)]) then bugmes();quit;end
+if or(full([ac bc])<>[full(ac) full(bc)]) then bugmes();quit;end
+if or(full([ac;bc])<>[full(ac);full(bc)]) then bugmes();quit;end
+// ----------------------------------------------------------
+// test des extractions
+//-----------------------------------------------------------
+af=full(a);
+if or(full(a(1,3))<>af(1,3)) then bugmes();quit;end
+if or(full(a(1,4))<>af(1,4)) then bugmes();quit;end
+if or(full(a(1,:))<>af(1,:)) then bugmes();quit;end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);vf=full(v);
+if or(full(v(:))<>vf(:)) then bugmes();quit;end
+if or(full(v(3:4))<>vf(3:4)) then bugmes();quit;end
+if or(full(v([1 5]))<>vf([1 5])) then bugmes();quit;end
+if or(full(v([4 3]))<>vf([4 3])) then bugmes();quit;end
+if or(full(v([4 4]))<>vf([4 4])) then bugmes();quit;end
+if or(full(v([1 1]))<>vf([1 1])) then bugmes();quit;end
+v=v';vf=vf';
+if or(full(v(:))<>vf(:)) then bugmes();quit;end
+if or(full(v(3:4))<>vf(3:4)) then bugmes();quit;end
+if or(full(v([1 5]))<>vf([1 5])) then bugmes();quit;end
+if or(full(v([4 3]))<>vf([4 3])) then bugmes();quit;end
+if or(full(v([4 4]))<>vf([4 4])) then bugmes();quit;end
+if or(full(v([1 1]))<>vf([1 1])) then bugmes();quit;end
+acff=full(ac);
+if or(full(ac(1,3))<>acff(1,3)) then bugmes();quit;end
+if or(full(ac(1,4))<>acff(1,4)) then bugmes();quit;end
+if or(full(ac(1,:))<>acff(1,:)) then bugmes();quit;end
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);vcf=full(vc);
+if or(full(vc(:))<>vcf(:)) then bugmes();quit;end
+if or(full(vc(3:4))<>vcf(3:4)) then bugmes();quit;end
+if or(full(vc([1 5]))<>vcf([1 5])) then bugmes();quit;end
+if or(full(vc([4 3]))<>vcf([4 3])) then bugmes();quit;end
+if or(full(vc([4 4]))<>vcf([4 4])) then bugmes();quit;end
+if or(full(vc([1 1]))<>vcf([1 1])) then bugmes();quit;end
+vc=vc';vcf=vcf';
+if or(full(vc(:))<>vcf(:)) then bugmes();quit;end
+if or(full(vc(3:4))<>vcf(3:4)) then bugmes();quit;end
+if or(full(vc([1 5]))<>vcf([1 5])) then bugmes();quit;end
+if or(full(vc([4 3]))<>vcf([4 3])) then bugmes();quit;end
+if or(full(vc([4 4]))<>vcf([4 4])) then bugmes();quit;end
+if or(full(vc([1 1]))<>vcf([1 1])) then bugmes();quit;end
+// ----------------------------------------------------------
+// test des insertions
+//-----------------------------------------------------------
+end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+// insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a=sparse([],[],[6,6]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then bugmes();quit;end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 2;1 3;3 3],-(1:3),[3,3]);
+a1=a;a1(1,1)=sparse(30);A=full(a);A(1,1)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,6)=sparse(30);A=full(a);A(1,6)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,8)=sparse(30);A=full(a);A(1,8)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=full(b);
+if or(full(a1)<>A) then bugmes();quit;end
+//sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=11:16;
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);A([1 3],:)=[vt;2*vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);A([3 1],:)=[vt;2*vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);A([1 3 1],:)=[vt;2*vt;3*vt];
+if or(full(a1)<>A) then bugmes();quit;end
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[1:6;11:16];
+a1=a;a1([1 3],:)=b;A=full(a);A([1 3],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 1],:)=b;A=full(a);A([3 1],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[1:6;11:16;21:26];
+a1=a;a1([1 3 1],:)=b;A=full(a);A([1 3 1],:)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=(1:6)';
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,3)=v;A=full(a);A(:,3)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+//
+a1=a;a1(:,7)=v;A=full(a);A(:,7)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,8)=v;A=full(a);A(:,8)=v;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[(1:6)' (11:16)'];
+a1=a;a1(:,[1 3])=b;A=full(a);A(:,[1 3])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(:,[3 1])=b;A=full(a);A(:,[3 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+b=[(1:6)' (11:16)' (21:26)'];
+a1=a;a1(:,[1 3 1])=b;A=full(a);A(:,[1 3 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+//********
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=-[1 2 3;4 5 6;7 8 9];
+a1=a;a1(1,1)=30;A=full(a);A(1,1)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,6)=30;A=full(a);A(1,6)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1,8)=30;A=full(a);A(1,8)=30;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=b;
+if or(full(a1)<>A) then bugmes();quit;end
+// vector insertion
+v=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=[5;10;33];V=full(v);V([1 2 8])=[5;10;33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then bugmes();quit;end
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=sparse([5;10;33]);V=full(v);V([1 2 8])=[5;10;33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 1])=sparse([5;10;33]);V=full(v);V([1 2 1])=[5;10;33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then bugmes();quit;end
+v1=v;v1(:)=sparse([2 1],44,[6 1]);V=full(v);V(:)=[0;44;0;0;0;0];
+if or(full(v1)<>V) then bugmes();quit;end
+v=v';
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=[5 10 33];V=full(v);V([1 2 8])=[5 10 33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 8])=sparse([5 10 33]);V=full(v);V([1 2 8])=[5 10 33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1([1 2 1])=sparse([5 10 33]);V=full(v);V([1 2 1])=[5 10 33];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(:)=sparse([1 2],44,[1,6]);V=full(v);V(:)=[0 44 0 0 0 0];
+if or(full(v1)<>V) then bugmes();quit;end
+v1=v;v1(1)=[];V=full(v);V(1)=[];
+if or(full(v1)<>V) then bugmes();quit;end
+//test des comparaisons
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6]);
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>sparse(5))<>(full(a)>5) then bugmes();quit;end
+if full(sparse(5)>a)<>(5>full(a)) then bugmes();quit;end
+if full(b>a)<>(full(b)>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>5)<>(full(a)>5) then bugmes();quit;end
+if full(5>a)<>(5>full(a)) then bugmes();quit;end
+if full(b>full(a))<>(full(b)>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)>sparse(5))<>(full(a)>5) then bugmes();quit;end
+if full(full(b)>a)<>(full(b)>full(a)) then bugmes();quit;end
+a=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>sparse(5))<>(full(a)>5) then bugmes();quit;end
+if full(sparse(5)>a)<>(5>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>5)<>(full(a)>5) then bugmes();quit;end
+if full(5>a)<>(5>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)>sparse(5))<>(full(a)>5) then bugmes();quit;end
+a=a';
+if full(a==a)<>full(a)==full(a) then bugmes();quit;end
+if full(a<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>sparse(5))<>(full(a)>5) then bugmes();quit;end
+if full(sparse(5)>a)<>(5>full(a)) then bugmes();quit;end
+if full(a==full(a))<>full(a)==full(a) then bugmes();quit;end
+if full(a<>full(a))<>(full(a)<>full(a)) then bugmes();quit;end
+if full(a>5)<>(full(a)>5) then bugmes();quit;end
+if full(5>a)<>(5>full(a)) then bugmes();quit;end
+if full(full(a)==a)<>full(a)==full(a) then bugmes();quit;end
+if full(full(a)<>a)<>(full(a)<>full(a)) then bugmes();quit;end
+if full(full(a)>sparse(5))<>(full(a)>5) then bugmes();quit;end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;5 5],[10;-1;-1],[5 6]);
+if a==b<>%f then bugmes();quit;end
+if a<>b<>%t then bugmes();quit;end
+a=sparse([%f %t %f %t]);
+b=sparse([%t %f %t %f]);
+assert_checkequal(~a, b);
diff --git a/modules/sparse/tests/unit_tests/sparse.tst b/modules/sparse/tests/unit_tests/sparse.tst
new file mode 100755
index 000000000..ddd6f2911
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparse.tst
@@ -0,0 +1,782 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+mode(5)
+lines(0)
+ij=[1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6];
+v=[1;2;3;4;5;6;7;8;9];
+ij1=[1 6;1 2;6 5];
+v1=[-1;-1;-1];
+vc=v+%i*(21:29)';
+v1c=v1+%i*[0;0.3;-1.2];
+zer=sparse([],[],[6,6]);
+//
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[-1;-1;-1],[6 6]);
+ma=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9),[6 6]);
+mb=sparse([1 6;1 2;6 5],-[-1;-1;-1],[6 6]);
+ac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+bc=sparse([1 6;1 2;6 5],[-1;-1;-1]+%i*[0;0.3;-1.2],[6 6]);
+mac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9)-%i*(21:29),[6 6]);
+mbc=sparse([1 6;1 2;6 5],[1;1;1]+%i*[0;-0.3;1.2],[6 6]);
+//
+if %t then
+//-------------------------------------------------------------
+//test des primitives sparse, full
+//--------------------------------------------------------------
+// -- for real matrix
+if or(full(sparse(0.3))<>0.3) then pause,end
+v=0*ones(1,3);v(3)=5;v(1)=1;
+if or(full(sparse([1 1;1 3],[1 5]))<>v) then pause,end
+v=0*ones(1,300);v(300)=5;v(1)=1;
+if or(full(sparse([1 1;1 300],[1 5]))<>v) then pause,end
+v=0*ones(3,1);v(3)=5;v(1)=1;
+if or(full(sparse([1 1;3 1],[1 5]))<>v) then pause,end
+v=0*ones(300,1);v(300)=5;v(1)=1;
+if or(full(sparse([1 1;300 1],[1 5]))<>v) then pause,end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+a=[0,0,3,0,2,1;;5,0,0,4,0,0;0,0,0,0,0,0;0,0,7,6,0,0;8,0,0,0,0,0;0,0,0,0,0,9];
+if or(full(sp)<>a) then pause,end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[8 6]);a(8,6)=0;
+if or(full(sp)<>a) then pause,end
+if or(full(sparse([],[],[4 10]))<>0*ones(4,10)) then pause,end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+a=[0;10;11;12;0;13];
+if or(full(v)<>a) then pause,end
+v=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+a=[0,10,11,12,0,13];
+if or(full(v)<>a) then pause,end
+// -- for complex matrix
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+a=[0,0,3+%i*23,0,2+%i*22,1+%i*21
+ 5+%i*25,0,0,4+%i*24,0,0
+ 0,0,0,0,0,0
+ 0,0,7+%i*27,6+%i*26,0,0
+ 8+%i*28,0,0,0,0,0
+ 0,0,0,0,0,9+%i*29];
+if or(full(sp)<>a) then pause,end
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[8 6]);
+a(8,6)=0;
+if or(full(sp)<>a) then pause,end
+v=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+a=[0;10-%i*3;11;12+%i*5;0;13+%i*0.5];
+if or(full(v)<>a) then pause,end
+v=sparse([1 2;1 3;1 4;1 6],[10-3*%i;11;12+5*%i;13+0.5*%i],[1,6]);
+a=[0,10-%i*3,11,12+%i*5,0,13+%i*0.5];
+if or(full(v)<>a) then pause,end
+//-------------------------------------------------------------
+//test de la primitives spget
+//--------------------------------------------------------------
+sp=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+[ij,v]=spget(sp);
+if or(ij<>[1,3;1,5;1,6;2,1;2,4;4,3;4,4;5,1;6,6])|or(v<>[3;2;1;5;4;7;6;8;9]) then pause,end
+zer=sparse([],[],[6,6]);[ij,v]=spget(zer);
+if ij<>[]|v<>[] then pause,end
+//-----------------------------------------------
+// addition and subtraction tests
+//-----------------------------------------------
+// -- real real
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[-1;-1;-1],[6 6]);
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+ma=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9),[6 6]);
+mb=sparse([1 6;1 2;6 5],-[-1;-1;-1],[6 6]);
+zer=sparse([],[],[6,6]);
+ac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],(1:9)+%i*(21:29),[6 6]);
+bc=sparse([1 6;1 2;6 5],[-1;-1;-1]+%i*[0;0.3;-1.2],[6 6]);
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+vct=sparse([1 2;1 3;1 4;1 6],[10-3*%i;11;12+5*%i;13+0.5*%i],[1,6]);
+mac=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9)-%i*(21:29),[6 6]);
+mbc=sparse([1 6;1 2;6 5],[1;1;1]+%i*[0;-0.3;1.2],[6 6]);
+if or(full(v+sparse([],[],[6,1]))<>full(v)) then pause,end
+if or(full(sparse([],[],[6,1])+v)<>full(v)) then pause,end
+if or(full(v+v)<>full(v)+full(v)) then pause,end
+if or(full(v-v)<>full(v)-full(v)) then pause,end
+if or(full(vt+sparse([],[],[1,6]))<>full(vt)) then pause,end
+if or(full(vt+vt)<>full(vt)+full(vt)) then pause,end
+if or(full(vt-vt)<>full(vt)-full(vt)) then pause,end
+if or(full(zer+zer)<>0*ones(6,6)) then pause,end
+if or(full(a+a)<>full(a)+full(a)) then pause,end
+if or(full(b+b)<>full(b)+full(b)) then pause,end
+if or(full(a+zer)<>full(a)) then pause,end
+if or(full(zer+a)<>full(a)) then pause,end
+if or(full(b+a)<>full(b)+full(a)) then pause,end
+if or(full(a+b)<>full(b)+full(a)) then pause,end
+if or(full(a+ma)<>full(a)+full(ma)) then pause,end
+if or(full(a-a)<>full(a)-full(a)) then pause,end
+if or(full(a-ma)<>full(a)-full(ma)) then pause,end
+if or(full(b-mb)<>full(b)-full(mb)) then pause,end
+if or(full(a-zer)<>full(a)) then pause,end
+if or(full(zer-a)<>-full(a)) then pause,end
+if or(full(a-mb)<>full(a)-full(mb)) then pause,end
+// -- real complex
+if or(full(sparse([],[],[6,1])+vc)<>full(vc)) then pause,end
+if or(full(v+vc)<>full(v)+full(vc)) then pause,end
+if or(full(v-vc)<>full(v)-full(vc)) then pause,end
+if or(full(vt+vct)<>full(vt)+full(vct)) then pause,end
+if or(full(vt-vct)<>full(vt)-full(vct)) then pause,end
+if or(full(a+ac)<>full(a)+full(ac)) then pause,end
+if or(full(b+bc)<>full(b)+full(bc)) then pause,end
+if or(full(a+bc)<>full(a)+full(bc)) then pause,end
+if or(full(zer+ac)<>full(zer)+full(ac)) then pause,end
+if or(full(b+ac)<>full(b)+full(ac)) then pause,end
+if or(full(a-ac)<>full(a)-full(ac)) then pause,end
+if or(full(b-bc)<>full(b)-full(bc)) then pause,end
+if or(full(a-bc)<>full(a)-full(bc)) then pause,end
+if or(full(zer-ac)<>full(zer)-full(ac)) then pause,end
+if or(full(b-ac)<>full(b)-full(ac)) then pause,end
+// -- complex real
+if or(full(vc+v)<>full(vc)+full(v)) then pause,end
+if or(full(vc-v)<>full(vc)-full(v)) then pause,end
+if or(full(vct+vt)<>full(vct)+full(vt)) then pause,end
+if or(full(vct-vt)<>full(vct)-full(vt)) then pause,end
+if or(full(ac+a)<>full(ac)+full(a)) then pause,end
+if or(full(bc+b)<>full(bc)+full(b)) then pause,end
+if or(full(ac+b)<>full(ac)+full(b)) then pause,end
+if or(full(ac+zer)<>full(zer)+full(ac)) then pause,end
+if or(full(bc+a)<>full(bc)+full(a)) then pause,end
+if or(full(ac-a)<>full(ac)-full(a)) then pause,end
+if or(full(bc-b)<>full(bc)-full(b)) then pause,end
+if or(full(ac-b)<>full(ac)-full(b)) then pause,end
+if or(full(ac-zer)<>-full(zer)+full(ac)) then pause,end
+if or(full(bc-a)<>full(bc)-full(a)) then pause,end
+// -- complex complex
+if or(full(vc+vc)<>full(vc)+full(vc)) then pause,end
+if or(full(vc-vc)<>full(vc)-full(vc)) then pause,end
+if or(full(vct+vct)<>full(vct)+full(vct)) then pause,end
+if or(full(vct-vct)<>full(vct)-full(vct)) then pause,end
+if or(full(ac+ac)<>full(ac)+full(ac)) then pause,end
+if or(full(bc+bc)<>full(bc)+full(bc)) then pause,end
+if or(full(ac+bc)<>full(ac)+full(bc)) then pause,end
+if or(full(bc+ac)<>full(bc)+full(ac)) then pause,end
+if or(full(ac-ac)<>full(zer)) then pause,end
+if or(full(bc-bc)<>full(zer)) then pause,end
+if or(full(ac-bc)<>full(ac)-full(bc)) then pause,end
+if or(full(bc-ac)<>full(bc)-full(ac)) then pause,end
+// sparse full and full sparse operation (soft coded apoerations)
+if or(full(a+1)<>full(a)+1) then pause,end
+if or(full(1+a)<>full(a)+1) then pause,end
+if or(full(a+ones(6,6))<>full(a)+ones(6,6)) then pause,end
+if or(full(ones(6,6)+a)<>full(a)+ones(6,6)) then pause,end
+if or(full(a+2*eye())<>full(a)+2*eye()) then pause,end
+if or(full(2*eye()+a)<>full(a)+2*eye()) then pause,end
+if or(full(a-1)<>full(a)-1) then pause,end
+if or(full(1-a)<>1-full(a)) then pause,end
+if or(full(a-ones(6,6))<>full(a)-ones(6,6)) then pause,end
+if or(full(ones(6,6)-a)<>ones(6,6)-full(a)) then pause,end
+if or(full(a-2*eye())<>full(a)-2*eye()) then pause,end
+if or(full(2*eye()-a)<>2*eye()-full(a)) then pause,end
+if or(full(ac+1)<>full(ac)+1) then pause,end
+if or(full(1+ac)<>full(ac)+1) then pause,end
+if or(full(ac+ones(6,6))<>full(ac)+ones(6,6)) then pause,end
+if or(full(ones(6,6)+ac)<>full(ac)+ones(6,6)) then pause,end
+if or(full(ac+2*eye())<>full(ac)+2*eye()) then pause,end
+if or(full(2*eye()+ac)<>full(ac)+2*eye()) then pause,end
+if or(full(ac-1)<>full(ac)-1) then pause,end
+if or(full(1-ac)<>1-full(ac)) then pause,end
+if or(full(ac-ones(6,6))<>full(ac)-ones(6,6)) then pause,end
+if or(full(ones(6,6)-ac)<>ones(6,6)-full(ac)) then pause,end
+if or(full(ac-2*eye())<>full(ac)-2*eye()) then pause,end
+if or(full(2*eye()-ac)<>2*eye()-full(ac)) then pause,end
+if or(full(ac+full(bc))<>full(ac)+full(bc)) then pause,end
+if or(full(ac-full(bc))<>full(ac)-full(bc)) then pause,end
+if or(full(full(ac)+full(bc))<>full(ac)+full(bc)) then pause,end
+end
+if %t then
+//-----------------------------------------------
+// multiplication tests
+//-----------------------------------------------
+// real x real
+// sparse scalar , saclar sparse
+if or(full(a*2)<>full(a)*2) then pause,end
+if or(full(2*a)<>full(a)*2) then pause,end
+if a*[]<>[] then pause,end
+if []*a<>[] then pause,end
+c=rand(6,6);
+if norm(a*c-full(a)*c) >100*%eps then pause,end
+if norm(c*a-c*full(a)) >100*%eps then pause,end
+// sparse sparse
+if or(full(zer*zer)<>full(zer)) then pause,end
+if or(full(a*zer)<>full(zer)) then pause,end
+if or(full(zer*a)<>full(zer)) then pause,end
+if norm(full(a*a)-full(a)*full(a),1)>100*%eps then pause,end
+if norm(full(b*b)-full(b)*full(b),1)>100*%eps then pause,end
+if norm(full(a*b)-full(a)*full(b),1)>100*%eps then pause,end
+if norm(full(b*a)-full(b)*full(a),1)>100*%eps then pause,end
+// complex x real real x complex
+// sparse scalar , scalar sparse
+if or(full(ac*2)<>full(ac)*2) then pause,end
+if or(full(2*ac)<>full(ac)*2) then pause,end
+if norm(full((2+%i)*a)-(2+%i)*full(a),1) >100*%eps then pause,end
+if norm(full(a*(2+%i))-(2+%i)*full(a),1) >100*%eps then pause,end
+if ac*[]<>[] then pause,end
+if []*ac<>[] then pause,end
+c=rand(6,6);
+cc=c+rand(6,6)*%i;
+if norm(ac*c-full(ac)*c) >100*%eps then pause,end
+if norm(cc*a-cc*full(a)) >100*%eps then pause,end
+// sparse sparse
+if or(full(ac*zer)<>full(zer)) then pause,end
+if or(full(zer*ac)<>full(zer)) then pause,end
+if norm(full(ac*a)-full(ac)*full(a),1)>100*%eps then pause,end
+if norm(full(bc*b)-full(bc)*full(b),1)>100*%eps then pause,end
+if norm(full(a*bc)-full(a)*full(bc),1)>100*%eps then pause,end
+if norm(full(b*ac)-full(b)*full(ac),1)>100*%eps then pause,end
+// // complex x complex
+if norm(ac*cc-full(ac)*cc) >100*%eps then pause,end
+if norm(cc*ac-cc*full(ac)) >100*%eps then pause,end
+// sparse sparse
+if norm(full(ac*ac)-full(ac)*full(ac),1)>100*%eps then pause,end
+if norm(full(bc*bc)-full(bc)*full(bc),1)>100*%eps then pause,end
+if norm(full(bc*ac)-full(bc)*full(ac),1)>100*%eps then pause,end
+//----------------------------------------------------------
+// element wise multiplication tests
+//----------------------------------------------------------
+if or(full(ac.*2)<>full(ac)*2) then pause,end
+if or(full((2).*ac)<>full(ac)*2) then pause,end
+if a.*[]<>[] then pause,end
+if [].*a<>[] then pause,end
+c=rand(6,6);
+//if norm(a*c-full(a)*c) >100*%eps then pause,end
+//if norm(c*a-c*full(a)) >100*%eps then pause,end
+// sparse sparse
+if or(full(zer.*zer)<>full(zer)) then pause,end
+if or(full(a.*zer)<>full(zer)) then pause,end
+if or(full(zer.*a)<>full(zer)) then pause,end
+if norm(full(a.*a)-full(a).*full(a),1)>100*%eps then pause,end
+if norm(full(b.*b)-full(b).*full(b),1)>100*%eps then pause,end
+if norm(full(a.*b)-full(a).*full(b),1)>100*%eps then pause,end
+if norm(full(b.*a)-full(b).*full(a),1)>100*%eps then pause,end
+// complex x real real x complex
+// sparse scalar , scalar sparse
+if norm(full((2+%i).*a)-(2+%i).*full(a),1) >100*%eps then pause,end
+if norm(full(a.*(2+%i))-(2+%i).*full(a),1) >100*%eps then pause,end
+if ac.*[]<>[] then pause,end
+if [].*ac<>[] then pause,end
+c=rand(6,6);
+cc=c+rand(6,6)*%i;
+if norm(full(ac.*c)-full(ac).*c) >100*%eps then pause,end
+if norm(full(cc.*a)-cc.*full(a)) >100*%eps then pause,end
+// sparse sparse
+if or(full(ac.*zer)<>full(zer)) then pause,end
+if or(full(zer.*ac)<>full(zer)) then pause,end
+if norm(full(ac.*a)-full(ac).*full(a),1)>100*%eps then pause,end
+if norm(full(bc.*b)-full(bc).*full(b),1)>100*%eps then pause,end
+if norm(full(a.*bc)-full(a).*full(bc),1)>100*%eps then pause,end
+if norm(full(b.*ac)-full(b).*full(ac),1)>100*%eps then pause,end
+// // complex x complex
+if norm(ac.*cc-full(ac).*cc) >100*%eps then pause,end
+if norm(cc.*ac-cc.*full(ac)) >100*%eps then pause,end
+// sparse sparse
+if norm(full(ac.*ac)-full(ac).*full(ac),1)>100*%eps then pause,end
+if norm(full(bc.*bc)-full(bc).*full(bc),1)>100*%eps then pause,end
+if norm(full(bc.*ac)-full(bc).*full(ac),1)>100*%eps then pause,end
+// ----------------------------------------------------------
+// test de la transposition
+//-----------------------------------------------------------
+if or(full(a')<>full(a)') then pause,end
+if or(full(ac')<>full(ac)') then pause,end
+if or(full(zer')<>full(zer)' ) then pause,end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+if or(full(v')<>full(v)') then pause,end
+if or(full((v')')<>full(v)) then pause,end
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+if or(full(vc')<>full(vc)') then pause,end
+if or(full((vc')')<>full(vc)) then pause,end
+// ----------------------------------------------------------
+// test des concatenation
+//-----------------------------------------------------------
+if or(full([a])<>full(a)) then pause,end
+if or(full([a b])<>[full(a) full(b)]) then pause,end
+if or(full([a;b])<>[full(a);full(b)]) then pause,end
+if or(full([a []])<>full(a)) then pause,end
+if or(full([a;[]])<>full(a)) then pause,end
+if or(full([a zer])<>[full(a) full(zer)]) then pause,end
+if or(full([zer;b])<>[full(zer);full(b)]) then pause,end
+if or(full([ac])<>full(ac)) then pause,end
+if or(full([ac b])<>[full(ac) full(b)]) then pause,end
+if or(full([ac;b])<>[full(ac);full(b)]) then pause,end
+if or(full([ac []])<>full(ac)) then pause,end
+if or(full([ac;[]])<>full(ac)) then pause,end
+if or(full([a bc])<>[full(a) full(bc)]) then pause,end
+if or(full([a;bc])<>[full(a);full(bc)]) then pause,end
+if or(full([ac bc])<>[full(ac) full(bc)]) then pause,end
+if or(full([ac;bc])<>[full(ac);full(bc)]) then pause,end
+// ----------------------------------------------------------
+// test des extractions
+//-----------------------------------------------------------
+af=full(a);
+if or(full(a(1,3))<>af(1,3)) then pause,end
+if or(full(a(1,4))<>af(1,4)) then pause,end
+if or(full(a(1,:))<>af(1,:)) then pause,end
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);vf=full(v);
+if or(full(v(:))<>vf(:)) then pause,end
+if or(full(v(3:4))<>vf(3:4)) then pause,end
+if or(full(v([1 5]))<>vf([1 5])) then pause,end
+if or(full(v([4 3]))<>vf([4 3])) then pause,end
+if or(full(v([4 4]))<>vf([4 4])) then pause,end
+if or(full(v([1 1]))<>vf([1 1])) then pause,end
+v=v';vf=vf';
+if or(full(v(:))<>vf(:)) then pause,end
+if or(full(v(3:4))<>vf(3:4)) then pause,end
+if or(full(v([1 5]))<>vf([1 5])) then pause,end
+if or(full(v([4 3]))<>vf([4 3])) then pause,end
+if or(full(v([4 4]))<>vf([4 4])) then pause,end
+if or(full(v([1 1]))<>vf([1 1])) then pause,end
+acff=full(ac);
+if or(full(ac(1,3))<>acff(1,3)) then pause,end
+if or(full(ac(1,4))<>acff(1,4)) then pause,end
+if or(full(ac(1,:))<>acff(1,:)) then pause,end
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);vcf=full(vc);
+if or(full(vc(:))<>vcf(:)) then pause,end
+if or(full(vc(3:4))<>vcf(3:4)) then pause,end
+if or(full(vc([1 5]))<>vcf([1 5])) then pause,end
+if or(full(vc([4 3]))<>vcf([4 3])) then pause,end
+if or(full(vc([4 4]))<>vcf([4 4])) then pause,end
+if or(full(vc([1 1]))<>vcf([1 1])) then pause,end
+vc=vc';vcf=vcf';
+if or(full(vc(:))<>vcf(:)) then pause,end
+if or(full(vc(3:4))<>vcf(3:4)) then pause,end
+if or(full(vc([1 5]))<>vcf([1 5])) then pause,end
+if or(full(vc([4 3]))<>vcf([4 3])) then pause,end
+if or(full(vc([4 4]))<>vcf([4 4])) then pause,end
+if or(full(vc([1 1]))<>vcf([1 1])) then pause,end
+// ----------------------------------------------------------
+// test des insertions
+//-----------------------------------------------------------
+end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+if or(full(a1)<>A) then pause,end
+// insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+if or(full(a1)<>A) then pause,end
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+// insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+if or(full(a1)<>A) then pause,end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+a=sparse([],[],[6,6]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+if or(full(a1)<>A) then pause,end
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+if or(full(a1)<>A) then pause,end
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+if or(full(a1)<>A) then pause,end
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 2;1 3;3 3],-(1:3),[3,3]);
+a1=a;a1(1,1)=sparse(30);A=full(a);A(1,1)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,6)=sparse(30);A=full(a);A(1,6)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,8)=sparse(30);A=full(a);A(1,8)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=full(b);
+if or(full(a1)<>A) then pause,end
+//sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=11:16;
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);A([1 3],:)=[vt;2*vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);A([3 1],:)=[vt;2*vt];
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);A([1 3 1],:)=[vt;2*vt;3*vt];
+if or(full(a1)<>A) then pause,end
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+if or(full(a1)<>A) then pause,end
+b=[1:6;11:16];
+a1=a;a1([1 3],:)=b;A=full(a);A([1 3],:)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 1],:)=b;A=full(a);A([3 1],:)=b;
+if or(full(a1)<>A) then pause,end
+b=[1:6;11:16;21:26];
+a1=a;a1([1 3 1],:)=b;A=full(a);A([1 3 1],:)=b;
+if or(full(a1)<>A) then pause,end
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=(1:6)';
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,3)=v;A=full(a);A(:,3)=v;
+if or(full(a1)<>A) then pause,end
+//
+a1=a;a1(:,7)=v;A=full(a);A(:,7)=v;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,8)=v;A=full(a);A(:,8)=v;
+if or(full(a1)<>A) then pause,end
+b=[(1:6)' (11:16)'];
+a1=a;a1(:,[1 3])=b;A=full(a);A(:,[1 3])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(:,[3 1])=b;A=full(a);A(:,[3 1])=b;
+if or(full(a1)<>A) then pause,end
+b=[(1:6)' (11:16)' (21:26)'];
+a1=a;a1(:,[1 3 1])=b;A=full(a);A(:,[1 3 1])=b;
+if or(full(a1)<>A) then pause,end
+//********
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=-[1 2 3;4 5 6;7 8 9];
+a1=a;a1(1,1)=30;A=full(a);A(1,1)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,6)=30;A=full(a);A(1,6)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1,8)=30;A=full(a);A(1,8)=30;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=b;
+if or(full(a1)<>A) then pause,end
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=b;
+if or(full(a1)<>A) then pause,end
+// vector insertion
+v=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=[5;10;33];V=full(v);V([1 2 8])=[5;10;33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then pause,end
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=sparse([5;10;33]);V=full(v);V([1 2 8])=[5;10;33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 1])=sparse([5;10;33]);V=full(v);V([1 2 1])=[5;10;33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=[];
+if or(full(v1)<>[]) then pause,end
+v1=v;v1(:)=sparse([2 1],44,[6 1]);V=full(v);V(:)=[0;44;0;0;0;0];
+if or(full(v1)<>V) then pause,end
+v=v';
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=[5 10 33];V=full(v);V([1 2 8])=[5 10 33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 8])=sparse([5 10 33]);V=full(v);V([1 2 8])=[5 10 33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1([1 2 1])=sparse([5 10 33]);V=full(v);V([1 2 1])=[5 10 33];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(:)=sparse([1 2],44,[1,6]);V=full(v);V(:)=[0 44 0 0 0 0];
+if or(full(v1)<>V) then pause,end
+v1=v;v1(1)=[];V=full(v);V(1)=[];
+if or(full(v1)<>V) then pause,end
+//test des comparaisons
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6]);
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a>sparse(5))<>(full(a)>5) then pause,end
+if full(sparse(5)>a)<>(5>full(a)) then pause,end
+if full(b>a)<>(full(b)>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(a>5)<>(full(a)>5) then pause,end
+if full(5>a)<>(5>full(a)) then pause,end
+if full(b>full(a))<>(full(b)>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+if full(full(a)>sparse(5))<>(full(a)>5) then pause,end
+if full(full(b)>a)<>(full(b)>full(a)) then pause,end
+a=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a>sparse(5))<>(full(a)>5) then pause,end
+if full(sparse(5)>a)<>(5>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(a>5)<>(full(a)>5) then pause,end
+if full(5>a)<>(5>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+if full(full(a)>sparse(5))<>(full(a)>5) then pause,end
+a=a';
+if full(a==a)<>full(a)==full(a) then pause,end
+if full(a<>a)<>(full(a)<>full(a)) then pause,end
+if full(a>sparse(5))<>(full(a)>5) then pause,end
+if full(sparse(5)>a)<>(5>full(a)) then pause,end
+if full(a==full(a))<>full(a)==full(a) then pause,end
+if full(a<>full(a))<>(full(a)<>full(a)) then pause,end
+if full(a>5)<>(full(a)>5) then pause,end
+if full(5>a)<>(5>full(a)) then pause,end
+if full(full(a)==a)<>full(a)==full(a) then pause,end
+if full(full(a)<>a)<>(full(a)<>full(a)) then pause,end
+if full(full(a)>sparse(5))<>(full(a)>5) then pause,end
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;5 5],[10;-1;-1],[5 6]);
+if a==b<>%f then pause,end
+if a<>b<>%t then pause,end
+
+a=sparse([%f %t %f %t]);
+b=sparse([%t %f %t %f]);
+assert_checkequal(~a, b);
diff --git a/modules/sparse/tests/unit_tests/sparseBool.dia.ref b/modules/sparse/tests/unit_tests/sparseBool.dia.ref
new file mode 100755
index 000000000..623e8b923
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparseBool.dia.ref
@@ -0,0 +1,92 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - DIGITEO - Antoine ELIAS
+// Copyright (C) 2012 - Scilab Enterprises - Cedric Delamarre
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+//
+//
+
+// boolean sparse function
+
+
+//from dense form
+s=[ %t,%f,%f,%f,%f,%f,%f;
+ %f,%t,%f,%f,%f,%f,%f;
+ %f,%f,%t,%f,%f,%f,%f;
+ %f,%f,%t,%t,%f,%f,%f;
+ %f,%f,%t,%t,%t,%f,%f;
+ %f,%f,%t,%t,%f,%t,%f;
+ %f,%f,%t,%t,%f,%t,%t];
+
+
+sp=sparse(s);
+
+assert_checkequal(size(s), size(sp));
+assert_checkequal(full(sp), s);
+
+//from coord
+sp = sparse([1 1;2 2;3 3;4 3;4 4;5 3;5 4;5 5;6 3;6 4;6 6;7 3;7 4;7 6;7 7], [%t %t %t %t %t %t %t %t %t %t %t %t %t %t %t]);
+assert_checkequal(size(s), size(sp));
+assert_checkequal(full(sp), s);
+
+//with size
+newsp = sparse([], [], [10,20]);
+assert_checkequal(size(newsp), [10,20]);
+
+//concatenation
+spc = [sp [%t; %f; %t; %f; %t; %f; %t]];
+sc = [s [%t; %f; %t; %f; %t; %f; %t]];
+assert_checkequal(full(spc), sc);
+
+spc = [sp ;[%t %f %t %f %t %f %t]];
+sc = [s ;[%t %f %t %f %t %f %t]];
+assert_checkequal(full(spc), sc);
+
+spc = [[%t; %f; %t; %f; %t; %f; %t] sp];
+sc = [[%t; %f; %t; %f; %t; %f; %t] s];
+assert_checkequal(full(spc), sc);
+
+spc = [[%t %f %t %f %t %f %t]; sp];
+sc = [[%t %f %t %f %t %f %t]; s];
+assert_checkequal(full(spc), sc);
+
+sc = [s s];
+spc = [sp sp];
+assert_checkequal(full(spc), sc);
+
+sc = [s; s];
+spc = [sp; sp];
+assert_checkequal(full(spc), sc);
+
+sc = [s s];
+spc = [sp sp];
+assert_checkequal(full(spc), sc);
+
+A = sparse(%t);
+A = [A %f];
+A = [A %f];
+A = [A %f];
+
+assert_checkequal(full(A), [%t %f %f %f]);
+assert_checkequal(size(A, 'c'), 4);
+
+//extraction
+assert_checkequal(full(sp(:)), s(:));
+assert_checkequal(size(sp(:)), size(s(:)));
+assert_checkequal(full(sp(1:7, 1:7)), s(1:7, 1:7));
+assert_checkequal(size(sp(1:7, 1:7)), size(s(1:7, 1:7)));
+assert_checkequal(full(sp(1:4, :)), s(1:4, :));
+assert_checkequal(size(sp(1:4, :)), size(s(1:4, :)));
+assert_checkequal(full(sp(:, 2:6)), s(:, 2:6));
+assert_checkequal(size(sp(:, 2:6)), size(s(:, 2:6)));
+assert_checkequal(full(sp(:, $)), s(:, $));
+assert_checkequal(size(sp(:, $)), size(s(:, $)));
+
+
+
+
diff --git a/modules/sparse/tests/unit_tests/sparseBool.tst b/modules/sparse/tests/unit_tests/sparseBool.tst
new file mode 100755
index 000000000..623e8b923
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sparseBool.tst
@@ -0,0 +1,92 @@
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - DIGITEO - Antoine ELIAS
+// Copyright (C) 2012 - Scilab Enterprises - Cedric Delamarre
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+//
+//
+
+// boolean sparse function
+
+
+//from dense form
+s=[ %t,%f,%f,%f,%f,%f,%f;
+ %f,%t,%f,%f,%f,%f,%f;
+ %f,%f,%t,%f,%f,%f,%f;
+ %f,%f,%t,%t,%f,%f,%f;
+ %f,%f,%t,%t,%t,%f,%f;
+ %f,%f,%t,%t,%f,%t,%f;
+ %f,%f,%t,%t,%f,%t,%t];
+
+
+sp=sparse(s);
+
+assert_checkequal(size(s), size(sp));
+assert_checkequal(full(sp), s);
+
+//from coord
+sp = sparse([1 1;2 2;3 3;4 3;4 4;5 3;5 4;5 5;6 3;6 4;6 6;7 3;7 4;7 6;7 7], [%t %t %t %t %t %t %t %t %t %t %t %t %t %t %t]);
+assert_checkequal(size(s), size(sp));
+assert_checkequal(full(sp), s);
+
+//with size
+newsp = sparse([], [], [10,20]);
+assert_checkequal(size(newsp), [10,20]);
+
+//concatenation
+spc = [sp [%t; %f; %t; %f; %t; %f; %t]];
+sc = [s [%t; %f; %t; %f; %t; %f; %t]];
+assert_checkequal(full(spc), sc);
+
+spc = [sp ;[%t %f %t %f %t %f %t]];
+sc = [s ;[%t %f %t %f %t %f %t]];
+assert_checkequal(full(spc), sc);
+
+spc = [[%t; %f; %t; %f; %t; %f; %t] sp];
+sc = [[%t; %f; %t; %f; %t; %f; %t] s];
+assert_checkequal(full(spc), sc);
+
+spc = [[%t %f %t %f %t %f %t]; sp];
+sc = [[%t %f %t %f %t %f %t]; s];
+assert_checkequal(full(spc), sc);
+
+sc = [s s];
+spc = [sp sp];
+assert_checkequal(full(spc), sc);
+
+sc = [s; s];
+spc = [sp; sp];
+assert_checkequal(full(spc), sc);
+
+sc = [s s];
+spc = [sp sp];
+assert_checkequal(full(spc), sc);
+
+A = sparse(%t);
+A = [A %f];
+A = [A %f];
+A = [A %f];
+
+assert_checkequal(full(A), [%t %f %f %f]);
+assert_checkequal(size(A, 'c'), 4);
+
+//extraction
+assert_checkequal(full(sp(:)), s(:));
+assert_checkequal(size(sp(:)), size(s(:)));
+assert_checkequal(full(sp(1:7, 1:7)), s(1:7, 1:7));
+assert_checkequal(size(sp(1:7, 1:7)), size(s(1:7, 1:7)));
+assert_checkequal(full(sp(1:4, :)), s(1:4, :));
+assert_checkequal(size(sp(1:4, :)), size(s(1:4, :)));
+assert_checkequal(full(sp(:, 2:6)), s(:, 2:6));
+assert_checkequal(size(sp(:, 2:6)), size(s(:, 2:6)));
+assert_checkequal(full(sp(:, $)), s(:, $));
+assert_checkequal(size(sp(:, $)), size(s(:, $)));
+
+
+
+
diff --git a/modules/sparse/tests/unit_tests/spisp.dia.ref b/modules/sparse/tests/unit_tests/spisp.dia.ref
new file mode 100755
index 000000000..7ba74cd43
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/spisp.dia.ref
@@ -0,0 +1,37 @@
+m = 200;
+n = 400;
+mi = 30;
+ni = 40;
+A = sprand(n,m,0.1) + %i*sprand(n,m,0.1);
+B = sprand(mi,ni,0.7) +%i*sprand(mi,ni,0.7);
+ii = ["grand(mi,1,""uin"",1,m)";
+ "-gsort(-grand(mi,1,""uin"",1,m))";
+ "1:mi";
+ "m:-1:(m-mi+1)";
+ "m-5:m+mi-6"];
+jj = ["grand(ni,1,""uin"",1,n)";
+ "-gsort(-grand(ni,1,""uin"",1,n))";
+ "1:ni";
+ "n:-1:(n-ni+1)";
+ "n-2:n+ni-3"];
+switchA = ["real(A)" "A"];
+switchB = ["real(B)" "B"];
+for i=1:5
+ indi = evstr(ii(i));
+ for j=1:5
+ indj = evstr(jj(j));
+ for k=1:2
+ for l=1:2
+ AA = evstr(switchA(k));
+ Af = full(AA);
+ D = evstr(switchB(l));
+ Df = full(D);
+ AA(indi,indj) = D;
+ Af(indi,indj) = Df;
+ if max(abs(Af - full(AA))) > 0 then
+ mprintf('\n\r test (%d,%d,%d,%d) fails',i,j,k,l)
+ end
+ end
+ end
+ end
+end
diff --git a/modules/sparse/tests/unit_tests/spisp.tst b/modules/sparse/tests/unit_tests/spisp.tst
new file mode 100755
index 000000000..13e0d5060
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/spisp.tst
@@ -0,0 +1,51 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- CLI SHELL MODE -->
+
+m = 200;
+n = 400;
+mi = 30;
+ni = 40;
+
+A = sprand(n,m,0.1) + %i*sprand(n,m,0.1);
+B = sprand(mi,ni,0.7) +%i*sprand(mi,ni,0.7);
+
+ii = ["grand(mi,1,""uin"",1,m)";
+ "-gsort(-grand(mi,1,""uin"",1,m))";
+ "1:mi";
+ "m:-1:(m-mi+1)";
+ "m-5:m+mi-6"];
+jj = ["grand(ni,1,""uin"",1,n)";
+ "-gsort(-grand(ni,1,""uin"",1,n))";
+ "1:ni";
+ "n:-1:(n-ni+1)";
+ "n-2:n+ni-3"];
+
+
+switchA = ["real(A)" "A"];
+switchB = ["real(B)" "B"];
+
+for i=1:5
+ indi = evstr(ii(i));
+ for j=1:5
+ indj = evstr(jj(j));
+ for k=1:2
+ for l=1:2
+ AA = evstr(switchA(k));
+ Af = full(AA);
+ D = evstr(switchB(l));
+ Df = full(D);
+ AA(indi,indj) = D;
+ Af(indi,indj) = Df;
+ if max(abs(Af - full(AA))) > 0 then
+ mprintf('\n\r test (%d,%d,%d,%d) fails',i,j,k,l)
+ end
+ end
+ end
+ end
+end
diff --git a/modules/sparse/tests/unit_tests/sprand.dia.ref b/modules/sparse/tests/unit_tests/sprand.dia.ref
new file mode 100755
index 000000000..97da5c68a
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sprand.dia.ref
@@ -0,0 +1,90 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+// Check default "typ" = "uniform"
+rand("seed",0);
+grand("setsd",0);
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( min(values) >= 0 , %t );
+assert_checkequal ( max(values) <= 1 , %t );
+assert_checkalmostequal ( mean(values) , 0.5 , 1.e-2 );
+// Get empty matrix
+s=sprand(0,0,0.01);
+assert_checkequal ( s , [] );
+// Test the scientific part
+// In the following script, we check that the entries of the matrix have the expected distribution.
+// We use the spget function in order to get the nonzero entries.
+// Then we compute the min, mean and max of the entries and compare them with the limit values.
+rand("seed",0);
+grand("setsd",0);
+typ = "normal";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( nnzs > 10000 , %t );
+assert_checkequal ( min(values) < -3 , %t );
+assert_checkalmostequal ( mean(values) , 0 , [] , 1.e-2 );
+assert_checkequal ( max(values) > 3 , %t );
+assert_checkalmostequal ( variance(values) , 1 , 1.e-2 );
+rand("seed",0);
+grand("setsd",0);
+typ = "uniform";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( nnzs > 10000 , %t );
+assert_checkalmostequal ( min(values) , 0 , [] , 1.e-2 );
+assert_checkalmostequal ( mean(values) , 0.5 , 1.e-2 );
+assert_checkalmostequal ( max(values) , 1 , 1.e-2 );
+assert_checkalmostequal ( variance(values) , 1/12 , 1.e-2 );
+// In the following script, we check that the entry indices,
+// which are also chosen at random, have the correct distribution.
+// We generate kmax sparse random matrices with uniform distribution.
+// For each matrix, we consider the indices of the nonzero entries
+// which were generated, i.e. we see if the event Aij = {the entry (i,j) is nonzero}
+// occurred for each i and j, for i=1,2,...,nrows and j=1,2,...,ncols.
+// The matrix C(i,j) stores the number of times that the event Aij occurred.
+// The matrix R(k) stores the actual density of the try number k, where k=1,2,...,kmax.
+rand("seed",0);
+grand("setsd",0);
+kmax = 1000;
+ncols=100;
+nrows=100;
+density=0.01;
+typ="uniform";
+C=zeros(nrows,ncols);
+R=[];
+for k=1:kmax
+ M=sprand(nrows,ncols,density,typ);
+ NZ=find(M<>0);
+ NZratio = size(NZ,"*")/(nrows*ncols);
+ R=[R NZratio];
+ C(NZ)=C(NZ)+1;
+end
+// Now that this algorithm has been performed (which may require some time),
+// we can compute elementary statistics to check that the algorithm performed well.
+// The average number should be close to the expectation.
+assert_checkalmostequal ( density*kmax , mean(C) , 1.e-2 );
+// The density should be close to expected density
+assert_checkalmostequal ( density , mean(R) , 1.e-2 );
+// More deeper tests should involve the particular distribution of
+// C, which follows a binomial law.
+// May be a chi-square test should be used for this.
diff --git a/modules/sparse/tests/unit_tests/sprand.tst b/modules/sparse/tests/unit_tests/sprand.tst
new file mode 100755
index 000000000..2ded8e777
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/sprand.tst
@@ -0,0 +1,103 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2010-2011 - DIGITEO - Michael Baudin
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+
+
+// Check default "typ" = "uniform"
+rand("seed",0);
+grand("setsd",0);
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( min(values) >= 0 , %t );
+assert_checkequal ( max(values) <= 1 , %t );
+assert_checkalmostequal ( mean(values) , 0.5 , 1.e-2 );
+
+// Get empty matrix
+s=sprand(0,0,0.01);
+assert_checkequal ( s , [] );
+
+// Test the scientific part
+// In the following script, we check that the entries of the matrix have the expected distribution.
+// We use the spget function in order to get the nonzero entries.
+// Then we compute the min, mean and max of the entries and compare them with the limit values.
+
+rand("seed",0);
+grand("setsd",0);
+typ = "normal";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( nnzs > 10000 , %t );
+assert_checkequal ( min(values) < -3 , %t );
+assert_checkalmostequal ( mean(values) , 0 , [] , 1.e-2 );
+assert_checkequal ( max(values) > 3 , %t );
+assert_checkalmostequal ( variance(values) , 1 , 1.e-2 );
+
+rand("seed",0);
+grand("setsd",0);
+typ = "uniform";
+nrows = 1000;
+ncols = 2000;
+density = 1/100;
+s=sprand(nrows,ncols,density,typ);
+assert_checkequal ( size(s) , [nrows,ncols] );
+nnzs=nnz(s);
+[ij,values]=spget(s);
+assert_checkequal ( nnzs > 10000 , %t );
+assert_checkalmostequal ( min(values) , 0 , [] , 1.e-2 );
+assert_checkalmostequal ( mean(values) , 0.5 , 1.e-2 );
+assert_checkalmostequal ( max(values) , 1 , 1.e-2 );
+assert_checkalmostequal ( variance(values) , 1/12 , 1.e-2 );
+
+// In the following script, we check that the entry indices,
+// which are also chosen at random, have the correct distribution.
+// We generate kmax sparse random matrices with uniform distribution.
+// For each matrix, we consider the indices of the nonzero entries
+// which were generated, i.e. we see if the event Aij = {the entry (i,j) is nonzero}
+// occurred for each i and j, for i=1,2,...,nrows and j=1,2,...,ncols.
+// The matrix C(i,j) stores the number of times that the event Aij occurred.
+// The matrix R(k) stores the actual density of the try number k, where k=1,2,...,kmax.
+
+rand("seed",0);
+grand("setsd",0);
+kmax = 1000;
+ncols=100;
+nrows=100;
+density=0.01;
+typ="uniform";
+C=zeros(nrows,ncols);
+R=[];
+for k=1:kmax
+ M=sprand(nrows,ncols,density,typ);
+ NZ=find(M<>0);
+ NZratio = size(NZ,"*")/(nrows*ncols);
+ R=[R NZratio];
+ C(NZ)=C(NZ)+1;
+end
+// Now that this algorithm has been performed (which may require some time),
+// we can compute elementary statistics to check that the algorithm performed well.
+
+// The average number should be close to the expectation.
+assert_checkalmostequal ( density*kmax , mean(C) , 1.e-2 );
+// The density should be close to expected density
+assert_checkalmostequal ( density , mean(R) , 1.e-2 );
+
+// More deeper tests should involve the particular distribution of
+// C, which follows a binomial law.
+// May be a chi-square test should be used for this.
+
+
diff --git a/modules/sparse/tests/unit_tests/spzeros.dia.ref b/modules/sparse/tests/unit_tests/spzeros.dia.ref
new file mode 100755
index 000000000..c1224dc03
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/spzeros.dia.ref
@@ -0,0 +1,18 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012-2012 - SE - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+m=spzeros(2,2);
+assert_checkequal(size(m),[2,2]);
+m=spzeros(2,3);
+assert_checkequal(size(m),[2,3]);
+a=rand(10,12);
+m=spzeros(a);
+assert_checkequal(size(m),[10,12]);
+assert_checkequal(sum(m),0);
+m=spzeros(3);
+assert_checkequal(size(m),[1,1]);
+assert_checkequal(sum(spzeros(1000,1000)),0);
diff --git a/modules/sparse/tests/unit_tests/spzeros.tst b/modules/sparse/tests/unit_tests/spzeros.tst
new file mode 100755
index 000000000..86b754b27
--- /dev/null
+++ b/modules/sparse/tests/unit_tests/spzeros.tst
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012-2012 - SE - Sylvestre Ledru
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- CLI SHELL MODE -->
+
+
+m=spzeros(2,2);
+assert_checkequal(size(m),[2,2]);
+
+m=spzeros(2,3);
+assert_checkequal(size(m),[2,3]);
+
+a=rand(10,12);
+m=spzeros(a);
+assert_checkequal(size(m),[10,12]);
+assert_checkequal(sum(m),0);
+
+m=spzeros(3);
+assert_checkequal(size(m),[1,1]);
+
+
+assert_checkequal(sum(spzeros(1000,1000)),0);