Skip to content

Commit 4f40588

Browse files
authored
move old code into old-code-folder (#68)
* move old code into old-code-folder * new folder structure
1 parent a70fcf8 commit 4f40588

File tree

139 files changed

+911
-937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+911
-937
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include "subexpr.h"
2323
#include "utils/CSR_Matrix.h"
2424

25-
expr *new_linear(expr *u, const CSR_Matrix *A, const double *b);
26-
2725
expr *new_add(expr *left, expr *right);
2826
expr *new_neg(expr *child);
2927

File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*/
18-
#ifndef OTHER_H
19-
#define OTHER_H
18+
#ifndef NON_ELEMENTWISE_FULL_DOM_H
19+
#define NON_ELEMENTWISE_FULL_DOM_H
2020

2121
#include "expr.h"
2222
#include "subexpr.h"
@@ -33,4 +33,4 @@ expr *new_prod_axis_zero(expr *child);
3333
/* product of entries along axis=1 (rowwise products) */
3434
expr *new_prod_axis_one(expr *child);
3535

36-
#endif /* OTHER_H */
36+
#endif /* NON_ELEMENTWISE_FULL_DOM_H */

include/bivariate.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

include/old-code/old_CSR.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#ifndef OLD_CSR_H
2+
#define OLD_CSR_H
3+
4+
#include "utils/CSR_Matrix.h"
5+
6+
/* Build (I_p kron A) = blkdiag(A, A, ..., A) of size (p*A->m) x (p*A->n) */
7+
CSR_Matrix *block_diag_repeat_csr(const CSR_Matrix *A, int p);
8+
9+
/* Build (A kron I_p) of size (A->m * p) x (A->n * p) with nnz = A->nnz * p. */
10+
CSR_Matrix *kron_identity_csr(const CSR_Matrix *A, int p);
11+
12+
/* Computes values of the row matrix C = z^T A (column indices must have been
13+
pre-computed) and transposed matrix AT must be provided) */
14+
void Ax_csr_fill_values(const CSR_Matrix *AT, const double *z, CSR_Matrix *C);
15+
16+
/* Insert value into CSR matrix A with just one row at col_idx. Assumes that A
17+
has enough space and that A does not have an element at col_idx. It does update
18+
nnz. */
19+
void csr_insert_value(CSR_Matrix *A, int col_idx, double value);
20+
21+
/* Compute C = diag(d) * A where d is an array and A, C are CSR matrices
22+
* d must have length m
23+
* C must be pre-allocated with same dimensions as A */
24+
void diag_csr_mult(const double *d, const CSR_Matrix *A, CSR_Matrix *C);
25+
26+
/* y = Ax, where y is returned as dense (no column offset) */
27+
void Ax_csr_wo_offset(const CSR_Matrix *A, const double *x, double *y);
28+
29+
#endif /* OLD_CSR_H */

include/old-code/old_CSR_sum.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#ifndef OLD_CSR_SUM_H
2+
#define OLD_CSR_SUM_H
3+
4+
#include "utils/CSR_Matrix.h"
5+
6+
/* Compute C = A + B where A, B, C are CSR matrices
7+
* A and B must have same dimensions
8+
* C must be pre-allocated with sufficient nnz capacity.
9+
* C must be different from A and B */
10+
void sum_csr_matrices(const CSR_Matrix *A, const CSR_Matrix *B, CSR_Matrix *C);
11+
12+
/* Compute C = diag(d1) * A + diag(d2) * B where A, B, C are CSR matrices */
13+
void sum_scaled_csr_matrices(const CSR_Matrix *A, const CSR_Matrix *B, CSR_Matrix *C,
14+
const double *d1, const double *d2);
15+
16+
/* forward declaration */
17+
struct int_double_pair;
18+
19+
/* Sum all rows of A into a single row matrix C */
20+
void sum_all_rows_csr(const CSR_Matrix *A, CSR_Matrix *C,
21+
struct int_double_pair *pairs);
22+
23+
/* Sum blocks of rows of A into a matrix C */
24+
void sum_block_of_rows_csr(const CSR_Matrix *A, CSR_Matrix *C,
25+
struct int_double_pair *pairs, int row_block_size);
26+
27+
/* Sum evenly spaced rows of A into a matrix C */
28+
void sum_evenly_spaced_rows_csr(const CSR_Matrix *A, CSR_Matrix *C,
29+
struct int_double_pair *pairs, int row_spacing);
30+
31+
/* Sum evenly spaced rows of A starting at offset into a row matrix C */
32+
void sum_spaced_rows_into_row_csr(const CSR_Matrix *A, CSR_Matrix *C,
33+
struct int_double_pair *pairs, int offset,
34+
int spacing);
35+
36+
/* Fill values of summed rows using precomputed idx_map and sparsity of C */
37+
void sum_all_rows_csr_fill_values(const CSR_Matrix *A, CSR_Matrix *C,
38+
const int *idx_map);
39+
40+
/* Fill values of summed block rows using precomputed idx_map */
41+
void sum_block_of_rows_csr_fill_values(const CSR_Matrix *A, CSR_Matrix *C,
42+
const int *idx_map);
43+
44+
#endif /* OLD_CSR_SUM_H */

include/old-code/old_affine.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef OLD_AFFINE_H
2+
#define OLD_AFFINE_H
3+
4+
#include "expr.h"
5+
#include "utils/CSR_Matrix.h"
6+
7+
expr *new_linear(expr *u, const CSR_Matrix *A, const double *b);
8+
9+
#endif /* OLD_AFFINE_H */

0 commit comments

Comments
 (0)