#include <iostream>
#include "CLHEP/Matrix/SymMatrix.h"
Go to the source code of this file.
◆ Ext_err_valid() [1/2]
bool Ext_err_valid |
( |
bool |
msg, |
|
|
const HepSymMatrix & |
error, |
|
|
const int |
dimension |
|
) |
| |
Definition at line 92 of file Ext_err_valid.cxx.
93{
94 bool valid( 1 );
95 double trace( 0 );
96
97 for( int i = 1; i<=dimension; i++ ){
98 double elem(
error( i, i ) );
99 trace += elem;
100 if( elem < 0.0 ){
101 valid = 0;
102 if( msg ){
103 std::cout << "%ERROR detected at Ext_err_valid: error matrix: error("
104 << i << "," << i << ")= " << elem << " < 0.0." << std::endl;
105 }
106 } else if( elem > Large ){
107 valid = 0;
108 if( msg ){
109 std::cout << "%ERROR detected at Ext_err_valid: error matrix: error("
110 << i << "," << i << ")= " << elem << " > " << Large << std::endl;
111 }
112 }
113 }
114 if( !trace ) valid = 0;
115 return( valid );
116}
◆ Ext_err_valid() [2/2]
bool Ext_err_valid |
( |
bool |
msg, |
|
|
HepSymMatrix & |
error, |
|
|
const int |
dimension |
|
) |
| |
Definition at line 58 of file Ext_err_valid.cxx.
59{
60 bool valid( 1 );
61 double trace( 0 );
62
63 for( int i = 1; i<=dimension; i++ ){
64 double elem(
error( i, i ) );
65 trace += elem;
66 if( elem < 0.0 ){
67 valid = 0;
68 if( msg ){
69 std::cout << "%ERROR detected at Ext_err_valid: error("
70 << i << "," << i << ") = " << elem << " < 0.0. "
71 << "Force to 0.0." << std::endl;
72 }
74 } else if( elem > Large ){
75 valid = 0;
76 if( msg ){
77 std::cout << "%ERROR detected at Ext_err_valid: error("
78 << i << "," << i << ") = " << elem << " > " << Large
79 << ". Force to " << Large << std::endl;
80 }
81 error( i, i ) = Large;
82 }
83 }
84 if( !trace ) valid = 0;
85 return( valid );
86}
Referenced by Ext_errmx::valid().