{"record":{"id":"e8bffee6ba5d622b","repo":"ruvnet/ruflo","slug":"need-at-least-one-point","errorCode":null,"errorMessage":"Need at least one point","messagePattern":"Need at least one point","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/hyperbolic.ts","lineNumber":288,"sourceCode":"}\n\n/**\n * Compute hyperbolic centroid (Fréchet mean) of multiple points\n *\n * Uses iterative optimization to find the centroid in Poincaré ball.\n *\n * @param points - Array of Poincaré embeddings\n * @param config - Configuration\n * @param maxIter - Maximum iterations (default: 100)\n * @returns Hyperbolic centroid\n */\nexport function hyperbolicCentroid(\n  points: Array<Float32Array | number[]>,\n  config: HyperbolicConfig = {},\n  maxIter = 100\n): Float32Array {\n  if (points.length === 0) {\n    throw new Error('Need at least one point');\n  }\n  if (points.length === 1) {\n    const arr = new Float32Array(points[0].length);\n    for (let i = 0; i < points[0].length; i++) {\n      arr[i] = points[0][i];\n    }\n    return arr;\n  }\n\n  const { epsilon } = { ...DEFAULT_CONFIG, ...config };\n  const dim = points[0].length;\n\n  // Initialize centroid at Euclidean mean projected to ball\n  const centroidInit = new Float32Array(dim);\n  for (const p of points) {\n    for (let i = 0; i < dim; i++) {\n      centroidInit[i] += p[i];\n    }","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/hyperbolic.ts#L270-L306","documentation":"hyperbolicCentroid() was called with an empty points array. A Fréchet mean over zero points is undefined, so the function refuses immediately rather than entering the iterative optimization with no data.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/hyperbolic.ts:288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass at least one point to the operation.","Guard the call site so empty batches are skipped instead of submitted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}