Skip to content

Commit

Permalink
Migrate full(X) to convert(Array, X) in tests outside of test/sparsed…
Browse files Browse the repository at this point in the history
…ir and test/linalg. Migrate `full` to `convert` in some documentation.
  • Loading branch information
Sacha0 committed Jun 24, 2016
1 parent a159ac5 commit b928fa2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8665,7 +8665,7 @@ the one with smallest norm is returned.
Multiplication with respect to either thin or full `Q` is allowed, i.e. both `F[:Q]*F[:R]`
and `F[:Q]*A` are supported. A `Q` matrix can be converted into a regular matrix with
[`full`](:func:`full`) which has a named argument `thin`.
[`convert(Array, _)`](:func:`convert`) which has a named argument `thin`.
**note**
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ reference.
+----------------------------------------+----------------------------------+--------------------------------------------+
| :func:`speye(n) <speye>` | :func:`eye(n) <eye>` | Creates a *n*-by-*n* identity matrix. |
+----------------------------------------+----------------------------------+--------------------------------------------+
| :func:`full(S) <full>` | :func:`sparse(A) <sparse>` | Interconverts between dense |
| :func:`convert(Array, S) <convert>` | :func:`sparse(A) <sparse>` | Interconverts between dense |
| | | and sparse formats. |
+----------------------------------------+----------------------------------+--------------------------------------------+
| :func:`sprand(m,n,d) <sprand>` | :func:`rand(m,n) <rand>` | Creates a *m*-by-*n* random matrix (of |
Expand Down
14 changes: 7 additions & 7 deletions doc/stdlib/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Constructs an upper (``isupper=true``\ ) or lower (``isupper=false``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .
Constructs an upper (``isupper=true``\ ) or lower (``isupper=false``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`convert`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .

**Example**

Expand All @@ -90,7 +90,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Constructs an upper (``uplo='U'``\ ) or lower (``uplo='L'``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .
Constructs an upper (``uplo='U'``\ ) or lower (``uplo='L'``\ ) bidiagonal matrix using the given diagonal (``dv``\ ) and off-diagonal (``ev``\ ) vectors. The result is of type ``Bidiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`convert`\ . ``ev``\ 's length must be one less than the length of ``dv``\ .

**Example**

Expand Down Expand Up @@ -119,13 +119,13 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Construct a symmetric tridiagonal matrix from the diagonal and first sub/super-diagonal, respectively. The result is of type ``SymTridiagonal`` and provides efficient specialized eigensolvers, but may be converted into a regular matrix with :func:`full`\ .
Construct a symmetric tridiagonal matrix from the diagonal and first sub/super-diagonal, respectively. The result is of type ``SymTridiagonal`` and provides efficient specialized eigensolvers, but may be converted into a regular matrix with :func:`convert`\ .

.. function:: Tridiagonal(dl, d, du)

.. Docstring generated from Julia source
Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . The lengths of ``dl`` and ``du`` must be one less than the length of ``d``\ .
Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`convert`\ . The lengths of ``dl`` and ``du`` must be one less than the length of ``d``\ .

.. function:: Symmetric(A, uplo=:U)

Expand Down Expand Up @@ -461,7 +461,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

The following functions are available for the ``QR`` objects: ``size``\ , ``\``\ . When ``A`` is rectangular, ``\`` will return a least squares solution and if the solution is not unique, the one with smallest norm is returned.

Multiplication with respect to either thin or full ``Q`` is allowed, i.e. both ``F[:Q]*F[:R]`` and ``F[:Q]*A`` are supported. A ``Q`` matrix can be converted into a regular matrix with :func:`full` which has a named argument ``thin``\ .
Multiplication with respect to either thin or full ``Q`` is allowed, i.e. both ``F[:Q]*F[:R]`` and ``F[:Q]*A`` are supported. A ``Q`` matrix can be converted into a regular matrix with :func:`convert` which has a named argument ``thin``\ .

**note**

Expand Down Expand Up @@ -626,7 +626,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Compute the Hessenberg decomposition of ``A`` and return a ``Hessenberg`` object. If ``F`` is the factorization object, the unitary matrix can be accessed with ``F[:Q]`` and the Hessenberg matrix with ``F[:H]``\ . When ``Q`` is extracted, the resulting type is the ``HessenbergQ`` object, and may be converted to a regular matrix with :func:`full`\ .
Compute the Hessenberg decomposition of ``A`` and return a ``Hessenberg`` object. If ``F`` is the factorization object, the unitary matrix can be accessed with ``F[:Q]`` and the Hessenberg matrix with ``F[:H]``\ . When ``Q`` is extracted, the resulting type is the ``HessenbergQ`` object, and may be converted to a regular matrix with :func:`convert`\ .

.. function:: hessfact!(A)

Expand Down Expand Up @@ -942,7 +942,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f

.. Docstring generated from Julia source
Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`full`\ . The lengths of ``dl`` and ``du`` must be one less than the length of ``d``\ .
Construct a tridiagonal matrix from the first subdiagonal, diagonal, and first superdiagonal, respectively. The result is of type ``Tridiagonal`` and provides efficient specialized linear solvers, but may be converted into a regular matrix with :func:`convert`\ . The lengths of ``dl`` and ``du`` must be one less than the length of ``d``\ .

.. function:: rank(M)

Expand Down
1 change: 1 addition & 0 deletions doc/stdlib/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,4 @@
.. Docstring generated from Julia source
Create a string from the address of a NUL-terminated UTF-32 string. A copy is made; the pointer can be safely freed. If ``length`` is specified, the string does not have to be NUL-terminated.

2 changes: 1 addition & 1 deletion doc/stdlib/test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ gives a `Broken` `Result`.

.. Docstring generated from Julia source
For use to indicate a test that should pass but currently intermittently fails. Does not evaluate the expression.
For use to indicate a test that should pass but currently intermittently fails. Does not evaluate the expression, which makes it useful for tests of not-yet-implemented functionality.

Creating Custom ``AbstractTestSet`` Types
-----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ end
x = sprand(10, 10, 0.5)
x[1] = 1
x.nzval[1] = 0
@test hash(x) == hash(full(x))
@test hash(x) == hash(convert(Array, x))

let a = QuoteNode(1), b = QuoteNode(1.0)
@test (hash(a)==hash(b)) == (a==b)
Expand Down
2 changes: 1 addition & 1 deletion test/perf/threads/stockcorr/pstockcorr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function pstockcorr(n)
SimulPriceB[1,:] = CurrentPrice[2]

## Generating the paths of stock prices by Geometric Brownian Motion
const UpperTriangle = full(chol(Corr)) # UpperTriangle Matrix by Cholesky decomposition
const UpperTriangle = convert(Array, chol(Corr)) # UpperTriangle Matrix by Cholesky decomposition

# Optimization: pre-allocate these for performance
# NOTE: the new GC will hopefully fix this, but currently GC time
Expand Down

0 comments on commit b928fa2

Please sign in to comment.