summaryrefslogtreecommitdiff
path: root/include/phat/helpers
diff options
context:
space:
mode:
authorjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-06-07 12:41:23 +0000
committerjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-06-07 12:41:23 +0000
commitbf64faab7dd9da8683484971a64c6c87f40a89a3 (patch)
treee06b71e240c3820c776f973ccecdd34982bc0ece /include/phat/helpers
parent8fa5020a3710161bb0ddfda1b9003a369b3b2174 (diff)
performance improvements through OpenMP
git-svn-id: https://phat.googlecode.com/svn/trunk@88 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'include/phat/helpers')
-rw-r--r--include/phat/helpers/dualize.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/phat/helpers/dualize.h b/include/phat/helpers/dualize.h
index e3ae9ed..3ffedf8 100644
--- a/include/phat/helpers/dualize.h
+++ b/include/phat/helpers/dualize.h
@@ -40,13 +40,13 @@ namespace phat {
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
boundary_matrix.get_col( cur_col, temp_col );
for( index idx = 0; idx < (index)temp_col.size(); idx++)
- dual_sizes[ nr_of_columns - 1 - temp_col[ idx ] ]++;
+ dual_sizes[ nr_of_columns - 1 - temp_col[ idx ] ]++;
}
- for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
+ #pragma omp parallel for
+ for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
dual_matrix[cur_col].reserve(dual_sizes[cur_col]);
- }
-
+
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ ) {
boundary_matrix.get_col( cur_col, temp_col );
for( index idx = 0; idx < (index)temp_col.size(); idx++)
@@ -54,9 +54,11 @@ namespace phat {
}
const dimension max_dim = boundary_matrix.get_max_dim();
+ #pragma omp parallel for
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
dual_dims[ nr_of_columns - 1 - cur_col ] = max_dim - boundary_matrix.get_dim( cur_col );
+ #pragma omp parallel for
for( index cur_col = 0; cur_col < nr_of_columns; cur_col++ )
std::reverse( dual_matrix[ cur_col ].begin(), dual_matrix[ cur_col ].end() );