MCPcopy
hub / github.com/mudler/LocalAI / minMax

Function minMax

backend/go/depth-anything-cpp/godepthanythingcpp.go:539–556  ·  view source on GitHub ↗
(v []float32)

Source from the content-addressed store, hash-verified

537}
538
539func minMax(v []float32) (mn, mx float32) {
540 if len(v) == 0 {
541 return 0, 0
542 }
543 mn, mx = v[0], v[0]
544 for _, x := range v {
545 if math.IsNaN(float64(x)) || math.IsInf(float64(x), 0) {
546 continue
547 }
548 if x < mn {
549 mn = x
550 }
551 if x > mx {
552 mx = x
553 }
554 }
555 return mn, mx
556}

Callers 2

PredictMethod · 0.85
writeDepthPNGFunction · 0.85

Calls 1

IsInfMethod · 0.80

Tested by

no test coverage detected