Skip to content

Commit

Permalink
Add implementations for tensor_projection
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Jan 29, 2025
1 parent 19cc2ba commit 27ac328
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/nlp/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,21 @@ If both `x` and `y` are provided, it computes the `n-1` projections of the **n-t
"""
function tensor_projection end

function tensor_projection(nlp::AbstractNLPModel{T, S}, n::Int, x::AbstractVector,
dimension::Int, directions...) where {T, S}
@lencheck nlp.meta.nvar x
p = S(undef, nlp.meta.nvar)
return tensor_projection!(nlp, n, x, dimension, p, directions...)
end

function tensor_projection(nlp::AbstractNLPModel{T, S}, n::Int, x::AbstractVector,
y::AbstractVector, dimension::Int, directions...) where {T, S}
@lencheck nlp.meta.nvar x
@lencheck nlp.meta.ncon y
p = S(undef, nlp.meta.nvar)
return tensor_projection!(nlp, n, x, y, dimension, p, directions...)
end

"""
tensor_projection!(nlp, n, x, dimension, p, args...)
tensor_projection!(nlp, n, x, y, dimension, p, args...)
Expand Down

0 comments on commit 27ac328

Please sign in to comment.