Skip to content

Commit

Permalink
Squashed 'moose-core/' changes from 6099142d6..ef066f704
Browse files Browse the repository at this point in the history
ef066f704 Fixes to violation of mass-conservation when Dsolve and Gsolve run for very long time (#176)
46ea47260 Local Documentation (#177)
852819875 Added connectionList field to SparseMsg to allow direct control over connection matrix. Some sanity checks in SparseMatrix to go with this.

git-subtree-dir: moose-core
git-subtree-split: ef066f70493fe05fe05393af48449b264c8f4bc0
  • Loading branch information
Dilawar Singh committed Apr 26, 2017
1 parent cc8759c commit 0f6f5d2
Show file tree
Hide file tree
Showing 7 changed files with 1,036 additions and 736 deletions.
2 changes: 1 addition & 1 deletion CheckCXXCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(COMPILER_SUPPORTS_CXX11)
elseif(COMPILER_SUPPORTS_CXX0X)
message(STATUS "Your compiler supports c++0x features. Enabling it")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
add_definitions( -DENABLE_CXX11 )
add_definitions( -DENABLE_CPP11 )
add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_NO_SCOPED_ENUMS )
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
Expand Down
26 changes: 15 additions & 11 deletions basecode/SparseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ template < class T > class SparseMatrix

void tripletFill( const vector< unsigned int >& row,
const vector< unsigned int >& col,
const vector< T >& z )
const vector< T >& z, bool retainSize = false )
{
unsigned int len = row.size();
if ( len > col.size() ) len = col.size();
Expand All @@ -591,16 +591,20 @@ template < class T > class SparseMatrix
for ( unsigned int i = 0; i < len; ++i )
trip[i]= Triplet< T >(z[i], row[i], col[i] );
sort( trip.begin(), trip.end(), Triplet< T >::cmp );
unsigned int nr = trip.back().b_ + 1;
unsigned int nc = 0;
for ( typename vector< Triplet< T > >::iterator i =
trip.begin(); i != trip.end(); ++i )
{
if ( nc < i->c_ )
nc = i->c_;
}
nc++;
setSize( nr, nc );
unsigned int nr = nrows_;
unsigned int nc = ncolumns_;
if ( !retainSize ) {
nr = trip.back().b_ + 1;
nc = 0;
for ( typename vector< Triplet< T > >::iterator i =
trip.begin(); i != trip.end(); ++i )
{
if ( nc < i->c_ )
nc = i->c_;
}
nc++;
}
setSize( nr, nc );

vector< unsigned int > colIndex( nc );
vector< T > entry( nc );
Expand Down
Loading

0 comments on commit 0f6f5d2

Please sign in to comment.