SSimplexDune
Product

Product features · Euclidean simplex projection

01

Review simplex_projection.py as a constrained numerical projection, checking feasibility separately from the nearest-point calculation.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Euclidean simplex projection

● ● ●SimplexDune●
A concrete starting point · Euclidean simplex projection ×
import math

def simplex_projection(values):
    if type(values) is not list or not 1 <= len(values) <= 256:
        raise ValueError("simplex.input")
    if any(type(x) not in (int, float) or not -10**6 <= x <= 10**6 or not math.isfinite(x) for x in values):
        raise ValueError("simplex.value")
    ranked = sorted(values, reverse=True)
    total, theta = 0.0, 0.0
    for count, value in enumerate(ranked, 1):
        total += value
        candidate = (total-1)/count
        if value > candidate:
            theta = candidate
    return [max(0.0, value-theta) for value in values]
✳Euclidean simplex projection
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗