55 namespace AbstractLinAlgPack {
62 new Teuchos::AbstractFactoryStd<
MatrixSymOp,MatrixSymPosDefCholFactor>())
143 *out <<
"\nUsing a direct sparse solver to update basis ...\n";
148 const size_type Gc_rows = n, Gc_cols = m, Gc_nz = Gc.
nz();
150 Gc_rows !=
n_ || Gc_cols !=
m_ || Gc_nz !=
Gc_nz_, std::invalid_argument
151 ,
"BasisSystemPermDirectSparse::set_basis(...) : Error, "
152 "This matrix object is not compatible with last call to set_basis() or select_basis()!" );
154 C == NULL, std::invalid_argument
155 ,
"BasisSystemPermDirectSparse::set_basis(...) : Error!" );
179 *out <<
"\nCurrent basis is singular : " << excpt.what() << std::endl
180 <<
"Throwing SingularBasis exception to client ...\n";
183 ,
"BasisSystemPermDirectSparse::update_basis(...) : Error, the current basis "
184 "is singular : " << excpt.what() );
228 *out <<
"\nUsing a direct sparse solver to set a new basis ...\n";
233 const size_type Gc_rows = n, Gc_cols = m, Gc_nz = Gc.
nz();
235 P_equ == NULL || equ_decomp == NULL, std::invalid_argument
236 ,
"BasisSystemPermDirectSparse::set_basis(...) : Error!" );
238 C == NULL, std::invalid_argument
239 ,
"BasisSystemPermDirectSparse::set_basis(...) : Error!" );
250 const PermutationSerial
251 &P_var_s =
dyn_cast<
const PermutationSerial>(P_var),
252 &P_equ_s = dyn_cast<const PermutationSerial>(*P_equ);
261 IVector row_perm_ds, col_perm_ds;
271 if( rank < var_dep.
size() ) {
294 *out <<
"\nUsing a direct sparse solver to select a new basis ...\n";
297 const char msg_err_head[] =
"BasisSystemPermDirectSparse::set_basis(...) : Error!";
299 Gc == NULL, std::invalid_argument
300 ,msg_err_head <<
" Must have equality constriants in this current implementation! " );
309 P_var == NULL || var_dep == NULL, std::invalid_argument, msg_err_head );
311 P_equ == NULL || equ_decomp == NULL, std::invalid_argument, msg_err_head );
313 C == NULL, std::invalid_argument, msg_err_head );
351 &P_var_s =
dyn_cast<PermutationSerial>(*P_var),
352 &P_equ_s =
dyn_cast<PermutationSerial>(*P_equ);
359 const int num_row_part = 2;
360 const int num_col_part = 2;
361 const index_type row_part[3] = { 1, rank, n+1 };
362 const index_type col_part[3] = { 1, rank, m+1 };
368 P_var,row_part,num_row_part
369 ,P_equ,col_part,num_col_part
383 if( C_aggr.
mns().get() ) {
386 if(C_bm.
get() == NULL)
387 dyn_cast<const DirectSparseSolver::BasisMatrix>(*C_aggr.
mns());
403 Teuchos::rcp_dynamic_cast<const MatrixExtractSparseElements>(Gc_pa.
mat_orig())
465 : ( equ_decomp.
lbound() == 1
virtual mat_ptr_t sub_view(const Range1D &row_rng, const Range1D &col_rng) const
Create a transient constant sub-matrix view of this matrix (if supported).
virtual size_type nz() const
Return the number of nonzero elements in the matrix.
Range1D equ_undecomp() const
const perm_fcty_ptr_t factory_P_inequ() const
void initialize(const size_type rows, const size_type cols)
Call this->initialize(v,v_release) with an allocated DenseLinAlgPack::DVector object.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
RTOp_index_type index_type
Abstract base class for all polymorphic symmetrix nonsingular matrices that can be used to compute ma...
MultiVectorMutable "Adapter" subclass for DenseLinAlgPack::DMatrixSlice or DenseLinAlgPack::DMatrix o...
void do_some_basis_stuff(const MatrixOp &Gc, const Range1D &var_dep, const Range1D &equ_decomp, const Teuchos::RCP< DirectSparseSolver::BasisMatrix > &C_bm, MatrixOpNonsingAggr *C_aggr, MatrixOp *D, MatrixOp *GcUP)
BasisSystemPermDirectSparse(const direct_solver_ptr_t &direct_solver=Teuchos::null)
Calls this->initialize()
void initialize(const direct_solver_ptr_t &direct_solver)
Initialize given a direct sparse solver object.
Abstract class for objects that represent the factorized matrix and can be used to solve for differen...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Index size() const
Return the size of the range (ubound() - lbound() + 1)
Aggregate matrix class for a matrix and its permuted view.
const perm_fcty_ptr_t factory_P_var() const
Range1D var_indep() const
void initialize(const mwo_ptr_t &mwo, BLAS_Cpp::Transp mwo_trans, const mns_ptr_t &mns, BLAS_Cpp::Transp mns_trans)
Initialize.
void update_basis_and_auxiliary_matrices(const MatrixOp &Gc, const Teuchos::RCP< DirectSparseSolver::BasisMatrix > &C_bm, MatrixOpNonsingAggr *C_aggr, MatrixOp *D, MatrixOp *GcUP) const
Interface adding operations specific for a symmetric matrix {abstract}.
const mat_fcty_ptr_t factory_D() const
const perm_fcty_ptr_t factory_P_equ() const
IVector init_equ_inv_perm_
void initialize(const mat_ptr_t &mat_orig, const perm_ptr_t &row_perm, const perm_ptr_t &col_perm, const mat_ptr_t &mat_perm)
Initialize.
virtual size_type cols() const
Return the number of columns in the matrix.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
IVector init_var_inv_perm_
. One-based subregion index range class.
RTOp_index_type size_type
T_To & dyn_cast(T_From &from)
Teuchos::RCP< DirectSparseSolver::BasisMatrix > get_basis_matrix(MatrixOpNonsingAggr &C_aggr) const
Base class for all matrices that support basic matrix operations.
direct_solver_ptr_t direct_solver_
const mat_nonsing_fcty_ptr_t factory_C() const
const mat_fcty_ptr_t factory_GcUP() const
static const Range1D Invalid
Range1D(INVALID)
Index lbound() const
Return lower bound of the range.
Abstract interface to permutation matrices.
void set_A_mctse(size_type n, size_type m, const MatrixPermAggr &Gc_pa, MatrixConvertToSparseEncap *A_mctse) const
void set_basis(const Permutation &P_var, const Range1D &var_dep, const Permutation *P_equ, const Range1D *equ_decomp, const MatrixOp &Gc, MatrixOpNonsing *C, MatrixOp *D, MatrixOp *GcUP, EMatRelations mat_rel, std::ostream *out)
Interface for setting and selecting a basis from the Jacobian from a set of equations.
Abstract base class for all nonsingular polymorphic matrices that can be used to compute matrix-vecto...
void M_StInvMtM(MatrixOp *m_lhs, value_type alpha, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2)
m_lhs = alpha * inv(op(mwo_rhs1)) * op(mwo_rhs2) (right)
virtual size_type rows() const
Return the number of rows in the matrix.
void select_basis(const Vector *nu, MatrixOp *Gc, Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp, MatrixOpNonsing *C, MatrixOp *D, MatrixOp *GcUP, EMatRelations mat_rel, std::ostream *out)
virtual mat_ptr_t perm_view(const Permutation *P_row, const index_type row_part[], int num_row_part, const Permutation *P_col, const index_type col_part[], int num_col_part) const
Create a permuted view: M_perm = P_row' * M * P_col.
void initialize(const mese_ptr_t &mese, const i_vector_ptr_t &inv_row_perm, const Range1D &row_rng, const i_vector_ptr_t &inv_col_perm, const Range1D &col_rng, const BLAS_Cpp::Transp mese_trans, const value_type alpha=1.0)
Initialize a permuted view of a sparse matrix.
Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with bu...
Sparse conversion subclass based on views of a MatrixExtractSparseElements object.
void update_basis(const MatrixOp &Gc, MatrixOpNonsing *C, MatrixOp *D, MatrixOp *GcUP, EMatRelations mat_rel, std::ostream *out) const
RangePack::Range1D Range1D
Aggregate matrix class pulling together a MatrixOp object and a MatrixNonsing object into a unified m...
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Range1D equ_decomp() const