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

Tpetra?: <float>,<complex> multiplication operator not defined #7230

Closed
markyoder opened this issue Apr 22, 2020 · 2 comments
Closed

Tpetra?: <float>,<complex> multiplication operator not defined #7230

markyoder opened this issue Apr 22, 2020 · 2 comments
Labels
pkg: Tpetra type: bug The primary issue is a bug in Trilinos code or tests

Comments

@markyoder
Copy link

markyoder commented Apr 22, 2020

Bug Report

@trilinos/Tpetra>

Getting a, "operator* not defined":
Trilinos/packages/tpetra/core/test/ImportExport2/ImportExport2_CrsSortingUtils.cpp:289:62: error: no match for ‘operator*’ (operand types are ‘double’ and ‘__gnu_cxx::__alloc_traits<std::allocator<std::complex<float> >, std::complex<float> >::value_type’ {aka ‘std::complex<float>’})

part of:

// Unit Test the functionality in Tpetra_Import_Util
TEUCHOS_UNIT_TEST_TEMPLATE_3_DECL( Import_Util, SortCrsEntries, Scalar, LO, GO)
{

It's a bit surprising because the error seems to imply that std:<complex> does not support simple scalar multiplication. Addition appears to be supported (if I replace 2*x with x+x it seems to work. also, *= is supported, so replacing:

for (size_type i=0; i<new_num_entries; i++) vals2[i] = 2.*vals[i];
with the. block,

      for (size_type i=0; i<new_num_entries; i++) {
          vals2[i] = vals[i];
          vals2[i]*=2.0;
            };

also fixes the problem.

Description

What went wrong? What should have happened? Do you have an idea what might
fix things? How has this bug affected you? What are you trying to accomplish?
What specifically must we demonstrate to call this work complete?

Steps to Reproduce

  1. SHA1: [insert here]
  2. Configure script: [attach here]
  3. Configure log: [attach here]
  4. Build log: [attach here]
  5. Input deck: [attach here]
  6. Do this.
  7. Do that.
  8. Shake fist angrily at computer.
  9. Run log: [attach here]
@markyoder markyoder added the type: bug The primary issue is a bug in Trilinos code or tests label Apr 22, 2020
@kddevin
Copy link
Contributor

kddevin commented May 12, 2020

Thanks @markyoder. Can you please post your cmake configuration command? Thank you.

@kddevin
Copy link
Contributor

kddevin commented Sep 8, 2020

Actually, this issue was fixed with #6336 in Nov 2019.
I will assume the report was for an older version of Trilinos.
Please reopen this issue if it is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: Tpetra type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

3 participants