Go to the documentation of this file.
20 #ifndef BLITZ_LU_SOLVE_INTERFACE_HH
21 #define BLITZ_LU_SOLVE_INTERFACE_HH
23 #include "blitz/array.h"
26 BZ_USING_NAMESPACE(blitz)
59 for (
int j=col_start ;
j<col_end+1 ;
j++){
77 for (
int j=col_start ;
j<col_end+1 ;
j++){
90 ASSERT( LU.rows()==LU.cols() ) ;
97 for(
int i=0;
i<
N;
i++ ) {
99 for(
int j=0;
j<
N;
j++ ) {
103 INFOS(
"blitz_LU_factor::Singular matrix" ) ;
106 ImplicitScaling(
i ) = 1./
big ;
109 for(
int j=0;
j<
N;
j++ ) {
110 for(
int i=0;
i<
j;
i++ ) {
111 theSum = LU(
i,
j ) ;
114 LU(
i,
j ) = theSum ;
119 for(
int i=
j;
i<
N;
i++ ) {
120 theSum = LU(
i,
j ) ;
123 LU(
i,
j ) = theSum ;
124 if( (ImplicitScaling(
i )*
abs( theSum ))>=
big ) {
125 dum = ImplicitScaling(
i )*
abs( theSum ) ;
132 for(
int k=0; k<
N; k++ ) {
133 dum = LU( index_max, k ) ;
134 LU( index_max, k ) = LU(
j, k ) ;
137 ImplicitScaling( index_max ) = ImplicitScaling(
j ) ;
139 pivot(
j ) = index_max ;
140 if ( LU(
j,
j )==0. ) LU(
j,
j ) = 1.e-20 ;
143 dum = 1./LU(
j,
j ) ;
144 for(
int i=
j+1;
i<
N;
i++ ) LU(
i,
j ) *= dum ;
155 ASSERT( LU.rows()==LU.cols() ) ;
160 for(
int i=0;
i<
N;
i++ ) {
161 int ip = pivot(
i ) ;
170 }
else if( theSum ) {
177 for(
int i=
N-1;
i>=0;
i-- ) {
184 X(
i ) = theSum/LU(
i,
i ) ;
blitz_interface< real >::gene_vector gene_vector
static real matrix_vector_product_sliced(const gene_matrix &A, gene_vector B, int row, int col_start, int col_end)
blitz::Array< real, 1 > gene_vector
static void new_Pivot_Vector(Pivot_Vector &pivot, int N)
static void LU_factor(gene_matrix &LU, Pivot_Vector &pivot, int N)
blitz::Array< int, 1 > Pivot_Vector
#define ASSERT(expression)
static void free_Pivot_Vector(Pivot_Vector &pivot)
static real matrix_matrix_product_sliced(gene_matrix &A, int row, int col_start, int col_end, gene_matrix &B, int row_shift, int col)
blitz_interface< real >::gene_matrix gene_matrix
static void LU_solve(const gene_matrix &LU, const Pivot_Vector pivot, gene_vector &B, gene_vector X, int N)
blitz::Array< real, 2 > gene_matrix
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:02