{"id":28722926,"url":"https://github.com/pedro-ricardo/quadprog","last_synced_at":"2025-06-15T09:09:53.300Z","repository":{"id":298844610,"uuid":"352633764","full_name":"pedro-ricardo/quadprog","owner":"pedro-ricardo","description":"Quadratic programming routine based on R Package sources. Changed to have a Matlab like interface and usage examples in C and Fortran.","archived":false,"fork":false,"pushed_at":"2021-03-29T19:55:47.000Z","size":39,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T07:48:44.251Z","etag":null,"topics":["c","modern-fortran","quadprog","quadratic-programming","solver"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedro-ricardo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-29T12:23:09.000Z","updated_at":"2024-05-16T18:02:11.000Z","dependencies_parsed_at":"2025-06-13T07:48:47.649Z","dependency_job_id":"8c2d4846-96f4-453a-b71b-afc1eae16b9f","html_url":"https://github.com/pedro-ricardo/quadprog","commit_stats":null,"previous_names":["pedro-ricardo/quadprog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedro-ricardo/quadprog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-ricardo%2Fquadprog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-ricardo%2Fquadprog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-ricardo%2Fquadprog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-ricardo%2Fquadprog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedro-ricardo","download_url":"https://codeload.github.com/pedro-ricardo/quadprog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-ricardo%2Fquadprog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259949680,"owners_count":22936412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","modern-fortran","quadprog","quadratic-programming","solver"],"created_at":"2025-06-15T09:09:52.474Z","updated_at":"2025-06-15T09:09:53.286Z","avatar_url":"https://github.com/pedro-ricardo.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuadProg Solver\nSimple Quadratic programming solver. Many thanks to [Felipeasg](https://github.com/Felipeasg) that found and started this interface.\n\nThe solver credit goes to a Cran `R` [package](https://github.com/cran/quadprog).\n\nThis repo simply translate that solver to use a **Matlab** like interface.\n* Both C and Fortran usage examples\n* Free from memmory leaks\n* Has a Blas dependency\n\n## Tested With:\n| Library  | Version  |\n| -------- | -------- |\n| GCC      | 10.2.1   |\n| Valgrind | 3.15.0   |\n| Blas     | 3.7.1    |\n\n## Usage\n```\n                                              /\n     /                         \\             |      [A].{x} \u003c= {b}\n    |  1                        |            |\nmin | --- {x}'[H]{x} + {f}'.{x} | such that \u003c|    [Aeq].{x} = {beq}\n x  |  2                        |            |\n     \\                         /             |  {lb} \u003c= {x} \u003c= {ub}\n                                              \\\n```\n### Arguments:\n* `n` (int): Number of variables\n* `q` (int): Total number of contraints (equality + inequality)\n* `qeq` (int): Number of equality constrains qeq (between 0 and q)\n* `H` (double) [n,n]: Matrix [H] as in the problem description  \n* `f` (double) [n]: Vector {f} as in the problem description\n* `Aeq` (double) [q,n]: Joined matrices [A] and [Aeq] like:\n```\n            --     --\n            | [Aeq] | [qeq,n]\nAeq [q,n] = |  [A]  | [q-qeq,n]\n            --     --\n```\n* `beq` (double) [q]: Joined vector [ [beq] [b] ]\n* `lb` (double) [n] Optional: Lower limits for x variable\n* `ub` (double) [n] Optional: Upper limits for x variable\n* `tol` (double): Solver tolerance\n\n* `x` (double) [n]: Optimun values\n* `res` (double): Solver residue\n* `err` (int): Error code, can be one of the following:\n  * 0 - Success\n  * 1 - Minimization problem has no solution\n  * 2 - Problem in matrix [H] decomposition\n  * 3 - Minimization problem solved but violates equality contrains\n  * 4 - Minimization problem solved but violates inequality contrains\n\n### Fortran callings :\n```fortran\n    call quadprog(n,q,qeq,H,f,Aeq,beq,lb,ub, x,tol,res,err)\n```\nor\n```fortran\n    call quadprog(n,q,qeq,H,f,Aeq,beq, x,tol,res,err)\n```\n\n### C callings :\n```c\n    quadprog(n,q,qeq,H,f,Aeq,beq,lb,ub, x,tol,res,err)\n```\nor\n```c\n    quadprog(n,q,qeq,H,f,Aeq,beq,NULL,NULL, x,tol,res,err)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedro-ricardo%2Fquadprog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedro-ricardo%2Fquadprog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedro-ricardo%2Fquadprog/lists"}