Skip to content

P1673: LWG review 2023/11/07 (Kona) #427

@mhoemmen

Description

@mhoemmen

P1673: LWG review 2023/11/07 (Kona)

[linalg.algs.blas3.trsm]

triangular_matrix_matrix_left_solve

  • Does "valid but unspecified" differ from "unspecified"? Intent is that you can use the values; they aren't like moved-from values. (OK)
  • Para 6 Note: Use math notation for those phrases, instead of English ("product of (the inverse of the second argument) and the first argument"). Also, add a Note (which is currently missing) to the right solve, explaining how users should construct the divide binary function object in that case. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)
  • "A is the triangular matrix" -- B and/or X could also be mathematically triangular. We're trying to say that t and d apply to A. However, linalg.general already says that the t and d apply to the preceding argument. Instead of saying "where applicable," say "that apply to A." Make this change throughout. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 . "taking into account the Triangle" is a key search phrase.)
  • Use std::divides<void> as the default binary divide operator, instead of a lambda. Make this change throughout. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)

triangular_matrix_matrix_right_solve

(See above.)

[linalg.algs.blas3.inplacetrsm]

[algorithms.parallel.defns]

(OK)

[algorithms.parallel.user]

(OK)

[linalg.layout.packed]

  • Fix operator() to take two parameters only, not a pack. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)
  • Reformulate is_always_unique() so it checks both static extents (because one extent could be static and the other could be dynamic). Ditto for is_always_strided(). (is_unique() and is_strided() are fine, because there's a precondition that the matrix be square.) (DONE in PR P1673: More Kona 2023 LWG edits #428 .)
  • Mandates form instead of Constraints is fine. (OK)
  • Constraint that packed layouts have a matching Triangle? It applies not just to packed matrices. The Constraint is actually spurious. Remove Para 2 (Constraints) in [linalg.algs.blas2.trsv]? For packed layouts, we might not actually need the Triangle template argument to match the packed layout's Triangle. Action item: Check whether it needs to match, and remove this Constraint ([linalg.algs.blas2.trsv] para 2) if it doesn't need to match.
  • Para 4.5: Change r1 to 0, and remove the double right parenthesis after static_extent(1). (DONE; fixed in PR P1673: LWG review (follow-on to PR 424) #426 .)
  • Para 5: (The meaning of this sentence only applies after you apply the Mandates. It should be sufficiently clear that it doesn't need to be regular if you put in weird template arguments.) (OK, this is fine.)

[linalg.layout.packed.cons]

Para 6.1 (first Precondition) is a bit pessimistic, because we only store half the size. On the other hand, worrying about that would make generic algorithms harder to implement. (See below for the action item.)

[linalg.layout.packed.obs]

  • Para 11 required_span_size() expression is in code font. extents_.extent(0) + 1 could overflow, and more importantly, extents_.extent(0) * (extents_.extent(0) + 1) is bigger than the size of the multidimensional index space. Write this in math font, because the result is definitely in range. Look for other places in the proposal that have this issue. Alternately, replace Mandate above (in Para 4) with a requirement (Mandate + Precondition) that extent(0) * (extent(0) + 1) be representable. (Do the latter.) (Create a function to check?) (9, 6.1, 4.6 -- use the expression without the divides by 2, in math font, for Mandates and Preconditions throughout.) (DONE in PR P1673: More Kona 2023 LWG edits #428 .)

operator()

stride

[linalg.transp]

transpose-extents-t and transpose-extents

  • mdspan should generally say which extent is the row extent and which extent is the column extent. Add this to [linalg.tags.order] (Storage order tags). (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)
    • We ended up adding definitions of the "rows" and "columns" of a matrix to [linalg.general], so that [linalg.tags.order] can refer to rows and columns.
  • Para 2: just say how to implement transpose-extents-t. Write it as code, not as English. Fix the Mandates, as the code wouldn't be able to express this. Also, the wording doesn't currently say that the index_type is the same; fix that. Instead, have transpose-extents return auto. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)
    • Add a new section [linalg.transp.helpers]
    • Move transpose-extent-t and transpose-extents there
    • Define transpose-extents-t in terms of transpose-extents, rather than the other way around
  • Fix numbering under Para 4. (DONE in PR P1673: LWG review (follow-on to PR 424) #426 .)

Resume tomorrow with layout_transpose.

Tasks 2023/11/08

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions