Skip to content

Commit ff1a376

Browse files
authored
Add license headers (#241)
1 parent cd24703 commit ff1a376

24 files changed

+124
-6
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020 Akshay Sharma
1+
Copyright (c) 2020 Akshay Sharma and contributors
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

docs/make.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
using Documenter, DiffOpt, Literate, Test
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
6+
using Documenter
7+
using DiffOpt
8+
using Literate
9+
using Test
210

311
const _EXAMPLE_DIR = joinpath(@__DIR__, "src", "examples")
412

src/ConicProgram/ConicProgram.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
module ConicProgram
27

38
using LinearAlgebra, SparseArrays

src/DiffOpt.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
module DiffOpt
27

38
using LinearAlgebra

src/QuadraticProgram/QuadraticProgram.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
module QuadraticProgram
27

38
using LinearAlgebra, SparseArrays
@@ -404,7 +409,7 @@ Each solver must implement: `solve_system(solver, LHS, RHS, iterative::Bool)`.
404409
struct LinearAlgebraSolver <: MOI.AbstractOptimizerAttribute end
405410

406411
"""
407-
Default `solve_system` call uses IterativeSolvers or the default linear solve
412+
Default `solve_system` call uses IterativeSolvers or the default linear solve
408413
"""
409414
function solve_system(::Any, LHS, RHS, iterative)
410415
if iterative

src/bridges.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
function MOI.set(
27
model::MOI.ModelLike,
38
attr::ForwardConstraintFunction,

src/bridges_unused.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
function MOI.set(
27
model::MOI.ModelLike,
38
attr::BackwardInVariablePrimal,

src/deprecated.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
@deprecate backward(model) reverse_differentiate!(model) false
27
@deprecate forward(model) forward_differentiate!(model) false
38

src/diff_opt.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
# Constructs a Differentiable Optimizer model from a MOI Optimizer.
27
# Supports `forward_differentiate!` and `reverse_differentiate!` methods for solving and differentiating the model respectectively.
38

src/jump_moi_overloads.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
function MOI.set(model::JuMP.Model, attr::ForwardObjectiveFunction, func::JuMP.AbstractJuMPScalar)
27
JuMP.check_belongs_to_model(func, model)
38
return MOI.set(model, attr, JuMP.moi_function(func))

src/moi_wrapper.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
"""
27
diff_optimizer(optimizer_constructor)::Optimizer
38

src/objective_container.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
mutable struct ObjectiveContainer{MOIForm,ArrayForm} <: MOI.ModelLike
27
num_variables::Int64
38
is_sense_set::Bool

src/product_of_sets.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
"""
27
ProductOfSets{T} <: MOI.Utilities.OrderedProductOfSets{T}
38

src/utils.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
# Representation of MOI functions using SparseArrays
27
# Might be able to replace in the future by a function in MOI, see
38
# https://github.com/jump-dev/MathOptInterface.jl/pull/1238

test/bridges.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
module TestBridges
27

38
using Test

test/conic_reverse.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
import SCS
27
# min X[1,1] + X[2,2] max y
38
# X[2,1] = 1 [0 y/2 [ 1 0

test/jump.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using Test
27
using JuMP
38
import DiffOpt
@@ -72,10 +77,10 @@ end
7277

7378
# Test some overloads from https://github.com/jump-dev/DiffOpt.jl/issues/211
7479
grad_obj = MOI.get(model, DiffOpt.ReverseObjectiveFunction())
75-
@test JuMP.coefficient(grad_obj, x[1], x[2])
80+
@test JuMP.coefficient(grad_obj, x[1], x[2])
7681
DiffOpt.quad_sym_half.(grad_obj, x[1], x[2]) atol=ATOL rtol=RTOL
7782

78-
@test DiffOpt.quad_sym_half(grad_obj, x[1], x[1])
83+
@test DiffOpt.quad_sym_half(grad_obj, x[1], x[1])
7984
2 * JuMP.coefficient(grad_obj, x[1], x[1]) atol=ATOL rtol=RTOL
8085

8186
# TODO: this simple show fails

test/moi_wrapper.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using Test
27
import DiffOpt
38
import MathOptInterface as MOI

test/qp_forward.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
import HiGHS
27
@testset "Differentiating LP; checking gradients for non-active contraints" begin
38
# Issue #40 from Gurobi.jl

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using Test
27
import DiffOpt
38
import Random

test/sensitivity_index_issue.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using JuMP
27
import HiGHS
38

@@ -115,7 +120,7 @@ end
115120
]
116121

117122
derivativeKKT = hcat([DiffOpt.lsqr(KKT,rhsKKT[:,i]) for i in 1:size(rhsKKT)[2]]...)
118-
123+
119124
dprimal_dconsKKT = derivativeKKT[1:6,:]
120125
#Finished calculation of sensitivities by Manual KKT
121126

test/singular_exception.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using Test
27
import DiffOpt
38
import MathOptInterface as MOI

test/solver_interface.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
import HiGHS
27

38
@testset "FEASIBILITY_SENSE zeros objective" begin

test/utils.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2020: Akshay Sharma and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using Test
27
using JuMP
38
import DiffOpt

0 commit comments

Comments
 (0)