EVSL
1.1.0
EigenValues Slicing Library
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
EXTERNAL
CXSparse
Source
cs_entry.c
Go to the documentation of this file.
1
#include "
cs.h
"
2
/* add an entry to a triplet matrix; return 1 if ok, 0 otherwise */
3
CS_INT
cs_entry
(
cs
*T,
CS_INT
i,
CS_INT
j,
CS_ENTRY
x)
4
{
5
if
(!
CS_TRIPLET
(T) || i < 0 || j < 0)
return
(0) ;
/* check inputs */
6
if
(T->nz >= T->nzmax && !
cs_sprealloc
(T,2*(T->nzmax)))
return
(0) ;
7
if
(T->x) T->x [T->nz] = x ;
8
T->i [T->nz] = i ;
9
T->p [T->nz++] = j ;
10
T->m =
CS_MAX
(T->m, i+1) ;
11
T->n =
CS_MAX
(T->n, j+1) ;
12
return
(1) ;
13
}
cs
#define cs
Definition:
cs.h:637
CS_ENTRY
#define CS_ENTRY
Definition:
cs.h:635
CS_MAX
#define CS_MAX(a, b)
Definition:
cs.h:653
cs.h
CS_INT
#define CS_INT
Definition:
cs.h:627
cs_sprealloc
CS_INT cs_sprealloc(cs *A, CS_INT nzmax)
Definition:
cs_util.c:18
CS_TRIPLET
#define CS_TRIPLET(A)
Definition:
cs.h:660
cs_entry
CS_INT cs_entry(cs *T, CS_INT i, CS_INT j, CS_ENTRY x)
Definition:
cs_entry.c:3
Generated by
1.8.6