MCPcopy Create free account
hub / github.com/avaneev/biteopt / calcTridiagonalMatrix

Function calcTridiagonalMatrix

tests/testfn.h:3676–3692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3674 0.0, &calcHilbert, NULL };
3675
3676static double calcTridiagonalMatrix( const double* const x, const int N )
3677{
3678 double s = sqr(x[0]);
3679 int i;
3680
3681 for( i = 1; i < N; i++ )
3682 {
3683 s += 2.0*sqr(x[i]);
3684 }
3685
3686 for( i = 1; i < N; i++ )
3687 {
3688 s -= 2.0*x[i-1]*x[i];
3689 }
3690
3691 return( s - 2.0*x[0] );
3692}
3693
3694static void calcTridiagonalMatrix_p( double* const minv, double* const maxv,
3695 const int N, double* const optv )

Callers

nothing calls this directly

Calls 1

sqrFunction · 0.85

Tested by

no test coverage detected