![]() |
Rosetta
2019.07
|
#include <SVD_Solver.hh>
Public Member Functions | |
~SVD_Solver () | |
SVD_Solver (platform::Size const M, platform::Size const N) | |
M is the size of vector b (experimental data); N is the size of the vector to optimize M >= N. More... | |
SVD_Solver & | operator= (SVD_Solver const &other) |
SVD_Solver (SVD_Solver const &other) | |
void | set_vector_b (utility::vector1< double > const &b) |
set the vector b of Ax=b More... | |
void | set_matrix_A (utility::vector1< utility::vector1< double > > const &A) |
set the matrix A of Ax=b More... | |
void | set_vector_b (ObjexxFCL::FArray1D< double > const &b) |
set the vector b of Ax=b (ObjexxFCL::FArray1D version) More... | |
void | set_matrix_A (ObjexxFCL::FArray2D< double > const &A) |
set the matrix A of Ax=b (ObjexxFCL::FArray2D version) More... | |
void | run_decomp_svd () |
decompose the matrix A. Can be called after the matrix A and vector b are set (with set_matrix_A and set_vector_b) More... | |
void | run_solve_svd () |
minimize the cost sqrt( ||A x - b||^2 ) (but doesn't calculate it) Can be called after run_decomp_svd() More... | |
double | run_score_svd_on_matrix (utility::vector1< utility::vector1< double > > const &cppstyle_A) const |
return the score given the matrix A Can be called after run_decomp_svd() More... | |
double | run_score_svd_on_matrix (ObjexxFCL::FArray2D< double > const &A) const |
return the score given the matrix A (ObjexxFCL::FArray2D version) Can be called after run_decomp_svd() More... | |
double | run_score_svd_without_solving () |
return the minimzed score without the need to call run_solve_svd() Can be called after run_decomp_svd() More... | |
utility::vector1< double > const & | get_svd_solution () const |
return the vector x that minimize ||Ax - b||^2 Can be called after run_solve_svd() More... | |
Private Member Functions | |
double | pythag (double const &a, double const &b) const |
void | svdcmp () |
void | svbksb () |
SVD_Solver () | |
|
default |
basic::svd::SVD_Solver::SVD_Solver | ( | platform::Size const | M, |
platform::Size const | N | ||
) |
M is the size of vector b (experimental data); N is the size of the vector to optimize M >= N.
References test.T007_TracerIO::M, and utility_exit_with_message.
|
default |
|
private |
utility::vector1< double > const & basic::svd::SVD_Solver::get_svd_solution | ( | ) | const |
return the vector x that minimize ||Ax - b||^2 Can be called after run_solve_svd()
Return the optimized vector x. Can be called only when ||Ax-b||^2 has been minimized.
References utility_exit_with_message.
SVD_Solver & basic::svd::SVD_Solver::operator= | ( | SVD_Solver const & | other | ) |
References A_is_decomp_, A_is_set_, b_is_set_, cstyle_A_decomp_, cstyle_b_, cstyle_tmp_, cstyle_v_, cstyle_w_, cstyle_x_, M_, N_, utility_exit_with_message, and x_is_solved_.
|
private |
References ObjexxFCL::abs(), and numeric::linear_algebra::pythag().
void basic::svd::SVD_Solver::run_decomp_svd | ( | ) |
decompose the matrix A. Can be called after the matrix A and vector b are set (with set_matrix_A and set_vector_b)
Decomposition of the matrix A. Can be called only when A is set. You can't decompose twice in a row without reseting the matrix A.
References numeric::linear_algebra::svdcmp(), and utility_exit_with_message.
double basic::svd::SVD_Solver::run_score_svd_on_matrix | ( | utility::vector1< utility::vector1< double > > const & | cppstyle_A | ) | const |
return the score given the matrix A Can be called after run_decomp_svd()
Return the score SQRT(||Ax-b||^2). Can be called only when ||Ax-b||^2 has been minimized. You need the give the original A matrix as argument.
References basic::options::OptionKeys::frags::j, erraser_single_res_analysis::score, erraser_analysis::temp, and utility_exit_with_message.
double basic::svd::SVD_Solver::run_score_svd_on_matrix | ( | ObjexxFCL::FArray2D< double > const & | A | ) | const |
return the score given the matrix A (ObjexxFCL::FArray2D version) Can be called after run_decomp_svd()
Return the score SQRT(||Ax-b||^2). Can be called only when ||Ax-b||^2 has been minimized. You need the give the original A matrix as argument.
References ObjexxFCL::format::A(), basic::options::OptionKeys::frags::j, erraser_single_res_analysis::score, erraser_analysis::temp, and utility_exit_with_message.
double basic::svd::SVD_Solver::run_score_svd_without_solving | ( | ) |
return the minimzed score without the need to call run_solve_svd() Can be called after run_decomp_svd()
Attempt to speed up calculation of the cost without actually solving Ax = b The routine works, but is not faster (nor slower)
References basic::options::OptionKeys::frags::j, erraser_single_res_analysis::score, erraser_analysis::temp, and utility_exit_with_message.
void basic::svd::SVD_Solver::run_solve_svd | ( | ) |
minimize the cost sqrt( ||A x - b||^2 ) (but doesn't calculate it) Can be called after run_decomp_svd()
Minimize ||Ax - b||^2. Can be called only when b is set and A is decomposed. You are allowed to update the vector b and minimize again.
References utility_exit_with_message.
void basic::svd::SVD_Solver::set_matrix_A | ( | utility::vector1< utility::vector1< double > > const & | A | ) |
set the matrix A of Ax=b
To minimize ||Ax - b||^2, you need to set the matrix A.
References ObjexxFCL::format::A(), basic::options::OptionKeys::frags::j, ObjexxFCL::size(), and utility_exit_with_message.
void basic::svd::SVD_Solver::set_matrix_A | ( | ObjexxFCL::FArray2D< double > const & | A | ) |
set the matrix A of Ax=b (ObjexxFCL::FArray2D version)
To minimize ||Ax - b||^2, you need to set the matrix A.
References ObjexxFCL::format::A(), basic::options::OptionKeys::frags::j, ObjexxFCL::FArray< typename >::size(), and utility_exit_with_message.
void basic::svd::SVD_Solver::set_vector_b | ( | utility::vector1< double > const & | b | ) |
set the vector b of Ax=b
To minimize ||Ax - b||^2, you need to set the vector b.
References utility_exit_with_message.
void basic::svd::SVD_Solver::set_vector_b | ( | ObjexxFCL::FArray1D< double > const & | b | ) |
set the vector b of Ax=b (ObjexxFCL::FArray1D version)
To minimize ||Ax - b||^2, you need to set the vector b.
References basic::options::OptionKeys::score::fiber_diffraction::b, ObjexxFCL::FArray< typename >::size(), and utility_exit_with_message.
|
private |
|
private |
References ObjexxFCL::abs(), demo.D060_Folding::f, basic::options::OptionKeys::frags::j, basic::options::OptionKeys::in::file::l, max(), min(), numeric::linear_algebra::pythag(), basic::options::OptionKeys::in::file::s, ObjexxFCL::sign(), utility_exit_with_message, numeric::crick_equations::x(), numeric::crick_equations::y(), and numeric::crick_equations::z().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().
|
private |
Referenced by operator=().