Skip to content

Commit

Permalink
Merge pull request #537 from JuliaReach/schillic/531
Browse files Browse the repository at this point in the history
#531 - Remove result type from SparseMatrixExp's 'get_row' function
  • Loading branch information
schillic authored Aug 15, 2018
2 parents 8627d06 + 7d4ca83 commit bf0fee9
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/ExponentialMap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,27 @@ function get_columns(spmexp::SparseMatrixExp{N},
return ans
end

function get_row(spmexp::SparseMatrixExp{N}, i::Int)::RowVector{N} where {N}
"""
get_row(spmexp::SparseMatrixExp{N}, i::Int) where {N}
Return a single row of a sparse matrix exponential.
### Input
- `spmexp` -- sparse matrix exponential
- `i` -- row index
### Output
A row vector corresponding to the `i`th row of the matrix exponential.
### Notes
This function uses Julia's `transpose` function to create the result.
The result is of type `Transpose`; in Julia versions older than v0.7, the result
was of type `RowVector`.
"""
function get_row(spmexp::SparseMatrixExp{N}, i::Int) where {N}
n = size(spmexp, 1)
aux = zeros(N, n)
aux[i] = one(N)
Expand Down

0 comments on commit bf0fee9

Please sign in to comment.