Mercurial > hg > CbC > CbC_gcc
comparison gcc/lambda-mat.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
25 #include "ggc.h" | 25 #include "ggc.h" |
26 #include "tree.h" | 26 #include "tree.h" |
27 #include "tree-flow.h" | 27 #include "tree-flow.h" |
28 #include "lambda.h" | 28 #include "lambda.h" |
29 | 29 |
30 static void lambda_matrix_get_column (lambda_matrix, int, int, | 30 static void lambda_matrix_get_column (lambda_matrix, int, int, |
31 lambda_vector); | 31 lambda_vector); |
32 | 32 |
33 /* Allocate a matrix of M rows x N cols. */ | 33 /* Allocate a matrix of M rows x N cols. */ |
34 | 34 |
35 lambda_matrix | 35 lambda_matrix |
37 { | 37 { |
38 lambda_matrix mat; | 38 lambda_matrix mat; |
39 int i; | 39 int i; |
40 | 40 |
41 mat = GGC_NEWVEC (lambda_vector, m); | 41 mat = GGC_NEWVEC (lambda_vector, m); |
42 | 42 |
43 for (i = 0; i < m; i++) | 43 for (i = 0; i < m; i++) |
44 mat[i] = lambda_vector_new (n); | 44 mat[i] = lambda_vector_new (n); |
45 | 45 |
46 return mat; | 46 return mat; |
47 } | 47 } |
316 { | 316 { |
317 int a, b, c, d, det; | 317 int a, b, c, d, det; |
318 a = mat[0][0]; | 318 a = mat[0][0]; |
319 b = mat[1][0]; | 319 b = mat[1][0]; |
320 c = mat[0][1]; | 320 c = mat[0][1]; |
321 d = mat[1][1]; | 321 d = mat[1][1]; |
322 inv[0][0] = d; | 322 inv[0][0] = d; |
323 inv[0][1] = -c; | 323 inv[0][1] = -c; |
324 inv[1][0] = -b; | 324 inv[1][0] = -b; |
325 inv[1][1] = a; | 325 inv[1][1] = a; |
326 det = (a * d - b * c); | 326 det = (a * d - b * c); |
481 } | 481 } |
482 | 482 |
483 /* Given an M x N integer matrix A, this function determines an M x | 483 /* Given an M x N integer matrix A, this function determines an M x |
484 M unimodular matrix U, and an M x N echelon matrix S such that | 484 M unimodular matrix U, and an M x N echelon matrix S such that |
485 "U.A = S". This decomposition is also known as "right Hermite". | 485 "U.A = S". This decomposition is also known as "right Hermite". |
486 | 486 |
487 Ref: Algorithm 2.1 page 33 in "Loop Transformations for | 487 Ref: Algorithm 2.1 page 33 in "Loop Transformations for |
488 Restructuring Compilers" Utpal Banerjee. */ | 488 Restructuring Compilers" Utpal Banerjee. */ |
489 | 489 |
490 void | 490 void |
491 lambda_matrix_right_hermite (lambda_matrix A, int m, int n, | 491 lambda_matrix_right_hermite (lambda_matrix A, int m, int n, |
526 } | 526 } |
527 | 527 |
528 /* Given an M x N integer matrix A, this function determines an M x M | 528 /* Given an M x N integer matrix A, this function determines an M x M |
529 unimodular matrix V, and an M x N echelon matrix S such that "A = | 529 unimodular matrix V, and an M x N echelon matrix S such that "A = |
530 V.S". This decomposition is also known as "left Hermite". | 530 V.S". This decomposition is also known as "left Hermite". |
531 | 531 |
532 Ref: Algorithm 2.2 page 36 in "Loop Transformations for | 532 Ref: Algorithm 2.2 page 36 in "Loop Transformations for |
533 Restructuring Compilers" Utpal Banerjee. */ | 533 Restructuring Compilers" Utpal Banerjee. */ |
534 | 534 |
535 void | 535 void |
536 lambda_matrix_left_hermite (lambda_matrix A, int m, int n, | 536 lambda_matrix_left_hermite (lambda_matrix A, int m, int n, |