mirror of
https://github.com/ruvnet/RuView
synced 2026-08-09 20:21:43 +00:00
feat: vendor midstream and sublinear-time-solver libraries
Add ruvnet/midstream (AIMDS real-time inference) and ruvnet/sublinear-time-solver (sublinear optimization algorithms) as vendored dependencies under vendor/. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
// Create a larger diagonally dominant matrix to test TRUE O(log n) algorithms
|
||||
import fs from 'fs';
|
||||
|
||||
const n = 200; // Large enough to trigger JL dimension reduction
|
||||
const values = [];
|
||||
const rowIndices = [];
|
||||
const colIndices = [];
|
||||
|
||||
// Create a tridiagonal diagonally dominant matrix
|
||||
for (let i = 0; i < n; i++) {
|
||||
// Diagonal element
|
||||
values.push(4.0);
|
||||
rowIndices.push(i);
|
||||
colIndices.push(i);
|
||||
|
||||
// Off-diagonal elements
|
||||
if (i > 0) {
|
||||
values.push(-1.0);
|
||||
rowIndices.push(i);
|
||||
colIndices.push(i - 1);
|
||||
}
|
||||
if (i < n - 1) {
|
||||
values.push(-1.0);
|
||||
rowIndices.push(i);
|
||||
colIndices.push(i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
const matrix = { values, rowIndices, colIndices, rows: n, cols: n };
|
||||
const vector = new Array(n).fill(1.0);
|
||||
|
||||
console.log('Matrix size:', n);
|
||||
console.log('Expected JL dimension:', Math.ceil(Math.log2(n) * 8));
|
||||
console.log('Matrix entries:', values.length);
|
||||
console.log('Test data created successfully');
|
||||
|
||||
// Export for use with MCP tools
|
||||
const testData = { matrix, vector, n };
|
||||
fs.writeFileSync('/tmp/large-matrix-test.json', JSON.stringify(testData, null, 2));
|
||||
console.log('Test data saved to /tmp/large-matrix-test.json');
|
||||
Reference in New Issue
Block a user