RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • allfinite
    • isfinite
    • isgpuarray
    • isinf
    • islogical
    • isnan
    • isnumeric
    • isreal
    • issparse

allfinite — Return true when every element of the input is finite.

tf = allfinite(A) returns a scalar logical indicating whether every element of A is finite. It is equivalent to applying isfinite to the whole input and reducing the mask with all(...,'all').

Syntax

tf = allfinite(A)

Inputs

NameTypeRequiredDefaultDescription
AAnyYes—Input value to test for finite elements.

Returns

NameTypeDescription
tfLogicalArrayTrue when every element of the input is finite.

Errors

IdentifierWhenMessage
RunMat:allfinite:InvalidInputInput is not numeric, logical, or char.allfinite: expected numeric, logical, or char input
RunMat:allfinite:InternalErrorA GPU provider, gather, download, or internal shape operation fails.allfinite: internal error

How allfinite works

  • Numeric scalars return true for finite values and false for NaN or Inf.
  • Numeric arrays return a scalar logical over all elements; empty numeric arrays return true.
  • Complex inputs return true only when every real and imaginary component is finite.
  • Sparse inputs inspect stored nonzero values; implicit zeros are finite.
  • Logical, character, and all eight built-in integer classes return true.
  • RunMat mode additionally accepts strings: string scalars and nonempty string arrays return false, while empty string arrays return true.
  • Cell arrays, structs, objects, and function handles are rejected with RunMat:allfinite:InvalidInput.

Does RunMat run allfinite on the GPU?

allfinite is a scalar predicate over the full input. gpuArray inputs use provider-side isfinite plus all reduction when available; the scalar logical result is returned on the CPU. Providers without those hooks fall back to host gather and reduction.

Examples

Check a finite matrix

tf = allfinite([1 2; 3 4])

Expected output:

tf =
     1

Detect nonfinite values

tf = allfinite([1 NaN Inf])

Expected output:

tf =
     0

Check complex values

tf = allfinite([1+2i 3-4i])

Expected output:

tf =
     1

Using allfinite with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how allfinite changes the result.

Run a small allfinite example, explain the result, then change one input and compare the output.

FAQ

How is allfinite(A) different from isfinite(A)?⌄

isfinite returns an element-wise logical mask. allfinite returns a single logical scalar for the whole input.

Are empty arrays all finite?⌄

Yes. The result follows MATLAB-style all identity behavior: reducing an empty finite mask gives true.

How does allfinite handle complex numbers?⌄

A complex value is finite only when both its real and imaginary components are finite.

Related Logical functions

Tests

isfinite · isgpuarray · isinf · islogical · isnan · isnumeric · isreal · issparse

Bit

and · bitand · bitcmp · bitget · bitor · bitset · bitshift · bitxor · not · or · xor

Rel

eq · ge · gt · isequal · isequaln · le · lt · ne

Logical

logical

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how allfinite is executed, line by line, in Rust.

  • View the source for allfinite in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How allfinite works
  • Does RunMat run allfinite on the GPU?
  • Examples
  • Check a finite matrix
  • Detect nonfinite values
  • Check complex values
  • Using allfinite with coding agents
  • FAQ
  • Related Logical functions
  • Tests
  • Bit
  • Rel
  • Logical
  • Open-source implementation
  • About RunMat