Skip to content
Commits on Source (4)
sofa-framework (19.06.01+dfsg-1) UNRELEASED; urgency=medium
sofa-framework (19.06.01+dfsg2-1) UNRELEASED; urgency=medium
* New upstream version
* Point watch file to Github
......
......@@ -4,7 +4,6 @@ Debianized-By: Dominique Belhachemi <domibel@debian.org>
Debianized-Date: Tue, 24 Jun 2008 20:51:56 +0200
Source: https://github.com/sofa-framework/sofa/releases
Files-Excluded: */libQGLViewer*
*/csparse
*/gtest
*/qwt*
*/eigen-3*
......@@ -13,7 +12,6 @@ Files-Excluded: */libQGLViewer*
*/tinyxml
*/*.dll
*/*.lib
*/SuiteSparse
Files: *
Copyright: 2006-2008 MGH, INRIA, USTL, UJF, CNRS
......
version=4
opts="repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
opts="repacksuffix=+dfsg,dversionmangle=auto,repack,compression=xz" \
https://github.com/sofa-framework/sofa/releases .*/archive/v@ANY_VERSION@@ARCHIVE_EXT@
cmake_minimum_required(VERSION 3.1)
project(csparse VERSION 1.2.0)
set(HEADER_FILES
csparse.h
ldl.h
UFconfig.h)
set(SOURCE_FILES
csparse.c
ldl.c)
# The code must be relocatable if we want to link a shared library against it.
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xGNU" OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
add_compile_options(-fPIC)
endif()
add_library(${PROJECT_NAME} STATIC ${HEADER_FILES} ${SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:include/extlibs/CSparse>")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
include(${SOFA_KERNEL_SOURCE_DIR}/SofaFramework/SofaMacros.cmake)
sofa_generate_package(NAME CSparse VERSION ${PROJECT_VERSION} TARGETS ${PROJECT_NAME} INCLUDE_INSTALL_DIR "extlibs/CSparse")
CSPARSE: a Concise Sparse matrix package.
Copyright (c) 2006, Timothy A. Davis.
http://www.cise.ufl.edu/research/sparse/CSparse
# CMake package configuration file for the csparse library
@PACKAGE_INIT@
if(NOT TARGET csparse)
include("${CMAKE_CURRENT_LIST_DIR}/CSparseTargets.cmake")
endif()
check_required_components(csparse)
set(CSparse_LIBRARIES csparse)
set(CSparse_INCLUDE_DIRS @PACKAGE_CSPARSE_INCLUDE_DIR@)
/* ========================================================================== */
/* === UFconfig.h =========================================================== */
/* ========================================================================== */
/* Configuration file for SuiteSparse: a Suite of Sparse matrix packages
* (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others).
*
* UFconfig.h provides the definition of the long integer. On most systems,
* a C program can be compiled in LP64 mode, in which long's and pointers are
* both 64-bits, and int's are 32-bits. Windows 64, however, uses the LLP64
* model, in which int's and long's are 32-bits, and long long's and pointers
* are 64-bits.
*
* SuiteSparse packages that include long integer versions are
* intended for the LP64 mode. However, as a workaround for Windows 64
* (and perhaps other systems), the long integer can be redefined.
*
* If _WIN64 is defined, then the __int64 type is used instead of long.
*
* The long integer can also be defined at compile time. For example, this
* could be added to UFconfig.mk:
*
* CFLAGS = -O -D'UF_long=long long' -D'UF_long_max=9223372036854775801' \
* -D'UF_long_id="%lld"'
*
* This file defines UF_long as either long (on all but _WIN64) or
* __int64 on Windows 64. The intent is that a UF_long is always a 64-bit
* integer in a 64-bit code. ptrdiff_t might be a better choice than long;
* it is always the same size as a pointer.
*
* This file also defines the SUITESPARSE_VERSION and related definitions.
*
* Copyright (c) 2007, University of Florida. No licensing restrictions
* apply to this file or to the UFconfig directory. Author: Timothy A. Davis.
*/
#ifndef _UFCONFIG_H
#define _UFCONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <limits.h>
/* ========================================================================== */
/* === UF_long ============================================================== */
/* ========================================================================== */
#ifndef UF_long
#ifdef _WIN64
#define UF_long __int64
#define UF_long_max _I64_MAX
#define UF_long_id "%I64d"
#else
#define UF_long long
#define UF_long_max LONG_MAX
#define UF_long_id "%ld"
#endif
#endif
/* ========================================================================== */
/* === SuiteSparse version ================================================== */
/* ========================================================================== */
/* SuiteSparse is not a package itself, but a collection of packages, some of
* which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD,
* COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the
* collection itself. The versions of packages within each version of
* SuiteSparse are meant to work together. Combining one packge from one
* version of SuiteSparse, with another package from another version of
* SuiteSparse, may or may not work.
*
* SuiteSparse Version 3.2.0 contains the following packages:
*
* AMD version 2.2.0
* CAMD version 2.2.0
* COLAMD version 2.7.1
* CCOLAMD version 2.7.1
* CHOLMOD version 1.7.0
* CSparse version 2.2.1
* CXSparse version 2.2.1
* KLU version 1.0.1
* BTF version 1.0.1
* LDL version 2.0.1
* UFconfig version number is the same as SuiteSparse
* UMFPACK version 5.2.0
* RBio version 1.1.1
* UFcollection version 1.1.1
* LINFACTOR version 1.1.0
* MESHND version 1.1.0
* SSMULT version 1.1.0
* MATLAB_Tools no specific version number
* SuiteSparseQR version 1.1.0
*
* Other package dependencies:
* BLAS required by CHOLMOD and UMFPACK
* LAPACK required by CHOLMOD
* METIS 4.0.1 required by CHOLMOD (optional) and KLU (optional)
*/
#define SUITESPARSE_DATE "Sept 20, 2008"
#define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub))
#define SUITESPARSE_MAIN_VERSION 3
#define SUITESPARSE_SUB_VERSION 2
#define SUITESPARSE_SUBSUB_VERSION 0
#define SUITESPARSE_VERSION \
SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION)
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
#ifndef _CS_H
#define _CS_H
#ifdef MATLAB_MEX_FILE
#include "mex.h"
#endif
#define CS_VER 1 /* CSparse Version 1.2.0 */
#define CS_SUBVER 2
#define CS_SUBSUB 0
#define CS_DATE "Mar 6, 2006" /* CSparse release date */
#define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006"
#if defined(__cplusplus)
extern "C" {
#endif
/* --- primary CSparse routines and data structures ------------------------- */
typedef struct cs_sparse /* matrix in compressed-column or triplet form */
{
int nzmax ; /* maximum number of entries */
int m ; /* number of rows */
int n ; /* number of columns */
int *p ; /* column pointers (size n+1) or col indices (size nzmax) */
int *i ; /* row indices, size nzmax */
double *x ; /* numerical values, size nzmax */
int nz ; /* # of entries in triplet matrix, -1 for compressed-col */
} cs ;
cs *cs_add (const cs *A, const cs *B, double alpha, double beta) ;
int cs_cholsol (const cs *A, double *b, int order) ;
int cs_dupl (cs *A) ;
int cs_entry (cs *T, int i, int j, double x) ;
int cs_lusol (const cs *A, double *b, int order, double tol) ;
int cs_gaxpy (const cs *A, const double *x, double *y) ;
cs *cs_multiply (const cs *A, const cs *B) ;
int cs_qrsol (const cs *A, double *b, int order) ;
cs *cs_transpose (const cs *A, int values) ;
cs *cs_triplet (const cs *T) ;
double cs_norm (const cs *A) ;
int cs_print (const cs *A, int brief) ;
cs *cs_load (FILE *f) ;
/* utilities */
void *cs_calloc (int n, size_t size) ;
void *cs_free (void *p) ;
void *cs_realloc (void *p, int n, size_t size, int *ok) ;
cs *cs_spalloc (int m, int n, int nzmax, int values, int triplet) ;
cs *cs_spfree (cs *A) ;
int cs_sprealloc (cs *A, int nzmax) ;
void *cs_malloc (int n, size_t size) ;
/* --- secondary CSparse routines and data structures ----------------------- */
typedef struct cs_symbolic /* symbolic Cholesky, LU, or QR analysis */
{
int *Pinv ; /* inverse row perm. for QR, fill red. perm for Chol */
int *Q ; /* fill-reducing column permutation for LU and QR */
int *parent ; /* elimination tree for Cholesky and QR */
int *cp ; /* column pointers for Cholesky, row counts for QR */
int m2 ; /* # of rows for QR, after adding fictitious rows */
int lnz ; /* # entries in L for LU or Cholesky; in V for QR */
int unz ; /* # entries in U for LU; in R for QR */
} css ;
typedef struct cs_numeric /* numeric Cholesky, LU, or QR factorization */
{
cs *L ; /* L for LU and Cholesky, V for QR */
cs *U ; /* U for LU, R for QR, not used for Cholesky */
int *Pinv ; /* partial pivoting for LU */
double *B ; /* beta [0..n-1] for QR */
} csn ;
typedef struct cs_dmperm_results /* cs_dmperm or cs_scc output */
{
int *P ; /* size m, row permutation */
int *Q ; /* size n, column permutation */
int *R ; /* size nb+1, block k is rows R[k] to R[k+1]-1 in A(P,Q) */
int *S ; /* size nb+1, block k is cols S[k] to S[k+1]-1 in A(P,Q) */
int nb ; /* # of blocks in fine dmperm decomposition */
int rr [5] ; /* coarse row decomposition */
int cc [5] ; /* coarse column decomposition */
} csd ;
int *cs_amd (const cs *A, int order) ;
csn *cs_chol (const cs *A, const css *S) ;
csd *cs_dmperm (const cs *A) ;
int cs_droptol (cs *A, double tol) ;
int cs_dropzeros (cs *A) ;
int cs_happly (const cs *V, int i, double beta, double *x) ;
int cs_ipvec (int n, const int *P, const double *b, double *x) ;
int cs_lsolve (const cs *L, double *x) ;
int cs_ltsolve (const cs *L, double *x) ;
csn *cs_lu (const cs *A, const css *S, double tol) ;
cs *cs_permute (const cs *A, const int *P, const int *Q, int values) ;
int *cs_pinv (const int *P, int n) ;
int cs_pvec (int n, const int *P, const double *b, double *x) ;
csn *cs_qr (const cs *A, const css *S) ;
css *cs_schol (const cs *A, int order) ;
css *cs_sqr (const cs *A, int order, int qr) ;
cs *cs_symperm (const cs *A, const int *Pinv, int values) ;
int cs_usolve (const cs *U, double *x) ;
int cs_utsolve (const cs *U, double *x) ;
int cs_updown (cs *L, int sigma, const cs *C, const int *parent) ;
/* utilities */
css *cs_sfree (css *S) ;
csn *cs_nfree (csn *N) ;
csd *cs_dfree (csd *D) ;
/* --- tertiary CSparse routines -------------------------------------------- */
int *cs_counts (const cs *A, const int *parent, const int *post, int ata) ;
int cs_cumsum (int *p, int *c, int n) ;
int cs_dfs (int j, cs *L, int top, int *xi, int *pstack, const int *Pinv) ;
int *cs_etree (const cs *A, int ata) ;
int cs_fkeep (cs *A, int (*fkeep) (int, int, double, void *), void *other) ;
double cs_house (double *x, double *beta, int n) ;
int *cs_maxtrans (const cs *A) ;
int *cs_post (int n, const int *parent) ;
int cs_reach (cs *L, const cs *B, int k, int *xi, const int *Pinv) ;
csd *cs_scc (cs *A) ;
int cs_scatter (const cs *A, int j, double beta, int *w, double *x, int mark,
cs *C, int nz) ;
int cs_splsolve (cs *L, const cs *B, int k, int *xi, double *x,
const int *Pinv) ;
int cs_tdfs (int j, int k, int *head, const int *next, int *post,
int *stack) ;
/* utilities */
csd *cs_dalloc (int m, int n) ;
cs *cs_done (cs *C, void *w, void *x, int ok) ;
int *cs_idone (int *p, cs *C, void *w, int ok) ;
csn *cs_ndone (csn *N, cs *C, void *w, void *x, int ok) ;
csd *cs_ddone (csd *D, cs *C, void *w, int ok) ;
#define CS_MAX(a,b) (((a) > (b)) ? (a) : (b))
#define CS_MIN(a,b) (((a) < (b)) ? (a) : (b))
#define CS_FLIP(i) (-(i)-2)
#define CS_UNFLIP(i) (((i) < 0) ? CS_FLIP(i) : (i))
#define CS_MARKED(Ap,j) (Ap [j] < 0)
#define CS_MARK(Ap,j) { Ap [j] = CS_FLIP (Ap [j]) ; }
#define CS_OVERFLOW(n,size) (n > INT_MAX / (int) size)
#if defined(__cplusplus)
} //extern "C"
#endif
#endif
This diff is collapsed.
/* ========================================================================== */
/* === ldl.h: include file for the LDL package ============================= */
/* ========================================================================== */
/* LDL Copyright (c) Timothy A Davis,
* University of Florida. All Rights Reserved. See README for the License.
*/
#include "UFconfig.h"
#ifdef LDL_LONG
#define LDL_int UF_long
#define LDL_ID UF_long_id
#define LDL_symbolic ldl_l_symbolic
#define LDL_numeric ldl_l_numeric
#define LDL_lsolve ldl_l_lsolve
#define LDL_dsolve ldl_l_dsolve
#define LDL_ltsolve ldl_l_ltsolve
#define LDL_perm ldl_l_perm
#define LDL_permt ldl_l_permt
#define LDL_valid_perm ldl_l_valid_perm
#define LDL_valid_matrix ldl_l_valid_matrix
#else
#define LDL_int int
#define LDL_ID "%d"
#define LDL_symbolic ldl_symbolic
#define LDL_numeric ldl_numeric
#define LDL_lsolve ldl_lsolve
#define LDL_dsolve ldl_dsolve
#define LDL_ltsolve ldl_ltsolve
#define LDL_perm ldl_perm
#define LDL_permt ldl_permt
#define LDL_valid_perm ldl_valid_perm
#define LDL_valid_matrix ldl_valid_matrix
#endif
#if defined(__cplusplus)
extern "C" {
#endif
/* ========================================================================== */
/* === int version ========================================================== */
/* ========================================================================== */
void ldl_symbolic (int n, int Ap [ ], int Ai [ ], int Lp [ ],
int Parent [ ], int Lnz [ ], int Flag [ ], int P [ ], int Pinv [ ]) ;
int ldl_numeric (int n, int Ap [ ], int Ai [ ], double Ax [ ],
int Lp [ ], int Parent [ ], int Lnz [ ], int Li [ ], double Lx [ ],
double D [ ], double Y [ ], int Pattern [ ], int Flag [ ],
int P [ ], int Pinv [ ]) ;
void ldl_lsolve (int n, double X [ ], int Lp [ ], int Li [ ],
double Lx [ ]) ;
void ldl_dsolve (int n, double X [ ], double D [ ]) ;
void ldl_ltsolve (int n, double X [ ], int Lp [ ], int Li [ ],
double Lx [ ]) ;
void ldl_perm (int n, double X [ ], double B [ ], int P [ ]) ;
void ldl_permt (int n, double X [ ], double B [ ], int P [ ]) ;
int ldl_valid_perm (int n, int P [ ], int Flag [ ]) ;
int ldl_valid_matrix ( int n, int Ap [ ], int Ai [ ]) ;
/* ========================================================================== */
/* === long version ========================================================= */
/* ========================================================================== */
void ldl_l_symbolic (UF_long n, UF_long Ap [ ], UF_long Ai [ ], UF_long Lp [ ],
UF_long Parent [ ], UF_long Lnz [ ], UF_long Flag [ ], UF_long P [ ],
UF_long Pinv [ ]) ;
UF_long ldl_l_numeric (UF_long n, UF_long Ap [ ], UF_long Ai [ ], double Ax [ ],
UF_long Lp [ ], UF_long Parent [ ], UF_long Lnz [ ], UF_long Li [ ],
double Lx [ ], double D [ ], double Y [ ], UF_long Pattern [ ],
UF_long Flag [ ], UF_long P [ ], UF_long Pinv [ ]) ;
void ldl_l_lsolve (UF_long n, double X [ ], UF_long Lp [ ], UF_long Li [ ],
double Lx [ ]) ;
void ldl_l_dsolve (UF_long n, double X [ ], double D [ ]) ;
void ldl_l_ltsolve (UF_long n, double X [ ], UF_long Lp [ ], UF_long Li [ ],
double Lx [ ]) ;
void ldl_l_perm (UF_long n, double X [ ], double B [ ], UF_long P [ ]) ;
void ldl_l_permt (UF_long n, double X [ ], double B [ ], UF_long P [ ]) ;
UF_long ldl_l_valid_perm (UF_long n, UF_long P [ ], UF_long Flag [ ]) ;
UF_long ldl_l_valid_matrix ( UF_long n, UF_long Ap [ ], UF_long Ai [ ]) ;
/* ========================================================================== */
/* === LDL version ========================================================== */
/* ========================================================================== */
#define LDL_DATE "Nov 1, 2007"
#define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub))
#define LDL_MAIN_VERSION 2
#define LDL_SUB_VERSION 0
#define LDL_SUBSUB_VERSION 1
#define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION)
#if defined(__cplusplus)
} //extern "C"
#endif