summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorulrich.bauer@gmail.com <ulrich.bauer@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-29 11:41:20 +0000
committerulrich.bauer@gmail.com <ulrich.bauer@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-29 11:41:20 +0000
commit89afd70e622d03bca4e4189ada72d602b7070992 (patch)
tree9e702745bf6dc2103968a5296ac5dee8b8b8f586 /include
parent5b3c289e9a16218061a0ff609c1bbf6f32ee7d4d (diff)
alpha shapes
git-svn-id: https://phat.googlecode.com/svn/trunk@46 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'include')
-rw-r--r--include/phat/helpers/dualize.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/phat/helpers/dualize.h b/include/phat/helpers/dualize.h
index 752103d..5f9a05c 100644
--- a/include/phat/helpers/dualize.h
+++ b/include/phat/helpers/dualize.h
@@ -31,11 +31,24 @@ namespace phat {
index nr_of_columns = boundary_matrix.get_num_cols();
dual_matrix.resize( nr_of_columns );
dual_dims.resize( nr_of_columns );
+
+ std::vector< dimension >& dual_sizes = dual_dims;
+
column temp_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++)
+ dual_sizes[ nr_of_columns - 1 - temp_col[ idx ] ]++;
+ }
+
+ 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++)
dual_matrix[ nr_of_columns - 1 - temp_col[ idx ] ].push_back( nr_of_columns - 1 - cur_col );
}