{"id":22668627,"url":"https://github.com/lanl/clp","last_synced_at":"2025-09-10T13:36:07.081Z","repository":{"id":55880729,"uuid":"45924510","full_name":"lanl/clp","owner":"lanl","description":"Go language bindings for the COIN-OR Linear Programming library","archived":false,"fork":false,"pushed_at":"2022-11-08T06:08:49.000Z","size":94,"stargazers_count":45,"open_issues_count":3,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-19T16:27:08.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T16:25:09.000Z","updated_at":"2025-03-06T08:27:52.000Z","dependencies_parsed_at":"2022-08-15T08:31:01.821Z","dependency_job_id":null,"html_url":"https://github.com/lanl/clp","commit_stats":null,"previous_names":["losalamos/clp"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/lanl/clp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fclp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fclp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fclp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fclp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanl","download_url":"https://codeload.github.com/lanl/clp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanl%2Fclp/sbom","scorecard":{"id":578576,"data":{"date":"2025-08-11","repo":{"name":"github.com/lanl/clp","commit":"ecce672c57a5a8fa7ec57cfae880295e8a0ab4f4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T18:32:07.848Z","repository_id":55880729,"created_at":"2025-08-20T18:32:07.848Z","updated_at":"2025-08-20T18:32:07.848Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274470683,"owners_count":25291610,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-09T15:16:01.300Z","updated_at":"2025-09-10T13:36:07.029Z","avatar_url":"https://github.com/lanl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"clp\n===\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/lanl/clp.svg)](https://pkg.go.dev/github.com/lanl/clp) [![Go project version](https://badge.fury.io/go/github.com%2Flanl%2Fclp.svg)](https://badge.fury.io/go/github.com%2Flanl%2Fclp) [![Go Report Card](https://goreportcard.com/badge/github.com/lanl/clp)](https://goreportcard.com/report/github.com/lanl/clp)\n\nDescription\n-----------\n\nThe `clp` package provides a [Go](https://go.dev/) interface to the [COIN-OR Linear Programming](https://www.coin-or.org/Clp/) (CLP) library, part of the [COIN-OR](http://www.coin-or.org/) (COmputational INfrastructure for Operations Research) suite.\n\n[Linear programming](https://en.wikipedia.org/wiki/Linear_programming) (LP) is a method for maximizing or minimizing a linear expression subject to a set of constraints expressed as inequalities.  As an example that's simple enough to solve by hand, what roll of three six-sided dice has the largest total value if no two dice are allowed have the same value and the difference in value between the first and second largest dice must be smaller than the difference in value between the second and third largest dice?  From an LP standpoint, the objective function we need to maximize to answer that question is *a* + *b* + *c*, where each variable represents the value on one die.  The first constraint is that each die be six sided:\n\n* 1 ≤ *a* ≤ 6\n* 1 ≤ *b* ≤ 6\n* 1 ≤ *c* ≤ 6\n\nThe second constraint is that the three dice all have different values.  We specify this by imposing a total order, *a* \u003e *b* \u003e *c*, which we express as\n\n* 1 ≤ a - b ≤ ∞\n* 1 ≤ b - c ≤ ∞\n\nThe third constraint is that the difference in value between the first and second largest dice (*a* − *b*) is smaller than the difference in value between the second and third largest dice (*b* − *c*).  To put this in a suitable format for LP, we rewrite *a* − *b* \u003c *b* − *c* as\n\n* -∞ ≤ a - 2b + c ≤ -1\n\nThese constraints translate directly to Go using the `clp` package's API:\n```Go\npackage main\n\nimport (\n        \"fmt\"\n        \"github.com/lanl/clp\"\n        \"math\"\n)\n\nfunc main() {\n        // Set up the optimization problem.\n        pinf := math.Inf(1)\n        ninf := math.Inf(-1)\n        simp := clp.NewSimplex()\n        simp.EasyLoadDenseProblem(\n                //         A    B    C\n                []float64{1.0, 1.0, 1.0},\n                [][2]float64{\n                        // LB UB\n                        {1, 6}, // 1 ≤ a ≤ 6\n                        {1, 6}, // 1 ≤ b ≤ 6\n                        {1, 6}, // 1 ≤ c ≤ 6\n                },\n                [][]float64{\n                        // LB  A    B    C    UB\n                        {1.0, 1.0, -1.0, 0.0, pinf},  // 1 ≤ a - b ≤ ∞\n                        {1.0, 0.0, 1.0, -1.0, pinf},  // 1 ≤ b - c ≤ ∞\n                        {ninf, 1.0, -2.0, 1.0, -1.0}, // -∞ ≤ a - 2b + c ≤ -1\n                })\n        simp.SetOptimizationDirection(clp.Maximize)\n\n        // Solve the optimization problem.\n        simp.Primal(clp.NoValuesPass, clp.NoStartFinishOptions)\n        soln := simp.PrimalColumnSolution()\n\n        // Output the solution.\n        fmt.Printf(\"Die 1 = %.0f\\n\", soln[0])\n        fmt.Printf(\"Die 2 = %.0f\\n\", soln[1])\n        fmt.Printf(\"Die 3 = %.0f\\n\", soln[2])\n}\n```\n\nThe output is the expected\n```\nDie 1 = 6\nDie 2 = 5\nDie 3 = 3\n```\n\nInstallation\n------------\n\n`clp` has been tested only on Linux.  The package requires a CLP installation to build.  To check if CLP is installed, ensure that the following command produces a list of libraries, typically along the lines of `-lClp -lCoinUtils …`, and, more importantly, issues no error messages:\n```bash\npkg-config --libs clp\n```\n\nOnce CLP installation is confirmed, you're ready to install the `clp` package.  As ` clp` has opted into the [Go module system](https://blog.golang.org/using-go-modules), installation is in fact unnecessary if your program or package has done likewise.  Otherwise, install the `clp` package with [`go get`](https://golang.org/cmd/go/#hdr-Legacy_GOPATH_go_get):\n```bash\ngo get github.com/lanl/clp\n```\n\nDocumentation\n-------------\n\nPre-built documentation for the `clp` API is available online at https://pkg.go.dev/github.com/lanl/clp.\n\nLegal statement\n---------------\n\nCopyright © 2011, Triad National Security, LLC.  All rights reserved.\n\nThis software was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of Energy/National Nuclear Security Administration.  All rights in the program are reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration. The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare derivative works, distribute copies to the public, perform publicly and display publicly, and to permit others to do so.  NEITHER THE GOVERNMENT NOR TRIAD NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.  If software is modified to produce derivative works, such modified software should be clearly marked, so as not to confuse it with the version available from LANL.\n\n`clp` is provided under a BSD 3-clause license.  See [the LICENSE file](http://github.com/lanl/clp/blob/master/LICENSE.md) for the full text.\n\nThis package is part of the LANL Go Suite, represented internally to LANL as LA-CC-11-056.\n\nAuthor\n------\n\nScott Pakin, *pakin@lanl.gov*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fclp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanl%2Fclp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanl%2Fclp/lists"}