-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da5546c
commit dc0c97f
Showing
14 changed files
with
555 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![allow(non_snake_case)] | ||
use clarabel::algebra::*; | ||
use clarabel::solver::*; | ||
|
||
fn problem_data() -> (CscMatrix<f64>, Vec<f64>, CscMatrix<f64>, Vec<f64>) { | ||
let n = 2000000; | ||
|
||
let P = CscMatrix::identity(n); | ||
|
||
// construct A = [I; -I] | ||
let I1 = CscMatrix::<f64>::identity(n); | ||
let mut I2 = CscMatrix::<f64>::identity(n); | ||
I2.negate(); | ||
|
||
let A = CscMatrix::vcat(&I1, &I2); | ||
|
||
let q = vec![1.; n]; | ||
let b = vec![1.; 2 * n]; | ||
|
||
(P, q, A, b) | ||
} | ||
|
||
fn main() { | ||
let (P, q, A, b) = problem_data(); | ||
|
||
let cones = [NonnegativeConeT(b.len())]; | ||
|
||
let settings = DefaultSettingsBuilder::default() | ||
.direct_solve_method("faer".to_owned()) | ||
.equilibrate_enable(true) | ||
.max_iter(50) | ||
.verbose(true) | ||
.build() | ||
.unwrap(); | ||
|
||
let mut solver = DefaultSolver::new(&P, &q, &A, &b, &cones, settings); | ||
|
||
solver.solve(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.