How to use function inside a package

I would like to use some of the functions included in the following package:
https://github.com/danspielman/Laplacians.jl/tree/master/src

For example the first file is IJV.jl .
My question is how I am supposed to use these functions?
I add the package by running pkg> add Laplacians#master as it is said in the instructions. I assume that after adding the package, all the functions would be available and I can call them, is it right?
For instance, if I want to use IJV.jl function, should I copy paste the code into my own file or I can just call the function?

@Nova: IJV.jl is a file in that package contains many functions.

You can access function name IJV in this file like below:

using Laplacians
ijv = IJV(A::SparseMatrixCSC)
1 Like

This is what I get running: ijv = IJV(A), where A is a sparse matrix
ERROR: UndefVarError: IJV not defined

julia> using Laplacians

julia> :IJV in names(Laplacians)
false

julia> :IJV in names(Laplacians, all=true)
true

julia> Laplacians.IJV
Laplacians.IJV

help?> Laplacians.IJV
  ijv = IJV(A::SparseMatrixCSC)

  Convert a sparse matrix to an IJV.

You can use it like Laplacians.IJV(A). This is because IJV is not exported by Laplacians

edit: I had a look at the docs, and this is intended. IJV is listed under “unexported (private) functions” in the API reference here

4 Likes