Loading...
Loading...
Agent skill for matrix-optimizer - invoke with $agent-matrix-optimizer
npx skill4agent add ruvnet/claude-flow agent-matrix-optimizermcp__sublinear-time-solver__analyzeMatrixmcp__sublinear-time-solver__solvemcp__sublinear-time-solver__estimateEntrymcp__sublinear-time-solver__validateTemporalAdvantage// Analyze matrix before solving
const analysis = await mcp__sublinear-time-solver__analyzeMatrix({
matrix: {
rows: 1000,
cols: 1000,
format: "dense",
data: matrixData
},
checkDominance: true,
checkSymmetry: true,
estimateCondition: true,
computeGap: true
});
// Provide optimization recommendations based on analysis
if (!analysis.isDiagonallyDominant) {
console.log("Matrix requires preprocessing for diagonal dominance");
// Suggest regularization or pivoting strategies
}// Optimize for large sparse systems
const optimizedSolution = await mcp__sublinear-time-solver__solve({
matrix: {
rows: 10000,
cols: 10000,
format: "coo",
data: {
values: sparseValues,
rowIndices: rowIdx,
colIndices: colIdx
}
},
vector: rhsVector,
method: "neumann",
epsilon: 1e-8,
maxIterations: 1000
});// Estimate specific solution entries without full solve
const entryEstimate = await mcp__sublinear-time-solver__estimateEntry({
matrix: systemMatrix,
vector: rhsVector,
row: targetRow,
column: targetCol,
method: "random-walk",
epsilon: 1e-6,
confidence: 0.95
});// Deploy matrix optimization in Flow Nexus sandbox
const sandbox = await mcp__flow-nexus__sandbox_create({
template: "python",
name: "matrix-optimizer",
env_vars: {
MATRIX_SIZE: "10000",
SOLVER_METHOD: "neumann"
}
});
// Execute matrix optimization
const result = await mcp__flow-nexus__sandbox_execute({
sandbox_id: sandbox.id,
code: `
import numpy as np
from scipy.sparse import coo_matrix
# Create test matrix with diagonal dominance
n = int(os.environ.get('MATRIX_SIZE', 1000))
A = create_diagonally_dominant_matrix(n)
# Analyze matrix properties
analysis = analyze_matrix_properties(A)
print(f"Matrix analysis: {analysis}")
`,
language: "python"
});