Skip to content

Commit

Permalink
Migrate full(X) to convert(Array, X) in tests outside of test/sparse …
Browse files Browse the repository at this point in the history
…and test/linalg. Migrate full to convert in some documentation.
  • Loading branch information
Sacha0 committed Oct 9, 2016
1 parent 034e97f commit 51f2e80
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions doc/manual/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ into a sparse matrix using the :func:`sparse` function:
[4, 4] = 1.0
[5, 5] = 1.0

You can go in the other direction using the :func:`full` function. The
You can go in the other direction using the :func:`convert` function. The
:func:`issparse` function can be used to query if a matrix is sparse.

.. doctest::
Expand Down Expand Up @@ -808,7 +808,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:`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
12 changes: 6 additions & 6 deletions doc/stdlib/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,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 @@ -147,7 +147,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 @@ -176,13 +176,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 @@ -722,7 +722,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) -> Hessenberg

Expand Down Expand Up @@ -1175,7 +1175,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[, tol::Real])

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(Array(x))

let a = QuoteNode(1), b = QuoteNode(1.0)
@test (hash(a)==hash(b)) == (a==b)
Expand Down
10 changes: 5 additions & 5 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ end
TAA = rand(2,2)
TAA = (TAA + TAA.')/2.
STAA = Symmetric(TAA)
@test full(atanh.(STAA)) == atanh.(TAA)
@test full(asinh.(STAA)) == asinh.(TAA)
@test full(acosh.(STAA+Symmetric(ones(TAA)))) == acosh.(TAA+ones(TAA))
@test full(acsch.(STAA+Symmetric(ones(TAA)))) == acsch.(TAA+ones(TAA))
@test full(acoth.(STAA+Symmetric(ones(TAA)))) == acoth.(TAA+ones(TAA))
@test Array(atanh.(STAA)) == atanh.(TAA)
@test Array(asinh.(STAA)) == asinh.(TAA)
@test Array(acosh.(STAA+Symmetric(ones(TAA)))) == acosh.(TAA+ones(TAA))
@test Array(acsch.(STAA+Symmetric(ones(TAA)))) == acsch.(TAA+ones(TAA))
@test Array(acoth.(STAA+Symmetric(ones(TAA)))) == acoth.(TAA+ones(TAA))
end

@testset "check exp2(::Integer) matches exp2(::Float)" begin
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 = 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 51f2e80

Please sign in to comment.