Skip to content

Commit

Permalink
remove result type from SparseMatrixExp's 'get_row' function
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Aug 14, 2018
1 parent 8627d06 commit 7d4ca83
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 7d4ca83

Please sign in to comment.