File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -76,35 +76,34 @@ inline double inv_Phi_lambda(double p) {
76
76
return 0 ;
77
77
}
78
78
79
- double val;
80
79
double inner_r;
81
80
double pre_mult;
82
- using Vector8d = Eigen::Matrix<double , 8 , 1 >;
83
- Eigen::Map<const Vector8d> numerator_map (NULL );
84
- Eigen::Map<const Vector8d> denonimator_map (NULL );
81
+ const double * num_ptr;
82
+ const double * den_ptr;
85
83
86
84
if (std::fabs (q) <= .425 ) {
87
85
inner_r = .180625 - square (q);
88
86
pre_mult = q;
89
87
90
- new (&numerator_map) Eigen::Map< const Vector8d>(a, 8 ) ;
91
- new (&denonimator_map) Eigen::Map< const Vector8d>(b, 8 ) ;
88
+ num_ptr = &a[ 0 ] ;
89
+ den_ptr = &b[ 0 ] ;
92
90
} else {
93
-
94
91
double temp_r = std::sqrt (-std::log (r));
95
92
if (temp_r <= 5.0 ) {
96
93
inner_r = temp_r - 1.6 ;
97
- new (&numerator_map) Eigen::Map< const Vector8d>(c, 8 ) ;
98
- new (&denonimator_map) Eigen::Map< const Vector8d>(d, 8 ) ;
94
+ num_ptr = &c[ 0 ] ;
95
+ den_ptr = &d[ 0 ] ;
99
96
} else {
100
97
inner_r = temp_r - 5.0 ;
101
- new (&numerator_map) Eigen::Map< const Vector8d>(e, 8 ) ;
102
- new (&denonimator_map) Eigen::Map< const Vector8d>(f, 8 ) ;
98
+ num_ptr = &e[ 0 ] ;
99
+ den_ptr = &f[ 0 ] ;
103
100
}
104
101
pre_mult = q < 0 ? -1 : 1 ;
105
102
}
106
103
107
104
Eigen::VectorXd r_pow = pow (inner_r, Eigen::ArrayXd::LinSpaced (8 , 0 , 7 )) / 10.0 ;
105
+ Eigen::Map<const Eigen::VectorXd> numerator_map (num_ptr, 8 );
106
+ Eigen::Map<const Eigen::VectorXd> denonimator_map (den_ptr, 8 );
108
107
return pre_mult * (numerator_map.dot (r_pow) * 10.0 ) / (denonimator_map.dot (r_pow) * 10.0 );
109
108
}
110
109
} // namespace internal
You can’t perform that action at this time.
0 commit comments