AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
Cassowary 제약 해결 알고리즘을 효율적으로 구현한 C++ 라이브러리
Efficient C++ implementation of the Cassowary constraint solving algorithm
개발 도구C++ · PythonGitHub @nucleic직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Kiwi is an efficient C++ implementation of the Cassowary constraint solving algorithm. Kiwi is an implementation of the algorithm based on the seminal Cassowary paper. It is not a refactoring of the original C++ solver. Kiwi has been designed from the ground up to be lightweight and fast. Kiwi ranges from 10x to 500x faster than the original Cassowary solver with typical use cases gaining a 40x improvement. Memory savings are consistently > 5x.
In addition to the C++ solver, Kiwi ships with hand-rolled Python bindings.
Write the following in your CMakeLists.txt to include Kiwi as a dependency:
include(FetchContent)
FetchContent_Declare(
kiwi
GIT_REPOSITORY https://github.com/nucleic/kiwi
GIT_TAG {release name}
)
FetchContent_MakeAvailable(kiwi)
target_link_libraries(your_target PRIVATE kiwi::kiwi)
C++ code example:
#include <kiwi/kiwi.h>
#include <iostream>
int main() {
// initialize the solver
kiwi::Solver solver;
// initialize the variables
kiwi::Variable x = kiwi::Variable("x");
kiwi::Variable y = kiwi::Variable("y");
solver.addConstraint(x + y == 10);
solver.addConstraint(x - y == 4);
// solve the system of equations
solver.updateVariables();
std::cout << "x: " << x.value() << ", y: " << y.value() << std::endl;
// Output: x: 7, y: 3
return 0;
}
You can also use tests to see more examples of how to use the solver: SimlpexTest and SolverTest.