Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShyLU, Belos: Fix build errors when Scalar=complex<float> is enabled #3597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class GmresPipeline : public Gmres<SC, MV, OP> {
int ell = 1;
const SC zero = STS::zero ();
const SC one = STS::one ();
const SC eps = STS::eps ();
const SC tolOrtho = 10.0*std::sqrt(eps);
const mag_type eps = STS::eps ();
const mag_type tolOrtho = mag_type (10.0) * STM::squareroot (eps);
SolverOutput<SC> output {};

Teuchos::BLAS<LO ,SC> blas;
Expand Down
16 changes: 8 additions & 8 deletions packages/shylu/shylu_node/hts/src/shylu_hts_impl_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ get_matrix_p (const CrsMatrix& A, const Array<Int>& p,
Sclr* const d_start = sd.d + sd.ir[i];
memcpy(d_start, A.d + A.ir[r], nc*sizeof(*sd.d));
if (set_diag_reciprocal)
d_start[nc-1] = 1.0/d_start[nc-1];
d_start[nc-1] = Sclr{1.0}/d_start[nc-1];
}

CrsMatrix* cm;
Expand Down Expand Up @@ -1999,7 +1999,7 @@ OnDiagTri::init_numeric (const CrsMatrix& T, const bool invert) {
if (lcol >= this->n_) break;
Size& i = ir[lrow+1];
jc[i] = lcol;
d[i] = lrow == lcol ? 1.0/T.d[k] : T.d[k];
d[i] = lrow == lcol ? Sclr{1.0}/T.d[k] : T.d[k];
++i;
}
}
Expand All @@ -2023,7 +2023,7 @@ OnDiagTri::reinit_numeric (const CrsMatrix& T, const bool invert) {
const Int lcol = T.jc[k] - c0_;
if (lcol >= this->n_) break;
const Size di = (lrow*(lrow + 1))/2 + lcol;
const Sclr dv = lrow == lcol ? 1.0/T.d[k] : T.d[k];
const Sclr dv = lrow == lcol ? Sclr{1.0}/T.d[k] : T.d[k];
// Compressed dense triangle.
d_[di] = dv;
++nnz;
Expand All @@ -2043,7 +2043,7 @@ OnDiagTri::reinit_numeric (const CrsMatrix& T, const bool invert) {
k < irgp1; ++k) {
const Int lcol = T.jc[k] - c0_;
if (lcol >= this->n_) break;
d[i] = lrow == lcol ? 1.0/T.d[k] : T.d[k];
d[i] = lrow == lcol ? Sclr{1.0}/T.d[k] : T.d[k];
++i;
}
}
Expand Down Expand Up @@ -3271,7 +3271,7 @@ LevelSetTri::reinit_numeric (const CrsMatrix& T) {
assert(nc == static_cast<Int>(t.m->ir[i+1] - t.m->ir[i]));
Sclr* const d_start = t.m->d + t.m->ir[i];
memcpy(d_start, T.d + T.ir[r], nc*sizeof(*t.m->d));
d_start[nc-1] = 1.0/d_start[nc-1];
d_start[nc-1] = Sclr{1.0}/d_start[nc-1];
}
} while (0);
if ( ! nthreads_ok) throw hts::Exception(msg);
Expand Down Expand Up @@ -3897,8 +3897,8 @@ to_outside (Sclr* x, const Int nrhs, const Sclr a, const Sclr b,
const Int i0 = part_[tid], i1 = part_[tid+1];
Sclr* ppx = px_;
Sclr* px = x;
if (b != 1.0) {
if (a != 0.0) {
if (b != Sclr{1.0}) {
if (a != Sclr{0.0}) {
for (int k = 0; ; ) {
for (Int i = i0; i < i1; ++i) {
Sclr* const pxqi = px + q_[i];
Expand All @@ -3918,7 +3918,7 @@ to_outside (Sclr* x, const Int nrhs, const Sclr a, const Sclr b,
}
}
} else {
if (a != 0.0) {
if (a != Sclr{0.0}) {
for (int k = 0; ; ) {
for (Int i = i0; i < i1; ++i) {
Sclr* const pxqi = px + q_[i];
Expand Down