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

WIP: Hilbert/Banach space structures #27401

Merged
merged 17 commits into from
Jun 19, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update docstrings of norm and inner
ranocha committed Jun 19, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 614776b6c3be2b9922380757dfdcc405cf6f8e2d
12 changes: 10 additions & 2 deletions stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
@@ -373,13 +373,18 @@ The `p`-norm is defined as
\\|A\\|_p = \\left( \\sum_{i=1}^n | a_i | ^p \\right)^{1/p}
```
with ``a_i`` the entries of ``A``, ``| a_i |`` are their [`norm`](@ref)s, and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``| a_i |`` are their [`norm`](@ref)s

->

``| a_i |`` the [`norm`](@ref) of ``a_i``

?

``n`` the length of ``A``.
``n`` the length of ``A``. Since the `p`-norm is computed using the [`norm`](@ref)s
of the entries of `A`, the `p`-norm of a vector of vectors is not compatible with
the interpretation of it as a block vector in general if `p != 2`.

`p` can assume any numeric value (even though not all values produce a
mathematically valid vector norm). In particular, `norm(A, Inf)` returns the largest value
in `abs.(A)`, whereas `norm(A, -Inf)` returns the smallest. If `A` is a matrix and `p=2`,
then this is equivalent to the Frobenius norm.

The second argument `p` is not necessarily a part of the interface for `norm`, i.e. a custom
type may only implement `norm(A)` without second argument.

Use [`opnorm`](@ref) to compute the operator norm of a matrix.

# Examples
@@ -636,7 +641,10 @@ end

For any iterable containers `x` and `y` (including arrays of any dimension) of numbers (or
any element type for which `inner` is defined), compute the inner product (or dot product
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Euclidean inner product" is perhaps more descriptive. (As opposed to some weighted inner product.)

Missing a close paren after "or scalar product".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me and the professors who have taught me linear algebra, Euclidean inner product implies that the corresponding field are the real numbers. Especially, if a vector space over the complex numbers is considered, the inner product has been called unitary inner product. But if Euclidean inner product means just an inner product in (american) English, I can of course rename it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close parenthesis is after "or scalar product, i.e. the sum of inner(x[i],y[i]))". If it might be better to have this part of the additional explanation outside of the parentheses, I will of course change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for the qualifier "Euclidean" or similar is to distinguish it from some other weighted inner product. But since we write that it is the sum of inner(x[i],y[i]) explicitly, I guess we don't need any other qualifiers.

Yes, I would suggest having the i.e. the sum of ... part go outside of the parentheses, as this is necessary to precisely define what inner product we are using (as opposed to just a synonym).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring should also mention: dot(x,y) and x ⋅ y (where can be typed by tab-completing \cdot in the REPL) are synonyms for inner(x,y).

or scalar product, i.e. the sum of `inner(x[i],y[i])`) as if they were vectors.
or scalar product), i.e. the sum of `inner(x[i],y[i])`, as if they were vectors.

`dot(x, y)`` and `x ⋅ y` (where `⋅` can be typed by tab-completing `\cdot` in the REPL) are
synonyms for `inner(x, y)`.

# Examples
```jldoctest