2
0
mirror of https://github.com/boostorg/odeint.git synced 2026-01-19 04:22:12 +00:00

Merge pull request #102 from LegalizeAdulthood/legalize-95

Don't increment iterators beyond the end of the state vector
This commit is contained in:
Matt Borland
2025-12-02 13:07:44 +01:00
committed by GitHub

View File

@@ -55,11 +55,11 @@ void gram_schmidt( StateType &x , LyapType &lyap , size_t n )
norm[0] = sqrt( std::inner_product( beg1 , end1 , beg1 , 0.0 ) );
normalize( beg1 , end1 , norm[0] );
for( size_t j=1 ; j<num_of_lyap ; ++j )
{
beg1 += n;
end1 += n;
for( size_t j=1 ; j<num_of_lyap ; ++j , beg1+=n , end1+=n )
{
for( size_t k=0 ; k<j ; ++k )
{
tmp[k] = std::inner_product( beg1 , end1 , first + k*n , 0.0 );