From 89afd70e622d03bca4e4189ada72d602b7070992 Mon Sep 17 00:00:00 2001 From: "ulrich.bauer@gmail.com" Date: Mon, 29 Apr 2013 11:41:20 +0000 Subject: alpha shapes git-svn-id: https://phat.googlecode.com/svn/trunk@46 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d --- include/phat/helpers/dualize.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/phat/helpers') 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,8 +31,21 @@ 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++) -- cgit v1.2.3