52 #include <AztecOO_config.h> 53 #include <Epetra_MpiComm.h> 54 #include <Epetra_ConfigDefs.h> 55 #include <Epetra_Map.h> 56 #include <Epetra_CrsMatrix.h> 57 #include <Epetra_Vector.h> 58 #include <Epetra_MultiVector.h> 59 #include <Epetra_Import.h> 60 #include <Epetra_LinearProblem.h> 61 #include <EpetraExt_MatrixMatrix.h> 64 #include <Amesos_BaseSolver.h> 65 #include <eigen/Eigen/Dense> 66 #include "parameters/all_parameters.h" 67 #include "reduced_order/multi_core_helper_functions.h" 83 const dealii::ParameterHandler ¶meter_handler_input,
84 const Epetra_CrsMatrix &A,
91 const dealii::ParameterHandler ¶meter_handler_input,
92 const Epetra_CrsMatrix &A,
93 const bool is_input_A_matrix_transposed,
100 const dealii::ParameterHandler ¶meter_handler_input,
101 const Epetra_CrsMatrix &A,
102 Epetra_MpiComm &Comm,
104 bool grad_exit_crit);
109 const dealii::ParameterHandler ¶meter_handler_input,
110 const Epetra_CrsMatrix &A,
111 const bool is_input_A_matrix_transposed,
112 Epetra_MpiComm &Comm,
114 bool grad_exit_crit);
119 const dealii::ParameterHandler ¶meter_handler_input,
120 const Epetra_CrsMatrix &A,
121 Epetra_MpiComm &Comm,
130 const dealii::ParameterHandler ¶meter_handler_input,
131 const Epetra_CrsMatrix &A,
132 const bool is_input_A_matrix_transposed,
133 Epetra_MpiComm &Comm,
142 const dealii::ParameterHandler ¶meter_handler_input,
143 const Epetra_CrsMatrix &A,
144 const bool is_input_A_matrix_transposed,
145 Epetra_MpiComm &Comm,
163 Epetra_Vector start_single_core = allocate_vector_to_single_core(start);
177 const Epetra_CrsMatrix
A_;
221 void add_into_x(Epetra_Vector &temp,
double alpha);
std::vector< bool > Z
Vector of booleans representing the columns in the active set.
const dealii::ParameterHandler & parameter_handler
Parameter handler for storing the .prm file being ran.
Epetra_Vector & get_solution()
Returns protected approximate solution.
void move_to_active_set(int idx)
Moves the column at idx into the active set (updating the index_set, Z, P, and numInactive_) ...
std::vector< bool > P
Vector of boolean representing the columns in the inactive set.
const bool is_input_A_matrix_transposed_
Files for the baseline physics.
Main parameter class that contains the various other sub-parameter classes.
const Epetra_CrsMatrix A_
Epetra Matrix A allocated to a single core.
bool iter_solver_
Boolean used for iterative solvers.
Epetra_MpiComm Comm_
Epetra Commuicator Object with MPI.
Eigen::VectorXd index_set
Eigen Vector of the index_set.
Epetra_Vector multi_x_
Epetra_Vector x, to be solved. Allocated to multiple cores.
void sub_into_x(Epetra_Vector &temp)
Replaces the entries with x with the values in temp.
int LS_iter_
Needed if the an iterative solver is used.
int iter_
Number of iterations in the NNLS solver.
void move_to_inactive_set(int idx)
Moves the column at idx into the inactive set (updating the index_set, Z, P, and numInactive_) ...
NNLSSolver(const Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input, const Epetra_CrsMatrix &A, Epetra_MpiComm &Comm, Epetra_Vector &b)
Default Constructor.
bool grad_exit_crit_
Boolean to use an exit Condition depending on maximum gradent.
int numInactive_
Number of inactive points.
double LS_tol_
Needed if the an iterative solver is used.
Epetra_Vector x_
Epetra Vector x, to be solved. Allocated to a single core.
bool solve()
Call to solve NNLS problem.
Epetra_Vector b_
Epetra Vector b allocated to a single core.
void starting_solution(Epetra_Vector &start)
Initiliazes the solution vector, must be used before .solve is called.
void positive_set_matrix(Epetra_CrsMatrix &P_mat)
Creates a matrix using the columns in A in the set P.
void epetra_permutation_matrix(Epetra_CrsMatrix &P_mat)
Creates square permutation matrix based off the active/inactive set, no longer in use...
void add_into_x(Epetra_Vector &temp, double alpha)
Adds the values of temp times alpha into the solution vector x.
const Parameters::AllParameters *const all_parameters
Pointer to all parameters.