CMR  1.3.0
Loading...
Searching...
No Matches
linear_algebra_internal.h
Go to the documentation of this file.
1#ifndef CMR_LINALG_INTERNAL_H
2#define CMR_LINALG_INTERNAL_H
3
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10static inline
11int moduloNonnegative(int p, int q)
12{
13 if (q == 0)
14 return p;
15 if (q < 0)
16 q = -q;
17 int r = p % q;
18 if (r < 0)
19 r += q;
20 return r;
21}
22
23static inline
24int moduloTernary(int p, int q)
25{
26 if (q == 0)
27 return p;
28 if (q < 0)
29 q = -q;
30 int r = p % q;
31 if (r < 0)
32 r += q;
33 return (r == 2 && q == 3) ? -1 : r;
34}
35
47 CMR* cmr,
48 CMR_INTMAT* matrix,
49 bool invert,
50 size_t* prank,
51 CMR_SUBMAT** ppermutations,
53 CMR_INTMAT** presult,
54 CMR_INTMAT** ptranspose
55);
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* CMR_LINALG_INTERNAL_H */
CMR_ERROR
Type for return codes of library functions.
Definition env.h:32
static int moduloTernary(int p, int q)
Definition linear_algebra_internal.h:24
CMR_ERROR CMRintmatComputeUpperDiagonal(CMR *cmr, CMR_INTMAT *matrix, bool invert, size_t *prank, CMR_SUBMAT **ppermutations, CMR_INTMAT **presult, CMR_INTMAT **ptranspose)
Transforms matrix into a new matrix by applying integer row operations and row- and column swaps to f...
Definition linear_algebra.c:569
static int moduloNonnegative(int p, int q)
Definition linear_algebra_internal.h:11
Definition env_internal.h:45
Row-wise representation of sparse int matrix.
Definition matrix.h:211
Row and column indices for a submatrix.
Definition matrix.h:28