# Raya library reference (full) Every public class, function and method in Raya’s core libraries and Riptide’s Raya maths libraries. One line per member: signature, then the first sentence of its documentation. HTML version: https://riptidecompute.com/raya/docs ## Core libraries ### Core types (raya:core) import 'raya:core'; Strings, numbers, BigInt, booleans, lists, maps, sets, iterables, dates and durations, URIs, regular expressions, errors and exceptions. Imported automatically. https://riptidecompute.com/raya/docs/core-core - external bool identical(Object? a, Object? b) — Check whether two object references are to the same object. - external int identityHashCode(Object? object) — The identity hash code of object. - void print(Object? object) — Prints an object to the console. - const Deprecated deprecated = Deprecated("next release") — Marks a feature as Deprecated until the next release. - const Object override = _Override() — Annotation on instance members which override an interface member. - typedef Comparator = int Function(T a, T b) — The signature of a generic comparison function. - class Deprecated — The annotation @Deprecated('migration') marks a feature as deprecated. - Deprecated: const Deprecated(this.message) — Creates a deprecation annotation which specifies the migration path and expiration of the annotated feature. - Deprecated: const Deprecated.implement([this.message]) — Creates an annotation which deprecates implementing a class or mixin. - Deprecated: const Deprecated.extend([this.message]) — Creates an annotation which deprecates extending a class. - Deprecated: const Deprecated.subclass([this.message]) — Creates an annotation which deprecates subclassing (implementing or extending) a class. - Deprecated: const Deprecated.instantiate([this.message]) — Creates an annotation which deprecates instantiating a class. - Deprecated: const Deprecated.mixin([this.message]) — Creates an annotation which deprecates mixing in a class. - Deprecated: const Deprecated.optional([this.message]) — Creates an annotation which deprecates omitting an argument for the annotated parameter. - Deprecated: final String? message — Message provided to the user when they use the deprecated feature. - Deprecated: String toString() - final class pragma — A hint to tools. - pragma: const factory pragma(String name, [Object? options]) = pragma._ — Creates a hint named name with optional options. - pragma: final String name — The name of the hint. - pragma: final Object? options — Optional extra data parameterizing the hint. - abstract final class BigInt implements Comparable — An arbitrarily large integer value. - BigInt: external factory BigInt.from(num value) — Creates a big integer from the provided value number. - BigInt: external static BigInt get zero — A big integer with the numerical value 0. - BigInt: external static BigInt get one — A big integer with the numerical value 1. - BigInt: external static BigInt get two — A big integer with the numerical value 2. - BigInt: external static BigInt parse(String source, {int? radix}) — Parses source as a, possibly signed, integer literal and returns its value. - BigInt: external static BigInt? tryParse(String source, {int? radix}) — Parses source as a, possibly signed, integer literal and returns its value. - BigInt: int get bitLength — Returns the minimum number of bits required to store this big integer. - BigInt: int get sign — Returns the sign of this big integer. - BigInt: bool get isEven — Whether this big integer is even. - BigInt: bool get isOdd — Whether this big integer is odd. - BigInt: bool get isNegative — Whether this number is negative. - BigInt: bool get isValidInt — Whether this big integer can be represented as an int without losing precision. - BigInt: BigInt abs() — Returns the absolute value of this integer. - BigInt: BigInt remainder(BigInt other) — Returns the remainder of the truncating division of this by other. - BigInt: int compareTo(BigInt other) — Compares this to other. - BigInt: BigInt pow(int exponent) — Returns this to the power of exponent. - BigInt: BigInt modPow(BigInt exponent, BigInt modulus) — Returns this integer to the power of exponent modulo modulus. - BigInt: BigInt modInverse(BigInt modulus) — Returns the modular multiplicative inverse of this big integer modulo modulus. - BigInt: BigInt gcd(BigInt other) — Returns the greatest common divisor of this big integer and other. - BigInt: BigInt toUnsigned(int width) — Returns the least significant width bits of this big integer as a non-negative number (i.e. unsigned representation). - BigInt: BigInt toSigned(int width) — Returns the least significant width bits of this integer, extending the highest retained bit to the sign. - BigInt: int toInt() — Returns this BigInt as an int. - BigInt: double toDouble() — Returns this BigInt as a double. - BigInt: String toString() — Returns a String-representation of this integer. - BigInt: String toRadixString(int radix) — Converts this BigInt to a string representation in the given radix. - BigInt: BigInt operator -() — Return the negative value of this integer. - BigInt: BigInt operator +(BigInt other) — Adds other to this big integer. - BigInt: BigInt operator -(BigInt other) — Subtracts other from this big integer. - BigInt: BigInt operator *(BigInt other) — Multiplies other by this big integer. - BigInt: double operator /(BigInt other) — Double division operator. - BigInt: BigInt operator ~/(BigInt other) — Truncating integer division operator. - BigInt: BigInt operator %(BigInt other) — Euclidean modulo operator. - BigInt: BigInt operator <<(int shiftAmount) — Shift the bits of this integer to the left by shiftAmount. - BigInt: BigInt operator >>(int shiftAmount) — Shift the bits of this integer to the right by shiftAmount. - BigInt: BigInt operator &(BigInt other) — Bit-wise and operator. - BigInt: BigInt operator |(BigInt other) — Bit-wise or operator. - BigInt: BigInt operator ^(BigInt other) — Bit-wise exclusive-or operator. - BigInt: BigInt operator ~() — The bit-wise negate operator. - BigInt: bool operator <(BigInt other) — Whether this big integer is numerically smaller than other. - BigInt: bool operator <=(BigInt other) — Whether other is numerically greater than this big integer. - BigInt: bool operator >(BigInt other) — Whether this big integer is numerically greater than other. - BigInt: bool operator >=(BigInt other) — Whether other is numerically smaller than this big integer. - final class bool — The reserved words true and false denote objects that are the only two instances of this class. - bool: external const factory bool.fromEnvironment(String name, {bool defaultValue = false}) — Boolean value for name in the compilation configuration environment. - bool: external const factory bool.hasEnvironment(String name) — Whether name is declared in the compilation configuration environment. - bool: external static bool parse(String source, {bool caseSensitive = true}) — Parses source as an, optionally case-insensitive, boolean literal. - bool: external static bool? tryParse(String source, {bool caseSensitive = true}) — Parses source as an, optionally case-insensitive, boolean literal. - bool: external int get hashCode - bool: String toString() — Returns either "true" for true and "false" for false. - bool: bool operator &(bool other) — The logical conjunction ("and") of this and other. - bool: bool operator |(bool other) — The logical disjunction ("inclusive or") of this and other. - bool: bool operator ^(bool other) — The logical exclusive disjunction ("exclusive or") of this and other. - abstract interface class Comparable — Interface used by types that have an intrinsic ordering. - Comparable: static int compare(Comparable a, Comparable b) — A Comparator that compares one comparable to another. - Comparable: int compareTo(T other) — Compares this object to another object. - class DateTime implements Comparable — An instant in time, such as July 20, 1969, 8:18pm GMT. - DateTime: DateTime(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0]) — Constructs a DateTime instance specified in the local time zone. - DateTime: DateTime.utc(int year, [int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0]) — Constructs a DateTime instance specified in the UTC time zone. - DateTime: DateTime.now() — Constructs a DateTime instance with current date and time in the local time zone. - DateTime: DateTime.timestamp() — Constructs a DateTime with the current UTC date and time. - DateTime: external DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, {bool isUtc = false}) — Constructs a new DateTime instance with the given millisecondsSinceEpoch. - DateTime: external DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch, {bool isUtc = false}) — Constructs a new DateTime instance with the given microsecondsSinceEpoch. - DateTime: static const int monday = 1 - DateTime: static const int tuesday = 2 - DateTime: static const int wednesday = 3 - DateTime: static const int thursday = 4 - DateTime: static const int friday = 5 - DateTime: static const int saturday = 6 - DateTime: static const int sunday = 7 - DateTime: static const int daysPerWeek = 7 - DateTime: static const int january = 1 - DateTime: static const int february = 2 - DateTime: static const int march = 3 - DateTime: static const int april = 4 - DateTime: static const int may = 5 - DateTime: static const int june = 6 - DateTime: static const int july = 7 - DateTime: static const int august = 8 - DateTime: static const int september = 9 - DateTime: static const int october = 10 - DateTime: static const int november = 11 - DateTime: static const int december = 12 - DateTime: static const int monthsPerYear = 12 - DateTime: static DateTime parse(String formattedString) — Constructs a new DateTime instance based on formattedString. - DateTime: static DateTime? tryParse(String formattedString) — Constructs a new DateTime instance based on formattedString. - DateTime: final bool isUtc — True if this DateTime is set to UTC time. - DateTime: external int get hashCode - DateTime: external int get millisecondsSinceEpoch — The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC). - DateTime: external int get microsecondsSinceEpoch — The number of microseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC). - DateTime: external String get timeZoneName — The time zone name. - DateTime: external Duration get timeZoneOffset — The time zone offset, which is the difference between local time and UTC. - DateTime: external int get year — The year. - DateTime: external int get month — The month 1..12. - DateTime: external int get day — The day of the month 1..31. - DateTime: external int get hour — The hour of the day, expressed as in a 24-hour clock 0..23. - DateTime: external int get minute — The minute 0...59. - DateTime: external int get second — The second 0...59. - DateTime: external int get millisecond — The millisecond 0...999. - DateTime: external int get microsecond — The microsecond 0...999. - DateTime: external int get weekday — The day of the week monday..sunday. - DateTime: external bool isBefore(DateTime other) — Whether this DateTime occurs before other. - DateTime: external bool isAfter(DateTime other) — Whether this DateTime occurs after other. - DateTime: external bool isAtSameMomentAs(DateTime other) — Whether this DateTime occurs at the same moment as other. - DateTime: external int compareTo(DateTime other) — Compares this DateTime object to other, returning zero if the values are equal. - DateTime: DateTime toLocal() — Returns this DateTime value in the local time zone. - DateTime: DateTime toUtc() — Returns this DateTime value in the UTC time zone. - DateTime: String toString() — Returns a human-readable string for this instance. - DateTime: String toIso8601String() — Returns an ISO-8601 full-precision extended format representation. - DateTime: external DateTime add(Duration duration) — Returns a new DateTime instance with duration added to this DateTime. - DateTime: external DateTime subtract(Duration duration) — Returns a new DateTime instance with duration subtracted from this DateTime. - DateTime: external Duration difference(DateTime other) — Returns a Duration with the difference when subtracting other from this DateTime. - DateTime: external bool operator ==(Object other) — Whether other is a DateTime at the same moment and in the same time zone (UTC or local). - extension DateTimeCopyWith on DateTime — Adds copyWith method to DateTime objects. - DateTimeCopyWith: DateTime copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond, bool? isUtc}) — Creates a new DateTime from this one by updating individual properties. - abstract final class double extends num — A double-precision floating point number. - double: static const double nan = 0.0 / 0.0 - double: static const double infinity = 1.0 / 0.0 - double: static const double negativeInfinity = -infinity - double: static const double minPositive = 5e-324 - double: static const double maxFinite = 1.7976931348623157e+308 - double: external static double parse(String source) — Parse source as a double literal and return its value. - double: external static double? tryParse(String source) — Parse source as a double literal and return its value. - double: double get sign — The sign of the double's numerical value. - double: double remainder(num other) - double: double abs() - double: int round() — Returns the integer closest to this number. - double: int floor() — Returns the greatest integer no greater than this number. - double: int ceil() — Returns the least integer that is not smaller than this number. - double: int truncate() — Returns the integer obtained by discarding any fractional part of this number. - double: double roundToDouble() — Returns the integer double value closest to this. - double: double floorToDouble() — Returns the greatest integer double value no greater than this. - double: double ceilToDouble() — Returns the least integer double value no smaller than this. - double: double truncateToDouble() — Returns the integer double value obtained by discarding any fractional digits from this. - double: String toString() — Provide a representation of this double value. - double: double operator +(num other) - double: double operator -(num other) - double: double operator *(num other) - double: double operator %(num other) - double: double operator /(num other) - double: int operator ~/(num other) - double: double operator -() - class Duration implements Comparable — A difference between points in time. - Duration: const Duration({int days = 0, int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0, int microseconds = 0}) — Creates a new Duration object whose value is the sum of all individual parts. - Duration: static const int microsecondsPerMillisecond = 1000 — The number of microseconds per millisecond. - Duration: static const int millisecondsPerSecond = 1000 — The number of milliseconds per second. - Duration: static const int secondsPerMinute = 60 — The number of seconds per minute. - Duration: static const int minutesPerHour = 60 — The number of minutes per hour. - Duration: static const int hoursPerDay = 24 — The number of hours per day. - Duration: static const int microsecondsPerSecond = microsecondsPerMillisecond * millisecondsPerSecond — The number of microseconds per second. - Duration: static const int microsecondsPerMinute = microsecondsPerSecond * secondsPerMinute — The number of microseconds per minute. - Duration: static const int microsecondsPerHour = microsecondsPerMinute * minutesPerHour — The number of microseconds per hour. - Duration: static const int microsecondsPerDay = microsecondsPerHour * hoursPerDay — The number of microseconds per day. - Duration: static const int millisecondsPerMinute = millisecondsPerSecond * secondsPerMinute — The number of milliseconds per minute. - Duration: static const int millisecondsPerHour = millisecondsPerMinute * minutesPerHour — The number of milliseconds per hour. - Duration: static const int millisecondsPerDay = millisecondsPerHour * hoursPerDay — The number of milliseconds per day. - Duration: static const int secondsPerHour = secondsPerMinute * minutesPerHour — The number of seconds per hour. - Duration: static const int secondsPerDay = secondsPerHour * hoursPerDay — The number of seconds per day. - Duration: static const int minutesPerDay = minutesPerHour * hoursPerDay — The number of minutes per day. - Duration: static const Duration zero = Duration(seconds: 0) — An empty duration, representing zero time. - Duration: final int inMicroseconds — The time offset of this duration in microseconds. - Duration: int get inDays — The number of entire days spanned by this Duration. - Duration: int get inHours — The number of entire hours spanned by this Duration. - Duration: int get inMinutes — The number of whole minutes spanned by this Duration. - Duration: int get inSeconds — The number of whole seconds spanned by this Duration. - Duration: int get inMilliseconds — The number of whole milliseconds spanned by this Duration. - Duration: int get hashCode — The hash code of a duration is the hash code of its inMicroseconds. - Duration: bool get isNegative — Whether this Duration is negative. - Duration: int compareTo(Duration other) — Compares this Duration to other. - Duration: String toString() — A string representation of this Duration. - Duration: Duration abs() — A positive Duration with the same absolute length as this Duration. - Duration: Duration operator +(Duration other) — Adds this Duration and other and returns the sum as a new Duration object. - Duration: Duration operator -(Duration other) — The offset of this duration minus the offset of other. - Duration: Duration operator *(num factor) — This Duration scaled by factor. - Duration: Duration operator ~/(int quotient) — One-quotientth of this duration. - Duration: bool operator <(Duration other) — Whether this duration's offset is smaller than that of other. - Duration: bool operator >(Duration other) — Whether this duration's offset is greater than that of other. - Duration: bool operator <=(Duration other) — Whether this duration's offset is not greater than that of other. - Duration: bool operator >=(Duration other) — Whether this duration's offset is not smaller than that of other. - Duration: bool operator ==(Object other) — Whether this Duration is equivalent to other. - Duration: Duration operator -() — Creates a new Duration with the opposite sign of this Duration. - abstract interface class Enum — An enumerated value. - Enum: static int compareByIndex(T value1, T value2) — Compares two enum values by their index. - Enum: static int compareByName(T value1, T value2) — Compares enum values by name. - Enum: int get index — A numeric identifier for the enumerated value. - extension EnumName on Enum — Access to the name of an enum value. - EnumName: String get name — The name of the enum value. - extension EnumByName on Iterable — Access enum values by name. - EnumByName: T byName(String name) — Finds the enum value in this list with name name. - EnumByName: Map asNameMap() — Creates a map from the names of enum values to the values. - class Error — Error objects thrown in the case of a program failure. - Error: Error() - Error: static String safeToString(Object? object) — Safely convert a value to a String description. - Error: static Never throwWithStackTrace(Object error, StackTrace stackTrace) — Throws error with associated stack trace stackTrace. - Error: external StackTrace? get stackTrace — The stack trace at the point where this error was first thrown. - class AssertionError extends Error — Error thrown by the runtime system when an assert statement fails. - AssertionError: AssertionError([this.message]) — Creates an assertion error with the provided message. - AssertionError: final Object? message — Message describing the assertion error. - AssertionError: String toString() - class TypeError extends Error — Error thrown by the runtime system when a dynamic type error happens. - class ArgumentError extends Error — Error thrown when a function is passed an unacceptable argument. - ArgumentError: ArgumentError([this.message, @Since("2.14") this.name]) — Creates an error with message describing the problem with an argument. - ArgumentError: ArgumentError.value(value, [this.name, this.message]) — Creates error containing the invalid value. - ArgumentError: ArgumentError.notNull([this.name]) — Creates an argument error for a null argument that must not be null. - ArgumentError: static T checkNotNull(T? argument, [String? name]) — Throws if argument is null. - ArgumentError: final dynamic invalidValue — The invalid value. - ArgumentError: final String? name — Name of the invalid argument, if available. - ArgumentError: final dynamic message — Message describing the problem. - ArgumentError: String toString() - class RangeError extends ArgumentError — Error thrown due to an argument value being outside an accepted range. - RangeError: RangeError(message) — Create a new RangeError with the given message. - RangeError: RangeError.value(num value, [String? name, String? message]) — Create a new RangeError with a message for the given value. - RangeError: RangeError.range(num invalidValue, int? minValue, int? maxValue, [String? name, String? message]) — Create a new RangeError for a value being outside the valid range. - RangeError: factory RangeError.index(int index, dynamic indexable, [String? name, String? message, int? length]) = IndexError — Creates a new RangeError stating that index is not a valid index into indexable. - RangeError: static int checkValueInInterval(int value, int minValue, int maxValue, [String? name, String? message]) — Check that an integer value lies in a specific interval. - RangeError: static int checkValidIndex(int index, dynamic indexable, [String? name, int? length, String? message]) — Check that index is a valid index into an indexable object. - RangeError: static int checkValidRange(int start, int? end, int length, [String? startName, String? endName, String? message]) — Check that a range represents a slice of an indexable object. - RangeError: static int checkNotNegative(int value, [String? name, String? message]) — Check that an integer value is non-negative. - RangeError: final num? start — The minimum value that value is allowed to assume. - RangeError: final num? end — The maximum value that value is allowed to assume. - RangeError: num? get invalidValue - class IndexError extends ArgumentError implements RangeError — A specialized RangeError used when an index is not in the range 0..indexable.length-1. - IndexError: IndexError(int invalidValue, dynamic indexable, [String? name, String? message, int? length]) — Creates a new IndexError stating that invalidValue is not a valid index into indexable. - IndexError: IndexError.withLength(int invalidValue, this.length, {this.indexable, String? name, String? message}) — Creates a new IndexError stating that invalidValue is not a valid index into indexable. - IndexError: static int check(int index, int length, {Object? indexable, String? name, String? message}) — Check that index is a valid index into an indexable object. - IndexError: final Object? indexable — The indexable object that invalidValue was not a valid index into. - IndexError: final int length — The length of indexable at the time of the error. - IndexError: int get invalidValue - IndexError: int get start - IndexError: int get end - class NoSuchMethodError extends Error — Error thrown on an invalid function or method invocation. - NoSuchMethodError: external factory NoSuchMethodError.withInvocation(Object? receiver, Invocation invocation) — Creates a NoSuchMethodError corresponding to a failed method call. - NoSuchMethodError: external String toString() - class UnsupportedError extends Error — The operation was not allowed by the object. - UnsupportedError: UnsupportedError(String this.message) - UnsupportedError: final String? message - UnsupportedError: String toString() - class UnimplementedError extends Error implements UnsupportedError — Thrown by operations that have not been implemented yet. - UnimplementedError: UnimplementedError([this.message]) - UnimplementedError: final String? message - UnimplementedError: String toString() - class StateError extends Error — The operation was not allowed by the current state of the object. - StateError: StateError(this.message) - StateError: final String message - StateError: String toString() - class ConcurrentModificationError extends Error — Error occurring when a collection is modified during iteration. - ConcurrentModificationError: ConcurrentModificationError([this.modifiedObject]) - ConcurrentModificationError: final Object? modifiedObject — The object that was modified in an incompatible way. - ConcurrentModificationError: String toString() - final class OutOfMemoryError implements Error — Error that the platform can use in case of memory shortage. - OutOfMemoryError: const OutOfMemoryError() - OutOfMemoryError: StackTrace? get stackTrace - OutOfMemoryError: String toString() - final class StackOverflowError implements Error — Error that the platform can use in case of stack overflow. - StackOverflowError: const StackOverflowError() - StackOverflowError: StackTrace? get stackTrace - StackOverflowError: String toString() - abstract interface class Exception — A marker interface implemented by all core library exceptions. - Exception: factory Exception([message]) - class FormatException implements Exception — Exception thrown when a string or some other data does not have an expected format and cannot be parsed or processed. - FormatException: const FormatException([this.message = "", this.source, this.offset]) — Creates a new FormatException with an optional error message. - FormatException: final String message — A message describing the format error. - FormatException: final dynamic source — The actual source input which caused the error. - FormatException: final int? offset — The offset in source where the error was detected. - FormatException: String toString() — Returns a description of the format exception. - class IntegerDivisionByZeroException implements Exception, UnsupportedError - IntegerDivisionByZeroException: const IntegerDivisionByZeroException() - IntegerDivisionByZeroException: String? get message - IntegerDivisionByZeroException: StackTrace? get stackTrace - IntegerDivisionByZeroException: String toString() - abstract final class Function — A function value. - Function: external static apply(Function function, List? positionalArguments, [Map? namedArguments]) — Dynamically call function with the specified arguments. - Function: int get hashCode — A hash code value that is compatible with operator==. - Function: bool operator ==(Object other) — Test whether another object is equal to this function. - abstract final class int extends num — An integer number. - int: external const factory int.fromEnvironment(String name, {int defaultValue = 0}) — Integer value for name in the compilation configuration environment. - int: external static int parse(String source, {int? radix}) — Parse source as a, possibly signed, integer literal and return its value. - int: external static int? tryParse(String source, {int? radix}) — Parse source as a, possibly signed, integer literal. - int: bool get isEven — Returns true if and only if this integer is even. - int: bool get isOdd — Returns true if and only if this integer is odd. - int: int get bitLength — Returns the minimum number of bits required to store this integer. - int: int get trailingZeroBitCount — The number of trailing (least significant) zero bits in the binary representation of this integer. - int: int get oneBitCount — The number of 1 bits in the binary representation of this integer. - int: int get sign — Returns the sign of this integer. - int: int modPow(int exponent, int modulus) — Returns this integer to the power of exponent modulo modulus. - int: int modInverse(int modulus) — Returns the modular multiplicative inverse of this integer modulo modulus. - int: int gcd(int other) — Returns the greatest common divisor of this integer and other. - int: int toUnsigned(int width) — Returns the least significant width bits of this integer as a non-negative number (i.e. unsigned representation). - int: int toSigned(int width) — Returns the least significant width bits of this integer, extending the highest retained bit to the sign. - int: int abs() — Returns the absolute value of this integer. - int: int round() — Returns this. - int: int floor() — Returns this. - int: int ceil() — Returns this. - int: int truncate() — Returns this. - int: double roundToDouble() — Returns this.toDouble. - int: double floorToDouble() — Returns this.toDouble. - int: double ceilToDouble() — Returns this.toDouble. - int: double truncateToDouble() — Returns this.toDouble. - int: String toString() — Returns a string representation of this integer. - int: String toRadixString(int radix) — Converts this int to a string representation in the given radix. - int: int operator &(int other) — Bit-wise and operator. - int: int operator |(int other) — Bit-wise or operator. - int: int operator ^(int other) — Bit-wise exclusive-or operator. - int: int operator ~() — The bit-wise negate operator. - int: int operator <<(int shiftAmount) — Shift the bits of this integer to the left by shiftAmount. - int: int operator >>(int shiftAmount) — Shift the bits of this integer to the right by shiftAmount. - int: int operator >>>(int shiftAmount) — Bitwise unsigned right shift by shiftAmount bits. - int: int operator -() — Return the negative value of this integer. - abstract class Invocation — Representation of the invocation of a member on an object. - Invocation: Invocation() - Invocation: factory Invocation.method(Symbol memberName, Iterable? positionalArguments, [Map? namedArguments]) — Creates an invocation corresponding to a method invocation. - Invocation: factory Invocation.genericMethod(Symbol memberName, Iterable? typeArguments, Iterable? positionalArguments, [Map? namedArguments]) — Creates an invocation corresponding to a generic method invocation. - Invocation: factory Invocation.getter(Symbol name) = _Invocation.getter — Creates an invocation corresponding to a getter invocation. - Invocation: factory Invocation.setter(Symbol memberName, Object? argument) = _Invocation.setter — Creates an invocation corresponding to a setter invocation. - Invocation: Symbol get memberName — The name of the invoked member. - Invocation: List get typeArguments — An unmodifiable view of the type arguments of the call. - Invocation: List get positionalArguments — An unmodifiable view of the positional arguments of the call. - Invocation: Map get namedArguments — An unmodifiable view of the named arguments of the call. - Invocation: bool get isMethod — Whether the invocation was a method call. - Invocation: bool get isGetter — Whether the invocation was a getter call. - Invocation: bool get isSetter — Whether the invocation was a setter call. - Invocation: bool get isAccessor — Whether the invocation was a getter or a setter call. - abstract mixin class Iterable — A collection of values, or "elements", that can be accessed sequentially. - Iterable: const Iterable() - Iterable: factory Iterable.generate(int count, [E generator(int index)?]) — Creates an Iterable which generates its elements dynamically. - Iterable: factory Iterable.withIterator(Iterator Function() iteratorFactory) = _WithIteratorIterable — Creates an Iterable from the Iterator factory. - Iterable: const factory Iterable.empty() = EmptyIterable — Creates an empty iterable. - Iterable: static Iterable castFrom(Iterable source) — Adapts source to be an Iterable. - Iterable: static String iterableToShortString(Iterable iterable, [String leftDelimiter = '(', String rightDelimiter = ')']) — Convert an Iterable to a string like Iterable.toString. - Iterable: static String iterableToFullString(Iterable iterable, [String leftDelimiter = '(', String rightDelimiter = ')']) — Converts an Iterable to a string. - Iterable: Iterator get iterator — A new Iterator that allows iterating the elements of this Iterable. - Iterable: int get length — The number of elements in this Iterable. - Iterable: bool get isEmpty — Whether this collection has no elements. - Iterable: bool get isNotEmpty — Whether this collection has at least one element. - Iterable: E get first — The first element. - Iterable: E get last — The last element. - Iterable: E get single — Checks that this iterable has only one element, and returns that element. - Iterable: Iterable cast() — A view of this iterable as an iterable of R instances. - Iterable: Iterable followedBy(Iterable other) — Creates the lazy concatenation of this iterable and other. - Iterable: Iterable map(T toElement(E e)) — The current elements of this iterable modified by toElement. - Iterable: Iterable where(bool test(E element)) — Creates a new lazy Iterable with all elements that satisfy the predicate test. - Iterable: Iterable whereType() — Creates a new lazy Iterable with all elements that have type T. - Iterable: Iterable expand(Iterable toElements(E element)) — Expands each element of this Iterable into zero or more elements. - Iterable: bool contains(Object? element) — Whether the collection contains an element equal to element. - Iterable: void forEach(void action(E element)) — Invokes action on each element of this iterable in iteration order. - Iterable: E reduce(E combine(E value, E element)) — Reduces a collection to a single value by iteratively combining elements of the collection using the provided function. - Iterable: T fold(T initialValue, T combine(T previousValue, E element)) — Reduces a collection to a single value by iteratively combining each element of the collection with an existing value - Iterable: bool every(bool test(E element)) — Checks whether every element of this iterable satisfies test. - Iterable: String join([String separator = ""]) — Converts each element to a String and concatenates the strings. - Iterable: bool any(bool test(E element)) — Checks whether any element of this iterable satisfies test. - Iterable: List toList({bool growable = true}) — Creates a List containing the elements of this Iterable. - Iterable: Set toSet() — Creates a Set containing the same elements as this iterable. - Iterable: Iterable take(int count) — Creates a lazy iterable of the count first elements of this iterable. - Iterable: Iterable takeWhile(bool test(E value)) — Creates a lazy iterable of the leading elements satisfying test. - Iterable: Iterable skip(int count) — Creates an Iterable that provides all but the first count elements. - Iterable: Iterable skipWhile(bool test(E value)) — Creates an Iterable that skips leading elements while test is satisfied. - Iterable: E firstWhere(bool test(E element), {E orElse()?}) — The first element that satisfies the given predicate test. - Iterable: E lastWhere(bool test(E element), {E orElse()?}) — The last element that satisfies the given predicate test. - Iterable: E singleWhere(bool test(E element), {E orElse()?}) — The single element that satisfies test. - Iterable: E elementAt(int index) — Returns the indexth element. - Iterable: String toString() — Returns a string representation of (some of) the elements of this. - abstract interface class Iterator — An interface for getting items, one at a time, from an object. - Iterator: E get current — The current element. - Iterator: bool moveNext() — Advances the iterator to the next element of the iteration. - abstract interface class List implements Iterable, _ListIterable — An indexable collection of objects with a length. - List: external factory List.filled(int length, E fill, {bool growable = false}) — Creates a list of the given length with fill at each position. - List: external factory List.empty({bool growable = false}) — Creates a new empty list. - List: external factory List.from(Iterable elements, {bool growable = true}) — Creates a list containing all elements. - List: external factory List.of(Iterable elements, {bool growable = true}) — Creates a list from elements. - List: external factory List.generate(int length, E generator(int index), {bool growable = true}) — Generates a list of values. - List: external factory List.unmodifiable(Iterable elements) — Creates an unmodifiable list containing all elements. - List: factory List.unmodifiableOf(Iterable elements) = List.unmodifiable — Creates an unmodifiable list containing all elements. - List: static List castFrom(List source) — Adapts source to be a List. - List: static void copyRange(List target, int at, List source, [int? start, int? end]) — Copy a range of one list into another list. - List: static void writeIterable(List target, int at, Iterable source) — Write the elements of an iterable into a list. - List: void set first(E value) — The first element of the list. - List: void set last(E value) — The last element of the list. - List: int get length — The number of objects in this list. - List: set length(int newLength) — Setting the length changes the number of elements in the list. - List: Iterable get reversed — An Iterable of the objects in this list in reverse order. - List: List cast() — Returns a view of this list as a list of R instances. - List: void add(E value) — Adds value to the end of this list, extending the length by one. - List: void addAll(Iterable iterable) — Appends all objects of iterable to the end of this list. - List: void sort([int compare(E a, E b)?]) — Sorts this list according to the order specified by the compare function. - List: void shuffle([Random? random]) — Shuffles the elements of this list randomly. - List: int indexOf(E element, [int start = 0]) — The first index of element in this list. - List: int indexWhere(bool test(E element), [int start = 0]) — The first index in the list that satisfies the provided test. - List: int lastIndexWhere(bool test(E element), [int? start]) — The last index in the list that satisfies the provided test. - List: int lastIndexOf(E element, [int? start]) — The last index of element in this list. - List: void clear() — Removes all objects from this list; the length of the list becomes zero. - List: void insert(int index, E element) — Inserts element at position index in this list. - List: void insertAll(int index, Iterable iterable) — Inserts all objects of iterable at position index in this list. - List: void setAll(int index, Iterable iterable) — Overwrites elements with the objects of iterable. - List: bool remove(Object? value) — Removes the first occurrence of value from this list. - List: E removeAt(int index) — Removes the object at position index from this list. - List: E removeLast() — Removes and returns the last object in this list. - List: void removeWhere(bool test(E element)) — Removes all objects from this list that satisfy test. - List: void retainWhere(bool test(E element)) — Removes all objects from this list that fail to satisfy test. - List: List sublist(int start, [int? end]) — Returns a new list containing the elements between start and end. - List: Iterable getRange(int start, int end) — Creates an Iterable that iterates over a range of elements. - List: void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) — Writes some elements of iterable into a range of this list. - List: void removeRange(int start, int end) — Removes a range of elements from the list. - List: void fillRange(int start, int end, [E? fillValue]) — Overwrites a range of elements with fillValue. - List: void replaceRange(int start, int end, Iterable replacements) — Replaces a range of elements with the elements of replacements. - List: Map asMap() — An unmodifiable Map view of this list. - List: E operator [](int index) — The object at the given index in the list. - List: void operator []=(int index, E value) — Sets the value at the given index in the list to value. - List: List operator +(List other) — Returns the concatenation of this list and other. - List: bool operator ==(Object other) — Whether this list is equal to other. - abstract interface class Map — A collection of key/value pairs, from which you retrieve a value using its associated key. - Map: external factory Map() — Creates an empty LinkedHashMap. - Map: factory Map.from(Map other) = LinkedHashMap.from — Creates a LinkedHashMap with the same keys and values as other. - Map: factory Map.of(Map other) = LinkedHashMap.of — Creates a LinkedHashMap with the same keys and values as other. - Map: external factory Map.unmodifiable(Map other) — Creates an unmodifiable hash-based map containing the entries of other. - Map: factory Map.unmodifiableOf(Map other) = Map.unmodifiable — Creates an unmodifiable hash-based map containing the entries of other. - Map: factory Map.identity() = LinkedHashMap.identity — Creates an identity map with the default implementation, LinkedHashMap. - Map: factory Map.fromIterable(Iterable iterable, {K key(dynamic element)?, V value(dynamic element)?}) = LinkedHashMap.fromIterable — Creates a Map instance in which the keys and values are computed from the iterable. - Map: factory Map.fromIterables(Iterable keys, Iterable values) = LinkedHashMap.fromIterables — Creates a map associating the given keys to the given values. - Map: factory Map.fromEntries(Iterable> entries) — Creates a new map and adds all entries. - Map: static Map castFrom(Map source) — Adapts source to be a Map. - Map: Iterable> get entries — The map entries of this Map. - Map: Iterable get keys — The keys of this Map. - Map: Iterable get values — The values of this Map. - Map: int get length — The number of key/value pairs in the map. - Map: bool get isEmpty — Whether there is no key/value pair in the map. - Map: bool get isNotEmpty — Whether there is at least one key/value pair in the map. - Map: Map cast() — Provides a view of this map as having RK keys and RV instances, if necessary. - Map: bool containsValue(Object? value) — Whether this map contains the given value. - Map: bool containsKey(Object? key) — Whether this map contains the given key. - Map: Map map(MapEntry convert(K key, V value)) — Returns a new map where all entries of this map are transformed by the given convert function. - Map: void addEntries(Iterable> newEntries) — Adds all key/value pairs of newEntries to this map. - Map: V update(K key, V update(V value), {V ifAbsent()?}) — Updates the value for the provided key. - Map: void updateAll(V update(K key, V value)) — Updates all values. - Map: void removeWhere(bool test(K key, V value)) — Removes all entries of this map that satisfy the given test. - Map: V putIfAbsent(K key, V ifAbsent()) — Look up the value of key, or add a new entry if it isn't there. - Map: void addAll(Map other) — Adds all key/value pairs of other to this map. - Map: V? remove(Object? key) — Removes key and its associated value, if present, from the map. - Map: void clear() — Removes all entries from the map. - Map: void forEach(void action(K key, V value)) — Applies action to each key/value pair of the map. - Map: V? operator [](Object? key) — The value for the given key, or null if key is not in the map. - Map: void operator []=(K key, V value) — Associates the key with the given value. - final class MapEntry — A key/value pair representing an entry in a Map. - MapEntry: const factory MapEntry(K key, V value) = MapEntry._ — Creates an entry with key and value. - MapEntry: final K key — The key of the entry. - MapEntry: final V value — The value associated to key in a map. - MapEntry: String toString() — String representation intended for debugging only. - final class Null — The reserved word null denotes an object that is the sole instance of this class. - Null: external int get hashCode - Null: String toString() — Returns the string "null". - sealed class num implements Comparable — An integer or floating-point number. - num: static num parse(String input, [@deprecated num onError(String input)?]) — Parses a string containing a number literal into a number. - num: static num? tryParse(String input) — Parses a string containing a number literal into a number. - num: int get hashCode — Returns a hash code for a numerical value. - num: bool get isNaN — Whether this number is a Not-a-Number value. - num: bool get isNegative — Whether this number is negative. - num: bool get isInfinite — Whether this number is positive infinity or negative infinity. - num: bool get isFinite — Whether this number is finite. - num: num get sign — Negative one, zero or positive one depending on the sign and numerical value of this number. - num: int compareTo(num other) — Compares this to other. - num: num remainder(num other) — The remainder of the truncating division of this by other. - num: num abs() — The absolute value of this number. - num: int round() — The integer closest to this number. - num: int floor() — The greatest integer no greater than this number. - num: int ceil() — The least integer no smaller than this. - num: int truncate() — The integer obtained by discarding any fractional digits from this. - num: double roundToDouble() — The double integer value closest to this value. - num: double floorToDouble() — Returns the greatest double integer value no greater than this. - num: double ceilToDouble() — Returns the least double integer value no smaller than this. - num: double truncateToDouble() — Returns the double integer value obtained by discarding any fractional digits from the double value of this. - num: num clamp(num lowerLimit, num upperLimit) — Returns this num clamped to be in the range lowerLimit-upperLimit. - num: int toInt() — Truncates this num to an integer and returns the result as an int. - num: double toDouble() — This number as a double. - num: String toStringAsFixed(int fractionDigits) — A decimal-point string-representation of this number. - num: String toStringAsExponential([int? fractionDigits]) — An exponential string-representation of this number. - num: String toStringAsPrecision(int precision) — A string representation with precision significant digits. - num: String toString() — The shortest string that correctly represents this number. - num: bool operator ==(Object other) — Test whether this value is numerically equal to other. - num: num operator +(num other) — Adds other to this number. - num: num operator -(num other) — Subtracts other from this number. - num: num operator *(num other) — Multiplies this number by other. - num: num operator %(num other) — Euclidean modulo of this number by other. - num: double operator /(num other) — Divides this number by other. - num: int operator ~/(num other) — Truncating division operator. - num: num operator -() — The negation of this value. - num: bool operator <(num other) — Whether this number is numerically smaller than other. - num: bool operator <=(num other) — Whether this number is numerically smaller than or equal to other. - num: bool operator >(num other) — Whether this number is numerically greater than other. - num: bool operator >=(num other) — Whether this number is numerically greater than or equal to other. - class Object — The base class for all Raya objects except null. - Object: const Object() — Creates a new Object instance. - Object: static int hash(Object? object1, Object? object2, [Object? object3 = sentinelValue, Object? object4 = sentinelValue, Object? object5 = sentinelValue, Object? object6 = sentinelValue, Object? object7 = sentinelValue, Object? object8 = sentinelValue, Object? object9 = sentinelValue, Object? object10 = sentinelValue, Object? object11 = sentinelValue, Object? object12 = sentinelValue, Object? object13 = sentinelValue, Object? object14 = sentinelValue, Object? object15 = sentinelValue, Object? object16 = sentinelValue, Object? object17 = sentinelValue, Object? object18 = sentinelValue, Object? object19 = sentinelValue, Object? object20 = sentinelValue]) — Creates a combined hash code for a number of objects. - Object: static int hashAll(Iterable objects) — Creates a combined hash code for a sequence of objects. - Object: static int hashAllUnordered(Iterable objects) — Creates a combined hash code for a collection of objects. - Object: external int get hashCode — The hash code for this object. - Object: external Type get runtimeType — A representation of the runtime type of the object. - Object: external String toString() — A string representation of this object. - Object: external dynamic noSuchMethod(Invocation invocation) — Invoked when a nonexistent method or property is accessed. - Object: external bool operator ==(Object other) — The equality operator. - abstract interface class Pattern — An interface for basic searches within strings. - Pattern: Iterable allMatches(String string, [int start = 0]) — Matches this pattern against the string repeatedly. - Pattern: Match? matchAsPrefix(String string, [int start = 0]) — Matches this pattern against the start of string. - abstract interface class Match — A result from searching within a string. - Match: int get start — The index in the string where the match starts. - Match: int get end — The index in the string after the last character of the match. - Match: int get groupCount — Returns the number of captured groups in the match. - Match: String get input — The string on which this match was computed. - Match: Pattern get pattern — The pattern used to search in input. - Match: String? group(int group) — The string matched by the given group. - Match: List groups(List groupIndices) — A list of the groups with the given indices. - Match: String? operator [](int group) — The string matched by the given group. - abstract final class Record — A record value. - Record: Type get runtimeType — A Type object representing the runtime type of a record. - Record: int get hashCode — A hash-code compatible with ==. - Record: String toString() — Creates a string-representation of the record. - Record: bool operator ==(Object other) — Checks whether other has the same shape and equal fields to this record. - abstract interface class RegExp implements Pattern — A regular expression pattern. - RegExp: external factory RegExp(String source, {bool multiLine = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) — Constructs a regular expression. - RegExp: external static String escape(String text) — Creates regular expression syntax that matches the input text. - RegExp: String get pattern — The regular expression pattern source of this RegExp. - RegExp: bool get isMultiLine — Whether this regular expression matches multiple lines. - RegExp: bool get isCaseSensitive — Whether this regular expression is case sensitive. - RegExp: bool get isUnicode — Whether this regular expression uses Unicode mode. - RegExp: bool get isDotAll — Whether "." in this regular expression matches line terminators. - RegExp: RegExpMatch? firstMatch(String input) — Finds the first match of the regular expression in the string input. - RegExp: Iterable allMatches(String input, [int start = 0]) - RegExp: bool hasMatch(String input) — Checks whether this regular expression has a match in the input. - RegExp: String? stringMatch(String input) — Finds the string of the first match of this regular expression in input. - abstract interface class RegExpMatch implements Match — A regular expression match. - RegExpMatch: Iterable get groupNames — The names of the named capture groups of pattern. - RegExpMatch: RegExp get pattern - RegExpMatch: String? namedGroup(String name) — The string captured by the named capture group name. - abstract interface class Set implements Iterable, _SetIterable — A collection of objects in which each object can occur only once. - Set: factory Set() = LinkedHashSet — Creates an empty Set. - Set: factory Set.identity() = LinkedHashSet.identity — Creates an empty identity Set. - Set: factory Set.from(Iterable elements) = LinkedHashSet.from — Creates a Set that contains all elements. - Set: factory Set.of(Iterable elements) = LinkedHashSet.of — Creates a Set from elements. - Set: factory Set.unmodifiable(Iterable elements) — Creates an unmodifiable Set from elements. - Set: static Set castFrom(Set source, {Set Function()? newSet}) — Adapts source to be a Set. - Set: Iterator get iterator — An iterator that iterates over the elements of this set. - Set: Set cast() — Provides a view of this set as a set of R instances. - Set: bool contains(Object? value) — Whether value is in the set. - Set: bool add(E value) — Adds value to the set. - Set: void addAll(Iterable elements) — Adds all elements to this set. - Set: bool remove(Object? value) — Removes value from the set. - Set: E? lookup(Object? object) — If an object equal to object is in the set, return it. - Set: void removeAll(Iterable elements) — Removes each element of elements from this set. - Set: void retainAll(Iterable elements) — Removes all elements of this set that are not elements in elements. - Set: void removeWhere(bool test(E element)) — Removes all elements of this set that satisfy test. - Set: void retainWhere(bool test(E element)) — Removes all elements of this set that fail to satisfy test. - Set: bool containsAll(Iterable other) — Whether this set contains all the elements of other. - Set: Set intersection(Set other) — Creates a new set which is the intersection between this set and other. - Set: Set union(Set other) — Creates a new set which contains all the elements of this set and other. - Set: Set difference(Set other) — Creates a new set with the elements of this that are not in other. - Set: void clear() — Removes all elements from the set. - Set: Set toSet() — Creates a Set with the same elements and behavior as this Set. - abstract interface class Sink — A generic destination for data. - Sink: void add(T data) — Adds data to the sink. - Sink: void close() — Closes the sink. - abstract interface class StackTrace — An interface implemented by all stack trace objects. - StackTrace: StackTrace() - StackTrace: factory StackTrace.fromString(String stackTraceString) = _StringStackTrace — Create a StackTrace object from stackTraceString. - StackTrace: static const empty = _StringStackTrace("") — A stack trace object with no information. - StackTrace: external static StackTrace get current — Returns a representation of the current stack trace. - StackTrace: String toString() — Returns a String representation of the stack trace. - class Stopwatch — A stopwatch which measures time while it's running. - Stopwatch: Stopwatch() — Creates a Stopwatch in stopped state with a zero elapsed count. - Stopwatch: int get frequency — Frequency of the elapsed counter in Hz. - Stopwatch: int get elapsedTicks — The elapsed number of clock ticks since calling start while the Stopwatch is running. - Stopwatch: Duration get elapsed — The elapsedTicks counter converted to a Duration. - Stopwatch: external int get elapsedMicroseconds — The elapsedTicks counter converted to microseconds. - Stopwatch: external int get elapsedMilliseconds — The elapsedTicks counter converted to milliseconds. - Stopwatch: bool get isRunning — Whether the Stopwatch is currently running. - Stopwatch: void start() — Starts the Stopwatch. - Stopwatch: void stop() — Stops the Stopwatch. - Stopwatch: void reset() — Resets the elapsed count to zero. - abstract final class String implements Comparable, Pattern — A sequence of UTF-16 code units. - String: external factory String.fromCharCodes(Iterable charCodes, [int start = 0, int? end]) — Allocates a new string containing the specified charCodes. - String: external factory String.fromCharCode(int charCode) — Allocates a new string containing the specified charCode. - String: external const factory String.fromEnvironment(String name, {String defaultValue = ""}) — Value for name in the compilation configuration environment declaration. - String: int get length — The length of the string. - String: int get hashCode — A hash code derived from the code units of the string. - String: bool get isEmpty — Whether this string is empty. - String: bool get isNotEmpty — Whether this string is not empty. - String: List get codeUnits — An unmodifiable list of the UTF-16 code units of this string. - String: Runes get runes — An Iterable of Unicode code-points of this string. - String: int codeUnitAt(int index) — Returns the 16-bit UTF-16 code unit at the given index. - String: int compareTo(String other) — Compares this string to other. - String: bool endsWith(String other) — Whether this string ends with other. - String: bool startsWith(Pattern pattern, [int index = 0]) — Whether this string starts with a match of pattern. - String: int indexOf(Pattern pattern, [int start = 0]) — Returns the position of the first match of pattern in this string, starting at start, inclusive: - String: int lastIndexOf(Pattern pattern, [int? start]) — The starting position of the last match pattern in this string. - String: String substring(int start, [int? end]) — The substring of this string from start, inclusive, to end, exclusive. - String: String trim() — The string without any leading and trailing whitespace. - String: String trimLeft() — The string without any leading whitespace. - String: String trimRight() — The string without any trailing whitespace. - String: String padLeft(int width, [String padding = ' ']) — Pads this string on the left if it is shorter than width. - String: String padRight(int width, [String padding = ' ']) — Pads this string on the right if it is shorter than width. - String: bool contains(Pattern other, [int startIndex = 0]) — Whether this string contains a match of other. - String: String replaceFirst(Pattern from, String to, [int startIndex = 0]) — Creates a new string with the first occurrence of from replaced by to. - String: String replaceFirstMapped(Pattern from, String replace(Match match), [int startIndex = 0]) — Replace the first occurrence of from in this string. - String: String replaceAll(Pattern from, String replace) — Replaces all substrings that match from with replace. - String: String replaceAllMapped(Pattern from, String Function(Match match) replace) — Replace all substrings that match from by a computed string. - String: String replaceRange(int start, int? end, String replacement) — Replaces the substring from start to end with replacement. - String: List split(Pattern pattern) — Splits the string at matches of pattern and returns a list of substrings. - String: String splitMapJoin(Pattern pattern, {String Function(Match)? onMatch, String Function(String)? onNonMatch}) — Splits the string, converts its parts, and combines them into a new string. - String: String toLowerCase() — Converts all characters in this string to lower case. - String: String toUpperCase() — Converts all characters in this string to upper case. - String: String operator [](int index) — The character (as a single-code-unit String) at the given index. - String: bool operator ==(Object other) — Whether other is a String with the same sequence of code units. - String: String operator +(String other) — Creates a new string by concatenating this string with other. - String: String operator *(int times) — Creates a new string by concatenating this string with itself a number of times. - final class Runes extends Iterable — The runes (integer Unicode code points) of a String. - Runes: Runes(this.string) — Creates a Runes iterator for string. - Runes: final String string — The string that this is the runes of. - Runes: RuneIterator get iterator - Runes: int get last - final class RuneIterator implements Iterator — Iterator for reading runes (integer Unicode code points) of a Raya string. - RuneIterator: RuneIterator(String string) — Create an iterator positioned at the beginning of the string. - RuneIterator: RuneIterator.at(String string, int index) — Create an iterator positioned before the indexth code unit of the string. - RuneIterator: final String string — String being iterated. - RuneIterator: int get rawIndex — The starting position of the current rune in the string. - RuneIterator: void set rawIndex(int rawIndex) — Resets the iterator to the rune at the specified index of the string. - RuneIterator: int get current — The rune (integer Unicode code point) starting at the current position in the string. - RuneIterator: int get currentSize — The number of code units comprising the current rune. - RuneIterator: String get currentAsString — A string containing the current rune. - RuneIterator: void reset([int rawIndex = 0]) — Resets the iterator to the given index into the string. - RuneIterator: bool moveNext() — Move to the next code point. - RuneIterator: bool movePrevious() — Move back to the previous code point. - class StringBuffer implements StringSink — A class for concatenating strings efficiently. - StringBuffer: external StringBuffer([Object content = ""]) — Creates a string buffer containing the provided content. - StringBuffer: external int get length — Returns the length of the content that has been accumulated so far. - StringBuffer: bool get isEmpty — Returns whether the buffer is empty. - StringBuffer: bool get isNotEmpty — Returns whether the buffer is not empty. - StringBuffer: external void write(Object? object) - StringBuffer: external void writeCharCode(int charCode) - StringBuffer: external void writeAll(Iterable objects, [String separator = ""]) - StringBuffer: external void writeln([Object? obj = ""]) — Writes the string representation of object followed by a newline. - StringBuffer: external void clear() — Clears the string buffer. - StringBuffer: external String toString() — Returns the contents of buffer as a single string. - abstract interface class StringSink - StringSink: void write(Object? object) — Writes the string representation of object. - StringSink: void writeAll(Iterable objects, [String separator = ""]) — Writes the elements of objects separated by separator. - StringSink: void writeln([Object? object = ""]) — Writes the string representation of object followed by a newline. - StringSink: void writeCharCode(int charCode) — Writes a string containing the character with code point charCode. - abstract class Symbol — Opaque name used by mirrors, invocations and Function.apply. - Symbol: const factory Symbol(String name) = internal.Symbol — Constructs a new Symbol representing the provided name. - Symbol: static const Symbol unaryMinus = Symbol("unary-") — The symbol corresponding to the name of the unary minus operator. - Symbol: static const Symbol empty = Symbol("") — The empty symbol. - Symbol: int get hashCode — Returns a hash code compatible with operator==. - Symbol: bool operator ==(Object other) — Symbols are equal to other symbols with an equal (==) name string. - abstract interface class Type — Runtime representation of a type. - Type: int get hashCode — A hash code for the type which is compatible with operator==. - Type: String toString() — Returns a string which represents the underlying type. - Type: bool operator ==(Object other) — Whether other is a Type instance representing an equivalent type. - abstract interface class Uri — A parsed URI, such as a URL. - Uri: factory Uri({String? scheme, String? userInfo, String? host, int? port, String? path, Iterable? pathSegments, String? query, Map? queryParameters, String? fragment}) = _Uri — Creates a new URI from its components. - Uri: factory Uri.http(String authority, [String unencodedPath, Map? queryParameters]) = _Uri.http — Creates a new http URI from authority, path and query. - Uri: factory Uri.https(String authority, [String unencodedPath, Map? queryParameters]) = _Uri.https — Creates a new https URI from authority, path and query. - Uri: factory Uri.file(String path, {bool? windows}) = _Uri.file — Creates a new file URI from an absolute or relative file path. - Uri: factory Uri.directory(String path, {bool? windows}) = _Uri.directory — Like Uri.file except that a non-empty URI path ends in a slash. - Uri: factory Uri.dataFromString(String content, {String? mimeType, Encoding? encoding, Map? parameters, bool base64 = false}) — Creates a data: URI containing the content string. - Uri: factory Uri.dataFromBytes(List bytes, {String mimeType = "application/octet-stream", Map? parameters, bool percentEncoded = false}) — Creates a data: URI containing an encoding of bytes. - Uri: external static Uri get base — The natural base URI for the current platform. - Uri: static Uri parse(String uri, [int start = 0, int? end]) — Creates a new Uri object by parsing a URI string. - Uri: static Uri? tryParse(String uri, [int start = 0, int? end]) — Creates a new Uri object by parsing a URI string. - Uri: static String encodeComponent(String component) — Encode the string component using percent-encoding to make it safe for literal use as a URI component. - Uri: static String encodeQueryComponent(String component, {Encoding encoding = utf8}) — Encodes the string component according to the HTML 4.01 rules for encoding the posting of a HTML form as a query string component. - Uri: static String decodeComponent(String encodedComponent) — Decodes the percent-encoding in encodedComponent. - Uri: static String decodeQueryComponent(String encodedComponent, {Encoding encoding = utf8}) — Decodes the percent-encoding in encodedComponent, converting pluses to spaces. - Uri: static String encodeFull(String uri) — Encodes the string uri using percent-encoding to make it safe for literal use as a full URI. - Uri: static String decodeFull(String uri) — Decodes the percent-encoding in uri. - Uri: static Map splitQueryString(String query, {Encoding encoding = utf8}) — Splits the query into a map according to the rules specified for FORM post in the HTML 4.01 specification section 17.13.4. - Uri: static List parseIPv4Address(String host, [@Since('3.10') int start = 0, @Since('3.10') int? end]) — Parses the host as an IP version 4 (IPv4) address, returning the address as a list of 4 bytes in network byte order (big endian). - Uri: static List parseIPv6Address(String host, [int start = 0, int? end]) — Parses the host as an IP version 6 (IPv6) address. - Uri: String get scheme — The scheme component of the URI. - Uri: String get authority — The authority component. - Uri: String get userInfo — The user info part of the authority component. - Uri: String get host — The host part of the authority component. - Uri: int get port — The port part of the authority component. - Uri: String get path — The path component. - Uri: String get query — The query component. - Uri: String get fragment — The fragment identifier component. - Uri: List get pathSegments — The URI path split into its segments. - Uri: Map get queryParameters — The URI query split into a map according to the rules specified for FORM post in the HTML 4.01 specification section 17.13.4. - Uri: Map> get queryParametersAll — Returns the URI query split into a map according to the rules specified for FORM post in the HTML 4.01 specification section 17.13.4. - Uri: bool get isAbsolute — Whether the URI is absolute. - Uri: bool get hasScheme — Whether the URI has a scheme component. - Uri: bool get hasAuthority — Whether the URI has an authority component. - Uri: bool get hasPort — Whether the URI has an explicit port. - Uri: bool get hasQuery — Whether the URI has a query part. - Uri: bool get hasFragment — Whether the URI has a fragment part. - Uri: bool get hasEmptyPath — Whether the URI has an empty path. - Uri: bool get hasAbsolutePath — Whether the URI has an absolute path (starting with '/'). - Uri: String get origin — Returns the origin of the URI in the form scheme://host:port for the schemes http and https. - Uri: UriData? get data — Access the structure of a data: URI. - Uri: int get hashCode — Returns a hash code computed as toString.hashCode. - Uri: bool isScheme(String scheme) — Whether the scheme of this Uri is scheme. - Uri: String toFilePath({bool? windows}) — Creates a file path from a file URI. - Uri: String toString() — The normalized string representation of the URI. - Uri: Uri replace({String? scheme, String? userInfo, String? host, int? port, String? path, Iterable? pathSegments, String? query, Map? queryParameters, String? fragment}) — Creates a new Uri based on this one, but with some parts replaced. - Uri: Uri removeFragment() — Creates a Uri that differs from this only in not having a fragment. - Uri: Uri resolve(String reference) — Resolve reference as an URI relative to this. - Uri: Uri resolveUri(Uri reference) — Resolve reference as a URI relative to this. - Uri: Uri normalizePath() — Returns a URI where the path has been normalized. - Uri: bool operator ==(Object other) — A URI is equal to another URI with the same normalized representation. - final class UriData — A way to access the structure of a data: URI. - UriData: factory UriData.fromString(String content, {String? mimeType, Encoding? encoding, Map? parameters, bool base64 = false}) — Creates a data: URI containing the content string. - UriData: factory UriData.fromBytes(List bytes, {String mimeType = "application/octet-stream", Map? parameters, bool percentEncoded = false}) — Creates a data: URI containing an encoding of bytes. - UriData: factory UriData.fromUri(Uri uri) — Creates a DataUri from a Uri which must have data as Uri.scheme. - UriData: static UriData parse(String uri) — Parses a string as a data URI. - UriData: Uri get uri — The Uri that this UriData is giving access to. - UriData: String get mimeType — The MIME type of the data URI. - UriData: String get charset — The charset parameter of the media type. - UriData: bool get isBase64 — Whether the data is Base64 encoded or not. - UriData: String get contentText — The content part of the data URI, as its actual representation. - UriData: Map get parameters — A map representing the parameters of the media type. - UriData: bool isMimeType(String mimeType) — Whether the UriData.mimeType is equal to mimeType. - UriData: bool isCharset(String charset) — Checks whether the charset parameter of the mime type is charset. - UriData: bool isEncoding(Encoding encoding) — Whether the charset parameter represents encoding. - UriData: Uint8List contentAsBytes() — The content part of the data URI as bytes. - UriData: String contentAsString({Encoding? encoding}) — Creates a string from the content of the data URI. - UriData: String toString() - final class Expando — An Expando allows adding new properties to objects. - Expando: external Expando([String? name]) — Creates a new Expando. - Expando: final String? name — The name of the this Expando as passed to the constructor. - Expando: String toString() — Expando toString method override. - Expando: external T? operator [](Object object) — Gets the value of this Expando's property on the given object. - Expando: external void operator []=(Object object, T? value) — Sets this Expando's property value on the given object to value. - abstract final class WeakReference — A weak reference to a Raya object. - WeakReference: external factory WeakReference(T target) — Creates a WeakReference pointing to the given target. - WeakReference: T? get target — The current object weakly referenced by this WeakReference, if any. - abstract final class Finalizer — A finalizer which can be attached to Raya objects. - Finalizer: external factory Finalizer(void Function(T) callback) — Creates a finalizer with the given finalization callback. - Finalizer: void attach(Object value, T finalizationToken, {Object? detach}) — Attaches this finalizer to value. - Finalizer: void detach(Object detach) — Detaches this finalizer from values attached with detach. ### Basic maths and random numbers (raya:math) import 'raya:math'; Constants, elementary functions, min and max, random numbers, points and rectangles. https://riptidecompute.com/raya/docs/core-math - external T min(T a, T b) — Returns the lesser of two numbers. - external T max(T a, T b) — Returns the larger of two numbers. - external double atan2(num a, num b) — A variant of atan. - external num pow(num x, num exponent) — Returns x to the power of exponent. - external double sin(num radians) — Converts radians to a double and returns the sine of the value. - external double cos(num radians) — Converts radians to a double and returns the cosine of the value. - external double tan(num radians) — Converts radians to a double and returns the tangent of the value. - external double acos(num x) — Converts x to a double and returns its arc cosine in radians. - external double asin(num x) — Converts x to a double and returns its arc sine in radians. - external double atan(num x) — Converts x to a double and returns its arc tangent in radians. - external double sqrt(num x) — Converts x to a double and returns the positive square root of the value. - external double exp(num x) — Converts x to a double and returns the natural exponent, e, to the power x. - external double log(num x) — Converts x to a double and returns the natural logarithm of the value. - const double e = 2.718281828459045 — Base of the natural logarithms. - const double ln10 = 2.302585092994046 — Natural logarithm of 10. - const double ln2 = 0.6931471805599453 — Natural logarithm of 2. - const double log2e = 1.4426950408889634 — Base-2 logarithm of e. - const double log10e = 0.4342944819032518 — Base-10 logarithm of e. - const double pi = 3.1415926535897932 — The PI constant. - const double sqrt1_2 = 0.7071067811865476 — Square root of 1/2. - const double sqrt2 = 1.4142135623730951 — Square root of 2. - class Point — A utility class for representing two-dimensional positions. - Point: const Point(T x, T y) — Creates a point with the provided x and y coordinates. - Point: final T x - Point: final T y - Point: int get hashCode - Point: double get magnitude — Get the straight line (Euclidean) distance between the origin (0, 0) and this point. - Point: String toString() - Point: double distanceTo(Point other) — Returns the distance between this and other. - Point: T squaredDistanceTo(Point other) — Returns the squared distance between this and other. - Point: bool operator ==(Object other) — Whether other is a point with the same coordinates as this point. - Point: Point operator +(Point other) — Add other to this, as if both points were vectors. - Point: Point operator -(Point other) — Subtract other from this, as if both points were vectors. - Point: Point operator *(num factor) — Scale this point by factor as if it were a vector. - abstract interface class Random — A generator of random bool, int, or double values. - Random: external factory Random([int? seed]) — Creates a random number generator. - Random: external factory Random.secure() — Creates a cryptographically secure random number generator. - Random: int nextInt(int max) — Generates a non-negative random integer uniformly distributed in the range from 0, inclusive, to max, exclusive. - Random: double nextDouble() — Generates a non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive. - Random: bool nextBool() — Generates a random boolean value. - class Rectangle extends _RectangleBase — A class for representing two-dimensional rectangles whose properties are immutable. - Rectangle: const Rectangle(this.left, this.top, T width, T height) — Create a rectangle spanned by (left, top) and (left+width, top+height). - Rectangle: factory Rectangle.fromPoints(Point a, Point b) — Create a rectangle spanned by the points a and b; - Rectangle: final T left - Rectangle: final T top - Rectangle: final T width - Rectangle: final T height - class MutableRectangle extends _RectangleBase implements Rectangle — A class for representing two-dimensional axis-aligned rectangles with mutable properties. - MutableRectangle: MutableRectangle(this.left, this.top, T width, T height) — Create a mutable rectangle spanned by (left, top) and (left+width, top+height). - MutableRectangle: factory MutableRectangle.fromPoints(Point a, Point b) — Create a mutable rectangle spanned by the points a and b; - MutableRectangle: T left — The x-coordinate of the left edge. - MutableRectangle: T top — The y-coordinate of the left edge. - MutableRectangle: T get width - MutableRectangle: set width(T width) — Sets the width of the rectangle. - MutableRectangle: T get height - MutableRectangle: set height(T height) — Sets the height of the rectangle. ### JSON, UTF-8 and encodings (raya:convert) import 'raya:convert'; Codecs and converters: JSON, UTF-8, Latin-1, ASCII, Base64, HTML escaping and line splitting. https://riptidecompute.com/raya/docs/core-convert - String base64Encode(List bytes) — Encodes bytes using base64 encoding. - String base64UrlEncode(List bytes) — Encodes bytes using base64url encoding. - Uint8List base64Decode(String source) — Decodes base64 or base64url encoded bytes. - String jsonEncode(Object? object, {Object? Function(Object? nonEncodable)? toEncodable}) — Converts object to a JSON string. - dynamic jsonDecode(String source, {Object? Function(Object? key, Object? value)? reviver}) — Parses the string and returns the resulting Json object. - const AsciiCodec ascii = AsciiCodec() — An instance of the default implementation of the AsciiCodec. - const Base64Codec base64 = Base64Codec() — A base64 encoder and decoder. - const Base64Codec base64Url = Base64Codec.urlSafe() — A base64url encoder and decoder. - const HtmlEscape htmlEscape = HtmlEscape() — A String converter that converts characters to HTML entities. - const JsonCodec json = JsonCodec() — An instance of the default implementation of the JsonCodec. - const Latin1Codec latin1 = Latin1Codec() — An instance of the default implementation of the Latin1Codec. - const int unicodeReplacementCharacterRune = 0xFFFD — The Unicode Replacement character U+FFFD (�). - const int unicodeBomCharacterRune = 0xFEFF — The Unicode Byte Order Marker (BOM) character U+FEFF. - const Utf8Codec utf8 = Utf8Codec() — An instance of the default implementation of the Utf8Codec. - typedef ByteConversionSinkBase = ByteConversionSink — This class provides a base-class for converters that need to accept byte inputs. - typedef StringConversionSinkBase = StringConversionSink — This class provides a base-class for converters that need to accept String inputs. - typedef StringConversionSinkMixin = StringConversionSink — This class provides a mixin for converters that need to accept String inputs. - final class AsciiCodec extends Encoding — Encoding and decoding of ASCII characters. - AsciiCodec: const AsciiCodec({this._allowInvalid = false}) — Instantiates a new AsciiCodec. - AsciiCodec: String get name — The name of this codec is "us-ascii". - AsciiCodec: AsciiEncoder get encoder - AsciiCodec: AsciiDecoder get decoder - AsciiCodec: Uint8List encode(String source) - AsciiCodec: String decode(List bytes, {bool? allowInvalid}) — Decodes the ASCII bytes (a list of unsigned 7-bit integers) to the corresponding string. - final class AsciiEncoder extends _UnicodeSubsetEncoder — Converts strings of only ASCII characters to bytes. - AsciiEncoder: const AsciiEncoder() - final class AsciiDecoder extends _UnicodeSubsetDecoder — Converts ASCII bytes to string. - AsciiDecoder: const AsciiDecoder({bool allowInvalid = false}) - AsciiDecoder: ByteConversionSink startChunkedConversion(Sink sink) — Starts a chunked conversion. - final class Base64Codec extends Codec, String> — A base64 encoder and decoder. - Base64Codec: const Base64Codec() - Base64Codec: const Base64Codec.urlSafe() - Base64Codec: Base64Encoder get encoder - Base64Codec: Base64Decoder get decoder - Base64Codec: Uint8List decode(String encoded) — Decodes encoded. - Base64Codec: String normalize(String source, [int start = 0, int? end]) — Validates and normalizes the base64 encoded data in source. - final class Base64Encoder extends Converter, String> — Base64 and base64url encoding converter. - Base64Encoder: const Base64Encoder() - Base64Encoder: const Base64Encoder.urlSafe() - Base64Encoder: String convert(List input) - Base64Encoder: ByteConversionSink startChunkedConversion(Sink sink) - final class Base64Decoder extends Converter> — Decoder for base64 encoded data. - Base64Decoder: const Base64Decoder() - Base64Decoder: Uint8List convert(String input, [int start = 0, int? end]) — Decodes the characters of input from start to end as base64. - Base64Decoder: StringConversionSink startChunkedConversion(Sink> sink) - abstract mixin class ByteConversionSink implements ChunkedConversionSink> — The ByteConversionSink provides an interface for converters to efficiently transmit byte data. - ByteConversionSink: const ByteConversionSink() - ByteConversionSink: factory ByteConversionSink.withCallback(void Function(List accumulated) callback) = _ByteCallbackSink - ByteConversionSink: factory ByteConversionSink.from(Sink> sink) = _ByteAdapterSink - ByteConversionSink: void addSlice(List chunk, int start, int end, bool isLast) — Adds the next chunk to this. - abstract interface class ChunkedConversionSink implements Sink — A ChunkedConversionSink is used to transmit data more efficiently between two converters during chunked conversions. - ChunkedConversionSink: ChunkedConversionSink() - ChunkedConversionSink: factory ChunkedConversionSink.withCallback(void Function(List accumulated) callback) = _SimpleCallbackSink - ChunkedConversionSink: void add(T chunk) — Adds chunked data to this sink. - ChunkedConversionSink: void close() — Closes the sink. - abstract mixin class Codec — A Codec encodes and (if supported) decodes data. - Codec: const Codec() - Codec: Converter get encoder — Returns the encoder from S to T. - Codec: Converter get decoder — Returns the decoder of this, converting from T to S. - Codec: Codec get inverted — Inverts this. - Codec: T encode(S input) — Encodes input. - Codec: S decode(T encoded) — Decodes encoded data. - Codec: Codec fuse(Codec other) — Fuses this with other. - abstract mixin class Converter implements StreamTransformerBase — A Converter converts data from one representation into another. - Converter: const Converter() - Converter: static Converter castFrom(Converter source) — Adapts source to be a Converter. - Converter: T convert(S input) — Converts input and returns the result of the conversion. - Converter: Converter fuse(Converter other) — Fuses this with other. - Converter: Sink startChunkedConversion(Sink sink) — Starts a chunked conversion. - Converter: Stream bind(Stream stream) - Converter: Converter cast() — Provides a Converter view of this stream transformer. - abstract class Encoding extends Codec> — Open-ended set of encodings. - Encoding: const Encoding() - Encoding: static Encoding? getByName(String? name) — Returns an Encoding for a named character set. - Encoding: Converter> get encoder — Returns the encoder from String to List. - Encoding: Converter, String> get decoder — Returns the decoder of this, converting from List to String. - Encoding: String get name — Name of the encoding. - Encoding: Future decodeStream(Stream> byteStream) - final class HtmlEscapeMode — HTML escape modes. - HtmlEscapeMode: const HtmlEscapeMode({this._name = "custom", this.escapeLtGt = false, this.escapeQuot = false, this.escapeApos = false, this.escapeSlash = false}) — Create a custom escaping mode. - HtmlEscapeMode: static const HtmlEscapeMode unknown = HtmlEscapeMode._('unknown', true, true, true, true) — Default escaping mode, which escapes all characters. - HtmlEscapeMode: static const HtmlEscapeMode attribute = HtmlEscapeMode._('attribute', true, true, false, false) — Escaping mode for text going into double-quoted HTML attribute values. - HtmlEscapeMode: static const HtmlEscapeMode sqAttribute = HtmlEscapeMode._('attribute', true, false, true, false) — Escaping mode for text going into single-quoted HTML attribute values. - HtmlEscapeMode: static const HtmlEscapeMode element = HtmlEscapeMode._('element', true, false, false, false) — Escaping mode for text going into HTML element content. - HtmlEscapeMode: final bool escapeLtGt — Whether to escape '<' and '>'. - HtmlEscapeMode: final bool escapeQuot — Whether to escape '"' (quote). - HtmlEscapeMode: final bool escapeApos — Whether to escape "'" (apostrophe). - HtmlEscapeMode: final bool escapeSlash — Whether to escape "/" (forward slash, solidus). - HtmlEscapeMode: String toString() - final class HtmlEscape extends Converter — Converter which escapes characters with special meaning in HTML. - HtmlEscape: const HtmlEscape([this.mode = HtmlEscapeMode.unknown]) — Create converter that escapes HTML characters. - HtmlEscape: final HtmlEscapeMode mode — The HtmlEscapeMode used by the converter. - HtmlEscape: String convert(String text) - HtmlEscape: StringConversionSink startChunkedConversion(Sink sink) - class JsonUnsupportedObjectError extends Error — Error thrown by JSON serialization if an object cannot be serialized. - JsonUnsupportedObjectError: JsonUnsupportedObjectError(this.unsupportedObject, {this.cause, this.partialResult}) - JsonUnsupportedObjectError: final Object? unsupportedObject — The object that could not be serialized. - JsonUnsupportedObjectError: final Object? cause — The exception thrown when trying to convert the object. - JsonUnsupportedObjectError: final String? partialResult — The partial result of the conversion, up until the error happened. - JsonUnsupportedObjectError: String toString() - class JsonCyclicError extends JsonUnsupportedObjectError — Reports that an object could not be stringified due to cyclic references. - JsonCyclicError: JsonCyclicError(super.object) — The first object that was detected as part of a cycle. - JsonCyclicError: String toString() - final class JsonCodec extends Codec — A JsonCodec encodes JSON objects to strings and decodes strings to JSON objects. - JsonCodec: const JsonCodec({this._reviver, this._toEncodable}) — Creates a JsonCodec with the given reviver and encoding function. - JsonCodec: JsonCodec.withReviver(dynamic Function(Object? key, Object? value) reviver) — Creates a JsonCodec with the given reviver. - JsonCodec: JsonEncoder get encoder - JsonCodec: JsonDecoder get decoder - JsonCodec: dynamic decode(String source, {Object? Function(Object? key, Object? value)? reviver}) — Parses the string and returns the resulting Json object. - JsonCodec: String encode(Object? value, {Object? Function(dynamic object)? toEncodable}) — Converts value to a JSON string. - final class JsonEncoder extends Converter — This class converts JSON objects to strings. - JsonEncoder: const JsonEncoder([Object? Function(dynamic object)? toEncodable]) — Creates a JSON encoder. - JsonEncoder: const JsonEncoder.withIndent(this.indent, [Object? Function(dynamic object)? toEncodable]) — Creates a JSON encoder that creates multi-line JSON. - JsonEncoder: final String? indent — The string used for indention. - JsonEncoder: String convert(Object? object) — Converts object to a JSON String. - JsonEncoder: ChunkedConversionSink startChunkedConversion(Sink sink) — Starts a chunked conversion. - JsonEncoder: Stream bind(Stream stream) - JsonEncoder: Converter fuse(Converter other) - final class JsonUtf8Encoder extends Converter> — Encoder that encodes a single object as a UTF-8 encoded JSON string. - JsonUtf8Encoder: JsonUtf8Encoder([String? indent, dynamic Function(dynamic object)? toEncodable, int? bufferSize]) — Create converter. - JsonUtf8Encoder: List convert(Object? object) — Convert object into UTF-8 encoded JSON. - JsonUtf8Encoder: ChunkedConversionSink startChunkedConversion(Sink> sink) — Start a chunked conversion. - JsonUtf8Encoder: Stream> bind(Stream stream) - final class JsonDecoder extends Converter — This class parses JSON strings and builds the corresponding objects. - JsonDecoder: const JsonDecoder([Object? Function(Object? key, Object? value)? reviver]) — Constructs a new JsonDecoder. - JsonDecoder: dynamic convert(String input) — Converts the given JSON-string input to its corresponding object. - JsonDecoder: external StringConversionSink startChunkedConversion(Sink sink) — Starts a conversion from a chunked JSON string to its corresponding object. - JsonDecoder: Stream bind(Stream stream) - final class Latin1Codec extends Encoding — A Latin1Codec encodes strings to ISO Latin-1 (aka ISO-8859-1) bytes and decodes Latin-1 bytes to strings. - Latin1Codec: const Latin1Codec({this._allowInvalid = false}) — Instantiates a new Latin1Codec. - Latin1Codec: String get name — The name of this codec, "iso-8859-1". - Latin1Codec: Latin1Encoder get encoder - Latin1Codec: Latin1Decoder get decoder - Latin1Codec: Uint8List encode(String source) - Latin1Codec: String decode(List bytes, {bool? allowInvalid}) — Decodes the Latin-1 bytes (a list of unsigned 8-bit integers) to the corresponding string. - final class Latin1Encoder extends _UnicodeSubsetEncoder — This class converts strings of only ISO Latin-1 characters to bytes. - Latin1Encoder: const Latin1Encoder() - final class Latin1Decoder extends _UnicodeSubsetDecoder — This class converts Latin-1 bytes (lists of unsigned 8-bit integers) to a string. - Latin1Decoder: const Latin1Decoder({bool allowInvalid = false}) — Instantiates a new Latin1Decoder. - Latin1Decoder: ByteConversionSink startChunkedConversion(Sink sink) — Starts a chunked conversion. - final class LineSplitter extends StreamTransformerBase — A StreamTransformer that splits a String into individual lines. - LineSplitter: const LineSplitter() - LineSplitter: static Iterable split(String lines, [int start = 0, int? end]) — Split lines into individual lines. - LineSplitter: List convert(String data) - LineSplitter: StringConversionSink startChunkedConversion(Sink sink) - LineSplitter: Stream bind(Stream stream) - abstract mixin class StringConversionSink implements ChunkedConversionSink — A sink for converters to efficiently transmit String data. - StringConversionSink: const StringConversionSink() - StringConversionSink: factory StringConversionSink.withCallback(void Function(String accumulated) callback) = _StringCallbackSink - StringConversionSink: factory StringConversionSink.from(Sink sink) = _StringAdapterSink - StringConversionSink: factory StringConversionSink.fromStringSink(StringSink sink) = _StringSinkConversionSink — Creates a new instance wrapping the given sink. - StringConversionSink: void addSlice(String chunk, int start, int end, bool isLast) — Adds the next chunk to this. - StringConversionSink: void add(String str) - StringConversionSink: ByteConversionSink asUtf8Sink(bool allowMalformed) — Returns this as a sink that accepts UTF-8 input. - StringConversionSink: ClosableStringSink asStringSink() — Returns this as a ClosableStringSink. - abstract interface class ClosableStringSink implements StringSink — A ClosableStringSink extends the StringSink interface by adding a close method. - ClosableStringSink: factory ClosableStringSink.fromStringSink(StringSink sink, void Function() onClose) = _ClosableStringSink — Creates a new instance combining a StringSink sink and a callback onClose which is invoked when the returned instance is closed. - ClosableStringSink: void close() — Closes this and flushes any outstanding data. - final class Utf8Codec extends Encoding — A Utf8Codec encodes strings to utf-8 code units (bytes) and decodes UTF-8 code units to strings. - Utf8Codec: const Utf8Codec({this._allowMalformed = false}) — Instantiates a new Utf8Codec. - Utf8Codec: String get name — The name of this codec is "utf-8". - Utf8Codec: Utf8Encoder get encoder - Utf8Codec: Utf8Decoder get decoder - Utf8Codec: String decode(List codeUnits, {bool? allowMalformed}) — Decodes the UTF-8 codeUnits (a list of unsigned 8-bit integers) to the corresponding string. - Utf8Codec: Uint8List encode(String string) — Encodes the string as UTF-8. - final class Utf8Encoder extends Converter> — This class converts strings to their UTF-8 code units (a list of unsigned 8-bit integers). - Utf8Encoder: const Utf8Encoder() - Utf8Encoder: Uint8List convert(String string, [int start = 0, int? end]) — Converts string to its UTF-8 code units (a list of unsigned 8-bit integers). - Utf8Encoder: StringConversionSink startChunkedConversion(Sink> sink) — Starts a chunked conversion. - Utf8Encoder: Stream> bind(Stream stream) - final class Utf8Decoder extends Converter, String> — This class converts UTF-8 code units (lists of unsigned 8-bit integers) to a string. - Utf8Decoder: const Utf8Decoder({this._allowMalformed = false}) — Instantiates a new Utf8Decoder. - Utf8Decoder: String convert(List codeUnits, [int start = 0, int? end]) — Converts the UTF-8 codeUnits (a list of unsigned 8-bit integers) to the corresponding string. - Utf8Decoder: ByteConversionSink startChunkedConversion(Sink sink) — Starts a chunked conversion. - Utf8Decoder: Stream bind(Stream> stream) - Utf8Decoder: external Converter, T> fuse(Converter next) ### More collections (raya:collection) import 'raya:collection'; Hash, linked and splay-tree maps and sets, queues, linked lists, and list and map helpers. https://riptidecompute.com/raya/docs/core-collection - typedef IterableMixin = Iterable — This Iterable mixin implements all Iterable members except iterator. - typedef IterableBase = Iterable — Base class for implementing Iterable. - typedef ListMixin = ListBase — Base mixin implementation of a List class. - typedef MapMixin = MapBase — Mixin implementing a Map. - typedef SetMixin = SetBase — Mixin implementation of Set. - class UnmodifiableListView extends UnmodifiableListBase — An unmodifiable List view of another List. - UnmodifiableListView: UnmodifiableListView(Iterable source) — Creates an unmodifiable list backed by source. - UnmodifiableListView: int get length - UnmodifiableListView: List cast() - UnmodifiableListView: E operator [](int index) - abstract final class HashMap implements Map — A hash-table based implementation of Map. - HashMap: external factory HashMap({bool Function(K, K)? equals, int Function(K)? hashCode, bool Function(dynamic)? isValidKey}) — Creates an unordered hash-table based Map. - HashMap: external factory HashMap.identity() — Creates an unordered identity-based map. - HashMap: factory HashMap.from(Map other) — Creates a HashMap that contains all key/value pairs of other. - HashMap: factory HashMap.of(Map other) — Creates a HashMap that contains all key/value pairs of other. - HashMap: factory HashMap.fromIterable(Iterable iterable, {K Function(dynamic element)? key, V Function(dynamic element)? value}) — Creates a HashMap where the keys and values are computed from the iterable. - HashMap: factory HashMap.fromIterables(Iterable keys, Iterable values) — Creates a HashMap associating the given keys to values. - HashMap: factory HashMap.fromEntries(Iterable> entries) — Creates a HashMap containing the entries of entries. - abstract final class HashSet implements Set — An unordered hash-table based Set implementation. - HashSet: external factory HashSet({bool Function(E, E)? equals, int Function(E)? hashCode, bool Function(dynamic)? isValidKey}) — Create a hash set using the provided equals as equality. - HashSet: external factory HashSet.identity() — Creates an unordered identity-based set. - HashSet: factory HashSet.from(Iterable elements) — Create a hash set containing all elements. - HashSet: factory HashSet.of(Iterable elements) — Create a hash set containing all elements. - HashSet: Iterator get iterator — Provides an iterator that iterates over the elements of this set. - extension NullableIterableExtensions on Iterable — Operations on iterables with nullable elements. - NullableIterableExtensions: Iterable get nonNulls — The non-null elements of this iterable. - extension IterableExtensions on Iterable — Operations on iterables. - IterableExtensions: Iterable<(int, T)> get indexed — Pairs of elements of the indices and elements of this iterable. - IterableExtensions: T? get firstOrNull — The first element of this iterator, or null if the iterable is empty. - IterableExtensions: T? get lastOrNull — The last element of this iterable, or null if the iterable is empty. - IterableExtensions: T? get singleOrNull — The single element of this iterator, or null. - IterableExtensions: T? elementAtOrNull(int index) — The element at position index of this iterable, or null. - final class HasNextIterator — Wrapper for Iterator providing the pre-Raya iterator interface. - HasNextIterator: HasNextIterator(Iterator iterator) - HasNextIterator: bool get hasNext — Whether the iterator has a next element. - HasNextIterator: E next() — Provides the next element of the iterable, and moves past it. - abstract final class LinkedHashMap implements Map — An insertion-ordered Map with expected constant-time lookup. - LinkedHashMap: external factory LinkedHashMap({bool Function(K, K)? equals, int Function(K)? hashCode, bool Function(dynamic)? isValidKey}) — Creates an insertion-ordered hash-table based Map. - LinkedHashMap: external factory LinkedHashMap.identity() — Creates an insertion-ordered identity-based map. - LinkedHashMap: factory LinkedHashMap.from(Map other) — Creates a LinkedHashMap that contains all key value pairs of other. - LinkedHashMap: factory LinkedHashMap.of(Map other) — Creates a LinkedHashMap that contains all key value pairs of other. - LinkedHashMap: factory LinkedHashMap.fromIterable(Iterable iterable, {K Function(dynamic element)? key, V Function(dynamic element)? value}) — Creates a LinkedHashMap where the keys and values are computed from the iterable. - LinkedHashMap: factory LinkedHashMap.fromIterables(Iterable keys, Iterable values) — Creates a LinkedHashMap associating the given keys to values. - LinkedHashMap: factory LinkedHashMap.fromEntries(Iterable> entries) — Creates a LinkedHashMap containing the entries of entries. - abstract final class LinkedHashSet implements Set — A LinkedHashSet is a hash-table based Set implementation. - LinkedHashSet: external factory LinkedHashSet({bool Function(E, E)? equals, int Function(E)? hashCode, bool Function(dynamic)? isValidKey}) — Create an insertion-ordered hash set using the provided equals and hashCode. - LinkedHashSet: external factory LinkedHashSet.identity() — Creates an insertion-ordered identity-based set. - LinkedHashSet: factory LinkedHashSet.from(Iterable elements) — Create a linked hash set containing all elements. - LinkedHashSet: factory LinkedHashSet.of(Iterable elements) — Create a linked hash set from elements. - LinkedHashSet: Iterator get iterator — Provides an iterator that iterates over the elements in insertion order. - LinkedHashSet: void forEach(void action(E element)) — Executes a function on each element of the set. - base class LinkedList> extends Iterable — A specialized double-linked list of elements that extends LinkedListEntry. - LinkedList: LinkedList() — Constructs a new empty linked list. - LinkedList: Iterator get iterator - LinkedList: int get length - LinkedList: E get first - LinkedList: E get last - LinkedList: E get single - LinkedList: bool get isEmpty - LinkedList: void addFirst(E entry) — Adds entry to the beginning of the linked list. - LinkedList: void add(E entry) — Adds entry to the end of the linked list. - LinkedList: void addAll(Iterable entries) — Adds entries to the end of the linked list. - LinkedList: bool remove(E entry) — Removes entry from the linked list. - LinkedList: bool contains(Object? entry) — Whether entry is a LinkedListEntry belonging to this list. - LinkedList: void clear() — Remove all elements from this linked list. - LinkedList: void forEach(void action(E entry)) — Call action with each entry in this linked list. - abstract base mixin class LinkedListEntry> — An object that can be an element in a LinkedList. - LinkedListEntry: LinkedList? get list — The linked list containing this element. - LinkedListEntry: E? get next — The successor of this element in its linked list. - LinkedListEntry: E? get previous — The predecessor of this element in its linked list. - LinkedListEntry: void unlink() — Unlink the element from its linked list. - LinkedListEntry: void insertAfter(E entry) — Insert an element after this element in this element's linked list. - LinkedListEntry: void insertBefore(E entry) — Insert an element before this element in this element's linked list. - abstract mixin class ListBase implements List — Abstract implementation of a list. - ListBase: const ListBase() - ListBase: static String listToString(List list) — Converts a List to a String. - ListBase: Iterator get iterator - ListBase: bool get isEmpty - ListBase: bool get isNotEmpty - ListBase: E get first - ListBase: void set first(E value) - ListBase: E get last - ListBase: void set last(E value) - ListBase: E get single - ListBase: Iterable get reversed - ListBase: E elementAt(int index) - ListBase: Iterable followedBy(Iterable other) - ListBase: void forEach(void action(E element)) - ListBase: bool contains(Object? element) - ListBase: bool every(bool test(E element)) - ListBase: bool any(bool test(E element)) - ListBase: E firstWhere(bool test(E element), {E Function()? orElse}) - ListBase: E lastWhere(bool test(E element), {E Function()? orElse}) - ListBase: E singleWhere(bool test(E element), {E Function()? orElse}) - ListBase: String join([String separator = ""]) - ListBase: Iterable where(bool test(E element)) - ListBase: Iterable whereType() - ListBase: Iterable map(T f(E element)) - ListBase: Iterable expand(Iterable f(E element)) - ListBase: E reduce(E combine(E previousValue, E element)) - ListBase: T fold(T initialValue, T combine(T previousValue, E element)) - ListBase: Iterable skip(int count) - ListBase: Iterable skipWhile(bool test(E element)) - ListBase: Iterable take(int count) - ListBase: Iterable takeWhile(bool test(E element)) - ListBase: List toList({bool growable = true}) - ListBase: Set toSet() - ListBase: void add(E element) - ListBase: void addAll(Iterable iterable) - ListBase: bool remove(Object? element) - ListBase: void removeWhere(bool test(E element)) - ListBase: void retainWhere(bool test(E element)) - ListBase: void clear() - ListBase: List cast() - ListBase: E removeLast() - ListBase: void sort([int Function(E a, E b)? compare]) - ListBase: void shuffle([Random? random]) - ListBase: Map asMap() - ListBase: List sublist(int start, [int? end]) - ListBase: Iterable getRange(int start, int end) - ListBase: void removeRange(int start, int end) - ListBase: void fillRange(int start, int end, [E? fill]) - ListBase: void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) - ListBase: void replaceRange(int start, int end, Iterable newContents) - ListBase: int indexOf(Object? element, [int start = 0]) - ListBase: int indexWhere(bool test(E element), [int start = 0]) - ListBase: int lastIndexOf(Object? element, [int? start]) - ListBase: int lastIndexWhere(bool test(E element), [int? start]) - ListBase: void insert(int index, E element) - ListBase: E removeAt(int index) - ListBase: void insertAll(int index, Iterable iterable) - ListBase: void setAll(int index, Iterable iterable) - ListBase: String toString() - ListBase: List operator +(List other) - abstract mixin class MapBase implements Map — Base class for implementing a Map. - MapBase: const MapBase() - MapBase: static String mapToString(Map m) - MapBase: Iterable get keys - MapBase: Iterable> get entries - MapBase: int get length - MapBase: bool get isEmpty - MapBase: bool get isNotEmpty - MapBase: Iterable get values - MapBase: V? remove(Object? key) - MapBase: void clear() - MapBase: Map cast() - MapBase: void forEach(void action(K key, V value)) - MapBase: void addAll(Map other) - MapBase: bool containsValue(Object? value) - MapBase: V putIfAbsent(K key, V ifAbsent()) - MapBase: V update(K key, V update(V value), {V Function()? ifAbsent}) - MapBase: void updateAll(V update(K key, V value)) - MapBase: Map map(MapEntry transform(K key, V value)) - MapBase: void addEntries(Iterable> newEntries) - MapBase: void removeWhere(bool test(K key, V value)) - MapBase: bool containsKey(Object? key) - MapBase: String toString() - MapBase: V? operator [](Object? key) - MapBase: operator []=(K key, V value) - abstract class UnmodifiableMapBase = MapBase with _UnmodifiableMapMixin — Basic implementation of an unmodifiable Map. - class MapView implements Map — Wrapper around a class that implements Map that only exposes Map members. - MapView: const MapView(Map map) — Creates a view which forwards operations to map. - MapView: bool get isEmpty - MapView: bool get isNotEmpty - MapView: int get length - MapView: Iterable get keys - MapView: Iterable get values - MapView: Iterable> get entries - MapView: Map cast() - MapView: void addAll(Map other) - MapView: void clear() - MapView: V putIfAbsent(K key, V ifAbsent()) - MapView: bool containsKey(Object? key) - MapView: bool containsValue(Object? value) - MapView: void forEach(void action(K key, V value)) - MapView: V? remove(Object? key) - MapView: String toString() - MapView: void addEntries(Iterable> entries) - MapView: Map map(MapEntry transform(K key, V value)) - MapView: V update(K key, V update(V value), {V Function()? ifAbsent}) - MapView: void updateAll(V update(K key, V value)) - MapView: void removeWhere(bool test(K key, V value)) - MapView: V? operator [](Object? key) - MapView: void operator []=(K key, V value) - class UnmodifiableMapView extends MapView with _UnmodifiableMapMixin — View of a Map that disallow modifying the map. - UnmodifiableMapView: UnmodifiableMapView(Map map) - UnmodifiableMapView: Map cast() - abstract interface class Queue implements Iterable, _QueueIterable — A Queue is a collection that can be manipulated at both ends. - Queue: factory Queue() = ListQueue — Creates a queue. - Queue: factory Queue.from(Iterable elements) = ListQueue.from — Creates a queue containing all elements. - Queue: factory Queue.of(Iterable elements) = ListQueue.of — Creates a queue from elements. - Queue: static Queue castFrom(Queue source) — Adapts source to be a Queue. - Queue: Queue cast() — Provides a view of this queue as a queue of R instances, if necessary. - Queue: E removeFirst() — Removes and returns the first element of this queue. - Queue: E removeLast() — Removes and returns the last element of the queue. - Queue: void addFirst(E value) — Adds value at the beginning of the queue. - Queue: void addLast(E value) — Adds value at the end of the queue. - Queue: void add(E value) — Adds value at the end of the queue. - Queue: bool remove(Object? value) — Removes a single instance of value from the queue. - Queue: void addAll(Iterable iterable) — Adds all elements of iterable at the end of the queue. - Queue: void removeWhere(bool test(E element)) — Removes all elements matched by test from the queue. - Queue: void retainWhere(bool test(E element)) — Removes all elements not matched by test from the queue. - Queue: void clear() — Removes all elements in the queue. - final class DoubleLinkedQueue extends Iterable implements Queue — A Queue implementation based on a double-linked list. - DoubleLinkedQueue: DoubleLinkedQueue() - DoubleLinkedQueue: factory DoubleLinkedQueue.from(Iterable elements) — Creates a double-linked queue containing all elements. - DoubleLinkedQueue: factory DoubleLinkedQueue.of(Iterable elements) — Creates a double-linked queue from elements. - DoubleLinkedQueue: int get length - DoubleLinkedQueue: E get first - DoubleLinkedQueue: E get last - DoubleLinkedQueue: E get single - DoubleLinkedQueue: bool get isEmpty - DoubleLinkedQueue: _DoubleLinkedQueueIterator get iterator - DoubleLinkedQueue: Queue cast() - DoubleLinkedQueue: void addLast(E value) - DoubleLinkedQueue: void addFirst(E value) - DoubleLinkedQueue: void add(E value) - DoubleLinkedQueue: void addAll(Iterable iterable) - DoubleLinkedQueue: E removeLast() - DoubleLinkedQueue: E removeFirst() - DoubleLinkedQueue: bool remove(Object? o) - DoubleLinkedQueue: void removeWhere(bool test(E element)) - DoubleLinkedQueue: void retainWhere(bool test(E element)) - DoubleLinkedQueue: DoubleLinkedQueueEntry? firstEntry() — The entry object of the first element in the queue. - DoubleLinkedQueue: DoubleLinkedQueueEntry? lastEntry() — The entry object of the last element in the queue. - DoubleLinkedQueue: void clear() - DoubleLinkedQueue: void forEachEntry(void action(DoubleLinkedQueueEntry element)) — Calls action for each entry object of this double-linked queue. - DoubleLinkedQueue: String toString() - final class ListQueue extends ListIterable implements Queue — List based Queue. - ListQueue: ListQueue([int? initialCapacity]) — Create an empty queue. - ListQueue: factory ListQueue.from(Iterable elements) — Create a ListQueue containing all elements. - ListQueue: factory ListQueue.of(Iterable elements) — Create a ListQueue from elements. - ListQueue: Iterator get iterator - ListQueue: bool get isEmpty - ListQueue: int get length - ListQueue: E get first - ListQueue: E get last - ListQueue: E get single - ListQueue: Queue cast() - ListQueue: void forEach(void f(E element)) - ListQueue: E elementAt(int index) - ListQueue: List toList({bool growable = true}) - ListQueue: void add(E value) - ListQueue: void addAll(Iterable elements) - ListQueue: bool remove(Object? value) - ListQueue: void removeWhere(bool test(E element)) — Remove all elements matched by test. - ListQueue: void retainWhere(bool test(E element)) — Remove all elements not matched by test. - ListQueue: void clear() - ListQueue: String toString() - ListQueue: void addLast(E value) - ListQueue: void addFirst(E value) - ListQueue: E removeFirst() - ListQueue: E removeLast() - abstract mixin class SetBase implements Set — Base implementation of Set. - SetBase: const SetBase() - SetBase: static String setToString(Set set) — Converts a Set to a String. - SetBase: Iterator get iterator - SetBase: int get length - SetBase: bool get isEmpty - SetBase: bool get isNotEmpty - SetBase: E get single - SetBase: E get first - SetBase: E get last - SetBase: bool add(E value) - SetBase: bool contains(Object? element) - SetBase: E? lookup(Object? element) - SetBase: bool remove(Object? value) - SetBase: Set toSet() - SetBase: Set cast() - SetBase: Iterable followedBy(Iterable other) - SetBase: Iterable whereType() - SetBase: void clear() - SetBase: void addAll(Iterable elements) - SetBase: void removeAll(Iterable elements) - SetBase: void retainAll(Iterable elements) - SetBase: void removeWhere(bool test(E element)) - SetBase: void retainWhere(bool test(E element)) - SetBase: bool containsAll(Iterable other) - SetBase: Set union(Set other) - SetBase: Set intersection(Set other) - SetBase: Set difference(Set other) - SetBase: List toList({bool growable = true}) - SetBase: Iterable map(T f(E element)) - SetBase: String toString() - SetBase: Iterable where(bool f(E element)) - SetBase: Iterable expand(Iterable f(E element)) - SetBase: void forEach(void f(E element)) - SetBase: E reduce(E combine(E value, E element)) - SetBase: T fold(T initialValue, T combine(T previousValue, E element)) - SetBase: bool every(bool f(E element)) - SetBase: String join([String separator = ""]) - SetBase: bool any(bool test(E element)) - SetBase: Iterable take(int n) - SetBase: Iterable takeWhile(bool test(E value)) - SetBase: Iterable skip(int n) - SetBase: Iterable skipWhile(bool test(E value)) - SetBase: E firstWhere(bool test(E value), {E Function()? orElse}) - SetBase: E lastWhere(bool test(E value), {E Function()? orElse}) - SetBase: E singleWhere(bool test(E value), {E Function()? orElse}) - SetBase: E elementAt(int index) - class UnmodifiableSetView extends SetBase with _UnmodifiableSetMixin — An unmodifiable Set view of another Set. - UnmodifiableSetView: UnmodifiableSetView(Set source) — Creates an UnmodifiableSetView of source. - UnmodifiableSetView: int get length - UnmodifiableSetView: Iterator get iterator - UnmodifiableSetView: bool contains(Object? element) - UnmodifiableSetView: E? lookup(Object? element) - UnmodifiableSetView: Set toSet() - final class SplayTreeMap extends _SplayTree> with MapMixin — A Map of objects that can be ordered relative to each other. - SplayTreeMap: SplayTreeMap([int Function(K key1, K key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) - SplayTreeMap: factory SplayTreeMap.from(Map other, [int Function(K key1, K key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Creates a SplayTreeMap that contains all key/value pairs of other. - SplayTreeMap: factory SplayTreeMap.of(Map other, [int Function(K key1, K key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Creates a SplayTreeMap that contains all key/value pairs of other. - SplayTreeMap: factory SplayTreeMap.fromIterable(Iterable iterable, {K Function(dynamic element)? key, V Function(dynamic element)? value, int Function(K key1, K key2)? compare, bool Function(dynamic potentialKey)? isValidKey}) — Creates a SplayTreeMap where the keys and values are computed from the iterable. - SplayTreeMap: factory SplayTreeMap.fromIterables(Iterable keys, Iterable values, [int Function(K key1, K key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Creates a SplayTreeMap associating the given keys to values. - SplayTreeMap: bool get isEmpty - SplayTreeMap: bool get isNotEmpty - SplayTreeMap: int get length - SplayTreeMap: Iterable get keys - SplayTreeMap: Iterable get values - SplayTreeMap: Iterable> get entries - SplayTreeMap: V? remove(Object? key) - SplayTreeMap: V putIfAbsent(K key, V ifAbsent()) - SplayTreeMap: V update(K key, V update(V value), {V Function()? ifAbsent}) - SplayTreeMap: void updateAll(V update(K key, V value)) - SplayTreeMap: void addAll(Map other) - SplayTreeMap: void forEach(void f(K key, V value)) - SplayTreeMap: void clear() - SplayTreeMap: bool containsKey(Object? key) - SplayTreeMap: bool containsValue(Object? value) - SplayTreeMap: K? firstKey() — The first key in the map. - SplayTreeMap: K? lastKey() — The last key in the map. - SplayTreeMap: K? lastKeyBefore(K key) — The last key in the map that is strictly smaller than key. - SplayTreeMap: K? firstKeyAfter(K key) — Get the first key in the map that is strictly larger than key. - SplayTreeMap: V? operator [](Object? key) - SplayTreeMap: void operator []=(K key, V value) - final class SplayTreeSet extends _SplayTree> with Iterable, SetMixin — A Set of objects that can be ordered relative to each other. - SplayTreeSet: SplayTreeSet([int Function(E key1, E key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Create a new SplayTreeSet with the given compare function. - SplayTreeSet: factory SplayTreeSet.from(Iterable elements, [int Function(E key1, E key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Creates a SplayTreeSet that contains all elements. - SplayTreeSet: factory SplayTreeSet.of(Iterable elements, [int Function(E key1, E key2)? compare, bool Function(dynamic potentialKey)? isValidKey]) — Creates a SplayTreeSet from elements. - SplayTreeSet: Iterator get iterator - SplayTreeSet: int get length - SplayTreeSet: bool get isEmpty - SplayTreeSet: bool get isNotEmpty - SplayTreeSet: E get first - SplayTreeSet: E get last - SplayTreeSet: E get single - SplayTreeSet: Set cast() - SplayTreeSet: bool contains(Object? element) - SplayTreeSet: bool add(E element) - SplayTreeSet: bool remove(Object? object) - SplayTreeSet: void addAll(Iterable elements) - SplayTreeSet: void removeAll(Iterable elements) - SplayTreeSet: void retainAll(Iterable elements) - SplayTreeSet: E? lookup(Object? object) - SplayTreeSet: Set intersection(Set other) - SplayTreeSet: Set difference(Set other) - SplayTreeSet: Set union(Set other) - SplayTreeSet: void clear() - SplayTreeSet: Set toSet() - SplayTreeSet: String toString() - class DoubleLinkedQueueEntry — An entry in a doubly linked list. - DoubleLinkedQueueEntry: DoubleLinkedQueueEntry(this.element) — Creates a new entry with the given element. - DoubleLinkedQueueEntry: E element — The element of the entry in the queue. - DoubleLinkedQueueEntry: void append(E e) — Appends the given element e as entry just after this entry. - DoubleLinkedQueueEntry: void prepend(E e) — Prepends the given e as entry just before this entry. - DoubleLinkedQueueEntry: E remove() — Removes this entry from any chain of entries it is part of. - DoubleLinkedQueueEntry: DoubleLinkedQueueEntry? previousEntry() — The previous entry, or null if there is none. - DoubleLinkedQueueEntry: DoubleLinkedQueueEntry? nextEntry() — The next entry, or null if there is none. ### Futures, streams and timers (raya:async) import 'raya:async'; Future, Stream, stream controllers and transformers, Completer, Timer, zones and microtasks. https://riptidecompute.com/raya/docs/core-async - void unawaited(Future? future) — Explicitly ignores a future. - void scheduleMicrotask(void Function() callback) — Runs a function asynchronously. - R runZoned(R body(), {Map? zoneValues, ZoneSpecification? zoneSpecification, @Deprecated("Use runZonedGuarded instead") Function? onError}) — Runs body in its own zone. - R? runZonedGuarded(R body(), void onError(Object error, StackTrace stack), {Map? zoneValues, ZoneSpecification? zoneSpecification}) — Runs body in its own error zone. - typedef ControllerCallback = void Function() — Type of a stream controller's onListen, onPause and onResume callbacks. - typedef ControllerCancelCallback = FutureOr Function() — Type of stream controller onCancel callbacks. - typedef ZoneCallback = R Function() — A no-argument function, like the argument to Zone.run. - typedef ZoneUnaryCallback = R Function(T) — A one-argument function, like the argument to Zone.runUnary. - typedef ZoneBinaryCallback = R Function(T1, T2) — A two-argument function, like the argument to Zone.runBinary. - typedef HandleUncaughtErrorHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace) — The type of a custom Zone.handleUncaughtError implementation function. - typedef RunHandler = R Function(Zone self, ZoneDelegate parent, Zone zone, R Function() f) — The type of a custom Zone.run implementation function. - typedef RunUnaryHandler = R Function(Zone self, ZoneDelegate parent, Zone zone, R Function(T arg) f, T arg) — The type of a custom Zone.runUnary implementation function. - typedef RunBinaryHandler = R Function(Zone self, ZoneDelegate parent, Zone zone, R Function(T1 arg1, T2 arg2) f, T1 arg1, T2 arg2) — The type of a custom Zone.runBinary implementation function. - typedef RegisterCallbackHandler = ZoneCallback Function(Zone self, ZoneDelegate parent, Zone zone, R Function() f) — The type of a custom Zone.registerCallback implementation function. - typedef RegisterUnaryCallbackHandler = ZoneUnaryCallback Function(Zone self, ZoneDelegate parent, Zone zone, R Function(T arg) f) — The type of a custom Zone.registerUnaryCallback implementation function. - typedef RegisterBinaryCallbackHandler = ZoneBinaryCallback Function(Zone self, ZoneDelegate parent, Zone zone, R Function(T1 arg1, T2 arg2) f) — The type of a custom Zone.registerBinaryCallback implementation function. - typedef ErrorCallbackHandler = AsyncError? Function(Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace? stackTrace) — The type of a custom Zone.errorCallback implementation function. - typedef ScheduleMicrotaskHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, void Function() f) — The type of a custom Zone.scheduleMicrotask implementation function. - typedef CreateTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration duration, void Function() f) — The type of a custom Zone.createTimer implementation function. - typedef CreatePeriodicTimerHandler = Timer Function(Zone self, ZoneDelegate parent, Zone zone, Duration period, void Function(Timer timer) f) — The type of a custom Zone.createPeriodicTimer implementation function. - typedef PrintHandler = void Function(Zone self, ZoneDelegate parent, Zone zone, String line) — The type of a custom Zone.print implementation function. - typedef ForkHandler = Zone Function(Zone self, ZoneDelegate parent, Zone zone, ZoneSpecification? specification, Map? zoneValues) — The type of a custom Zone.fork implementation function. - final class AsyncError implements Error — An error and a stack trace. - AsyncError: AsyncError(Object error, StackTrace? stackTrace) - AsyncError: static StackTrace defaultStackTrace(Object error) — A default stack trace for an error. - AsyncError: final Object error - AsyncError: final StackTrace stackTrace - AsyncError: String toString() - final class DeferredLoadException implements Exception — Thrown when a deferred library fails to load. - DeferredLoadException: DeferredLoadException(String message) - DeferredLoadException: String toString() - abstract class FutureOr — A type representing values that are either Future or T. - abstract interface class Future — The result of an asynchronous computation. - Future: factory Future(FutureOr computation()) — Creates a future containing the result of calling computation asynchronously with Timer.run. - Future: factory Future.microtask(FutureOr computation()) — Creates a future containing the result of calling computation asynchronously with scheduleMicrotask. - Future: factory Future.sync(FutureOr computation()) — The result of calling computation as a future. - Future: factory Future.syncValue(T value) — Creates a future completed with value. - Future: factory Future.value([FutureOr? value]) — Creates a future completed with value. - Future: factory Future.error(Object error, [StackTrace? stackTrace]) — Creates a future that completes with an error. - Future: factory Future.delayed(Duration duration, [FutureOr Function()? computation]) — Creates a future that runs its computation after a delay. - Future: static Future pause([Duration duration = Duration.zero]) — Creates a Future that completes with no result after duration. - Future: static Future> wait(Iterable> futures, {bool eagerError = false, void cleanUp(T successValue)?}) — Waits for multiple futures to complete and collects their results. - Future: static Future any(Iterable> futures) — Returns the result of the first future in futures to complete. - Future: static Future forEach(Iterable elements, FutureOr action(T element)) — Performs an action for each element of the iterable, in turn. - Future: static Future doWhile(FutureOr action()) — Performs an operation repeatedly until it returns false. - Future: Future then(FutureOr onValue(T value), {Function? onError}) — Register callbacks to be called when this future completes. - Future: Future catchError(Function onError, {bool test(Object error)?}) — Handles errors emitted by this Future. - Future: Future whenComplete(FutureOr action()) — Registers a function to be called when this future completes. - Future: Stream asStream() — Creates a Stream containing the result of this future. - Future: Future timeout(Duration timeLimit, {FutureOr onTimeout()?}) — Stop waiting for this future after timeLimit has passed. - extension FutureExtensions on Future — Convenience methods on futures. - FutureExtensions: Future onError(FutureOr handleError(E error, StackTrace stackTrace), {bool test(E error)?}) — Handles errors on this future. - FutureExtensions: void ignore() — Completely ignores this future and its result. - class TimeoutException implements Exception — Thrown when a scheduled timeout happens while waiting for an async result. - TimeoutException: TimeoutException(this.message, [this.duration]) - TimeoutException: final String? message — Description of the cause of the timeout. - TimeoutException: final Duration? duration — The duration that was exceeded. - TimeoutException: String toString() - abstract interface class Completer — A way to produce Future objects and to complete them later with a value or error. - Completer: factory Completer() — Creates a new completer. - Completer: factory Completer.sync() — Completes the future synchronously. - Completer: Future get future — The future that is completed by this completer. - Completer: bool get isCompleted — Whether the future has been completed. - Completer: void complete([FutureOr? value]) — Completes future with the supplied values. - Completer: void completeError(Object error, [StackTrace? stackTrace]) — Complete future with an error. - extension FutureIterable on Iterable> - FutureIterable: Future> get wait — Waits for futures in parallel. - extension FutureRecord2 on (Future, Future) — Parallel operations on a record of futures. - FutureRecord2: Future<(T1, T2)> get wait — Waits for futures in parallel. - extension FutureRecord3 on (Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord3: Future<(T1, T2, T3)> get wait — Waits for futures in parallel. - extension FutureRecord4 on (Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord4: Future<(T1, T2, T3, T4)> get wait — Waits for futures in parallel. - extension FutureRecord5 on (Future, Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord5: Future<(T1, T2, T3, T4, T5)> get wait — Waits for futures in parallel. - extension FutureRecord6 on (Future, Future, Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord6: Future<(T1, T2, T3, T4, T5, T6)> get wait — Waits for futures in parallel. - extension FutureRecord7 on (Future, Future, Future, Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord7: Future<(T1, T2, T3, T4, T5, T6, T7)> get wait — Waits for futures in parallel. - extension FutureRecord8 on (Future, Future, Future, Future, Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord8: Future<(T1, T2, T3, T4, T5, T6, T7, T8)> get wait — Waits for futures in parallel. - extension FutureRecord9 on (Future, Future, Future, Future, Future, Future, Future, Future, Future) — Parallel operations on a record of futures. - FutureRecord9: Future<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> get wait — Waits for futures in parallel. - class ParallelWaitError extends Error — Error thrown when waiting for multiple futures, when some have errors. - ParallelWaitError: ParallelWaitError(this.values, this.errors, {@Since("3.4") this._errorCount, @Since("3.4") this._defaultError}) — Creates error with the provided values and errors. - ParallelWaitError: final V values — Values of successful futures. - ParallelWaitError: final E errors — Errors of failing futures. - ParallelWaitError: StackTrace? get stackTrace - ParallelWaitError: String toString() - abstract mixin class Stream — A source of asynchronous data events. - Stream: const Stream() - Stream: const factory Stream.empty({@Since("3.2") bool broadcast}) = _EmptyStream — Creates an empty broadcast stream. - Stream: factory Stream.value(T value) — Creates a stream which emits a single data event before closing. - Stream: factory Stream.error(Object error, [StackTrace? stackTrace]) — Creates a stream which emits a single error event before completing. - Stream: factory Stream.fromFuture(Future future) — Creates a new single-subscription stream from the future. - Stream: factory Stream.fromFutures(Iterable> futures) — Create a single-subscription stream from a group of futures. - Stream: factory Stream.fromIterable(Iterable elements) — Creates a stream that gets its data from elements. - Stream: factory Stream.multi(void Function(MultiStreamController) onListen, {bool isBroadcast = false}) — Creates a multi-subscription stream. - Stream: factory Stream.periodic(Duration period, [T computation(int computationCount)?]) — Creates a stream that repeatedly emits events at period intervals. - Stream: factory Stream.eventTransformed(Stream source, EventSink mapSink(EventSink sink)) — Creates a stream where all events of an existing stream are piped through a sink-transformation. - Stream: static Stream castFrom(Stream source) — Adapts source to be a Stream. - Stream: bool get isBroadcast — Whether this stream is a broadcast stream. - Stream: Future get length — The number of elements in this stream. - Stream: Future get isEmpty — Whether this stream contains any elements. - Stream: Future get first — The first element of this stream. - Stream: Future get last — The last element of this stream. - Stream: Future get single — The single element of this stream. - Stream: Stream asBroadcastStream({void onListen(StreamSubscription subscription)?, void onCancel(StreamSubscription subscription)?}) — Returns a multi-subscription stream that produces the same events as this. - Stream: StreamSubscription listen(void onData(T event)?, {Function? onError, void onDone()?, bool? cancelOnError}) — Adds a subscription to this stream. - Stream: Stream where(bool test(T event)) — Creates a new stream from this stream that discards some elements. - Stream: Stream map(S convert(T event)) — Transforms each element of this stream into a new stream event. - Stream: Stream asyncMap(FutureOr convert(T event)) — Creates a new stream with each data event of this stream asynchronously mapped to a new event. - Stream: Stream asyncExpand(Stream? convert(T event)) — Transforms each element into a sequence of asynchronous events. - Stream: Stream handleError(Function onError, {bool test(error)?}) — Creates a wrapper Stream that intercepts some errors from this stream. - Stream: Stream expand(Iterable convert(T element)) — Transforms each element of this stream into a sequence of elements. - Stream: Future pipe(StreamConsumer streamConsumer) — Pipes the events of this stream into streamConsumer. - Stream: Stream transform(StreamTransformer streamTransformer) — Applies streamTransformer to this stream. - Stream: Future reduce(T combine(T previous, T element)) — Combines a sequence of values by repeatedly applying combine. - Stream: Future fold(S initialValue, S combine(S previous, T element)) — Combines a sequence of values by repeatedly applying combine. - Stream: Future join([String separator = ""]) — Combines the string representation of elements into a single string. - Stream: Future contains(Object? needle) — Returns whether needle occurs in the elements provided by this stream. - Stream: Future forEach(void action(T element)) — Executes action on each element of this stream. - Stream: Future every(bool test(T element)) — Checks whether test accepts all elements provided by this stream. - Stream: Future any(bool test(T element)) — Checks whether test accepts any element provided by this stream. - Stream: Stream cast() — Adapt this stream to be a Stream. - Stream: Future> toList() — Collects all elements of this stream in a List. - Stream: Future> toSet() — Collects the data of this stream in a Set. - Stream: Future drain([E? futureValue]) — Discards all data on this stream, but signals when it is done or an error occurred. - Stream: Stream take(int count) — Provides at most the first count data events of this stream. - Stream: Stream takeWhile(bool test(T element)) — Forwards data events while test is successful. - Stream: Stream skip(int count) — Skips the first count data events from this stream. - Stream: Stream skipWhile(bool test(T element)) — Skip data events from this stream while they are matched by test. - Stream: Stream distinct([bool equals(T previous, T next)?]) — Skips data events if they are equal to the previous data event. - Stream: Future firstWhere(bool test(T element), {T orElse()?}) — Finds the first element of this stream matching test. - Stream: Future lastWhere(bool test(T element), {T orElse()?}) — Finds the last element in this stream matching test. - Stream: Future singleWhere(bool test(T element), {T orElse()?}) — Finds the single element in this stream matching test. - Stream: Future elementAt(int index) — Returns the value of the indexth data event of this stream. - Stream: Stream timeout(Duration timeLimit, {void onTimeout(EventSink sink)?}) — Creates a new stream with the same events as this stream. - abstract interface class StreamSubscription — A subscription on events from a Stream. - StreamSubscription: bool get isPaused — Whether the StreamSubscription is currently paused. - StreamSubscription: Future cancel() — Cancels this subscription. - StreamSubscription: void onData(void handleData(T data)?) — Replaces the data event handler of this subscription. - StreamSubscription: void onError(Function? handleError) — Replaces the error event handler of this subscription. - StreamSubscription: void onDone(void handleDone()?) — Replaces the done event handler of this subscription. - StreamSubscription: void pause([Future? resumeSignal]) — Requests that the stream pauses events until further notice. - StreamSubscription: void resume() — Resumes after a pause. - StreamSubscription: Future asFuture([E? futureValue]) — Returns a future that handles the onDone and onError callbacks. - abstract interface class EventSink implements Sink — A Sink that supports adding errors. - EventSink: void add(T event) — Adds a data event to the sink. - EventSink: void addError(Object error, [StackTrace? stackTrace]) — Adds an error to the sink. - EventSink: void close() — Closes the sink. - class StreamView extends Stream — Stream wrapper that only exposes the Stream interface. - StreamView: const StreamView(Stream stream) - StreamView: bool get isBroadcast - StreamView: Stream asBroadcastStream({void onListen(StreamSubscription subscription)?, void onCancel(StreamSubscription subscription)?}) - StreamView: StreamSubscription listen(void onData(T value)?, {Function? onError, void onDone()?, bool? cancelOnError}) - abstract interface class StreamConsumer — Abstract interface for a "sink" accepting multiple entire streams. - StreamConsumer: Future addStream(Stream stream) — Consumes the elements of stream. - StreamConsumer: Future close() — Tells the consumer that no further streams will be added. - abstract interface class StreamSink implements EventSink, StreamConsumer — A object that accepts stream events both synchronously and asynchronously. - StreamSink: Future get done — Return a future which is completed when the StreamSink is finished. - StreamSink: Future close() — Tells the stream sink that no further streams will be added. - abstract interface class StreamTransformer — Transforms a Stream. - StreamTransformer: const factory StreamTransformer(StreamSubscription onListen(Stream stream, bool cancelOnError)) = _StreamSubscriptionTransformer — Creates a StreamTransformer based on the given onListen callback. - StreamTransformer: factory StreamTransformer.fromHandlers({void handleData(S data, EventSink sink)?, void handleError(Object error, StackTrace stackTrace, EventSink sink)?, void handleDone(EventSink sink)?}) = _StreamHandlerTransformer — Creates a StreamTransformer that delegates events to the given functions. - StreamTransformer: factory StreamTransformer.fromBind(Stream Function(Stream) bind) = _StreamBindTransformer — Creates a StreamTransformer based on a bind callback. - StreamTransformer: static StreamTransformer castFrom(StreamTransformer source) — Adapts source to be a StreamTransformer. - StreamTransformer: Stream bind(Stream stream) — Transforms the provided stream. - StreamTransformer: StreamTransformer cast() — Provides a StreamTransformer view of this stream transformer. - abstract class StreamTransformerBase implements StreamTransformer — Base class for implementing StreamTransformer. - StreamTransformerBase: const StreamTransformerBase() - StreamTransformerBase: StreamTransformer cast() - abstract interface class StreamIterator — An Iterator-like interface for the values of a Stream. - StreamIterator: factory StreamIterator(Stream stream) — Create a StreamIterator on stream. - StreamIterator: T get current — The current value of the stream. - StreamIterator: Future moveNext() — Wait for the next stream value to be available. - StreamIterator: Future cancel() — Cancels the stream iterator (and the underlying stream subscription) early. - abstract interface class MultiStreamController implements StreamController — An enhanced stream controller provided by Stream.multi. - MultiStreamController: void addSync(T value) — Adds and delivers an event. - MultiStreamController: void addErrorSync(Object error, [StackTrace? stackTrace]) — Adds and delivers an error event. - MultiStreamController: void closeSync() — Closes the controller and delivers a done event. - abstract interface class StreamController implements StreamSink — A controller with the stream it controls. - StreamController: factory StreamController({void onListen()?, void onPause()?, void onResume()?, FutureOr onCancel()?, bool sync = false}) — A controller with a stream that supports only one single subscriber. - StreamController: factory StreamController.broadcast({void onListen()?, void onCancel()?, bool sync = false}) — A controller where stream can be listened to more than once. - StreamController: Stream get stream — The stream that this controller is controlling. - StreamController: abstract void Function()? onListen — The callback which is called when the stream is listened to. - StreamController: abstract void Function()? onPause — The callback which is called when the stream is paused. - StreamController: abstract void Function()? onResume — The callback which is called when the stream is resumed. - StreamController: abstract FutureOr Function()? onCancel — The callback which is called when the stream is canceled. - StreamController: StreamSink get sink — Returns a view of this object that only exposes the StreamSink interface. - StreamController: bool get isClosed — Whether the stream controller is closed for adding more events. - StreamController: bool get isPaused — Whether the subscription would need to buffer events. - StreamController: bool get hasListener — Whether there is a subscriber on the Stream. - StreamController: Future get done — A future which is completed when the stream controller is done sending events. - StreamController: void add(T event) — Sends a data event. - StreamController: void addError(Object error, [StackTrace? stackTrace]) — Sends or enqueues an error event. - StreamController: Future close() — Closes the stream. - StreamController: Future addStream(Stream source, {bool? cancelOnError}) — Receives events from source and puts them into this controller's stream. - abstract interface class SynchronousStreamController implements StreamController — A stream controller that delivers its events synchronously. - SynchronousStreamController: void add(T data) — Adds event to the controller's stream. - SynchronousStreamController: void addError(Object error, [StackTrace? stackTrace]) — Adds error to the controller's stream. - SynchronousStreamController: Future close() — Closes the controller's stream. - abstract interface class Timer — A countdown timer that can be configured to fire once or repeatedly. - Timer: factory Timer(Duration duration, void Function() callback) — Creates a new timer. - Timer: factory Timer.periodic(Duration duration, void callback(Timer timer)) — Creates a new repeating timer. - Timer: static void run(void Function() callback) — Runs the given callback asynchronously as soon as possible. - Timer: int get tick — The number of durations preceding the most recent timer event. - Timer: bool get isActive — Returns whether the timer is still active. - Timer: void cancel() — Cancels the timer. - abstract final class Zone — A zone represents an environment that remains stable across asynchronous calls. - Zone: static const Zone root = _rootZone — The root zone. - Zone: static Zone get current — The zone that is currently active. - Zone: Zone? get parent — The parent zone of the this zone. - Zone: Zone get errorZone — The error zone is responsible for dealing with uncaught errors. - Zone: void handleUncaughtError(Object error, StackTrace stackTrace) — Handles uncaught asynchronous errors. - Zone: bool inSameErrorZone(Zone otherZone) — Whether this zone and otherZone are in the same error zone. - Zone: Zone fork({ZoneSpecification? specification, Map? zoneValues}) — Creates a new zone as a child zone of this zone. - Zone: R run(R action()) — Executes action in this zone. - Zone: R runUnary(R action(T argument), T argument) — Executes the given action with argument in this zone. - Zone: R runBinary(R action(T1 argument1, T2 argument2), T1 argument1, T2 argument2) — Executes the given action with argument1 and argument2 in this zone. - Zone: void runGuarded(void action()) — Executes the given action in this zone and catches synchronous errors. - Zone: void runUnaryGuarded(void action(T argument), T argument) — Executes the given action with argument in this zone and catches synchronous errors. - Zone: void runBinaryGuarded(void action(T1 argument1, T2 argument2), T1 argument1, T2 argument2) — Executes the given action with argument1 and argument2 in this zone and catches synchronous errors. - Zone: ZoneCallback registerCallback(R callback()) — Registers the given callback in this zone. - Zone: ZoneUnaryCallback registerUnaryCallback(R callback(T arg)) — Registers the given callback in this zone. - Zone: ZoneBinaryCallback registerBinaryCallback(R callback(T1 arg1, T2 arg2)) — Registers the given callback in this zone. - Zone: ZoneCallback bindCallback(R callback()) — Registers the provided callback and returns a function that will execute in this zone. - Zone: ZoneUnaryCallback bindUnaryCallback(R callback(T argument)) — Registers the provided callback and returns a function that will execute in this zone. - Zone: ZoneBinaryCallback bindBinaryCallback(R callback(T1 argument1, T2 argument2)) — Registers the provided callback and returns a function that will execute in this zone. - Zone: void Function() bindCallbackGuarded(void Function() callback) — Registers the provided callback and returns a function that will execute in this zone. - Zone: void Function(T) bindUnaryCallbackGuarded(void callback(T argument)) — Registers the provided callback and returns a function that will execute in this zone. - Zone: void Function(T1, T2) bindBinaryCallbackGuarded(void callback(T1 argument1, T2 argument2)) — Registers the provided callback and returns a function that will execute in this zone. - Zone: AsyncError? errorCallback(Object error, StackTrace? stackTrace) — Intercepts errors when added programmatically to a Future or Stream. - Zone: void scheduleMicrotask(void Function() callback) — Runs callback asynchronously in this zone. - Zone: Timer createTimer(Duration duration, void Function() callback) — Creates a Timer where the callback is executed in this zone. - Zone: Timer createPeriodicTimer(Duration period, void callback(Timer timer)) — Creates a periodic Timer where the callback is executed in this zone. - Zone: void print(String line) — Prints the given line. - Zone: dynamic operator [](Object? key) — Retrieves the zone-value associated with key. - abstract final class ZoneDelegate — An adapted view of the parent zone. - ZoneDelegate: void handleUncaughtError(Zone zone, Object error, StackTrace stackTrace) - ZoneDelegate: R run(Zone zone, R f()) - ZoneDelegate: R runUnary(Zone zone, R f(T arg), T arg) - ZoneDelegate: R runBinary(Zone zone, R f(T1 arg1, T2 arg2), T1 arg1, T2 arg2) - ZoneDelegate: ZoneCallback registerCallback(Zone zone, R f()) - ZoneDelegate: ZoneUnaryCallback registerUnaryCallback(Zone zone, R f(T arg)) - ZoneDelegate: ZoneBinaryCallback registerBinaryCallback(Zone zone, R f(T1 arg1, T2 arg2)) - ZoneDelegate: AsyncError? errorCallback(Zone zone, Object error, StackTrace? stackTrace) - ZoneDelegate: void scheduleMicrotask(Zone zone, void f()) - ZoneDelegate: Timer createTimer(Zone zone, Duration duration, void f()) - ZoneDelegate: Timer createPeriodicTimer(Zone zone, Duration period, void f(Timer timer)) - ZoneDelegate: void print(Zone zone, String line) - ZoneDelegate: Zone fork(Zone zone, ZoneSpecification? specification, Map? zoneValues) - final class ZoneSpecification — A parameter object with custom zone function handlers for Zone.fork. - ZoneSpecification: const ZoneSpecification({this.handleUncaughtError, this.run, this.runUnary, this.runBinary, this.registerCallback, this.registerUnaryCallback, this.registerBinaryCallback, this.errorCallback, this.scheduleMicrotask, this.createTimer, this.createPeriodicTimer, this.print, this.fork}) — Creates a specification with the provided handlers. - ZoneSpecification: ZoneSpecification.from(ZoneSpecification other, {HandleUncaughtErrorHandler? handleUncaughtError, RunHandler? run, RunUnaryHandler? runUnary, RunBinaryHandler? runBinary, RegisterCallbackHandler? registerCallback, RegisterUnaryCallbackHandler? registerUnaryCallback, RegisterBinaryCallbackHandler? registerBinaryCallback, ErrorCallbackHandler? errorCallback, ScheduleMicrotaskHandler? scheduleMicrotask, CreateTimerHandler? createTimer, CreatePeriodicTimerHandler? createPeriodicTimer, PrintHandler? print, ForkHandler? fork}) — Creates a specification from other and provided handlers. - ZoneSpecification: final HandleUncaughtErrorHandler? handleUncaughtError — A custom Zone.handleUncaughtError implementation for a new zone. - ZoneSpecification: final RunHandler? run — A custom Zone.run implementation for a new zone. - ZoneSpecification: final RunUnaryHandler? runUnary — A custom Zone.runUnary implementation for a new zone. - ZoneSpecification: final RunBinaryHandler? runBinary — A custom Zone.runBinary implementation for a new zone. - ZoneSpecification: final RegisterCallbackHandler? registerCallback — A custom Zone.registerCallback implementation for a new zone. - ZoneSpecification: final RegisterUnaryCallbackHandler? registerUnaryCallback — A custom Zone.registerUnaryCallback implementation for a new zone. - ZoneSpecification: final RegisterBinaryCallbackHandler? registerBinaryCallback — A custom Zone.registerBinaryCallback implementation for a new zone. - ZoneSpecification: final ErrorCallbackHandler? errorCallback — A custom Zone.errorCallback implementation for a new zone. - ZoneSpecification: final ScheduleMicrotaskHandler? scheduleMicrotask — A custom Zone.scheduleMicrotask implementation for a new zone. - ZoneSpecification: final CreateTimerHandler? createTimer — A custom Zone.createTimer implementation for a new zone. - ZoneSpecification: final CreatePeriodicTimerHandler? createPeriodicTimer — A custom Zone.createPeriodicTimer implementation for a new zone. - ZoneSpecification: final PrintHandler? print — A custom Zone.print implementation for a new zone. - ZoneSpecification: final ForkHandler? fork — A custom Zone.handleUncaughtError implementation for a new zone. ### Typed data and SIMD (raya:typed_data) import 'raya:typed_data'; Typed lists and byte buffers, ByteData views, and the SIMD types Float32x4, Int32x4 and Float64x2. https://riptidecompute.com/raya/docs/core-typed-data - abstract final class ByteBuffer — A sequence of bytes underlying a typed data object. - ByteBuffer: int get lengthInBytes — The length of this byte buffer, in bytes. - ByteBuffer: Uint8List asUint8List([int offsetInBytes = 0, int? length]) — Creates a Uint8List view of a region of this byte buffer. - ByteBuffer: Int8List asInt8List([int offsetInBytes = 0, int? length]) — Creates a Int8List view of a region of this byte buffer. - ByteBuffer: Uint8ClampedList asUint8ClampedList([int offsetInBytes = 0, int? length]) — Creates a Uint8ClampedList view of a region of this byte buffer. - ByteBuffer: Uint16List asUint16List([int offsetInBytes = 0, int? length]) — Creates a Uint16List view of a region of this byte buffer. - ByteBuffer: Int16List asInt16List([int offsetInBytes = 0, int? length]) — Creates a Int16List view of a region of this byte buffer. - ByteBuffer: Uint32List asUint32List([int offsetInBytes = 0, int? length]) — Creates a Uint32List view of a region of this byte buffer. - ByteBuffer: Int32List asInt32List([int offsetInBytes = 0, int? length]) — Creates a Int32List view of a region of this byte buffer. - ByteBuffer: Uint64List asUint64List([int offsetInBytes = 0, int? length]) — Creates a Uint64List view of a region of this byte buffer. - ByteBuffer: Int64List asInt64List([int offsetInBytes = 0, int? length]) — Creates a Int64List view of a region of this byte buffer. - ByteBuffer: Int32x4List asInt32x4List([int offsetInBytes = 0, int? length]) — Creates a Int32x4List view of a region of this byte buffer. - ByteBuffer: Float32List asFloat32List([int offsetInBytes = 0, int? length]) — Creates a Float32List view of a region of this byte buffer. - ByteBuffer: Float64List asFloat64List([int offsetInBytes = 0, int? length]) — Creates a Float64List view of a region of this byte buffer. - ByteBuffer: Float32x4List asFloat32x4List([int offsetInBytes = 0, int? length]) — Creates a Float32x4List view of a region of this byte buffer. - ByteBuffer: Float64x2List asFloat64x2List([int offsetInBytes = 0, int? length]) — Creates a Float64x2List view of a region of this byte buffer. - ByteBuffer: ByteData asByteData([int offsetInBytes = 0, int? length]) — Creates a ByteData view of a region of this byte buffer. - abstract final class TypedData — A typed view of a sequence of bytes. - TypedData: int get elementSizeInBytes — The number of bytes in the representation of each element in this list. - TypedData: int get offsetInBytes — The offset of this view into the underlying byte buffer, in bytes. - TypedData: int get lengthInBytes — The length of this view, in bytes. - TypedData: ByteBuffer get buffer — The byte buffer associated with this object. - abstract final class TypedDataList implements TypedData, List — A TypedData fixed-length List-view on the bytes of buffer. - final class Endian — Endianness of number representation. - Endian: static const Endian big = Endian._(false) - Endian: static const Endian little = Endian._(true) - Endian: static final Endian host - abstract final class ByteData implements TypedData — A fixed-length, random-access sequence of bytes that also provides random and unaligned access to the fixed-width integers and floating point numbers represented by those bytes. - ByteData: external factory ByteData(int length) — Creates a ByteData of the specified length (in elements), all of whose bytes are initially zero. - ByteData: factory ByteData.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an ByteData view of the specified region in buffer. - ByteData: factory ByteData.sublistView(TypedData data, [int start = 0, int? end]) — Creates a ByteData view on a range of elements of data. - ByteData: ByteData asUnmodifiableView() — A read-only view of this ByteData. - ByteData: int getInt8(int byteOffset) — The (possibly negative) integer represented by the byte at the specified byteOffset in this object, in two's complement binary representation. - ByteData: void setInt8(int byteOffset, int value) — Sets the byte at the specified byteOffset in this object to the two's complement binary representation of the specified value, which must fit in a single byte. - ByteData: int getUint8(int byteOffset) — The positive integer represented by the byte at the specified byteOffset in this object, in unsigned binary form. - ByteData: void setUint8(int byteOffset, int value) — Sets the byte at the specified byteOffset in this object to the unsigned binary representation of the specified value, which must fit in a single byte. - ByteData: int getInt16(int byteOffset, [Endian endian = Endian.big]) — The (possibly negative) integer represented by the two bytes at the specified byteOffset in this object, in two's complement binary form. - ByteData: void setInt16(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the two bytes starting at the specified byteOffset in this object to the two's complement binary representation of the specified value, which must fit in two bytes. - ByteData: int getUint16(int byteOffset, [Endian endian = Endian.big]) — The positive integer represented by the two bytes starting at the specified byteOffset in this object, in unsigned binary form. - ByteData: void setUint16(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the two bytes starting at the specified byteOffset in this object to the unsigned binary representation of the specified value, which must fit in two bytes. - ByteData: int getInt32(int byteOffset, [Endian endian = Endian.big]) — The (possibly negative) integer represented by the four bytes at the specified byteOffset in this object, in two's complement binary form. - ByteData: void setInt32(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the four bytes starting at the specified byteOffset in this object to the two's complement binary representation of the specified value, which must fit in four bytes. - ByteData: int getUint32(int byteOffset, [Endian endian = Endian.big]) — The positive integer represented by the four bytes starting at the specified byteOffset in this object, in unsigned binary form. - ByteData: void setUint32(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the four bytes starting at the specified byteOffset in this object to the unsigned binary representation of the specified value, which must fit in four bytes. - ByteData: int getInt64(int byteOffset, [Endian endian = Endian.big]) — The (possibly negative) integer represented by the eight bytes at the specified byteOffset in this object, in two's complement binary form. - ByteData: void setInt64(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the eight bytes starting at the specified byteOffset in this object to the two's complement binary representation of the specified value, which must fit in eight bytes. - ByteData: int getUint64(int byteOffset, [Endian endian = Endian.big]) — The positive integer represented by the eight bytes starting at the specified byteOffset in this object, in unsigned binary form. - ByteData: void setUint64(int byteOffset, int value, [Endian endian = Endian.big]) — Sets the eight bytes starting at the specified byteOffset in this object to the unsigned binary representation of the specified value, which must fit in eight bytes. - ByteData: double getFloat32(int byteOffset, [Endian endian = Endian.big]) — The floating point number represented by the four bytes at the specified byteOffset in this object, in IEEE 754 single-precision binary floating-point format (binary32). - ByteData: void setFloat32(int byteOffset, double value, [Endian endian = Endian.big]) — Sets the four bytes starting at the specified byteOffset in this object to the IEEE 754 single-precision binary floating-point (binary32) representation of the specified value. - ByteData: double getFloat64(int byteOffset, [Endian endian = Endian.big]) — The floating point number represented by the eight bytes at the specified byteOffset in this object, in IEEE 754 double-precision binary floating-point format (binary64). - ByteData: void setFloat64(int byteOffset, double value, [Endian endian = Endian.big]) — Sets the eight bytes starting at the specified byteOffset in this object to the IEEE 754 double-precision binary floating-point (binary64) representation of the specified value. - abstract final class Int8List implements _TypedIntList — A fixed-length list of 8-bit signed integers. - Int8List: external factory Int8List(int length) — Creates an Int8List of the specified length (in elements), all of whose elements are initially zero. - Int8List: external factory Int8List.fromList(List elements) — Creates a Int8List with the same length as the elements list and copies over the elements. - Int8List: factory Int8List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an Int8List view of the specified region in buffer. - Int8List: factory Int8List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Int8List view on a range of elements of data. - Int8List: static const int bytesPerElement = 1 - Int8List: Int8List asUnmodifiableView() — A read-only view of this Int8List; - Int8List: Int8List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Uint8List implements _TypedIntList — A fixed-length list of 8-bit unsigned integers. - Uint8List: external factory Uint8List(int length) — Creates a Uint8List of the specified length (in elements), all of whose elements are initially zero. - Uint8List: external factory Uint8List.fromList(List elements) — Creates a Uint8List with the same length as the elements list and copies over the elements. - Uint8List: factory Uint8List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Uint8List view of the specified region in buffer. - Uint8List: factory Uint8List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Uint8List view on a range of elements of data. - Uint8List: static const int bytesPerElement = 1 - Uint8List: Uint8List asUnmodifiableView() — A read-only view of this Uint8List. - Uint8List: Uint8List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - Uint8List: List operator +(List other) — Returns a concatenation of this list and other. - abstract final class Uint8ClampedList implements _TypedIntList — A fixed-length list of 8-bit unsigned integers. - Uint8ClampedList: external factory Uint8ClampedList(int length) — Creates a Uint8ClampedList of the specified length (in elements), all of whose elements are initially zero. - Uint8ClampedList: external factory Uint8ClampedList.fromList(List elements) — Creates a Uint8ClampedList of the same size as the elements list and copies over the values clamping when needed. - Uint8ClampedList: factory Uint8ClampedList.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Uint8ClampedList view of the specified region in the specified byte buffer. - Uint8ClampedList: factory Uint8ClampedList.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Uint8ClampedList view on a range of elements of data. - Uint8ClampedList: static const int bytesPerElement = 1 - Uint8ClampedList: Uint8ClampedList asUnmodifiableView() — A read-only view of this Uint8ClampedList. - Uint8ClampedList: Uint8ClampedList sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Int16List implements _TypedIntList — A fixed-length list of 16-bit signed integers that is viewable as a TypedData. - Int16List: external factory Int16List(int length) — Creates an Int16List of the specified length (in elements), all of whose elements are initially zero. - Int16List: external factory Int16List.fromList(List elements) — Creates a Int16List with the same length as the elements list and copies over the elements. - Int16List: factory Int16List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an Int16List view of the specified region in buffer. - Int16List: factory Int16List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Int16List view on a range of elements of data. - Int16List: static const int bytesPerElement = 2 - Int16List: Int16List asUnmodifiableView() — A read-only view of this Int16List. - Int16List: Int16List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Uint16List implements _TypedIntList — A fixed-length list of 16-bit unsigned integers that is viewable as a TypedData. - Uint16List: external factory Uint16List(int length) — Creates a Uint16List of the specified length (in elements), all of whose elements are initially zero. - Uint16List: external factory Uint16List.fromList(List elements) — Creates a Uint16List with the same length as the elements list and copies over the elements. - Uint16List: factory Uint16List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Uint16List view of the specified region in the specified byte buffer. - Uint16List: factory Uint16List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Uint16List view on a range of elements of data. - Uint16List: static const int bytesPerElement = 2 - Uint16List: Uint16List asUnmodifiableView() — A read-only view of this Uint16List. - Uint16List: Uint16List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Int32List implements _TypedIntList — A fixed-length list of 32-bit signed integers that is viewable as a TypedData. - Int32List: external factory Int32List(int length) — Creates an Int32List of the specified length (in elements), all of whose elements are initially zero. - Int32List: external factory Int32List.fromList(List elements) — Creates a Int32List with the same length as the elements list and copies over the elements. - Int32List: factory Int32List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an Int32List view of the specified region in buffer. - Int32List: factory Int32List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Int32List view on a range of elements of data. - Int32List: static const int bytesPerElement = 4 - Int32List: Int32List asUnmodifiableView() — A read-only view of this Int16List. - Int32List: Int32List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Uint32List implements _TypedIntList — A fixed-length list of 32-bit unsigned integers that is viewable as a TypedData. - Uint32List: external factory Uint32List(int length) — Creates a Uint32List of the specified length (in elements), all of whose elements are initially zero. - Uint32List: external factory Uint32List.fromList(List elements) — Creates a Uint32List with the same length as the elements list and copies over the elements. - Uint32List: factory Uint32List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Uint32List view of the specified region in the specified byte buffer. - Uint32List: factory Uint32List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Uint32List view on a range of elements of data. - Uint32List: static const int bytesPerElement = 4 - Uint32List: Uint32List asUnmodifiableView() — A read-only view of this Uint32List. - Uint32List: Uint32List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Int64List implements _TypedIntList — A fixed-length list of 64-bit signed integers that is viewable as a TypedData. - Int64List: external factory Int64List(int length) — Creates an Int64List of the specified length (in elements), all of whose elements are initially zero. - Int64List: external factory Int64List.fromList(List elements) — Creates a Int64List with the same length as the elements list and copies over the elements. - Int64List: factory Int64List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an Int64List view of the specified region in buffer. - Int64List: factory Int64List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Int64List view on a range of elements of data. - Int64List: static const int bytesPerElement = 8 - Int64List: Int64List asUnmodifiableView() — A read-only view of this Int64List. - Int64List: Int64List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Uint64List implements _TypedIntList — A fixed-length list of 64-bit unsigned integers that is viewable as a TypedData. - Uint64List: external factory Uint64List(int length) — Creates a Uint64List of the specified length (in elements), all of whose elements are initially zero. - Uint64List: external factory Uint64List.fromList(List elements) — Creates a Uint64List with the same length as the elements list and copies over the elements. - Uint64List: factory Uint64List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates an Uint64List view of the specified region in the specified byte buffer. - Uint64List: factory Uint64List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Uint64List view on a range of elements of data. - Uint64List: static const int bytesPerElement = 8 - Uint64List: Uint64List asUnmodifiableView() — A read-only view of this Uint64List. - Uint64List: Uint64List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Float32List implements _TypedFloatList — A fixed-length list of IEEE 754 single-precision binary floating-point numbers that is viewable as a TypedData. - Float32List: external factory Float32List(int length) — Creates a Float32List of the specified length (in elements), all of whose elements are initially zero. - Float32List: external factory Float32List.fromList(List elements) — Creates a Float32List with the same length as the elements list and copies over the elements. - Float32List: factory Float32List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Float32List view of the specified region in buffer. - Float32List: factory Float32List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Float32List view on a range of elements of data. - Float32List: static const int bytesPerElement = 4 - Float32List: Float32List asUnmodifiableView() — A read-only view of this Float32List. - Float32List: Float32List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Float64List implements _TypedFloatList — A fixed-length list of IEEE 754 double-precision binary floating-point numbers that is viewable as a TypedData. - Float64List: external factory Float64List(int length) — Creates a Float64List of the specified length (in elements), all of whose elements are initially zero. - Float64List: external factory Float64List.fromList(List elements) — Creates a Float64List with the same length as the elements list and copies over the elements. - Float64List: factory Float64List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Float64List view of the specified region in buffer. - Float64List: factory Float64List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Float64List view on a range of elements of data. - Float64List: static const int bytesPerElement = 8 - Float64List: Float64List asUnmodifiableView() — A read-only view of this Float64List. - Float64List: Float64List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - abstract final class Float32x4List implements TypedDataList, TypedData — A fixed-length list of Float32x4 numbers that is viewable as a TypedData. - Float32x4List: external factory Float32x4List(int length) — Creates a Float32x4List of the specified length (in elements), all of whose elements are initially zero. - Float32x4List: external factory Float32x4List.fromList(List elements) — Creates a Float32x4List with the same length as the elements list and copies over the elements. - Float32x4List: factory Float32x4List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Float32x4List view of the specified region in buffer. - Float32x4List: factory Float32x4List.sublistView(TypedData data, [int start = 0, int? end]) — Creates a Float32x4List view on a range of elements of data. - Float32x4List: static const int bytesPerElement = 16 - Float32x4List: Float32x4List asUnmodifiableView() — A read-only view of this Float32x4List. - Float32x4List: Float32x4List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - Float32x4List: List operator +(List other) — The concatenation of this list and other. - abstract final class Int32x4List implements TypedDataList, TypedData — A fixed-length list of Int32x4 numbers that is viewable as a TypedData. - Int32x4List: external factory Int32x4List(int length) — Creates a Int32x4List of the specified length (in elements), all of whose elements are initially zero. - Int32x4List: external factory Int32x4List.fromList(List elements) — Creates a Int32x4List with the same length as the elements list and copies over the elements. - Int32x4List: factory Int32x4List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Int32x4List view of the specified region in buffer. - Int32x4List: factory Int32x4List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Int32x4List view on a range of elements of data. - Int32x4List: static const int bytesPerElement = 16 - Int32x4List: Int32x4List asUnmodifiableView() — A read-only view of this Int32x4List. - Int32x4List: Int32x4List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - Int32x4List: List operator +(List other) — The concatenation of this list and other. - abstract final class Float64x2List implements TypedDataList, TypedData — A fixed-length list of Float64x2 numbers that is viewable as a TypedData. - Float64x2List: external factory Float64x2List(int length) — Creates a Float64x2List of the specified length (in elements), all of whose elements have all lanes set to zero. - Float64x2List: external factory Float64x2List.fromList(List elements) — Creates a Float64x2List with the same length as the elements list and copies over the elements. - Float64x2List: factory Float64x2List.view(ByteBuffer buffer, [int offsetInBytes = 0, int? length]) — Creates a Float64x2List view of the specified region in buffer. - Float64x2List: factory Float64x2List.sublistView(TypedData data, [int start = 0, int? end]) — Creates an Float64x2List view on a range of elements of data. - Float64x2List: static const int bytesPerElement = 16 - Float64x2List: Float64x2List asUnmodifiableView() — A read-only view of this Float64x2List. - Float64x2List: Float64x2List sublist(int start, [int? end]) — Creates a new list containing the elements between start and end. - Float64x2List: List operator +(List other) — The concatenation of this list and other. - abstract final class Float32x4 — Four 32-bit floating point values. - Float32x4: external factory Float32x4(double x, double y, double z, double w) — Creates a Float32x4 containing the 32-bit float values of the arguments. - Float32x4: external factory Float32x4.splat(double value) — Creates a Float32x4 with the same 32-bit float value four times. - Float32x4: external factory Float32x4.zero() — Creates a Float32x4 with all values being zero. - Float32x4: external factory Float32x4.fromInt32x4Bits(Int32x4 bits) — Creates a Float32x4 with 32-bit float values from the provided bits. - Float32x4: external factory Float32x4.fromFloat64x2(Float64x2 xy) — Creates a Float32x4 with its x and y lanes set to values from xy. - Float32x4: static const int xxxx = 0x00 — Shuffle mask "xxxx". - Float32x4: static const int xxxy = 0x40 — Shuffle mask "xxxy". - Float32x4: static const int xxxz = 0x80 — Shuffle mask "xxxz". - Float32x4: static const int xxxw = 0xC0 — Shuffle mask "xxxw". - Float32x4: static const int xxyx = 0x10 — Shuffle mask "xxyx". - Float32x4: static const int xxyy = 0x50 — Shuffle mask "xxyy". - Float32x4: static const int xxyz = 0x90 — Shuffle mask "xxyz". - Float32x4: static const int xxyw = 0xD0 — Shuffle mask "xxyw". - Float32x4: static const int xxzx = 0x20 — Shuffle mask "xxzx". - Float32x4: static const int xxzy = 0x60 — Shuffle mask "xxzy". - Float32x4: static const int xxzz = 0xA0 — Shuffle mask "xxzz". - Float32x4: static const int xxzw = 0xE0 — Shuffle mask "xxzw". - Float32x4: static const int xxwx = 0x30 — Shuffle mask "xxwx". - Float32x4: static const int xxwy = 0x70 — Shuffle mask "xxwy". - Float32x4: static const int xxwz = 0xB0 — Shuffle mask "xxwz". - Float32x4: static const int xxww = 0xF0 — Shuffle mask "xxww". - Float32x4: static const int xyxx = 0x04 — Shuffle mask "xyxx". - Float32x4: static const int xyxy = 0x44 — Shuffle mask "xyxy". - Float32x4: static const int xyxz = 0x84 — Shuffle mask "xyxz". - Float32x4: static const int xyxw = 0xC4 — Shuffle mask "xyxw". - Float32x4: static const int xyyx = 0x14 — Shuffle mask "xyyx". - Float32x4: static const int xyyy = 0x54 — Shuffle mask "xyyy". - Float32x4: static const int xyyz = 0x94 — Shuffle mask "xyyz". - Float32x4: static const int xyyw = 0xD4 — Shuffle mask "xyyw". - Float32x4: static const int xyzx = 0x24 — Shuffle mask "xyzx". - Float32x4: static const int xyzy = 0x64 — Shuffle mask "xyzy". - Float32x4: static const int xyzz = 0xA4 — Shuffle mask "xyzz". - Float32x4: static const int xyzw = 0xE4 — Shuffle mask "xyzw". - Float32x4: static const int xywx = 0x34 — Shuffle mask "xywx". - Float32x4: static const int xywy = 0x74 — Shuffle mask "xywy". - Float32x4: static const int xywz = 0xB4 — Shuffle mask "xywz". - Float32x4: static const int xyww = 0xF4 — Shuffle mask "xyww". - Float32x4: static const int xzxx = 0x08 — Shuffle mask "xzxx". - Float32x4: static const int xzxy = 0x48 — Shuffle mask "xzxy". - Float32x4: static const int xzxz = 0x88 — Shuffle mask "xzxz". - Float32x4: static const int xzxw = 0xC8 — Shuffle mask "xzxw". - Float32x4: static const int xzyx = 0x18 — Shuffle mask "xzyx". - Float32x4: static const int xzyy = 0x58 — Shuffle mask "xzyy". - Float32x4: static const int xzyz = 0x98 — Shuffle mask "xzyz". - Float32x4: static const int xzyw = 0xD8 — Shuffle mask "xzyw". - Float32x4: static const int xzzx = 0x28 — Shuffle mask "xzzx". - Float32x4: static const int xzzy = 0x68 — Shuffle mask "xzzy". - Float32x4: static const int xzzz = 0xA8 — Shuffle mask "xzzz". - Float32x4: static const int xzzw = 0xE8 — Shuffle mask "xzzw". - Float32x4: static const int xzwx = 0x38 — Shuffle mask "xzwx". - Float32x4: static const int xzwy = 0x78 — Shuffle mask "xzwy". - Float32x4: static const int xzwz = 0xB8 — Shuffle mask "xzwz". - Float32x4: static const int xzww = 0xF8 — Shuffle mask "xzww". - Float32x4: static const int xwxx = 0x0C — Shuffle mask "xwxx". - Float32x4: static const int xwxy = 0x4C — Shuffle mask "xwxy". - Float32x4: static const int xwxz = 0x8C — Shuffle mask "xwxz". - Float32x4: static const int xwxw = 0xCC — Shuffle mask "xwxw". - Float32x4: static const int xwyx = 0x1C — Shuffle mask "xwyx". - Float32x4: static const int xwyy = 0x5C — Shuffle mask "xwyy". - Float32x4: static const int xwyz = 0x9C — Shuffle mask "xwyz". - Float32x4: static const int xwyw = 0xDC — Shuffle mask "xwyw". - Float32x4: static const int xwzx = 0x2C — Shuffle mask "xwzx". - Float32x4: static const int xwzy = 0x6C — Shuffle mask "xwzy". - Float32x4: static const int xwzz = 0xAC — Shuffle mask "xwzz". - Float32x4: static const int xwzw = 0xEC — Shuffle mask "xwzw". - Float32x4: static const int xwwx = 0x3C — Shuffle mask "xwwx". - Float32x4: static const int xwwy = 0x7C — Shuffle mask "xwwy". - Float32x4: static const int xwwz = 0xBC — Shuffle mask "xwwz". - Float32x4: static const int xwww = 0xFC — Shuffle mask "xwww". - Float32x4: static const int yxxx = 0x01 — Shuffle mask "yxxx". - Float32x4: static const int yxxy = 0x41 — Shuffle mask "yxxy". - Float32x4: static const int yxxz = 0x81 — Shuffle mask "yxxz". - Float32x4: static const int yxxw = 0xC1 — Shuffle mask "yxxw". - Float32x4: static const int yxyx = 0x11 — Shuffle mask "yxyx". - Float32x4: static const int yxyy = 0x51 — Shuffle mask "yxyy". - Float32x4: static const int yxyz = 0x91 — Shuffle mask "yxyz". - Float32x4: static const int yxyw = 0xD1 — Shuffle mask "yxyw". - Float32x4: static const int yxzx = 0x21 — Shuffle mask "yxzx". - Float32x4: static const int yxzy = 0x61 — Shuffle mask "yxzy". - Float32x4: static const int yxzz = 0xA1 — Shuffle mask "yxzz". - Float32x4: static const int yxzw = 0xE1 — Shuffle mask "yxzw". - Float32x4: static const int yxwx = 0x31 — Shuffle mask "yxwx". - Float32x4: static const int yxwy = 0x71 — Shuffle mask "yxwy". - Float32x4: static const int yxwz = 0xB1 — Shuffle mask "yxwz". - Float32x4: static const int yxww = 0xF1 — Shuffle mask "yxww". - Float32x4: static const int yyxx = 0x05 — Shuffle mask "yyxx". - Float32x4: static const int yyxy = 0x45 — Shuffle mask "yyxy". - Float32x4: static const int yyxz = 0x85 — Shuffle mask "yyxz". - Float32x4: static const int yyxw = 0xC5 — Shuffle mask "yyxw". - Float32x4: static const int yyyx = 0x15 — Shuffle mask "yyyx". - Float32x4: static const int yyyy = 0x55 — Shuffle mask "yyyy". - Float32x4: static const int yyyz = 0x95 — Shuffle mask "yyyz". - Float32x4: static const int yyyw = 0xD5 — Shuffle mask "yyyw". - Float32x4: static const int yyzx = 0x25 — Shuffle mask "yyzx". - Float32x4: static const int yyzy = 0x65 — Shuffle mask "yyzy". - Float32x4: static const int yyzz = 0xA5 — Shuffle mask "yyzz". - Float32x4: static const int yyzw = 0xE5 — Shuffle mask "yyzw". - Float32x4: static const int yywx = 0x35 — Shuffle mask "yywx". - Float32x4: static const int yywy = 0x75 — Shuffle mask "yywy". - Float32x4: static const int yywz = 0xB5 — Shuffle mask "yywz". - Float32x4: static const int yyww = 0xF5 — Shuffle mask "yyww". - Float32x4: static const int yzxx = 0x09 — Shuffle mask "yzxx". - Float32x4: static const int yzxy = 0x49 — Shuffle mask "yzxy". - Float32x4: static const int yzxz = 0x89 — Shuffle mask "yzxz". - Float32x4: static const int yzxw = 0xC9 — Shuffle mask "yzxw". - Float32x4: static const int yzyx = 0x19 — Shuffle mask "yzyx". - Float32x4: static const int yzyy = 0x59 — Shuffle mask "yzyy". - Float32x4: static const int yzyz = 0x99 — Shuffle mask "yzyz". - Float32x4: static const int yzyw = 0xD9 — Shuffle mask "yzyw". - Float32x4: static const int yzzx = 0x29 — Shuffle mask "yzzx". - Float32x4: static const int yzzy = 0x69 — Shuffle mask "yzzy". - Float32x4: static const int yzzz = 0xA9 — Shuffle mask "yzzz". - Float32x4: static const int yzzw = 0xE9 — Shuffle mask "yzzw". - Float32x4: static const int yzwx = 0x39 — Shuffle mask "yzwx". - Float32x4: static const int yzwy = 0x79 — Shuffle mask "yzwy". - Float32x4: static const int yzwz = 0xB9 — Shuffle mask "yzwz". - Float32x4: static const int yzww = 0xF9 — Shuffle mask "yzww". - Float32x4: static const int ywxx = 0x0D — Shuffle mask "ywxx". - Float32x4: static const int ywxy = 0x4D — Shuffle mask "ywxy". - Float32x4: static const int ywxz = 0x8D — Shuffle mask "ywxz". - Float32x4: static const int ywxw = 0xCD — Shuffle mask "ywxw". - Float32x4: static const int ywyx = 0x1D — Shuffle mask "ywyx". - Float32x4: static const int ywyy = 0x5D — Shuffle mask "ywyy". - Float32x4: static const int ywyz = 0x9D — Shuffle mask "ywyz". - Float32x4: static const int ywyw = 0xDD — Shuffle mask "ywyw". - Float32x4: static const int ywzx = 0x2D — Shuffle mask "ywzx". - Float32x4: static const int ywzy = 0x6D — Shuffle mask "ywzy". - Float32x4: static const int ywzz = 0xAD — Shuffle mask "ywzz". - Float32x4: static const int ywzw = 0xED — Shuffle mask "ywzw". - Float32x4: static const int ywwx = 0x3D — Shuffle mask "ywwx". - Float32x4: static const int ywwy = 0x7D — Shuffle mask "ywwy". - Float32x4: static const int ywwz = 0xBD — Shuffle mask "ywwz". - Float32x4: static const int ywww = 0xFD — Shuffle mask "ywww". - Float32x4: static const int zxxx = 0x02 — Shuffle mask "zxxx". - Float32x4: static const int zxxy = 0x42 — Shuffle mask "zxxy". - Float32x4: static const int zxxz = 0x82 — Shuffle mask "zxxz". - Float32x4: static const int zxxw = 0xC2 — Shuffle mask "zxxw". - Float32x4: static const int zxyx = 0x12 — Shuffle mask "zxyx". - Float32x4: static const int zxyy = 0x52 — Shuffle mask "zxyy". - Float32x4: static const int zxyz = 0x92 — Shuffle mask "zxyz". - Float32x4: static const int zxyw = 0xD2 — Shuffle mask "zxyw". - Float32x4: static const int zxzx = 0x22 — Shuffle mask "zxzx". - Float32x4: static const int zxzy = 0x62 — Shuffle mask "zxzy". - Float32x4: static const int zxzz = 0xA2 — Shuffle mask "zxzz". - Float32x4: static const int zxzw = 0xE2 — Shuffle mask "zxzw". - Float32x4: static const int zxwx = 0x32 — Shuffle mask "zxwx". - Float32x4: static const int zxwy = 0x72 — Shuffle mask "zxwy". - Float32x4: static const int zxwz = 0xB2 — Shuffle mask "zxwz". - Float32x4: static const int zxww = 0xF2 — Shuffle mask "zxww". - Float32x4: static const int zyxx = 0x06 — Shuffle mask "zyxx". - Float32x4: static const int zyxy = 0x46 — Shuffle mask "zyxy". - Float32x4: static const int zyxz = 0x86 — Shuffle mask "zyxz". - Float32x4: static const int zyxw = 0xC6 — Shuffle mask "zyxw". - Float32x4: static const int zyyx = 0x16 — Shuffle mask "zyyx". - Float32x4: static const int zyyy = 0x56 — Shuffle mask "zyyy". - Float32x4: static const int zyyz = 0x96 — Shuffle mask "zyyz". - Float32x4: static const int zyyw = 0xD6 — Shuffle mask "zyyw". - Float32x4: static const int zyzx = 0x26 — Shuffle mask "zyzx". - Float32x4: static const int zyzy = 0x66 — Shuffle mask "zyzy". - Float32x4: static const int zyzz = 0xA6 — Shuffle mask "zyzz". - Float32x4: static const int zyzw = 0xE6 — Shuffle mask "zyzw". - Float32x4: static const int zywx = 0x36 — Shuffle mask "zywx". - Float32x4: static const int zywy = 0x76 — Shuffle mask "zywy". - Float32x4: static const int zywz = 0xB6 — Shuffle mask "zywz". - Float32x4: static const int zyww = 0xF6 — Shuffle mask "zyww". - Float32x4: static const int zzxx = 0x0A — Shuffle mask "zzxx". - Float32x4: static const int zzxy = 0x4A — Shuffle mask "zzxy". - Float32x4: static const int zzxz = 0x8A — Shuffle mask "zzxz". - Float32x4: static const int zzxw = 0xCA — Shuffle mask "zzxw". - Float32x4: static const int zzyx = 0x1A — Shuffle mask "zzyx". - Float32x4: static const int zzyy = 0x5A — Shuffle mask "zzyy". - Float32x4: static const int zzyz = 0x9A — Shuffle mask "zzyz". - Float32x4: static const int zzyw = 0xDA — Shuffle mask "zzyw". - Float32x4: static const int zzzx = 0x2A — Shuffle mask "zzzx". - Float32x4: static const int zzzy = 0x6A — Shuffle mask "zzzy". - Float32x4: static const int zzzz = 0xAA — Shuffle mask "zzzz". - Float32x4: static const int zzzw = 0xEA — Shuffle mask "zzzw". - Float32x4: static const int zzwx = 0x3A — Shuffle mask "zzwx". - Float32x4: static const int zzwy = 0x7A — Shuffle mask "zzwy". - Float32x4: static const int zzwz = 0xBA — Shuffle mask "zzwz". - Float32x4: static const int zzww = 0xFA — Shuffle mask "zzww". - Float32x4: static const int zwxx = 0x0E — Shuffle mask "zwxx". - Float32x4: static const int zwxy = 0x4E — Shuffle mask "zwxy". - Float32x4: static const int zwxz = 0x8E — Shuffle mask "zwxz". - Float32x4: static const int zwxw = 0xCE — Shuffle mask "zwxw". - Float32x4: static const int zwyx = 0x1E — Shuffle mask "zwyx". - Float32x4: static const int zwyy = 0x5E — Shuffle mask "zwyy". - Float32x4: static const int zwyz = 0x9E — Shuffle mask "zwyz". - Float32x4: static const int zwyw = 0xDE — Shuffle mask "zwyw". - Float32x4: static const int zwzx = 0x2E — Shuffle mask "zwzx". - Float32x4: static const int zwzy = 0x6E — Shuffle mask "zwzy". - Float32x4: static const int zwzz = 0xAE — Shuffle mask "zwzz". - Float32x4: static const int zwzw = 0xEE — Shuffle mask "zwzw". - Float32x4: static const int zwwx = 0x3E — Shuffle mask "zwwx". - Float32x4: static const int zwwy = 0x7E — Shuffle mask "zwwy". - Float32x4: static const int zwwz = 0xBE — Shuffle mask "zwwz". - Float32x4: static const int zwww = 0xFE — Shuffle mask "zwww". - Float32x4: static const int wxxx = 0x03 — Shuffle mask "wxxx". - Float32x4: static const int wxxy = 0x43 — Shuffle mask "wxxy". - Float32x4: static const int wxxz = 0x83 — Shuffle mask "wxxz". - Float32x4: static const int wxxw = 0xC3 — Shuffle mask "wxxw". - Float32x4: static const int wxyx = 0x13 — Shuffle mask "wxyx". - Float32x4: static const int wxyy = 0x53 — Shuffle mask "wxyy". - Float32x4: static const int wxyz = 0x93 — Shuffle mask "wxyz". - Float32x4: static const int wxyw = 0xD3 — Shuffle mask "wxyw". - Float32x4: static const int wxzx = 0x23 — Shuffle mask "wxzx". - Float32x4: static const int wxzy = 0x63 — Shuffle mask "wxzy". - Float32x4: static const int wxzz = 0xA3 — Shuffle mask "wxzz". - Float32x4: static const int wxzw = 0xE3 — Shuffle mask "wxzw". - Float32x4: static const int wxwx = 0x33 — Shuffle mask "wxwx". - Float32x4: static const int wxwy = 0x73 — Shuffle mask "wxwy". - Float32x4: static const int wxwz = 0xB3 — Shuffle mask "wxwz". - Float32x4: static const int wxww = 0xF3 — Shuffle mask "wxww". - Float32x4: static const int wyxx = 0x07 — Shuffle mask "wyxx". - Float32x4: static const int wyxy = 0x47 — Shuffle mask "wyxy". - Float32x4: static const int wyxz = 0x87 — Shuffle mask "wyxz". - Float32x4: static const int wyxw = 0xC7 — Shuffle mask "wyxw". - Float32x4: static const int wyyx = 0x17 — Shuffle mask "wyyx". - Float32x4: static const int wyyy = 0x57 — Shuffle mask "wyyy". - Float32x4: static const int wyyz = 0x97 — Shuffle mask "wyyz". - Float32x4: static const int wyyw = 0xD7 — Shuffle mask "wyyw". - Float32x4: static const int wyzx = 0x27 — Shuffle mask "wyzx". - Float32x4: static const int wyzy = 0x67 — Shuffle mask "wyzy". - Float32x4: static const int wyzz = 0xA7 — Shuffle mask "wyzz". - Float32x4: static const int wyzw = 0xE7 — Shuffle mask "wyzw". - Float32x4: static const int wywx = 0x37 — Shuffle mask "wywx". - Float32x4: static const int wywy = 0x77 — Shuffle mask "wywy". - Float32x4: static const int wywz = 0xB7 — Shuffle mask "wywz". - Float32x4: static const int wyww = 0xF7 — Shuffle mask "wyww". - Float32x4: static const int wzxx = 0x0B — Shuffle mask "wzxx". - Float32x4: static const int wzxy = 0x4B — Shuffle mask "wzxy". - Float32x4: static const int wzxz = 0x8B — Shuffle mask "wzxz". - Float32x4: static const int wzxw = 0xCB — Shuffle mask "wzxw". - Float32x4: static const int wzyx = 0x1B — Shuffle mask "wzyx". - Float32x4: static const int wzyy = 0x5B — Shuffle mask "wzyy". - Float32x4: static const int wzyz = 0x9B — Shuffle mask "wzyz". - Float32x4: static const int wzyw = 0xDB — Shuffle mask "wzyw". - Float32x4: static const int wzzx = 0x2B — Shuffle mask "wzzx". - Float32x4: static const int wzzy = 0x6B — Shuffle mask "wzzy". - Float32x4: static const int wzzz = 0xAB — Shuffle mask "wzzz". - Float32x4: static const int wzzw = 0xEB — Shuffle mask "wzzw". - Float32x4: static const int wzwx = 0x3B — Shuffle mask "wzwx". - Float32x4: static const int wzwy = 0x7B — Shuffle mask "wzwy". - Float32x4: static const int wzwz = 0xBB — Shuffle mask "wzwz". - Float32x4: static const int wzww = 0xFB — Shuffle mask "wzww". - Float32x4: static const int wwxx = 0x0F — Shuffle mask "wwxx". - Float32x4: static const int wwxy = 0x4F — Shuffle mask "wwxy". - Float32x4: static const int wwxz = 0x8F — Shuffle mask "wwxz". - Float32x4: static const int wwxw = 0xCF — Shuffle mask "wwxw". - Float32x4: static const int wwyx = 0x1F — Shuffle mask "wwyx". - Float32x4: static const int wwyy = 0x5F — Shuffle mask "wwyy". - Float32x4: static const int wwyz = 0x9F — Shuffle mask "wwyz". - Float32x4: static const int wwyw = 0xDF — Shuffle mask "wwyw". - Float32x4: static const int wwzx = 0x2F — Shuffle mask "wwzx". - Float32x4: static const int wwzy = 0x6F — Shuffle mask "wwzy". - Float32x4: static const int wwzz = 0xAF — Shuffle mask "wwzz". - Float32x4: static const int wwzw = 0xEF — Shuffle mask "wwzw". - Float32x4: static const int wwwx = 0x3F — Shuffle mask "wwwx". - Float32x4: static const int wwwy = 0x7F — Shuffle mask "wwwy". - Float32x4: static const int wwwz = 0xBF — Shuffle mask "wwwz". - Float32x4: static const int wwww = 0xFF — Shuffle mask "wwww". - Float32x4: double get x — The value of the "x" lane. - Float32x4: double get y — The value of the "y" lane. - Float32x4: double get z — The value of the "z" lane. - Float32x4: double get w — The value of the "w" lane. - Float32x4: int get signMask — The sign bits of each lane as single bits. - Float32x4: Int32x4 lessThan(Float32x4 other) — Lane-wise less-than comparison. - Float32x4: Int32x4 lessThanOrEqual(Float32x4 other) — Lane-wise less-than-or-equal comparison. - Float32x4: Int32x4 greaterThan(Float32x4 other) — Lane-wise greater-than comparison. - Float32x4: Int32x4 greaterThanOrEqual(Float32x4 other) — Lane-wise greater-than-or-equal comparison. - Float32x4: Int32x4 equal(Float32x4 other) — Lane-wise equals comparison. - Float32x4: Int32x4 notEqual(Float32x4 other) — Lane-wise not-equals comparison. - Float32x4: Float32x4 scale(double scale) — Lane-wise multiplication by scale. - Float32x4: Float32x4 abs() — Lane-wise conversion to absolute value. - Float32x4: Float32x4 clamp(Float32x4 lowerLimit, Float32x4 upperLimit) — Lane-wise clamp to a range. - Float32x4: Float32x4 shuffle(int mask) — Shuffle the lane values based on the mask. - Float32x4: Float32x4 shuffleMix(Float32x4 other, int mask) — Mixes lanes chosen from two Float32x4 values using a mask. - Float32x4: Float32x4 withX(double x) — This value, but with the value of the Float32x4.x lane set to x. - Float32x4: Float32x4 withY(double y) — This value, but with the value of the Float32x4.y lane set to y. - Float32x4: Float32x4 withZ(double z) — This value, but with the value of the Float32x4.z lane set to z. - Float32x4: Float32x4 withW(double w) — This value, but with the value of the Float32x4.w lane set to w. - Float32x4: Float32x4 min(Float32x4 other) — Lane-wise minimum. - Float32x4: Float32x4 max(Float32x4 other) — Lane-wise maximum. - Float32x4: Float32x4 sqrt() — Lane-wise square root. - Float32x4: Float32x4 reciprocal() — Lane-wise reciprocal. - Float32x4: Float32x4 reciprocalSqrt() — Lane-wise approximation of reciprocal square root. - Float32x4: Float32x4 operator +(Float32x4 other) — Lane-wise addition. - Float32x4: Float32x4 operator -() — Lane-wise negation. - Float32x4: Float32x4 operator -(Float32x4 other) — Lane-wise subtraction. - Float32x4: Float32x4 operator *(Float32x4 other) — Lane-wise multiplication. - Float32x4: Float32x4 operator /(Float32x4 other) — Lane-wise division. - abstract final class Int32x4 — Int32x4 and operations. - Int32x4: external factory Int32x4(int x, int y, int z, int w) - Int32x4: external factory Int32x4.bool(bool x, bool y, bool z, bool w) - Int32x4: external factory Int32x4.fromFloat32x4Bits(Float32x4 x) - Int32x4: static const int xxxx = 0x00 — Mask passed to shuffle or shuffleMix. - Int32x4: static const int xxxy = 0x40 - Int32x4: static const int xxxz = 0x80 - Int32x4: static const int xxxw = 0xC0 - Int32x4: static const int xxyx = 0x10 - Int32x4: static const int xxyy = 0x50 - Int32x4: static const int xxyz = 0x90 - Int32x4: static const int xxyw = 0xD0 - Int32x4: static const int xxzx = 0x20 - Int32x4: static const int xxzy = 0x60 - Int32x4: static const int xxzz = 0xA0 - Int32x4: static const int xxzw = 0xE0 - Int32x4: static const int xxwx = 0x30 - Int32x4: static const int xxwy = 0x70 - Int32x4: static const int xxwz = 0xB0 - Int32x4: static const int xxww = 0xF0 - Int32x4: static const int xyxx = 0x04 - Int32x4: static const int xyxy = 0x44 - Int32x4: static const int xyxz = 0x84 - Int32x4: static const int xyxw = 0xC4 - Int32x4: static const int xyyx = 0x14 - Int32x4: static const int xyyy = 0x54 - Int32x4: static const int xyyz = 0x94 - Int32x4: static const int xyyw = 0xD4 - Int32x4: static const int xyzx = 0x24 - Int32x4: static const int xyzy = 0x64 - Int32x4: static const int xyzz = 0xA4 - Int32x4: static const int xyzw = 0xE4 - Int32x4: static const int xywx = 0x34 - Int32x4: static const int xywy = 0x74 - Int32x4: static const int xywz = 0xB4 - Int32x4: static const int xyww = 0xF4 - Int32x4: static const int xzxx = 0x08 - Int32x4: static const int xzxy = 0x48 - Int32x4: static const int xzxz = 0x88 - Int32x4: static const int xzxw = 0xC8 - Int32x4: static const int xzyx = 0x18 - Int32x4: static const int xzyy = 0x58 - Int32x4: static const int xzyz = 0x98 - Int32x4: static const int xzyw = 0xD8 - Int32x4: static const int xzzx = 0x28 - Int32x4: static const int xzzy = 0x68 - Int32x4: static const int xzzz = 0xA8 - Int32x4: static const int xzzw = 0xE8 - Int32x4: static const int xzwx = 0x38 - Int32x4: static const int xzwy = 0x78 - Int32x4: static const int xzwz = 0xB8 - Int32x4: static const int xzww = 0xF8 - Int32x4: static const int xwxx = 0x0C - Int32x4: static const int xwxy = 0x4C - Int32x4: static const int xwxz = 0x8C - Int32x4: static const int xwxw = 0xCC - Int32x4: static const int xwyx = 0x1C - Int32x4: static const int xwyy = 0x5C - Int32x4: static const int xwyz = 0x9C - Int32x4: static const int xwyw = 0xDC - Int32x4: static const int xwzx = 0x2C - Int32x4: static const int xwzy = 0x6C - Int32x4: static const int xwzz = 0xAC - Int32x4: static const int xwzw = 0xEC - Int32x4: static const int xwwx = 0x3C - Int32x4: static const int xwwy = 0x7C - Int32x4: static const int xwwz = 0xBC - Int32x4: static const int xwww = 0xFC - Int32x4: static const int yxxx = 0x01 - Int32x4: static const int yxxy = 0x41 - Int32x4: static const int yxxz = 0x81 - Int32x4: static const int yxxw = 0xC1 - Int32x4: static const int yxyx = 0x11 - Int32x4: static const int yxyy = 0x51 - Int32x4: static const int yxyz = 0x91 - Int32x4: static const int yxyw = 0xD1 - Int32x4: static const int yxzx = 0x21 - Int32x4: static const int yxzy = 0x61 - Int32x4: static const int yxzz = 0xA1 - Int32x4: static const int yxzw = 0xE1 - Int32x4: static const int yxwx = 0x31 - Int32x4: static const int yxwy = 0x71 - Int32x4: static const int yxwz = 0xB1 - Int32x4: static const int yxww = 0xF1 - Int32x4: static const int yyxx = 0x05 - Int32x4: static const int yyxy = 0x45 - Int32x4: static const int yyxz = 0x85 - Int32x4: static const int yyxw = 0xC5 - Int32x4: static const int yyyx = 0x15 - Int32x4: static const int yyyy = 0x55 - Int32x4: static const int yyyz = 0x95 - Int32x4: static const int yyyw = 0xD5 - Int32x4: static const int yyzx = 0x25 - Int32x4: static const int yyzy = 0x65 - Int32x4: static const int yyzz = 0xA5 - Int32x4: static const int yyzw = 0xE5 - Int32x4: static const int yywx = 0x35 - Int32x4: static const int yywy = 0x75 - Int32x4: static const int yywz = 0xB5 - Int32x4: static const int yyww = 0xF5 - Int32x4: static const int yzxx = 0x09 - Int32x4: static const int yzxy = 0x49 - Int32x4: static const int yzxz = 0x89 - Int32x4: static const int yzxw = 0xC9 - Int32x4: static const int yzyx = 0x19 - Int32x4: static const int yzyy = 0x59 - Int32x4: static const int yzyz = 0x99 - Int32x4: static const int yzyw = 0xD9 - Int32x4: static const int yzzx = 0x29 - Int32x4: static const int yzzy = 0x69 - Int32x4: static const int yzzz = 0xA9 - Int32x4: static const int yzzw = 0xE9 - Int32x4: static const int yzwx = 0x39 - Int32x4: static const int yzwy = 0x79 - Int32x4: static const int yzwz = 0xB9 - Int32x4: static const int yzww = 0xF9 - Int32x4: static const int ywxx = 0x0D - Int32x4: static const int ywxy = 0x4D - Int32x4: static const int ywxz = 0x8D - Int32x4: static const int ywxw = 0xCD - Int32x4: static const int ywyx = 0x1D - Int32x4: static const int ywyy = 0x5D - Int32x4: static const int ywyz = 0x9D - Int32x4: static const int ywyw = 0xDD - Int32x4: static const int ywzx = 0x2D - Int32x4: static const int ywzy = 0x6D - Int32x4: static const int ywzz = 0xAD - Int32x4: static const int ywzw = 0xED - Int32x4: static const int ywwx = 0x3D - Int32x4: static const int ywwy = 0x7D - Int32x4: static const int ywwz = 0xBD - Int32x4: static const int ywww = 0xFD - Int32x4: static const int zxxx = 0x02 - Int32x4: static const int zxxy = 0x42 - Int32x4: static const int zxxz = 0x82 - Int32x4: static const int zxxw = 0xC2 - Int32x4: static const int zxyx = 0x12 - Int32x4: static const int zxyy = 0x52 - Int32x4: static const int zxyz = 0x92 - Int32x4: static const int zxyw = 0xD2 - Int32x4: static const int zxzx = 0x22 - Int32x4: static const int zxzy = 0x62 - Int32x4: static const int zxzz = 0xA2 - Int32x4: static const int zxzw = 0xE2 - Int32x4: static const int zxwx = 0x32 - Int32x4: static const int zxwy = 0x72 - Int32x4: static const int zxwz = 0xB2 - Int32x4: static const int zxww = 0xF2 - Int32x4: static const int zyxx = 0x06 - Int32x4: static const int zyxy = 0x46 - Int32x4: static const int zyxz = 0x86 - Int32x4: static const int zyxw = 0xC6 - Int32x4: static const int zyyx = 0x16 - Int32x4: static const int zyyy = 0x56 - Int32x4: static const int zyyz = 0x96 - Int32x4: static const int zyyw = 0xD6 - Int32x4: static const int zyzx = 0x26 - Int32x4: static const int zyzy = 0x66 - Int32x4: static const int zyzz = 0xA6 - Int32x4: static const int zyzw = 0xE6 - Int32x4: static const int zywx = 0x36 - Int32x4: static const int zywy = 0x76 - Int32x4: static const int zywz = 0xB6 - Int32x4: static const int zyww = 0xF6 - Int32x4: static const int zzxx = 0x0A - Int32x4: static const int zzxy = 0x4A - Int32x4: static const int zzxz = 0x8A - Int32x4: static const int zzxw = 0xCA - Int32x4: static const int zzyx = 0x1A - Int32x4: static const int zzyy = 0x5A - Int32x4: static const int zzyz = 0x9A - Int32x4: static const int zzyw = 0xDA - Int32x4: static const int zzzx = 0x2A - Int32x4: static const int zzzy = 0x6A - Int32x4: static const int zzzz = 0xAA - Int32x4: static const int zzzw = 0xEA - Int32x4: static const int zzwx = 0x3A - Int32x4: static const int zzwy = 0x7A - Int32x4: static const int zzwz = 0xBA - Int32x4: static const int zzww = 0xFA - Int32x4: static const int zwxx = 0x0E - Int32x4: static const int zwxy = 0x4E - Int32x4: static const int zwxz = 0x8E - Int32x4: static const int zwxw = 0xCE - Int32x4: static const int zwyx = 0x1E - Int32x4: static const int zwyy = 0x5E - Int32x4: static const int zwyz = 0x9E - Int32x4: static const int zwyw = 0xDE - Int32x4: static const int zwzx = 0x2E - Int32x4: static const int zwzy = 0x6E - Int32x4: static const int zwzz = 0xAE - Int32x4: static const int zwzw = 0xEE - Int32x4: static const int zwwx = 0x3E - Int32x4: static const int zwwy = 0x7E - Int32x4: static const int zwwz = 0xBE - Int32x4: static const int zwww = 0xFE - Int32x4: static const int wxxx = 0x03 - Int32x4: static const int wxxy = 0x43 - Int32x4: static const int wxxz = 0x83 - Int32x4: static const int wxxw = 0xC3 - Int32x4: static const int wxyx = 0x13 - Int32x4: static const int wxyy = 0x53 - Int32x4: static const int wxyz = 0x93 - Int32x4: static const int wxyw = 0xD3 - Int32x4: static const int wxzx = 0x23 - Int32x4: static const int wxzy = 0x63 - Int32x4: static const int wxzz = 0xA3 - Int32x4: static const int wxzw = 0xE3 - Int32x4: static const int wxwx = 0x33 - Int32x4: static const int wxwy = 0x73 - Int32x4: static const int wxwz = 0xB3 - Int32x4: static const int wxww = 0xF3 - Int32x4: static const int wyxx = 0x07 - Int32x4: static const int wyxy = 0x47 - Int32x4: static const int wyxz = 0x87 - Int32x4: static const int wyxw = 0xC7 - Int32x4: static const int wyyx = 0x17 - Int32x4: static const int wyyy = 0x57 - Int32x4: static const int wyyz = 0x97 - Int32x4: static const int wyyw = 0xD7 - Int32x4: static const int wyzx = 0x27 - Int32x4: static const int wyzy = 0x67 - Int32x4: static const int wyzz = 0xA7 - Int32x4: static const int wyzw = 0xE7 - Int32x4: static const int wywx = 0x37 - Int32x4: static const int wywy = 0x77 - Int32x4: static const int wywz = 0xB7 - Int32x4: static const int wyww = 0xF7 - Int32x4: static const int wzxx = 0x0B - Int32x4: static const int wzxy = 0x4B - Int32x4: static const int wzxz = 0x8B - Int32x4: static const int wzxw = 0xCB - Int32x4: static const int wzyx = 0x1B - Int32x4: static const int wzyy = 0x5B - Int32x4: static const int wzyz = 0x9B - Int32x4: static const int wzyw = 0xDB - Int32x4: static const int wzzx = 0x2B - Int32x4: static const int wzzy = 0x6B - Int32x4: static const int wzzz = 0xAB - Int32x4: static const int wzzw = 0xEB - Int32x4: static const int wzwx = 0x3B - Int32x4: static const int wzwy = 0x7B - Int32x4: static const int wzwz = 0xBB - Int32x4: static const int wzww = 0xFB - Int32x4: static const int wwxx = 0x0F - Int32x4: static const int wwxy = 0x4F - Int32x4: static const int wwxz = 0x8F - Int32x4: static const int wwxw = 0xCF - Int32x4: static const int wwyx = 0x1F - Int32x4: static const int wwyy = 0x5F - Int32x4: static const int wwyz = 0x9F - Int32x4: static const int wwyw = 0xDF - Int32x4: static const int wwzx = 0x2F - Int32x4: static const int wwzy = 0x6F - Int32x4: static const int wwzz = 0xAF - Int32x4: static const int wwzw = 0xEF - Int32x4: static const int wwwx = 0x3F - Int32x4: static const int wwwy = 0x7F - Int32x4: static const int wwwz = 0xBF - Int32x4: static const int wwww = 0xFF - Int32x4: int get x — Extract 32-bit mask from x lane. - Int32x4: int get y — Extract 32-bit mask from y lane. - Int32x4: int get z — Extract 32-bit mask from z lane. - Int32x4: int get w — Extract 32-bit mask from w lane. - Int32x4: int get signMask — Extract the top bit from each lane return them in the first 4 bits. - Int32x4: bool get flagX — Extracted x value. - Int32x4: bool get flagY — Extracted y value. - Int32x4: bool get flagZ — Extracted z value. - Int32x4: bool get flagW — Extracted w value. - Int32x4: Int32x4 shuffle(int mask) — Shuffle the lane values. mask must be one of the 256 shuffle constants. - Int32x4: Int32x4 shuffleMix(Int32x4 other, int mask) — Shuffle the lane values in this Int32x4 and other. - Int32x4: Int32x4 withX(int x) — Returns a new Int32x4 copied from this Int32x4 with a new x value. - Int32x4: Int32x4 withY(int y) — Returns a new Int32x4 copied from this Int32x4 with a new y value. - Int32x4: Int32x4 withZ(int z) — Returns a new Int32x4 copied from this Int32x4 with a new z value. - Int32x4: Int32x4 withW(int w) — Returns a new Int32x4 copied from this Int32x4 with a new w value. - Int32x4: Int32x4 withFlagX(bool x) — Returns a new Int32x4 copied from this Int32x4 with a new x value. - Int32x4: Int32x4 withFlagY(bool y) — Returns a new Int32x4 copied from this Int32x4 with a new y value. - Int32x4: Int32x4 withFlagZ(bool z) — Returns a new Int32x4 copied from this Int32x4 with a new z value. - Int32x4: Int32x4 withFlagW(bool w) — Returns a new Int32x4 copied from this Int32x4 with a new w value. - Int32x4: Float32x4 select(Float32x4 trueValue, Float32x4 falseValue) — Merge trueValue and falseValue based on this Int32x4 bit mask: Select bit from trueValue when bit in this Int32x4 is on. - Int32x4: Int32x4 operator |(Int32x4 other) — The bit-wise or operator. - Int32x4: Int32x4 operator &(Int32x4 other) — The bit-wise and operator. - Int32x4: Int32x4 operator ^(Int32x4 other) — The bit-wise xor operator. - Int32x4: Int32x4 operator +(Int32x4 other) — Addition operator. - Int32x4: Int32x4 operator -(Int32x4 other) — Subtraction operator. - abstract final class Float64x2 — Float64x2 immutable value type and operations. - Float64x2: external factory Float64x2(double x, double y) - Float64x2: external factory Float64x2.splat(double v) - Float64x2: external factory Float64x2.zero() - Float64x2: external factory Float64x2.fromFloat32x4(Float32x4 v) — Uses the "x" and "y" lanes from v. - Float64x2: double get x — Extracted x value. - Float64x2: double get y — Extracted y value. - Float64x2: int get signMask — Extract the sign bits from each lane return them in the first 2 bits. - Float64x2: Float64x2 scale(double s) — Returns a copy of this Float64x2 each lane being scaled by s. - Float64x2: Float64x2 abs() — The lane-wise absolute value of this Float64x2. - Float64x2: Float64x2 clamp(Float64x2 lowerLimit, Float64x2 upperLimit) — Lane-wise clamp this Float64x2 to be in the range lowerLimit-upperLimit. - Float64x2: Float64x2 withX(double x) — Returns a new Float64x2 copied from this Float64x2 with a new x value. - Float64x2: Float64x2 withY(double y) — Returns a new Float64x2 copied from this Float64x2 with a new y value. - Float64x2: Float64x2 min(Float64x2 other) — The lane-wise minimum value in this Float64x2 or other. - Float64x2: Float64x2 max(Float64x2 other) — The lane-wise maximum value in this Float64x2 or other. - Float64x2: Float64x2 sqrt() — The lane-wise square root of this Float64x2. - Float64x2: Float64x2 operator +(Float64x2 other) — Addition operator. - Float64x2: Float64x2 operator -() — Negate operator. - Float64x2: Float64x2 operator -(Float64x2 other) — Subtraction operator. - Float64x2: Float64x2 operator *(Float64x2 other) — Multiplication operator. - Float64x2: Float64x2 operator /(Float64x2 other) — Division operator. - abstract interface class BytesBuilder — Builds a list of bytes, allowing bytes and lists of bytes to be added at the end. - BytesBuilder: factory BytesBuilder({bool copy = true}) — Construct a new empty BytesBuilder. - BytesBuilder: int get length — The number of bytes in this builder. - BytesBuilder: bool get isEmpty — Whether the buffer is empty. - BytesBuilder: bool get isNotEmpty — Whether the buffer is non-empty. - BytesBuilder: void add(List bytes) — Appends bytes to the current contents of this builder. - BytesBuilder: void addByte(int byte) — Appends byte to the current contents of this builder. - BytesBuilder: Uint8List takeBytes() — Returns the bytes currently contained in this builder and clears it. - BytesBuilder: Uint8List toBytes() — Returns a copy of the current byte contents of this builder. - BytesBuilder: void clear() — Clears the contents of this builder. ### Isolates (raya:isolate) import 'raya:isolate'; Real parallel threads: Isolate.run, ports and capabilities. https://riptidecompute.com/raya/docs/core-isolate - class IsolateSpawnException implements Exception — Thrown when an isolate cannot be created. - IsolateSpawnException: IsolateSpawnException(this.message) - IsolateSpawnException: final String message — Error message reported by the spawn operation. - IsolateSpawnException: String toString() - final class Isolate — An isolated Raya execution context. - Isolate: Isolate(this.controlPort, {this.pauseCapability, this.terminateCapability}) — Creates a new Isolate object with a restricted set of capabilities. - Isolate: static const int immediate = 0 — Argument to ping and kill: Ask for immediate action. - Isolate: static const int beforeNextEvent = 1 — Argument to ping and kill: Ask for action before the next event. - Isolate: static Future run(FutureOr computation(), {String? debugName}) — Runs computation in a new isolate and returns the result. - Isolate: external static Isolate get current — An Isolate object representing the current isolate. - Isolate: external static Future get packageConfig — The location of the package configuration file of the current isolate. - Isolate: external static Uri? get packageConfigSync — The location of the package configuration file of the current isolate. - Isolate: external static Future resolvePackageUri(Uri packageUri) — Resolves a package: URI to its actual location. - Isolate: external static Uri? resolvePackageUriSync(Uri packageUri) — Resolves a package: URI to its actual location. - Isolate: external static Future spawn(void entryPoint(T message), T message, {bool paused = false, bool errorsAreFatal = true, SendPort? onExit, SendPort? onError, String? debugName}) — Spawns an isolate that shares the same code as the current isolate. - Isolate: external static Future spawnUri(Uri uri, List args, message, {bool paused = false, SendPort? onExit, SendPort? onError, bool errorsAreFatal = true, bool? checked, Map? environment, @Deprecated('The packages/ dir is not supported in Raya') Uri? packageRoot, Uri? packageConfig, bool automaticPackageResolution = false, String? debugName}) — Spawns an isolate running the script file specified by uri. - Isolate: external static Never exit([SendPort? finalMessagePort, Object? message]) — Terminates the current isolate synchronously. - Isolate: external static Isolate create({String? debugName}) — Create a new isolate in the current isolate group. - Isolate: external static bool pinToCurrentThread() — Pin current isolate to the current OS thread. - Isolate: final SendPort controlPort — Control port used to send control messages to the isolate. - Isolate: final Capability? pauseCapability — Capability granting the ability to pause the isolate. - Isolate: final Capability? terminateCapability — Capability granting the ability to terminate the isolate. - Isolate: external String? get debugName — The name of the Isolate displayed for debug purposes. - Isolate: Stream get errors — Returns a broadcast stream of uncaught errors from the isolate. - Isolate: external bool get isPinnedToCurrentThread — Whether the isolate is pinned to the current OS thread. - Isolate: external void set onEvent(void Function(Isolate) callback) — Event notify callback for the isolate. - Isolate: Capability pause([Capability? resumeCapability]) — Requests the isolate to pause. - Isolate: external void resume(Capability resumeCapability) — Resumes a paused isolate. - Isolate: external void addOnExitListener(SendPort responsePort, {Object? response}) — Requests an exit message on responsePort when the isolate terminates. - Isolate: external void removeOnExitListener(SendPort responsePort) — Stops listening for exit messages from the isolate. - Isolate: external void setErrorsFatal(bool errorsAreFatal) — Sets whether uncaught errors will terminate the isolate. - Isolate: external void kill({int priority = beforeNextEvent}) — Requests the isolate to shut down. - Isolate: external void ping(SendPort responsePort, {Object? response, int priority = immediate}) — Requests that the isolate send response on the responsePort. - Isolate: external void addErrorListener(SendPort port) — Requests that uncaught errors of the isolate are sent back to port. - Isolate: external void removeErrorListener(SendPort port) — Stops listening for uncaught errors from the isolate. - Isolate: external R runSync(R Function() f) — Execute the given function in the context of the given isolate. - Isolate: external void shutdownSync() — Shut down target isolate. - Isolate: external void runEventLoopSync() — Run event loop for the target isolate synchronously on the current thread. - Isolate: external void handleEvent() — Handle at most one pending event for the isolate. - abstract interface class SendPort implements Capability — Sends messages to its ReceivePorts. - SendPort: int get hashCode — A hash code for this send port that is consistent with the == operator. - SendPort: void send(Object? message) — Sends an asynchronous message through this send port, to its corresponding ReceivePort. - SendPort: bool operator ==(other) — Tests whether other is a SendPort pointing to the same ReceivePort as this one. - abstract interface class ReceivePort implements Stream — Together with SendPort, the only means of communication between isolates. - ReceivePort: external factory ReceivePort([String debugName = '']) — Opens a long-lived port for receiving messages. - ReceivePort: external factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) — Creates a ReceivePort from a RawReceivePort. - ReceivePort: SendPort get sendPort — A SendPort which sends messages to this receive port. - ReceivePort: StreamSubscription listen(void onData(message)?, {Function? onError, void onDone()?, bool? cancelOnError}) — Listen for events from Stream. - ReceivePort: void close() — Closes the receive port. - abstract interface class RawReceivePort — A low-level asynchronous message receiver. - RawReceivePort: external factory RawReceivePort([Function? handler, String debugName = '']) — Opens a long-lived port for receiving messages. - RawReceivePort: void set handler(Function? newHandler) — Sets the handler that is invoked for every incoming message. - RawReceivePort: SendPort get sendPort — Returns a SendPort that sends messages to this raw receive port. - RawReceivePort: abstract bool keepIsolateAlive — Whether this RawReceivePort keeps its Isolate alive. - RawReceivePort: void close() — Closes the port. - final class RemoteError implements Error — Description of an error from another isolate. - RemoteError: RemoteError(String description, String stackDescription) - RemoteError: final StackTrace stackTrace - RemoteError: String toString() - abstract final class TransferableTypedData — An efficiently transferable sequence of byte values. - TransferableTypedData: external factory TransferableTypedData.fromList(List list) — Creates a new TransferableTypedData containing the bytes of list. - TransferableTypedData: ByteBuffer materialize() — Creates a new ByteBuffer containing the bytes stored in this TransferableTypedData. - abstract interface class Capability — An unforgeable object that comes back as equal when passed through other isolates. - Capability: external factory Capability() — Create a new unforgeable capability object. ### Mutexes and condition variables (raya:concurrent) import 'raya:concurrent'; Synchronisation for memory shared between isolates. https://riptidecompute.com/raya/docs/core-concurrent - abstract interface class Mutex — A mutex synchronization primitive. - Mutex: factory Mutex() - Mutex: R runLocked(R Function() action) — Run the given synchronous action under a mutex. - abstract interface class ConditionVariable — A condition variable synchronization primitive. - ConditionVariable: factory ConditionVariable() - ConditionVariable: external void wait(Mutex mutex, [int timeout = 0]) — Block and wait until another thread calls notify. - ConditionVariable: external void notify() — Wake up at least one thread waiting on this condition variable. - ConditionVariable: external void notifyAll() — Wake up all threads waiting on this condition variable. ### Files, processes, sockets and HTTP (raya:io) import 'raya:io'; Files and directories, processes, standard input and output, sockets, an HTTP client and server, and WebSockets. https://riptidecompute.com/raya/docs/core-io - Never exit(int code) — Exit the Raya VM process immediately with the given exit code. - void sleep(Duration duration) — Sleep for the duration specified in duration. - StdioType stdioType(object) — Whether a stream is attached to a file, pipe, terminal, or something else. - const ZLibCodec zlib = ZLibCodec._default() — An instance of the default implementation of the ZLibCodec. - const GZipCodec gzip = GZipCodec._default() — An instance of the default implementation of the GZipCodec. - int get exitCode — Get the global exit code for the Raya VM. - int get pid — Returns the PID of the current process. - Stdin get stdin — The standard input stream of data read by this program. - Stdout get stdout — The standard output stream of data written by this program. - Stdout get stderr — The standard output stream of errors written by this program. - const SystemEncoding systemEncoding = const SystemEncoding() — The current system encoding. - typedef BadCertificateCallback = bool Function(X509Certificate cr, String host, int port) - abstract class IOException implements Exception — Base class for all IO related exceptions. - IOException: String toString() - class OSError implements Exception — An Exception holding information about an error from the operating system. - OSError: const OSError([this.message = "", this.errorCode = noErrorCode]) — Creates an OSError object from a message and an errorCode. - OSError: static const int noErrorCode = -1 — Constant used to indicate that no OS error code is available. - OSError: final String message — Error message supplied by the operating system. - OSError: final int errorCode — Error code supplied by the operating system. - OSError: String toString() — Converts an OSError object to a string representation. - abstract final class ZLibOption — Exposes ZLib options for input parameters. - ZLibOption: static const int minWindowBits = 8 — Minimal value for ZLibCodec.windowBits, ZLibEncoder.windowBits and ZLibDecoder.windowBits. - ZLibOption: static const int maxWindowBits = 15 — Maximal value for ZLibCodec.windowBits, ZLibEncoder.windowBits and ZLibDecoder.windowBits. - ZLibOption: static const int defaultWindowBits = 15 — Default value for ZLibCodec.windowBits, ZLibEncoder.windowBits and ZLibDecoder.windowBits. - ZLibOption: static const int minLevel = -1 — Minimal value for ZLibCodec.level and ZLibEncoder.level. - ZLibOption: static const int maxLevel = 9 — Maximal value for ZLibCodec.level and ZLibEncoder.level - ZLibOption: static const int defaultLevel = 6 — Default value for ZLibCodec.level and ZLibEncoder.level. - ZLibOption: static const int minMemLevel = 1 — Minimal value for ZLibCodec.memLevel and ZLibEncoder.memLevel. - ZLibOption: static const int maxMemLevel = 9 — Maximal value for ZLibCodec.memLevel and ZLibEncoder.memLevel. - ZLibOption: static const int defaultMemLevel = 8 — Default value for ZLibCodec.memLevel and ZLibEncoder.memLevel. - ZLibOption: static const int strategyFiltered = 1 — Recommended strategy for data produced by a filter (or predictor) - ZLibOption: static const int strategyHuffmanOnly = 2 — Use this strategy to force Huffman encoding only (no string match) - ZLibOption: static const int strategyRle = 3 — Use this strategy to limit match distances to one (run-length encoding) - ZLibOption: static const int strategyFixed = 4 — This strategy prevents the use of dynamic Huffman codes, allowing for a simpler decoder - ZLibOption: static const int strategyDefault = 0 — Recommended strategy for normal data - final class ZLibCodec extends Codec, List> — The ZLibCodec encodes raw bytes to ZLib compressed bytes and decodes ZLib compressed bytes to raw bytes. - ZLibCodec: ZLibCodec({this.level = ZLibOption.defaultLevel, this.windowBits = ZLibOption.defaultWindowBits, this.memLevel = ZLibOption.defaultMemLevel, this.strategy = ZLibOption.strategyDefault, this.dictionary, this.raw = false, this.gzip = false}) - ZLibCodec: final bool gzip — When true, GZip frames will be added to the compressed data. - ZLibCodec: final int level — The compression-level can be set in the range of -1..9, with 6 being the default compression level. - ZLibCodec: final int memLevel — Specifies how much memory should be allocated for the internal compression state. 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed. - ZLibCodec: final int strategy — Tunes the compression algorithm. - ZLibCodec: final int windowBits — Base two logarithm of the window size (the size of the history buffer). - ZLibCodec: final bool raw — When true, deflate generates raw data with no zlib header or trailer, and will not compute an adler32 check value - ZLibCodec: final List? dictionary — Initial compression dictionary. - ZLibCodec: ZLibEncoder get encoder — Get a ZLibEncoder for encoding to ZLib compressed data. - ZLibCodec: ZLibDecoder get decoder — Get a ZLibDecoder for decoding ZLib compressed data. - final class GZipCodec extends Codec, List> — The GZipCodec encodes raw bytes to GZip compressed bytes and decodes GZip compressed bytes to raw bytes. - GZipCodec: GZipCodec({this.level = ZLibOption.defaultLevel, this.windowBits = ZLibOption.defaultWindowBits, this.memLevel = ZLibOption.defaultMemLevel, this.strategy = ZLibOption.strategyDefault, this.dictionary, this.raw = false, this.gzip = true}) - GZipCodec: final bool gzip — When true, GZip frames will be added to the compressed data. - GZipCodec: final int level — The compression-level can be set in the range of -1..9, with 6 being the default compression level. - GZipCodec: final int memLevel — Specifies how much memory should be allocated for the internal compression state. 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed. - GZipCodec: final int strategy — Tunes the compression algorithm. - GZipCodec: final int windowBits — Base two logarithm of the window size (the size of the history buffer). - GZipCodec: final List? dictionary — Initial compression dictionary. - GZipCodec: final bool raw — When true, deflate generates raw data with no zlib header or trailer, and will not compute an adler32 check value - GZipCodec: ZLibEncoder get encoder — Get a ZLibEncoder for encoding to GZip compressed data. - GZipCodec: ZLibDecoder get decoder — Get a ZLibDecoder for decoding GZip compressed data. - final class ZLibEncoder extends Converter, List> — The ZLibEncoder encoder is used by ZLibCodec and GZipCodec to compress data. - ZLibEncoder: ZLibEncoder({this.gzip = false, this.level = ZLibOption.defaultLevel, this.windowBits = ZLibOption.defaultWindowBits, this.memLevel = ZLibOption.defaultMemLevel, this.strategy = ZLibOption.strategyDefault, this.dictionary, this.raw = false}) - ZLibEncoder: final bool gzip — When true, GZip frames will be added to the compressed data. - ZLibEncoder: final int level — The compression-level can be set in the range of -1..9, with 6 being the default compression level. - ZLibEncoder: final int memLevel — Specifies how much memory should be allocated for the internal compression state. 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed. - ZLibEncoder: final int strategy — Tunes the compression algorithm. - ZLibEncoder: final int windowBits — Base two logarithm of the window size (the size of the history buffer). - ZLibEncoder: final List? dictionary — Initial compression dictionary. - ZLibEncoder: final bool raw — When true, deflate generates raw data with no zlib header or trailer, and will not compute an adler32 check value - ZLibEncoder: List convert(List bytes) — Convert a list of bytes using the options given to the ZLibEncoder constructor. - ZLibEncoder: ByteConversionSink startChunkedConversion(Sink> sink) — Start a chunked conversion using the options given to the ZLibEncoder constructor. - final class ZLibDecoder extends Converter, List> — The ZLibDecoder is used by ZLibCodec and GZipCodec to decompress data. - ZLibDecoder: ZLibDecoder({this.gzip = false, this.windowBits = ZLibOption.defaultWindowBits, this.dictionary, this.raw = false}) - ZLibDecoder: final bool gzip — When true, all concatenated compressed data sets in the input are decompressed and concatenated in the output. - ZLibDecoder: final int windowBits — Base two logarithm of the window size (the size of the history buffer). - ZLibDecoder: final List? dictionary — Initial compression dictionary. - ZLibDecoder: final bool raw — When true, deflate generates raw data with no zlib header or trailer, and will not compute an adler32 check value - ZLibDecoder: List convert(List bytes) — Convert a list of bytes using the options given to the ZLibDecoder constructor. - ZLibDecoder: ByteConversionSink startChunkedConversion(Sink> sink) — Start a chunked conversion. - abstract interface class RawZLibFilter — The RawZLibFilter class provides a low-level interface to zlib. - RawZLibFilter: factory RawZLibFilter.deflateFilter({bool gzip = false, int level = ZLibOption.defaultLevel, int windowBits = ZLibOption.defaultWindowBits, int memLevel = ZLibOption.defaultMemLevel, int strategy = ZLibOption.strategyDefault, List? dictionary, bool raw = false}) — Returns a RawZLibFilter whose process and processed methods compress data. - RawZLibFilter: factory RawZLibFilter.inflateFilter({bool gzip = false, int windowBits = ZLibOption.defaultWindowBits, List? dictionary, bool raw = false}) — Returns a RawZLibFilter whose process and processed methods decompress data. - RawZLibFilter: void process(List data, int start, int end) — Process a chunk of data. - RawZLibFilter: List? processed({bool flush = true, bool end = false}) — Get a chunk of processed data. - abstract interface class Directory implements FileSystemEntity — A reference to a directory (or folder) on the file system. - Directory: factory Directory(String path) — Creates a Directory object. - Directory: factory Directory.fromRawPath(Uint8List path) - Directory: factory Directory.fromUri(Uri uri) — Create a Directory from a URI. - Directory: static Directory get current — Creates a directory object pointing to the current working directory. - Directory: static void set current(dynamic path) — Sets the current working directory of the Raya process. - Directory: static Directory get systemTemp — The system temp directory. - Directory: String get path — Gets the path of this directory. - Directory: Uri get uri — A Uri representing the directory's location. - Directory: Directory get absolute — A Directory whose path is the absolute path of this Directory. - Directory: Future create({bool recursive = false}) — Creates the directory if it doesn't exist. - Directory: void createSync({bool recursive = false}) — Synchronously creates the directory if it doesn't exist. - Directory: Future createTemp([String? prefix]) — Creates a temporary directory in this directory. - Directory: Directory createTempSync([String? prefix]) — Synchronously creates a temporary directory in this directory. - Directory: Future resolveSymbolicLinks() - Directory: String resolveSymbolicLinksSync() - Directory: Future rename(String newPath) — Renames this directory. - Directory: Directory renameSync(String newPath) — Synchronously renames this directory. - Directory: Future delete({bool recursive = false}) — Deletes this Directory. - Directory: void deleteSync({bool recursive = false}) — Synchronously deletes this Directory. - Directory: Stream list({bool recursive = false, bool followLinks = true}) — Lists the sub-directories and files of this Directory. - Directory: List listSync({bool recursive = false, bool followLinks = true}) — Lists the sub-directories and files of this Directory. - Directory: String toString() — Returns a human readable representation of this Directory. - class FileMode — The modes in which a File can be opened. - FileMode: static const read = FileMode._internal(0) — The mode for opening a file only for reading. - FileMode: static const write = FileMode._internal(1) — Mode for opening a file for reading and writing. - FileMode: static const append = FileMode._internal(2) — Mode for opening a file for reading and writing to the end of it. - FileMode: static const writeOnly = FileMode._internal(3) — Mode for opening a file for writing only. - FileMode: static const writeOnlyAppend = FileMode._internal(4) — Mode for opening a file for writing only to the end of it. - class FileLock — Type of lock when requesting a lock on a file. - FileLock: static const shared = FileLock._internal(1) — Shared file lock. - FileLock: static const exclusive = FileLock._internal(2) — Exclusive file lock. - FileLock: static const blockingShared = FileLock._internal(3) — Blocking shared file lock. - FileLock: static const blockingExclusive = FileLock._internal(4) — Blocking exclusive file lock. - abstract interface class File implements FileSystemEntity — A reference to a file on the file system. - File: factory File(String path) — Creates a File object. - File: factory File.fromUri(Uri uri) — Create a File object from a URI. - File: factory File.fromRawPath(Uint8List rawPath) — Creates a File object from a raw path. - File: File get absolute — A File with the absolute path of path. - File: String get path — Get the path of the file. - File: Future create({bool recursive = false, bool exclusive = false}) — Creates the file. - File: void createSync({bool recursive = false, bool exclusive = false}) — Synchronously creates the file. - File: Future rename(String newPath) — Renames this file. - File: File renameSync(String newPath) — Synchronously renames this file. - File: Future delete({bool recursive = false}) — Deletes this File. - File: void deleteSync({bool recursive = false}) — Synchronously deletes this File. - File: Future copy(String newPath) — Copies this file. - File: File copySync(String newPath) — Synchronously copies this file. - File: Future length() — The length of the file. - File: int lengthSync() — The length of the file provided synchronously. - File: Future lastAccessed() — The last-accessed time of the file. - File: DateTime lastAccessedSync() — The last-accessed time of the file. - File: Future setLastAccessed(DateTime time) — Modifies the time the file was last accessed. - File: void setLastAccessedSync(DateTime time) — Synchronously modifies the time the file was last accessed. - File: Future lastModified() — Get the last-modified time of the file. - File: DateTime lastModifiedSync() — Get the last-modified time of the file. - File: Future setLastModified(DateTime time) — Modifies the time the file was last modified. - File: void setLastModifiedSync(DateTime time) — Synchronously modifies the time the file was last modified. - File: Future open({FileMode mode = FileMode.read}) — Opens the file for random access operations. - File: RandomAccessFile openSync({FileMode mode = FileMode.read}) — Synchronously opens the file for random access operations. - File: Stream> openRead([int? start, int? end]) — Creates a new independent Stream for the contents of this file. - File: IOSink openWrite({FileMode mode = FileMode.write, Encoding encoding = utf8}) — Creates a new independent IOSink for the file. - File: Future readAsBytes() — Reads the entire file contents as a list of bytes. - File: Uint8List readAsBytesSync() — Synchronously reads the entire file contents as a list of bytes. - File: Future readAsString({Encoding encoding = utf8}) — Reads the entire file contents as a string using the given Encoding. - File: String readAsStringSync({Encoding encoding = utf8}) — Synchronously reads the entire file contents as a string using the given Encoding. - File: Future> readAsLines({Encoding encoding = utf8}) — Reads the entire file contents as lines of text using the given Encoding. - File: List readAsLinesSync({Encoding encoding = utf8}) — Synchronously reads the entire file contents as lines of text using the given Encoding. - File: Future writeAsBytes(List bytes, {FileMode mode = FileMode.write, bool flush = false}) — Writes a list of bytes to a file. - File: void writeAsBytesSync(List bytes, {FileMode mode = FileMode.write, bool flush = false}) — Synchronously writes a list of bytes to a file. - File: Future writeAsString(String contents, {FileMode mode = FileMode.write, Encoding encoding = utf8, bool flush = false}) — Writes a string to a file. - File: void writeAsStringSync(String contents, {FileMode mode = FileMode.write, Encoding encoding = utf8, bool flush = false}) — Synchronously writes a string to a file. - abstract interface class RandomAccessFile — Random access to the data in a file. - RandomAccessFile: String get path — The path of the file underlying this random access file. - RandomAccessFile: Future close() — Closes the file. - RandomAccessFile: void closeSync() — Synchronously closes the file. - RandomAccessFile: Future readByte() — Reads a byte from the file. - RandomAccessFile: int readByteSync() — Synchronously reads a single byte from the file. - RandomAccessFile: Future read(int count) — Reads up to count bytes from a file. - RandomAccessFile: Uint8List readSync(int count) — Synchronously reads up to count bytes from a file - RandomAccessFile: Future readInto(List buffer, [int start = 0, int? end]) — Reads bytes into an existing buffer. - RandomAccessFile: int readIntoSync(List buffer, [int start = 0, int? end]) — Synchronously reads into an existing buffer. - RandomAccessFile: Future writeByte(int value) — Writes a single byte to the file. - RandomAccessFile: int writeByteSync(int value) — Synchronously writes a single byte to the file. - RandomAccessFile: Future writeFrom(List buffer, [int start = 0, int? end]) — Writes from a buffer to the file. - RandomAccessFile: void writeFromSync(List buffer, [int start = 0, int? end]) — Synchronously writes from a buffer to the file. - RandomAccessFile: Future writeString(String string, {Encoding encoding = utf8}) — Writes a string to the file using the given Encoding. - RandomAccessFile: void writeStringSync(String string, {Encoding encoding = utf8}) — Synchronously writes a single string to the file using the given Encoding. - RandomAccessFile: Future position() — Gets the current byte position in the file. - RandomAccessFile: int positionSync() — Synchronously gets the current byte position in the file. - RandomAccessFile: Future setPosition(int position) — Sets the byte position in the file. - RandomAccessFile: void setPositionSync(int position) — Synchronously sets the byte position in the file. - RandomAccessFile: Future truncate(int length) — Truncates (or extends) the file to length bytes. - RandomAccessFile: void truncateSync(int length) — Synchronously truncates (or extends) the file to length bytes. - RandomAccessFile: Future length() — Gets the length of the file. - RandomAccessFile: int lengthSync() — Synchronously gets the length of the file. - RandomAccessFile: Future flush() — Flushes the contents of the file to disk. - RandomAccessFile: void flushSync() — Synchronously flushes the contents of the file to disk. - RandomAccessFile: Future lock([FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) — Locks the file or part of the file. - RandomAccessFile: void lockSync([FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) — Synchronously locks the file or part of the file. - RandomAccessFile: Future unlock([int start = 0, int end = -1]) — Unlocks the file or part of the file. - RandomAccessFile: void unlockSync([int start = 0, int end = -1]) — Synchronously unlocks the file or part of the file. - RandomAccessFile: String toString() — Returns a human-readable string for this random access file. - class FileSystemException implements IOException — Exception thrown when a file operation fails. - FileSystemException: const FileSystemException([this.message = "", this.path = "", this.osError]) — Creates a new file system exception with optional parts. - FileSystemException: final String message — Message describing the error. - FileSystemException: final String? path — The file system path on which the error occurred. - FileSystemException: final OSError? osError — The underlying OS error. - FileSystemException: String toString() - class PathAccessException extends FileSystemException — Exception thrown when a file operation fails because the necessary access rights are not available. - PathAccessException: const PathAccessException(String path, OSError osError, [String message = ""]) - PathAccessException: String toString() - class PathExistsException extends FileSystemException — Exception thrown when a file operation fails because the target path already exists. - PathExistsException: const PathExistsException(String path, OSError osError, [String message = ""]) - PathExistsException: String toString() - class PathNotFoundException extends FileSystemException — Exception thrown when a file operation fails because a file or directory does not exist. - PathNotFoundException: const PathNotFoundException(String path, OSError osError, [String message = ""]) - PathNotFoundException: String toString() - abstract interface class ReadPipe implements Stream> — The "read" end of an Pipe created by Pipe.create. - abstract interface class WritePipe implements IOSink — The "write" end of an Pipe created by Pipe.create. - abstract interface class Pipe — An anonymous pipe that can be used to send data in a single direction i.e. data written to write can be read using read. - Pipe: factory Pipe.createSync() — Synchronously creates an anonymous pipe. - Pipe: static Future create() - Pipe: ReadPipe get read — The read end of the Pipe. - Pipe: WritePipe get write — The write end of the Pipe. - final class FileSystemEntityType — The type of an entity on the file system, such as a file, directory, or link. - FileSystemEntityType: static const file = const FileSystemEntityType._internal(0) - FileSystemEntityType: static const directory = const FileSystemEntityType._internal(1) - FileSystemEntityType: static const link = const FileSystemEntityType._internal(2) - FileSystemEntityType: static const unixDomainSock = const FileSystemEntityType._internal(3) - FileSystemEntityType: static const pipe = const FileSystemEntityType._internal(4) - FileSystemEntityType: static const notFound = const FileSystemEntityType._internal(5) - FileSystemEntityType: static const NOT_FOUND = notFound - FileSystemEntityType: String toString() - interface class FileStat — The result of calling the POSIX stat function on a file system object. - FileStat: static FileStat statSync(String path) — Calls the operating system's stat function (or equivalent) on path. - FileStat: static Future stat(String path) — Asynchronously calls the operating system's stat function (or equivalent) on path. - FileStat: final DateTime changed — The time of the last change to the data or metadata of the file system object. - FileStat: final DateTime modified — The time of the last change to the data of the file system object. - FileStat: final DateTime accessed — The time of the last access to the data of the file system object. - FileStat: final FileSystemEntityType type — The type of the underlying file system object. - FileStat: final int mode — The mode of the file system object. - FileStat: final int size — The size of the file system object. - FileStat: String toString() - FileStat: String modeString() — The mode value as a human-readable string. - abstract class FileSystemEntity — The common superclass of File, Directory, and Link. - FileSystemEntity: static Future identical(String path1, String path2) — Checks whether two paths refer to the same object in the file system. - FileSystemEntity: static bool identicalSync(String path1, String path2) — Synchronously checks whether two paths refer to the same object in the file system. - FileSystemEntity: static bool get isWatchSupported — Test if watch is supported on the current system. - FileSystemEntity: static Future type(String path, {bool followLinks = true}) — Finds the type of file system object that a path points to. - FileSystemEntity: static FileSystemEntityType typeSync(String path, {bool followLinks = true}) — Synchronously finds the type of file system object that a path points to. - FileSystemEntity: static Future isLink(String path) — Whether path refers to a link. - FileSystemEntity: static Future isFile(String path) — Whether path refers to a file. - FileSystemEntity: static Future isDirectory(String path) — Whether path refers to a directory. - FileSystemEntity: static bool isLinkSync(String path) — Synchronously checks whether path refers to a link. - FileSystemEntity: static bool isFileSync(String path) — Synchronously checks whether path refers to a file. - FileSystemEntity: static bool isDirectorySync(String path) — Synchronously checks whether path refers to a directory. - FileSystemEntity: static String parentOf(String path) — The parent path of a path. - FileSystemEntity: String get path - FileSystemEntity: Uri get uri — A Uri representing the file system entity's location. - FileSystemEntity: bool get isAbsolute — Whether this object's path is absolute. - FileSystemEntity: FileSystemEntity get absolute — A FileSystemEntity whose path is the absolute path of path. - FileSystemEntity: Directory get parent — The parent directory of this entity. - FileSystemEntity: Future exists() — Checks whether the file system entity with this path exists. - FileSystemEntity: bool existsSync() — Synchronously checks whether the file system entity with this path exists. - FileSystemEntity: Future rename(String newPath) — Renames this file system entity. - FileSystemEntity: FileSystemEntity renameSync(String newPath) — Synchronously renames this file system entity. - FileSystemEntity: Future resolveSymbolicLinks() — Resolves the path of a file system object relative to the current working directory. - FileSystemEntity: String resolveSymbolicLinksSync() — Resolves the path of a file system object relative to the current working directory. - FileSystemEntity: Future stat() — Calls the operating system's stat function on path. - FileSystemEntity: FileStat statSync() — Synchronously calls the operating system's stat function on path. - FileSystemEntity: Future delete({bool recursive = false}) — Deletes this FileSystemEntity. - FileSystemEntity: void deleteSync({bool recursive = false}) — Synchronously deletes this FileSystemEntity. - FileSystemEntity: Stream watch({int events = FileSystemEvent.all, bool recursive = false}) — Start watching the FileSystemEntity for changes. - sealed class FileSystemEvent — Base event class emitted by FileSystemEntity.watch. - FileSystemEvent: static const int create = 1 << 0 — Bitfield for FileSystemEntity.watch, to enable FileSystemCreateEvents. - FileSystemEvent: static const int modify = 1 << 1 — Bitfield for FileSystemEntity.watch, to enable FileSystemModifyEvents. - FileSystemEvent: static const int delete = 1 << 2 — Bitfield for FileSystemEntity.watch, to enable FileSystemDeleteEvents. - FileSystemEvent: static const int move = 1 << 3 — Bitfield for FileSystemEntity.watch, to enable FileSystemMoveEvents. - FileSystemEvent: static const int all = create | modify | delete | move — Bitfield for FileSystemEntity.watch, for enabling all of create, modify, delete and move. - FileSystemEvent: final int type — The type of event. - FileSystemEvent: final String path — The path that triggered the event. - FileSystemEvent: final bool isDirectory — Whether the event target is a directory. - final class FileSystemCreateEvent extends FileSystemEvent — File system event for newly created file system objects. - FileSystemCreateEvent: FileSystemCreateEvent(String path, bool isDirectory) — Constructs a new FileSystemCreateEvent. - FileSystemCreateEvent: String toString() - final class FileSystemModifyEvent extends FileSystemEvent — File system event for modifications of file system objects. - FileSystemModifyEvent: FileSystemModifyEvent(String path, bool isDirectory, this.contentChanged) — Constructs a new FileSystemModifyEvent. - FileSystemModifyEvent: final bool contentChanged — If the content was changed and not only the attributes, contentChanged is true. - FileSystemModifyEvent: String toString() - final class FileSystemDeleteEvent extends FileSystemEvent — File system event for deletion of file system objects. - FileSystemDeleteEvent: FileSystemDeleteEvent(String path, bool isDirectory) — Constructs a new FileSystemDeleteEvent. - FileSystemDeleteEvent: bool get isDirectory — Whether the file system object was a directory. - FileSystemDeleteEvent: String toString() - final class FileSystemMoveEvent extends FileSystemEvent — File system event for moving of file system objects. - FileSystemMoveEvent: FileSystemMoveEvent(String path, bool isDirectory, this.destination) — Constructs a new FileSystemMoveEvent. - FileSystemMoveEvent: final String? destination — The destination path of the file being moved. - FileSystemMoveEvent: String toString() - abstract interface class IOSink implements StreamSink>, StringSink — A combined byte and text output. - IOSink: factory IOSink(StreamConsumer> target, {Encoding encoding = utf8}) — Create an IOSink that outputs to a target StreamConsumer of bytes. - IOSink: late Encoding encoding — The Encoding used when writing strings. - IOSink: Future get done — A future that will complete when the consumer closes, or when an error occurs. - IOSink: void add(List data) — Adds byte data to the target consumer, ignoring encoding. - IOSink: void write(Object? object) — Converts object to a String by invoking Object.toString and adds the encoding of the result to the target consumer. - IOSink: void writeAll(Iterable objects, [String separator = ""]) — Iterates over the given objects and writes them in sequence. - IOSink: void writeln([Object? object = ""]) — Converts object to a String by invoking Object.toString and writes the result to this, followed by a newline. - IOSink: void writeCharCode(int charCode) — Writes the character of charCode. - IOSink: void addError(error, [StackTrace? stackTrace]) — Passes the error to the target consumer as an error event. - IOSink: Future addStream(Stream> stream) — Adds all elements of the given stream. - IOSink: Future flush() — Returns a Future that completes once all buffered data is accepted by the underlying StreamConsumer. - IOSink: Future close() — Close the target consumer. - abstract interface class Link implements FileSystemEntity — References to filesystem links. - Link: factory Link(String path) — Creates a Link object. - Link: factory Link.fromRawPath(Uint8List rawPath) - Link: factory Link.fromUri(Uri uri) — Creates a Link object. - Link: Link get absolute — A Link instance whose path is the absolute path to this Link. - Link: Future create(String target, {bool recursive = false}) — Creates a symbolic link in the file system. - Link: void createSync(String target, {bool recursive = false}) — Creates a symbolic link in the file system. - Link: void updateSync(String target) — Synchronously updates an existing link. - Link: Future update(String target) — Updates an existing link. - Link: Future resolveSymbolicLinks() - Link: String resolveSymbolicLinksSync() - Link: Future rename(String newPath) — Renames this link. - Link: Link renameSync(String newPath) — Synchronously renames this link. - Link: Future delete({bool recursive = false}) — Deletes this Link. - Link: void deleteSync({bool recursive = false}) — Synchronously deletes this Link. - Link: Future target() — Gets the target of the link. - Link: String targetSync() — Synchronously gets the target of the link. - abstract base class IOOverrides — Facilities for overriding various APIs of raya:io with mock implementations. - IOOverrides: static IOOverrides? get current - IOOverrides: static set global(IOOverrides? overrides) — The IOOverrides to use in the root Zone. - IOOverrides: static R runZoned(R body(), {Directory Function(String)? createDirectory, Directory Function()? getCurrentDirectory, void Function(String)? setCurrentDirectory, Directory Function()? getSystemTempDirectory, File Function(String)? createFile, Future Function(String)? stat, FileStat Function(String)? statSync, Future Function(String, String)? fseIdentical, bool Function(String, String)? fseIdenticalSync, Future Function(String, bool)? fseGetType, FileSystemEntityType Function(String, bool)? fseGetTypeSync, Stream Function(String, int, bool)? fsWatch, bool Function()? fsWatchIsSupported, Link Function(String)? createLink, Future Function(dynamic, int, {dynamic sourceAddress, int sourcePort, Duration? timeout})? socketConnect, Future> Function(dynamic, int, {dynamic sourceAddress, int sourcePort})? socketStartConnect, Future Function(dynamic, int, {int backlog, bool v6Only, bool shared})? serverSocketBind, Stdin Function()? stdin, Stdout Function()? stdout, Stdout Function()? stderr, @Since("3.10") Never Function(int)? exit}) — Runs body in a fresh Zone using the provided overrides. - IOOverrides: static R runWithIOOverrides(R body(), IOOverrides overrides) — Runs body in a fresh Zone using the overrides found in overrides. - IOOverrides: Stdin get stdin — The standard input stream of data read by this program. - IOOverrides: Stdout get stdout — The standard output stream of data written by this program. - IOOverrides: Stdout get stderr — The standard output stream of errors written by this program. - IOOverrides: Directory createDirectory(String path) — Creates a new Directory object for the given path. - IOOverrides: Directory getCurrentDirectory() — Returns the current working directory. - IOOverrides: void setCurrentDirectory(String path) — Sets the current working directory to be path. - IOOverrides: Directory getSystemTempDirectory() — Returns the system temporary directory. - IOOverrides: File createFile(String path) — Creates a new File object for the given path. - IOOverrides: Future stat(String path) — Asynchronously returns FileStat information for path. - IOOverrides: FileStat statSync(String path) — Returns FileStat information for path. - IOOverrides: Future fseIdentical(String path1, String path2) — Asynchronously returns true if path1 and path2 are paths to the same file system object. - IOOverrides: bool fseIdenticalSync(String path1, String path2) — Returns true if path1 and path2 are paths to the same file system object. - IOOverrides: Future fseGetType(String path, bool followLinks) — Asynchronously returns the FileSystemEntityType for path. - IOOverrides: FileSystemEntityType fseGetTypeSync(String path, bool followLinks) — Returns the FileSystemEntityType for path. - IOOverrides: Stream fsWatch(String path, int events, bool recursive) — Returns a Stream of FileSystemEvents. - IOOverrides: bool fsWatchIsSupported() — Returns true when FileSystemEntity.watch is supported. - IOOverrides: Link createLink(String path) — Returns a new Link object for the given path. - IOOverrides: Future socketConnect(host, int port, {sourceAddress, int sourcePort = 0, Duration? timeout}) — Asynchronously returns a Socket connected to the given host and port. - IOOverrides: Future> socketStartConnect(host, int port, {sourceAddress, int sourcePort = 0}) — Asynchronously returns a ConnectionTask that connects to the given host and port when successful. - IOOverrides: Future serverSocketBind(address, int port, {int backlog = 0, bool v6Only = false, bool shared = false}) — Asynchronously returns a ServerSocket that connects to the given address and port when successful. - IOOverrides: Never exit(int code) — Exit the Raya VM process immediately with the given exit code. - abstract final class Platform — Information about the environment in which the current program is running. - Platform: static final numberOfProcessors — The number of individual execution units of the machine. - Platform: static final pathSeparator — The path separator used by the operating system to separate components in file paths. - Platform: static final operatingSystem — A string representing the operating system or platform. - Platform: static final operatingSystemVersion — A string representing the version of the operating system or platform. - Platform: static final localHostname — The local hostname for the system. - Platform: static final version — The version of the current Raya runtime. - Platform: static String get localeName — Get the name of the current locale. - Platform: static final bool isLinux — Whether the operating system is a version of Linux. - Platform: static final bool isMacOS — Whether the operating system is a version of macOS. - Platform: static bool isWindows — Whether the operating system is a version of Microsoft Windows. - Platform: static final bool isAndroid — Whether the operating system is a version of Android. - Platform: static final bool isIOS — Whether the operating system is a version of iOS. - Platform: static final bool isFuchsia — Whether the operating system is a version of Fuchsia. - Platform: static Map get environment — The environment for this process as a map from string key to string value. - Platform: static String get executable — The path of the executable used to run the script in this isolate. - Platform: static String get resolvedExecutable — The path of the executable used to run the script in this isolate after it has been resolved by the OS. - Platform: static Uri get script — The absolute URI of the script being run in this isolate. - Platform: static List get executableArguments — The flags passed to the executable used to run the script in this isolate. - Platform: static String? get packageConfig — The --packages flag passed to the executable used to run the script in this isolate. - Platform: static String get lineTerminator — The current operating system's default line terminator. - abstract final class ProcessInfo — Methods for retrieving information about the current process. - ProcessInfo: external static int get currentRss — The current resident set size of memory for the process, in bytes. - ProcessInfo: external static int get maxRss — The high-watermark in bytes for the resident set size of memory for the process. - final class ProcessStartMode — Modes for running a new process. - ProcessStartMode: static const normal = const ProcessStartMode._internal(0) — Normal child process. - ProcessStartMode: static const inheritStdio = const ProcessStartMode._internal(1) — Stdio handles are inherited by the child process. - ProcessStartMode: static const detached = const ProcessStartMode._internal(2) — Detached child process with no open communication channel. - ProcessStartMode: static const detachedWithStdio = const ProcessStartMode._internal(3) — Detached child process with stdin, stdout and stderr still open for communication with the child. - ProcessStartMode: static List get values - ProcessStartMode: String toString() - abstract interface class Process — The means to execute a program. - Process: external static Future start(String executable, List arguments, {String? workingDirectory, Map? environment, bool includeParentEnvironment = true, bool runInShell = false, ProcessStartMode mode = ProcessStartMode.normal}) — Starts a process running the executable with the specified arguments. - Process: external static Future run(String executable, List arguments, {String? workingDirectory, Map? environment, bool includeParentEnvironment = true, bool runInShell = false, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding}) — Starts a process and runs it non-interactively to completion. - Process: external static ProcessResult runSync(String executable, List arguments, {String? workingDirectory, Map? environment, bool includeParentEnvironment = true, bool runInShell = false, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding}) — Starts a process and runs it to completion. - Process: external static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) — Kills the process with id pid. - Process: Future get exitCode — A Future which completes with the exit code of the process when the process completes. - Process: Stream> get stdout — The standard output stream of the process as a Stream. - Process: Stream> get stderr — The standard error stream of the process as a Stream. - Process: IOSink get stdin — The standard input stream of the process as an IOSink. - Process: int get pid — The process id of the process. - Process: bool kill([ProcessSignal signal = ProcessSignal.sigterm]) — Kills the process. - final class ProcessResult — The result of running a non-interactive process started with Process.run or Process.runSync. - ProcessResult: ProcessResult(this.pid, this.exitCode, this.stdout, this.stderr) - ProcessResult: final int exitCode — Exit code for the process. - ProcessResult: final stdout — Standard output from the process. - ProcessResult: final stderr — Standard error from the process. - ProcessResult: final int pid — Process id of the process. - interface class ProcessSignal — On Posix systems, ProcessSignal is used to send a specific signal to a child process, see Process.kill. - ProcessSignal: static const ProcessSignal sighup = const ProcessSignal._(1, "SIGHUP") - ProcessSignal: static const ProcessSignal sigint = const ProcessSignal._(2, "SIGINT") - ProcessSignal: static const ProcessSignal sigquit = const ProcessSignal._(3, "SIGQUIT") - ProcessSignal: static const ProcessSignal sigill = const ProcessSignal._(4, "SIGILL") - ProcessSignal: static const ProcessSignal sigtrap = const ProcessSignal._(5, "SIGTRAP") - ProcessSignal: static const ProcessSignal sigabrt = const ProcessSignal._(6, "SIGABRT") - ProcessSignal: static const ProcessSignal sigbus = const ProcessSignal._(7, "SIGBUS") - ProcessSignal: static const ProcessSignal sigfpe = const ProcessSignal._(8, "SIGFPE") - ProcessSignal: static const ProcessSignal sigkill = const ProcessSignal._(9, "SIGKILL") - ProcessSignal: static const ProcessSignal sigusr1 = const ProcessSignal._(10, "SIGUSR1") - ProcessSignal: static const ProcessSignal sigsegv = const ProcessSignal._(11, "SIGSEGV") - ProcessSignal: static const ProcessSignal sigusr2 = const ProcessSignal._(12, "SIGUSR2") - ProcessSignal: static const ProcessSignal sigpipe = const ProcessSignal._(13, "SIGPIPE") - ProcessSignal: static const ProcessSignal sigalrm = const ProcessSignal._(14, "SIGALRM") - ProcessSignal: static const ProcessSignal sigterm = const ProcessSignal._(15, "SIGTERM") - ProcessSignal: static const ProcessSignal sigchld = const ProcessSignal._(17, "SIGCHLD") - ProcessSignal: static const ProcessSignal sigcont = const ProcessSignal._(18, "SIGCONT") - ProcessSignal: static const ProcessSignal sigstop = const ProcessSignal._(19, "SIGSTOP") - ProcessSignal: static const ProcessSignal sigtstp = const ProcessSignal._(20, "SIGTSTP") - ProcessSignal: static const ProcessSignal sigttin = const ProcessSignal._(21, "SIGTTIN") - ProcessSignal: static const ProcessSignal sigttou = const ProcessSignal._(22, "SIGTTOU") - ProcessSignal: static const ProcessSignal sigurg = const ProcessSignal._(23, "SIGURG") - ProcessSignal: static const ProcessSignal sigxcpu = const ProcessSignal._(24, "SIGXCPU") - ProcessSignal: static const ProcessSignal sigxfsz = const ProcessSignal._(25, "SIGXFSZ") - ProcessSignal: static const ProcessSignal sigvtalrm = const ProcessSignal._(26, "SIGVTALRM") - ProcessSignal: static const ProcessSignal sigprof = const ProcessSignal._(27, "SIGPROF") - ProcessSignal: static const ProcessSignal sigwinch = const ProcessSignal._(28, "SIGWINCH") - ProcessSignal: static const ProcessSignal sigpoll = const ProcessSignal._(29, "SIGPOLL") - ProcessSignal: static const ProcessSignal sigsys = const ProcessSignal._(31, "SIGSYS") - ProcessSignal: final int signalNumber — The numeric constant for the signal e.g. - ProcessSignal: final String name — The POSIX-standardized name of the signal e.g. - ProcessSignal: String toString() - ProcessSignal: Stream watch() — Watch for process signals. - class SignalException implements IOException - SignalException: const SignalException(this.message, [this.osError]) - SignalException: final String message - SignalException: final osError - SignalException: String toString() - class ProcessException implements IOException - ProcessException: const ProcessException(this.executable, this.arguments, [this.message = "", this.errorCode = 0]) - ProcessException: final String executable — The executable provided for the process. - ProcessException: final List arguments — The arguments provided for the process. - ProcessException: final String message — The system message for the process exception, if any. - ProcessException: final int errorCode — The OS error code for the process exception, if any. - ProcessException: String toString() - class SecureServerSocket extends Stream implements ServerSocketBase — A server socket, providing a stream of high-level Sockets. - SecureServerSocket: static Future bind(address, int port, SecurityContext? context, {int backlog = 0, bool v6Only = false, bool requestClientCertificate = false, bool requireClientCertificate = false, List? supportedProtocols, bool shared = false}) — Listens on a given address and port. - SecureServerSocket: int get port — The port used by this socket. - SecureServerSocket: InternetAddress get address — The address used by this socket. - SecureServerSocket: StreamSubscription listen(void onData(SecureSocket socket)?, {Function? onError, void onDone()?, bool? cancelOnError}) - SecureServerSocket: Future close() — Closes this socket. - class RawSecureServerSocket extends Stream — A server socket providing a stream of low-level RawSecureSockets. - RawSecureServerSocket: static Future bind(address, int port, SecurityContext? context, {int backlog = 0, bool v6Only = false, bool requestClientCertificate = false, bool requireClientCertificate = false, List? supportedProtocols, bool shared = false}) — Listens on a provided address and port. - RawSecureServerSocket: final bool requestClientCertificate - RawSecureServerSocket: final bool requireClientCertificate - RawSecureServerSocket: final List? supportedProtocols - RawSecureServerSocket: int get port — The port used by this socket. - RawSecureServerSocket: InternetAddress get address — The address used by this socket. - RawSecureServerSocket: StreamSubscription listen(void onData(RawSecureSocket s)?, {Function? onError, void onDone()?, bool? cancelOnError}) - RawSecureServerSocket: Future close() — Closes this socket. - abstract interface class SecureSocket implements Socket — A TCP socket using TLS and SSL. - SecureSocket: static Future connect(host, int port, {SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols, Duration? timeout}) — Constructs a new secure client socket and connects it to the given host on port port. - SecureSocket: static Future> startConnect(host, int port, {SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols}) — Like connect, but returns a Future that completes with a ConnectionTask that can be cancelled if the SecureSocket is no longer needed. - SecureSocket: static Future secure(Socket socket, {host, SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols}) — Initiates TLS on an existing connection. - SecureSocket: static Future secureServer(Socket socket, SecurityContext? context, {List? bufferedData, bool requestClientCertificate = false, bool requireClientCertificate = false, List? supportedProtocols}) — Initiates TLS on an existing server connection. - SecureSocket: X509Certificate? get peerCertificate — The peer certificate for a connected SecureSocket. - SecureSocket: String? get selectedProtocol — The protocol which was selected during ALPN protocol negotiation. - SecureSocket: void renegotiate({bool useSessionCache = true, bool requestClientCertificate = false, bool requireClientCertificate = false}) — Does nothing. - abstract interface class RawSecureSocket implements RawSocket — RawSecureSocket provides a secure (SSL or TLS) network connection. - RawSecureSocket: static Future connect(host, int port, {SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols, Duration? timeout}) — Constructs a new secure client socket and connect it to the given host on the given port. - RawSecureSocket: static Future> startConnect(host, int port, {SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols}) — Like connect, but returns a Future that completes with a ConnectionTask that can be cancelled if the RawSecureSocket is no longer needed. - RawSecureSocket: static Future secure(RawSocket socket, {StreamSubscription? subscription, host, SecurityContext? context, bool onBadCertificate(X509Certificate certificate)?, void keyLog(String line)?, List? supportedProtocols}) — Initiates TLS on an existing connection. - RawSecureSocket: static Future secureServer(RawSocket socket, SecurityContext? context, {StreamSubscription? subscription, List? bufferedData, bool requestClientCertificate = false, bool requireClientCertificate = false, List? supportedProtocols}) — Initiates TLS on an existing server connection. - RawSecureSocket: X509Certificate? get peerCertificate — Get the peer certificate for a connected RawSecureSocket. - RawSecureSocket: String? get selectedProtocol — The protocol which was selected during protocol negotiation. - RawSecureSocket: void renegotiate({bool useSessionCache = true, bool requestClientCertificate = false, bool requireClientCertificate = false}) — Does nothing. - abstract interface class X509Certificate — X509Certificate represents an SSL certificate, with accessors to get the fields of the certificate. - X509Certificate: Uint8List get der — The DER encoded bytes of the certificate. - X509Certificate: String get pem — The PEM encoded String of the certificate. - X509Certificate: Uint8List get sha1 — The SHA1 hash of the certificate. - X509Certificate: String get subject - X509Certificate: String get issuer - X509Certificate: DateTime get startValidity - X509Certificate: DateTime get endValidity - class TlsException implements IOException — A secure networking exception caused by a failure in the TLS/SSL protocol. - TlsException: const TlsException([String message = "", OSError? osError]) - TlsException: final String type - TlsException: final String message - TlsException: final OSError? osError - TlsException: String toString() - class HandshakeException extends TlsException — An exception that happens in the handshake phase of establishing a secure network connection. - HandshakeException: const HandshakeException([String message = "", OSError? osError]) - class CertificateException extends TlsException — An exception that happens in the handshake phase of establishing a secure network connection, when looking up or verifying a certificate. - CertificateException: const CertificateException([String message = "", OSError? osError]) - class TlsProtocolVersion — A Transport Layer Security (TLS) version. - TlsProtocolVersion: static const tls1_2 = TlsProtocolVersion._(0x0303) — Transport Layer Security (TLS) Protocol Version 1.2. - TlsProtocolVersion: static const tls1_3 = TlsProtocolVersion._(0x0304) — Transport Layer Security (TLS) Protocol Version 1.3. - abstract final class SecurityContext — The object containing the certificates to trust when making a secure client connection, and the certificate chain and private key to serve from a secure server. - SecurityContext: external factory SecurityContext({bool withTrustedRoots = false}) — Creates a new SecurityContext. - SecurityContext: external static SecurityContext get defaultContext — The default security context used by most operation requiring one. - SecurityContext: external static bool get alpnSupported — Whether the platform supports ALPN. - SecurityContext: abstract bool allowLegacyUnsafeRenegotiation — If true, the SecurityContext will allow TLS renegotiation. - SecurityContext: abstract TlsProtocolVersion minimumTlsProtocolVersion — The minimum TLS version to use when establishing a secure connection. - SecurityContext: void usePrivateKey(String file, {String? password}) — Sets the private key for a server certificate or client certificate. - SecurityContext: void usePrivateKeyBytes(List keyBytes, {String? password}) — Sets the private key for a server certificate or client certificate. - SecurityContext: void setTrustedCertificates(String file, {String? password}) — Add a certificate to the set of trusted X509 certificates used by SecureSocket client connections. - SecurityContext: void setTrustedCertificatesBytes(List certBytes, {String? password}) — Add a certificate to the set of trusted X509 certificates used by SecureSocket client connections. - SecurityContext: void useCertificateChain(String file, {String? password}) — Sets the chain of X509 certificates served by SecureServerSocket when making secure connections, including the server certificate. - SecurityContext: void useCertificateChainBytes(List chainBytes, {String? password}) — Sets the chain of X509 certificates served by SecureServerSocket when making secure connections, including the server certificate. - SecurityContext: void setClientAuthorities(String file, {String? password}) — Sets the list of authority names that a SecureServerSocket will advertise as accepted when requesting a client certificate from a connecting client. - SecurityContext: void setClientAuthoritiesBytes(List authCertBytes, {String? password}) — Sets the list of authority names that a SecureServerSocket will advertise as accepted, when requesting a client certificate from a connecting client. - SecurityContext: void setAlpnProtocols(List protocols, bool isServer) — Sets the list of application-level protocols supported by a client connection or server connection. - final class InternetAddressType — The type, or address family, of an InternetAddress. - InternetAddressType: static const InternetAddressType IPv4 = InternetAddressType._(0) - InternetAddressType: static const InternetAddressType IPv6 = InternetAddressType._(1) - InternetAddressType: static const InternetAddressType unix = InternetAddressType._(2) - InternetAddressType: static const InternetAddressType any = InternetAddressType._(-1) - InternetAddressType: String get name — Get the name of the type, e.g. - InternetAddressType: String toString() - abstract interface class InternetAddress — An internet address or a Unix domain address. - InternetAddress: external factory InternetAddress(String address, {InternetAddressType? type}) — Creates a new InternetAddress from a numeric address or a file path. - InternetAddress: external factory InternetAddress.fromRawAddress(Uint8List rawAddress, {InternetAddressType? type}) — Creates a new InternetAddress from the provided raw address bytes. - InternetAddress: external static InternetAddress get loopbackIPv4 — IP version 4 loopback address. - InternetAddress: external static InternetAddress get loopbackIPv6 — IP version 6 loopback address. - InternetAddress: external static InternetAddress get anyIPv4 — IP version 4 any address. - InternetAddress: external static InternetAddress get anyIPv6 — IP version 6 any address. - InternetAddress: external static Future> lookup(String host, {InternetAddressType type = InternetAddressType.any}) — Looks up the addresses of a host. - InternetAddress: external static InternetAddress? tryParse(String address) — Attempts to parse address as a numeric address. - InternetAddress: InternetAddressType get type — The address family of the InternetAddress. - InternetAddress: String get address — The numeric address of the host. - InternetAddress: String get host — The host used to lookup the address. - InternetAddress: Uint8List get rawAddress — The raw address of this InternetAddress. - InternetAddress: bool get isLoopback — Whether the InternetAddress is a loopback address. - InternetAddress: bool get isLinkLocal — Whether the scope of the InternetAddress is a link-local. - InternetAddress: bool get isMulticast — Whether the scope of the InternetAddress is multicast. - InternetAddress: Future reverse() — Performs a reverse DNS lookup on this address - abstract interface class InterfaceAddress implements InternetAddress — An InternetAddress bound to a NetworkInterface, extended with network configuration details. - InterfaceAddress: int get prefixLength — The prefix length of the network, also known as the subnet mask length. - InterfaceAddress: InternetAddress? get broadcast — The broadcast address of this network. - abstract interface class NetworkInterface — A NetworkInterface represents an active network interface on the current system. - NetworkInterface: external static bool get listSupported — Whether the list method is supported. - NetworkInterface: external static Future> list({bool includeLoopback = false, bool includeLinkLocal = false, InternetAddressType type = InternetAddressType.any}) — Query the system for NetworkInterfaces. - NetworkInterface: String get name — The name of the NetworkInterface. - NetworkInterface: int get index — The index of the NetworkInterface. - NetworkInterface: List get addresses — The list of InterfaceAddresses currently bound to this NetworkInterface. - abstract interface class RawServerSocket implements Stream — A listening socket. - RawServerSocket: external static Future bind(address, int port, {int backlog = 0, bool v6Only = false, bool shared = false}) — Listens on a given address and port. - RawServerSocket: int get port — The port used by this socket. - RawServerSocket: InternetAddress get address — The address used by this socket. - RawServerSocket: Future close() — Closes the socket. - abstract interface class ServerSocket implements ServerSocketBase — A listening socket. - ServerSocket: static Future bind(address, int port, {int backlog = 0, bool v6Only = false, bool shared = false}) — Listens on a given address and port. - ServerSocket: int get port — The port used by this socket. - ServerSocket: InternetAddress get address — The address used by this socket. - ServerSocket: Future close() — Closes the socket. - final class SocketDirection — The SocketDirection is used as a parameter to Socket.close and RawSocket.close to close a socket in the specified direction(s). - SocketDirection: static const SocketDirection receive = SocketDirection._(0) - SocketDirection: static const SocketDirection send = SocketDirection._(1) - SocketDirection: static const SocketDirection both = SocketDirection._(2) - final class SocketOption — An option for a socket which is configured using Socket.setOption. - SocketOption: static const SocketOption tcpNoDelay = SocketOption._(0) — Enable or disable no-delay on the socket. - final class RawSocketOption — The RawSocketOption is used as a parameter to Socket.setRawOption and RawSocket.setRawOption to customize the behaviour of the underlying socket. - RawSocketOption: const RawSocketOption(this.level, this.option, this.value) — Creates a RawSocketOption for RawSocket.getRawOption and RawSocket.setRawOption. - RawSocketOption: factory RawSocketOption.fromInt(int level, int option, int value) — Convenience constructor for creating an integer based RawSocketOption. - RawSocketOption: factory RawSocketOption.fromBool(int level, int option, bool value) — Convenience constructor for creating a boolean based RawSocketOption. - RawSocketOption: static int get levelSocket — Socket level option for SOL_SOCKET. - RawSocketOption: static int get levelIPv4 — Socket level option for IPPROTO_IP. - RawSocketOption: static int get IPv4MulticastInterface — Socket option for IP_MULTICAST_IF. - RawSocketOption: static int get levelIPv6 — Socket level option for IPPROTO_IPV6. - RawSocketOption: static int get IPv6MulticastInterface — Socket option for IPV6_MULTICAST_IF. - RawSocketOption: static int get levelTcp — Socket level option for IPPROTO_TCP. - RawSocketOption: static int get levelUdp — Socket level option for IPPROTO_UDP. - RawSocketOption: final int level — The level for the option to set or get. - RawSocketOption: final int option — The numeric ID of the option to set or get. - RawSocketOption: final Uint8List value — The raw data to set, or the array to write the current option value into. - class RawSocketEvent — Events for the RawDatagramSocket, RawSecureSocket, and RawSocket. - RawSocketEvent: static const RawSocketEvent read = RawSocketEvent._(0) — An event indicates the socket is ready to be read. - RawSocketEvent: static const RawSocketEvent write = RawSocketEvent._(1) — An event indicates the socket is ready to write. - RawSocketEvent: static const RawSocketEvent readClosed = RawSocketEvent._(2) — An event indicates the reading from the socket is closed - RawSocketEvent: static const RawSocketEvent closed = RawSocketEvent._(3) — An event indicates the socket is closed. - RawSocketEvent: String toString() - final class ConnectionTask — A cancelable connection attempt. - ConnectionTask: static ConnectionTask fromSocket(Future socket, void Function() onCancel) — Create a ConnectionTask from an existing Future. - ConnectionTask: final Future socket — A Future that completes with value that S.connect would return unless cancel is called on this ConnectionTask. - ConnectionTask: void cancel() — Cancels the connection attempt. - abstract interface class RawSocket implements Stream — A TCP connection. - RawSocket: external static Future connect(host, int port, {sourceAddress, int sourcePort = 0, Duration? timeout}) — Creates a new socket connection to the host and port. - RawSocket: external static Future> startConnect(host, int port, {sourceAddress, int sourcePort = 0}) — Like connect, but returns a Future that completes with a ConnectionTask that can be cancelled if the RawSocket is no longer needed. - RawSocket: abstract bool readEventsEnabled — Set or get, if the RawSocket should listen for RawSocketEvent.read and RawSocketEvent.readClosed events. - RawSocket: abstract bool writeEventsEnabled — Set or get, if the RawSocket should listen for RawSocketEvent.write events. - RawSocket: int get port — The port used by this socket. - RawSocket: int get remotePort — The remote port connected to by this socket. - RawSocket: InternetAddress get address — The InternetAddress used to connect this socket. - RawSocket: InternetAddress get remoteAddress — The remote InternetAddress connected to by this socket. - RawSocket: int available() — The number of received and non-read bytes in the socket that can be read. - RawSocket: Uint8List? read([int? len]) — Read up to len bytes from the socket. - RawSocket: SocketMessage? readMessage([int? count]) — Reads a message containing up to count bytes from the socket. - RawSocket: int write(List buffer, [int offset = 0, int? count]) — Writes up to count bytes of the buffer from offset buffer offset to the socket. - RawSocket: int sendMessage(List controlMessages, List data, [int offset = 0, int? count]) — Writes socket control messages and data bytes to the socket. - RawSocket: Future close() — Closes the socket. - RawSocket: void shutdown(SocketDirection direction) — Shuts down the socket in the direction. - RawSocket: bool setOption(SocketOption option, bool enabled) — Customize the RawSocket. - RawSocket: Uint8List getRawOption(RawSocketOption option) — Reads low level information about the RawSocket. - RawSocket: void setRawOption(RawSocketOption option) — Customizes the RawSocket. - abstract interface class Socket implements Stream, IOSink — A TCP connection between two sockets. - Socket: static Future connect(host, int port, {sourceAddress, int sourcePort = 0, Duration? timeout}) — Creates a new socket connection to the host and port and returns a Future that will complete with either a Socket once connected or an error if the host-lookup or connection failed. - Socket: static Future> startConnect(host, int port, {sourceAddress, int sourcePort = 0}) — Like connect, but returns a Future that completes with a ConnectionTask that can be cancelled if the Socket is no longer needed. - Socket: int get port — The port used by this socket. - Socket: int get remotePort — The remote port connected to by this socket. - Socket: InternetAddress get address — The InternetAddress used to connect this socket. - Socket: InternetAddress get remoteAddress — The remote InternetAddress connected to by this socket. - Socket: Future get done - Socket: void destroy() — Destroys the socket in both directions. - Socket: bool setOption(SocketOption option, bool enabled) — Customizes the RawSocket. - Socket: Uint8List getRawOption(RawSocketOption option) — Reads low level information about the RawSocket. - Socket: void setRawOption(RawSocketOption option) — Customizes the RawSocket. - Socket: void addError(Object error, [StackTrace? stackTrace]) — Unsupported operation on sockets. - Socket: Future close() - final class Datagram — A data packet received by a RawDatagramSocket. - Datagram: Datagram(this.data, this.address, this.port) - Datagram: Uint8List data — The actual bytes of the message. - Datagram: InternetAddress address — The address of the socket which sends the data. - Datagram: int port — The port of the socket which sends the data. - abstract interface class ResourceHandle — A wrapper around OS resource handle so it can be passed via Socket as part of SocketMessage. - ResourceHandle: external factory ResourceHandle.fromFile(RandomAccessFile file) — Creates wrapper around opened file. - ResourceHandle: external factory ResourceHandle.fromSocket(Socket socket) — Creates wrapper around opened socket. - ResourceHandle: external factory ResourceHandle.fromRawSocket(RawSocket socket) — Creates wrapper around opened raw socket. - ResourceHandle: external factory ResourceHandle.fromRawDatagramSocket(RawDatagramSocket socket) — Creates wrapper around opened raw datagram socket. - ResourceHandle: external factory ResourceHandle.fromStdin(Stdin stdin) — Creates wrapper around current stdin. - ResourceHandle: external factory ResourceHandle.fromStdout(Stdout stdout) — Creates wrapper around current stdout. - ResourceHandle: external factory ResourceHandle.fromReadPipe(ReadPipe pipe) - ResourceHandle: external factory ResourceHandle.fromWritePipe(WritePipe pipe) - ResourceHandle: RandomAccessFile toFile() — Extracts opened file from resource handle. - ResourceHandle: Socket toSocket() — Extracts opened socket from resource handle. - ResourceHandle: RawSocket toRawSocket() — Extracts opened raw socket from resource handle. - ResourceHandle: RawDatagramSocket toRawDatagramSocket() — Extracts opened raw datagram socket from resource handle. - ResourceHandle: ReadPipe toReadPipe() — Extracts a read pipe from resource handle. - ResourceHandle: WritePipe toWritePipe() — Extracts a write pipe from resource handle. - abstract interface class SocketControlMessage — Control message part of the SocketMessage received by a call to RawSocket.readMessage. - SocketControlMessage: external factory SocketControlMessage.fromHandles(List handles) — Creates a control message containing the provided handles. - SocketControlMessage: int get level — A platform specific value used to determine the kind of control message. - SocketControlMessage: int get type — A platform specific value used to determine the kind of control message. - SocketControlMessage: Uint8List get data — Actual bytes that were passed as part of the control message by the underlying platform. - SocketControlMessage: List extractHandles() — Extracts the list of handles embedded in this message. - final class SocketMessage — A socket message received by a RawDatagramSocket. - SocketMessage: SocketMessage(this.data, this.controlMessages) - SocketMessage: final Uint8List data — The actual bytes of the message. - SocketMessage: final List controlMessages — The control messages sent as part of this socket message. - abstract interface class RawDatagramSocket extends Stream — An unbuffered interface to a UDP socket. - RawDatagramSocket: external static Future bind(host, int port, {bool reuseAddress = true, bool reusePort = false, int ttl = 1}) — Binds a socket to the given host and port. - RawDatagramSocket: abstract bool readEventsEnabled — Whether the RawDatagramSocket should listen for RawSocketEvent.read events. - RawDatagramSocket: abstract bool writeEventsEnabled — Whether the RawDatagramSocket should listen for RawSocketEvent.write events. - RawDatagramSocket: abstract bool multicastLoopback — Whether multicast traffic is looped back to the host. - RawDatagramSocket: abstract int multicastHops — The maximum network hops for multicast packages originating from this socket. - RawDatagramSocket: NetworkInterface? multicastInterface — The network interface used for outgoing multicast packages. - RawDatagramSocket: abstract bool broadcastEnabled — Whether IPv4 broadcast is enabled. - RawDatagramSocket: int get port — The port used by this socket. - RawDatagramSocket: InternetAddress get address — The address used by this socket. - RawDatagramSocket: void close() — Closes the datagram socket. - RawDatagramSocket: int send(List buffer, InternetAddress address, int port) — Asynchronously sends a datagram. - RawDatagramSocket: Datagram? receive() — Receives a datagram. - RawDatagramSocket: void joinMulticast(InternetAddress group, [NetworkInterface? interface]) — Joins a multicast group. - RawDatagramSocket: void leaveMulticast(InternetAddress group, [NetworkInterface? interface]) — Leaves a multicast group. - RawDatagramSocket: Uint8List getRawOption(RawSocketOption option) — Reads low level information about the RawSocket. - RawDatagramSocket: void setRawOption(RawSocketOption option) — Customizes the RawSocket. - class SocketException implements IOException — Exception thrown when a socket operation fails. - SocketException: const SocketException(this.message, {this.osError, this.address, this.port}) — Creates a SocketException with the provided values. - SocketException: const SocketException.closed() — Creates an exception reporting that a socket was used after it was closed. - SocketException: final String message — Description of the error. - SocketException: final OSError? osError — The underlying OS error. - SocketException: final InternetAddress? address — The address of the socket giving rise to the exception. - SocketException: final int? port — The port of the socket giving rise to the exception. - SocketException: String toString() - class Stdin extends _StdStream implements Stream> — The standard input stream of the process. - Stdin: external bool get echoMode — Whether echo mode is enabled on stdin. - Stdin: external set echoMode(bool echoMode) - Stdin: external bool get echoNewlineMode — Whether echo newline mode is enabled on stdin. - Stdin: external set echoNewlineMode(bool echoNewlineMode) - Stdin: external bool get lineMode — Whether line mode is enabled on stdin. - Stdin: external set lineMode(bool lineMode) - Stdin: external bool get supportsAnsiEscapes — Whether connected to a terminal that supports ANSI escape sequences. - Stdin: bool get hasTerminal — Whether there is a terminal attached to stdin. - Stdin: String? readLineSync({Encoding encoding = systemEncoding, bool retainNewlines = false}) — Reads a line from stdin. - Stdin: external int readByteSync() — Synchronously reads a byte from stdin. - class Stdout extends _StdSink implements IOSink — An IOSink connected to either the standard out or error of the process. - Stdout: bool get hasTerminal — Whether there is a terminal attached to stdout. - Stdout: int get terminalColumns — The number of columns of the terminal. - Stdout: int get terminalLines — The number of lines of the terminal. - Stdout: bool get supportsAnsiEscapes — Whether connected to a terminal that supports ANSI escape sequences. - Stdout: IOSink get nonBlocking — A non-blocking IOSink for the same output. - class StdoutException implements IOException — Exception thrown by some operations of Stdout - StdoutException: const StdoutException(this.message, [this.osError]) - StdoutException: final String message — Message describing cause of the exception. - StdoutException: final OSError? osError — The underlying OS error, if available. - StdoutException: String toString() - class StdinException implements IOException — Exception thrown by some operations of Stdin - StdinException: const StdinException(this.message, [this.osError]) - StdinException: final String message — Message describing cause of the exception. - StdinException: final OSError? osError — The underlying OS error, if available. - StdinException: String toString() - final class StdioType — The type of object a standard IO stream can be attached to. - StdioType: static const StdioType terminal = const StdioType._("terminal") - StdioType: static const StdioType pipe = const StdioType._("pipe") - StdioType: static const StdioType file = const StdioType._("file") - StdioType: static const StdioType other = const StdioType._("other") - StdioType: final String name - StdioType: String toString() - final class SystemEncoding extends Encoding — The system encoding is the current code page on Windows and UTF-8 on Linux and Mac. - SystemEncoding: const SystemEncoding() — Creates a const SystemEncoding. - SystemEncoding: String get name - SystemEncoding: Converter> get encoder - SystemEncoding: Converter, String> get decoder - SystemEncoding: List encode(String input) - SystemEncoding: String decode(List encoded) - abstract interface class RawSynchronousSocket — A low-level class for communicating synchronously over a TCP socket. - RawSynchronousSocket: external static RawSynchronousSocket connectSync(host, int port) — Creates a new socket connection and returns a RawSynchronousSocket. - RawSynchronousSocket: int get port — The port used by this socket. - RawSynchronousSocket: int get remotePort — The remote port connected to by this socket. - RawSynchronousSocket: InternetAddress get address — The InternetAddress used to connect this socket. - RawSynchronousSocket: InternetAddress get remoteAddress — The remote InternetAddress connected to by this socket. - RawSynchronousSocket: int available() — The number of received and unread bytes in the socket that can be read. - RawSynchronousSocket: void closeSync() — Closes the RawSynchronousSocket. - RawSynchronousSocket: int readIntoSync(List buffer, [int start = 0, int? end]) — Reads bytes into an existing buffer. - RawSynchronousSocket: List? readSync(int bytes) — Reads up to bytes bytes from the socket. - RawSynchronousSocket: void shutdown(SocketDirection direction) — Shuts down a socket in the provided direction. - RawSynchronousSocket: void writeFromSync(List buffer, [int start = 0, int? end]) — Writes from a buffer to the socket. - abstract class HttpServer implements Stream — A server that delivers content, such as web pages, using the HTTP protocol. - HttpServer: factory HttpServer.listenOn(ServerSocket serverSocket) — Attaches the HTTP server to an existing ServerSocket. - HttpServer: static Future bind(address, int port, {int backlog = 0, bool v6Only = false, bool shared = false}) — Starts listening for HTTP requests on the specified address and port. - HttpServer: static Future bindSecure(address, int port, SecurityContext context, {int backlog = 0, bool v6Only = false, bool requestClientCertificate = false, bool shared = false}) — The address can either be a String or an InternetAddress. - HttpServer: String? serverHeader — Gets and sets the default value of the Server header for all responses generated by this HttpServer. - HttpServer: HttpHeaders get defaultResponseHeaders — Default set of headers added to all response objects. - HttpServer: bool autoCompress — Whether the HttpServer should compress the content, if possible. - HttpServer: Duration? idleTimeout — Gets or sets the timeout used for idle keep-alive connections. - HttpServer: int get port — The port that the server is listening on. - HttpServer: InternetAddress get address — The address that the server is listening on. - HttpServer: set sessionTimeout(int timeout) — Sets the timeout, in seconds, for sessions of this HttpServer. - HttpServer: Future close({bool force = false}) — Permanently stops this HttpServer from listening for new connections. - HttpServer: HttpConnectionsInfo connectionsInfo() — An HttpConnectionsInfo object summarizing the number of current connections handled by the server. - class HttpConnectionsInfo — Summary statistics about an HttpServers current socket connections. - HttpConnectionsInfo: int total — Total number of socket connections. - HttpConnectionsInfo: int active — Number of active connections where actual request/response processing is active. - HttpConnectionsInfo: int idle — Number of idle connections held by clients as persistent connections. - HttpConnectionsInfo: int closing — Number of connections which are preparing to close. - abstract interface class HttpHeaders — Headers for HTTP requests and responses. - HttpHeaders: static const acceptHeader = "accept" - HttpHeaders: static const acceptCharsetHeader = "accept-charset" - HttpHeaders: static const acceptEncodingHeader = "accept-encoding" - HttpHeaders: static const acceptLanguageHeader = "accept-language" - HttpHeaders: static const acceptRangesHeader = "accept-ranges" - HttpHeaders: static const accessControlAllowCredentialsHeader = 'access-control-allow-credentials' - HttpHeaders: static const accessControlAllowHeadersHeader = 'access-control-allow-headers' - HttpHeaders: static const accessControlAllowMethodsHeader = 'access-control-allow-methods' - HttpHeaders: static const accessControlAllowOriginHeader = 'access-control-allow-origin' - HttpHeaders: static const accessControlExposeHeadersHeader = 'access-control-expose-headers' - HttpHeaders: static const accessControlMaxAgeHeader = 'access-control-max-age' - HttpHeaders: static const accessControlRequestHeadersHeader = 'access-control-request-headers' - HttpHeaders: static const accessControlRequestMethodHeader = 'access-control-request-method' - HttpHeaders: static const ageHeader = "age" - HttpHeaders: static const allowHeader = "allow" - HttpHeaders: static const authorizationHeader = "authorization" - HttpHeaders: static const cacheControlHeader = "cache-control" - HttpHeaders: static const connectionHeader = "connection" - HttpHeaders: static const contentEncodingHeader = "content-encoding" - HttpHeaders: static const contentLanguageHeader = "content-language" - HttpHeaders: static const contentLengthHeader = "content-length" - HttpHeaders: static const contentLocationHeader = "content-location" - HttpHeaders: static const contentMD5Header = "content-md5" - HttpHeaders: static const contentRangeHeader = "content-range" - HttpHeaders: static const contentTypeHeader = "content-type" - HttpHeaders: static const dateHeader = "date" - HttpHeaders: static const etagHeader = "etag" - HttpHeaders: static const expectHeader = "expect" - HttpHeaders: static const expiresHeader = "expires" - HttpHeaders: static const fromHeader = "from" - HttpHeaders: static const hostHeader = "host" - HttpHeaders: static const ifMatchHeader = "if-match" - HttpHeaders: static const ifModifiedSinceHeader = "if-modified-since" - HttpHeaders: static const ifNoneMatchHeader = "if-none-match" - HttpHeaders: static const ifRangeHeader = "if-range" - HttpHeaders: static const ifUnmodifiedSinceHeader = "if-unmodified-since" - HttpHeaders: static const lastModifiedHeader = "last-modified" - HttpHeaders: static const locationHeader = "location" - HttpHeaders: static const maxForwardsHeader = "max-forwards" - HttpHeaders: static const pragmaHeader = "pragma" - HttpHeaders: static const proxyAuthenticateHeader = "proxy-authenticate" - HttpHeaders: static const proxyAuthorizationHeader = "proxy-authorization" - HttpHeaders: static const rangeHeader = "range" - HttpHeaders: static const refererHeader = "referer" - HttpHeaders: static const retryAfterHeader = "retry-after" - HttpHeaders: static const serverHeader = "server" - HttpHeaders: static const teHeader = "te" - HttpHeaders: static const trailerHeader = "trailer" - HttpHeaders: static const transferEncodingHeader = "transfer-encoding" - HttpHeaders: static const upgradeHeader = "upgrade" - HttpHeaders: static const userAgentHeader = "user-agent" - HttpHeaders: static const varyHeader = "vary" - HttpHeaders: static const viaHeader = "via" - HttpHeaders: static const warningHeader = "warning" - HttpHeaders: static const wwwAuthenticateHeader = "www-authenticate" - HttpHeaders: static const contentDisposition = "content-disposition" - HttpHeaders: static const cookieHeader = "cookie" - HttpHeaders: static const setCookieHeader = "set-cookie" - HttpHeaders: static const generalHeaders - HttpHeaders: static const entityHeaders - HttpHeaders: static const responseHeaders - HttpHeaders: static const requestHeaders - HttpHeaders: DateTime? date — The date specified by the dateHeader header, if any. - HttpHeaders: DateTime? expires — The date and time specified by the expiresHeader header, if any. - HttpHeaders: DateTime? ifModifiedSince — The date and time specified by the ifModifiedSinceHeader header, if any. - HttpHeaders: String? host — The value of the hostHeader header, if any. - HttpHeaders: int? port — The value of the port part of the hostHeader header, if any. - HttpHeaders: ContentType? contentType — The ContentType of the contentTypeHeader header, if any. - HttpHeaders: int contentLength — The value of the contentLengthHeader header, if any. - HttpHeaders: late bool persistentConnection — Whether the connection is persistent (keep-alive). - HttpHeaders: late bool chunkedTransferEncoding — Whether the connection uses chunked transfer encoding. - HttpHeaders: String? value(String name) — Convenience method for the value for a single valued header. - HttpHeaders: void add(String name, Object value, {bool preserveHeaderCase = false}) — Adds a header value. - HttpHeaders: void set(String name, Object value, {bool preserveHeaderCase = false}) — Sets the header name to value. - HttpHeaders: void remove(String name, Object value) — Removes a specific value for a header name. - HttpHeaders: void removeAll(String name) — Removes all values for the specified header name. - HttpHeaders: void forEach(void Function(String name, List values) action) — Performs the action on each header. - HttpHeaders: void noFolding(String name) — Disables folding for the header named name when sending the HTTP header. - HttpHeaders: void clear() — Removes all headers. - HttpHeaders: List? operator [](String name) — The values for the header named name. - abstract interface class HeaderValue — Representation of a header value in the form: - HeaderValue: factory HeaderValue([String value = "", Map parameters = const {}]) — Creates a new header value object setting the value and parameters. - HeaderValue: static HeaderValue parse(String value, {String parameterSeparator = ";", String? valueSeparator, bool preserveBackslash = false}) — Creates a new header value object from parsing a header value string with both value and optional parameters. - HeaderValue: String get value — The value of the header. - HeaderValue: Map get parameters — A map of parameters. - HeaderValue: String toString() — Returns the formatted string representation in the form: - abstract interface class HttpSession implements Map — The HttpRequest.session of an HttpRequest. - HttpSession: String get id — The id of the current session. - HttpSession: void set onTimeout(void Function() callback) — Sets a callback that will be called when the session is timed out. - HttpSession: bool get isNew — Whether the session has not yet been sent to the client. - HttpSession: void destroy() — Destroys the session. - abstract interface class ContentType implements HeaderValue — A MIME/IANA media type used as the value of the HttpHeaders.contentTypeHeader header. - ContentType: factory ContentType(String primaryType, String subType, {String? charset, Map parameters = const {}}) — Creates a new content type object setting the primary type and sub type. - ContentType: static final text — Content type for plain text using UTF-8 encoding. - ContentType: static final html — Content type for HTML using UTF-8 encoding. - ContentType: static final json — Content type for JSON using UTF-8 encoding. - ContentType: static final binary — Content type for binary data. - ContentType: static ContentType parse(String value) — Creates a new content type object from parsing a Content-Type header value. - ContentType: String get mimeType — Gets the MIME type and subtype, without any parameters. - ContentType: String get primaryType — Gets the primary type. - ContentType: String get subType — Gets the subtype. - ContentType: String? get charset — Gets the character set, if any. - final class SameSite — Cookie cross-site availability configuration. - SameSite: static const lax = SameSite._("Lax") — Default value, cookie with this value will generally not be sent on cross-site requests, unless the user is navigated to the original site. - SameSite: static const strict = SameSite._("Strict") — Cookie with this value will never be sent on cross-site requests. - SameSite: static const none = SameSite._("None") — Cookie with this value will be sent in all requests. - SameSite: static const List values = [lax, strict, none] - SameSite: final String name - SameSite: String toString() - abstract interface class Cookie — Representation of a cookie. - Cookie: factory Cookie(String name, String value) — Creates a new cookie setting the name and value. - Cookie: factory Cookie.fromSetCookieValue(String value) — Creates a new cookie by parsing a header value from a 'set-cookie' header. - Cookie: abstract String name — The name of the cookie. - Cookie: abstract String value — The value of the cookie. - Cookie: abstract DateTime? expires — The time at which the cookie expires. - Cookie: abstract int? maxAge — The number of seconds until the cookie expires. - Cookie: abstract String? domain — The domain that the cookie applies to. - Cookie: abstract String? path — The path within the domain that the cookie applies to. - Cookie: abstract bool secure — Whether to only send this cookie on secure connections. - Cookie: abstract bool httpOnly — Whether the cookie is only sent in the HTTP request and is not made available to client side scripts. - Cookie: abstract SameSite? sameSite — Whether the cookie is available from other sites. - Cookie: String toString() — Returns the formatted string representation of the cookie. - abstract interface class HttpRequest implements Stream — A server-side object that contains the content of and information about an HTTP request. - HttpRequest: int get contentLength — The content length of the request body. - HttpRequest: String get method — The method, such as 'GET' or 'POST', for the request. - HttpRequest: Uri get uri — The URI for the request. - HttpRequest: Uri get requestedUri — The requested URI for the request. - HttpRequest: HttpHeaders get headers — The request headers. - HttpRequest: List get cookies — The cookies in the request, from the "Cookie" headers. - HttpRequest: bool get persistentConnection — The persistent connection state signaled by the client. - HttpRequest: X509Certificate? get certificate — The client certificate of the client making the request. - HttpRequest: HttpSession get session — The session for the given request. - HttpRequest: String get protocolVersion — The HTTP protocol version used in the request, either "1.0" or "1.1". - HttpRequest: HttpConnectionInfo? get connectionInfo — Information about the client connection. - HttpRequest: HttpResponse get response — The HttpResponse object, used for sending back the response to the client. - abstract interface class HttpResponse implements IOSink — An HTTP response, which returns the headers and data from the server to the client in response to an HTTP request. - HttpResponse: int contentLength — Gets and sets the content length of the response. - HttpResponse: int statusCode — The status code of the response. - HttpResponse: late String reasonPhrase — The reason phrase for the response. - HttpResponse: late bool persistentConnection — Gets and sets the persistent connection state. - HttpResponse: Duration? deadline — Set and get the deadline for the response. - HttpResponse: bool bufferOutput — Gets or sets if the HttpResponse should buffer output. - HttpResponse: HttpHeaders get headers — Returns the response headers. - HttpResponse: List get cookies — Cookies to set in the client (in the 'set-cookie' header). - HttpResponse: HttpConnectionInfo? get connectionInfo — Gets information about the client connection. - HttpResponse: Future redirect(Uri location, {int status = HttpStatus.movedTemporarily}) — Respond with a redirect to location. - HttpResponse: Future detachSocket({bool writeHeaders = true}) — Detaches the underlying socket from the HTTP server. - abstract interface class HttpClient — An HTTP client for communicating with an HTTP server. - HttpClient: factory HttpClient({SecurityContext? context}) - HttpClient: static const int defaultHttpPort = 80 - HttpClient: static const int defaultHttpsPort = 443 - HttpClient: static set enableTimelineLogging(bool value) — Enable logging of HTTP requests from all HttpClients to the developer timeline. - HttpClient: static bool get enableTimelineLogging — Current state of HTTP request logging from all HttpClients to the developer timeline. - HttpClient: static String findProxyFromEnvironment(Uri url, {Map? environment}) — Function for resolving the proxy server to be used for an HTTP connection from the proxy configuration specified through environment variables. - HttpClient: Duration idleTimeout — Gets and sets the idle timeout of non-active persistent (keep-alive) connections. - HttpClient: Duration? connectionTimeout — Gets and sets the connection timeout. - HttpClient: int? maxConnectionsPerHost — Gets and sets the maximum number of live connections, to a single host. - HttpClient: bool autoUncompress — Gets and sets whether the body of a response will be automatically uncompressed. - HttpClient: String? userAgent — Gets and sets the default value of the User-Agent header for all requests generated by this HttpClient. - HttpClient: void set authenticate(Future Function(Uri url, String scheme, String? realm)? f) — Sets the function to be called when a site is requesting authentication. - HttpClient: void set connectionFactory(Future> Function(Uri url, String? proxyHost, int? proxyPort)? f) — Sets the function used to create socket connections. - HttpClient: void set findProxy(String Function(Uri url)? f) — Sets the function used to resolve the proxy server to be used for opening an HTTP connection to the specified url. - HttpClient: void set authenticateProxy(Future Function(String host, int port, String scheme, String? realm)? f) — Sets the function to be called when a proxy is requesting authentication. - HttpClient: void set badCertificateCallback(bool Function(X509Certificate cert, String host, int port)? callback) — Sets a callback that will decide whether to accept a secure connection with a server certificate that cannot be authenticated by any of our trusted root certificates. - HttpClient: void set keyLog(Function(String line)? callback) — Sets a callback that will be called when new TLS keys are exchanged with the server. - HttpClient: Future open(String method, String host, int port, String path) — Opens an HTTP connection. - HttpClient: Future openUrl(String method, Uri url) — Opens an HTTP connection. - HttpClient: Future get(String host, int port, String path) — Opens an HTTP connection using the GET method. - HttpClient: Future getUrl(Uri url) — Opens an HTTP connection using the GET method. - HttpClient: Future post(String host, int port, String path) — Opens an HTTP connection using the POST method. - HttpClient: Future postUrl(Uri url) — Opens an HTTP connection using the POST method. - HttpClient: Future put(String host, int port, String path) — Opens an HTTP connection using the PUT method. - HttpClient: Future putUrl(Uri url) — Opens an HTTP connection using the PUT method. - HttpClient: Future delete(String host, int port, String path) — Opens an HTTP connection using the DELETE method. - HttpClient: Future deleteUrl(Uri url) — Opens an HTTP connection using the DELETE method. - HttpClient: Future patch(String host, int port, String path) — Opens an HTTP connection using the PATCH method. - HttpClient: Future patchUrl(Uri url) — Opens an HTTP connection using the PATCH method. - HttpClient: Future head(String host, int port, String path) — Opens an HTTP connection using the HEAD method. - HttpClient: Future headUrl(Uri url) — Opens an HTTP connection using the HEAD method. - HttpClient: void addCredentials(Uri url, String realm, HttpClientCredentials credentials) — Add credentials to be used for authorizing HTTP requests. - HttpClient: void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) — Add credentials to be used for authorizing HTTP proxies. - HttpClient: void close({bool force = false}) — Shuts down the HTTP client. - abstract interface class HttpClientRequest implements IOSink — HTTP request for a client connection. - HttpClientRequest: bool persistentConnection — The requested persistent connection state. - HttpClientRequest: bool followRedirects — Whether to follow redirects automatically. - HttpClientRequest: int maxRedirects — Set this property to the maximum number of redirects to follow when followRedirects is true. - HttpClientRequest: String get method — The method of the request. - HttpClientRequest: Uri get uri — The uri of the request. - HttpClientRequest: int contentLength — Gets and sets the content length of the request. - HttpClientRequest: bool bufferOutput — Gets or sets if the HttpClientRequest should buffer output. - HttpClientRequest: HttpHeaders get headers — Returns the client request headers. - HttpClientRequest: List get cookies — Cookies to present to the server (in the 'cookie' header). - HttpClientRequest: Future get done — An HttpClientResponse future that will complete once the response is available. - HttpClientRequest: HttpConnectionInfo? get connectionInfo — Gets information about the client connection. - HttpClientRequest: Future close() — Close the request for input. - HttpClientRequest: void abort([Object? exception, StackTrace? stackTrace]) — Aborts the client connection. - abstract interface class HttpClientResponse implements Stream> — HTTP response for a client connection. - HttpClientResponse: int get statusCode — Returns the status code. - HttpClientResponse: String get reasonPhrase — Returns the reason phrase associated with the status code. - HttpClientResponse: int get contentLength — Returns the content length of the response body. - HttpClientResponse: HttpClientResponseCompressionState get compressionState — The compression state of the response. - HttpClientResponse: bool get persistentConnection — Gets the persistent connection state returned by the server. - HttpClientResponse: bool get isRedirect — Returns whether the status code is one of the normal redirect codes HttpStatus.movedPermanently, HttpStatus.found, HttpStatus.movedTemporarily, HttpStatus.seeOther and HttpStatus.temporaryRedirect. - HttpClientResponse: List get redirects — Returns the series of redirects this connection has been through. - HttpClientResponse: HttpHeaders get headers — Returns the client response headers. - HttpClientResponse: List get cookies — Cookies set by the server (from the 'set-cookie' header). - HttpClientResponse: X509Certificate? get certificate — Returns the certificate of the HTTPS server providing the response. - HttpClientResponse: HttpConnectionInfo? get connectionInfo — Gets information about the client connection. - HttpClientResponse: Future redirect([String? method, Uri? url, bool? followLoops]) — Redirects this connection to a new URL. - HttpClientResponse: Future detachSocket() — Detach the underlying socket from the HTTP client. - enum HttpClientResponseCompressionState — Enum that specifies the compression state of the byte stream of an HttpClientResponse. - HttpClientResponseCompressionState: notCompressed — The body of the HTTP response was received and remains in an uncompressed state. - HttpClientResponseCompressionState: decompressed — The body of the HTTP response was originally compressed, but by virtue of the HttpClient.autoUncompress configuration option, it has been automatically uncompressed. - HttpClientResponseCompressionState: compressed — The body of the HTTP response contains compressed bytes. - abstract interface class HttpClientCredentials — Represents credentials for authentication in HttpClient. - abstract final class HttpClientBasicCredentials implements HttpClientCredentials — Represents credentials for basic authentication. - HttpClientBasicCredentials: factory HttpClientBasicCredentials(String username, String password) - abstract final class HttpClientBearerCredentials implements HttpClientCredentials — Represents credentials for bearer token authentication. - HttpClientBearerCredentials: factory HttpClientBearerCredentials(String token) - abstract final class HttpClientDigestCredentials implements HttpClientCredentials — Represents credentials for digest authentication. - HttpClientDigestCredentials: factory HttpClientDigestCredentials(String username, String password) - abstract interface class HttpConnectionInfo — Information about an HttpRequest, HttpResponse, HttpClientRequest, or HttpClientResponse connection. - HttpConnectionInfo: InternetAddress get remoteAddress - HttpConnectionInfo: int get remotePort - HttpConnectionInfo: int get localPort - abstract interface class RedirectInfo — Redirect information. - RedirectInfo: int get statusCode — Returns the status code used for the redirect. - RedirectInfo: String get method — Returns the method used for the redirect. - RedirectInfo: Uri get location — Returns the location for the redirect. - class HttpException implements IOException - HttpException: const HttpException(this.message, {this.uri}) - HttpException: final String message - HttpException: final Uri? uri - HttpException: String toString() - class RedirectException implements HttpException - RedirectException: const RedirectException(this.message, this.redirects) - RedirectException: final String message - RedirectException: final List redirects - RedirectException: Uri? get uri - RedirectException: String toString() - class HttpDate — Utility functions for working with dates with HTTP specific date formats. - HttpDate: static String format(DateTime date) — Format a date according to RFC-1123, e.g. - HttpDate: static DateTime parse(String date) — Parse a date string in either of the formats RFC-1123, RFC-850 or ANSI C's asctime format. - abstract class HttpOverrides — This class facilitates overriding HttpClient with a mock implementation. - HttpOverrides: static HttpOverrides? get current - HttpOverrides: static set global(HttpOverrides? overrides) — The HttpOverrides to use in the root Zone. - HttpOverrides: static R runZoned(R Function() body, {HttpClient Function(SecurityContext?)? createHttpClient, String Function(Uri uri, Map? environment)? findProxyFromEnvironment}) — Runs body in a fresh Zone using the provided overrides. - HttpOverrides: static R runWithHttpOverrides(R Function() body, HttpOverrides overrides) — Runs body in a fresh Zone using the overrides found in overrides. - HttpOverrides: HttpClient createHttpClient(SecurityContext? context) — Returns a new HttpClient using the given context. - HttpOverrides: String findProxyFromEnvironment(Uri url, Map? environment) — Resolves the proxy server to be used for HTTP connections. - abstract class WebSocketStatus — WebSocket status codes used when closing a WebSocket connection. - WebSocketStatus: static const int normalClosure = 1000 - WebSocketStatus: static const int goingAway = 1001 - WebSocketStatus: static const int protocolError = 1002 - WebSocketStatus: static const int unsupportedData = 1003 - WebSocketStatus: static const int reserved1004 = 1004 - WebSocketStatus: static const int noStatusReceived = 1005 - WebSocketStatus: static const int abnormalClosure = 1006 - WebSocketStatus: static const int invalidFramePayloadData = 1007 - WebSocketStatus: static const int policyViolation = 1008 - WebSocketStatus: static const int messageTooBig = 1009 - WebSocketStatus: static const int missingMandatoryExtension = 1010 - WebSocketStatus: static const int internalServerError = 1011 - WebSocketStatus: static const int reserved1015 = 1015 - class CompressionOptions — Options controlling compression in a WebSocket. - CompressionOptions: const CompressionOptions({this.clientNoContextTakeover = false, this.serverNoContextTakeover = false, this.clientMaxWindowBits, this.serverMaxWindowBits, this.enabled = true}) - CompressionOptions: static const CompressionOptions compressionDefault = CompressionOptions() — Default WebSocket compression configuration. - CompressionOptions: static const CompressionOptions compressionOff = CompressionOptions(enabled: false) — No-compression configuration. - CompressionOptions: final bool clientNoContextTakeover — Whether the client will reuse its compression instances. - CompressionOptions: final bool serverNoContextTakeover — Whether the server will reuse its compression instances. - CompressionOptions: final int? clientMaxWindowBits — The maximal window size bit count requested by the client. - CompressionOptions: final int? serverMaxWindowBits — The maximal window size bit count requested by the server. - CompressionOptions: final bool enabled — Whether WebSocket compression is enabled. - abstract class WebSocketTransformer implements StreamTransformer — The WebSocketTransformer provides the ability to upgrade a HttpRequest to a WebSocket connection. - WebSocketTransformer: factory WebSocketTransformer({Function(List protocols)? protocolSelector, CompressionOptions compression = CompressionOptions.compressionDefault, int maxPayloadLength = _kDefaultWebSocketMaxPayloadLength}) — Create a new WebSocketTransformer. - WebSocketTransformer: static Future upgrade(HttpRequest request, {Function(List protocols)? protocolSelector, CompressionOptions compression = CompressionOptions.compressionDefault, int maxPayloadLength = _kDefaultWebSocketMaxPayloadLength}) — Upgrades an HttpRequest to a WebSocket connection. - WebSocketTransformer: static bool isUpgradeRequest(HttpRequest request) — Checks whether the request is a valid WebSocket upgrade request. - abstract class WebSocket implements Stream, StreamSink — A two-way HTTP communication object for client or server applications. - WebSocket: WebSocket() - WebSocket: factory WebSocket.fromUpgradedSocket(Socket socket, {String? protocol, bool? serverSide, CompressionOptions compression = CompressionOptions.compressionDefault, int maxPayloadLength = _kDefaultWebSocketMaxPayloadLength}) — Creates a WebSocket from an already-upgraded socket. - WebSocket: static const int connecting = 0 — Possible states of the connection. - WebSocket: static const int open = 1 - WebSocket: static const int closing = 2 - WebSocket: static const int closed = 3 - WebSocket: static Future connect(String url, {Iterable? protocols, Map? headers, CompressionOptions compression = CompressionOptions.compressionDefault, HttpClient? customClient, int maxPayloadLength = _kDefaultWebSocketMaxPayloadLength}) — Create a new WebSocket connection. - WebSocket: static String? get userAgent — Gets the user agent used for WebSocket connections. - WebSocket: static set userAgent(String? userAgent) — Sets the user agent to use for WebSocket connections. - WebSocket: Duration? pingInterval — The interval between ping signals. - WebSocket: int get readyState — Returns the current state of the connection. - WebSocket: String get extensions — The extensions property is initially the empty string. - WebSocket: String? get protocol — The protocol property is initially the empty string. - WebSocket: int? get closeCode — The close code set when the WebSocket connection is closed. - WebSocket: String? get closeReason — The close reason set when the WebSocket connection is closed. - WebSocket: Future close([int? code, String? reason]) — Closes the WebSocket connection. - WebSocket: void add(data) — Sends data on the WebSocket connection. - WebSocket: void addError(Object error, [StackTrace? stackTrace]) — Reports an error on this WebSocket. - WebSocket: Future addStream(Stream stream) — Sends data from a stream on WebSocket connection. - WebSocket: void addUtf8Text(List bytes) — Sends a text message with the text represented by bytes. - class WebSocketException implements IOException - WebSocketException: const WebSocketException([this.message = "", this.httpStatusCode]) - WebSocketException: final String message - WebSocketException: final int? httpStatusCode - WebSocketException: String toString() - abstract interface class BytesBuilder — Builds a list of bytes, allowing bytes and lists of bytes to be added at the end. - BytesBuilder: factory BytesBuilder({bool copy = true}) — Construct a new empty BytesBuilder. - BytesBuilder: int get length — The number of bytes in this builder. - BytesBuilder: bool get isEmpty — Whether the buffer is empty. - BytesBuilder: bool get isNotEmpty — Whether the buffer is non-empty. - BytesBuilder: void add(List bytes) — Appends bytes to the current contents of this builder. - BytesBuilder: void addByte(int byte) — Appends byte to the current contents of this builder. - BytesBuilder: Uint8List takeBytes() — Returns the bytes currently contained in this builder and clears it. - BytesBuilder: Uint8List toBytes() — Returns a copy of the current byte contents of this builder. - BytesBuilder: void clear() — Clears the contents of this builder. - abstract class HttpStatus — HTTP status codes. - HttpStatus: static const int continue_ = 100 - HttpStatus: static const int switchingProtocols = 101 - HttpStatus: static const int processing = 102 - HttpStatus: static const int ok = 200 - HttpStatus: static const int created = 201 - HttpStatus: static const int accepted = 202 - HttpStatus: static const int nonAuthoritativeInformation = 203 - HttpStatus: static const int noContent = 204 - HttpStatus: static const int resetContent = 205 - HttpStatus: static const int partialContent = 206 - HttpStatus: static const int multiStatus = 207 - HttpStatus: static const int alreadyReported = 208 - HttpStatus: static const int imUsed = 226 - HttpStatus: static const int multipleChoices = 300 - HttpStatus: static const int movedPermanently = 301 - HttpStatus: static const int found = 302 - HttpStatus: static const int movedTemporarily = 302 - HttpStatus: static const int seeOther = 303 - HttpStatus: static const int notModified = 304 - HttpStatus: static const int useProxy = 305 - HttpStatus: static const int temporaryRedirect = 307 - HttpStatus: static const int permanentRedirect = 308 - HttpStatus: static const int badRequest = 400 - HttpStatus: static const int unauthorized = 401 - HttpStatus: static const int paymentRequired = 402 - HttpStatus: static const int forbidden = 403 - HttpStatus: static const int notFound = 404 - HttpStatus: static const int methodNotAllowed = 405 - HttpStatus: static const int notAcceptable = 406 - HttpStatus: static const int proxyAuthenticationRequired = 407 - HttpStatus: static const int requestTimeout = 408 - HttpStatus: static const int conflict = 409 - HttpStatus: static const int gone = 410 - HttpStatus: static const int lengthRequired = 411 - HttpStatus: static const int preconditionFailed = 412 - HttpStatus: static const int requestEntityTooLarge = 413 - HttpStatus: static const int requestUriTooLong = 414 - HttpStatus: static const int unsupportedMediaType = 415 - HttpStatus: static const int requestedRangeNotSatisfiable = 416 - HttpStatus: static const int expectationFailed = 417 - HttpStatus: static const int misdirectedRequest = 421 - HttpStatus: static const int unprocessableEntity = 422 - HttpStatus: static const int locked = 423 - HttpStatus: static const int failedDependency = 424 - HttpStatus: static const int upgradeRequired = 426 - HttpStatus: static const int preconditionRequired = 428 - HttpStatus: static const int tooManyRequests = 429 - HttpStatus: static const int requestHeaderFieldsTooLarge = 431 - HttpStatus: static const int connectionClosedWithoutResponse = 444 - HttpStatus: static const int unavailableForLegalReasons = 451 - HttpStatus: static const int clientClosedRequest = 499 - HttpStatus: static const int internalServerError = 500 - HttpStatus: static const int notImplemented = 501 - HttpStatus: static const int badGateway = 502 - HttpStatus: static const int serviceUnavailable = 503 - HttpStatus: static const int gatewayTimeout = 504 - HttpStatus: static const int httpVersionNotSupported = 505 - HttpStatus: static const int variantAlsoNegotiates = 506 - HttpStatus: static const int insufficientStorage = 507 - HttpStatus: static const int loopDetected = 508 - HttpStatus: static const int notExtended = 510 - HttpStatus: static const int networkAuthenticationRequired = 511 - HttpStatus: static const int networkConnectTimeoutError = 599 - HttpStatus: static const int CONTINUE = continue_ - HttpStatus: static const int SWITCHING_PROTOCOLS = switchingProtocols - HttpStatus: static const int OK = ok - HttpStatus: static const int CREATED = created - HttpStatus: static const int ACCEPTED = accepted - HttpStatus: static const int NON_AUTHORITATIVE_INFORMATION = nonAuthoritativeInformation - HttpStatus: static const int NO_CONTENT = noContent - HttpStatus: static const int RESET_CONTENT = resetContent - HttpStatus: static const int PARTIAL_CONTENT = partialContent - HttpStatus: static const int MULTIPLE_CHOICES = multipleChoices - HttpStatus: static const int MOVED_PERMANENTLY = movedPermanently - HttpStatus: static const int FOUND = found - HttpStatus: static const int MOVED_TEMPORARILY = movedTemporarily - HttpStatus: static const int SEE_OTHER = seeOther - HttpStatus: static const int NOT_MODIFIED = notModified - HttpStatus: static const int USE_PROXY = useProxy - HttpStatus: static const int TEMPORARY_REDIRECT = temporaryRedirect - HttpStatus: static const int BAD_REQUEST = badRequest - HttpStatus: static const int UNAUTHORIZED = unauthorized - HttpStatus: static const int PAYMENT_REQUIRED = paymentRequired - HttpStatus: static const int FORBIDDEN = forbidden - HttpStatus: static const int NOT_FOUND = notFound - HttpStatus: static const int METHOD_NOT_ALLOWED = methodNotAllowed - HttpStatus: static const int NOT_ACCEPTABLE = notAcceptable - HttpStatus: static const int PROXY_AUTHENTICATION_REQUIRED = proxyAuthenticationRequired - HttpStatus: static const int REQUEST_TIMEOUT = requestTimeout - HttpStatus: static const int CONFLICT = conflict - HttpStatus: static const int GONE = gone - HttpStatus: static const int LENGTH_REQUIRED = lengthRequired - HttpStatus: static const int PRECONDITION_FAILED = preconditionFailed - HttpStatus: static const int REQUEST_ENTITY_TOO_LARGE = requestEntityTooLarge - HttpStatus: static const int REQUEST_URI_TOO_LONG = requestUriTooLong - HttpStatus: static const int UNSUPPORTED_MEDIA_TYPE = unsupportedMediaType - HttpStatus: static const int REQUESTED_RANGE_NOT_SATISFIABLE = requestedRangeNotSatisfiable - HttpStatus: static const int EXPECTATION_FAILED = expectationFailed - HttpStatus: static const int UPGRADE_REQUIRED = upgradeRequired - HttpStatus: static const int INTERNAL_SERVER_ERROR = internalServerError - HttpStatus: static const int NOT_IMPLEMENTED = notImplemented - HttpStatus: static const int BAD_GATEWAY = badGateway - HttpStatus: static const int SERVICE_UNAVAILABLE = serviceUnavailable - HttpStatus: static const int GATEWAY_TIMEOUT = gatewayTimeout - HttpStatus: static const int HTTP_VERSION_NOT_SUPPORTED = httpVersionNotSupported - HttpStatus: static const int NETWORK_CONNECT_TIMEOUT_ERROR = networkConnectTimeoutError ### Calling C (FFI) (raya:ffi) import 'raya:ffi'; Pointers, native types, structs and unions, dynamic libraries, callbacks and native memory. https://riptidecompute.com/raya/docs/core-ffi - external int sizeOf() — Number of bytes used by native type T. - final Pointer nullptr — Represents a pointer into the native C memory corresponding to 'NULL', e.g. a pointer with address 0. - typedef Dart_NativeMessageHandler = Void Function(Int64, Pointer) - typedef NativeFinalizerFunction = NativeFunction token)> — The native function type for NativeFinalizers. - final class Pointer implements SizedNativeType — Represents a pointer into the native C memory. - Pointer: external factory Pointer.fromAddress(int ptr) — Construction from raw integer. - Pointer: external static Pointer> fromFunction(@DartRepresentationOf('T') Function f, [Object? exceptionalReturn]) — Convert Raya function to a C function pointer, automatically marshalling the arguments and return value - Pointer: external int get address — Access to the raw pointer value. - Pointer: int get hashCode — The hash code for a Pointer only depends on its address. - Pointer: external Pointer cast() — Reinterprets the address of this pointer as the address of a U. - Pointer: bool operator ==(Object other) — Equality for Pointers only depends on their address. - final class Array extends _Compound — A fixed-sized array of Ts. - Array: const factory Array(int dimension1, [int dimension2, int dimension3, int dimension4, int dimension5]) = _ArraySize — Annotation to specify Array dimensions in Structs. - Array: const factory Array.multi(List dimensions) = _ArraySize.multi — Annotation to specify Array dimensions in Structs. - Array: const factory Array.variable([int dimension2, int dimension3, int dimension4, int dimension5]) = _ArraySize.variable — Annotation to specify a variable length Array in Structs. - Array: const factory Array.variableWithVariableDimension([int dimension1, int dimension2, int dimension3, int dimension4, int dimension5]) = _ArraySize.variableWithVariableDimension — Annotation to specify a variable length Array with a configurable variable dimension (dimension1) in Structs. - Array: const factory Array.variableMulti(List dimensions, {@Since('3.7') int variableDimension}) = _ArraySize.variableMulti — Annotation to a variable length Array in Structs. - extension NativeFunctionPointer on Pointer> — Extension on Pointer specialized for the type argument NativeFunction. - NativeFunctionPointer: external DF asFunction<@DartRepresentationOf('NF') DF extends Function>({bool isLeaf = false}) — Convert to Raya function, automatically marshalling the arguments and return value. - abstract final class NativeCallable — A native callable which listens for calls to a native function. - NativeCallable: factory NativeCallable.isolateLocal(@DartRepresentationOf("T") Function callback, {Object? exceptionalReturn}) — Constructs a NativeCallable that must be invoked from the same thread that created it. - NativeCallable: factory NativeCallable.isolateGroupBound(@DartRepresentationOf("T") Function callback, {Object? exceptionalReturn}) — Constructs a NativeCallable that can be invoked from any thread. - NativeCallable: factory NativeCallable.listener(@DartRepresentationOf("T") Function callback) — Constructs a NativeCallable that can be invoked from any thread. - NativeCallable: Pointer> get nativeFunction — The native function pointer which can be used to invoke the callback passed to the constructor. - NativeCallable: external bool get keepIsolateAlive — Whether this NativeCallable keeps its Isolate alive. - NativeCallable: external set keepIsolateAlive(bool value) - NativeCallable: void close() — Closes this callback and releases its resources. - extension Int8Pointer on Pointer — Extension on Pointer specialized for the type argument Int8. - Int8Pointer: external int get value — The 8-bit two's complement integer at address. - Int8Pointer: external void set value(int value) - Int8Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Int8Pointer: external Int8List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Int8Pointer: external int operator [](int index) — The 8-bit two's complement integer at address + sizeOf * index. - Int8Pointer: external void operator []=(int index, int value) — The 8-bit two's complement integer at address + sizeOf * index. - Int8Pointer: Pointer operator +(int offset) — A pointer to the offsetth Int8 after this one. - Int8Pointer: Pointer operator -(int offset) — A pointer to the offsetth Int8 before this one. - extension Int16Pointer on Pointer — Extension on Pointer specialized for the type argument Int16. - Int16Pointer: external int get value — The 16-bit two's complement integer at address. - Int16Pointer: external void set value(int value) - Int16Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Int16Pointer: external Int16List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Int16Pointer: external int operator [](int index) — The 16-bit two's complement integer at address + sizeOf * index. - Int16Pointer: external void operator []=(int index, int value) — The 16-bit two's complement integer at address + sizeOf * index. - Int16Pointer: Pointer operator +(int offset) — A pointer to the offsetth Int16 after this one. - Int16Pointer: Pointer operator -(int offset) — A pointer to the offsetth Int16 before this one. - extension Int32Pointer on Pointer — Extension on Pointer specialized for the type argument Int32. - Int32Pointer: external int get value — The 32-bit two's complement integer at address. - Int32Pointer: external void set value(int value) - Int32Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Int32Pointer: external Int32List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Int32Pointer: external int operator [](int index) — The 32-bit two's complement integer at address + sizeOf * index. - Int32Pointer: external void operator []=(int index, int value) — The 32-bit two's complement integer at address + sizeOf * index. - Int32Pointer: Pointer operator +(int offset) — A pointer to the offsetth Int32 after this one. - Int32Pointer: Pointer operator -(int offset) — A pointer to the offsetth Int32 before this one. - extension Int64Pointer on Pointer — Extension on Pointer specialized for the type argument Int64. - Int64Pointer: external int get value — The 64-bit two's complement integer at address. - Int64Pointer: external void set value(int value) - Int64Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Int64Pointer: external Int64List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Int64Pointer: external int operator [](int index) — The 64-bit two's complement integer at address + sizeOf * index. - Int64Pointer: external void operator []=(int index, int value) — The 64-bit two's complement integer at address + sizeOf * index. - Int64Pointer: Pointer operator +(int offset) — A pointer to the offsetth Int64 after this one. - Int64Pointer: Pointer operator -(int offset) — A pointer to the offsetth Int64 before this one. - extension Uint8Pointer on Pointer — Extension on Pointer specialized for the type argument Uint8. - Uint8Pointer: external int get value — The 8-bit unsigned integer at address. - Uint8Pointer: external void set value(int value) - Uint8Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Uint8Pointer: external Uint8List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Uint8Pointer: external int operator [](int index) — The 8-bit unsigned integer at address + sizeOf * index. - Uint8Pointer: external void operator []=(int index, int value) — The 8-bit unsigned integer at address + sizeOf * index. - Uint8Pointer: Pointer operator +(int offset) — A pointer to the offsetth Uint8 after this one. - Uint8Pointer: Pointer operator -(int offset) — A pointer to the offsetth Uint8 before this one. - extension Uint16Pointer on Pointer — Extension on Pointer specialized for the type argument Uint16. - Uint16Pointer: external int get value — The 16-bit unsigned integer at address. - Uint16Pointer: external void set value(int value) - Uint16Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Uint16Pointer: external Uint16List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Uint16Pointer: external int operator [](int index) — The 16-bit unsigned integer at address + sizeOf * index. - Uint16Pointer: external void operator []=(int index, int value) — The 16-bit unsigned integer at address + sizeOf * index. - Uint16Pointer: Pointer operator +(int offset) — A pointer to the offsetth Uint16 after this one. - Uint16Pointer: Pointer operator -(int offset) — A pointer to the offsetth Uint16 before this one. - extension Uint32Pointer on Pointer — Extension on Pointer specialized for the type argument Uint32. - Uint32Pointer: external int get value — The 32-bit unsigned integer at address. - Uint32Pointer: external void set value(int value) - Uint32Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Uint32Pointer: external Uint32List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Uint32Pointer: external int operator [](int index) — The 32-bit unsigned integer at address + sizeOf * index. - Uint32Pointer: external void operator []=(int index, int value) — The 32-bit unsigned integer at address + sizeOf * index. - Uint32Pointer: Pointer operator +(int offset) — A pointer to the offsetth Uint32 after this one. - Uint32Pointer: Pointer operator -(int offset) — A pointer to the offsetth Uint32 before this one. - extension Uint64Pointer on Pointer — Extension on Pointer specialized for the type argument Uint64. - Uint64Pointer: external int get value — The 64-bit unsigned integer at address. - Uint64Pointer: external void set value(int value) - Uint64Pointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - Uint64Pointer: external Uint64List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - Uint64Pointer: external int operator [](int index) — The 64-bit unsigned integer at address + sizeOf * index. - Uint64Pointer: external void operator []=(int index, int value) — The 64-bit unsigned integer at address + sizeOf * index. - Uint64Pointer: Pointer operator +(int offset) — A pointer to the offsetth Uint64 after this one. - Uint64Pointer: Pointer operator -(int offset) — A pointer to the offsetth Uint64 before this one. - extension FloatPointer on Pointer — Extension on Pointer specialized for the type argument Float. - FloatPointer: external double get value — The float at address. - FloatPointer: external void set value(double value) - FloatPointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - FloatPointer: external Float32List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - FloatPointer: external double operator [](int index) — The float at address + sizeOf * index. - FloatPointer: external void operator []=(int index, double value) — The float at address + sizeOf * index. - FloatPointer: Pointer operator +(int offset) — A pointer to the offsetth Float after this one. - FloatPointer: Pointer operator -(int offset) — A pointer to the offsetth Float before this one. - extension DoublePointer on Pointer — Extension on Pointer specialized for the type argument Double. - DoublePointer: external double get value — The double at address. - DoublePointer: external void set value(double value) - DoublePointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - DoublePointer: external Float64List asTypedList(int length, {@Since('3.1') Pointer? finalizer, @Since('3.1') Pointer? token}) — Creates a typed list view backed by memory in the address space. - DoublePointer: external double operator [](int index) — The double at address + sizeOf * index. - DoublePointer: external void operator []=(int index, double value) — The double at address + sizeOf * index. - DoublePointer: Pointer operator +(int offset) — A pointer to the offsetth Double after this one. - DoublePointer: Pointer operator -(int offset) — A pointer to the offsetth Double before this one. - extension BoolPointer on Pointer — Extension on Pointer specialized for the type argument Bool. - BoolPointer: external bool get value — The bool at address. - BoolPointer: external void set value(bool value) - BoolPointer: Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - BoolPointer: external bool operator [](int index) — The bool at address + sizeOf * index. - BoolPointer: external void operator []=(int index, bool value) — The bool at address + sizeOf * index. - BoolPointer: Pointer operator +(int offset) — A pointer to the offsetth Bool after this one. - BoolPointer: Pointer operator -(int offset) — A pointer to the offsetth Bool before this one. - extension Int8Array on Array — Bounds checking indexing methods on Arrays of Int8. - Int8Array: external Int8List get elements — A list view of the bytes of this array. - Int8Array: external int operator [](int index) — Loads a Raya value from this array at index. - Int8Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Int16Array on Array — Bounds checking indexing methods on Arrays of Int16. - Int16Array: external Int16List get elements — A list view of the bytes of this array. - Int16Array: external int operator [](int index) — Loads a Raya value from this array at index. - Int16Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Int32Array on Array — Bounds checking indexing methods on Arrays of Int32. - Int32Array: external Int32List get elements — A list view of the bytes of this array. - Int32Array: external int operator [](int index) — Loads a Raya value from this array at index. - Int32Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Int64Array on Array — Bounds checking indexing methods on Arrays of Int64. - Int64Array: external Int64List get elements — A list view of the bytes of this array. - Int64Array: external int operator [](int index) — Loads a Raya value from this array at index. - Int64Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Uint8Array on Array — Bounds checking indexing methods on Arrays of Uint8. - Uint8Array: external Uint8List get elements — A list view of the bytes of this array. - Uint8Array: external int operator [](int index) — Loads a Raya value from this array at index. - Uint8Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Uint16Array on Array — Bounds checking indexing methods on Arrays of Uint16. - Uint16Array: external Uint16List get elements — A list view of the bytes of this array. - Uint16Array: external int operator [](int index) — Loads a Raya value from this array at index. - Uint16Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Uint32Array on Array — Bounds checking indexing methods on Arrays of Uint32. - Uint32Array: external Uint32List get elements — A list view of the bytes of this array. - Uint32Array: external int operator [](int index) — Loads a Raya value from this array at index. - Uint32Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension Uint64Array on Array — Bounds checking indexing methods on Arrays of Uint64. - Uint64Array: external Uint64List get elements — A list view of the bytes of this array. - Uint64Array: external int operator [](int index) — Loads a Raya value from this array at index. - Uint64Array: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension FloatArray on Array — Bounds checking indexing methods on Arrays of Float. - FloatArray: external Float32List get elements — A list view of the bytes of this array. - FloatArray: external double operator [](int index) — Loads a Raya value from this array at index. - FloatArray: external void operator []=(int index, double value) — Stores a Raya value in this array at index. - extension DoubleArray on Array — Bounds checking indexing methods on Arrays of Double. - DoubleArray: external Float64List get elements — A list view of the bytes of this array. - DoubleArray: external double operator [](int index) — Loads a Raya value from this array at index. - DoubleArray: external void operator []=(int index, double value) — Stores a Raya value in this array at index. - extension BoolArray on Array — Bounds checking indexing methods on Arrays of Bool. - BoolArray: external List get elements — A list view of the bytes of this array. - BoolArray: external bool operator [](int index) — Loads a Raya value from this array at index. - BoolArray: external void operator []=(int index, bool value) — Stores a Raya value in this array at index. - extension Int8ListAddress on Int8List - Int8ListAddress: external Pointer get address — The memory address of the underlying data. - extension Int16ListAddress on Int16List - Int16ListAddress: external Pointer get address — The memory address of the underlying data. - extension Int32ListAddress on Int32List - Int32ListAddress: external Pointer get address — The memory address of the underlying data. - extension Int64ListAddress on Int64List - Int64ListAddress: external Pointer get address — The memory address of the underlying data. - extension Uint8ListAddress on Uint8List - Uint8ListAddress: external Pointer get address — The memory address of the underlying data. - extension Uint16ListAddress on Uint16List - Uint16ListAddress: external Pointer get address — The memory address of the underlying data. - extension Uint32ListAddress on Uint32List - Uint32ListAddress: external Pointer get address — The memory address of the underlying data. - extension Uint64ListAddress on Uint64List - Uint64ListAddress: external Pointer get address — The memory address of the underlying data. - extension Float32ListAddress on Float32List - Float32ListAddress: external Pointer get address — The memory address of the underlying data. - extension Float64ListAddress on Float64List - Float64ListAddress: external Pointer get address — The memory address of the underlying data. - extension PointerPointer on Pointer> — Extension on Pointer specialized for the type argument Pointer. - PointerPointer: external Pointer get value — The pointer at address. - PointerPointer: external void set value(Pointer value) - PointerPointer: external Pointer> elementAt(int index) — Pointer arithmetic (takes element size into account). - PointerPointer: external Pointer operator [](int index) — Load a Raya value from this location offset by index. - PointerPointer: external void operator []=(int index, Pointer value) — Store a Raya value into this location offset by index. - PointerPointer: external Pointer> operator +(int offset) — A pointer to the offsetth Pointer after this one. - PointerPointer: external Pointer> operator -(int offset) — A pointer to the offsetth Pointer before this one. - extension StructPointer on Pointer — Extension on Pointer specialized for the type argument Struct. - StructPointer: external T get ref — A Raya view of the struct referenced by this pointer. - StructPointer: external set ref(T value) - StructPointer: external T refWithFinalizer(Pointer finalizer, {Pointer? token}) — A Raya view of the struct referenced by this pointer. - StructPointer: external Pointer elementAt(int index) — Pointer arithmetic (takes element size into account) - StructPointer: external T operator [](int index) — Creates a reference to access the fields of this struct backed by native memory at address + sizeOf * index. - StructPointer: external void operator []=(int index, T value) — Copies the value struct into native memory, starting at address * sizeOf * index. - StructPointer: external Pointer operator +(int offset) — A pointer to the offsetth T after this one. - StructPointer: external Pointer operator -(int offset) — A pointer to the offsetth T before this one. - extension UnionPointer on Pointer — Extension on Pointer specialized for the type argument Union. - UnionPointer: external T get ref — A Raya view of the union referenced by this pointer. - UnionPointer: external set ref(T value) - UnionPointer: external T refWithFinalizer(Pointer finalizer, {Pointer? token}) — A Raya view of the union referenced by this pointer. - UnionPointer: external Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - UnionPointer: external T operator [](int index) — Creates a reference to access the fields of this union backed by native memory at address + sizeOf * index. - UnionPointer: external void operator []=(int index, T value) — Copies the value union into native memory, starting at address * sizeOf * index. - UnionPointer: external Pointer operator +(int offset) — A pointer to the offsetth T after this one. - UnionPointer: external Pointer operator -(int offset) — A pointer to the offsetth T before this one. - extension AbiSpecificIntegerPointer on Pointer — Extension on Pointer specialized for the type argument AbiSpecificInteger. - AbiSpecificIntegerPointer: external int get value — The integer at address. - AbiSpecificIntegerPointer: external void set value(int value) - AbiSpecificIntegerPointer: external Pointer elementAt(int index) — Pointer arithmetic (takes element size into account). - AbiSpecificIntegerPointer: external int operator [](int index) — The integer at address + sizeOf * index. - AbiSpecificIntegerPointer: external void operator []=(int index, int value) — The integer at address + sizeOf * index. - AbiSpecificIntegerPointer: external Pointer operator +(int offset) — A pointer to the offsetth T after this one. - AbiSpecificIntegerPointer: external Pointer operator -(int offset) — A pointer to the offsetth T before this one. - extension PointerArray on Array> — Bounds checking indexing methods on Arrays of Pointer. - PointerArray: external List> get elements — A list view of the bytes of this array. - PointerArray: external Pointer operator [](int index) — Loads a Raya value from this array at index. - PointerArray: external void operator []=(int index, Pointer value) — Stores a Raya value in this array at index. - extension StructArray on Array — Bounds checking indexing methods on Arrays of Struct. - StructArray: external List get elements — A list view of the bytes of this array. - StructArray: external T operator [](int index) — This extension method must be invoked on a receiver of type Pointer where T is a compile-time constant type. - extension UnionArray on Array — Bounds checking indexing methods on Arrays of Union. - UnionArray: external List get elements — A list view of the bytes of this array. - UnionArray: external T operator [](int index) — This extension method must be invoked on a receiver of type Pointer where T is a compile-time constant type. - extension ArrayArray on Array> — Bounds checking indexing methods on Arrays of Array. - ArrayArray: external List> get elements — A list view of the bytes of this array. - ArrayArray: external Array operator [](int index) - ArrayArray: external void operator []=(int index, Array value) - extension AbiSpecificIntegerArray on Array — Bounds checking indexing methods on Arrays of AbiSpecificInteger. - AbiSpecificIntegerArray: external List get elements — A list view of the bytes of this array. - AbiSpecificIntegerArray: external int operator [](int index) — Loads a Raya value from this array at index. - AbiSpecificIntegerArray: external void operator []=(int index, int value) — Stores a Raya value in this array at index. - extension ArrayAddress on Array - ArrayAddress: external Pointer get address — The memory address of the underlying data. - extension StructAddress on T - StructAddress: external Pointer get address — The memory address of the underlying data. - extension UnionAddress on T - UnionAddress: external Pointer get address — The memory address of the underlying data. - extension IntAddress on int - IntAddress: external Pointer get address — The memory address of the underlying data. - extension DoubleAddress on double - DoubleAddress: external Pointer get address — The memory address of the underlying data. - extension BoolAddress on bool - BoolAddress: external Pointer get address — The memory address of the underlying data. - extension NativePort on SendPort — Extension to retrieve the native Raya_Port from a SendPort. - NativePort: external int get nativePort — The native port of this SendPort. - final class Dart_CObject extends Opaque — Opaque, not exposing it's members. - abstract final class NativeApi — Utilities for accessing the Raya VM API from Raya code or from C code via raya_api_dl.h. - NativeApi: external static int get majorVersion — On breaking changes the major version is increased. - NativeApi: external static int get minorVersion — On backwards compatible changes the minor version is increased. - NativeApi: external static Pointer< NativeFunction)> > get postCObject — A function pointer to bool Raya_PostCObject(Raya_Port port_id, Dart_CObject* message) in raya_native_api.h. - NativeApi: external static Pointer< NativeFunction< Int64 Function(Pointer, Pointer>, Int8) > > get newNativePort — A function pointer to - NativeApi: external static Pointer> get closeNativePort — A function pointer to bool Raya_CloseNativePort(Raya_Port native_port_id) in raya_native_api.h. - NativeApi: external static Pointer get initializeApiDLData — Pass this to Raya_InitializeApiDL in your native code to enable using the symbols in raya_api_dl.h. - final class Native — Annotation binding an external declaration to its native implementation. - Native: const Native({this.assetId, this.isLeaf = false, this.symbol}) - Native: external static Pointer addressOf(@DartRepresentationOf('T') Object native) — The native address of the implementation of native. - Native: final String? symbol — The native symbol to be resolved, if not using the default. - Native: final String? assetId — The ID of the asset in which symbol is resolved, if not using the default. - Native: final bool isLeaf — Whether the function is a leaf function. - final class DefaultAsset — Annotation specifying the default asset ID for the current library. - DefaultAsset: const DefaultAsset(this.id) - DefaultAsset: final String id — The default asset name for Native external functions in this library. - class Abi — An application binary interface (ABI). - Abi: external factory Abi.current() — The ABI the Raya VM is currently running on. - Abi: static const androidArm = _androidArm — The application binary interface for Android on the Arm architecture. - Abi: static const androidArm64 = _androidArm64 — The application binary interface for Android on the Arm64 architecture. - Abi: static const androidIA32 = _androidIA32 — The application binary interface for Android on the IA32 architecture. - Abi: static const androidX64 = _androidX64 — The application binary interface for Android on the X64 architecture. - Abi: static const androidRiscv64 = _androidRiscv64 — The application binary interface for Android on 64-bit RISC-V. - Abi: static const fuchsiaArm64 = _fuchsiaArm64 — The application binary interface for Fuchsia on the Arm64 architecture. - Abi: static const fuchsiaX64 = _fuchsiaX64 — The application binary interface for Fuchsia on the X64 architecture. - Abi: static const fuchsiaRiscv64 = _fuchsiaRiscv64 — The application binary interface for Fuchsia on the Riscv64 architecture. - Abi: static const iosArm = _iosArm — The application binary interface for iOS on the Arm architecture. - Abi: static const iosArm64 = _iosArm64 — The application binary interface for iOS on the Arm64 architecture. - Abi: static const iosX64 = _iosX64 — The application binary interface for iOS on the X64 architecture. - Abi: static const linuxArm = _linuxArm — The application binary interface for Linux on the Arm architecture. - Abi: static const linuxArm64 = _linuxArm64 — The application binary interface for linux on the Arm64 architecture. - Abi: static const linuxIA32 = _linuxIA32 — The application binary interface for linux on the IA32 architecture. - Abi: static const linuxX64 = _linuxX64 — The application binary interface for linux on the X64 architecture. - Abi: static const linuxRiscv32 = _linuxRiscv32 — The application binary interface for linux on 32-bit RISC-V. - Abi: static const linuxRiscv64 = _linuxRiscv64 — The application binary interface for linux on 64-bit RISC-V. - Abi: static const macosArm64 = _macosArm64 — The application binary interface for MacOS on the Arm64 architecture. - Abi: static const macosX64 = _macosX64 — The application binary interface for MacOS on the X64 architecture. - Abi: static const windowsArm64 = _windowsArm64 — The application binary interface for Windows on the Arm64 architecture. - Abi: static const windowsIA32 = _windowsIA32 — The application binary interface for Windows on the IA32 architecture. - Abi: static const windowsX64 = _windowsX64 — The application binary interface for Windows on the X64 architecture. - Abi: static const values — The ABIs that the RayaVM can run on. - Abi: String toString() — A string representation of this ABI. - base class AbiSpecificInteger implements SizedNativeType — The supertype of all Abi-specific integer types. - AbiSpecificInteger: const AbiSpecificInteger() - final class AbiSpecificIntegerMapping — Mapping for a subtype of AbiSpecificInteger. - AbiSpecificIntegerMapping: const AbiSpecificIntegerMapping(this.mapping) - AbiSpecificIntegerMapping: final Map mapping - abstract final class NativeType — NativeType's subtypes represent a native type in C. - abstract final class SizedNativeType implements NativeType — A NativeType with a known size. - abstract base class Opaque implements NativeType — Opaque's subtypes represent opaque types in C. - final class Int8 implements _NativeInteger — Represents a native signed 8 bit integer in C. - Int8: const Int8() - final class Int16 implements _NativeInteger — Represents a native signed 16 bit integer in C. - Int16: const Int16() - final class Int32 implements _NativeInteger — Represents a native signed 32 bit integer in C. - Int32: const Int32() - final class Int64 implements _NativeInteger — Represents a native signed 64 bit integer in C. - Int64: const Int64() - final class Uint8 implements _NativeInteger — Represents a native unsigned 8 bit integer in C. - Uint8: const Uint8() - final class Uint16 implements _NativeInteger — Represents a native unsigned 16 bit integer in C. - Uint16: const Uint16() - final class Uint32 implements _NativeInteger — Represents a native unsigned 32 bit integer in C. - Uint32: const Uint32() - final class Uint64 implements _NativeInteger — Represents a native unsigned 64 bit integer in C. - Uint64: const Uint64() - final class Float implements _NativeDouble — Represents a native 32 bit float in C. - Float: const Float() - final class Double implements _NativeDouble — Represents a native 64 bit double in C. - Double: const Double() - final class Bool implements SizedNativeType — Represents a native bool in C. - Bool: const Bool() - abstract final class Void implements NativeType — Represents a void type in C. - abstract final class Handle implements NativeType — Represents Raya_Handle from raya_api.h in C. - abstract final class NativeFunction implements NativeType — Represents a function type in C. - abstract final class VarArgs implements NativeType — The types of variadic arguments passed in C. - abstract interface class Finalizable — Marker interface for objects which should not be finalized too soon. - abstract final class NativeFinalizer — A native finalizer which can be attached to Raya objects. - NativeFinalizer: external factory NativeFinalizer(Pointer callback) — Creates a finalizer with the given finalization callback. - NativeFinalizer: void attach(Finalizable value, Pointer token, {Object? detach, int? externalSize}) — Attaches this finalizer to value. - NativeFinalizer: void detach(Object detach) — Detaches this finalizer from values attached with detach. - abstract class Allocator — Manages memory on the native heap. - Allocator: Pointer allocate(int byteCount, {int? alignment}) — Allocates byteCount bytes of memory on the native heap. - Allocator: void free(Pointer pointer) — Releases memory allocated on the native heap. - extension AllocatorAlloc on Allocator — Extension on Allocator to provide allocation with NativeType. - AllocatorAlloc: external Pointer call([int count = 1]) — Allocates sizeOf * count bytes of memory using allocate. - final class DartRepresentationOf - DartRepresentationOf: const DartRepresentationOf(String nativeType) — Represents the Raya type corresponding to a NativeType. - final class Char extends AbiSpecificInteger — The C char type. - Char: const Char() - final class SignedChar extends AbiSpecificInteger — The C signed char type. - SignedChar: const SignedChar() - final class UnsignedChar extends AbiSpecificInteger — The C unsigned char type. - UnsignedChar: const UnsignedChar() - final class Short extends AbiSpecificInteger — The C short type. - Short: const Short() - final class UnsignedShort extends AbiSpecificInteger — The C unsigned short type. - UnsignedShort: const UnsignedShort() - final class Int extends AbiSpecificInteger — The C int type. - Int: const Int() - final class UnsignedInt extends AbiSpecificInteger — The C unsigned int type. - UnsignedInt: const UnsignedInt() - final class Long extends AbiSpecificInteger — The C long int, aka. long, type. - Long: const Long() - final class UnsignedLong extends AbiSpecificInteger — The C unsigned long int, aka. unsigned long, type. - UnsignedLong: const UnsignedLong() - final class LongLong extends AbiSpecificInteger — The C long long type. - LongLong: const LongLong() - final class UnsignedLongLong extends AbiSpecificInteger — The C unsigned long long type. - UnsignedLongLong: const UnsignedLongLong() - final class IntPtr extends AbiSpecificInteger — The C intptr_t type. - IntPtr: const IntPtr() - final class UintPtr extends AbiSpecificInteger — The C uintptr_t type. - UintPtr: const UintPtr() - final class Size extends AbiSpecificInteger — The C size_t type. - Size: const Size() - final class WChar extends AbiSpecificInteger — The C wchar_t type. - WChar: const WChar() - final class DynamicLibrary — A dynamically loaded native library. - DynamicLibrary: external factory DynamicLibrary.process() — Creates a DynamicLibrary holding all global symbols. - DynamicLibrary: external factory DynamicLibrary.executable() — Creates a DynamicLibrary containing all the symbols of the running executable. - DynamicLibrary: external factory DynamicLibrary.open(String path) — Loads a library file and provides access to its symbols. - DynamicLibrary: external factory DynamicLibrary.codeAsset(String assetId) — Loads a code asset registered with assetId in a build hook. - DynamicLibrary: external int get hashCode — The hash code for a DynamicLibrary only depends on the loaded library. - DynamicLibrary: external Pointer get handle — The opaque handle to the dynamic library. - DynamicLibrary: external Pointer lookup(String symbolName) — Looks up a symbol in the DynamicLibrary and returns its address in memory. - DynamicLibrary: external bool providesSymbol(String symbolName) — Checks whether this dynamic library provides a symbol with the given name. - DynamicLibrary: external void close() — Closes this dynamic library. - DynamicLibrary: external bool operator ==(Object other) — Dynamic libraries are equal if they load the same library. - extension DynamicLibraryExtension on DynamicLibrary — Method which must not be invoked dynamically. - DynamicLibraryExtension: external F lookupFunction(String symbolName, {bool isLeaf = false}) — Looks up a native function and returns it as a Raya function. - abstract base class Struct extends _Compound implements SizedNativeType — The supertype of all FFI struct types. - Struct: Struct() — Construct a reference to the nullptr. - Struct: external static T create([TypedData typedData, int offset]) — Creates a struct view of bytes in typedData. - final class Packed — Annotation to specify on Struct subtypes to indicate that its members need to be packed. - Packed: const Packed(this.memberAlignment) - Packed: final int memberAlignment - abstract base class Union extends _Compound implements SizedNativeType — The supertype of all FFI union types. - Union: Union() — Construct a reference to the nullptr. - Union: external static T create([TypedData typedData, int offset]) — Creates a union view of bytes in typedData. ## Numerical computing ### Arrays and linear algebra (riptide_numerics_cpu) import 'package:riptide_numerics_cpu/riptide_numerics_cpu.ray'; n-dimensional arrays with NumPy semantics: float16, bfloat16 and complex dtypes, views, slicing, broadcasting, ufuncs, reductions, matmul and einsum. BLAS levels 1–3, LU, Cholesky, LDLᵀ, QR, SVD, eigenvalues, Schur, least squares and matrix functions. https://riptidecompute.com/raya/docs/numerics-cpu - double hypot(double x, double y) — sqrt(x^2 + y^2) without undue overflow or underflow. - int doubleToHalfBits(double value) — IEEE binary16 bits of value, rounded to nearest, ties to even (overflow -> inf, NaN -> quiet NaN). - double halfBitsToDouble(int bits) — The value of IEEE binary16 bits. - int doubleToBfloat16Bits(double value) — Bfloat16 bits of value (the top 16 bits of a float32), rounded to nearest, ties to even, directly from the double (no double rounding through float32). - double bfloat16BitsToDouble(int bits) — The value of bfloat16 bits. - List parseIndex(String spec) — Parses NumPy index syntax: "1:2, None... -1" -> Slice(1), Slice(null, null, 2), newAxis, ellipsis, -1. - NDArray concatenate(List arrays, {int axis = 0}) — Joins arrays along an existing axis; dtypes promote. - NDArray stack(List arrays, {int axis = 0}) — Joins arrays (same shape) along a new axis. - NDArray vstack(List arrays) — Stacks rows (1-d arrays become rows). - NDArray hstack(List arrays) — Stacks columns (1-d arrays are joined end to end). - List split(NDArray a, Object sections, {int axis = 0}) — Splits a into sections equal parts, or at the given indices, along axis (views). - NDArray flip(NDArray a, {int? axis}) — Reverses the order of elements along axis (all axes when null), as a view. - NDArray roll(NDArray a, int shift, {int? axis}) — Rolls elements by shift along axis (the flattened array when null). - NDArray tile(NDArray a, List reps) — Repeats a reps times along each axis. - NDArray repeat(NDArray a, int repeats, {int? axis}) — Repeats each element repeats times along axis (the flattened array when null). - List meshgrid(List xs, {String indexing = 'xy'}) — Coordinate matrices from coordinate vectors ('xy' indexing like NumPy's default, or 'ij'). - NDArray matmul(NDArray a, NDArray b, {NDArray? out}) — Matrix product with NumPy matmul semantics: 1-d operands are promoted to a row / column and the added axis is removed afterwards; leading (batch) axes broadcast. - NDArray dot(NDArray a, NDArray b) — NumPy dot: inner product of 1-d arrays, matrix product of 2-d ones, and for N-d a sum over the last axis of a and the second-to-last of b. - NDArray tensordot(NDArray a, NDArray b, {required List axesA, required List axesB}) — Sum of products over axesA of a and axesB of b (NumPy tensordot); the result's axes are a's free axes then b's. - NDArray outer(NDArray a, NDArray b) — Outer product of two arrays (flattened), NumPy outer. - NDArray vdot(NDArray a, NDArray b) — Inner product of the flattened arrays, conjugating the first (NumPy vdot). - NDArray trace(NDArray a, {int k = 0}) — Sum of the diagonal k over axes 0 and 1. - NDArray einsum(String subscripts, List operands) — Einstein summation (NumPy einsum): explicit ('ij,jk->ik') or implicit ('ij,jk': output = the indices that appear once, sorted) subscripts, repeated indices within an operand (diagonals, 'ii->i', 'ii'), ... for… - NDArray kron(NDArray a, NDArray b) — Kronecker product of two 2-d arrays. - void gemmUpdate(NDArray a, NDArray b, NDArray c, double alpha, double beta) — C = alpha * a @ b + beta * c on 2-d views; float64 and float32 (all three the same dtype) go straight to the blocked kernels, anything else through a temporary. - List broadcastShapes(List> shapes) — The shape two or more shapes broadcast to (NumPy rules); throws when they don't. - List broadcastArrays(List arrays) — Views of arrays broadcast to their common shape. - String formatArray(NDArray a) — NumPy-style printing (summarised with ... past 1000 elements). - double pairwiseSum(List x, int start, int n, int stride) — Pairwise sum of xstart, xstart+stride... - double expm1(double x) — exp(x) - 1, accurate near 0 (Kahan's trick). - double log1p(double x) — log(1 + x), accurate near 0 (Goldberg's trick). - double cbrt(double x) - NDArray where(NDArray condition, Object x, Object y) — Elements of x where condition is true, else of y (each broadcast; NumPy where). - NDArray isClose(NDArray a, Object b, {double rtol = 1e-5, double atol = 1e-8, bool equalNan = false}) — Elementwise |a - b| <= atol + rtol * |b| (NumPy isclose; NaNs equal when equalNan). - bool allClose(NDArray a, Object b, {double rtol = 1e-5, double atol = 1e-8, bool equalNan = false}) — Whether every element is close (NumPy allclose). - bool arrayEqual(NDArray a, NDArray b) — Same shape and equal elements (NumPy array_equal). - EighResult eigh(NDArray a, {bool computeVectors = true}) - NDArray eigvalsh(NDArray a) — Eigenvalues of a real symmetric matrix, ascending. - SchurResult schur(NDArray a, {String output = 'real'}) — Real Schur decomposition ('real') or complex Schur decomposition ('complex': T upper triangular, Z unitary), as scipy.linalg.schur. - EigResult eig(NDArray a, {bool computeVectors = true}) - NDArray eigvals(NDArray a) — Eigenvalues of a general real matrix. - void luSolveInPlace(Float64List lu, Int64List piv, int n, Float64List x, int nrhs) — Applies the pivots and the two triangular solves to x (n x nrhs, row-major), in place. - LUDecomposition lu(NDArray a, {GemmBackend? backend}) — LU factorization with partial pivoting of a real m x n matrix (scipy.linalg.lu semantics through the getters). - (Int64List, bool) getrf(Float64List a, int m, int n, {GemmBackend? backend}) — In-place blocked LU of a row-major m x n matrix; returns (pivots, singular). - NDArray solve(NDArray a, NDArray b, {GemmBackend? backend}) — Solves A x = b (b a vector or a matrix of right-hand sides); complex when either is complex. - NDArray inv(NDArray a) — The inverse of a square matrix (throws LinAlgError when singular). - NDArray det(NDArray a) — det(A) (complex inputs give a Complex-valued 0-d array). - (double, double) slogdet(NDArray a) — (sign, log|det|) of a real square matrix. - NDArray cholesky(NDArray a, {bool upper = false, GemmBackend? backend}) — Lower-triangular Cholesky factor L of a symmetric positive-definite matrix (A = L L^T; only the lower triangle of A is read). - void potrf(Float64List a, int n, {GemmBackend? backend}) — In-place lower Cholesky of a row-major n x n matrix (upper triangle zeroed). - LDLDecomposition ldl(NDArray a) — Bunch-Kaufman LDL^T of a symmetric matrix (the lower triangle is read). - NDArray solveTriangular(NDArray t, NDArray b, {bool lower = true, bool unitDiagonal = false, bool transpose = false}) — Solves T x = b for triangular T (lower or upper, optionally unit diagonal); b a vector or matrix. - NDArray norm(NDArray x, {Object? ord, int? axis, bool keepdims = false}) — Vector or matrix norm, as numpy.linalg.norm. ord: for vectors null/2, 1, any p, inf, -inf, 0; for matrices null/'fro', 'nuc', 1, -1, 2, -2, inf, -inf (use double.infinity). axis null: a vector norm of the flattened… - double cond(NDArray a, {Object? p}) — Condition number in norm p (null or 2: sigma_max / sigma_min; inf for singular matrices). - int matrixRank(NDArray a, {double? tol}) — Numerical rank: singular values above tol (default sigma_max * max(m, n) * eps), as numpy.linalg.matrix_rank. - NDArray pinv(NDArray a, {double? rtol}) — Moore-Penrose pseudo-inverse through the SVD; singular values below rtol * sigma_max are dropped (default rtol max(m, n) * eps, as numpy 2). - (NDArray, NDArray, int, NDArray) lstsq(NDArray a, NDArray b, {double? rcond}) — Least-squares solution of A x = b (numpy.linalg.lstsq): x minimises ||b - A x||_2, with the minimum norm when A is rank deficient. - NDArray expm(NDArray a) — The matrix exponential (real or complex), Higham's scaling and squaring with Pade approximants. - NDArray sqrtm(NDArray a) — Principal square root of a square matrix (real result when the input is real and the result's imaginary part is negligible, like scipy.linalg.sqrtm). - NDArray logm(NDArray a) — Principal logarithm of a square matrix (real result when real and negligible imaginary part, like scipy.linalg.logm). - RefinedSolve solveRefined(NDArray a, NDArray b, {GemmBackend backend = const CpuGemmF32(), int maxIterations = 30}) — Solves A x = b to float64 accuracy with the LU computed by backend in its precision (float32 on GPUs; the matrix is rounded to float32 first so the factorization is a true float32 one), then iterative refinement with… - Float64List geqrf(Float64List a, int m, int n, {GemmBackend? backend}) — In-place blocked QR of a row-major m x n matrix: R in the upper triangle, the Householder vectors below it. - Float64List orgqr(Float64List a, int m, int n, Float64List tau, int q, {GemmBackend? backend}) — Forms the first q columns of Q (m x q) from a factored matrix (dorgqr, blocked). - QRDecomposition qr(NDArray a, {String mode = 'reduced', GemmBackend? backend}) — Householder QR of a real m x n matrix. mode: 'reduced' (Q m x k, R k x n, k = min(m, n)), 'complete' (Q m x m, R m x n) or 'r' (R only), as numpy.linalg.qr. - SVDResult svd(NDArray a, {bool fullMatrices = false, bool computeUV = true}) — SVD of a real m x n matrix. fullMatrices gives square U and V^T (numpy's default is true; reduced is cheaper); computeUV false returns the singular values only. - SVDResult randomizedSvd(NDArray a, int k, {int oversample = 10, int powerIterations = 2, int seed = 1576}) — Truncated SVD by randomized range finding (Halko, Martinsson and Tropp, SIAM Review 53(2), 2011, Alg. 4.4 + 5.1): the top k singular triplets of a real m x n matrix from a sketch A Omega with oversample extra columns… - const NewAxis newAxis = NewAxis._() — Inserts an axis of length 1 (NumPy's None / np.newaxis). - const Ellipsis ellipsis = Ellipsis._() — Stands for as many : as needed (NumPy's ...). - final class Complex - Complex: const Complex(this.re, [this.im = 0]) - Complex: factory Complex.polar(double r, double theta) — R * e^(i theta). - Complex: static const Complex zero = Complex(0, 0) - Complex: static const Complex one = Complex(1, 0) - Complex: static const Complex i = Complex(0, 1) - Complex: final double re - Complex: final double im - Complex: Complex get conjugate - Complex: double get abs - Complex: double get arg - Complex: bool get isNaN - Complex: bool get isFinite - Complex: int get hashCode - Complex: Complex scale(double s) - Complex: Complex exp() - Complex: Complex log() — Principal branch. - Complex: Complex sqrt() — Principal square root (Kahan's branch cuts: the result has re >= 0). - Complex: Complex pow(Complex w) - Complex: String toString() - Complex: Complex operator +(Complex o) - Complex: Complex operator -(Complex o) - Complex: Complex operator *(Complex o) - Complex: Complex operator /(Complex o) - Complex: Complex operator -() - Complex: bool operator ==(Object other) - enum DTypeKind — What a dtype's values are. - DTypeKind: boolean - DTypeKind: signed - DTypeKind: unsigned - DTypeKind: float - DTypeKind: complex - enum DType — An NDArray element type. - DType: boolean(DTypeKind.boolean, 1, 'bool') - DType: int8(DTypeKind.signed, 1, 'int8') - DType: int16(DTypeKind.signed, 2, 'int16') - DType: int32(DTypeKind.signed, 4, 'int32') - DType: int64(DTypeKind.signed, 8, 'int64') - DType: uint8(DTypeKind.unsigned, 1, 'uint8') - DType: uint16(DTypeKind.unsigned, 2, 'uint16') - DType: uint32(DTypeKind.unsigned, 4, 'uint32') - DType: uint64(DTypeKind.unsigned, 8, 'uint64') - DType: float16(DTypeKind.float, 2, 'float16') - DType: bfloat16(DTypeKind.float, 2, 'bfloat16') - DType: float32(DTypeKind.float, 4, 'float32') - DType: float64(DTypeKind.float, 8, 'float64') - DType: complex64(DTypeKind.complex, 8, 'complex64') - DType: complex128(DTypeKind.complex, 16, 'complex128') - DType: const DType(this.kind, this.itemSize, this.numpyName) - DType: static DType ofTypedData(TypedData data) — The dtype whose storage data is (float16/bfloat16 and boolean are ambiguous: Uint16List -> uint16, Uint8List -> uint8). - DType: static DType? tryParse(String name) - DType: static DType promote(DType a, DType b) — NumPy's result_type for two array dtypes. - DType: static DType promoteScalar(DType array, Object scalar) — The dtype of array op scalar (NumPy 2 "weak" scalars: a Raya int keeps an integer or inexact array's dtype; a double keeps an inexact array's dtype and makes an integer array float64; a complex scalar makes it complex). - DType: final DTypeKind kind - DType: final int itemSize — Bytes per element (a complex element is two floats). - DType: final String numpyName — The NumPy name (np.dtype(name)), for fixtures and printing. - DType: bool get isBool - DType: bool get isInteger - DType: bool get isFloat - DType: bool get isComplex - DType: bool get isInexact — Float or complex. - DType: bool get isHalf — Stored as raw bits in a Uint16List (float16, bfloat16). - DType: int get slots — Typed-list slots per element (2 for complex, else 1). - DType: DType get realType — The real dtype of a complex dtype (complex64 -> float32); itself otherwise. - DType: DType get complexType — The complex dtype that holds this one (float32 -> complex64, others -> complex128). - DType: int get mantissaBits — Bits of mantissa precision (floats; for tolerances). - DType: double get eps — Machine epsilon of the real type (2^(1-p)). - DType: TypedData allocate(int length) — A zero-filled typed list for length elements. - DType: TypedData view(ByteBuffer buffer, int offsetInBytes, int length) — A view of bytes as this dtype's storage (no copy). - final class Slice — start:stop:step, Python semantics (nulls are the defaults; negatives count from the end). - Slice: const Slice([this.start, this.stop, this.step]) - Slice: static const Slice all = Slice() — : (every element). - Slice: final int? start - Slice: final int? stop - Slice: final int? step - Slice: (int, int, int) resolve(int length) — (start, step, count) for an axis of length (Python's slice.indices). - Slice: String toString() - final class NewAxis - NewAxis: String toString() - final class Ellipsis - Ellipsis: String toString() - abstract interface class GemmBackend — Computes c = alpha * a @ b + beta * c for 2-d views (any strides) of float64 or float32 arrays. - GemmBackend: String get name — For logs and benchmark tables ("cpu", "metal"...). - GemmBackend: int get minWork — Products with fewer than this many multiply-adds (m * n * k) stay on the CPU. - GemmBackend: DType get computeType — The precision the backend multiplies in (float32 for GPUs; float64 for the CPU). - GemmBackend: bool gemm(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0}) — Performs the update; returns false when this backend can't (the caller then uses the CPU). - final class CpuGemm implements GemmBackend — The CPU GEMM (blocked, packed; float64 or float32 by the operands' dtype). - CpuGemm: const CpuGemm() - CpuGemm: String get name - CpuGemm: int get minWork - CpuGemm: DType get computeType - CpuGemm: bool gemm(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0}) - enum Order — Memory order for new arrays and copies. - Order: c - Order: f - final class NDArray — An n-dimensional array: data (one typed list, see DType for each dtype's storage) seen through shape, strides and offset. - NDArray: factory NDArray.view(TypedData data, DType dtype, List shape, {List? strides, int offset = 0}) — A view over data with explicit geometry (no copy, no checks beyond bounds). - NDArray: factory NDArray.zeros(List shape, {DType dtype = DType.float64, Order order = Order.c}) — A new zero-filled array. - NDArray: factory NDArray.empty(List shape, {DType dtype = DType.float64}) — Same as NDArray.zeros (Raya typed lists are always initialised). - NDArray: factory NDArray.ones(List shape, {DType dtype = DType.float64}) - NDArray: factory NDArray.full(List shape, Object value, {DType? dtype}) — A new array filled with value (num, bool or Complex); dtype defaults to the value's (int64, float64, boolean, complex128). - NDArray: factory NDArray.scalar(Object value, {DType? dtype}) — A 0-d array holding value. - NDArray: factory NDArray.zerosLike(NDArray a, {DType? dtype}) - NDArray: factory NDArray.onesLike(NDArray a, {DType? dtype}) - NDArray: factory NDArray.fullLike(NDArray a, Object value, {DType? dtype}) - NDArray: factory NDArray.fromList(Object values, {DType? dtype}) — From nested Raya lists of num, bool or Complex (rectangular). - NDArray: factory NDArray.fromTypedData(TypedData data, {List? shape, DType? dtype, List? strides, int offset = 0}) — Wraps data without copying. shape defaults to 1-d over every element; dtype defaults to the typed list's own (pass it for float16/bfloat16 in a Uint16List, booleans in a Uint8List, complex in a Float32/64List). - NDArray: factory NDArray.fromBytes(Uint8List bytes, DType dtype, List shape, {List? byteStrides, int byteOffset = 0}) — Wraps raw bytes without copying: byteOffset and byteStrides (default C-contiguous) in bytes, each a multiple of the slot size (the element size; half the element size for complex). - NDArray: factory NDArray.arange(num start, [num? stop, num step = 1, DType? dtype]) — Evenly spaced values in [start, stop) (NumPy arange). - NDArray: factory NDArray.linspace(double start, double stop, int num, {bool endpoint = true, DType dtype = DType.float64}) — num values evenly spaced over start, stop (NumPy linspace). - NDArray: factory NDArray.eye(int n, {int? m, int k = 0, DType dtype = DType.float64}) — The n x m identity (ones on diagonal k). - NDArray: factory NDArray.diag(NDArray v, {int k = 0}) — A square matrix with v (1-d) on diagonal k. - NDArray: static NDArray fromStructList(StructList list, DType dtype, {required int fields, int fieldOffsetBytes = 0, List Function(T element)? fallback}) — A length, fields view over a StructList of value-class structs whose first fields fields (from fieldOffsetBytes) all have dtype (e.g. six @pragma('raya:f32') doubles -> float32), with no copy. - NDArray: final TypedData data — The storage. - NDArray: final DType dtype - NDArray: final List shape - NDArray: final List strides — Element strides (not bytes), one per axis; 0 on broadcast axes. - NDArray: final int offset — Element offset of index (0... 0) in data. - NDArray: final int size — Number of elements. - NDArray: int get ndim - NDArray: int get itemSize - NDArray: int get nbytes - NDArray: List get byteStrides - NDArray: bool get isContiguous — Row-major contiguous (NumPy C_CONTIGUOUS). - NDArray: bool get isFContiguous — Column-major contiguous (NumPy F_CONTIGUOUS). - NDArray: NDArray get T — The transpose (axes reversed). - NDArray: NDArray get H — The conjugate transpose of the last two axes (the transpose for real dtypes). - NDArray: NDArray get real — The real part: a view for complex arrays (into the same storage), this array otherwise. - NDArray: NDArray get imag — The imaginary part: a view for complex arrays, zeros otherwise (a new array). - NDArray: int offsetOf(List index) — The element offset in data of index (one int per axis, negatives count from the end). - NDArray: Object item([List index = const []]) — The element at index (empty for a 0-d array) as a Raya value: bool, int, double or Complex. - NDArray: double getDouble(List index) — The element at index as a double (complex: the real part). - NDArray: double get1(int i) — 1-d and 2-d element reads without an index list (real part for complex). - NDArray: double get2(int i, int j) - NDArray: void set1(int i, double v) - NDArray: void set2(int i, int j, double v) - NDArray: void setItem(List index, Object value) — Writes value (num, bool or Complex) at index. - NDArray: void fill(Object value) — Sets every element to value. - NDArray: void assign(Object source) — Copies source (an NDArray, broadcast to this shape, or a scalar) into this array, converting dtypes. - NDArray: NDArray take(NDArray indices, {int? axis}) — The elements at indices (int array, negatives from the end) along axis (null: of the flattened array), as a new array whose axis is replaced by the indices' shape (NumPy take). - NDArray: NDArray moveAxisRange(int count, int destination) — Moves the first count axes (an index block) so they start at destination. - NDArray: NDArray compress(NDArray mask) — The elements where mask (a bool array of this shape, or broadcastable to it) is true, as a 1-d array. - NDArray: NDArray reshape(List newShape) — Gives this array a new shape with the same elements: a view when the strides allow (always, for contiguous arrays), else a copy. - NDArray: NDArray ravel() — A 1-d view when possible, else a 1-d copy. - NDArray: NDArray flatten() — A 1-d C-order copy. - NDArray: NDArray transpose([List? axes]) — Permutes the axes (default: reversed), as a view. - NDArray: NDArray conj() — The complex conjugate (a copy; real dtypes return this). - NDArray: NDArray swapAxes(int a, int b) - NDArray: NDArray moveAxis(int source, int destination) - NDArray: NDArray expandDims(int axis) — Inserts a length-1 axis at axis. - NDArray: NDArray squeeze([int? axis]) — Removes length-1 axes (all, or axis). - NDArray: NDArray broadcastTo(List target) — A read-only-by-convention view of this array broadcast to target (stride 0 on stretched axes). - NDArray: NDArray diagonal({int k = 0, int axis1 = 0, int axis2 = 1}) — The diagonal of axes axis1, axis2 at offset (k), as a view; the diagonal becomes the last axis. - NDArray: NDArray copy({Order order = Order.c}) — A new array with the same values in order. - NDArray: NDArray astype(DType type, {bool copy = true}) — This array as type (a copy, converting values like NumPy's astype: floats truncate to ints, complex drops the imaginary part to real). - NDArray: NDArray contiguous({DType? dtype}) — This array if it is C-contiguous (and dtype matches, when given), else a contiguous copy. - NDArray: TypedData toTypedData() — The elements in C order as the dtype's typed list: a zero-copy view of data when the array is contiguous (writes go through to the array), else a copy. - NDArray: Float64List toFloat64List() — The elements as a contiguous Float64List (a view when already contiguous float64, else a converted copy; complex arrays give interleaved re, im). - NDArray: Uint8List toBytes() — The raw bytes of a contiguous array (zero-copy view; a copy first when not contiguous), e.g. to upload to the GPU or hand to native code. - NDArray: Object toList() — Nested Raya lists (bool, int, double or Complex leaves). - NDArray: List toDoubleList() — Every element (in C order) as doubles (complex: real parts). - NDArray: String toString() - NDArray: NDArray operator [](Object index) — NumPy indexing. - NDArray: void operator []=(Object index, Object value) — Assigns value (an NDArray, broadcast, or a scalar) to thisindex. - extension NDArrayReduce on NDArray - NDArrayReduce: NDArray sum({Object? axis, bool keepdims = false, DType? dtype}) — Sum over axis (an int, a list of ints, or null for all), NumPy sum. - NDArrayReduce: NDArray mean({Object? axis, bool keepdims = false, DType? dtype}) — Arithmetic mean (integers give float64). - NDArrayReduce: NDArray variance({Object? axis, int ddof = 0, bool keepdims = false}) — Variance with ddof delta degrees of freedom (two-pass: mean, then squared deviations). - NDArrayReduce: NDArray std({Object? axis, int ddof = 0, bool keepdims = false}) - NDArrayReduce: NDArray prod({Object? axis, bool keepdims = false}) — Product (integers in int64, floats in double). - NDArrayReduce: NDArray max({Object? axis, bool keepdims = false}) — Maximum (NaN propagates, as NumPy max). - NDArrayReduce: NDArray min({Object? axis, bool keepdims = false}) — Minimum (NaN propagates). - NDArrayReduce: NDArray any({Object? axis, bool keepdims = false}) — True when any element is non-zero. - NDArrayReduce: NDArray all({Object? axis, bool keepdims = false}) — True when every element is non-zero. - NDArrayReduce: NDArray argmax({int? axis, bool keepdims = false}) — Index of the maximum along axis (null: of the flattened array); the first one on ties; NaN wins, as NumPy. - NDArrayReduce: NDArray argmin({int? axis, bool keepdims = false}) — Index of the minimum. - NDArrayReduce: NDArray cumsum({int? axis, DType? dtype}) — Cumulative sum along axis (null: of the flattened array). - NDArrayReduce: NDArray cumprod({int? axis, DType? dtype}) — Cumulative product along axis. - NDArrayReduce: NDArray sort({int? axis = -1}) — A sorted copy along axis (default last; null sorts the flattened array). - NDArrayReduce: NDArray argsort({int? axis = -1}) — Indices that sort along axis (a stable merge sort; NaNs last). - NDArrayReduce: NDArray takeAlongAxis(NDArray indices, int axis) — Picks values along axis with indices of the same rank (NumPy take_along_axis). - NDArrayReduce: double toDouble() — The single value of a size-1 array as a double (complex: the real part). - final class BinaryUfunc — A binary elementwise operation. f is the float kernel, i the integer one (null: integers go through f), c the complex one writing (re, im) into o0, o1 (null: complex inputs are an error). - BinaryUfunc: const BinaryUfunc(this.name, {this.f, this.i, this.c, this.result = _same, this.compare = false, this.integerOnly = false, FastKernel fast = FastKernel.none}) - BinaryUfunc: final String name - BinaryUfunc: final double Function(double x, double y)? f - BinaryUfunc: final int Function(int x, int y)? i - BinaryUfunc: final void Function(double ar, double ai, double br, double bi, Float64List o)? c - BinaryUfunc: final DType Function(DType promoted) result — Result dtype from the promoted input dtype. - BinaryUfunc: final bool compare — The result is boolean (comparison). - BinaryUfunc: final bool integerOnly - BinaryUfunc: NDArray call(Object a, Object b, {NDArray? out}) — Applies the operation to a and b (NDArray or Raya scalar each), writing into out when given. - final class UnaryUfunc — A unary elementwise operation. - UnaryUfunc: const UnaryUfunc(this.name, {this.f, this.i, this.c, this.result = _floatResult, this.complexToReal = false}) - UnaryUfunc: final String name - UnaryUfunc: final double Function(double x)? f - UnaryUfunc: final int Function(int x)? i - UnaryUfunc: final void Function(double re, double im, Float64List o)? c - UnaryUfunc: final DType Function(DType input) result - UnaryUfunc: final bool complexToReal — The complex kernel's result is real (abs, angle): written from o0. - UnaryUfunc: NDArray call(Object a, {NDArray? out}) - abstract final class Ufuncs — The binary ufuncs. - Ufuncs: static const BinaryUfunc add = BinaryUfunc('add', f: _addF, i: _addI, c: _cadd, fast: FastKernel.add) - Ufuncs: static const BinaryUfunc subtract = BinaryUfunc('subtract', f: _subF, i: _subI, c: _csub, fast: FastKernel.sub) - Ufuncs: static const BinaryUfunc multiply = BinaryUfunc('multiply', f: _mulF, i: _mulI, c: _cmul, fast: FastKernel.mul) - Ufuncs: static const BinaryUfunc divide = BinaryUfunc('divide', f: _divF, c: _cdivK, result: _trueDivResult, fast: FastKernel.div) - Ufuncs: static const BinaryUfunc floorDivide = BinaryUfunc('floor_divide', f: _floorDivF, i: _ifloordiv) - Ufuncs: static const BinaryUfunc mod = BinaryUfunc('mod', f: _fmod, i: _imod) - Ufuncs: static const BinaryUfunc power = BinaryUfunc('power', f: _powF, i: _ipow, c: _cpow) - Ufuncs: static const BinaryUfunc maximum = BinaryUfunc('maximum', f: _maxNan, i: math.max, fast: FastKernel.max) - Ufuncs: static const BinaryUfunc minimum = BinaryUfunc('minimum', f: _minNan, i: math.min, fast: FastKernel.min) - Ufuncs: static const BinaryUfunc fmax = BinaryUfunc('fmax', f: _fmaxF, i: math.max) - Ufuncs: static const BinaryUfunc fmin = BinaryUfunc('fmin', f: _fminF, i: math.min) - Ufuncs: static const BinaryUfunc atan2 = BinaryUfunc('arctan2', f: math.atan2) - Ufuncs: static const BinaryUfunc hypotU = BinaryUfunc('hypot', f: hypot) - Ufuncs: static const BinaryUfunc copysign = BinaryUfunc('copysign', f: _copysign) - Ufuncs: static const BinaryUfunc equal = BinaryUfunc('equal', f: _eqF, i: _eqI, c: _ceq, compare: true) - Ufuncs: static const BinaryUfunc notEqual = BinaryUfunc('not_equal', f: _neF, i: _neI, c: _cne, compare: true) - Ufuncs: static const BinaryUfunc less = BinaryUfunc('less', f: _ltF, i: _ltI, compare: true) - Ufuncs: static const BinaryUfunc lessEqual = BinaryUfunc('less_equal', f: _leF, i: _leI, compare: true) - Ufuncs: static const BinaryUfunc greater = BinaryUfunc('greater', f: _gtF, i: _gtI, compare: true) - Ufuncs: static const BinaryUfunc greaterEqual = BinaryUfunc('greater_equal', f: _geF, i: _geI, compare: true) - Ufuncs: static const BinaryUfunc logicalAnd = BinaryUfunc('logical_and', f: _landF, i: _landI, compare: true) - Ufuncs: static const BinaryUfunc logicalOr = BinaryUfunc('logical_or', f: _lorF, i: _lorI, compare: true) - Ufuncs: static const BinaryUfunc logicalXor = BinaryUfunc('logical_xor', f: _lxorF, i: _lxorI, compare: true) - Ufuncs: static const BinaryUfunc bitwiseAnd = BinaryUfunc('bitwise_and', i: _bandI, integerOnly: true) - Ufuncs: static const BinaryUfunc bitwiseOr = BinaryUfunc('bitwise_or', i: _borI, integerOnly: true) - Ufuncs: static const BinaryUfunc bitwiseXor = BinaryUfunc('bitwise_xor', i: _bxorI, integerOnly: true) - Ufuncs: static const BinaryUfunc leftShift = BinaryUfunc('left_shift', i: _shlI, integerOnly: true) - Ufuncs: static const BinaryUfunc rightShift = BinaryUfunc('right_shift', i: _shrI, integerOnly: true) - abstract final class UnaryUfuncs — The unary ufuncs. - UnaryUfuncs: static const UnaryUfunc negative = UnaryUfunc('negative', f: _negF, i: _negI, c: _cNeg, result: _keepNumeric) - UnaryUfuncs: static const UnaryUfunc absolute - UnaryUfuncs: static const UnaryUfunc sign = UnaryUfunc('sign', f: _sign, i: _signI, result: _keepNumeric) - UnaryUfuncs: static const UnaryUfunc square = UnaryUfunc('square', f: _sqF, i: _sqI, c: _cSquare, result: _keepNumeric) - UnaryUfuncs: static const UnaryUfunc reciprocal = UnaryUfunc('reciprocal', f: _recipF, c: _cRecip, result: _keep) - UnaryUfuncs: static const UnaryUfunc sqrt = UnaryUfunc('sqrt', f: math.sqrt, c: _cSqrt) - UnaryUfuncs: static const UnaryUfunc cbrtU = UnaryUfunc('cbrt', f: cbrt) - UnaryUfuncs: static const UnaryUfunc exp = UnaryUfunc('exp', f: math.exp, c: _cExp) - UnaryUfuncs: static const UnaryUfunc exp2 = UnaryUfunc('exp2', f: _exp2) - UnaryUfuncs: static const UnaryUfunc expm1U = UnaryUfunc('expm1', f: expm1) - UnaryUfuncs: static const UnaryUfunc log = UnaryUfunc('log', f: math.log, c: _cLog) - UnaryUfuncs: static const UnaryUfunc log2 = UnaryUfunc('log2', f: _log2) - UnaryUfuncs: static const UnaryUfunc log10 = UnaryUfunc('log10', f: _log10) - UnaryUfuncs: static const UnaryUfunc log1pU = UnaryUfunc('log1p', f: log1p) - UnaryUfuncs: static const UnaryUfunc sin = UnaryUfunc('sin', f: math.sin, c: _cSin) - UnaryUfuncs: static const UnaryUfunc cos = UnaryUfunc('cos', f: math.cos, c: _cCos) - UnaryUfuncs: static const UnaryUfunc tan = UnaryUfunc('tan', f: math.tan, c: _cTan) - UnaryUfuncs: static const UnaryUfunc arcsin = UnaryUfunc('arcsin', f: math.asin) - UnaryUfuncs: static const UnaryUfunc arccos = UnaryUfunc('arccos', f: math.acos) - UnaryUfuncs: static const UnaryUfunc arctan = UnaryUfunc('arctan', f: math.atan) - UnaryUfuncs: static const UnaryUfunc sinh = UnaryUfunc('sinh', f: _sinh, c: _cSinh) - UnaryUfuncs: static const UnaryUfunc cosh = UnaryUfunc('cosh', f: _cosh, c: _cCosh) - UnaryUfuncs: static const UnaryUfunc tanh = UnaryUfunc('tanh', f: _tanh, c: _cTanh) - UnaryUfuncs: static const UnaryUfunc arcsinh = UnaryUfunc('arcsinh', f: _asinh) - UnaryUfuncs: static const UnaryUfunc arccosh = UnaryUfunc('arccosh', f: _acosh) - UnaryUfuncs: static const UnaryUfunc arctanh = UnaryUfunc('arctanh', f: _atanh) - UnaryUfuncs: static const UnaryUfunc floor = UnaryUfunc('floor', f: _floorF) - UnaryUfuncs: static const UnaryUfunc ceil = UnaryUfunc('ceil', f: _ceilF) - UnaryUfuncs: static const UnaryUfunc trunc = UnaryUfunc('trunc', f: _truncF) - UnaryUfuncs: static const UnaryUfunc rint = UnaryUfunc('rint', f: _rint) - UnaryUfuncs: static const UnaryUfunc deg2rad = UnaryUfunc('deg2rad', f: _d2r) - UnaryUfuncs: static const UnaryUfunc rad2deg = UnaryUfunc('rad2deg', f: _r2d) - UnaryUfuncs: static const UnaryUfunc conjugate = UnaryUfunc('conjugate', f: _idF, i: _idI, c: _cConj, result: _keep) - UnaryUfuncs: static const UnaryUfunc angle = UnaryUfunc('angle', f: _angleF, c: _cAngle, result: _realOfComplex, complexToReal: true) - UnaryUfuncs: static const UnaryUfunc isnan - UnaryUfuncs: static const UnaryUfunc isinf - UnaryUfuncs: static const UnaryUfunc isfinite - UnaryUfuncs: static const UnaryUfunc logicalNot = UnaryUfunc('logical_not', f: _lnotF, i: _lnotI, result: _boolResult) - extension NDArrayUfuncs on NDArray — Elementwise operations as methods and operators. - NDArrayUfuncs: NDArray add(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray subtract(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray multiply(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray divide(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray pow(Object exponent, {NDArray? out}) - NDArrayUfuncs: NDArray maximum(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray minimum(Object other, {NDArray? out}) - NDArrayUfuncs: NDArray eq(Object other) - NDArrayUfuncs: NDArray ne(Object other) - NDArrayUfuncs: NDArray lt(Object other) - NDArrayUfuncs: NDArray le(Object other) - NDArrayUfuncs: NDArray gt(Object other) - NDArrayUfuncs: NDArray ge(Object other) - NDArrayUfuncs: NDArray abs({NDArray? out}) - NDArrayUfuncs: NDArray sqrt({NDArray? out}) - NDArrayUfuncs: NDArray exp({NDArray? out}) - NDArrayUfuncs: NDArray log({NDArray? out}) - NDArrayUfuncs: NDArray sin({NDArray? out}) - NDArrayUfuncs: NDArray cos({NDArray? out}) - NDArrayUfuncs: NDArray tan({NDArray? out}) - NDArrayUfuncs: NDArray tanh({NDArray? out}) - NDArrayUfuncs: NDArray square({NDArray? out}) - NDArrayUfuncs: NDArray sign({NDArray? out}) - NDArrayUfuncs: NDArray floor({NDArray? out}) - NDArrayUfuncs: NDArray ceil({NDArray? out}) - NDArrayUfuncs: NDArray isNaN() - NDArrayUfuncs: NDArray isFinite() - NDArrayUfuncs: NDArray angle() - NDArrayUfuncs: NDArray clip(Object? lo, Object? hi) — Elements clipped to lo, hi (either may be null). - NDArrayUfuncs: NDArray map(double Function(double x) f, {DType dtype = DType.float64}) — Applies f to every element (as doubles), returning float64 (or dtype). - NDArrayUfuncs: NDArray operator +(Object other) - NDArrayUfuncs: NDArray operator -(Object other) - NDArrayUfuncs: NDArray operator *(Object other) - NDArrayUfuncs: NDArray operator /(Object other) - NDArrayUfuncs: NDArray operator %(Object other) - NDArrayUfuncs: NDArray operator ~/(Object other) - NDArrayUfuncs: NDArray operator -() - abstract final class Blas - Blas: static double dot(NDArray x, NDArray y) — X. y - Blas: static void axpy(double alpha, NDArray x, NDArray y) — Y += alpha x - Blas: static void scal(double alpha, NDArray x) — X *= alpha - Blas: static double nrm2(NDArray x) - Blas: static double asum(NDArray x) — Sum |x_i| - Blas: static int iamax(NDArray x) — Index of the first element of largest |x_i| (-1 for empty). - Blas: static void swap(NDArray x, NDArray y) - Blas: static void copy(NDArray x, NDArray y) — Y = x - Blas: static void rot(NDArray x, NDArray y, double c, double s) — Applies the plane rotation (x, y) <- (c x + s y, c y - s x). - Blas: static (double, double, double) rotg(double a, double b) — (c, s, r) with c s; -s c a; b = r; 0. - Blas: static void gemv(double alpha, NDArray a, NDArray x, double beta, NDArray y, {bool trans = false}) — Y = alpha op(A) x + beta y, op(A) = A or A^T. - Blas: static void ger(double alpha, NDArray x, NDArray y, NDArray a) — A += alpha x y^T - Blas: static void symv(double alpha, NDArray a, NDArray x, double beta, NDArray y) — Y = alpha A x + beta y for symmetric A (the lower triangle is read). - Blas: static void trsv(NDArray t, NDArray x, {bool lower = true, bool trans = false, bool unit = false}) — X <- op(T)^-1 x for triangular T (in place). - Blas: static void gemm(double alpha, NDArray a, NDArray b, double beta, NDArray c, {bool transA = false, bool transB = false}) — C = alpha op(A) op(B) + beta C (the blocked, packed GEMM; transposes are free). - Blas: static void trsm(NDArray t, NDArray b, {bool lower = true, bool trans = false, bool unit = false, double alpha = 1}) — B <- alpha op(T)^-1 B for triangular T (left side), in place; blocked so most of the work is GEMM. - Blas: static void syrk(double alpha, NDArray a, double beta, NDArray c, {bool trans = false}) — C = alpha A A^T + beta C (trans: A^T A); the whole of C is written. - Blas: static void symm(double alpha, NDArray a, NDArray b, double beta, NDArray c) — C = alpha A B + beta C for symmetric A (lower triangle read). - class LinAlgError implements Exception — A linear-algebra failure: singular matrix, not positive definite, no convergence (NumPy's LinAlgError). - LinAlgError: LinAlgError(this.message) - LinAlgError: final String message - LinAlgError: String toString() - final class EighResult — Eigenvalues (ascending) and, optionally, orthonormal eigenvectors (columns) of a real symmetric matrix (the lower triangle is read, as numpy.linalg.eigh's default). - EighResult: final NDArray values - EighResult: final NDArray? vectors - final class SchurResult — Real Schur form A = Z T Z^T: T quasi upper triangular (1x1 blocks for real eigenvalues, 2x2 for complex pairs), Z orthogonal. - SchurResult: final NDArray t - SchurResult: final NDArray z - final class EigResult — Eigenvalues and right eigenvectors (unit 2-norm columns) of a general real matrix, as numpy.linalg.eig: real arrays when every eigenvalue is real, complex otherwise (eigenvalues in Schur order, conjugate pairs adjacent). - EigResult: final NDArray values - EigResult: final NDArray? vectors - final class LUDecomposition — A = P L U for an m x n matrix: L unit lower (m x k), U upper (k x n), k = min(m, n). - LUDecomposition: final Int64List pivots — LAPACK's pivots: row i was swapped with row pivotsi (in order). - LUDecomposition: final int rows - LUDecomposition: final int cols - LUDecomposition: final bool singular — True when U has an exact zero on its diagonal. - LUDecomposition: NDArray get packed — L and U packed in one m x n array (L's unit diagonal not stored), NumPy/SciPy lu_factor layout. - LUDecomposition: List get perm — The row permutation as a list: row i of P^T A is row permi of A. - LUDecomposition: NDArray get p — The permutation matrix P (A = P L U). - LUDecomposition: NDArray get l - LUDecomposition: NDArray get u - LUDecomposition: double get det — det(A) (square only). - LUDecomposition: (double, double) get slogdet — (sign, log|det|), robust against overflow. - LUDecomposition: NDArray solve(NDArray b) — Solves A x = b for a vector or a matrix of right-hand sides. - LUDecomposition: NDArray inverse() - final class LDLDecomposition — P A P^T = L D L^T for a symmetric (possibly indefinite) matrix, Bunch-Kaufman pivoting (D has 1x1 and 2x2 blocks). - LDLDecomposition: final List perm — Row i of P A P^T is row permi of A. - LDLDecomposition: final int n - LDLDecomposition: NDArray get l — Unit lower-triangular L. - LDLDecomposition: NDArray get d — Block-diagonal D (1x1 and symmetric 2x2 blocks). - LDLDecomposition: NDArray get p — The permutation matrix P. - LDLDecomposition: NDArray solve(NDArray b) — Solves A x = b. - final class CpuGemmF32 implements GemmBackend — GEMM in float32 on the CPU (Float32x4 kernels): converts the float64 views, multiplies, adds back. - CpuGemmF32: const CpuGemmF32() - CpuGemmF32: String get name - CpuGemmF32: int get minWork - CpuGemmF32: DType get computeType - CpuGemmF32: bool gemm(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0}) - final class RefinedSolve — The result of solveRefined. - RefinedSolve: final NDArray x — The solution, float64. - RefinedSolve: final int iterations — Refinement steps taken. - RefinedSolve: final bool fellBack — True when refinement didn't converge and the float64 LU solved it instead. - RefinedSolve: final double backwardError — max_j ||b_j - A x_j||_inf / (||A||_inf ||x_j||_inf + ||b_j||_inf). - final class QRDecomposition — A = Q R. - QRDecomposition: final NDArray? q — Orthonormal columns (m x k for 'reduced', m x m for 'complete'; null for mode 'r'). - QRDecomposition: final NDArray r — Upper triangular (k x n or m x n). - final class SVDResult — A = U diag(S) V^T (V^T is vt); S descending, non-negative. - SVDResult: final NDArray? u — M x k ('reduced') or m x m ('full'); null when only values were asked for. - SVDResult: final NDArray s - SVDResult: final NDArray? vt - abstract class NativeLinalg — What a native backend can do. - NativeLinalg: const NativeLinalg() - NativeLinalg: String get name — "accelerate", "raya-native", "raya-native x6" (for logs and benchmark tables). - NativeLinalg: Float64List? allocate(int n) — A zeroed list for a factorization's working matrix, in memory this backend can share with its worker threads (native memory, freed by a finalizer), or null for an ordinary Raya list. - NativeLinalg: bool dgemm(int m, int n, int k, double alpha, Float64List a, int aOff, int aRs, int aCs, Float64List b, int bOff, int bRs, int bCs, double beta, Float64List c, int cOff, int cRs, int cCs) — C = alpha A B + beta C on strided views, as dgemm in gemm.ray. - NativeLinalg: bool sgemm(int m, int n, int k, double alpha, Float32List a, int aOff, int aRs, int aCs, Float32List b, int bOff, int bRs, int bCs, double beta, Float32List c, int cOff, int cRs, int cCs) — Single precision, as sgemm in gemm.ray. - NativeLinalg: bool zgemm(int m, int n, int k, double alpha, Float64List a, int aOff, int aRs, int aCs, Float64List b, int bOff, int bRs, int bCs, double beta, Float64List c, int cOff, int cRs, int cCs) — Complex (interleaved re, im; strides in complex elements), real alpha and beta, as zgemm in gemm.ray. - NativeLinalg: bool dgemvT(int m, int n, double alpha, Float64List a, int aOff, int lda, Float64List x, int xOff, Float64List y, int yOff) — Y0:n += alpha A^T x for an m x n row-major block of A at aOff with row stride lda (for a symmetric A, the symv of the tridiagonal reduction). - NativeLinalg: (Int64List, bool)? getrf(Float64List a, int m, int n) — In-place LU with partial pivoting of an m x n matrix (dgetrf); (0-based pivots, singular) or null. - NativeLinalg: (Int64List, bool)? sgetrf(Float64List a, int n) — A true single-precision LU (sgetrf) of n x n a, whose values are float32 numbers stored as doubles; the factors are written back the same way. - NativeLinalg: bool luSolve(Float64List lu, int n, Float64List x, int nrhs) — Solves with packed LU factors in place (x is n x nrhs; the pivots are already applied by the caller). - NativeLinalg: int? potrf(Float64List a, int n) — In-place lower Cholesky (upper triangle zeroed); the leading minor that is not positive definite (1-based), 0 on success, or null when not handled. - NativeLinalg: Float64List? qr(Float64List a, int m, int n, int qCols) — Householder QR: R in the upper triangle of a (m x n, in place) and Q (m x qCols) returned, or null. - NativeLinalg: (Float64List, Float64List?)? syevd(Float64List a, int n, bool vectors) — Symmetric eigenproblem of full symmetric storage a (n x n, destroyed): ascending values, and when vectors the eigenvectors as columns (row-major n x n). - NativeLinalg: (Float64List?, Float64List, Float64List?)? gesdd(Float64List a, int m, int n, bool vectors, bool full) — SVD of m x n a (destroyed): (U m x uCols, S, V^T vtRows x n) with uCols = vtRows = min(m, n) reduced, m and n full; U and V^T null when not vectors. - NativeLinalg: Float64List? gees(Float64List a, int n) — Real Schur form A = Z T Z^T in place (T in a), Z returned (row-major), or null. - NativeLinalg: (Float64List, Float64List, Float64List?)? geev(Float64List a, int n, bool vectors) — General eigenproblem (dgeev): (wr, wi, right eigenvectors in LAPACK's real packed form, row-major) or null. - abstract final class Linalg — The backend the linear algebra uses. - Linalg: static NativeLinalg? get backend — The active native backend, or null for. - Linalg: static set backend(NativeLinalg? b) - Linalg: static String get backendName — "raya" when no native backend is active. - Linalg: static T using(NativeLinalg? b, T Function() f) — Runs f with b as the backend (null:), then restores the previous one. - Linalg: static Map available() — The backends available on this platform by name ("accelerate", "native", "native-parallel"), for tests and benchmarks. ### Calculus and solvers (riptide_numerics_calculus) import 'package:riptide_numerics_calculus/riptide_numerics_calculus.ray'; Automatic differentiation, ODE solvers (explicit, stiff, symplectic, batched), B-spline, NURBS and RBF interpolation, quadrature, root finding and optimisation. https://riptidecompute.com/raya/docs/numerics-calculus - double derivative(Dual Function(Dual x) f, double x) — The derivative f'(x) of a scalar function written over Dual. - void jacobianForward(DualVectorFunction f, Float64List x, int m, Float64List jac, {Float64List? fx}) — The m x n Jacobian of f at x by forward mode (n passes, one seeded direction each), written row-major into jac. fx, when given, receives f(x). - void gradientForward(Dual Function(List x) f, Float64List x, Float64List grad) — The gradient of a scalar function of n variables written over Dual (n forward passes). - (double, double, double) secondDerivative(HyperDual Function(HyperDual x) f, double x) — f(x), f'(x) and f''(x) of a scalar function written over HyperDual, in one evaluation. - void hessianForward(HyperDual Function(List x) f, Float64List x, Float64List hess, {Float64List? grad}) — The n x n Hessian of a scalar function written over HyperDual, row-major into hess (n(n+1)/2 evaluations). grad, when given, receives the gradient. - void hessianVectorProduct(HyperDual Function(List x) f, Float64List x, Float64List v, Float64List out) — The Hessian-vector product ∇²f(x)·v into out (n evaluations; no Hessian is formed). - double gradientReverse(VarFunction f, Float64List x, Float64List grad, {Tape? tape}) — f(x) and its gradient into grad by reverse mode (one forward + one backward pass). - void jacobianReverse(VarVectorFunction f, Float64List x, int m, Float64List jac, {Float64List? fx, Tape? tape}) — The m x n Jacobian by reverse mode: one recording, m backward passes (cheaper than forward mode when m < n). - void vjp(VarVectorFunction f, Float64List x, Float64List v, Float64List out, {Float64List? fx, Tape? tape}) — Vector-Jacobian product vᵀ J of f at x into out (length n), one backward pass. - int findSpan(Float64List t, int k, double v) — The knot span index l with tl <= v < tl+1 and k <= l < n, where n = t.length - k - 1 (A2.1). - void basisFunctions(Float64List t, int k, int l, double v, Float64List out) — The k + 1 non-zero basis functions N_{l-k..l, k}(v) into out (A2.2). - void basisFunctionDerivatives(Float64List t, int k, int l, double v, int nd, Float64List ders) — Basis functions and their derivatives up to order nd (A2.3): dersd * (k + 1) + r is the d-th derivative of N_{l-k+r, k} at v. - (Float64List, Float64List) insertKnotRaw(Float64List t, Float64List c, int k, int dim, double u) — One Boehm knot insertion on raw arrays: knots t, coefficients c (n x dim), degree k. - Float64List notAKnotKnots(Float64List x, int k) — SciPy's not-a-knot knot vector for interpolation at x with degree k (Greville-like sites for even k). - BSpline makeInterpSpline(Float64List x, Float64List y, {int k = 3, Float64List? t, int dim = 1}) — The interpolating B-spline of degree k through (x_i, y_i) (SciPy's make_interp_spline). - BSpline makeLsqSpline(Float64List x, Float64List y, Float64List t, {int k = 3, Float64List? w}) — The weighted least-squares spline with knots t and degree k (SciPy's make_lsq_spline): minimises Σ (w_i (y_i - s(x_i)))² (the weight multiplies the residual, as in SciPy). - CubicSpline makeSmoothingSpline(Float64List x, Float64List y, {Float64List? w, double? lam, List? chosenLambda}) — The cubic smoothing spline minimising Σ w_i (y_i - f(x_i))² + λ ∫ f''(u)² du (SciPy's make_smoothing_spline). lam null chooses λ by generalised cross-validation over (0, n] as SciPy does. - int findInterval(Float64List x, double v) — Index i of the interval x[i, xi+1) containing v, clamped to 0, x.length - 2. - void solveTridiagonal(Float64List sub, Float64List diag, Float64List sup, Float64List rhs) — Solves a tridiagonal system (Thomas algorithm, no pivoting: for diagonally dominant systems such as cubic splines). sub has length n (sub0 unused), diag n, sup n (supn-1 unused); rhs is overwritten with x. - void matVec(Float64List a, int m, int n, Float64List x, Float64List y) — Y = A x for a row-major m x n matrix. - double dot(Float64List a, Float64List b) - double norm2(Float64List a) - double normInf(Float64List a) - double rmsScaled(Float64List x, Float64List scale) — RMS norm of x / scale (SciPy's norm(x / scale)). - (double, Float64List) validateTolerances(double rtol, Object atol, int n) — Tolerances broadcast to n components; rtol is clamped below at 100·eps as SciPy does. - double selectInitialStep(OdeFunction f, double t0, Float64List y0, double tBound, double maxStep, Float64List f0, double direction, int order, double rtol, Float64List atol) — SciPy's select_initial_step: a first step for a method of order (Hairer I, II.4). - double minStepAt(double t, double direction) — 10 ulps of t in direction: the smallest step the adaptive methods take (SciPy's min_step). - OdeJacobianFunction odeJacobianFromDual(DualOdeFunction f, int n) — A OdeJacobianFunction computed by forward-mode automatic differentiation of f (n passes with Dual numbers). - OdeFunction odeFunctionFromDual(DualOdeFunction f, int n) — An OdeFunction that evaluates a DualOdeFunction on plain values (derivative lanes zero). - Float64List aosToSoa(List aos, int n, int d) — Converts n systems of dimension d between row-major n, d (the tensor layout) and structure-of-arrays. - Float64List soaToAos(List soa, int n, int d) - TensorGraph rk4EnsembleGraph(String name, int n, int d, double h, int steps, TensorRhs rhs) — Records steps fixed RK4 steps of size h for n systems of dimension d: input y0 n, d (float32), output y. - TensorRhs dampedOscillatorRhs(double omega, double zeta) — Damped harmonic oscillators, d = 2 (x, v): x' = v, v' = -2ζω v - ω² x. - TensorRhs lorenzRhs({double sigma = 10, double rho = 28, double beta = 8 / 3}) — The Lorenz system, d = 3. - TensorRhs centralGravityRhs({double gm = 1, double softening = 1e-3}) — Particles in a softened central gravity field in the plane, d = 4 (x, y, vx, vy): a = -GM r / (|r|² + ε²)^1.5. - OdeFunction dampedOscillatorBatch(int n, double omega, double zeta) — The CPU (structure-of-arrays, float64) counterparts of the tensor right-hand sides, for EnsembleIntegrator. - OdeFunction lorenzBatch(int n, {double sigma = 10, double rho = 28, double beta = 8 / 3}) - OdeFunction centralGravityBatch(int n, {double gm = 1, double softening = 1e-3}) - OdeStepper createStepper(OdeMethod method, OdeFunction f, double t0, Float64List y0, double t1, {double rtol = 1e-3, Object atol = 1e-6, double maxStep = double.infinity, double? firstStep, OdeJacobianFunction? jac}) — Creates the stepper for method. - OdeSolution solveIvp(OdeFunction f, (double, double) span, List y0, {OdeMethod method = OdeMethod.rk45, double rtol = 1e-3, Object atol = 1e-6, List? tEval, bool denseOutput = false, List events = const [], double maxStep = double.infinity, double? firstStep, OdeJacobianFunction? jac, DualOdeFunction? dualFun}) — Solves y' = f(t, y), y(t0) = y0 on span = (t0, t1), like SciPy's solve_ivp. - double brentRoot(double Function(double) f, double a, double b, {double xtol = 2e-12, double rtol = 8.881784197001252e-16, int maxIter = 100}) — Brent's root finder on a, b (f(a) and f(b) of opposite sign or zero), as SciPy's brentq. - ValueAndGradient valueAndGradientForward(Dual Function(List x) f) — A value-and-gradient callback from a function written over Dual (forward mode: n passes per call). - ValueAndGradient valueAndGradientReverse(VarFunction f) — A value-and-gradient callback from a function written over Var (reverse mode: one backward pass per call; the tape is reused across calls). - ValueAndGradient valueAndGradientNumeric(ObjectiveFunction f, {double? step}) — A value-and-gradient callback from a plain objective by central differences (2n extra evaluations per call). - JacobianFunction jacobianNumeric(VectorFunction f, int m) — A Jacobian callback by forward differences of f (m outputs): n extra evaluations per call. - JacobianFunction jacobianFromDual(DualVectorFunction f, int m) — A Jacobian callback from a vector function written over Dual (forward mode). - OptimizeResult minimizeLbfgsb(ValueAndGradient fg, Float64List x0, {Float64List? lower, Float64List? upper, int m = 10, double ftol = 2.220446049250313e-09, double gtol = 1e-5, int maxiter = 15000, int maxfun = 15000}) — Minimises f subject to loweri ≤ xi ≤ upperi (use ±infinity for no bound). lower/upper null means unbounded, so this is also plain L-BFGS. - OptimizeResult leastSquaresLm(VectorFunction residuals, Float64List x0, int m, {JacobianFunction? jacobian, double ftol = 1e-8, double xtol = 1e-8, double gtol = 1e-8, int? maxfev}) — Least squares by Levenberg–Marquardt. residuals writes the m residuals; jacobian the m x n Jacobian (default: forward differences; pass jacobianFromDual for exact derivatives). - OptimizeResult leastSquaresDogbox(VectorFunction residuals, Float64List x0, int m, {JacobianFunction? jacobian, Float64List? lower, Float64List? upper, double ftol = 1e-8, double xtol = 1e-8, double gtol = 1e-8, int? maxfev}) — Bounded least squares by the rectangular trust-region dogleg ('dogbox'). lower/upper may hold ±infinity. - OptimizeResult solveNewton(VectorFunction system, Float64List x0, {JacobianFunction? jacobian, double tol = 1e-10, double xtol = 1e-12, int maxiter = 100}) — Solves the square system F(x) = 0 by Newton's method with backtracking on ½‖F‖². jacobian defaults to forward differences. - OptimizeResult linprog(Float64List c, {Float64List? aUb, Float64List? bUb, Float64List? aEq, Float64List? bEq, Float64List? lower, Float64List? upper, int maxiter = 10000}) — Solves the linear program min cᵀx s.t. aUb x ≤ bUb, aEq x = bEq, lower ≤ x ≤ upper. - OptimizeResult quadprog(Float64List g, Float64List c, {Float64List? aEq, Float64List? bEq, Float64List? aUb, Float64List? bUb, Float64List? x0, int maxiter = 1000}) — Solves the convex QP min ½xᵀgx + cᵀx s.t. aEq x = bEq, aUb x ≤ bUb by the primal active-set method. g is n x n row-major. x0, when given, must be feasible; otherwise a feasible point is found by the simplex phase 1. - OptimizeResult minimizeBfgs(ValueAndGradient fg, Float64List x0, {double gtol = 1e-5, int? maxiter}) — BFGS with a strong-Wolfe line search. - OptimizeResult minimizeCg(ValueAndGradient fg, Float64List x0, {double gtol = 1e-5, int? maxiter}) — Nonlinear conjugate gradient, Polak–Ribière+ with a strong-Wolfe line search (c₂ = 0.4, SciPy's method='CG'). - OptimizeResult minimizeNewton(ValueAndGradient fg, HessianFunction hess, Float64List x0, {double gtol = 1e-8, int maxiter = 200}) — Newton's method with an exact Hessian (e.g. hessianForward over HyperDual): the Newton step from a Cholesky factorisation of ∇²f + τI (τ raised until positive definite, Nocedal & Wright Alg. 3.3) and a Wolfe line search. - OptimizeResult minimizeNelderMead(ObjectiveFunction f, Float64List x0, {double xatol = 1e-4, double fatol = 1e-4, int? maxiter, int? maxfev, bool adaptive = true}) — Nelder–Mead simplex search (no derivatives), SciPy's method='Nelder-Mead' with adaptive=True parameters. - ScalarResult bisect(double Function(double x) f, double a, double b, {double xtol = 2e-12, double rtol = 4 * _eps, int maxiter = 200}) — Bisection on a, b (f(a) and f(b) of opposite sign). - ScalarResult brentq(double Function(double x) f, double a, double b, {double xtol = 2e-12, double rtol = 4 * _eps, int maxiter = 100}) — Brent's method on a bracket a, b (SciPy's brentq): inverse quadratic interpolation with bisection safeguards. - ScalarResult newton(double Function(double x) f, double x0, {double Function(double x)? fprime, double Function(double x)? fprime2, double tol = 1.48e-8, int maxiter = 50}) — Newton's method from x0 (SciPy's newton): with fprime it is Newton (quadratic convergence), with fprime and fprime2 Halley (cubic), with neither the secant method (order 1.618). - ScalarResult secant(double Function(double x) f, double x0, {double? x1, double tol = 1.48e-8, int maxiter = 50}) — The secant method from x0 and x1 (default x0·(1 + 1e-4) + 1e-4, SciPy's choice). - ScalarResult newtonAD(Dual Function(Dual x) f, double x0, {double tol = 1.48e-8, int maxiter = 50}) — Newton's method with the derivative from forward-mode autodiff (one Dual evaluation per iteration). - ScalarResult halleyAD(HyperDual Function(HyperDual x) f, double x0, {double tol = 1.48e-8, int maxiter = 50}) — Halley's method with f' and f'' from one HyperDual evaluation per iteration (cubic convergence). - ScalarResult minimizeScalarBounded(double Function(double x) f, double a, double b, {double xatol = 1e-5, int maxiter = 500}) — The minimum of f on a, b by Brent's method (SciPy's minimize_scalar(method='bounded') / fminbound). - ScalarResult goldenSection(double Function(double x) f, double a, double b, {double xtol = 1e-8, int maxiter = 500}) — Golden-section search for the minimum of a unimodal f on a, b (linear convergence, no assumptions on smoothness). - QuadResult monteCarlo(double Function(Float64List x) f, List lower, List upper, {int n = 100000, math.Random? rng}) — ∫ over lower, upper of f by plain Monte Carlo with n uniform points; the error is one standard error. - QuadResult quasiMonteCarlo(double Function(Float64List x) f, List lower, List upper, {int n = 4096, int replicates = 8, math.Random? rng}) — ∫ over lower, upper of f by randomised quasi-Monte Carlo: replicates digitally shifted Sobol sequences of n points each (n a power of two keeps the balance properties); the value is their mean and the error the… - (double, double, double, double) gaussKronrod21(double Function(double) f, double a, double b) — QK21: the 21-point Gauss–Kronrod rule on a, b with the 10-point Gauss error estimate. - QuadResult quad(double Function(double) f, double a, double b, {double epsabs = 1.49e-8, double epsrel = 1.49e-8, int limit = 50}) — ∫ₐᵇ f(x) dx by adaptive Gauss–Kronrod with epsilon-algorithm extrapolation (scipy.integrate.quad). - (Float64List nodes, Float64List weights) gaussLegendre(int n) — Gauss–Legendre nodes and weights on -1, 1 for n points: exact for polynomials of degree 2n − 1. - double fixedQuad(double Function(double) f, double a, double b, {int n = 5}) — ∫ₐᵇ f by n-point Gauss–Legendre (scipy.integrate.fixed_quad). - QuadResult romberg(double Function(double) f, double a, double b, {double tol = 1.48e-8, double rtol = 1.48e-8, int maxLevels = 20}) — ∫ₐᵇ f by Romberg integration: trapezoid sums with 2^k panels, Richardson-extrapolated, until two diagonal entries agree to tol (absolute) or rtol (relative). - QuadResult tanhSinh(double Function(double) f, double a, double b, {double tol = 1e-12, int maxLevel = 10}) — ∫ₐᵇ f by tanh-sinh (double-exponential) quadrature: x = tanh(π/2 · sinh t), trapezoid in t with step halved each level until successive levels agree to tol·max(1, |I|). - QuadResult tanhSinhDistances(double Function(double x, double fromA, double fromB) f, double a, double b, {double tol = 1e-12, int maxLevel = 10}) — Tanh-sinh with an integrand that also receives each node's distances to the endpoints, f(x, x − a, b − x), computed exactly: write singular factors in terms of them (1/√(1 − x²) as 1/√((x − a)(b − x)) on −1, 1) and the… - QuadResult quadBox(double Function(Float64List x) f, List lower, List upper, {double epsabs = 1.49e-8, double epsrel = 1.49e-8, int limit = 50}) — ∫ over the box lower, upper (any dimension) of f by nested adaptive Gauss–Kronrod (scipy.integrate.nquad): the outermost variable is the first coordinate. - const double odeEps = 2.220446049250313e-16 — Machine epsilon for doubles. - const RkTableau dormandPrince54 — Dormand–Prince 5(4), as in SciPy's RK45 (the error estimator is 4th order, the solution 5th; dense output is Shampine's 4th-order interpolant). - final RkTableau tsitouras54 — Tsitouras 5(4) (Tsit5). - typedef DualVectorFunction = void Function(List x, List out) — A vector function written over Dual: reads x (length n), writes out (length m). - typedef VarFunction = Var Function(List x) — A scalar function written over Vars. - typedef VarVectorFunction = List Function(List x) — A vector function written over Vars: returns its m outputs. - typedef OdeFunction = void Function(double t, Float64List y, Float64List dydt) — Dy/dt = f(t, y): reads y, writes dydt. - typedef OdeJacobianFunction = void Function(double t, Float64List y, Float64List jac) — ∂f/∂y at (t, y), written row-major (n x n) into jac. - typedef DualOdeFunction = void Function(Dual t, List y, List dydt) — The right-hand side written over Dual numbers, for an automatic Jacobian (see odeJacobianFromDual). - typedef TensorRhs = Tensor Function(Tensor y) — A vectorised right-hand side over an n, d tensor (autonomous: no t). - typedef AccelerationFunction = void Function(Float64List q, Float64List a) — Writes the acceleration a(q) (force / mass) for positions q into a. - typedef ObjectiveFunction = double Function(Float64List x) — An objective f(x). - typedef ValueAndGradient = double Function(Float64List x, Float64List grad) — f(x), writing ∇f(x) into grad. - typedef VectorFunction = void Function(Float64List x, Float64List out) — A vector function: reads x, writes out (residuals or a system's equations). - typedef JacobianFunction = void Function(Float64List x, Float64List jac) — A Jacobian: reads x, writes the m x n Jacobian row-major into jac. - typedef HessianFunction = void Function(Float64List x, Float64List hess) — A Hessian callback: writes ∇²f(x) row-major into hess. - extension type const Dual._(Float64x2 _p) — A dual number: value + deriv·ε. - Dual: Dual(double value, [double deriv = 0]) — Value + deriv·ε. - Dual: Dual.constant(double value) — A constant (derivative 0). - Dual: Dual.variable(double value) — The independent variable at value (derivative 1). - Dual: static Dual atan2(Dual y, Dual x) - Dual: static Dual max(Dual a, Dual b) - Dual: static Dual min(Dual a, Dual b) - Dual: double get value - Dual: double get deriv - Dual: Dual addScalar(double c) — This + c for a plain double. - Dual: Dual scale(double c) — This · c for a plain double (both lanes scaled: one instruction). - Dual: Dual chain(double fv, double dfv) — Applies f with f(value) = fv and f'(value) = dfv: (f(a), f'(a)·a'). - Dual: Dual sin() - Dual: Dual cos() - Dual: Dual tan() - Dual: Dual exp() - Dual: Dual log() - Dual: Dual sqrt() - Dual: Dual pow(double k) - Dual: Dual powDual(Dual o) — Thisᵒ for a dual exponent: exp(o · log(this)). - Dual: Dual tanh() - Dual: Dual atan() - Dual: Dual asin() - Dual: Dual acos() - Dual: Dual abs() - Dual: Dual square() - Dual: Dual operator +(Dual o) - Dual: Dual operator -(Dual o) - Dual: Dual operator -() - Dual: Dual operator *(Dual o) - Dual: Dual operator /(Dual o) - Dual: bool operator <(Dual o) - Dual: bool operator >(Dual o) - Dual: bool operator <=(Dual o) - Dual: bool operator >=(Dual o) - final class HyperDual — A hyper-dual number: v + d1·ε₁ + d2·ε₂ + d12·ε₁ε₂. - HyperDual: const HyperDual(this.v, [this.d1 = 0, this.d2 = 0, this.d12 = 0]) - HyperDual: const HyperDual.constant(double value) — A constant. - HyperDual: const HyperDual.variable(double value) — The independent variable of a scalar function (both directions seeded): f(x), f'(x), f'(x), f''(x). - HyperDual: final double v - HyperDual: final double d1 - HyperDual: final double d2 - HyperDual: final double d12 - HyperDual: HyperDual addScalar(double c) - HyperDual: HyperDual scale(double c) - HyperDual: HyperDual chain(double f0, double f1, double f2) — f(this) given f(v) = f0, f'(v) = f1, f''(v) = f2. - HyperDual: HyperDual reciprocal() - HyperDual: HyperDual sin() - HyperDual: HyperDual cos() - HyperDual: HyperDual exp() - HyperDual: HyperDual log() - HyperDual: HyperDual sqrt() - HyperDual: HyperDual pow(double k) - HyperDual: HyperDual tanh() - HyperDual: HyperDual atan() - HyperDual: HyperDual square() - HyperDual: HyperDual operator +(HyperDual o) - HyperDual: HyperDual operator -(HyperDual o) - HyperDual: HyperDual operator -() - HyperDual: HyperDual operator *(HyperDual o) - HyperDual: HyperDual operator /(HyperDual o) - final class Tape — A tape recording operations on Vars for reverse-mode differentiation. - Tape: Tape([int capacity = 256]) - Tape: static Tape get current — The tape Var operations record onto (the last one begin was called on). - Tape: int get length — Number of nodes recorded. - Tape: void begin() — Clears the recording (keeping the storage) and makes this the active tape. - Tape: Var variable(double value) — A new independent variable (an input of the function). - Tape: VarVec variables(Float64List values) — A vector of independent variables. - Tape: Var constant(double value) — A constant (no edges; its adjoint is computed but not used). - Tape: double value(Var v) - Tape: double adjoint(Var v) — The adjoint ∂out/∂v after backward. - Tape: void backward(Var out) — Seeds ∂out/∂out = 1 and propagates adjoints to every node. - Tape: void backwardSeeded(List outs, Float64List seed) — Vector-Jacobian product: seeds the adjoints of outs with seed and propagates; read the result with inputAdjoints. - Tape: void inputAdjoints(Float64List out) — The adjoints of the inputs (in the order they were created) into out. - Tape: VarVec add(VarVec a, VarVec b) — Elementwise a + b. - Tape: VarVec sub(VarVec a, VarVec b) — Elementwise a - b. - Tape: VarVec mul(VarVec a, VarVec b) — Elementwise a · b. - Tape: VarVec scale(VarVec a, double c) — A · c for a constant c. - Tape: VarVec sin(VarVec a) - Tape: VarVec cos(VarVec a) - Tape: VarVec exp(VarVec a) - Tape: VarVec log(VarVec a) - Tape: VarVec tanh(VarVec a) - Tape: VarVec square(VarVec a) - Tape: Var sum(VarVec a) — Σ aᵢ (one node, n edges). - Tape: Var dot(VarVec a, VarVec b) — Σ aᵢbᵢ (one node, 2n edges). - Tape: VarVec matVec(Float64List a, int m, VarVec x) — Y = A x for a constant row-major m x n matrix a (one node per row, n edges each). - Tape: Float64List values(VarVec v) — The values of v into a new list. - extension type const Var._(int _i) — A recorded scalar on the Tape.current tape (an index into it; nothing is allocated). - Var: static Var atan2(Var y, Var x) - Var: int get index — Index of the node on its tape. - Var: double get value - Var: Var addScalar(double c) - Var: Var scale(double c) - Var: Var sin() - Var: Var cos() - Var: Var tan() - Var: Var exp() - Var: Var log() - Var: Var sqrt() - Var: Var pow(double k) - Var: Var tanh() - Var: Var atan() - Var: Var abs() - Var: Var square() - Var: Var operator +(Var o) - Var: Var operator -(Var o) - Var: Var operator *(Var o) - Var: Var operator /(Var o) - Var: Var operator -() - final class VarVec — A contiguous run of recorded scalars (the reverse-mode view of a float64 vector). - VarVec: final int start - VarVec: final int length - VarVec: Var operator [](int k) - class BSpline — A spline of degree k in B-spline form: s(v) = Σ c_i B_{i,k}(v), knots t (non-decreasing), n = t.length - k - 1 coefficients, each of dimension dim (dim > 1 for curves; c is n x dim row-major). - BSpline: BSpline(this.t, this.c, this.k, {this.dim = 1}) - BSpline: static Float64List designMatrix(Float64List x, Float64List t, int k) — The m x n design matrix B_j(x_i), dense row-major (SciPy's BSpline.design_matrix, as a dense array). - BSpline: final Float64List t - BSpline: final Float64List c - BSpline: final int k - BSpline: final int dim - BSpline: int get n — The number of coefficients. - BSpline: double get lower — The base interval t[k, tn]. - BSpline: double get upper - BSpline: double call(double v, [int nu = 0]) — The value (or nuth derivative) of a scalar spline at v. - BSpline: void evalInto(double v, Float64List out, [int nu = 0]) — The value (or nuth derivative) at v written into out (length dim). - BSpline: Float64List evalAll(Float64List v, [int nu = 0]) — Evaluates a scalar spline at every point of v. - BSpline: BSpline derivative([int nu = 1]) — The derivative spline (degree k - 1, knots t1..-1). - BSpline: BSpline antiderivative() — The antiderivative spline (degree k + 1), zero at t0 (SciPy's splantider: one knot added at each end). - BSpline: double integrate(double a, double b) — ∫ₐᵇ s for a scalar spline. - BSpline: BSpline insertKnot(double u, [int times = 1]) — A new spline equal to this one with knot u inserted times times (Boehm's algorithm). - BSpline: PPoly toPPoly() — Converts to piecewise polynomial form over the distinct knots of the base interval. - class CatmullRomSpline — A Catmull–Rom spline through points (count x dim, row-major). - CatmullRomSpline: CatmullRomSpline(this.points, {required this.dim, this.alpha = 0.5, this.closed = false}) - CatmullRomSpline: final Float64List points - CatmullRomSpline: final int dim - CatmullRomSpline: final int count - CatmullRomSpline: final double alpha — 0 uniform, 0.5 centripetal, 1 chordal. - CatmullRomSpline: final bool closed - CatmullRomSpline: int get segments - CatmullRomSpline: void pointInto(double s, Float64List out) — The point at parameter s (in 0, segments) into out. - CatmullRomSpline: Float64List point(double s) - class GridInterpolator — Tensor-product spline interpolation of values on the grid axes (values row-major, last axis fastest). - GridInterpolator: GridInterpolator(List axes, Float64List values, {this.degree = 3, this.outside = GridOutside.nan}) - GridInterpolator: final List axes - GridInterpolator: final int dims - GridInterpolator: final int degree - GridInterpolator: final GridOutside outside - GridInterpolator: double call(List point, {List? derivs}) — The value at point (length dims); derivs gives the derivative order along each axis (default none). - enum GridOutside — Out-of-range behaviour of GridInterpolator. - GridOutside: nan — NaN (scipy's RegularGridInterpolator with bounds_error=False, fill_value=nan). - GridOutside: extrapolate — Continue the end polynomial pieces. - GridOutside: error — Throw a RangeError. - class NurbsCurve — A NURBS curve of degree in dim dimensions: knots, control points (n x dim, row-major) and weights. - NurbsCurve: NurbsCurve(this.degree, this.knots, this.points, this.weights, {required this.dim}) - NurbsCurve: factory NurbsCurve.fromBSpline(BSpline s) — A non-rational B-spline curve as a NURBS curve (all weights 1). - NurbsCurve: factory NurbsCurve.circle(List center, double radius) — The full circle of radius around center in the xy-plane (2-D or 3-D center): nine control points on the circumscribed square, degree 2, corner weights √2/2. - NurbsCurve: factory NurbsCurve.arc(List center, double radius, double start, double end, {List? xAxis, List? yAxis}) — The circular arc from start to end (radians, counter-clockwise, |end - start| <= 2π) of radius around center, in the plane spanned by xAxis and yAxis (unit, orthogonal; default the xy-plane). - NurbsCurve: factory NurbsCurve.arcTurns(List center, double radius, Turn start, Turn step, int segments, {List? xAxis, List? yAxis}) — The circular arc of radius around center that starts at the direction start and makes segments steps of the turn step (at most a quarter turn: step.c ≥ 0), counter-clockwise in the plane of xAxis and yAxis. - NurbsCurve: final int degree - NurbsCurve: final int dim - NurbsCurve: final Float64List knots - NurbsCurve: final Float64List points - NurbsCurve: final Float64List weights - NurbsCurve: double get lower - NurbsCurve: double get upper - NurbsCurve: void pointInto(double u, Float64List out) — The point at parameter u into out (length dim). - NurbsCurve: Float64List point(double u) - NurbsCurve: Float64List derivatives(double u, int order) — Derivatives C^(0..order) at u (A4.2), as (order + 1) x dim row-major. - NurbsCurve: NurbsCurve insertKnot(double u, [int times = 1]) — The curve with knot u inserted times times (same shape, one more control point per insertion). - NurbsCurve: double length([double? a, double? b]) — Arc length over a, b (default the whole curve): 8-point Gauss–Legendre per knot span, 4 subdivisions. - class NurbsSurface — A NURBS surface: degrees p (u) and q (v), knots uKnots and vKnots, a control net of nu x nv points (row-major: point (i, j) at (i * nv + j) * dim) and weights (nu x nv). - NurbsSurface: NurbsSurface(this.p, this.q, this.uKnots, this.vKnots, this.points, this.weights, {required this.nu, required this.nv, this.dim = 3}) - NurbsSurface: factory NurbsSurface.extrude(NurbsCurve curve, List direction) — The surface swept by moving curve along direction (degree 1 in v; a cylinder from a circle). - NurbsSurface: factory NurbsSurface.revolve(NurbsCurve profile) — The surface of revolution of a profile curve in the xz-plane (3-D points with y = 0, x >= 0) about the z-axis, a full turn (A8.1): the profile is v, the circle is u. - NurbsSurface: final int p - NurbsSurface: final int q - NurbsSurface: final int nu - NurbsSurface: final int nv - NurbsSurface: final int dim - NurbsSurface: final Float64List uKnots - NurbsSurface: final Float64List vKnots - NurbsSurface: final Float64List points - NurbsSurface: final Float64List weights - NurbsSurface: Float64List derivatives(double u, double v, int order) — Partial derivatives S_{k,l}(u, v) for k + l <= order (A4.4): result(k * (order + 1) + l) * dim + d. - NurbsSurface: Float64List point(double u, double v) — The point S(u, v). - NurbsSurface: Float64List normal(double u, double v) — The unit normal Su × Sv (3-D surfaces). - NurbsSurface: NurbsSurface insertKnot(double value, {bool inU = true}) — The surface with value inserted once into the u knots (inU) or the v knots: every row/column of the net goes through curve knot insertion in homogeneous coordinates. - enum Extrapolate — How a 1-D interpolant evaluates outside x0, xn. - Extrapolate: extend — Continue the first/last polynomial piece (SciPy's extrapolate=True). - Extrapolate: nan — Return NaN (SciPy's extrapolate=False). - Extrapolate: periodic — Wrap the argument into the base interval (SciPy's extrapolate='periodic'). - class PPoly — A piecewise polynomial in local power form: on x[i, xi+1], p(v) = Σ_m ci (v - xi)^(k - m), degree k (SciPy's PPoly layout, highest power first). - PPoly: PPoly(this.x, this.c, {this.extrapolate = Extrapolate.extend}) - PPoly: final Float64List x — Breakpoints (strictly increasing). - PPoly: final List c — Coefficients, ci for power k - m on interval i. - PPoly: final int k - PPoly: final Extrapolate extrapolate - PPoly: double get lower - PPoly: double get upper - PPoly: double call(double v, [int nu = 0]) — The nuth derivative at v. - PPoly: Float64List evalAll(Float64List v, [int nu = 0]) — Evaluates at every point of v into a new list. - PPoly: PPoly derivative([int nu = 1]) — The derivative as a new piecewise polynomial of degree k - 1. - PPoly: PPoly antiderivative() — The antiderivative that is 0 at x0 and continuous, degree k + 1. - PPoly: double integrate(double a, double b) — ∫ₐᵇ p (with the same extrapolation rule; periodic integrates whole periods exactly). - PPoly: List solve([double y = 0]) — Real roots of p(v) = y on the breakpoint range (each interval's cubic or lower solved by bracketing; for degree ≤ 3). - class CubicHermiteSpline extends PPoly — Piecewise cubic Hermite interpolation from values y and slopes dydx at x (SciPy's CubicHermiteSpline). - CubicHermiteSpline: CubicHermiteSpline(Float64List x, Float64List y, Float64List dydx, {super.extrapolate}) - sealed class SplineBoundary — A boundary condition of a CubicSpline. - SplineBoundary: const SplineBoundary() - SplineBoundary: static const notAKnot = _NotAKnot() — The first and second piece are the same cubic (the third derivative is continuous at x1); SciPy's default. - SplineBoundary: static const natural = SecondDerivative(0) — Second derivative zero at the end. - SplineBoundary: static const clamped = FirstDerivative(0) — First derivative zero at the end. - SplineBoundary: static const periodic = _Periodic() — Periodic (y0 must equal yn-1); set on both ends. - final class FirstDerivative extends SplineBoundary — A prescribed first derivative at the end. - FirstDerivative: const FirstDerivative(this.value) - FirstDerivative: final double value - final class SecondDerivative extends SplineBoundary — A prescribed second derivative at the end. - SecondDerivative: const SecondDerivative(this.value) - SecondDerivative: final double value - class CubicSpline extends CubicHermiteSpline — Cubic spline interpolation, twice continuously differentiable (SciPy's CubicSpline: slopes from a tridiagonal system, solved here by banded LU with pivoting since not-a-knot rows are not diagonally dominant). - CubicSpline: factory CubicSpline(Float64List x, Float64List y, {SplineBoundary left = SplineBoundary.notAKnot, SplineBoundary? right, Extrapolate? extrapolate}) - class PchipInterpolator extends CubicHermiteSpline — Shape-preserving monotone piecewise cubic (Fritsch–Carlson slopes with SciPy's weighted harmonic mean and three-point end slopes; PchipInterpolator). - PchipInterpolator: PchipInterpolator(Float64List x, Float64List y, {super.extrapolate}) - class AkimaInterpolator extends CubicHermiteSpline — Akima's 1970 interpolant (and the modified "makima" variant, which avoids overshoot on flat runs): slopes from a weighted average of neighbouring secants (SciPy's Akima1DInterpolator; out-of-range is NaN by default). - AkimaInterpolator: AkimaInterpolator(Float64List x, Float64List y, {bool modified = false, super.extrapolate = Extrapolate.nan}) - class LinearInterpolator — Piecewise linear interpolation with a choice of out-of-range behaviour (numpy.interp clamps; SciPy's interp1d extrapolates or fills). - LinearInterpolator: LinearInterpolator(this.x, this.y, {this.outside = LinearOutside.clamp}) - LinearInterpolator: final Float64List x - LinearInterpolator: final Float64List y - LinearInterpolator: final LinearOutside outside - LinearInterpolator: double call(double v) - enum LinearOutside — Out-of-range behaviour of LinearInterpolator. - LinearOutside: clamp - LinearOutside: extrapolate - LinearOutside: nan - LinearOutside: error - enum RbfKernel — RBF kernels φ(r), r = ε‖x − y‖ (SciPy's names and signs). - RbfKernel: linear(0, true) - RbfKernel: thinPlateSpline(1, true) - RbfKernel: cubic(1, true) - RbfKernel: quintic(2, true) - RbfKernel: multiquadric(0, false) - RbfKernel: inverseMultiquadric(-1, false) - RbfKernel: inverseQuadratic(-1, false) - RbfKernel: gaussian(-1, false) - RbfKernel: const RbfKernel(this.minDegree, this.scaleInvariant) - RbfKernel: final int minDegree — The lowest polynomial degree that keeps the system solvable (-1: none needed). - RbfKernel: final bool scaleInvariant — Whether ε has no effect (it may then be left at 1). - RbfKernel: double phi(double r) - class RbfInterpolator — An RBF interpolant s(x) = Σ c_i φ(ε‖x − y_i‖) + Σ b_j p_j(x) through values at centers (n x dim). values may carry outputs values per centre. smoothing > 0 gives a smoothing (not interpolating) fit. degree defaults to… - RbfInterpolator: RbfInterpolator(this.centers, Float64List values, {required this.dim, this.kernel = RbfKernel.thinPlateSpline, double? epsilon, this.smoothing = 0, int? degree, this.outputs = 1}) - RbfInterpolator: final Float64List centers - RbfInterpolator: final int dim - RbfInterpolator: final int n - RbfInterpolator: final int degree - RbfInterpolator: final int outputs - RbfInterpolator: final RbfKernel kernel - RbfInterpolator: final double epsilon - RbfInterpolator: final double smoothing - RbfInterpolator: void evalInto(Float64List x, Float64List out) — The interpolant at x (length dim) into out (length outputs). - RbfInterpolator: double call(List x) — The (first output of the) interpolant at x. - class SingularMatrixException implements Exception — Thrown when a factorisation meets a singular (or, for Cholesky, non-positive-definite) matrix. - SingularMatrixException: SingularMatrixException(this.message) - SingularMatrixException: final String message - SingularMatrixException: String toString() - final class DenseLu — LU factorisation with partial pivoting of an n x n row-major matrix, P A = L U, stored in place (L unit lower). - DenseLu: DenseLu(Float64List a, this.n, {bool inPlace = false}) — Factors a (n x n, row-major). a is copied unless inPlace. - DenseLu: final int n - DenseLu: final Float64List lu - DenseLu: final Int32List piv - DenseLu: int sign — +1 or -1: the sign of the row permutation (for the determinant). - DenseLu: double get determinant - DenseLu: void solveInPlace(Float64List b) — Solves A x = b in place in b. - DenseLu: Float64List solve(Float64List b) — A new vector x with A x = b. - DenseLu: double rcondEstimate(double anorm1) — Reciprocal condition estimate in the 1-norm from the factors (cheap lower bound on 1/cond, LAPACK dgecon-like: one solve with a +-1 right-hand side). - final class DenseCholesky — Cholesky factorisation A = L Lᵀ of a symmetric positive-definite row-major matrix (lower triangle used). - DenseCholesky: DenseCholesky(Float64List a, this.n) - DenseCholesky: final int n - DenseCholesky: final Float64List l - DenseCholesky: void solveInPlace(Float64List b) - final class DenseQr — Householder QR of an m x n (m >= n) row-major matrix; solves least squares min ||A x - b||₂. - DenseQr: DenseQr(Float64List a, this.m, this.n) - DenseQr: final int m - DenseQr: final int n - DenseQr: final Float64List qr - DenseQr: final Float64List tau - DenseQr: void applyQt(Float64List b) — Applies Qᵀ to b (length m) in place. - DenseQr: Float64List solve(Float64List b) — The least-squares solution x (length n) of A x ≈ b. - final class BdfStepper extends OdeStepper — Variable-order BDF stepper (SciPy's BDF). jac analytic, else finite differences (FiniteDifferenceJacobian); for an automatic Jacobian pass odeJacobianFromDual(...) as jac. - BdfStepper: BdfStepper(this.f, double t0, Float64List y0, this.tBound, {this.jac, double rtol = 1e-3, Object atol = 1e-6, this.maxStep = double.infinity, double? firstStep}) - BdfStepper: final OdeFunction f - BdfStepper: final OdeJacobianFunction? jac - BdfStepper: final double tBound - BdfStepper: final double maxStep - BdfStepper: final double direction - BdfStepper: final int n - BdfStepper: late final double rtol - BdfStepper: late final Float64List atol - BdfStepper: late final double newtonTol - BdfStepper: int order - BdfStepper: double get t - BdfStepper: Float64List get y - BdfStepper: double get tOld - BdfStepper: double get stepSize - BdfStepper: bool step() - BdfStepper: void denseInto(double time, Float64List out) - BdfStepper: DenseSegment denseSegment() - enum OdeStatus — Why a stepper stopped. - OdeStatus: running - OdeStatus: finished - OdeStatus: failed - abstract class OdeStepper — An incremental solver: call step until status is not OdeStatus.running. - OdeStepper: double get t — The current time and state. - OdeStepper: Float64List get y - OdeStepper: double get tOld — The start of the last accepted step. - OdeStepper: double get stepSize — The step-size estimate for the next step (absolute). - OdeStepper: int get n - OdeStepper: OdeStatus status - OdeStepper: String? message - OdeStepper: int nfev - OdeStepper: int njev - OdeStepper: int nlu - OdeStepper: bool step() — Advances one accepted step (or to the bound). - OdeStepper: void denseInto(double time, Float64List out) — The last step's interpolant at time (in tOld, t) into out. - OdeStepper: DenseSegment denseSegment() — A copy of the last step's interpolant, valid after later steps (for OdeSolution.sol). - abstract class DenseSegment — One step's continuous extension. - DenseSegment: double get tMin - DenseSegment: double get tMax - DenseSegment: void evaluate(double t, Float64List out) - final class FiniteDifferenceJacobian — A finite-difference Jacobian: forward differences with SciPy's step rule h_j = sqrt(eps)·max(|y_j|, atol_j) (num_jac without its adaptive refinement). - FiniteDifferenceJacobian: FiniteDifferenceJacobian(this.f, this.n, this.atol) - FiniteDifferenceJacobian: final OdeFunction f - FiniteDifferenceJacobian: final int n - FiniteDifferenceJacobian: final Float64List atol - FiniteDifferenceJacobian: int nfev - FiniteDifferenceJacobian: void call(double t, Float64List y, Float64List fy, Float64List jac) - enum EnsembleMethod - EnsembleMethod: rk4 — Classic RK4. - EnsembleMethod: dopri5 — Dormand–Prince 5(4) at a fixed step, with a per-system error estimate. - final class EnsembleIntegrator — Fixed-step integration of n systems of dimension d stored structure-of-arrays (yk * n + i); f receives and fills the whole batch. step allocates nothing. - EnsembleIntegrator: EnsembleIntegrator(this.f, this.n, this.d, {this.method = EnsembleMethod.rk4}) - EnsembleIntegrator: final OdeFunction f - EnsembleIntegrator: final int n - EnsembleIntegrator: final int d - EnsembleIntegrator: final EnsembleMethod method - EnsembleIntegrator: final Float64List errorEstimate — For EnsembleMethod.dopri5: after each step, max_k |local error| of each system. - EnsembleIntegrator: int get nfev - EnsembleIntegrator: void step(double t, Float64List y, double h) — Advances y (length n·d) from t by h. - EnsembleIntegrator: double integrate(double t0, Float64List y, double h, int steps) — steps steps of size h from t0. - final class Rk4Stepper — Classic fourth-order Runge–Kutta with a fixed step. step allocates nothing. - Rk4Stepper: Rk4Stepper(this.f, this.n) - Rk4Stepper: final OdeFunction f - Rk4Stepper: final int n - Rk4Stepper: int nfev - Rk4Stepper: void step(double t, Float64List y, double h) — Advances y in place from t by h. - Rk4Stepper: double integrate(double t0, Float64List y, double h, int steps) — steps steps of size h from t0; y is advanced in place. - final class RkTableau — A Butcher tableau of an explicit embedded pair with FSAL (the last stage is f at the new point). - RkTableau: const RkTableau({required this.name, required this.order, required this.errorOrder, required this.c, required this.a, required this.b, required this.e, required this.dense}) - RkTableau: final String name - RkTableau: final int order — Order of the propagated solution and of the embedded error estimate. - RkTableau: final int errorOrder — Order of the propagated solution and of the embedded error estimate. - RkTableau: final List c — Nodes (s), lower-triangular coupling rows (s rows, row i has i entries), weights (s), error weights (s + 1, the last multiplying the FSAL stage). - RkTableau: final List b — Nodes (s), lower-triangular coupling rows (s rows, row i has i entries), weights (s), error weights (s + 1, the last multiplying the FSAL stage). - RkTableau: final List e — Nodes (s), lower-triangular coupling rows (s rows, row i has i entries), weights (s), error weights (s + 1, the last multiplying the FSAL stage). - RkTableau: final List> a - RkTableau: final List> dense — The continuous extension: weight i at θ ∈ 0, 1 is Σ_k densek θ^(k+1) (s + 1 rows). - RkTableau: int get stages - final class ExplicitRkStepper extends OdeStepper — The adaptive explicit Runge–Kutta stepper (SciPy's RungeKutta._step_impl), for dormandPrince54 and tsitouras54. - ExplicitRkStepper: ExplicitRkStepper(this.f, double t0, Float64List y0, this.tBound, {this.tableau = dormandPrince54, double rtol = 1e-3, Object atol = 1e-6, double maxStep = double.infinity, double? firstStep}) - ExplicitRkStepper: final OdeFunction f - ExplicitRkStepper: final double tBound - ExplicitRkStepper: final double maxStep - ExplicitRkStepper: final double direction - ExplicitRkStepper: final RkTableau tableau - ExplicitRkStepper: final int n - ExplicitRkStepper: late final double rtol - ExplicitRkStepper: late final Float64List atol - ExplicitRkStepper: double get t - ExplicitRkStepper: Float64List get y - ExplicitRkStepper: double get tOld - ExplicitRkStepper: double get stepSize - ExplicitRkStepper: Float64List get currentDerivative — The right-hand side at the current point (FSAL). - ExplicitRkStepper: bool step() - ExplicitRkStepper: void denseInto(double time, Float64List out) - ExplicitRkStepper: DenseSegment denseSegment() - final class RadauStepper extends OdeStepper — Radau IIA (order 5) stepper (SciPy's Radau). jac analytic, else finite differences. - RadauStepper: RadauStepper(this.f, double t0, Float64List y0, this.tBound, {this.jac, double rtol = 1e-3, Object atol = 1e-6, this.maxStep = double.infinity, double? firstStep}) - RadauStepper: final OdeFunction f - RadauStepper: final OdeJacobianFunction? jac - RadauStepper: final double tBound - RadauStepper: final double maxStep - RadauStepper: final double direction - RadauStepper: final int n - RadauStepper: late final double rtol - RadauStepper: late final Float64List atol - RadauStepper: late final double newtonTol - RadauStepper: double get t - RadauStepper: Float64List get y - RadauStepper: double get tOld - RadauStepper: double get stepSize - RadauStepper: bool step() - RadauStepper: void denseInto(double time, Float64List out) - RadauStepper: DenseSegment denseSegment() - enum OdeMethod — The adaptive methods solveIvp offers. - OdeMethod: rk45 — Dormand–Prince 5(4), SciPy's default. - OdeMethod: tsit5 — Tsitouras 5(4): usually fewer evaluations than RK45 for the same accuracy. - OdeMethod: bdf — Variable-order BDF/NDF (1–5), stiff. - OdeMethod: radau — Radau IIA order 5, stiff (L-stable; the most accurate stiff choice at tight tolerances). - final class OdeEvent — An event function g(t, y); solveIvp finds its zeros. - OdeEvent: const OdeEvent(this.g, {this.terminal = false, this.maxCount = 1, this.direction = 0}) - OdeEvent: final double Function(double t, Float64List y) g - OdeEvent: final bool terminal — Stop the integration after maxCount zeros. - OdeEvent: final int maxCount - OdeEvent: final double direction — 0: only zeros where g goes from negative to positive; < 0: positive to negative; 0: both. - final class OdeSolution — The result of solveIvp. - OdeSolution: final List t — Output times (every accepted step, or the requested ones) and the states there. - OdeSolution: final List y - OdeSolution: final OdeInterpolant? sol — The continuous solution over the whole interval, when denseOutput: true. - OdeSolution: final List> tEvents — Per event: the times and states of its zeros. - OdeSolution: final List> yEvents - OdeSolution: final int nfev - OdeSolution: final int njev - OdeSolution: final int nlu - OdeSolution: final int status — 0: reached the end; 1: a terminal event; -1: the integration failed. - OdeSolution: final String message - OdeSolution: final int steps — Accepted steps. - OdeSolution: bool get success - final class OdeInterpolant — A piecewise continuous solution made of the steps' interpolants. - OdeInterpolant: OdeInterpolant(this.segments, this.n) - OdeInterpolant: final List segments - OdeInterpolant: final int n - OdeInterpolant: double get tMin - OdeInterpolant: double get tMax - OdeInterpolant: Float64List call(double t, [Float64List? out]) — y(t) into out (allocated when null). - enum SymplecticMethod - SymplecticMethod: velocityVerlet — Kick-drift-kick with the acceleration cached between steps: order 2, one force evaluation per step. - SymplecticMethod: leapfrog — Drift-kick-drift (position Verlet): order 2, one force evaluation per step, no cached state. - SymplecticMethod: yoshida4 — Yoshida's triple jump over velocity Verlet: order 4, three force evaluations per step. - SymplecticMethod: yoshida6 — Yoshida's solution A, seven Verlet substeps: order 6, seven force evaluations per step. - extension SymplecticCompositionWeights on SymplecticMethod — The composition weights of each method: the step fractions of its second-order substeps (velocity Verlet / leapfrog: 1; Yoshida 4: the triple jump; Yoshida 6: solution A). - SymplecticCompositionWeights: List get compositionWeights - final class SymplecticIntegrator — A symplectic stepper over positions q and velocities v (length n each). step allocates nothing. - SymplecticIntegrator: SymplecticIntegrator(this.method, this.accel, this.n) - SymplecticIntegrator: final SymplecticMethod method - SymplecticIntegrator: final AccelerationFunction accel - SymplecticIntegrator: final int n - SymplecticIntegrator: int nfev — Force evaluations so far. - SymplecticIntegrator: int get order — Order of accuracy. - SymplecticIntegrator: void invalidate() — Call after changing q outside step (the cached acceleration is stale). - SymplecticIntegrator: void step(Float64List q, Float64List v, double h) — One step of size h; q and v are updated in place. - SymplecticIntegrator: void integrate(Float64List q, Float64List v, double h, int steps) — steps steps of size h. - final class OptimizeResult — The outcome of a minimisation or a multivariate root/least-squares solve (SciPy's OptimizeResult). - OptimizeResult: OptimizeResult({required this.x, required this.fun, required this.nit, required this.nfev, required this.success, required this.message, this.njev = 0, this.grad, this.residual}) - OptimizeResult: final Float64List x — The solution. - OptimizeResult: final double fun — The objective at x (for least squares, ½‖r‖²; for systems, ½‖F‖²). - OptimizeResult: final int nit — Iterations. - OptimizeResult: final int nfev — Function evaluations (a value-and-gradient call counts once). - OptimizeResult: final int njev — Jacobian or gradient evaluations, where counted separately. - OptimizeResult: final bool success - OptimizeResult: final String message - OptimizeResult: final Float64List? grad — The gradient at x, when the method computes it. - OptimizeResult: final Float64List? residual — The residual vector at x (least squares and systems). - OptimizeResult: String toString() - final class ScalarResult — The outcome of a scalar root or scalar minimisation. - ScalarResult: const ScalarResult(this.x, this.fun, this.iterations, this.evaluations, this.converged, this.message) - ScalarResult: final double x - ScalarResult: final double fun — f(x) (the residual for a root, the minimum for a minimisation). - ScalarResult: final int iterations - ScalarResult: final int evaluations - ScalarResult: final bool converged - ScalarResult: final String message - ScalarResult: String toString() - class OptimizeException implements Exception — Thrown when an input is invalid (bracket without a sign change, infeasible bounds...). - OptimizeException: OptimizeException(this.message) - OptimizeException: final String message - OptimizeException: String toString() - final class WolfeLineSearch — A line search along p from x: evaluates the objective and gradient at x + αp into xTrial / gTrial. - WolfeLineSearch: WolfeLineSearch(this.fg, int n) - WolfeLineSearch: final ValueAndGradient fg - WolfeLineSearch: final Float64List xTrial - WolfeLineSearch: final Float64List gTrial - WolfeLineSearch: int evaluations — Evaluations made by the last search. - WolfeLineSearch: double get phiStar - WolfeLineSearch: double? search(Float64List x, Float64List p, double phi0, double derphi0, {double? oldPhi0, double c1 = 1e-4, double c2 = 0.9, double? amax, double? alpha1Guess, int maxiter = 20}) — Returns α satisfying the strong Wolfe conditions, or null. - class Sobol — A Sobol low-discrepancy sequence in 0, 1)^[dims. - Sobol: Sobol(this.dims, {Int32List? shift}) - Sobol: static const int bits = 30 - Sobol: static const int maxDims = 1024 - Sobol: static Int32List randomShift(int dims, math.Random rng) — A random digital shift for dims dimensions. - Sobol: final int dims - Sobol: int get index — Points drawn so far. - Sobol: void nextInto(Float64List out) — The next point into out (length dims). - Sobol: Float64List take(int n) — The next n points, n x dims row-major. - final class QuadResult — The outcome of an adaptive quadrature. - QuadResult: const QuadResult(this.value, this.error, this.evaluations, {this.intervals = 1, this.status = 0}) - QuadResult: final double value — The estimate of the integral. - QuadResult: final double error — An estimate of |value − integral|. - QuadResult: final int evaluations — Integrand evaluations. - QuadResult: final int intervals — Subintervals used. - QuadResult: final int status — QUADPACK's ier: 0 converged; 1 subdivision limit; 2 round-off detected; 3 bad integrand behaviour; 4 extrapolation did not converge; 5 probably divergent; 6 invalid input. - QuadResult: bool get converged - QuadResult: String toString() ### FFT and signal processing (riptide_numerics_signal) import 'package:riptide_numerics_signal/riptide_numerics_signal.ray'; Mixed-radix and Bluestein FFT, real and n-D FFT, DCT, convolution, FIR and IIR filter design, windows, resampling and spectral analysis. https://riptidecompute.com/raya/docs/numerics-signal - FftPlan fftPlan(int n) — The cached complex plan for length n. - RealFftPlan realFftPlan(int n) — The cached real plan for length n. - Float64List fft(Float64List x, {int? n, FftNorm norm = FftNorm.backward}) — The DFT of interleaved complex x (numpy.fft.fft). n pads or truncates (default x.length/2). - Float64List ifft(Float64List x, {int? n, FftNorm norm = FftNorm.backward}) — The inverse DFT of interleaved complex x (numpy.fft.ifft). - Float64List rfft(Float64List x, {int? n, FftNorm norm = FftNorm.backward}) — The DFT of real x as n/2+1 interleaved complex bins (numpy.fft.rfft). - Float64List irfft(Float64List spec, {int? n, FftNorm norm = FftNorm.backward}) — The real inverse of a half spectrum (numpy.fft.irfft). n defaults to 2·(bins-1); the spectrum is truncated or zero-padded to n/2+1 bins. - Float64List fftn(Float64List x, List shape, {List? axes, FftNorm norm = FftNorm.backward}) — n-D DFT of interleaved complex x with row-major shape over axes (default all), numpy.fft.fftn. - Float64List ifftn(Float64List x, List shape, {List? axes, FftNorm norm = FftNorm.backward}) — n-D inverse DFT (numpy.fft.ifftn). - (Float64List, List) rfftn(Float64List x, List shape, {List? axes, FftNorm norm = FftNorm.backward}) — n-D real DFT (numpy.fft.rfftn): rfft over the last of axes, then complex FFTs over the rest. - Float64List irfftn(Float64List spec, List specShape, List outShape, {List? axes, FftNorm norm = FftNorm.backward}) — Inverse of rfftn: spec has specShape (last of axes holding n/2+1 bins); outShape is the real result's shape (numpy's s). - Float64List fftfreq(int n, [double d = 1.0]) — Sample frequencies of an n-point DFT with spacing d (numpy.fft.fftfreq). - Float64List rfftfreq(int n, [double d = 1.0]) — Sample frequencies of an n-point real DFT (numpy.fft.rfftfreq). - Float64List fftshift(Float64List x, {int width = 1}) — Moves the zero-frequency element to the centre (numpy.fft.fftshift) for a 1-D list of width-double elements (1 for real, 2 for interleaved complex). - Float64List ifftshift(Float64List x, {int width = 1}) — Inverse of fftshift (numpy.fft.ifftshift). - Float64List dct(Float64List x, {int type = 2, DctNorm norm = DctNorm.backward}) — The DCT of real x of type 1-4 (scipy.fft.dct). - Float64List idct(Float64List x, {int type = 2, DctNorm norm = DctNorm.backward}) — The inverse DCT (scipy.fft.idct): idct(dct(x, type), type) == x for every norm. - Float64List dst(Float64List x, {int type = 2, DctNorm norm = DctNorm.backward}) — The DST of real x of type 1-4 (scipy.fft.dst). - Float64List idst(Float64List x, {int type = 2, DctNorm norm = DctNorm.backward}) — The inverse DST (scipy.fft.idst). - TensorGraph fftGraph(String name, int batch, int n, {bool inverse = false}) — A tensor graph computing batch complex FFTs of length n (a power of two) in float32. - double fftFlops(int batch, int n) — Floating-point operations of batch FFTs of length n by the 5·n·log2(n) convention (for GFLOP/s figures). - double fftScale(int n, FftNorm norm, {required bool forward}) — The scale factor a transform of length n in direction forward applies under norm. - (double, double) sinCos2PiByN(int k, int n) — (cos, sin) of 2πk/n, reduced to the first octant first so large k and n keep full precision (PocketFFT's sincos_2pibyn does the same). - int goodSize(int n) — The smallest length >= n whose prime factors are all 2, 3, 5, 7 or 11 (fast for the mixed-radix passes; scipy's next_fast_len). - int goodSizeReal(int n) — The smallest length >= n made of 2, 3 and 5 only (real-input transforms; scipy's next_fast_len(n, real=True)). - Float64List convolveDirect(Float64List a, Float64List v, {ConvMode mode = ConvMode.full}) — The direct sum Σ aj·vk-j (O(n·m)). - Float64List fftconvolve(Float64List a, Float64List v, {ConvMode mode = ConvMode.full}) — Convolution by real FFTs of a fast length >= n + m - 1 (scipy.signal.fftconvolve). - Float64List oaconvolve(Float64List a, Float64List v, {ConvMode mode = ConvMode.full, int? blockSize}) — Overlap-add convolution (scipy.signal.oaconvolve): the longer input in blocks, each convolved with the shorter by FFTs of one fixed size. - Float64List convolve(Float64List a, Float64List v, {ConvMode mode = ConvMode.full, ConvMethod method = ConvMethod.auto}) — Convolution of a and v (scipy.signal.convolve). same is centred and as long as a; valid keeps the part computed without zero padding. - Float64List correlate(Float64List a, Float64List v, {ConvMode mode = ConvMode.full, ConvMethod method = ConvMethod.auto}) — Cross-correlation Σ ak+j·vj (scipy.signal.correlate for real input): convolution with the reversed v. - (Float64List, List) fftconvolveNd(Float64List a, List aShape, Float64List b, List bShape, {ConvMode mode = ConvMode.full}) — n-D convolution of row-major a (aShape) and b (bShape) by real n-D FFTs (scipy.signal.fftconvolve with n-D input). - Float64List lfilter(Float64List b, Float64List a, Float64List x, {Float64List? zi}) — Filters x with the rational transfer function b(z)/a(z) (scipy.signal.lfilter, direct form II transposed). zi, when given (length max(len a, len b) - 1), is the initial state and receives the final state. - Float64List lfilterZi(Float64List b, Float64List a) — The initial state of lfilter for a step response's steady state (scipy.signal.lfilter_zi): filtering a constant c with zi = c·lfilterZi(b, a) gives c·sum(b)/sum(a) from the first sample. - Float64List sosfilt(Float64List sos, Float64List x, {Float64List? zi}) — Filters x through cascaded second-order sections sos (row-major n × 6, scipy.signal.sosfilt). zi, when given (n × 2), is the initial state and receives the final state. - Float64List sosfiltZi(Float64List sos) — Initial state of sosfilt for a step response's steady state (scipy.signal.sosfilt_zi), n × 2. - Float64List oddExtend(Float64List x, int n) — Odd extension by n samples at each end: 2·x0 - xn..1 | x | 2·x-1 - x-2..-n-1 (scipy odd_ext). - Float64List filtfilt(Float64List b, Float64List a, Float64List x, {int? padlen}) — Zero-phase filtering: forward then backward through b/a, odd-extended by padlen samples (default 3·max(len a, len b)), with steady-state initial conditions (scipy.signal.filtfilt, method 'pad'). - Float64List sosfiltfilt(Float64List sos, Float64List x, {int? padlen}) — Zero-phase filtering through second-order sections (scipy.signal.sosfiltfilt). - ({Float64List w, Float64List h}) freqz(Float64List b, Float64List a, {int worN = 512, bool whole = false, double? fs}) — Frequency response of b/a at worN frequencies (scipy.signal.freqz): w from 0 to π (2π if whole), endpoint excluded, in rad/sample, or in the units of fs when given. h is interleaved complex. - ({Float64List w, Float64List h}) sosfreqz(Float64List sos, {int worN = 512, bool whole = false, double? fs}) — Frequency response of second-order sections (scipy.signal.sosfreqz / freqz_sos). - Float64List firwin(int numtaps, List cutoff, {Window window = Window.hamming, bool passZero = true, bool scale = true, double fs = 2.0}) — Linear-phase FIR taps (scipy.signal.firwin). cutoff are band edges in the units of fs (default: normalised so Nyquist = 1); passZero passes DC (lowpass/bandstop) or not (highpass/bandpass). - Zpk buttap(int order) — Analog Butterworth prototype of order (scipy buttap). - Zpk cheb1ap(int order, double rp) — Analog Chebyshev type I prototype with rp dB passband ripple (scipy cheb1ap). - Zpk cheb2ap(int order, double rs) — Analog Chebyshev type II prototype with rs dB stopband attenuation (scipy cheb2ap). - Zpk lp2lpZpk(Zpk f, double wo) - Zpk lp2hpZpk(Zpk f, double wo) - Zpk lp2bpZpk(Zpk f, double wo, double bw) - Zpk lp2bsZpk(Zpk f, double wo, double bw) - Zpk bilinearZpk(Zpk f, double fs) — Bilinear transform s = 2·fs·(z-1)/(z+1) of an analog zpk (scipy bilinear_zpk). - Zpk iirFilter(Zpk prototype, List wn, {BandType btype = BandType.lowpass, bool analog = false, double? fs}) — Digital (or, with analog, analog) IIR design from a prototype (scipy iirfilter). wn holds one critical frequency for lowpass/highpass and two for bandpass/bandstop: normalised to Nyquist (0..1) for digital filters, in… - Zpk butter(int order, List wn, {BandType btype = BandType.lowpass, bool analog = false, double? fs}) — Butterworth filter (scipy.signal.butter, output='zpk'; call .toSos or .toBa). - Zpk cheby1(int order, double rp, List wn, {BandType btype = BandType.lowpass, bool analog = false, double? fs}) — Chebyshev type I filter with rp dB passband ripple (scipy.signal.cheby1). - Zpk cheby2(int order, double rs, List wn, {BandType btype = BandType.lowpass, bool analog = false, double? fs}) — Chebyshev type II filter with rs dB minimum stopband attenuation (scipy.signal.cheby2). - Float64List zpk2sos(List zeros, List poles, double k) — Zeros, poles and gain to second-order sections (scipy zpk2sos, pairing 'nearest', digital). - Float64List resample(Float64List x, int num) — Resamples real x to num samples by truncating or zero-padding its spectrum (scipy.signal.resample): assumes x is periodic. - Float64List upfirdn(Float64List h, Float64List x, {int up = 1, int down = 1}) — Upsample by up (zero insertion), FIR-filter with h, downsample by down (scipy.signal.upfirdn), computed polyphase: only the kept outputs, only the non-zero inputs. - Float64List resamplePoly(Float64List x, int up, int down, {Window window = const Window.kaiser(5.0), Float64List? taps}) — Resamples x by up/down with a polyphase FIR filter (scipy.signal.resample_poly, padtype 'constant'). - Float64List decimate(Float64List x, int q, {int? n, bool fir = false, bool zeroPhase = true}) — Downsamples x by q after an anti-aliasing filter (scipy.signal.decimate): by default an order-8 Chebyshev I (0.05 dB ripple, cutoff 0.8/q) applied forward and backward; with fir a Hamming firwin of n+1 taps (default n… - Psd welch(Float64List x, {double fs = 1.0, Window window = Window.hann, int? nperseg, int? noverlap, int? nfft, Detrend detrend = Detrend.constant, SpectralScaling scaling = SpectralScaling.density, bool onesided = true, bool median = false}) — Welch's method: the mean of the periodograms of overlapping windowed segments (scipy.signal.welch). - Psd periodogram(Float64List x, {double fs = 1.0, Window window = Window.boxcar, int? nfft, Detrend detrend = Detrend.constant, SpectralScaling scaling = SpectralScaling.density, bool onesided = true}) — Periodogram: one segment covering the whole signal (scipy.signal.periodogram; default boxcar window). - Spectrogram spectrogram(Float64List x, {double fs = 1.0, Window window = const Window.tukey(0.25), int? nperseg, int? noverlap, int? nfft, Detrend detrend = Detrend.constant, SpectralScaling scaling = SpectralScaling.density, bool onesided = true}) — Power spectrogram (scipy.signal.spectrogram, mode 'psd'): defaults Tukey(0.25) periodic window, nperseg 256 (or the signal length), overlap nperseg/8. - Stft stft(Float64List x, {double fs = 1.0, Window window = Window.hann, int nperseg = 256, int? noverlap, int? nfft, bool boundary = true, bool padded = true}) — Short-time Fourier transform of real x (scipy.signal.stft): one-sided, scaled by 1/Σw ('spectrum'), with nperseg/2 zeros added at both ends (boundary) and the end zero-padded to whole segments (padded). - ({Float64List t, Float64List x}) istft(Stft s, {double fs = 1.0, Window window = Window.hann, int nperseg = 256, int? noverlap, int? nfft, bool boundary = true}) — Inverse STFT by weighted overlap-add (scipy.signal.istft): undoes stft with the same parameters, returning the times and the signal (with the boundary padding removed). - Float64List getWindow(Window window, int n, {bool fftbins = true}) — Scipy.signal.get_window: periodic (fftbins) by default. - double besselI0(double x) — The modified Bessel function of the first kind, order 0: the power series Σ ((x/2)^k / k!)² below 15, the asymptotic expansion e^x / sqrt(2πx) · (1 + 1/8x + 9/128x² +...) above. - enum DctNorm — Scipy.fft normalisation for the trigonometric transforms. - DctNorm: backward - DctNorm: ortho - DctNorm: forward - abstract interface class NativeFft — An in-place complex transform of one length (interleaved re, im). - NativeFft: String get name - NativeFft: void transform(List data, {required bool forward, double scale = 1.0}) — The unnormalised transform in direction forward of data (2n doubles, interleaved), times scale. - abstract final class FftBackend — Native FFTs on or off for plans made from now on (default: on where available). - FftBackend: static bool enabled - FftBackend: static NativeFft? forLength(int n) — A native transform of length n, or null. - enum FftNorm — Normalisation, as numpy.fft: backward scales the inverse by 1/n, forward scales the forward transform by 1/n, ortho scales both by 1/sqrt(n). - FftNorm: backward - FftNorm: ortho - FftNorm: forward - final class FftPlan — A reusable plan for complex FFTs of length n. - FftPlan: FftPlan(this.n) - FftPlan: final int n - FftPlan: String? get nativeBackend — The native transform this plan runs ("vdsp"), or null for the pure-Raya one. - FftPlan: bool get usesBluestein — True when this length uses Bluestein's algorithm. - FftPlan: List get factors — The mixed-radix factors (empty for Bluestein plans). - FftPlan: void forward(Float64List data, {FftNorm norm = FftNorm.backward}) — Forward transform Xk = Σ xj e^{-2πi jk/n} of interleaved data (length >= 2n) in place. - FftPlan: void inverse(Float64List data, {FftNorm norm = FftNorm.backward}) — Inverse transform xj = (1/n) Σ Xk e^{+2πi jk/n} (with the default norm) in place. - FftPlan: void transform(Float64List data, {required bool forward, double scale = 1.0}) — The unnormalised transform in direction forward, multiplied by scale. - final class RealFftPlan — A reusable plan for real FFTs of length n. - RealFftPlan: RealFftPlan(this.n) - RealFftPlan: final int n - RealFftPlan: int get bins — Number of complex output bins, n/2 + 1. - RealFftPlan: void forward(Float64List x, Float64List out, {FftNorm norm = FftNorm.backward}) — Rfft: x (length n, real) to out (length 2·bins, interleaved complex). - RealFftPlan: void inverse(Float64List spec, Float64List out, {FftNorm norm = FftNorm.backward}) — Irfft: spec (2·bins doubles, Hermitian half spectrum) to out (n reals). - final class Complex — A complex number for filter design (zeros, poles, frequency responses). - Complex: const Complex(this.re, [this.im = 0]) - Complex: static const zero = Complex(0) - Complex: static const one = Complex(1) - Complex: static Complex exp(Complex z) - Complex: static Complex polar(double r, double theta) — E^{iθ}. - Complex: final double re - Complex: final double im - Complex: Complex get conj - Complex: double get abs - Complex: double get arg - Complex: bool get isReal - Complex: Complex scale(double s) - Complex: Complex sqrt() — Principal square root. - Complex: String toString() - Complex: Complex operator +(Complex o) - Complex: Complex operator -(Complex o) - Complex: Complex operator -() - Complex: Complex operator *(Complex o) - Complex: Complex operator /(Complex o) - enum ConvMode — Output size, as scipy.signal.convolve. - ConvMode: full - ConvMode: same - ConvMode: valid - enum ConvMethod — How to convolve. auto picks direct for short kernels and FFT otherwise. - ConvMethod: auto - ConvMethod: direct - ConvMethod: fft - ConvMethod: overlapAdd - enum BandType — The band a filter passes. - BandType: lowpass - BandType: highpass - BandType: bandpass - BandType: bandstop - final class Zpk — A filter in zero-pole-gain form. - Zpk: const Zpk(this.z, this.p, this.k) - Zpk: final List z - Zpk: final List p - Zpk: final double k - Zpk: ({Float64List b, Float64List a}) toBa() — Transfer-function coefficients b (numerator) and a (denominator), highest power first (scipy's zpk2tf). - Zpk: Float64List toSos() — Second-order sections, row-major sections × 6: b0 b1 b2 a0 a1 a2 (scipy's zpk2sos, pairing 'nearest'). - enum Detrend — Detrending applied to each segment. - Detrend: none - Detrend: constant - Detrend: linear - enum SpectralScaling — 'density' (V²/Hz, scaled by 1/(fs·Σw²)) or 'spectrum' (V², scaled by 1/(Σw)²). - SpectralScaling: density - SpectralScaling: spectrum - final class Psd — A power spectral density estimate: frequencies f and powers pxx. - Psd: const Psd(this.f, this.pxx) - Psd: final Float64List f - Psd: final Float64List pxx - final class Spectrogram — A spectrogram: f (rows), segment-centre times t (columns), and row-major sxx (f.length × t.length). - Spectrogram: const Spectrogram(this.f, this.t, this.sxx) - Spectrogram: final Float64List f - Spectrogram: final Float64List t - Spectrogram: final Float64List sxx - final class Stft — An STFT: f, t, and row-major interleaved complex zxx (f.length × t.length). - Stft: const Stft(this.f, this.t, this.zxx) - Stft: final Float64List f - Stft: final Float64List t - Stft: final Float64List zxx - enum WindowKind — The window families. - WindowKind: boxcar - WindowKind: hann - WindowKind: hamming - WindowKind: blackman - WindowKind: blackmanHarris - WindowKind: bartlett - WindowKind: flattop - WindowKind: kaiser - WindowKind: gaussian - WindowKind: tukey - final class Window — A window: a family plus its parameter (Kaiser β, Gaussian σ, Tukey α). - Window: const Window(this.kind, [this.param = 0]) - Window: const Window.kaiser(double beta) — Kaiser window with shape parameter beta. - Window: const Window.gaussian(double std) — Gaussian window with standard deviation std (in samples). - Window: const Window.tukey([double alpha = 0.5]) — Tukey (tapered cosine) window; alpha is the tapered fraction (0 = boxcar, 1 = Hann). - Window: static const boxcar = Window(WindowKind.boxcar) - Window: static const hann = Window(WindowKind.hann) - Window: static const hamming = Window(WindowKind.hamming) - Window: static const blackman = Window(WindowKind.blackman) - Window: static const blackmanHarris = Window(WindowKind.blackmanHarris) - Window: static const bartlett = Window(WindowKind.bartlett) - Window: static const flattop = Window(WindowKind.flattop) - Window: final WindowKind kind - Window: final double param - Window: Float64List generate(int m, {bool sym = true}) — The window of length m: symmetric when sym, periodic otherwise. - Window: String toString() ### Sparse linear algebra (riptide_numerics_sparse) import 'package:riptide_numerics_sparse/riptide_numerics_sparse.ray'; COO, CSR, CSC and BSR matrices, SIMD sparse products, Krylov solvers (CG, PCG, GMRES, BiCGSTAB, MINRES) with Jacobi, ILU(0) and IC(0) preconditioners, reorderings and sparse Cholesky. https://riptidecompute.com/raya/docs/numerics-sparse - enum FillOrdering — Which fill-reducing ordering a sparse factorisation applies first. - FillOrdering: natural - FillOrdering: reverseCuthillMcKee - FillOrdering: approximateMinimumDegree - final class SparseCholesky extends _SparseFactor — Sparse Cholesky A = P·L·Lᵀ·Pᵀ (see _SparseFactor). - SparseCholesky: SparseCholesky(CsrMatrix a, {FillOrdering ordering = FillOrdering.approximateMinimumDegree}) - SparseCholesky: int get nnzL - SparseCholesky: Float64List solve(Float64List b) — Solves A·x = b. - SparseCholesky: double logDeterminant() — Log det A = 2 Σ log L_jj. - final class SparseLdlt extends _SparseFactor — Sparse LDLᵀ A = P·L·D·Lᵀ·Pᵀ with unit lower L (see _SparseFactor). - SparseLdlt: SparseLdlt(CsrMatrix a, {FillOrdering ordering = FillOrdering.approximateMinimumDegree}) - SparseLdlt: final Float64List d — The diagonal D. - SparseLdlt: int get nnzL - SparseLdlt: Float64List solve(Float64List b) — Solves A·x = b. - SparseLdlt: (int, int, int) inertia() — (positive, negative, zero) eigenvalue counts of A by Sylvester's law of inertia. - final class CooMatrix — A sparse matrix in coordinate (triplet) form: the format to build in. - CooMatrix: CooMatrix(this.rows, this.cols, {int capacity = 16}) - CooMatrix: factory CooMatrix.fromTriplets(int rows, int cols, List row, List col, List val) — From parallel arrays of row indices, column indices and values. - CooMatrix: final int rows - CooMatrix: final int cols - CooMatrix: int get nnz — Stored entries, counting duplicates. - CooMatrix: Int32List get rowIndices - CooMatrix: Int32List get colIndices - CooMatrix: Float64List get values - CooMatrix: void add(int i, int j, double v) — Appends a(i, j) += v. - CooMatrix: CsrMatrix toCsr() — Compressed rows: counting sort by row, then each row's columns sorted and duplicates summed. - CooMatrix: CscMatrix toCsc() — Compressed columns (the transpose's rows). - final class CsrMatrix implements LinearOperator — Compressed sparse row: row i's entries are indicesindptr[i.. indptri+1) (sorted, no duplicates when built by this package) with values in data. - CsrMatrix: CsrMatrix(this.rows, this.cols, this.indptr, this.indices, this.data) - CsrMatrix: factory CsrMatrix.fromDense(Float64List a, int rows, int cols, {double dropTolerance = 0}) — From a dense row-major rows x cols array, keeping entries with |a| > dropTolerance. - CsrMatrix: factory CsrMatrix.identity(int n, [double scale = 1]) - CsrMatrix: factory CsrMatrix.diags(int n, List> diagonals, List offsets) — A diagonal-offset (banded) matrix: diagonalsk sits on offset offsetsk (0 main, +1 super, −1 sub), like scipy.sparse.diags. - CsrMatrix: final int rows - CsrMatrix: final int cols - CsrMatrix: final Int32List indptr - CsrMatrix: final Int32List indices - CsrMatrix: final Float64List data - CsrMatrix: int get nnz - CsrMatrix: void spmv(Float64List x, Float64List y, {double alpha = 1, double beta = 0}) — Y = alpha·A·x + beta·y (beta 0 overwrites y, so it may hold garbage). - CsrMatrix: void apply(Float64List x, Float64List y) - CsrMatrix: void spmvTransposed(Float64List x, Float64List y, {double alpha = 1, double beta = 0}) — Y = alpha·Aᵀ·x + beta·y (scatter by column). - CsrMatrix: void spmm(Float64List x, int k, Float64List y) — Sparse × dense: Y (rows × k, row-major) = A · X (cols × k, row-major). - CsrMatrix: CsrMatrix matmul(CsrMatrix b) — Sparse × sparse (Gustavson's row-by-row algorithm with a dense accumulator): C = A · B, columns sorted. - CsrMatrix: CsrMatrix add(CsrMatrix b, {double alpha = 1, double beta = 1}) — Alpha·A + beta·B (same shape), sorted merge per row. - CsrMatrix: CsrMatrix transpose() — Aᵀ as CSR (a counting sort by column, which leaves each transposed row sorted). - CsrMatrix: CscMatrix toCsc() — The same matrix in CSC (shares no storage). - CsrMatrix: Float64List diagonal() — The main diagonal (zeros where not stored). - CsrMatrix: Float64List toDense() — Dense row-major copy (tests and small matrices). - CsrMatrix: CsrMatrix triangle({bool lower = true}) — The lower (or upper) triangle including the diagonal. - CsrMatrix: CsrMatrix permuteSymmetric(Int32List perm) — P·A·Pᵀ for a symmetric permutation: row/column permk of A becomes row/column k. - CsrMatrix: bool isSymmetric({double tolerance = 0}) — Whether A equals Aᵀ to within tolerance (absolute). - CsrMatrix: Float32List dataAsFloat32() — A copy with values narrowed to f32 (the GPU SpMV buffers). - CsrMatrix: double operator [](({int i, int j}) at) — a(i, j), by binary search in row i (0 when not stored). - final class CscMatrix implements LinearOperator — Compressed sparse column: column j's entries are indicesindptr[j.. indptrj+1) (row indices, sorted). - CscMatrix: CscMatrix(this.rows, this.cols, this.indptr, this.indices, this.data) - CscMatrix: final int rows - CscMatrix: final int cols - CscMatrix: final Int32List indptr - CscMatrix: final Int32List indices - CscMatrix: final Float64List data - CscMatrix: int get nnz - CscMatrix: void spmv(Float64List x, Float64List y, {double alpha = 1, double beta = 0}) — Y = alpha·A·x + beta·y. - CscMatrix: void apply(Float64List x, Float64List y) - CscMatrix: CsrMatrix toCsr() — The same matrix in CSR. - final class BsrMatrix implements LinearOperator — Block compressed sparse row with dense blockRows × blockCols blocks (row-major inside each block), like SciPy's bsr_matrix. - BsrMatrix: BsrMatrix(this.rows, this.cols, this.blockRows, this.blockCols, this.indptr, this.indices, this.data) - BsrMatrix: factory BsrMatrix.fromCsr(CsrMatrix a, int blockRows, int blockCols) — Groups a CSR matrix into blocks (any block touched by a stored entry is stored densely). - BsrMatrix: final int rows - BsrMatrix: final int cols - BsrMatrix: final int blockRows - BsrMatrix: final int blockCols - BsrMatrix: final Int32List indptr - BsrMatrix: final Int32List indices - BsrMatrix: final Float64List data - BsrMatrix: int get blocks - BsrMatrix: void spmv(Float64List x, Float64List y) — Y = A·x. - BsrMatrix: void apply(Float64List x, Float64List y) - abstract final class Gallery — Standard test matrices. - Gallery: static CsrMatrix poisson2d(int nx, int ny) — The 5-point Laplacian on an nx × ny grid with Dirichlet boundaries (SPD, condition number ~ (n/π)²): the matrix of scipy.sparse examples and of every pressure projection in a grid fluid. - Gallery: static CsrMatrix convectionDiffusion1d(int n, double c) — 1-D convection–diffusion −u'' + c·u' (central differences, Péclet number c·h/2): nonsymmetric for c ≠ 0, the standard GMRES / BiCGSTAB test. - abstract final class MatrixMarket — Matrix Market exchange format (NIST, https://math.nist.gov/MatrixMarket/formats.html), coordinate real with general or symmetric symmetry (and pattern, read as ones): the format SuiteSparse Matrix Collection test… - MatrixMarket: static CsrMatrix parse(String text) - MatrixMarket: static String format(CsrMatrix a) — Writes coordinate real general with 17 significant digits (round-trips every double). - final class SolveResult — What an iterative solve returns. residual is the true relative residual ‖b − A·x‖ / ‖b‖ recomputed at the end (not the solver's running estimate). - SolveResult: SolveResult(this.x, this.iterations, this.residual, this.converged) - SolveResult: final Float64List x - SolveResult: final int iterations - SolveResult: final double residual - SolveResult: final bool converged - SolveResult: String toString() - abstract final class Krylov — Krylov subspace solvers for A·x = b (Saad 2003; Barrett et al. - Krylov: static SolveResult cg(LinearOperator a, Float64List b, {Float64List? x0, Preconditioner? m, double rtol = 1e-10, double atol = 0, int? maxIterations}) — Conjugate gradients, preconditioned when m is given (PCG). - Krylov: static SolveResult gmres(LinearOperator a, Float64List b, {Float64List? x0, Preconditioner? m, int restart = 30, double rtol = 1e-10, double atol = 0, int? maxIterations}) — Restarted GMRES(restart) with right preconditioning (so the minimised residual is the true one): Arnoldi with modified Gram–Schmidt plus one reorthogonalisation pass, Givens rotations for the least-squares problem. - Krylov: static SolveResult bicgstab(LinearOperator a, Float64List b, {Float64List? x0, Preconditioner? m, double rtol = 1e-10, double atol = 0, int? maxIterations}) — BiCGSTAB (van der Vorst 1992) with right preconditioning, for nonsymmetric systems: short recurrences (fixed memory, unlike GMRES) and smoother convergence than BiCG. - Krylov: static SolveResult minres(LinearOperator a, Float64List b, {Float64List? x0, Preconditioner? m, double rtol = 1e-10, double atol = 0, int? maxIterations}) — MINRES (Paige and Saunders 1975) for symmetric, possibly indefinite A; the optional preconditioner must be symmetric positive definite. - abstract interface class LinearOperator — Anything that computes y = A·x: every sparse format, a dense matrix, or a matrix-free stencil. - LinearOperator: int get rows - LinearOperator: int get cols - LinearOperator: void apply(Float64List x, Float64List y) — Y = A·x (y fully overwritten). - final class FunctionOperator implements LinearOperator — A matrix-free operator from a closure. - FunctionOperator: FunctionOperator(this.rows, this.cols, this._apply) - FunctionOperator: final int rows - FunctionOperator: final int cols - FunctionOperator: void apply(Float64List x, Float64List y) - final class DenseOperator implements LinearOperator — A dense row-major operator (small systems, tests). - DenseOperator: DenseOperator(this.a, this.rows, this.cols) - DenseOperator: final Float64List a - DenseOperator: final int rows - DenseOperator: final int cols - DenseOperator: void apply(Float64List x, Float64List y) - abstract final class Vec — Level-1 kernels on Float64List used by the solvers. - Vec: static double dot(Float64List a, Float64List b) - Vec: static double norm(Float64List a) — The 2-norm, scaled to avoid overflow and underflow (LAPACK dnrm2's idea, one pass). - Vec: static void axpy(double alpha, Float64List x, Float64List y) — Y += alpha·x. - Vec: static void xpby(Float64List x, double beta, Float64List y) — Y = x + beta·y. - abstract final class Ordering — Fill-reducing and bandwidth-reducing orderings of a symmetric sparsity pattern. - Ordering: static Int32List natural(int n) - Ordering: static Int32List reverseCuthillMcKee(CsrMatrix a) — Reverse Cuthill–McKee (George and Liu 1981): breadth-first from a pseudo-peripheral vertex, visiting neighbours by increasing degree, then reversed. - Ordering: static Int32List approximateMinimumDegree(CsrMatrix a) — Approximate minimum degree on the quotient graph (Amestoy, Davis and Duff, "An Approximate Minimum Degree Ordering Algorithm", SIMAX 1996): eliminated vertices become elements, elements adjacent to the pivot are… - Ordering: static int bandwidth(CsrMatrix a) — Bandwidth max |i − j| over stored entries (to compare orderings). - abstract interface class Preconditioner — Z = M⁻¹·r for a preconditioner M ≈ A. - Preconditioner: void solve(Float64List r, Float64List z) - final class IdentityPreconditioner implements Preconditioner — M = I. - IdentityPreconditioner: const IdentityPreconditioner() - IdentityPreconditioner: void solve(Float64List r, Float64List z) - final class JacobiPreconditioner implements Preconditioner — M = diag(A). - JacobiPreconditioner: JacobiPreconditioner(CsrMatrix a) - JacobiPreconditioner: void solve(Float64List r, Float64List z) - final class Ilu0Preconditioner implements Preconditioner — Incomplete LU with zero fill (ILU(0); Saad, "Iterative Methods for Sparse Linear Systems", 2nd ed. - Ilu0Preconditioner: Ilu0Preconditioner(CsrMatrix a) - Ilu0Preconditioner: void solve(Float64List r, Float64List z) - final class IncompleteCholeskyPreconditioner implements Preconditioner — Incomplete Cholesky with zero fill (IC(0)): L has the pattern of tril(A) and A ≈ L·Lᵀ. - IncompleteCholeskyPreconditioner: IncompleteCholeskyPreconditioner(CsrMatrix a) - IncompleteCholeskyPreconditioner: late final double shift — The diagonal shift α the factorisation needed (0 for none). - IncompleteCholeskyPreconditioner: void solve(Float64List r, Float64List z) ### Spatial structures (riptide_numerics_spatial) import 'package:riptide_numerics_spatial/riptide_numerics_spatial.ray'; KD-trees, ball trees and BVHs, 2-D and 3-D convex hulls, Delaunay and Voronoi, k-nearest neighbours, point clouds and Morton codes. https://riptidecompute.com/raya/docs/numerics-spatial - double f32Down(double v) — v rounded to the nearest float32 not above it. - double f32Up(double v) — v rounded to the nearest float32 not below it. - (double, double) circumcenter(double ax, double ay, double bx, double by, double cx, double cy) — Circumcentre of triangle (a, b, c). - int orient3(Float64List p, int a, int b, int c, int d) — Sign of det(a − d, b − d, c − d). - int inSphere(Float64List p, int a, int b, int c, int d, int e) — 0 when e is strictly inside the sphere through positively oriented a, b, c, d; 0 on it; < 0 outside. - Int32List convexHull2d(Float64List xy) — Convex hull of 2-D points (interleaved x y) by Andrew's monotone chain (1979), O(n log n), with Shewchuk's robust orientation test from riptide_math, so near-collinear input never produces a reflex vertex. - double polygonArea(Float64List xy, List poly) — Area enclosed by a polygon given as indices into interleaved xy (positive when counter-clockwise). - KnnResult bruteForceKnn(Float64List points, Float64List queries, int dim, int k) — Exact k nearest neighbours by brute force, O(n·m·d): the reference the trees are tested against. points and queries are interleaved (x0 y0 z0 x1 y1 z1 …, dim values per point). - RadiusResult bruteForceRadius(Float64List points, List query, int dim, double radius) — Points within radius of query by brute force (the reference for the trees' radius search), nearest first. - RadiusResult sortedRadius(List<(double, int)> hits) - (Float64List, Float64List) symmetricEigen(Float64List a, int n, {int maxSweeps = 50}) — Eigen-decomposition of a small symmetric n×n matrix a (row-major) by cyclic Jacobi rotations. - final class AabbBvh — A bounding volume hierarchy over axis-aligned boxes (or points) in 3-D, built top-down with the binned surface area heuristic (Wald 2007) on all three axes, and stored flattened for the GPU: one 32-byte node per entry… - AabbBvh: factory AabbBvh.build(Float64List mins, Float64List maxs, {int maxLeaf = 4, int bins = 16}) — Builds over count boxes given as interleaved mins and maxs (3 doubles per box). maxLeaf is 1–16. - AabbBvh: factory AabbBvh.points(Float64List xyz, {int maxLeaf = 4}) — Builds over points (zero-size boxes), interleaved xyz. - AabbBvh: final Uint8List nodes — The flattened nodes (32 bytes each), ready to copy into a GPU storage buffer. - AabbBvh: final Uint32List primOrder — Leaf primitive ranges index this permutation of the input boxes. - AabbBvh: final int nodeCount - AabbBvh: final int primCount - AabbBvh: final Float32List f32 — Views of nodes as floats (bounds) and ints (miss, prim). - AabbBvh: final Int32List i32 - AabbBvh: double get sahCost — The SAH cost of the tree (traversal 1, intersection 1), relative to the root's area: lower is better. - AabbBvh: int get depth — Depth of the deepest leaf (root = 0). - AabbBvh: int miss(int node) - AabbBvh: int prim(int node) - AabbBvh: bool isLeaf(int node) - AabbBvh: int leafFirst(int node) - AabbBvh: int leafCount(int node) - AabbBvh: int right(int node) - AabbBvh: void queryAabb(List lo, List hi, void Function(int prim) visit) — Calls visit with every primitive whose node box overlaps lo..hi (3 values each). - AabbBvh: ({int prim, double t})? raycast(double ox, double oy, double oz, double dx, double dy, double dz, double? Function(int prim) hit, {double tMax = double.infinity}) — Closest hit along the ray o + t·d for t in 0, [tMax]: hit tests one primitive and returns its hit distance (or null). - AabbBvh: List<(int, int)> overlapPairs(Float64List mins, Float64List maxs) — Every pair (i, j), i < j, of input boxes in mins/maxs that overlap: the broadphase. - AabbBvh: void refit(Float64List mins, Float64List maxs) — Recomputes every node box from moved primitives (same topology), O(n). - final class BallTree — A ball tree (Omohundro 1989; the layout of scikit-learn's BallTree, BSD-3-Clause): every node is a hypersphere (centroid, radius) around its points, split at the median of the dimension of largest spread. - BallTree: factory BallTree(Float64List points, int dim, {int leafSize = 16}) - BallTree: final Float64List points - BallTree: final int dim - BallTree: final Int32List order - BallTree: final Float64List centers — Per node: centroid (dim values) and radius. - BallTree: final Float64List radii — Per node: centroid (dim values) and radius. - BallTree: final Int32List child — Per node: left child (right is +1) or −1 for a leaf; leaf ranges start, end) of [order. - BallTree: final Int32List start — Per node: left child (right is +1) or −1 for a leaf; leaf ranges start, end) of [order. - BallTree: final Int32List end — Per node: left child (right is +1) or −1 for a leaf; leaf ranges start, end) of [order. - BallTree: int get length - BallTree: int get nodeCount - BallTree: KnnResult knn(List query, int k) - BallTree: KnnResult knnBatch(Float64List queries, int k) - BallTree: void knnInto(List query, KnnHeap heap) - BallTree: RadiusResult radius(List query, double radius) - final class CellList — A uniform-grid cell list over 3-D points, built by counting sort (two passes, no per-cell lists): the neighbour structure for SPH, particle-in-cell deposition and short-range forces, where the search radius equals the… - CellList: factory CellList.build(Float64List xyz, double cellSize, {List? boxMin, List? boxMax}) — Bins interleaved xyz points into cells of cellSize covering their bounds (or the given box). - CellList: final double originX - CellList: final double originY - CellList: final double originZ - CellList: final double cellSize - CellList: final int nx - CellList: final int ny - CellList: final int nz - CellList: final Int32List cellStart - CellList: final Int32List sorted - CellList: final Int32List cellOf - CellList: int get cellCount - CellList: void forEachNear(double x, double y, double z, void Function(int point) visit) — Calls visit with every point in the 27 cells around (x, y, z): candidates within cellSize of it (and some farther ones; the caller checks the distance). - CellList: List<(int, int)> pairsWithin(Float64List xyz, double radius) — Every pair (i, j), i < j, of points closer than radius ≤ cellSize in interleaved xyz. - final class Delaunay2d — 2-D Delaunay triangulation by the sweep-hull method of Delaunator: sort points by distance from the circumcentre of a seed triangle, add them one by one outside a convex hull kept as a linked list with an angular hash,… - Delaunay2d: factory Delaunay2d(Float64List points) — Triangulates interleaved x y points. - Delaunay2d: static int nextHalfedge(int e) - Delaunay2d: static int prevHalfedge(int e) - Delaunay2d: final Float64List points - Delaunay2d: final Int32List triangles - Delaunay2d: final Int32List halfedges - Delaunay2d: final Int32List hull — Hull vertices counter-clockwise. - Delaunay2d: int get triangleCount - Delaunay2d: List> neighbors() — Delaunay neighbours of every point (sorted), from the half-edges. - Delaunay2d: Float64List circumcenters() — The circumcentre of every triangle (interleaved), the vertices of the Voronoi diagram. - Delaunay2d: Voronoi2d voronoi(double x0, double y0, double x1, double y1) — The Voronoi diagram, every cell clipped to the box x0, x1 × y0, y1. - final class Voronoi2d — A Voronoi diagram as the dual of a Delaunay2d: cell i is the box cut by the bisector half-planes of point i and each of its Delaunay neighbours (exactly the cell, since Voronoi neighbours are Delaunay neighbours), so… - Voronoi2d: final Delaunay2d delaunay - Voronoi2d: final double x0 - Voronoi2d: final double y0 - Voronoi2d: final double x1 - Voronoi2d: final double y1 - Voronoi2d: Float64List cell(int i) — The vertices of cell i, counter-clockwise, interleaved; empty for a skipped duplicate point outside the box. - Voronoi2d: double cellArea(int i) — Area of cell i. - final class Delaunay3d — 3-D Delaunay tetrahedralisation by Bowyer–Watson insertion (Bowyer 1981, Watson 1981): points are inserted in Morton order inside a large enclosing tetrahedron; each one is located by a visibility walk, the tetrahedra… - Delaunay3d: factory Delaunay3d(Float64List xyz) - Delaunay3d: final Float64List points — Interleaved xyz input. - Delaunay3d: final Int32List tetrahedra — 4 vertex indices per tetrahedron. - Delaunay3d: final Int32List neighbors — 4 per tetrahedron: the neighbour across the face opposite vertex k, or −1 on the hull. - Delaunay3d: int get tetrahedronCount - Delaunay3d: double get volume — Total volume (equals the convex hull's). - final class ConvexHull3d — A 3-D convex hull: triangles (3 vertex indices each, counter-clockwise seen from outside) over the input points. - ConvexHull3d: factory ConvexHull3d.quickHull(Float64List xyz) — QuickHull (Barber, Dobkin and Huhdanpaa 1996; the algorithm qhull implements, written here from the paper): start from an extreme tetrahedron, give each outside point to a face it sees, then repeatedly take a face's… - ConvexHull3d: final Float64List points — The input points (interleaved xyz). - ConvexHull3d: final Int32List triangles — Flat triangle list, 3 indices per face, wound counter-clockwise from outside. - ConvexHull3d: int get faceCount - ConvexHull3d: Int32List get vertices — The distinct hull vertices, ascending. - ConvexHull3d: double get volume - ConvexHull3d: double get area - final class KdTree — A k-d tree over points in any dimension (Float64), after nanoflann (Blanco and Rai, BSD-2-Clause): sliding-midpoint splits on the dimension of largest spread, leaf buckets of up to leafSize points, nodes as flat typed… - KdTree: factory KdTree(Float64List points, int dim, {int leafSize = 10}) - KdTree: final Float64List points — The indexed points (interleaved, dim per point). - KdTree: final int dim - KdTree: final Int32List order — Leaf buckets are contiguous ranges of this permutation of point indices. - KdTree: final Int32List child — Per node: left child index (the right child is child + 1), or −1 for a leaf. - KdTree: final Int32List splitDim - KdTree: final Float64List splitLow — Per interior node: the largest coordinate on the low side and the smallest on the high side. - KdTree: final Float64List splitHigh — Per interior node: the largest coordinate on the low side and the smallest on the high side. - KdTree: final Int32List start — Per leaf: the range start, end) of [order. - KdTree: final Int32List end — Per leaf: the range start, end) of [order. - KdTree: final Float64List rootMin — Bounding box of all points. - KdTree: final Float64List rootMax — Bounding box of all points. - KdTree: int get length - KdTree: int get nodeCount - KdTree: KnnResult knn(List query, int k) — The k nearest points to query (length dim). - KdTree: KnnResult knnBatch(Float64List queries, int k) — K nearest neighbours of every query in queries (interleaved), k per query. - KdTree: void knnInto(List query, KnnHeap heap) — Fills heap (call KnnHeap.reset first) with the nearest points to query; allocates nothing. - KdTree: RadiusResult radius(List query, double radius, {bool sorted = true}) — Every point within radius of query, nearest first when sorted. - KdTree: int countWithin(List query, double radius) — The number of points within radius of query (no result list). - abstract final class Morton — Morton (Z-order) codes: interleave the bits of integer cell coordinates so points close in space get close codes. - Morton: static int encode3(int x, int y, int z) — 3-D code from 21-bit coordinates (0 … 2²¹−1 each), 63 bits. - Morton: static (int, int, int) decode3(int code) - Morton: static int encode2(int x, int y) — 2-D code from 31-bit coordinates, 62 bits. - Morton: static (int, int) decode2(int code) - Morton: static int morton3d30(double x, double y, double z) — 30-bit 3-D code (10 bits per axis) of a point already normalised to 0, 1³: the LBVH / GPU form. - final class KnnResult — The k nearest neighbours of one or more queries: indices and squared Euclidean distances dist2, k per query, nearest first. - KnnResult: KnnResult(this.k, this.indices, this.dist2) - KnnResult: final int k - KnnResult: final Int32List indices - KnnResult: final Float64List dist2 - KnnResult: int get queries — Number of queries. - final class RadiusResult — Points within a radius of one query: indices and squared distances dist2, nearest first when sorted. - RadiusResult: RadiusResult(this.indices, this.dist2) - RadiusResult: final Int32List indices - RadiusResult: final Float64List dist2 - RadiusResult: int get length - final class KnnHeap — A fixed-capacity list of the best k candidates, kept sorted by insertion (k is small in practice; nanoflann's KNNResultSet does the same). - KnnHeap: KnnHeap(this.k) - KnnHeap: final int k - KnnHeap: final Int32List idx - KnnHeap: final Float64List d2 - KnnHeap: int count - KnnHeap: double get worst — The current pruning bound: the k-th best distance, or ∞ while fewer than k are held. - KnnHeap: void reset() - KnnHeap: void add(int index, double dist2) - abstract final class PointCloud — Point-cloud operations on interleaved xyz Float64List clouds (the layouts Open3D and PCL describe; the algorithms are the textbook ones, written here). - PointCloud: static Float64List centroid(Float64List xyz) - PointCloud: static (Float64List, Float64List) bounds(Float64List xyz) — (min xyz, max xyz). - PointCloud: static Float64List voxelDownsample(Float64List xyz, double voxel) — Voxel-grid downsampling: one point per occupied voxel of size voxel, the mean of the points in it. - PointCloud: static Float64List estimateNormals(Float64List xyz, {int k = 10, List? viewpoint, KdTree? tree}) — Unit normals by PCA of each point's k nearest neighbours: the eigenvector of the smallest eigenvalue of the neighbourhood covariance. - PointCloud: static Int32List removeStatisticalOutliers(Float64List xyz, {int k = 8, double stdRatio = 2}) — Statistical outlier removal (PCL's StatisticalOutlierRemoval): the mean distance d_i from each point to its k nearest others; points with d_i > μ + stdRatio·σ are outliers. - PointCloud: static ({Float64List rotation, Float64List translation}) rigidTransform(Float64List a, Float64List b, {Float64List? weights}) — Least-squares rigid transform taking points a onto corresponding points b (same count, interleaved): b ≈ R·a + t. - PointCloud: static ({Float64List rotation, Float64List translation, double rmse, int iterations}) icp(Float64List source, Float64List target, {int maxIterations = 50, double tolerance = 1e-10, double maxDistance = double.infinity}) — Point-to-point ICP (Besl and McKay 1992): repeatedly match every source point to its nearest target point (k-d tree) and solve the rigid transform (rigidTransform) until the RMS error stops improving by more than… - PointCloud: static void transform(Float64List r, Float64List t, Float64List xyz) — Applies x → R·x + t in place to interleaved xyz. ### Special functions (riptide_numerics_special) import 'package:riptide_numerics_special/riptide_numerics_special.ray'; Gamma and beta (complete and incomplete), the erf family, Bessel J, Y, I and K, Airy, elliptic integrals, Legendre and spherical harmonics, zeta and hypergeometric functions, tested against SciPy and mpmath. https://riptidecompute.com/raya/docs/numerics-special - ({double ai, double aip, double bi, double bip}) airy(double x) — Airy functions Ai, Ai', Bi, Bi' at real x (DLMF 9.6: Bessel functions of order 1/3 and 2/3 for |x| ≥ 1, the Maclaurin series inside). - double besselJ(double v, double x) — Bessel function of the first kind J_v(x) for real v and x (x < 0 only for integer v). - double besselY(double v, double x) — Bessel function of the second kind Y_v(x), x > 0. - double besselI(double v, double x) — Modified Bessel function of the first kind I_v(x) (x < 0 only for integer v). - double besselIe(double v, double x) — Exponentially scaled I_v(x) e^(-|x|). - double besselK(double v, double x) — Modified Bessel function of the second kind K_v(x), x > 0. - double besselKe(double v, double x) — Exponentially scaled K_v(x) e^x. - double sphericalJ(int n, double x) — Spherical Bessel j_n(x) = √(π/2x) J_{n+1/2}(x). - double sphericalY(int n, double x) — Spherical Bessel y_n(x) = √(π/2x) Y_{n+1/2}(x). - double carlsonRC(double x, double y) — Carlson's degenerate integral R_C(x, y) (Cauchy principal value for y < 0). - double carlsonRF(double x, double y, double z) — Carlson's symmetric integral of the first kind R_F(x, y, z). - double carlsonRD(double x, double y, double z) — Carlson's symmetric integral of the second kind R_D(x, y, z) = R_J(x, y, z, z). - double carlsonRJ(double x, double y, double z, double p) — Carlson's symmetric integral of the third kind R_J(x, y, z, p), p > 0. - double ellipk(double m) — Complete elliptic integral of the first kind K(m), m < 1 (SciPy ellipk). - double ellipkm1(double p) — K(1 - p), accurate for p near 0 (SciPy ellipkm1). - double ellipe(double m) — Complete elliptic integral of the second kind E(m), m ≤ 1 (SciPy ellipe). - double ellipkinc(double phi, double m) — Incomplete elliptic integral of the first kind F(φ | m) (SciPy ellipkinc). - double ellipeinc(double phi, double m) — Incomplete elliptic integral of the second kind E(φ | m) (SciPy ellipeinc). - double ellippi(double n, double m) — Complete elliptic integral of the third kind Π(n | m), n < 1, m < 1. - double ellippiinc(double n, double phi, double m) — Incomplete elliptic integral of the third kind Π(n; φ | m) (DLMF 19.25.14; n sin²φ < 1). - ({double sn, double cn, double dn, double ph}) ellipj(double u, double m) — Jacobi elliptic functions sn, cn, dn and the amplitude φ at u for 0 ≤ m ≤ 1 (SciPy ellipj), by the arithmetic–geometric mean and descending Landen transformation (Abramowitz and Stegun 16.4). - double erf(double x) — The error function erf(x). - double erfc(double x) — The complementary error function erfc(x) = 1 - erf(x). - double erfcx(double x) — The scaled complementary error function erfcx(x) = e^(x²) erfc(x). - double erfinv(double y) — Inverse error function: erf(erfinv(y)) = y for -1 ≤ y ≤ 1. - double erfcinv(double q) — Inverse complementary error function: erfc(erfcinv(q)) = q for 0 ≤ q ≤ 2. - double ndtr(double x) — The standard normal CDF Φ(x) (SciPy ndtr). - double ndtri(double p) — The standard normal quantile Φ⁻¹(p) (SciPy ndtri). - double stirlingCorrection(double x) — Stirling correction lgamma(x) - ((x - 1/2) ln x - x + ln(2π)/2) for x ≥ 10. - double gamma(double x) — The gamma function Γ(x) for real x. - double gammaSign(double x) — Sign of Γ(x) (+1 or -1; +1 for NaN inputs). - double lgamma(double x) — Log|Γ(x)|. +∞ at non-positive integers. - double digamma(double x) — The digamma function ψ(x) = Γ'(x)/Γ(x). - double trigamma(double x) — The trigamma function ψ'(x). - double polygamma(int n, double x) — The polygamma function ψ^(n)(x) for n ≥ 0 and x > 0 (n = 0, 1 for any real x): (-1)^(n+1) n! ζ(n + 1, x). - double beta(double a, double b) — The beta function B(a, b) = Γ(a) Γ(b) / Γ(a + b), for a, b > 0. - double lbeta(double a, double b) — Log B(a, b) for a, b > 0, without cancellation for large or very unequal arguments. - double hyp2f1(double a, double b, double c, double z) — Gauss hypergeometric function ₂F₁(a, b; c; z) for real z < 1 (and z = 1 when c - a - b > 0): the power series for 0 ≤ z ≤ 1/2, Pfaff's transformation for z < 0 and the 1 - z connection formula (DLMF 15.8.4) for 1/2 < z… - double hyp1f1(double a, double b, double x) — Confluent hypergeometric function ₁F₁(a; b; x) (Kummer's M) for real x: the series, with Kummer's transformation e^x ₁F₁(b - a; b; -x) for x < 0. - double gammaincP(double a, double x) — The regularized lower incomplete gamma function P(a, x) = γ(a, x) / Γ(a) (SciPy gammainc), a > 0, x ≥ 0. - double gammaincQ(double a, double x) — The regularized upper incomplete gamma function Q(a, x) = 1 - P(a, x) (SciPy gammaincc). - double gammaincPInv(double a, double p) — Inverse of gammaincP in x (SciPy gammaincinv). - double gammaincQInv(double a, double q) — Inverse of gammaincQ in x (SciPy gammainccinv). - double betainc(double a, double b, double x) — The regularized incomplete beta function I_x(a, b) (SciPy betainc), a, b > 0, 0 ≤ x ≤ 1. - double betaincc(double a, double b, double x) — 1 - I_x(a, b) (SciPy betaincc). - double betaincinv(double a, double b, double p) — Inverse of betainc in x (SciPy betaincinv). - double betainccinv(double a, double b, double q) — Inverse of betaincc in x (SciPy betainccinv). - double legendreP(int n, double x) — Legendre polynomial P_n(x) by the three-term recurrence. - double assocLegendreP(int l, int m, double x) — Associated Legendre function P_l^m(x) for |x| ≤ 1, with the Condon–Shortley phase (-1)^m (SciPy lpmv(m, l, x) and DLMF 14.7.10 convention). - (double, double) sphericalHarmonic(int l, int m, double theta, double phi) — Complex spherical harmonic Y_l^m(θ, φ) = N_l^m P_l^m(cos θ) e^{imφ} (θ polar, φ azimuth; Condon–Shortley phase, as SciPy sph_harm_y(l, m, θ, φ)). - double realSphericalHarmonic(int l, int m, double theta, double phi) — Real spherical harmonic Y_lm (no Condon–Shortley phase) at polar angle θ and azimuth φ: √2 N P_l^m cos mφ for m > 0, N P_l^0 for m = 0, √2 N P_l^|m| sin |m|φ for m < 0. - void realShBasis(int lmax, double x, double y, double z, Float64List out) — All real SH values up to band lmax for the unit direction (x, y, z), into out ((lmax+1)² values, index l² + l + m). - double log1p(double x) — log(1 + x) accurate for small x (Goldberg's correction: the rounding of 1 + x is divided back out). - double expm1(double x) — exp(x) - 1 accurate for small x (Kahan's correction). - double log1pmx(double x) — log(1 + x) - x, without cancellation for small x. - double sinpi(double x) — sin(πx) with exact argument reduction (exact zeros at integers). - double cospi(double x) — cos(πx) with exact argument reduction. - double hurwitzZeta(double s, double a) — Hurwitz zeta ζ(s, a) = Σ_{k≥0} (k + a)^-s for a > 0 and s ≠ 1, by Euler–Maclaurin summation (the method of Cephes zeta.c and of SciPy's zeta(x, q), written here from the formula). - double zeta(double s) — Riemann zeta ζ(s) for real s (the functional equation for s < 0). - final class ShRotation — Rotation matrices for real spherical harmonics, band by band up to lmax, built from a 3×3 rotation by the recurrence of Ivanic and Ruedenberg (J. - ShRotation: factory ShRotation.fromMatrix(int lmax, List r) — From a row-major 3×3 rotation matrix r (r3*i + j = R_ij, acting on column vectors). - ShRotation: factory ShRotation.fromQuat(int lmax, Quat q) — From a unit quaternion (riptide_math Quat). - ShRotation: final int lmax - ShRotation: final List bands — Bandsl is the (2l+1)×(2l+1) row-major block, rows and columns ordered m = -l … l. - ShRotation: void apply(List coeffs, List out) — Out = M · coeffs for (lmax+1)² coefficients (out may not alias coeffs). - ShRotation: void applyToShRgb(ShRgb sh) — Rotates the 27 RGB coefficients of a riptide_math ShRgb in place (needs lmax ≥ 2). ### Statistics and random numbers (riptide_numerics_stats) import 'package:riptide_numerics_stats/riptide_numerics_stats.ray'; Counter-based Philox and Threefry generators that give the same bits on the CPU and the GPU, distributions with pdf, cdf and ppf, descriptive statistics, regression, PCA and k-means. https://riptidecompute.com/raya/docs/numerics-stats - abstract final class Stats — Descriptive statistics over a sample (any List, typically a Float64List or one axis of an NDArray). - Stats: static double mean(List x) — Mean with Neumaier's compensated sum. - Stats: static double sum(List x) — Neumaier (improved Kahan) summation. - Stats: static double variance(List x, {int ddof = 0}) — Variance by Welford's one-pass algorithm; ddof = 0 (population, NumPy's default) or 1 (sample). - Stats: static double std(List x, {int ddof = 0}) - Stats: static double skewness(List x, {bool bias = true}) — Skewness g1 (SciPy skew, bias=True by default; bias=False gives the adjusted Fisher–Pearson G1). - Stats: static double kurtosis(List x, {bool fisher = true, bool bias = true}) — Kurtosis (SciPy kurtosis: Fisher's definition, excess over 3, by default; bias=True by default). - Stats: static double median(List x) - Stats: static double quantile(List x, double q, {String method = 'linear'}) — Quantile q in 0, 1 with NumPy's method names (default 'linear'). - Stats: static double quantileSorted(List s, double q, {String method = 'linear'}) — quantile over already sorted data. - Stats: static (Int64List, Float64List) histogram(List x, int bins, {(double, double)? range}) — Histogram with NumPy's semantics: bins equal-width bins over range (default the data's min/max; ±0.5 when they are equal), every bin half-open except the last, values outside excluded. - Stats: static double pearson(List x, List y) — Pearson correlation coefficient (two-pass). - Stats: static double spearman(List x, List y) — Spearman's rank correlation (ties get average ranks, as SciPy). - Stats: static Float64List rank(List x) — Ranks 1…n with ties averaged (SciPy rankdata, method='average'). - Stats: static Float64List covariance(List data, int n, int p, {int ddof = 1}) — Covariance matrix of data (n rows = observations, p columns = variables, row-major), p×p, with ddof. - Stats: static Float64List correlationMatrix(List data, int n, int p) — Correlation matrix (NumPy corrcoef with rowvar=False). - abstract base class ContinuousDistribution — A univariate continuous distribution. - ContinuousDistribution: const ContinuousDistribution() - ContinuousDistribution: double get mean - ContinuousDistribution: double get variance - ContinuousDistribution: double get std - ContinuousDistribution: double pdf(double x) - ContinuousDistribution: double logpdf(double x) - ContinuousDistribution: double cdf(double x) - ContinuousDistribution: double sf(double x) — Survival function 1 - cdf, computed without cancellation. - ContinuousDistribution: double ppf(double p) — Quantile function (inverse cdf). - ContinuousDistribution: double isf(double q) — Inverse survival function. - ContinuousDistribution: double sample(PhiloxStream rng) - ContinuousDistribution: void sampleInto(PhiloxStream rng, Float64List out) - abstract base class DiscreteDistribution — A univariate distribution on the integers. - DiscreteDistribution: const DiscreteDistribution() - DiscreteDistribution: double get mean - DiscreteDistribution: double get variance - DiscreteDistribution: double pmf(int k) - DiscreteDistribution: double logpmf(int k) - DiscreteDistribution: double cdf(int k) - DiscreteDistribution: double sf(int k) - DiscreteDistribution: int ppf(double p) — Smallest k with cdf(k) ≥ p. - DiscreteDistribution: int sample(PhiloxStream rng) - final class Uniform extends ContinuousDistribution — Uniform on [low, high). - Uniform: const Uniform([this.low = 0, this.high = 1]) - Uniform: final double low - Uniform: final double high - Uniform: double get mean - Uniform: double get variance - Uniform: double logpdf(double x) - Uniform: double cdf(double x) - Uniform: double sf(double x) - Uniform: double ppf(double p) - Uniform: double sample(PhiloxStream rng) - final class Normal extends ContinuousDistribution — Normal N(loc, scale²). - Normal: const Normal([this.loc = 0, this.scale = 1]) - Normal: final double loc - Normal: final double scale - Normal: double get mean - Normal: double get variance - Normal: double logpdf(double x) - Normal: double cdf(double x) - Normal: double sf(double x) - Normal: double ppf(double p) - Normal: double isf(double q) - Normal: double sample(PhiloxStream rng) - final class Exponential extends ContinuousDistribution — Exponential with mean scale (rate 1/scale). - Exponential: const Exponential([this.scale = 1]) - Exponential: final double scale - Exponential: double get mean - Exponential: double get variance - Exponential: double logpdf(double x) - Exponential: double cdf(double x) - Exponential: double sf(double x) - Exponential: double ppf(double p) - Exponential: double isf(double q) - Exponential: double sample(PhiloxStream rng) - final class GammaDistribution extends ContinuousDistribution — Gamma with shape a and scale. - GammaDistribution: const GammaDistribution(this.a, [this.scale = 1]) - GammaDistribution: static double standardGamma(double a, PhiloxStream rng) — A Gamma(a, 1) variate. - GammaDistribution: final double a - GammaDistribution: final double scale - GammaDistribution: double get mean - GammaDistribution: double get variance - GammaDistribution: double logpdf(double x) - GammaDistribution: double cdf(double x) - GammaDistribution: double sf(double x) - GammaDistribution: double ppf(double p) - GammaDistribution: double isf(double q) - GammaDistribution: double sample(PhiloxStream rng) - final class BetaDistribution extends ContinuousDistribution — Beta(a, b) on 0, 1. - BetaDistribution: const BetaDistribution(this.a, this.b) - BetaDistribution: final double a - BetaDistribution: final double b - BetaDistribution: double get mean - BetaDistribution: double get variance - BetaDistribution: double logpdf(double x) - BetaDistribution: double cdf(double x) - BetaDistribution: double sf(double x) - BetaDistribution: double ppf(double p) - BetaDistribution: double isf(double q) - BetaDistribution: double sample(PhiloxStream rng) - final class Poisson extends DiscreteDistribution — Poisson with mean mu. - Poisson: const Poisson(this.mu) - Poisson: final double mu - Poisson: double get mean - Poisson: double get variance - Poisson: double logpmf(int k) - Poisson: double cdf(int k) - Poisson: double sf(int k) - Poisson: int ppf(double p) - Poisson: int sample(PhiloxStream rng) - final class Binomial extends DiscreteDistribution — Binomial(n, p). - Binomial: const Binomial(this.n, this.p) - Binomial: final int n - Binomial: final double p - Binomial: double get mean - Binomial: double get variance - Binomial: double logpmf(int k) - Binomial: double cdf(int k) - Binomial: double sf(int k) - Binomial: int ppf(double q) - Binomial: int sample(PhiloxStream rng) - final class MultivariateNormal — Multivariate normal with mean (d) and covariance cov (d×d row-major, positive definite). - MultivariateNormal: MultivariateNormal(this.mean, this.cov) - MultivariateNormal: final Float64List mean - MultivariateNormal: final Float64List cov - MultivariateNormal: final int d - MultivariateNormal: double logpdf(Float64List x) - MultivariateNormal: double pdf(Float64List x) - MultivariateNormal: void sample(PhiloxStream rng, Float64List out) — One sample written to out (length d): mean + L z with z standard normal. - final class Dirichlet — Dirichlet(alpha) on the simplex. - Dirichlet: Dirichlet(this.alpha) - Dirichlet: final Float64List alpha - Dirichlet: double get alpha0 - Dirichlet: Float64List get mean - Dirichlet: Float64List get variance - Dirichlet: double logpdf(Float64List x) - Dirichlet: double pdf(Float64List x) - Dirichlet: void sample(PhiloxStream rng, Float64List out) - final class LinearRegression — Ordinary least squares fit (Householder QR, so no normal equations). - LinearRegression: factory LinearRegression.fit(List x, int n, int p, List y, {bool intercept = true}) — Fits y ≈ X β for X (n×p row-major). - LinearRegression: final Float64List coefficients - LinearRegression: final Float64List standardErrors - LinearRegression: final Float64List residuals - LinearRegression: final double rSquared - LinearRegression: final double residualVariance - final class LogisticRegression — Logistic regression by iteratively reweighted least squares (Newton's method on the log-likelihood), with an optional L2 penalty l2 on the non-intercept coefficients. - LogisticRegression: factory LogisticRegression.fit(List x, int n, int p, List y, {bool intercept = true, double l2 = 0, int maxIterations = 100, double tolerance = 1e-12}) - LogisticRegression: final Float64List coefficients - LogisticRegression: final Float64List standardErrors - LogisticRegression: final double logLikelihood - LogisticRegression: final int iterations - LogisticRegression: final bool intercept - LogisticRegression: double predict(List features) — P(y = 1 | features) for one row of p features. - final class Pca — Principal component analysis by the SVD of the centred data (part A's svd, LAPACK-style one-sided bidiagonal QR), which avoids squaring the condition number as the covariance route does. - Pca: factory Pca.fit(List data, int n, int p, {int? k}) — Fits data (n×p row-major), keeping k components (all by default). - Pca: factory Pca.fitArray(NDArray x, {int? k}) — Fits the rows of a 2-D NDArray (n×p, any real dtype). - Pca: final int p - Pca: final Float64List mean - Pca: final Float64List components — K×p row-major: row i is the i-th principal axis (unit length; largest component positive). - Pca: final Float64List explainedVariance - Pca: final Float64List explainedVarianceRatio - Pca: int get k - Pca: Float64List transform(List data, int n) — Projects n rows of p features onto the k components (n×k). - final class KMeans — k-means clustering: k-means++ seeding (Arthur and Vassilvitskii 2007) from a Philox stream, then Lloyd iterations; the best of restarts runs by inertia. - KMeans: factory KMeans.fit(List data, int n, int p, int k, {int seed = 0, int restarts = 4, int maxIterations = 300, double tolerance = 1e-10}) - KMeans: final Float64List centroids — K×p row-major centroids. - KMeans: final Int32List labels - KMeans: final double inertia - KMeans: final int iterations - abstract final class Philox4x32 — Philox4x32-10: a 4×32-bit counter and a 2×32-bit key give 4 independent 32-bit words. - Philox4x32: static const int m0 = 0xD2511F53 - Philox4x32: static const int m1 = 0xCD9E8D57 - Philox4x32: static const int w0 = 0x9E3779B9 - Philox4x32: static const int w1 = 0xBB67AE85 - Philox4x32: static (int, int) mulhilo16(int a, int b) — The 32×32 → 64-bit product as (hi, lo) using only 16-bit partial products and 32-bit wrapping arithmetic: the fallback a GLSL kernel uses where umulExtended is missing (it is mirrored here so the test pins the method). - Philox4x32: static void block(int c0, int c1, int c2, int c3, int k0, int k1, Uint32List out, [int offset = 0]) — One block: writes Philox4x32-10(counter (c0, c1, c2, c3), key (k0, k1)) to outoffset..offset+3. - abstract final class Threefry2x32 — Threefry2x32-20: a 2×32-bit counter and a 2×32-bit key give 2 words (Threefish-style add/rotate/xor). - Threefry2x32: static const int parity = 0x1BD11BDA - Threefry2x32: static void block(int c0, int c1, int k0, int k1, Uint32List out, [int offset = 0]) — One block: writes Threefry2x32-20(counter (c0, c1), key (k0, k1)) to outoffset, outoffset+1. - abstract final class U32 — The exact u32 → floating-point conversions (identical on CPU and GPU: integer shifts and a power-of-two scale). - U32: static double toFloat01(int u) — [0, 1) float32: (u >> 8) · 2^-24. - U32: static double toFloatOpen(int u) — (0, 1] float32: ((u >> 8) + 1) · 2^-24 (safe for log). - U32: static double toDouble01(int a, int b) — [0, 1) double from two words: ((a >> 5) · 2^26 + (b >> 6)) · 2^-53. - U32: static double toDoubleOpen(int a, int b) — (0, 1] double from two words. - abstract interface class RandomSource — A source of 32-bit words (the generators below). - RandomSource: int nextU32() — The next uniformly distributed 32-bit word (0 … 2^32-1). - final class PhiloxStream implements RandomSource — A Philox4x32-10 stream. - PhiloxStream: PhiloxStream(int seed, {int stream = 0}) — seed and stream are 64-bit; words are drawn from block position 0 upward. - PhiloxStream: PhiloxStream.substream(int seed, int a, int b) — Stream (a, b) of seed: counter words c2 = a, c3 = b. - PhiloxStream: final int k0 - PhiloxStream: final int k1 - PhiloxStream: final int s0 - PhiloxStream: final int s1 - PhiloxStream: int get position — The block position the next refill uses (a 64-bit counter). - PhiloxStream: void seek(int position) — Jumps to block position, discarding buffered words. - PhiloxStream: int nextU32() - PhiloxStream: double nextDouble() — A uniform double in [0, 1) (two words). - PhiloxStream: double nextDoubleOpen() — A uniform double in (0, 1] (two words). - PhiloxStream: double nextFloat() — A uniform float32 value in [0, 1) (one word), returned as a double. - PhiloxStream: double nextNormal() — A standard normal by the Box–Muller transform on two open uniforms; values come in pairs (the second is cached). - PhiloxStream: int nextInt(int n) — An integer uniform in [0, n) without modulo bias (Lemire's multiply-shift with rejection), n ≤ 2^32. - PhiloxStream: void fillUniform(Float64List out) — Fills out with uniform doubles in [0, 1). - PhiloxStream: void fillUniformF32(Float32List out) — Fills out with float32 uniforms in [0, 1) (one word each: the GPU-identical conversion). - PhiloxStream: void fillNormal(Float64List out, {double mean = 0, double std = 1}) — Fills out with standard normals (Box–Muller). - PhiloxStream: void fillNormalF32(Float32List out, {double mean = 0, double std = 1}) — Fills out with float32 standard normals by Box–Muller on float32 uniforms (one word per uniform), the formula a GPU kernel evaluates; transcendental functions may differ by an ulp between CPU and GPU. - PhiloxStream: void fillU32(Uint32List out) — Fills out with raw words, block by block (what a GPU kernel writes for the same seed and stream). - final class ThreefryStream implements RandomSource — A Threefry2x32-20 stream: key = seed, counter = (position, stream). - ThreefryStream: ThreefryStream(int seed, {int stream = 0}) - ThreefryStream: final int k0 - ThreefryStream: final int k1 - ThreefryStream: final int s - ThreefryStream: int nextU32() - ThreefryStream: double nextDouble() ### GPU numerics (riptide_numerics_gpu) import 'package:riptide_numerics_gpu/riptide_numerics_gpu.ray'; Dense and batched GEMM, Cholesky and LU, sparse products, random numbers and BVH queries as GPU compute kernels on Metal and Vulkan. https://riptidecompute.com/raya/docs/numerics-gpu - PackedMatrix packMatrix(NDArray a, GpuPrecision precision) — Packs a 2-d rows, cols or 3-d batch, rows, cols array of any dtype, strides or order (transposed views are packed by value; nothing on the GPU needs a transpose flag). - NDArray unpackMatrix(PackedMatrix p) — The values a packed matrix holds, as float64 (batch, rows, cols, or 2-d when batch is 1): what the GPU actually multiplies, for error bounds in tests. - Future openGemmEngine() — The best GEMM engine on this device: Riptide's Metal 4 kernels when the engine has them, else Evelyn GPU compute, else null. - void packF32(NDArray x, Float32List out) — x (2-d, any strides and real dtype) into out as row-major float32. - final class NumericsGpu — The loaded kernels. - NumericsGpu: static Future load({ByteData? shaderBundle}) - NumericsGpu: static gpu.BufferView view(gpu.DeviceBuffer b) - NumericsGpu: final gpu.GpuContext context - NumericsGpu: GpuCsrMatrix upload(CsrMatrix a) — Uploads a (values narrowed to f32) once; reuse it for every SpMV. - NumericsGpu: gpu.DeviceBuffer floats(int n) — A device buffer of n floats (host-visible, so results can be read back). - NumericsGpu: gpu.DeviceBuffer floatsFrom(Float32List v) - NumericsGpu: void encodeSpmv(gpu.CommandBuffer commands, GpuCsrMatrix a, gpu.DeviceBuffer x, gpu.DeviceBuffer y, {double alpha = 1, double beta = 0}) — Records y = alpha·A·x + beta·y into commands (one dispatch, 64 rows per workgroup). - NumericsGpu: void encodeSpmm(gpu.CommandBuffer commands, GpuCsrMatrix a, gpu.DeviceBuffer x, int k, gpu.DeviceBuffer y) — Records Y = A·X into commands: X is cols × k and Y rows × k, both row-major f32 (one invocation per output element). - NumericsGpu: void encodePhilox(gpu.CommandBuffer commands, gpu.DeviceBuffer out, {required int blocks, required int key0, required int key1, int base = 0, int c1 = 0, int c2 = 0, int c3 = 0, bool asFloats = false}) — Records blocks Philox4x32-10 blocks into out (4 words per block): counter (base + i, c1, c2, c3), key (k0, k1). asFloats writes f32 uniforms in [0, 1) (float(x >> 8)·2⁻²⁴) instead of raw u32 words. - NumericsGpu: GpuBvh uploadBvh(AabbBvh bvh, Float64List mins, Float64List maxs) — Uploads a riptide_numerics_spatial AabbBvh (its 32-byte nodes byte for byte) and the primitive boxes it was built over (mins, maxs: 3 doubles per box, narrowed to f32). - NumericsGpu: void encodeBvhQuery(gpu.CommandBuffer commands, GpuBvh bvh, gpu.DeviceBuffer queries, int queryCount, gpu.DeviceBuffer hits) — Records one stackless traversal per query box (queries: 6 floats each, min then max) writing 2 ints per query into hits: the number of primitives whose box overlaps it, and the smallest such index (−1 for none). - NumericsGpu: void reset() — Frees the per-call uniform space once the commands that used it have completed. - final class GpuCsrMatrix — A CSR matrix resident on the GPU. - GpuCsrMatrix: final int rows - GpuCsrMatrix: final int cols - GpuCsrMatrix: final gpu.DeviceBuffer indptr - GpuCsrMatrix: final gpu.DeviceBuffer indices - GpuCsrMatrix: final gpu.DeviceBuffer values - final class GpuBvh — An AabbBvh resident on the GPU. - GpuBvh: final int nodeCount - GpuBvh: final gpu.DeviceBuffer nodes - GpuBvh: final gpu.DeviceBuffer primOrder - GpuBvh: final gpu.DeviceBuffer boxes - abstract interface class GemmEngine — A GPU that runs dense matrix products. - GemmEngine: String get name - GemmEngine: void gemmSync(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0, GpuPrecision precision = GpuPrecision.f32}) — C = alpha * A @ B + beta * C, waiting for the GPU without returning to the event loop (for GemmBackend). c must be float32 or float64; it is written in place. - final class BatchedCholesky — Result of NumericsLinalgGpu.batchedCholesky: L (lower, f32), the solutions when a right-hand side was given, and per-matrix info (0 = ok, j + 1 = minor j + 1 not positive definite). - BatchedCholesky: BatchedCholesky(this.l, this.x, this.info) - BatchedCholesky: final NDArray l - BatchedCholesky: final NDArray? x - BatchedCholesky: final Int32List info - final class BatchedLu — Result of NumericsLinalgGpu.batchedLu: packed L\U (f32, unit-diagonal L below), 0-based pivots per step, the solutions when a right-hand side was given, per-matrix info (0 = ok, j + 1 = zero pivot at step j). - BatchedLu: BatchedLu(this.lu, this.pivots, this.x, this.info) - BatchedLu: final NDArray lu - BatchedLu: final Int32List pivots - BatchedLu: final NDArray? x - BatchedLu: final Int32List info - final class ChainCholesky — A LinalgChain.cholesky recorded on the chain: where its L, X and per-matrix info live until LinalgChain.readCholesky. - ChainCholesky: final GpuMatrix a — The factored matrices (L in the lower triangle) and the solutions, both in place. - ChainCholesky: final GpuMatrix? rhs - ChainCholesky: final gpu.DeviceBuffer info - ChainCholesky: final int n - ChainCholesky: final int nrhs - ChainCholesky: final int batch - final class ChainLu — A LinalgChain.lu recorded on the chain (see ChainCholesky). - ChainLu: final GpuMatrix a - ChainLu: final GpuMatrix? rhs - ChainLu: final gpu.DeviceBuffer pivots - ChainLu: final gpu.DeviceBuffer info - ChainLu: final int n - ChainLu: final int nrhs - ChainLu: final int batch - final class NumericsLinalgGpu implements GemmEngine — The loaded dense kernels. - NumericsLinalgGpu: static Future open({ByteData? shaderBundle}) — The kernels, or null when this device has no compute (OpenGL ES) or Evelyn GPU isn't enabled. - NumericsLinalgGpu: static final bool hasBlockingWait — Whether the engine has Evelyn's CommandBuffer.submitAndWaitSync (patch 30; the pinned Riptide SDK's engine has not until an Evelyn release carries it). - NumericsLinalgGpu: static bool debugForceFlagWait — Benchmarks only: forces the flag-and-settle wait on an engine that has the blocking one, to measure both in one process. - NumericsLinalgGpu: static bool get blockingWaitInUse — Whether the synchronous waits use the engine's blocking wait. - NumericsLinalgGpu: final gpu.GpuContext context - NumericsLinalgGpu: String get name - NumericsLinalgGpu: GpuMatrix upload(PackedMatrix p) — Uploads a packed matrix (device buffer of its words). - NumericsLinalgGpu: GpuMatrix output(int rows, int cols, {int batch = 1}) — A host-visible f32 output of batch x rows x cols (row-major, ld = cols). - NumericsLinalgGpu: void encodeGemm(gpu.CommandBuffer commands, GpuMatrix a, GpuMatrix b, GpuMatrix c, {double alpha = 1, double beta = 0, int repeat = 1}) — Records C = alpha * A @ B + beta * C (batched when A or B has a batch; a batch of 1 is shared). - NumericsLinalgGpu: void encodeSmallGemm(gpu.CommandBuffer commands, GpuMatrix a, GpuMatrix b, GpuMatrix c) — Records batched small products Ct = At @ Bt (one invocation per output element). - NumericsLinalgGpu: NDArray readResult(GpuMatrix m) — Reads a f32 output (or a LinalgChain result) back, once its command buffer has completed. - NumericsLinalgGpu: Future matmul(NDArray a, NDArray b, {GpuPrecision precision = GpuPrecision.f32, double alpha = 1}) — A @ B on the GPU (2-d, or batched 3-d with the same batch or a shared 2-d operand); the result is float32. - NumericsLinalgGpu: Future batchedMatmul(NDArray a, NDArray b) — Batched small At @ Bt (batch, m, k @ batch, k, n), one invocation per element; float32 result. - NumericsLinalgGpu: Future batchedCholesky(NDArray a, {NDArray? rhs}) — Cholesky of each batch, n, n symmetric positive definite matrix (f32, one invocation per matrix; meant for n <= 64), and A X = B for rhs batch, n, nrhs when given. - NumericsLinalgGpu: Future batchedLu(NDArray a, {NDArray? rhs}) — LU with partial pivoting of each batch, n, n matrix (f32, one invocation per matrix), and A X = B for rhs batch, n, nrhs when given. - NumericsLinalgGpu: Future batchedCholeskySerial(NDArray a, {NDArray? rhs}) — batchedCholesky as it was before LinalgChain: one command buffer, one wait and one read per call. - NumericsLinalgGpu: Future batchedLuSerial(NDArray a, {NDArray? rhs}) — batchedLu as it was before LinalgChain (reference, like batchedCholeskySerial). - NumericsLinalgGpu: void gemmSync(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0, GpuPrecision precision = GpuPrecision.f32, Duration timeout = const Duration(seconds: 60)}) - NumericsLinalgGpu: void gemmSyncSerial(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0, GpuPrecision precision = GpuPrecision.f32, Duration timeout = const Duration(seconds: 60)}) — gemmSync as it was before LinalgChain.runSync: the signal kernel in a pass of its own after the product's. - NumericsLinalgGpu: LinalgChain chain() — A chain: many GEMMs and small GEMMs recorded into one command buffer with hazard-tracked barriers, one wait at LinalgChain.run, then reads (see LinalgChain). - NumericsLinalgGpu: GpuMatrix uploadF32(Float32List data, int rows, int cols) — Uploads a row-major f32 rows x cols matrix as it is (no NDArray, no copy beyond the upload). - NumericsLinalgGpu: Float32List readF32(GpuMatrix m) — Reads a f32 output back as a flat row-major list, once its command buffer has completed. - NumericsLinalgGpu: GpuIntMatrix uploadI32(Int32List data, int rows, int cols) — Uploads a row-major int32 rows x cols matrix for encodeGemmI32. - NumericsLinalgGpu: GpuIntMatrix outputI32(int rows, int cols) — A host-visible int32 rows x cols output for encodeGemmI32. - NumericsLinalgGpu: void encodeGemmI32(gpu.CommandBuffer commands, GpuIntMatrix a, GpuIntMatrix b, GpuIntMatrix c, {required int bound, bool accumulate = false, int repeat = 1}) — Records C = A @ B (or C += A @ B with accumulate) in 32-bit integers: the exact product whenever every partial sum fits in 32 bits. bound is max|A| · max|B| (the caller knows its inputs); the call refuses when bound ·… - NumericsLinalgGpu: Int32List readI32(GpuIntMatrix m) — Reads an int32 output back, once its command buffer has completed. - NumericsLinalgGpu: Future matmulI32(Int32List a, Int32List b, {required int m, required int n, required int k, required int bound}) — A @ B exactly in 32-bit integers (row-major m x k and k x n; bound as in encodeGemmI32). - NumericsLinalgGpu: void reset() — Frees per-call uniform space once the command buffers that used it (from the encode* calls) have completed. - NumericsLinalgGpu: GpuGemmBackend backend({int minWork = GpuGemmBackend.defaultMinWork, GpuPrecision precision = GpuPrecision.f32}) — A GemmBackend' blocked factorizations. - final class GpuIntMatrix — A row-major int32 matrix resident on the GPU (NumericsLinalgGpu.encodeGemmI32). - GpuIntMatrix: final int rows - GpuIntMatrix: final int cols - GpuIntMatrix: final gpu.DeviceBuffer buffer - final class GpuMatrix — A matrix (or batch) resident on the GPU, with its layout. - GpuMatrix: final PackedMatrix layout - GpuMatrix: final gpu.DeviceBuffer buffer - final class GpuGemmBackend implements GemmBackend — riptide_numerics_cpu' GemmBackend on a GemmEngine: f32 (or f16/bf16-input) products with f32 accumulation, so factorizations that need float64 accuracy refine on the CPU (solveRefined). - GpuGemmBackend: GpuGemmBackend(this.engine, {this.minWork = defaultMinWork, this.precision = GpuPrecision.f32}) - GpuGemmBackend: static const int defaultMinWork = 320 * 320 * 320 — Below ~320^3 multiply-adds packing, upload, submit and readback cost more than the CPU's float64 GEMM: end to end the GPU path takes 4.5 ms at 256 (CPU 4.2 ms) and 7.1 ms at 384 (CPU 12.3 ms) on an M5 Pro. - GpuGemmBackend: final GemmEngine engine - GpuGemmBackend: final GpuPrecision precision - GpuGemmBackend: final int minWork - GpuGemmBackend: String get name - GpuGemmBackend: DType get computeType - GpuGemmBackend: bool gemm(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0}) - final class LinalgChain — Many dense products, one submit and one wait: each call records into one compute pass (ComputeBatch) and places a barrier only where an op reads or writes what an earlier one wrote, so a chain of dependent products… - LinalgChain: ComputeStats get stats — What the planner did: dispatches, barriers placed and skipped. - LinalgChain: GpuMatrix gemm(GpuMatrix a, GpuMatrix b, {GpuMatrix? into, double alpha = 1, double beta = 0}) — Records C = alpha * A @ B + beta * C and returns C (a new f32 output unless into is given; a beta other than zero reads it, so pass into holding the values to accumulate onto). - LinalgChain: GpuMatrix smallGemm(GpuMatrix a, GpuMatrix b, {GpuMatrix? into}) — Records batched small products Ct = At @ Bt (f32) and returns C. - LinalgChain: ChainCholesky cholesky(GpuMatrix a, {GpuMatrix? rhs}) — Records the batched Cholesky of a (batch, n, n f32, one invocation per matrix, meant for n <= 64) and, with rhs (batch, n, nrhs), A X = B. - LinalgChain: ChainLu lu(GpuMatrix a, {GpuMatrix? rhs}) — Records the batched LU with partial pivoting of a (batch, n, n f32, in place: packed L\U) and, with rhs, A X = B (in place). - LinalgChain: BatchedCholesky readCholesky(ChainCholesky c) — Reads a cholesky result (after run). - LinalgChain: BatchedLu readLu(ChainLu c) — Reads an lu result (after run). - LinalgChain: void runSync({Duration timeout = const Duration(seconds: 60)}) — run for callers that cannot yield to the event loop (a synchronous GemmBackend): submits, then blocks the isolate until the GPU has finished: submitAndWaitSync on an Evelyn engine (patch 30). - LinalgChain: Future run() — Waits for everything recorded: one submit, one wait. - LinalgChain: NDArray read(GpuMatrix m) — Reads a f32 result back (after run). - enum GpuPrecision — What the GEMM inputs are stored as on the GPU. - GpuPrecision: f32 — Float32 inputs. - GpuPrecision: f16 — Float16 inputs (two per uint32), f32 accumulation: the mixed-precision path. - GpuPrecision: bf16 — Bfloat16 inputs (two per uint32), f32 accumulation. - final class PackedMatrix — A row-major matrix (or a batch of them) laid out for upload: words are f32 bits for GpuPrecision.f32, or two halves per word (element 2i in the low 16 bits) with each row padded to an even length otherwise. ld is the… - PackedMatrix: PackedMatrix(this.words, this.rows, this.cols, this.ld, this.batch, this.batchStride, this.precision) - PackedMatrix: final Uint32List words - PackedMatrix: final int rows - PackedMatrix: final int cols - PackedMatrix: final int ld - PackedMatrix: final int batch - PackedMatrix: final int batchStride - PackedMatrix: final GpuPrecision precision - final class RiptideGemmEngine implements GemmEngine — GemmEngine on Riptide's library GEMM. - RiptideGemmEngine: static RiptideGemmEngine? open({GpuDevice? device}) — The engine, or null when this process has no Riptide device with the Metal 4 tensor tier. - RiptideGemmEngine: final GpuDevice device - RiptideGemmEngine: final GpuKernels kernels - RiptideGemmEngine: String get name - RiptideGemmEngine: void gemmSync(NDArray a, NDArray b, NDArray c, {double alpha = 1, double beta = 0, GpuPrecision precision = GpuPrecision.f32}) - RiptideGemmEngine: void dispose() ### Tensors (riptide_tensor) import 'package:riptide_tensor/riptide_tensor.ray'; A tensor API that records a graph, runs it on the CPU while you develop, and compiles it to GPU kernels. Riptorch’s engine grew from here. https://riptidecompute.com/raya/docs/tensor - Future> buildTensorProgramsHook(BuildInput input, BuildOutputBuilder output, Map graphs, {int beam = 0, String? tuneDevice, String family = 'generic', Set library = const {}, MatmulPrecision libraryPrecision = MatmulPrecision.f16, int libraryMinFlops = 1 << 20, bool msl = true}) - String? locateImpellerc({Map? environment}) - Future> buildTensorPrograms({required Directory outDir, required Map graphs, required ProgramCompiler? toolchain, int beam = 0, String? tuneDevice, String family = 'generic', bool keepGoing = false, Set library = const {}, MatmulPrecision libraryPrecision = MatmulPrecision.f16, int libraryMinFlops = 1 << 20, bool msl = true}) — library (any of Ops.library) builds library steps: tinygrad leaves those nodes unfused and the program names them for own kernels (Metal 4 tensor-op GEMM in libraryPrecision, fused attention), with tinygrad's kernels… - Future compileShaderBundle(TensorProgram program, File bundle, String impellerc) - const maxKernelBuffers = 30 — The most buffers one generated kernel may bind (inputs + output): Metal's 31 argument-table slots, minus one spare. - abstract final class TensorContainer — The container both riptide_tensor files use (the graph Raya records, the program tinygrad writes back): - TensorContainer: static const graphMagic = 'STG1' - TensorContainer: static const programMagic = 'STP1' - TensorContainer: static const version = 1 - TensorContainer: static Uint8List pack(String magic, Map header, [Uint8List? blob]) - TensorContainer: static (Map, Uint8List) unpack(Uint8List data, String magic) — The header and the blob (a view into data, no copy). - final class CpuInterpreter — Runs a TensorGraph on the CPU in plain Raya: the reference every GPU program is checked against, and the path debug builds and hot restarts take, so development never waits on a tinygrad build. - CpuInterpreter: CpuInterpreter(this.graph) - CpuInterpreter: static TypedData alloc(DType dtype, int n) — Allocates the typed list for n elements of dtype. - CpuInterpreter: final TensorGraph graph - CpuInterpreter: Map run(Map inputs) — Runs the graph. inputs are typed lists (Float32List for float32, Int32List, Uint32List) in row-major order. - enum DType — Element types. - DType: float32('float32') - DType: int32('int32') - DType: uint32('uint32') - DType: bool_('bool') - DType: const DType(this.wire) - DType: static DType fromWire(String name) - DType: final String wire — The name in the graph and program files (tinygrad's dtype names). - DType: bool get isFloat - DType: bool get isInt - final class Node — One recorded op. - Node: final int id - Node: final String op - Node: final List shape - Node: final DType dtype - Node: final List src - Node: final Map args - Node: int get numel - Node: Map toJson() - abstract final class Ops — Ops a TensorGraph records. - Ops: static const leaves = {'input', 'weight', 'const', 'arange'} - Ops: static const unary = {'neg', 'recip', 'sqrt', 'exp2', 'log2', 'sin', 'trunc'} - Ops: static const binary - Ops: static const compare = {'cmplt', 'cmpne', 'cmpeq'} - Ops: static const reduce = {'sum', 'rmax'} - Ops: static const movement = {'reshape', 'permute', 'expand', 'pad', 'shrink', 'flip'} - Ops: static const other = {'cast', 'bitcast', 'where', 'matmul', 'conv2d', 'attention'} - Ops: static const library = {'matmul', 'conv2d', 'attention'} — Ops a program built in library mode can hand to own kernels (a library step) instead of tinygrad's. - enum MatmulPrecision — The operand format a library GEMM may use for a matmul or conv2d node (library mode only; tinygrad's own kernels and the CPU interpreter always compute float32). - MatmulPrecision: f32('f32') — Float32 operands on the matrix units' float32 path. - MatmulPrecision: f16('f16') — Float16 operands (about 3.5x float32 on M5-class GPUs; error ~2.6e-4 relative). - MatmulPrecision: bf16('bf16') — Bfloat16 operands (float32's range, 8-bit mantissa; ~2.1e-3). - MatmulPrecision: f32x3('f32x3') — Float32 as two float16 halves and three float16 products: float32 accuracy (or better) at float32 speed or better; values must stay inside float16's range. - MatmulPrecision: const MatmulPrecision(this.wire) - MatmulPrecision: final String wire - final class TensorGraph — A recorded computation: inputs, weights, ops, named outputs. - TensorGraph: TensorGraph(this.name) - TensorGraph: final String name - TensorGraph: final List nodes - TensorGraph: final Map outputs - TensorGraph: final Map inputs - TensorGraph: final Map weights - TensorGraph: String get hash — Sha256 of toBytes: a program built from this exact graph records it, so a stale program is never replayed. - TensorGraph: Node add(String op, List shape, DType dtype, [List src = const [], Map args = const {}]) - TensorGraph: Node addInput(String name, List shape, DType dtype) - TensorGraph: Node addWeight(String name, List shape, DType dtype, Uint8List bytes) - TensorGraph: void output(String name, Node node) - TensorGraph: Uint8List toBytes() — The graph file (container STG1): what the build hook hands to tinygrad. - final class ProgramBuffer — A buffer of a TensorProgram: an input, an output, a weight (bytes in TensorProgram.weights) or scratch. - ProgramBuffer: ProgramBuffer.fromJson(Map j) - ProgramBuffer: final int id - ProgramBuffer: final int nbytes - ProgramBuffer: final String dtype - ProgramBuffer: final String kind — input, output, weight or scratch. - ProgramBuffer: final String? name - ProgramBuffer: final int? offset — A weight's offset in TensorProgram.weights (256-aligned). - ProgramBuffer: final int? alias — A scratch buffer whose lifetime doesn't overlap alias's shares its memory. - ProgramBuffer: int get storage — The buffer whose memory this one uses (itself unless it aliases). - final class ProgramBinding - ProgramBinding: ProgramBinding.fromJson(Map j) - ProgramBinding: final String block — The storage block name in the kernel's GLSL (B), which Evelyn GPU binds by name ('' in MSL bindings). - ProgramBinding: final int slot — MSL bindings: the address goes at byte 8 * slot of the dispatch's root struct (-1 in GLSL bindings). - ProgramBinding: final int buffer - ProgramBinding: final int offset - ProgramBinding: final int nbytes - ProgramBinding: final bool write - final class ProgramView — A byte range of a program buffer: a library step's operand or output. - ProgramView: ProgramView.fromJson(Map j) - ProgramView: final int buffer - ProgramView: final int offset - ProgramView: final int nbytes - final class ProgramMslKernel — A kernel step in Riptide MSL (tinygrad's Metal renderer, simdgroup matrices included): its own launch dims, and bindings by root-struct slot. - ProgramMslKernel: ProgramMslKernel.fromJson(Map j) - ProgramMslKernel: final String entry - ProgramMslKernel: final List global - ProgramMslKernel: final List local - ProgramMslKernel: final List bindings - final class ProgramStep — One step of a program: a kernel dispatch, a buffer copy, or a library call (a dense matmul / conv-as-GEMM or an attention node that tinygrad left unfused for own kernels). - ProgramStep: ProgramStep.fromJson(Map j) - ProgramStep: final String kind — kernel, copy or library. - ProgramStep: final String? name — Tinygrad's kernel name (r_16_16_64, E_32_4): what it does and its shape. - ProgramStep: final String? entry — The shader's name in the program's shader bundle. - ProgramStep: final List? global — Workgroups to dispatch (x, y, z) and the invocations per workgroup the shader declares. - ProgramStep: final List? local — Workgroups to dispatch (x, y, z) and the invocations per workgroup the shader declares. - ProgramStep: final List bindings - ProgramStep: final int? src - ProgramStep: final int? dst - ProgramStep: final int? nbytes - ProgramStep: final ProgramMslKernel? msl — The same kernel in Riptide MSL (programs built with MSL; null otherwise). - ProgramStep: final String? op — Library steps: matmul (attrs m, n, k, batch, stride_a/b/c in elements, precision) or attention (attrs batch_heads, sq, skv, head_dim, scale, causal); the graph op it came from (conv2d for conv-as-GEMM) and its node. - ProgramStep: final String? sourceOp — Library steps: matmul (attrs m, n, k, batch, stride_a/b/c in elements, precision) or attention (attrs batch_heads, sq, skv, head_dim, scale, causal); the graph op it came from (conv2d for conv-as-GEMM) and its node. - ProgramStep: final int? node - ProgramStep: final Map attrs - ProgramStep: final List inputs — Library steps: operands (matmul: A, B; attention: Q, K, V) and the output, all float32 and contiguous. - ProgramStep: final ProgramView? output - ProgramStep: final List fallback — Library steps: tinygrad's kernels for the same node (they write output); a backend without the library kernel runs these instead. - final class ProgramIO - ProgramIO: ProgramIO.fromJson(Map j) - ProgramIO: final String name - ProgramIO: final int buffer - ProgramIO: final List shape - ProgramIO: final DType dtype - final class TensorProgram — A program tinygrad compiled from a TensorGraph: GLSL kernels (and, from version 2, the same kernels in Riptide MSL), the steps that dispatch them (and library steps), the buffer plan and the weights. - TensorProgram: factory TensorProgram.parse(Uint8List bytes) - TensorProgram: final Map header - TensorProgram: final String name - TensorProgram: final String graphHash — Sha256 of the graph file this program was built from (TensorGraph.hash). - TensorProgram: final Map compiler — Tinygrad commit, renderer, BEAM width, GPU family. - TensorProgram: final List buffers - TensorProgram: final List steps - TensorProgram: final Map kernelSources - TensorProgram: final Map mslSources — The kernels in Riptide MSL by entry (empty when the program was built without MSL). - TensorProgram: final List> librarySkipped — Library-op nodes the build's guard kept in tinygrad, with the reason ({node, op, shape, reason}). - TensorProgram: final List inputs - TensorProgram: final List outputs - TensorProgram: final Uint8List weights - TensorProgram: int get deviceBytes — Bytes of GPU memory the program allocates (aliased scratch counted once). - TensorProgram: int get kernelCount - TensorProgram: int get libraryCount - TensorProgram: bool get hasMsl — Whether every kernel (fallbacks included) has an MSL version, so the program runs on Riptide. - TensorProgram: bool matches(TensorGraph graph) — Whether this program was built from exactly graph. - TensorProgram: Uint8List weightBytes(ProgramBuffer b) - abstract interface class TensorBackend — Something that runs a TensorGraph: the CPU interpreter here, Evelyn GPU compute in riptide_tensor_gpu, and later Riptide. - TensorBackend: String get name — cpu, flutter_gpu... - TensorBackend: Future> run(Map inputs) — Runs once: inputs by name (Float32List / Int32List / Uint32List, row-major) to outputs by name. - TensorBackend: void dispose() - final class CpuTensorBackend implements TensorBackend — The CPU backend: CpuInterpreter on the graph itself. - CpuTensorBackend: CpuTensorBackend(TensorGraph graph) - CpuTensorBackend: String get name - CpuTensorBackend: Future> run(Map inputs) - CpuTensorBackend: void dispose() - final class BackendChoice — Why a runtime picked the backend it did (logged by apps, asserted by tests). - BackendChoice: const BackendChoice(this.backend, this.reason) - BackendChoice: final TensorBackend backend - BackendChoice: final String reason - final class Tensor — A lazy tensor: every op records a Node in its TensorGraph; nothing runs until the graph is run on the CPU (CpuInterpreter) or replayed as a tinygrad program on the GPU. - Tensor: Tensor(this.graph, this.node) - Tensor: factory Tensor.input(TensorGraph g, String name, List shape, [DType dtype = DType.float32]) - Tensor: factory Tensor.weight(TensorGraph g, String name, List shape, TypedData data) — A constant buffer (model weights): float32 from a Float32List, int32/uint32 from Int32List/Uint32List. - Tensor: factory Tensor.full(TensorGraph g, List shape, num value, [DType dtype = DType.float32]) — value in every element of shape. - Tensor: factory Tensor.arange(TensorGraph g, int n, [DType dtype = DType.int32]) — 0, 1... n - 1 (int32 or uint32). - Tensor: static (Tensor, Tensor) broadcast(Tensor a, Tensor b) — Broadcasts two tensors to one shape (numpy rules), as tinygrad's _broadcasted does, without promoting types. - Tensor: static Tensor cat(List parts, int axis) — Concatenation as tinygrad does it: pad each part into place and add. - Tensor: static Tensor stack(List parts, int axis) - Tensor: final TensorGraph graph - Tensor: final Node node - Tensor: List get shape - Tensor: DType get dtype - Tensor: int get rank - Tensor: int get numel - Tensor: void output(String name) — Records this tensor as the graph output name. - Tensor: Tensor constLike(num value, {List? shape, DType? dtype}) — A constant of this tensor's dtype (or dtype) broadcast to shape. - Tensor: Tensor idiv(Object other) — Integer division truncating toward zero (C, GLSL). - Tensor: Tensor mod(Object other) — Integer remainder with the dividend's sign (C, GLSL). - Tensor: Tensor eq(Object other) - Tensor: Tensor ne(Object other) - Tensor: Tensor maximum(Object other) - Tensor: Tensor minimum(Object other) - Tensor: Tensor logicalNot() - Tensor: Tensor reciprocal() - Tensor: Tensor sqrt() - Tensor: Tensor exp2() - Tensor: Tensor log2() - Tensor: Tensor sin() - Tensor: Tensor trunc() - Tensor: Tensor cast(DType to) - Tensor: Tensor bitcast(DType to) - Tensor: Tensor where(Object a, Object b) — cond.where(a, b): a where this (bool) is true, else b. - Tensor: Tensor exp() - Tensor: Tensor log() - Tensor: Tensor cos() - Tensor: Tensor floor() - Tensor: Tensor abs() - Tensor: Tensor relu() - Tensor: Tensor clip(num lo, num hi) - Tensor: Tensor relu6() - Tensor: Tensor sigmoid() - Tensor: Tensor square() - Tensor: Tensor sum([List? axes, bool keepdim = false]) - Tensor: Tensor max([List? axes, bool keepdim = false]) - Tensor: Tensor mean([List? axes, bool keepdim = false]) - Tensor: Tensor softmax([int axis = -1]) - Tensor: Tensor reshape(List newShape) - Tensor: Tensor permute(List order) - Tensor: Tensor expand(List newShape) - Tensor: Tensor pad(List<(int, int)> pads) — Zero padding: pads is (before, after) per axis. - Tensor: Tensor shrink(List<(int, int)> ranges) — ranges is (start, end) per axis. - Tensor: Tensor flip(List axes) - Tensor: Tensor transpose([int a = -2, int b = -1]) - Tensor: Tensor flatten([int start = 0]) - Tensor: Tensor unsqueeze(int axis) - Tensor: Tensor slice(int axis, int start, int end) — Elements start, end) along [axis. - Tensor: Tensor matmul(Tensor other, {MatmulPrecision? precision}) — ... m, k @ ... k, n; batch dims must match (or other is 2D). precision is the operand format a library GEMM may use for this node in library mode (default: the build's libraryPrecision). - Tensor: Tensor scaledDotProductAttention(Tensor key, Tensor value, {double? scale, bool causal = false}) — softmax(scale * this @ key^T) @ value, recorded as one node (attention): this is ... - Tensor: Tensor conv2d(Tensor weight, {Tensor? bias, (int, int) stride = (1, 1), ((int, int), (int, int)) padding = ((0, 0), (0, 0)), (int, int) dilation = (1, 1), int groups = 1, MatmulPrecision? precision}) — NCHW input, OIHW weight (I = channels / groups). padding is ((top, bottom), (left, right)). - Tensor: String toString() - Tensor: Tensor operator +(Object other) - Tensor: Tensor operator -(Object other) - Tensor: Tensor operator *(Object other) - Tensor: Tensor operator /(Object other) — True division for floats (tinygrad's x * y.reciprocal), truncating division for ints. - Tensor: Tensor operator -() - Tensor: Tensor operator &(Object other) - Tensor: Tensor operator |(Object other) - Tensor: Tensor operator ^(Object other) - Tensor: Tensor operator <<(Object other) - Tensor: Tensor operator >>(Object other) - Tensor: Tensor operator <(Object other) - Tensor: Tensor operator >(Object other) - Tensor: Tensor operator <=(Object other) - Tensor: Tensor operator >=(Object other) - final class ProgramOptions — The options a ProgramCompiler builds a program with (buildTensorPrograms' tuning arguments). - ProgramOptions: const ProgramOptions({this.beam = 0, this.tuneDevice, this.family = 'generic', this.library = const {}, this.libraryPrecision = MatmulPrecision.f16, this.libraryMinFlops = 1 << 20, this.msl = true}) - ProgramOptions: final int beam - ProgramOptions: final String? tuneDevice - ProgramOptions: final String family - ProgramOptions: final Set library - ProgramOptions: final MatmulPrecision libraryPrecision - ProgramOptions: final int libraryMinFlops - ProgramOptions: final bool msl - abstract interface class ProgramCompiler — Turns a recorded graph into a program file (STP1): the Riptide compiler (package:riptide_compiler, in process; the default through its hook, tinygrad building the graphs it can't) or TinygradToolchain… - ProgramCompiler: String get name — tinygrad or riptide. - ProgramCompiler: String get commit — The compiler's version (and its sources' hash): part of every built program's cache key. - ProgramCompiler: String? get impellerc - ProgramCompiler: Future compileProgram(String name, TensorGraph graph, Directory outDir, File program, ProgramOptions options) — Writes the program for graph to program. - final class ProgramCompileException implements Exception — A ProgramCompiler could not build a graph. - ProgramCompileException: const ProgramCompileException(this.message) - ProgramCompileException: final String message - ProgramCompileException: String toString() - final class TinygradToolchain implements ProgramCompiler - TinygradToolchain: const TinygradToolchain({required this.python, required this.checkout, required this.commit, this.package, this.impellerc}) - TinygradToolchain: static TinygradToolchain? locate({required Directory from, Map? environment}) — Null when tinygrad isn't set up. - TinygradToolchain: String get name - TinygradToolchain: final String python — The venv's python. - TinygradToolchain: final String checkout - TinygradToolchain: final String commit — The tinygrad commit plus a hash of package's sources: the cache key for built programs. - TinygradToolchain: final String? package - TinygradToolchain: final String? impellerc - TinygradToolchain: Future compileProgram(String name, TensorGraph graph, Directory outDir, File program, ProgramOptions options) — Runs tinygrad on graph and writes the program to program. - final class TensorProgramBuild — What buildTensorPrograms did for one graph. - TensorProgramBuild: const TensorProgramBuild(this.name, this.status, this.reason, {this.program, this.shaderBundle}) - TensorProgramBuild: final String name - TensorProgramBuild: final String status — Skipped and failed graphs run on the CPU. - TensorProgramBuild: final String reason - TensorProgramBuild: final File? program - TensorProgramBuild: final File? shaderBundle - TensorProgramBuild: String toString() ## Exact and higher mathematics ### Arbitrary precision (riptide_precision) import 'package:riptide_precision/riptide_precision.ray'; Exact rationals, binary floating point of any precision with correctly rounded operations, interval and ball arithmetic, and elementary and special functions to any precision. https://riptidecompute.com/raya/docs/precision - double nextUp(double x) — The least double greater than x (nextUp(maxFinite) = ∞, nextUp(−∞) = −maxFinite, NaN stays NaN). - double nextDown(double x) — The greatest double less than x. - BigInt fastMultiply(BigInt a, BigInt b) — a · b, subquadratic for large operands (same result as a * b). - BigInt fastSquare(BigInt a) — a². - BigInt fastDivide(BigInt a, BigInt b) - (BigInt, BigInt) fastDivMod(BigInt a, BigInt b) - BigInt fastIsqrt(BigInt n) — Floor of the square root of a nonnegative BigInt (Newton from a recursive approximation for huge n). - (BigInt, int, bool) quotientBits(BigInt n, BigInt d, int bits) — n / d (d > 0, n ≠ 0) as q · 2^e with q holding at least bits significant bits, and whether the division left a remainder (the sticky flag for roundBits). - (BigInt, int) decomposeDouble(double x) — Splits a finite double into (m, e) with x == m · 2^e exactly (m odd or zero). - double doubleFromBits(BigInt m, int e, RoundingMode rnd, {bool sticky = false}) — The double for m · 2^e (plus a sticky tail), rounded once with IEEE binary64 rules. - int trailingZeros(BigInt m) — Number of trailing zero bits of a nonzero BigInt. - (BigInt, int, bool) roundBits(BigInt m, int e, int prec, RoundingMode rnd, {int? minExp, bool sticky = false}) — Rounds the exact value m · 2^e (plus a tail of the same sign as m when sticky is set: the true value lies strictly between m · 2^e and (m + sign m) · 2^e) to at most prec significant bits and, when minExp is given, to… - BigInt isqrt(BigInt n) — Floor of the square root of a nonnegative BigInt (Newton's method from a power-of-two start above the root). - final class Ball — The set mid − rad, mid + rad of real numbers. - Ball: factory Ball(BigFloat mid, [BigFloat? rad]) — mid ± rad (rad defaults to 0: an exact ball). - Ball: factory Ball.fromInt(Object n, {int prec = 53}) - Ball: factory Ball.fromDouble(double x, {int prec = 53}) — The exact value of a finite double (an exact ball when prec ≥ 53). - Ball: factory Ball.fromRational(Rational q, {int prec = 53}) — A ball containing q (exact when q is a dyadic rational with at most prec bits). - Ball: factory Ball.parse(String s, {int prec = 53}) — A ball containing the decimal s ("0.1", "1/3", "-2.5e-10"). - Ball: factory Ball.indeterminate({int prec = 53}) — The whole real line. - Ball: factory Ball.fromEndpoints(BigFloat lo, BigFloat hi, {int? prec}) — The smallest ball (at prec) containing lo, hi. - Ball: final BigFloat mid — The midpoint (finite). - Ball: final BigFloat rad — The radius: a nonnegative 30-bit upper bound, or +∞. - Ball: int get precision - Ball: bool get isExact - Ball: bool get isFinite - Ball: bool get isZero - Ball: bool get isPositive — True when every point of the ball is > 0 / < 0 / ≠ 0. - Ball: bool get isNegative - Ball: bool get isNonZero - Ball: bool get containsZero - Ball: BigFloat get magnitudeUpper — An upper bound of |x| over the ball. - Ball: BigFloat get magnitudeLower — A lower bound of |x| over the ball (0 when it contains zero). - Ball: int get relativeAccuracyBits — Relative accuracy in bits, like Arb's arb_rel_accuracy_bits (a large number for exact balls). - Ball: BigFloat lower({int? prec}) — A lower bound of every point (rounded down at prec, default the midpoint precision). - Ball: BigFloat upper({int? prec}) — An upper bound of every point (rounded up at prec). - Ball: bool contains(Rational q) — Whether the exact rational q lies in the ball. - Ball: bool containsBall(Ball o) — Whether every point of o lies in this ball. - Ball: bool overlaps(Ball o) — Whether the two balls share a point. - Ball: Ball add(Ball o, {int? prec}) - Ball: Ball sub(Ball o, {int? prec}) - Ball: Ball mul(Ball o, {int? prec}) - Ball: Ball div(Ball o, {int? prec}) - Ball: Ball sqrt({int? prec}) — Square root of the nonnegative part (the whole line when the ball is entirely negative or indeterminate). - Ball: Ball square({int? prec}) - Ball: Ball pow(int n, {int? prec}) — this^n for an integer n (n < 0 inverts) by binary powering. - Ball: Ball inverse({int? prec}) - Ball: Ball roundTo(int prec) — The same set with the midpoint rounded to prec bits (the radius grows by the rounding error). - Ball: Ball ldexp(int k) — this · 2^k, exact. - Ball: Ball addError(BigFloat err) — The ball with its radius grown by err (an upper bound, ≥ 0). - Ball: Ball abs() - Ball: Ball union(Ball o, {int? prec}) — The union hull of two balls. - Ball: String toString() — "3.14159265358979 +/- 3.2e-16". - Ball: Ball operator +(Ball o) - Ball: Ball operator -(Ball o) - Ball: Ball operator *(Ball o) - Ball: Ball operator /(Ball o) - Ball: Ball operator -() - final class BigFloat implements Comparable — A binary floating-point number man · 2^exp with a precision in bits, like an MPFR variable. - BigFloat: factory BigFloat.fromBits(BigInt m, int e, {int prec = 53, RoundingMode rnd = RoundingMode.nearestEven, bool sticky = false}) — Rounds the exact value m · 2^e (plus a sticky tail, see roundBits) to prec bits. - BigFloat: factory BigFloat.fromInt(Object n, {int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: factory BigFloat.fromDouble(double x, {int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — The exact value of x (rounded only when prec < 53 bits of x are needed). - BigFloat: factory BigFloat.fromRational(Rational q, {int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: factory BigFloat.parse(String s, {int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — Parses a decimal ("3.14159", "-1e-400", "2/3", "inf", "nan"), correctly rounded to prec bits. - BigFloat: factory BigFloat.zero({int prec = 53, bool negative = false}) - BigFloat: factory BigFloat.infinity({int prec = 53, bool negative = false}) - BigFloat: factory BigFloat.nan({int prec = 53}) - BigFloat: static BigFloat fma(BigFloat a, BigFloat b, BigFloat c, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) — a · b + c with a single rounding. - BigFloat: final BigInt man — Signed odd mantissa (zero for non-finite values and zeros). - BigFloat: final int exp — Binary exponent: the value is man · 2^exp. - BigFloat: final int precision — Precision in bits; the result precision of operators is the larger operand precision. - BigFloat: bool get isNaN - BigFloat: bool get isInfinite - BigFloat: bool get isFinite - BigFloat: bool get isZero - BigFloat: bool get isNegative — True for negative values, −0 and −∞ (false for NaN). - BigFloat: int get sign - BigFloat: int get bitCount — Bits in the mantissa. - BigFloat: int get magnitude — Exponent of the leading bit plus one (MPFR's mpfr_get_exp): 2^(magnitude-1) <= |x| < 2^magnitude. - BigFloat: BigFloat get ulp — One unit in the last place at this precision. - BigFloat: int get hashCode - BigFloat: BigFloat round(int prec, [RoundingMode rnd = RoundingMode.nearestEven]) — Rounds to prec bits (precision change, MPFR mpfr_prec_round). - BigFloat: BigFloat add(BigFloat o, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: BigFloat sub(BigFloat o, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: BigFloat mul(BigFloat o, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: BigFloat div(BigFloat o, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloat: BigFloat sqrt({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) — Correctly rounded square root; NaN for negative input, sqrt(−0) = −0. - BigFloat: BigFloat ldexp(int k) — this · 2^k, exact. - BigFloat: BigFloat abs() - BigFloat: BigFloat nextUp() — The next representable value toward +∞ at this precision. - BigFloat: BigFloat nextDown() — The next representable value toward −∞ at this precision. - BigFloat: Rational toRational() — The exact value (throws for ±∞ and NaN). - BigFloat: double toDouble([RoundingMode rnd = RoundingMode.nearestEven]) — Nearest double (correctly rounded in rnd, subnormals included). - BigFloat: BigInt toBigInt([RoundingMode rnd = RoundingMode.towardZero]) — Integer part rounded in rnd (floor = down, ceil = up, truncate = towardZero). - BigFloat: int compareTo(BigFloat o) - BigFloat: String toStringAsPrecision(int digits, [RoundingMode rnd = RoundingMode.nearestEven]) — digits significant decimal digits, correctly rounded in rnd: "3.1415926535897932385", "1.2345e-30". - BigFloat: (BigInt, int) decimalDigits(int digits, [RoundingMode rnd = RoundingMode.nearestEven]) — The decimal N · 10^(d − digits + 1) nearest this value with |N| having exactly digits digits; returns (N, d) where d is the decimal exponent of the leading digit. - BigFloat: String toString() — Enough digits to round-trip at this precision. - BigFloat: BigFloat operator +(BigFloat o) - BigFloat: BigFloat operator -(BigFloat o) - BigFloat: BigFloat operator *(BigFloat o) - BigFloat: BigFloat operator /(BigFloat o) - BigFloat: BigFloat operator -() - BigFloat: bool operator <(BigFloat o) - BigFloat: bool operator <=(BigFloat o) - BigFloat: bool operator >(BigFloat o) - BigFloat: bool operator >=(BigFloat o) - BigFloat: bool operator ==(Object other) — Value equality (precision is ignored; −0 == +0; NaN != NaN). - final class BigComplex — A complex number re + i·im with BigFloat parts. - BigComplex: const BigComplex(this.re, this.im) - BigComplex: factory BigComplex.real(BigFloat re) — A real number as a complex one. - BigComplex: factory BigComplex.fromInt(int re, [int im = 0, int prec = 53]) - BigComplex: factory BigComplex.fromDoubles(double re, [double im = 0, int prec = 53]) - BigComplex: factory BigComplex.parse(String s, {int prec = 53}) — Parses "1.5", "-2/3", or two parts "1.5, -2" (re, im), correctly rounded to prec bits. - BigComplex: factory BigComplex.i({int prec = 53}) — The imaginary unit at prec bits. - BigComplex: final BigFloat re - BigComplex: final BigFloat im - BigComplex: int get precision - BigComplex: bool get isReal - BigComplex: bool get isZero - BigComplex: bool get isFinite - BigComplex: bool get isNaN - BigComplex: int get log2Magnitude — About log2 |z| (an int; 0 for zero). - BigComplex: int get magnitudeBits - BigComplex: int get hashCode - BigComplex: BigComplex add(BigComplex o, {int? prec}) - BigComplex: BigComplex sub(BigComplex o, {int? prec}) - BigComplex: BigComplex mul(BigComplex o, {int? prec}) — Each part is correctly rounded (exact products, one rounding): re·o.re − im·o.im and re·o.im + im·o.re. - BigComplex: BigComplex div(BigComplex o, {int? prec}) - BigComplex: BigComplex scale(BigFloat s, {int? prec}) - BigComplex: BigComplex ldexp(int k) - BigComplex: BigComplex conj() - BigComplex: BigComplex square({int? prec}) - BigComplex: BigComplex inverse({int? prec}) - BigComplex: BigComplex roundTo(int prec) - BigComplex: BigFloat abs({int? prec}) - BigComplex: BigFloat norm({int? prec}) - BigComplex: BigFloat arg({int? prec}) — The principal argument in (−π, π], correctly rounded. - BigComplex: BigComplex exp({int? prec}) — E^z. - BigComplex: BigComplex log({int? prec}) — Principal logarithm: log|z| + i·arg z (log|z| without cancellation near |z| = 1). - BigComplex: BigComplex sqrt({int? prec}) — Principal square root (branch cut on the negative real axis, sqrt(−x) = i·sqrt(x)). - BigComplex: BigComplex pow(BigComplex w, {int? prec}) — z^w = exp(w·log z) (principal), with exact binary powering for integer w. - BigComplex: BigComplex powInt(int n, {int? prec}) — z^n by binary powering. - BigComplex: BigComplex sin({int? prec}) - BigComplex: BigComplex cos({int? prec}) - BigComplex: BigComplex tan({int? prec}) - BigComplex: BigComplex sinh({int? prec}) - BigComplex: BigComplex cosh({int? prec}) - BigComplex: BigComplex tanh({int? prec}) - BigComplex: BigComplex atan({int? prec}) — Principal atan: (i/2)·(log(1 − iz) − log(1 + iz)). - BigComplex: (double, double) toDoubles() — (re, im) as doubles (nearest). - BigComplex: String toString() - BigComplex: BigComplex operator +(BigComplex o) - BigComplex: BigComplex operator -(BigComplex o) - BigComplex: BigComplex operator *(BigComplex o) - BigComplex: BigComplex operator /(BigComplex o) - BigComplex: BigComplex operator -() - BigComplex: bool operator ==(Object other) — Same parts (precision ignored). - final class DoubleInterval — The closed interval lo, hi of doubles. - DoubleInterval: const DoubleInterval(this.lo, this.hi) - DoubleInterval: const DoubleInterval.point(double x) — The degenerate interval x, x. - DoubleInterval: static const DoubleInterval entire = DoubleInterval(double.negativeInfinity, double.infinity) - DoubleInterval: static const DoubleInterval empty = DoubleInterval(double.nan, double.nan) - DoubleInterval: final double lo - DoubleInterval: final double hi - DoubleInterval: bool get isEmpty - DoubleInterval: bool get containsZero - DoubleInterval: bool get isPositive - DoubleInterval: bool get isNegative - DoubleInterval: double get width — Width rounded up. - DoubleInterval: double get mid — Midpoint (finite intervals). - DoubleInterval: int get hashCode - DoubleInterval: bool contains(double x) - DoubleInterval: bool containsInterval(DoubleInterval o) - DoubleInterval: bool overlaps(DoubleInterval o) - DoubleInterval: DoubleInterval sqrt() — Square root of the nonnegative part. - DoubleInterval: DoubleInterval square() — x², never negative. - DoubleInterval: DoubleInterval abs() - DoubleInterval: DoubleInterval intersect(DoubleInterval o) - DoubleInterval: DoubleInterval hull(DoubleInterval o) - DoubleInterval: (DoubleInterval, DoubleInterval) bisect() - DoubleInterval: String toString() - DoubleInterval: DoubleInterval operator +(DoubleInterval o) - DoubleInterval: DoubleInterval operator -(DoubleInterval o) - DoubleInterval: DoubleInterval operator -() - DoubleInterval: DoubleInterval operator *(DoubleInterval o) - DoubleInterval: DoubleInterval operator /(DoubleInterval o) — A divisor containing 0 gives the entire line (empty for 0, 0). - DoubleInterval: bool operator ==(Object other) - abstract final class Constants — Mathematical constants to any precision, correctly rounded. - Constants: static BigFloat pi({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — Π. - Constants: static BigFloat e({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — E = exp(1). - Constants: static BigFloat ln2({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — Ln 2. - Constants: static BigFloat euler({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — Euler–Mascheroni constant γ. - Constants: static BigFloat catalan({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — Catalan's constant G. - Constants: static Ball piBallAt(int prec) — Balls containing the constants at about prec bits. - Constants: static Ball eBallAt(int prec) - Constants: static Ball ln2BallAt(int prec) - Constants: static Ball eulerBallAt(int prec) - Constants: static Ball catalanBallAt(int prec) - extension BigFloatElementary on BigFloat — Correctly rounded elementary functions (MPFR semantics): the exact result rounded once to prec bits (default the operand precision) in rnd. - BigFloatElementary: BigFloat exponential({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) — E^x (named exponential because BigFloat.exp is the binary exponent). - BigFloatElementary: BigFloat expm1({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat log({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat log1p({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat pow(BigFloat y, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) — this^y (IEEE 754 pow special values; exact when the result is representable). - BigFloatElementary: BigFloat sin({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat cos({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat tan({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat atan({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat atan2(BigFloat x, {int? prec, RoundingMode rnd = RoundingMode.nearestEven}) — atan2(this, x): the angle of the point (x, this), in (−π, π] (IEEE 754 special values). - BigFloatElementary: BigFloat asin({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat acos({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat sinh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat cosh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat tanh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat asinh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat acosh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - BigFloatElementary: BigFloat atanh({int? prec, RoundingMode rnd = RoundingMode.nearestEven}) - extension BallElementary on Ball — Elementary functions over balls (Arb semantics: a ball not inside the domain gives an indeterminate result). - BallElementary: Ball exp({int? prec}) - BallElementary: Ball expm1({int? prec}) - BallElementary: Ball log({int? prec}) - BallElementary: Ball log1p({int? prec}) - BallElementary: Ball atan({int? prec}) - BallElementary: Ball asin({int? prec}) - BallElementary: Ball acos({int? prec}) - BallElementary: Ball sinh({int? prec}) - BallElementary: Ball tanh({int? prec}) - BallElementary: Ball asinh({int? prec}) - BallElementary: Ball acosh({int? prec}) - BallElementary: Ball atanh({int? prec}) - BallElementary: Ball sin({int? prec}) - BallElementary: Ball cos({int? prec}) - BallElementary: Ball tan({int? prec}) - BallElementary: Ball cosh({int? prec}) - BallElementary: Ball power(Ball y, {int? prec}) — this^y for a positive base: exp(y · log this). - BallElementary: Ball atan2(Ball x, {int? prec}) — Atan2(this, x) (through the interval version: corners, or (−π, π] across the branch cut). - extension IntervalElementary on Interval — Elementary functions over intervals, restricted to the domain (log(−1, 4) = −∞, log 4). - IntervalElementary: Interval exp({int? prec}) - IntervalElementary: Interval expm1({int? prec}) - IntervalElementary: Interval log({int? prec}) - IntervalElementary: Interval log1p({int? prec}) - IntervalElementary: Interval atan({int? prec}) - IntervalElementary: Interval asin({int? prec}) - IntervalElementary: Interval acos({int? prec}) - IntervalElementary: Interval sinh({int? prec}) - IntervalElementary: Interval tanh({int? prec}) - IntervalElementary: Interval asinh({int? prec}) - IntervalElementary: Interval acosh({int? prec}) - IntervalElementary: Interval atanh({int? prec}) - IntervalElementary: Interval cosh({int? prec}) - IntervalElementary: Interval sin({int? prec}) — Sin over the interval: the endpoint values, plus ±1 wherever the interval may contain π/2 + 2kπ or −π/2 + 2kπ. - IntervalElementary: Interval cos({int? prec}) — Cos = the same with extrema at 2kπ (max) and π + 2kπ (min). - IntervalElementary: Interval tan({int? prec}) — Tan: monotone between poles; the entire line when the interval may contain a pole π/2 + kπ. - IntervalElementary: Interval power(Interval y, {int? prec}) — this^y for the positive part of the base: exp(y · log x). - IntervalElementary: Interval atan2(Interval x, {int? prec}) — Atan2(this, x): corners of the box when it avoids the origin and the branch cut, else −π, π. - extension DoubleIntervalElementary on DoubleInterval - DoubleIntervalElementary: DoubleInterval exp() - DoubleIntervalElementary: DoubleInterval expm1() - DoubleIntervalElementary: DoubleInterval log() - DoubleIntervalElementary: DoubleInterval log1p() - DoubleIntervalElementary: DoubleInterval sin() - DoubleIntervalElementary: DoubleInterval cos() - DoubleIntervalElementary: DoubleInterval tan() - DoubleIntervalElementary: DoubleInterval atan() - DoubleIntervalElementary: DoubleInterval asin() - DoubleIntervalElementary: DoubleInterval acos() - DoubleIntervalElementary: DoubleInterval sinh() - DoubleIntervalElementary: DoubleInterval cosh() - DoubleIntervalElementary: DoubleInterval tanh() - DoubleIntervalElementary: DoubleInterval asinh() - DoubleIntervalElementary: DoubleInterval acosh() - DoubleIntervalElementary: DoubleInterval atanh() - DoubleIntervalElementary: DoubleInterval power(DoubleInterval y) - DoubleIntervalElementary: DoubleInterval atan2(DoubleInterval x) - final class Interval — The closed set lo, hi of real numbers, lo ≤ hi, with lo ∈ −∞, ∞) and hi ∈ (−∞, ∞; or the empty set. - Interval: factory Interval(BigFloat lo, BigFloat hi) — lo, hi; throws when lo > hi, an endpoint is NaN, or lo = +∞ / hi = −∞. - Interval: factory Interval.point(BigFloat x) — The single point x. - Interval: factory Interval.fromInt(Object n, {int prec = 53}) - Interval: factory Interval.fromRational(Rational q, {int prec = 53}) — The tightest interval at prec bits containing q. - Interval: factory Interval.fromRationals(Rational a, Rational b, {int prec = 53}) — The tightest interval containing a, b (rationals, a ≤ b). - Interval: factory Interval.parse(String s, {int prec = 53}) — The tightest interval containing the decimal s ("0.1", "1/3"), or "a, b". - Interval: factory Interval.fromDouble(double x, {int prec = 53}) — The interval x − 2^-k, x + 2^-k-style enclosure of a double: exact. - Interval: factory Interval.fromBall(Ball b, {int? prec}) — mid − rad, mid + rad rounded outward. - Interval: factory Interval.entire({int prec = 53}) - Interval: factory Interval.empty({int prec = 53}) - Interval: final BigFloat lo — Lower endpoint (NaN for the empty set). - Interval: final BigFloat hi — Upper endpoint (NaN for the empty set). - Interval: bool get isEmpty - Interval: bool get isEntire - Interval: bool get isBounded - Interval: bool get isPoint - Interval: bool get containsZero - Interval: bool get isPositive — Every point > 0 / < 0. - Interval: bool get isNegative - Interval: int get precision - Interval: BigFloat get magnitude — Upper bound of |x| over the interval. - Interval: BigFloat get mignitude — Lower bound of |x| over the interval (0 when it contains zero). - Interval: int get hashCode - Interval: BigFloat mid({int? prec}) — The midpoint, rounded to nearest (0 for the entire line, ±max-ish for half-unbounded intervals). - Interval: BigFloat width({int prec = magPrec}) — hi − lo rounded up. - Interval: bool contains(Rational q) - Interval: bool containsBigFloat(BigFloat x) - Interval: bool containsInterval(Interval o) — Whether o is a subset of this interval. - Interval: bool interiorContains(Interval o) — Whether o lies in the interior of this interval. - Interval: bool overlaps(Interval o) - Interval: bool certainlyLess(Interval o) — Certainly less: every point of this interval is below every point of o. - Interval: bool certainlyLessOrEqual(Interval o) - Interval: bool possiblyLess(Interval o) - Interval: Interval intersect(Interval o) - Interval: Interval hull(Interval o) - Interval: (Interval, Interval) bisect({int? prec}) — Splits at the midpoint (for bisection-based root isolation and branch and bound). - Interval: Ball toBall({int? prec}) — A ball containing this interval. - Interval: Interval add(Interval o, {int? prec}) - Interval: Interval sub(Interval o, {int? prec}) - Interval: Interval mul(Interval o, {int? prec}) - Interval: Interval div(Interval o, {int? prec}) — Division; a divisor containing zero gives the entire line (or the empty set for 0, 0). - Interval: Interval inverse({int? prec}) - Interval: Interval sqrt({int? prec}) — Square root of the nonnegative part. - Interval: Interval square({int? prec}) — x² (tighter than x * x: the result is never negative). - Interval: Interval pow(int n, {int? prec}) — x^n for an integer n, respecting monotonicity (even powers of an interval containing 0 start at 0). - Interval: Interval abs() - Interval: Interval ldexp(int k) — this · 2^k, exact. - Interval: String toString() — "1.4142135623730949, 1.4142135623730952": the decimal endpoints are rounded outward too. - Interval: Interval operator +(Interval o) - Interval: Interval operator -(Interval o) - Interval: Interval operator *(Interval o) - Interval: Interval operator /(Interval o) - Interval: Interval operator -() - Interval: bool operator ==(Object other) — Same endpoints (precision ignored). - final class Rational implements Comparable — An exact rational numerator / denominator, always in lowest terms with a positive denominator. - Rational: factory Rational(BigInt n, [BigInt? d]) — n / d, reduced. - Rational: factory Rational.fromInt(int n, [int d = 1]) - Rational: factory Rational.fromDouble(double x) — The exact value of a finite double. - Rational: factory Rational.parse(String s) — Parses "-3/4", "17", "1.25", "6.02e23" exactly. - Rational: static final Rational zero - Rational: static final Rational one - Rational: final BigInt numerator - Rational: final BigInt denominator - Rational: bool get isZero - Rational: bool get isInteger - Rational: bool get isNegative - Rational: int get sign - Rational: Rational get reciprocal - Rational: int get hashCode - Rational: Rational abs() - Rational: Rational pow(int k) — this^k for any integer k (k < 0 inverts). - Rational: BigInt floor() — Largest integer ≤ this. - Rational: BigInt ceil() — Smallest integer ≥ this. - Rational: BigInt round() — Nearest integer, ties to even. - Rational: double toDouble([RoundingMode rnd = RoundingMode.nearestEven]) — The double nearest to this value (correctly rounded, subnormals included, ±∞ on overflow). - Rational: int compareTo(Rational o) - Rational: String toString() - Rational: String toLatex() — LaTeX: \frac{3}{4}, -\frac{1}{2}, 5. - Rational: Rational operator +(Rational o) - Rational: Rational operator -(Rational o) - Rational: Rational operator -() - Rational: Rational operator *(Rational o) - Rational: Rational operator /(Rational o) - Rational: bool operator <(Rational o) - Rational: bool operator <=(Rational o) - Rational: bool operator >(Rational o) - Rational: bool operator >=(Rational o) - Rational: bool operator ==(Object other) - enum RoundingMode — IEEE 754 / MPFR rounding modes. - RoundingMode: nearestEven — Round to nearest, ties to even (MPFR RNDN, IEEE default). - RoundingMode: towardZero — Toward zero (truncate; MPFR RNDZ). - RoundingMode: up — Toward +∞ (MPFR RNDU). - RoundingMode: down — Toward −∞ (MPFR RNDD). - RoundingMode: awayFromZero — Away from zero (MPFR RNDA). - abstract final class Special — Special functions to arbitrary precision for real and complex arguments, after mpmath (BSD; algorithms ported, marked in the sources). - Special: static BigComplex gamma(BigComplex z, {int prec = 53}) - Special: static BigComplex rgamma(BigComplex z, {int prec = 53}) - Special: static BigComplex loggamma(BigComplex z, {int prec = 53}) — Principal-branch log Γ (mpmath's loggamma). - Special: static BigComplex digamma(BigComplex z, {int prec = 53}) - Special: static BigComplex polygamma(int m, BigComplex z, {int prec = 53}) - Special: static BigComplex beta(BigComplex a, BigComplex b, {int prec = 53}) - Special: static Rational bernoulli(int n) — Bernoulli number B_n (exact). - Special: static BigComplex zeta(BigComplex s, {int prec = 53}) - Special: static BigComplex hurwitzZeta(BigComplex s, BigComplex a, {int prec = 53}) - Special: static BigComplex polylog(BigComplex s, BigComplex z, {int prec = 53}) - Special: static BigComplex erf(BigComplex z, {int prec = 53}) - Special: static BigComplex erfc(BigComplex z, {int prec = 53}) - Special: static BigComplex gammaincLower(BigComplex s, BigComplex z, {int prec = 53}) - Special: static BigComplex gammaincUpper(BigComplex s, BigComplex z, {int prec = 53}) - Special: static BigComplex hyp0f1(BigComplex b, BigComplex z, {int prec = 53}) - Special: static BigComplex hyp1f1(BigComplex a, BigComplex b, BigComplex z, {int prec = 53}) - Special: static BigComplex hyp2f1(BigComplex a, BigComplex b, BigComplex c, BigComplex z, {int prec = 53}) - Special: static BigComplex hyper(List a, List b, BigComplex z, {int prec = 53}) - Special: static BigComplex besselJ(BigComplex nu, BigComplex z, {int prec = 53}) - Special: static BigComplex besselY(BigComplex nu, BigComplex z, {int prec = 53}) - Special: static BigComplex besselI(BigComplex nu, BigComplex z, {int prec = 53}) - Special: static BigComplex besselK(BigComplex nu, BigComplex z, {int prec = 53}) - Special: static BigComplex airyAi(BigComplex z, {int prec = 53}) - Special: static BigComplex airyBi(BigComplex z, {int prec = 53}) - Special: static BigComplex legendreP(BigComplex nu, BigComplex z, {int prec = 53}) - Special: static BigComplex legendrePAssoc(BigComplex nu, BigComplex mu, BigComplex z, {int prec = 53}) — Ferrers associated Legendre function (mpmath legenp(ν, μ, x, type=2)). - Special: static BigComplex sphericalHarmonic(int l, int m, BigFloat theta, BigFloat phi, {int prec = 53}) - Special: static BigComplex agm(BigComplex a, BigComplex b, {int prec = 53}) - Special: static BigComplex ellipK(BigComplex m, {int prec = 53}) - Special: static BigComplex ellipE(BigComplex m, {int prec = 53}) - Special: static BigComplex ellipPi(BigComplex n, BigComplex m, {int prec = 53}) - Special: static BigComplex ellipF(BigComplex phi, BigComplex m, {int prec = 53}) - Special: static BigComplex ellipEIncomplete(BigComplex phi, BigComplex m, {int prec = 53}) - Special: static BigComplex ellipPiIncomplete(BigComplex n, BigComplex phi, BigComplex m, {int prec = 53}) - Special: static BigComplex carlsonRF(BigComplex x, BigComplex y, BigComplex z, {int prec = 53}) - Special: static BigComplex carlsonRC(BigComplex x, BigComplex y, {int prec = 53}) - Special: static BigComplex carlsonRD(BigComplex x, BigComplex y, BigComplex z, {int prec = 53}) - Special: static BigComplex carlsonRJ(BigComplex x, BigComplex y, BigComplex z, BigComplex p, {int prec = 53}) - Special: static BigComplex jtheta(int n, BigComplex z, BigComplex q, {int prec = 53}) — Jacobi theta θ_n(z, q), nome q (|q| < 1). - Special: static BigComplex ellipNome(BigComplex m, {int prec = 53}) - Special: static (BigComplex, BigComplex, BigComplex) ellipfun(BigComplex u, BigComplex m, {int prec = 53}) — Jacobi elliptic functions (sn, cn, dn)(u | m). - Special: static BigComplex lambertW(BigComplex z, {int k = 0, int prec = 53}) — Lambert W on branch k. - extension BigFloatSpecial on BigFloat — Real special functions on BigFloat (NaN where the value isn't real). - BigFloatSpecial: BigFloat gamma({int? prec}) - BigFloatSpecial: BigFloat lgamma({int? prec}) — Log |Γ(x)|. - BigFloatSpecial: BigFloat digamma({int? prec}) - BigFloatSpecial: BigFloat erf({int? prec}) - BigFloatSpecial: BigFloat erfc({int? prec}) - BigFloatSpecial: BigFloat zeta({int? prec}) - BigFloatSpecial: BigFloat lambertW({int k = 0, int? prec}) - class NoConvergence implements Exception — Thrown where an expansion doesn't converge (outside the implemented region). - NoConvergence: NoConvergence(this.message) - NoConvergence: final String message - NoConvergence: String toString() ### Computer algebra (riptide_cas) import 'package:riptide_cas/riptide_cas.ray'; Symbolic expressions, simplification, expansion and factorisation, differentiation, integration, series, multivariate polynomials, Gröbner bases, solving and LaTeX output. https://riptidecompute.com/raya/docs/cas - bool isNumber(Expr e) - Expr numAdd(Expr a, Expr b) - Expr numMul(Expr a, Expr b) - List symbols(String names, {bool positive = false, bool real = false, bool integer = false}) — Symbols from a space- or comma-separated list: symbols('x y z'). - Expr exp(Object x) - Expr log(Object x, [Object? base]) — Natural logarithm, or log(x)/log(base) when base is given. - Expr sqrt(Object x) - Expr root(Object x, int n) — The principal n-th root. - Expr sin(Object x) - Expr cos(Object x) - Expr tan(Object x) - Expr cot(Object x) - Expr sec(Object x) - Expr csc(Object x) - Expr asin(Object x) - Expr acos(Object x) - Expr atan(Object x) - Expr sinh(Object x) - Expr cosh(Object x) - Expr tanh(Object x) - Expr asinh(Object x) - Expr acosh(Object x) - Expr atanh(Object x) - Expr absE(Object x) - Expr signE(Object x) - Expr re(Object x) - Expr im(Object x) - Expr conjugate(Object x) - Expr gamma(Object x) - Expr erf(Object x) - Expr erfc(Object x) - Expr factorial(Object n) - Expr binomial(Object n, Object k) - Expr legendre(Object n, Object x) - Expr assocLegendre(Object n, Object m, Object x) - Expr laguerre(Object n, Object x) - Expr assocLaguerre(Object n, Object a, Object x) - Expr hermite(Object n, Object x) - Expr ynm(Object n, Object m, Object theta, Object phi) — The spherical harmonic Y_n^m(θ, φ) (Condon–Shortley phase, SymPy's convention); explicit for integer n, m. - FunctionDef function(String name) — An uninterpreted function: final f = function('f'); f(x). - BigInt integerRoot(BigInt n, int k) — Floor of the k-th root of n >= 0 (Newton's method on BigInt). - (BigInt, int) perfectPower(BigInt n) — (b, k) with n == b^k and k maximal (k = 1 when n is not a perfect power). - Map factorInteger(BigInt n, {int limit = 1 << 16}) — Prime factorisation of n >= 1 by trial division up to limit; a remaining cofactor is reported as a perfect power of an unfactored base (which may be composite). - BigInt factorialBig(int n) - BigInt binomialBig(int n, int k) - int compareExpr(Expr a, Expr b) — The canonical total order on expressions used to sort Add and Mul arguments. - List printOrder(List terms) — Sorts the terms of a sum for display: lexicographic in the generators (symbols by name first), higher powers first, constants last, matching SymPy's default order='lex' printing for polynomial-like sums. - List polyGens(Iterable es) — The generators of e (after expansion): symbols sorted by name, then other non-numeric atoms (sin(x)). - MPoly polyFromExpr(Expr e, List gens, {MonoOrder order = MonoOrder.lex}) — e as a polynomial over QQ in gens. - (BigInt, MPoly) clearDenominators(MPoly f) — Clears denominators: returns (d, F) with F = d·f over ZZ, d > 0 the lcm of the denominators. - MPoly toQQ(MPoly f, PolyRing ring) - Expr gcd(Expr a, Expr b) — Greatest common divisor. - Expr lcm(Expr a, Expr b) — Least common multiple (same normalisation as gcd). - (Expr, Expr) div(Expr a, Expr b, Sym x) — Division with remainder in x over QQ (other symbols as further lex generators): a = q·b + r. - Expr resultant(Expr a, Expr b, Sym x) — The resultant of a and b with respect to x. - Expr discriminant(Expr a, Sym x) — The discriminant of a with respect to x. - (Rational, List<(Expr, int)>) sqfList(Expr a, {List? gens}) — Square-free decomposition a = c · Π g_k^k over QQ. - Expr sqf(Expr a, {List? gens}) — The square-free form as a product. - (Rational, List<(Expr, int)>) factorList(Expr a, {List? gens}) — Factorisation over QQ into irreducibles over ZZ: a = c · Π h^k (h primitive with positive leading coefficient). - Expr factor(Expr a, {List? gens}) — Factors a polynomial, or numerator and denominator of a rational function, over the rationals. - List groebner(List polys, List gens, {MonoOrder order = MonoOrder.lex, GroebnerMethod method = GroebnerMethod.buchberger, int? modulus}) — The reduced Gröbner basis of polys in gens under order, as SymPy prints it: over QQ each element is the primitive integer multiple with positive leading coefficient; with modulus p the coefficients lie in GF(p)… - bool inIdeal(Expr f, List polys, List gens, {MonoOrder order = MonoOrder.grevlex}) — Whether f lies in the ideal generated by polys (via a Gröbner basis in gens). - List eliminate(List polys, List vars, List otherGens) — Eliminates vars from the ideal: the lex Gröbner basis elements free of them (gens order: vars first). - (List, Expr) reduced(Expr f, List polys, List gens, {MonoOrder order = MonoOrder.lex}) — Normal form of f modulo polys by multivariate division (quotients and remainder), over QQ. - List> groebnerBasis(List> fs, {GroebnerMethod method = GroebnerMethod.buchberger}) — The reduced Gröbner basis of the ideal generated by fs (coefficients in a field). - bool isZeroDimensional(List> g) — Whether the ideal with Gröbner basis g has finitely many solutions (every variable has a pure-power LM). - List> fglm(List> g, PolyRing target) — FGLM (Faugère, Gianni, Lazard, Mora): converts the reduced Gröbner basis g of a zero-dimensional ideal to the reduced basis in the order of target, by linear algebra on normal forms. - bool idealContains(List> g, MPoly f) — Whether f lies in the ideal with Gröbner basis g. - Expr together(Expr e) — Combines a sum of fractions over a common denominator (no expansion, no cancellation): 1/x + 1/y -> (x + y)/(x*y). - Expr cancel(Expr e) — Puts a rational function into canonical p/q form: expanded numerator and denominator with no common factor, integer coefficients in the denominator with positive leading coefficient, rational content in front. - Expr collect(Expr e, Expr x) — Collects the terms of the expanded expression by powers of x: a*x + b*x + c -> x*(a + b) + c. - Expr apart(Expr e, Sym x) — Partial fraction decomposition of a rational function in x over the rationals. - int countOps(Expr e) — A complexity measure: the number of nodes, with powers and functions weighted like SymPy's count_ops. - Expr trigsimp(Expr e) — Trigonometric and hyperbolic simplification: applies sin² + cos² = 1 (and cosh² − sinh² = 1) by substituting for the squares in both directions and keeping the shortest result; also rewrites tan/cot/sec/csc via sin and… - Expr powsimp(Expr e) — Combines powers: same base (automatic) and same exponent for non-negative bases (sqrt(2)*sqrt(x) -> sqrt(2*x) when x >= 0), and exp products (automatic). - Expr radsimp(Expr e) — Rationalises denominators with square roots: 1/(a + b*sqrt(c)) -> (a - b*sqrt(c))/(a^2 - b^2*c). - Expr simplify(Expr e) — SymPy-style heuristic simplification: tries cancel, factor-free rational normal forms, trigsimp, powsimp, radsimp and expansion, and returns the candidate with the fewest operations. - Expr integrate(Expr f, Sym x, [Object? a, Object? b]) — ∫ f dx, or ∫_a^b f dx when a and b are given. - Expr ratint(Expr n, Expr d, Sym x) — ∫ n/d dx for polynomials over QQ in x. - Expr? rischNorman(Expr f, Sym x) — A heuristic Risch–Norman ansatz (in the spirit of SymPy's heurisch): the integrand's transcendental monomials (exp, log, tan, sin, cos, sqrt-free) become symbols, the candidate is a polynomial of bounded total degree… - Expr limit(Expr e, Sym x, Object x0, {String dir = '+'}) — The limit of e as x -> x0; dir is '+' (from above, default), '-' or '+-' (both sides must agree). - PSeries seriesAt0(Expr e, Sym x, int n) — Expands e at x = 0 to absolute order n (terms below x^n are exact). - Expr series(Expr e, Sym x, {Expr? x0, int n = 6, bool withOrder = true}) — Series expansion of e in x about x0 (default 0) up to but excluding (x - x0)^n, with an O term. x0 = oo expands in 1/x. - Map seriesCoefficients(Expr e, Sym x, int n) — The coefficients of the expansion at 0 (exponent -> coefficient) up to order n. - List? solveRational(List> a, List b) — Solves A x = b over QQ by Bareiss' fraction-free elimination on the integer-scaled augmented matrix. - BigInt bareissDet(List> a) — Determinant of an integer matrix by Bareiss' algorithm. - (List, Expr)? linearCoefficients(Expr e, List vars) — Splits a linear expression in vars into coefficients and the constant term (null if not linear). - Map? linsolve(List eqs, List vars) — Solves a linear system of equations (expressions equal to zero) for vars by Gauss–Jordan elimination with cancel-normalised pivots (coefficients may contain parameters). - List solve(Expr eq, Sym x) — The distinct solutions of eq = 0 for x (SymPy's solve for a single equation). - List rootsOfIrreducible(Expr q, Sym x) — The roots of an irreducible polynomial over QQ: radicals up to degree 4 (degree 3 and 4 by Cardano and Ferrari), CRootOf otherwise. - List> solveSystem(List eqs, List vars) — Solves a system of equations (expressions = 0) for vars: linear systems by Gauss–Jordan, polynomial systems by a lex Gröbner basis and back substitution. - final Expr pi - final Expr I - final Expr oo - final Expr zoo - final Expr nan - final Expr eulerGamma - final Expr E — Euler's number, represented as exp(1). - const IntegerRing zz = IntegerRing() - const RationalField qq = RationalField() - final FunctionDef crootof — CRootOf(p, k): the k-th root of the irreducible polynomial p (SymPy's order: real roots ascending, then complex roots by real part); numeric with evalf. - abstract base class Expr implements Comparable — A symbolic expression. - Expr: static Expr from(Object o) — Converts int, BigInt, Rational, double (exact), String (parsed) or Expr to an expression. - Expr: static Expr parse(String s, {Map? locals}) — Parses "x^2 + sin(y)/3" (also **, implicit 2x, pi, E, I, oo, any function name). - Expr: final int hashCode - Expr: List get args — The child expressions (empty for atoms). - Expr: bool get isAtom - Expr: Set get freeSymbols — The symbols occurring in this expression (bound variables of Derivative included). - Expr: Iterable get preorder — All subtrees, pre-order. - Expr: bool? get isPositive - Expr: bool? get isNegative - Expr: bool? get isZero - Expr: bool? get isReal - Expr: bool? get isInteger - Expr: bool? get isNonNegative - Expr: bool? get isNonPositive - Expr: bool get isRationalNumber — A rational number with no symbols. - Expr: bool get isConstant — No free symbols (numbers, constants, functions of those). - Expr: Expr rebuild(List args) — Rebuilds this node from new args, re-running the automatic simplification. - Expr: Expr pow(Object e) — this ^ e. - Expr: bool has(Expr sub) — Whether sub occurs as a subtree. - Expr: bool hasWhere(bool Function(Expr) test) — Whether any subtree satisfies test. - Expr: bool isFreeOf(Iterable syms) — Whether this expression is free of every symbol in syms. - Expr: Expr subs(Map map) — Simultaneous structural substitution: every subtree equal to a key is replaced by its value. - Expr: Expr transform(Expr Function(Expr) f) — Rebuilds bottom-up applying f to every node (after its children). - Expr: (Expr, Expr) asCoeffMul() — (c, rest) with this == c * rest and c the numeric coefficient (a Num or Flt). - Expr: (Expr, Expr) asCoeffAdd() — (c, rest) with this == c + rest and c the numeric constant term. - Expr: (Expr, Expr) asBaseExp() — (base, exponent). - Expr: (Expr, Expr) asNumerDenom() — The expression as a numerator and denominator (x/y -> (x, y)), without expanding. - Expr: bool couldExtractMinusSign() — SymPy's could_extract_minus_sign: true when -this is "nicer" (negative coefficient, mostly negative sum). - Expr: Expr diff(Sym x, [int n = 1]) — The n-th derivative with respect to x. - Expr: Expr expand() — Distributes products over sums and expands integer powers of sums (multinomial). - Expr: Expr evalf([int digits = 15]) — Numeric value to digits significant decimal digits (symbols are left in place). - Expr: BigFloat toBigFloat({int prec = 53}) — Numeric value as a real BigFloat with prec bits (throws if not real-numeric). - Expr: double toDouble() — Numeric value as a double (throws if not real-numeric). - Expr: String toString() — SymPy-style plain text (x**2 + sin(y)/3). - Expr: String toLatex() — LaTeX in SymPy's latex style (x^{2} + \frac{\sin{\left(y \right)}}{3}). - Expr: String srepr() — Tree form for debugging (Add(Pow(Symbol('x'), Integer(2)), …)). - Expr: int compareTo(Expr other) - Expr: Expr operator +(Object o) - Expr: Expr operator -(Object o) - Expr: Expr operator *(Object o) - Expr: Expr operator /(Object o) - Expr: Expr operator -() - Expr: bool operator ==(Object other) - final class Add extends Expr — A sum. - Add: static Expr of(Iterable input) - Add: final List args - Add: bool? get isPositive - Add: bool? get isNegative - Add: bool? get isZero - Add: bool? get isReal - Add: bool? get isInteger - Add: Expr rebuild(List args) - Add: (Expr, Expr) asCoeffAdd() - Add: bool couldExtractMinusSign() - final class Mul extends Expr — A product. - Mul: static Expr factored(Iterable input) — Like of but keeps c * (a + b) as a product instead of distributing (used for factored output). - Mul: static Expr of(Iterable input, {bool distribute = true}) - Mul: final List args - Mul: bool? get isPositive - Mul: bool? get isNegative - Mul: bool? get isNonNegative - Mul: bool? get isZero - Mul: bool? get isReal - Mul: bool? get isInteger - Mul: Expr rebuild(List args) - Mul: (Expr, Expr) asCoeffMul() - Mul: (Expr, Expr) asNumerDenom() - Mul: bool couldExtractMinusSign() - final class Pow extends Expr — A power base ^ exp. - Pow: static Expr of(Expr b, Expr e) - Pow: final Expr base - Pow: final Expr exp - Pow: List get args - Pow: bool? get isPositive - Pow: bool? get isNegative - Pow: bool? get isNonNegative - Pow: bool? get isZero - Pow: bool? get isReal - Pow: bool? get isInteger - Pow: Expr rebuild(List args) - Pow: (Expr, Expr) asBaseExp() - final class Num extends Expr — An exact rational number (SymPy's Integer / Rational). - Num: Num(this.value) - Num: factory Num.int_(int i) - Num: factory Num.frac(int p, int q) — p / q. - Num: static final Num zero - Num: static final Num one - Num: static final Num two - Num: static final Num negOne - Num: static final Num half - Num: final Rational value - Num: bool get isInt - Num: BigInt get numer - Num: BigInt get denom - Num: int get intValue — The value as an int (throws when not a machine integer). - Num: bool? get isPositive - Num: bool? get isNegative - Num: bool? get isZero - Num: bool? get isReal - Num: bool? get isInteger - Num: bool get isRationalNumber - Num: bool couldExtractMinusSign() - Num: (Expr, Expr) asCoeffMul() - Num: (Expr, Expr) asCoeffAdd() - Num: (Expr, Expr) asNumerDenom() - final class Flt extends Expr — An arbitrary-precision binary floating-point number (SymPy's Float). - Flt: Flt(this.value) - Flt: final BigFloat value - Flt: bool? get isPositive - Flt: bool? get isNegative - Flt: bool? get isZero - Flt: bool? get isReal - Flt: bool couldExtractMinusSign() - Flt: (Expr, Expr) asCoeffMul() - Flt: (Expr, Expr) asCoeffAdd() - final class Sym extends Expr — A symbol with optional assumptions. - Sym: Sym(this.name, {bool positive = false, bool real = false, bool integer = false, bool nonnegative = false}) - Sym: final String name - Sym: bool? get isPositive - Sym: bool? get isNegative - Sym: bool? get isZero - Sym: bool? get isReal - Sym: bool? get isInteger - Sym: bool? get isNonNegative - enum ConstKind - ConstKind: pi - ConstKind: i - ConstKind: oo - ConstKind: zoo - ConstKind: nan - ConstKind: eulerGamma - final class Const extends Expr — The named constants π, i, ∞, complex infinity, NaN and Euler's γ. - Const: static final Const pi - Const: static final Const i - Const: static final Const oo - Const: static final Const zoo - Const: static final Const nan - Const: static final Const eulerGamma - Const: final ConstKind kind - Const: bool? get isPositive - Const: bool? get isNegative - Const: bool? get isZero - Const: bool? get isReal - Const: bool? get isInteger - final class Derivative extends Expr — An unevaluated derivative of expr with respect to vars (a multiset, sorted), used for undefined functions. - Derivative: factory Derivative.of(Expr expr, List vars) — d^n expr / d vars, evaluating when possible. - Derivative: final Expr expr - Derivative: final List vars - Derivative: List get args - Derivative: Expr rebuild(List args) - final class FunctionDef — A function symbol: its name, arity, automatic simplification (eval) and partial derivatives (partials). - FunctionDef: factory FunctionDef.undefined(String name) — An uninterpreted function name(args…) (f(x)), cached by name. - FunctionDef: factory FunctionDef.custom(String name, {int? nargs, Expr? Function(List args)? eval, List Function(List args)? partials, double Function(List args)? numeric}) — A user function with optional simplification, derivative rules and a double-precision numeric value. - FunctionDef: final String name - FunctionDef: final int? nargs — Number of arguments, or null for any. - FunctionDef: final Expr? Function(List args)? eval — Automatic simplification: returns the simplified value or null to keep name(args). - FunctionDef: final List Function(List args)? partials — Partial derivatives with respect to each argument (null entries are not differentiable symbolically). - FunctionDef: final double Function(List args)? numeric — A double-precision value for custom functions (built-ins evaluate at any precision in evalf). - FunctionDef: final bool isUndefined - FunctionDef: Expr call(List args) — Applies the function: f.call(x). - FunctionDef: String toString() - final class Fn extends Expr — A function application f(args…). - Fn: static Expr of(FunctionDef def, List args) - Fn: final FunctionDef def - Fn: final List args - Fn: String get name - Fn: bool? get isReal - Fn: bool? get isPositive - Fn: bool? get isNegative - Fn: bool? get isNonNegative - Fn: bool? get isZero - Fn: bool? get isInteger - Fn: Expr rebuild(List args) - abstract final class Functions — The built-in functions. - Functions: static final FunctionDef exp - Functions: static final FunctionDef log - Functions: static final FunctionDef sin - Functions: static final FunctionDef cos - Functions: static final FunctionDef tan - Functions: static final FunctionDef cot - Functions: static final FunctionDef sec - Functions: static final FunctionDef csc - Functions: static final FunctionDef asin - Functions: static final FunctionDef acos - Functions: static final FunctionDef atan - Functions: static final FunctionDef acot - Functions: static final FunctionDef sinh - Functions: static final FunctionDef cosh - Functions: static final FunctionDef tanh - Functions: static final FunctionDef coth - Functions: static final FunctionDef asinh - Functions: static final FunctionDef acosh - Functions: static final FunctionDef atanh - Functions: static final FunctionDef abs - Functions: static final FunctionDef sign - Functions: static final FunctionDef re - Functions: static final FunctionDef im - Functions: static final FunctionDef conjugate - Functions: static final FunctionDef gamma - Functions: static final FunctionDef polygamma - Functions: static final FunctionDef erf - Functions: static final FunctionDef erfc - Functions: static final FunctionDef factorial - Functions: static final FunctionDef binomial - Functions: static final FunctionDef legendre - Functions: static final FunctionDef assocLegendre - Functions: static final FunctionDef laguerre - Functions: static final FunctionDef assocLaguerre - Functions: static final FunctionDef hermite - Functions: static final FunctionDef ynm - Functions: static final FunctionDef zeta — The Riemann zeta function (exact at even positive and all non-positive integers). - Functions: static final FunctionDef integral — An unevaluated integral Integral(f, x) (or Integral(f, x, a, b)); d/dx Integral(f, x) = f. - Functions: static final FunctionDef order — The order term O(x**n) of a truncated series. - Functions: static final Map byName — Every built-in by name (the parser and printers use this). - final class PolynomialError implements Exception — The expression is not a polynomial in the requested generators. - PolynomialError: PolynomialError(this.message) - PolynomialError: final String message - PolynomialError: String toString() - abstract class Domain — A commutative coefficient ring (an integral domain; a field when isField). - Domain: const Domain() - Domain: T get zero - Domain: T get one - Domain: bool get isField - Domain: int get characteristic — Characteristic (0 for ZZ and QQ). - Domain: T add(T a, T b) - Domain: T sub(T a, T b) - Domain: T mul(T a, T b) - Domain: T neg(T a) - Domain: bool isZero(T a) - Domain: bool isOne(T a) - Domain: T fromInt(int n) - Domain: T? exquo(T a, T b) — A / b when b divides a exactly, else null. - Domain: T inv(T a) — The inverse (fields only). - Domain: T div(T a, T b) - Domain: T gcd(T a, T b) — Gcd of two elements (1 in a field unless both are zero). - Domain: bool isNegative(T a) — Whether a is "negative" (for normalising signs; false in GF(p)). - Domain: Expr toExpr(T a) - Domain: T? fromRational(Rational r) — Converts an exact number, or null. - Domain: String name() - Domain: String toString() - final class IntegerRing extends Domain - IntegerRing: const IntegerRing() - IntegerRing: BigInt get zero - IntegerRing: BigInt get one - IntegerRing: bool get isField - IntegerRing: BigInt add(BigInt a, BigInt b) - IntegerRing: BigInt sub(BigInt a, BigInt b) - IntegerRing: BigInt mul(BigInt a, BigInt b) - IntegerRing: BigInt neg(BigInt a) - IntegerRing: bool isZero(BigInt a) - IntegerRing: BigInt fromInt(int n) - IntegerRing: BigInt? exquo(BigInt a, BigInt b) - IntegerRing: BigInt inv(BigInt a) - IntegerRing: BigInt gcd(BigInt a, BigInt b) - IntegerRing: bool isNegative(BigInt a) - IntegerRing: Expr toExpr(BigInt a) - IntegerRing: BigInt? fromRational(Rational r) - IntegerRing: String name() - final class RationalField extends Domain - RationalField: const RationalField() - RationalField: Rational get zero - RationalField: Rational get one - RationalField: bool get isField - RationalField: Rational add(Rational a, Rational b) - RationalField: Rational sub(Rational a, Rational b) - RationalField: Rational mul(Rational a, Rational b) - RationalField: Rational neg(Rational a) - RationalField: bool isZero(Rational a) - RationalField: Rational fromInt(int n) - RationalField: Rational? exquo(Rational a, Rational b) - RationalField: Rational inv(Rational a) - RationalField: Rational div(Rational a, Rational b) - RationalField: Rational gcd(Rational a, Rational b) - RationalField: bool isNegative(Rational a) - RationalField: Expr toExpr(Rational a) - RationalField: Rational? fromRational(Rational r) - RationalField: String name() - final class PrimeField extends Domain — The prime field GF(p) on machine ints (p < 2^26 keeps products exact on every platform). - PrimeField: const PrimeField(this.p) - PrimeField: final int p - PrimeField: int get zero - PrimeField: int get one - PrimeField: bool get isField - PrimeField: int get characteristic - PrimeField: int get hashCode - PrimeField: int add(int a, int b) - PrimeField: int sub(int a, int b) - PrimeField: int mul(int a, int b) - PrimeField: int neg(int a) - PrimeField: bool isZero(int a) - PrimeField: int fromInt(int n) - PrimeField: int? exquo(int a, int b) - PrimeField: int inv(int a) - PrimeField: int gcd(int a, int b) - PrimeField: Expr toExpr(int a) - PrimeField: int? fromRational(Rational r) - PrimeField: String name() - PrimeField: bool operator ==(Object other) - enum GroebnerMethod - GroebnerMethod: buchberger - GroebnerMethod: f4 - final class Mono — An exponent vector, immutable, with cached hash and total degree. - Mono: Mono(List e) - Mono: factory Mono.zero(int n) - Mono: final List e - Mono: final int deg - Mono: final int hashCode - Mono: int get length - Mono: bool get isOne - Mono: bool divides(Mono o) - Mono: Mono lcm(Mono o) - Mono: Mono gcd(Mono o) - Mono: String toString() - Mono: int operator [](int i) - Mono: Mono operator *(Mono o) - Mono: Mono operator /(Mono o) — This / o (assumes o divides this). - Mono: bool operator ==(Object other) - enum MonoOrder — Monomial orders. compare(a, b) > 0 when a is greater. - MonoOrder: lex - MonoOrder: grlex - MonoOrder: grevlex - MonoOrder: int compare(Mono a, Mono b) - final class PolyRing — A polynomial ring domaingens with a monomial order. - PolyRing: PolyRing(this.domain, List gens, {this.order = MonoOrder.lex}) - PolyRing: final Domain domain - PolyRing: final List gens - PolyRing: final MonoOrder order - PolyRing: int get n - PolyRing: late final Mono one_ - PolyRing: late final MPoly zero - PolyRing: late final MPoly one - PolyRing: MPoly constant(T c) - PolyRing: MPoly fromInt(int c) - PolyRing: MPoly gen(int i) — The i-th generator. - PolyRing: MPoly term(Mono m, T c) - PolyRing: MPoly fromMap(Map terms) — From a monomial -> coefficient map (zeros dropped). - PolyRing: PolyRing withOrder(MonoOrder o) - PolyRing: PolyRing withDomain(Domain d) - PolyRing: String toString() - final class MPoly — A polynomial: terms sorted by decreasing monomial (in the ring's order), no zero coefficients. - MPoly: final PolyRing ring - MPoly: final List monos - MPoly: final List coeffs - MPoly: bool get isZero - MPoly: bool get isConstant - MPoly: bool get isOne - MPoly: int get length - MPoly: Mono get lm - MPoly: T get lc - MPoly: MPoly get lt - MPoly: T get constantTerm — The constant coefficient (zero if none). - MPoly: int get totalDegree - MPoly: Set get variables — Indices of the generators that occur. - MPoly: int get hashCode - MPoly: Map toMap() - MPoly: int degree(int i) - MPoly: MPoly mulTerm(Mono m, T c) — This * c * m. - MPoly: MPoly scale(T c) - MPoly: MPoly pow(int k) - MPoly: MPoly exquoScalar(T c) — Divides every coefficient by c exactly (throws if not exact). - MPoly: MPoly monic() — Monic (fields only). - MPoly: T content() — Gcd of the coefficients (for ZZ; 1 over a field). - MPoly: MPoly primitive() — This divided by its content (positive leading coefficient over ZZ, monic over a field). - MPoly: MPoly? exquo(MPoly g) — Exact quotient this / g, or null when g does not divide this. - MPoly: MPoly rem(List> gs) — Full reduction (normal form) modulo gs by the multivariate division algorithm (fields). - MPoly: (List>, MPoly) divmod(List> gs, {bool wantQuotients = true}) — Multivariate division: this == sum q_i g_i + r with no term of r divisible by any LM(g_i). - MPoly: MPoly diff(int i) — Partial derivative with respect to generator i. - MPoly: MPoly compose(int i, MPoly v) — Substitutes the polynomial v for generator i. - MPoly: MPoly evaluate(int i, T c) — Substitutes the constant c for generator i. - MPoly: Map> coefficientsIn(int i) — Coefficients with respect to generator i: degree -> coefficient (a polynomial free of x_i). - MPoly: MPoly lcIn(int i) — Leading coefficient with respect to generator i (a polynomial free of x_i). - MPoly: MPoly shift(int i, int k) — Multiplies by x_i^k. - MPoly: MPoly mapCoeffs(PolyRing to, S Function(T) f) — Maps coefficients into another ring with the same generators. - MPoly: MPoly reorder(PolyRing to) — The same polynomial in a ring with another order. - MPoly: Expr toExpr() - MPoly: String toString() - MPoly: MPoly operator +(MPoly o) - MPoly: MPoly operator -(MPoly o) - MPoly: MPoly operator -() - MPoly: MPoly operator *(MPoly o) - MPoly: bool operator ==(Object other) - final class LimitError implements Exception - LimitError: LimitError(this.message) - LimitError: final String message - LimitError: String toString() - final class SeriesError implements Exception — Thrown when an expansion does not exist in this framework (essential singularity, oscillation...). - SeriesError: SeriesError(this.message) - SeriesError: final String message - SeriesError: String toString() - final class PSeries — A truncated series sum c_k x^k + O(x^order); exponents are rationals, coefficients are expressions free of x (they may contain log(x) for logarithmic terms). - PSeries: PSeries(Map terms, this.order) - PSeries: factory PSeries.constant(Expr c, Rational order) - PSeries: static PSeries compose(List a, PSeries h) — sum_k a_k h^k for a series h with positive valuation, given coefficients a_0 … a_n. - PSeries: final Map terms - PSeries: final Rational order - PSeries: bool get isZero - PSeries: Rational get valuation — Lowest exponent present (the valuation), or order when zero to this order. - PSeries: Expr coeff(Rational k) - PSeries: PSeries scale(Expr c) - PSeries: PSeries shift(Rational r) — Multiplies by x^r. - PSeries: (Expr, Rational, PSeries) normalized() — (c, v, h) with this == c x^v (1 + h), h of positive valuation. - PSeries: Expr toExpr(Expr x, {bool withOrder = true}) — The series as an expression in x with an O(x^order) term (no O term when withOrder is false). - PSeries: String toString() - PSeries: PSeries operator +(PSeries o) - PSeries: PSeries operator -() - PSeries: PSeries operator -(PSeries o) - PSeries: PSeries operator *(PSeries o) ### Algebra and number theory (riptide_algebra) import 'package:riptide_algebra/riptide_algebra.ray'; Permutation groups and character tables, Lie groups and algebras, Clifford algebras and spinors, quaternions and octonions, exact real algebraic numbers, primes, elliptic curves and modular forms. https://riptidecompute.com/raya/docs/algebra - BigInt resultantZ(List a0, List b0) — The resultant of two integer polynomials by the subresultant algorithm (Cohen, Algorithm 3.3.7). - List> factorSquareFreeZ(List f0) — The irreducible factors over Z of a square-free primitive integer polynomial of degree ≥ 1 (Zassenhaus). - QIMatrix intertwiner(List a, List b) — The matrix S with S A_k = B_k S for two irreducible sets of anticommuting generators satisfying the same Clifford relations (Schur's lemma: S = Σ_Γ Γ_B M Γ_A⁻¹ over the products of generators, for any M making it… - List cyclotomicPolynomial(int n) — The integer coefficients of the n-th cyclotomic polynomial Φ_n, constant term first (Φ_n is monic). - int cyclotomicDegree(int n) — Exposed for tests: φ(n) via the degree of Φ_n. - QPoly spreadPolynomial(int n) — The spread polynomial Sₙ(s) over Q (integer coefficients): S₀ = 0, S₁ = s, S₂ = 4s − 4s², S₃ = s(3 − 4s)². - List soGenerators(int p, [int q = 0]) — The basis M_ab (a < b) of so(p, q) = {X: Xᵀη + ηX = 0}, η = diag(+1 × p, −1 × q). - CMatrix su2Rotation(double theta, List axis) — U = exp(−i θ n·σ/2) = cos(θ/2) I − i sin(θ/2) n·σ ∈ SU(2): the spinor rotation by θ about n. - CMatrix so3Rotation(double theta, List axis) — The rotation by θ about n in SO(3) (Rodrigues): R = I + sin θ K + (1 − cos θ) K², K = n·L. - CMatrix su2ToSo3(CMatrix u) — The double cover SU(2) → SO(3): R_ij = ½ Tr(σ_i U σ_j U†). - CMatrix sl2cToLorentz(CMatrix a) — The covering map SL(2,C) → SO⁺(3,1): Λ_μν = ½ Tr(σ_μ A σ_ν A†) with σ_μ = (I, σ), from A X A† for X = x^μ σ_μ (det X = t² − |x|² is preserved). - CMatrix sl2cBoost(double rapidity, List axis) — The SL(2,C) element of a boost with rapidity η along n: exp(η n·σ/2) (acting on right-handed Weyl spinors). - CMatrix lorentzBoost(double rapidity, List axis) — The Lorentz boost with rapidity η along n: exp(η n·K). - CMatrix su3Exp(List theta) — exp(i Σ θ_a λ_a / 2) ∈ SU(3). - BigInt weylDimension(RootSystem rs, Weight lambda) — Weyl dimension formula for V(λ). - Map tensorProduct(RootSystem rs, Weight lambda, Weight mu) — V(λ) ⊗ V(μ) = ⊕ N_ν V(ν), by the Racah–Speiser (Klimyk) algorithm: Σ over weights ν of V(μ) of m_μ(ν) · sign(w) V(w(λ+ν+ρ) − ρ). - List dynkinToYoung(Weight lambda) — Dynkin labels of su(n) (A_(n−1)) → the Young diagram's row lengths (r_i = Σ_(j≥i) λ_j), trailing zeros dropped. - Weight youngToDynkin(List rows, int n) — A Young diagram (row lengths, weakly decreasing) for su(n) → Dynkin labels of A_(n−1). - Rational half(int twice) — K/2 as a Rational (half-integers: half(1) = 1/2, half(3) = 3/2). - SqrtRational wigner3j(Rational j1, Rational j2, Rational j3, Rational m1, Rational m2, Rational m3) — The Wigner 3j symbol (j1 j2 j3; m1 m2 m3), exact. - SqrtRational wigner3jTwice(int j1, int j2, int j3, int m1, int m2, int m3) — wigner3j with every argument doubled (so half-integers are odd ints). - SqrtRational clebschGordan(Rational j1, Rational m1, Rational j2, Rational m2, Rational j, Rational m) — The Clebsch–Gordan coefficient ⟨j1 m1; j2 m2 | j m⟩ (Condon–Shortley phase), exact. - SqrtRational clebschGordanTwice(int j1, int m1, int j2, int m2, int j, int m) — clebschGordan with doubled arguments. - SqrtRational wigner6j(Rational j1, Rational j2, Rational j3, Rational j4, Rational j5, Rational j6) — The Wigner 6j symbol {j1 j2 j3; j4 j5 j6}, exact. - SqrtRational wigner6jTwice(int j1, int j2, int j3, int j4, int j5, int j6) — wigner6j with doubled arguments. - SqrtRational wigner9j(Rational j1, Rational j2, Rational j3, Rational j4, Rational j5, Rational j6, Rational j7, Rational j8, Rational j9) — The Wigner 9j symbol {j1 j2 j3; j4 j5 j6; j7 j8 j9}, exact, as Σ_x (−1)^(2x) (2x+1) {j1 j4 j7; j8 j9 x}{j2 j5 j8; j4 x j6}{j3 j6 j9; x j1 j2}. - SqrtRational wigner9jTwice(int j1, int j2, int j3, int j4, int j5, int j6, int j7, int j8, int j9) — wigner9j with doubled arguments. - SqrtRational racahW(Rational a, Rational b, Rational c, Rational d, Rational e, Rational f) — The Racah W coefficient W(abcd; ef) = (−1)^(a+b+c+d) {a b e; d c f}. - double wignerSmallD(Rational j, Rational mp, Rational m, double beta) — Wigner small-d matrix element d^j_{m'm}(β) (Condon–Shortley; active rotations, as Sakurai), double precision. - Complex wignerD(Rational j, Rational mp, Rational m, double alpha, double beta, double gamma) — Wigner D-matrix element D^j_{m'm}(α, β, γ) = e^(−i m' α) d^j_{m'm}(β) e^(−i m γ) (z-y-z Euler angles). - List> wignerDMatrix(Rational j, double alpha, double beta, double gamma) — The full (2j+1)×(2j+1) D-matrix, rows m' = j … −j, columns m = j … −j. - int mobius(BigInt n) — The Möbius function μ(n) for n >= 1. - BigInt divisorSigma(BigInt n, [int k = 1]) — The divisor function σ_k(n) = Σ_{d | n} d^k for n >= 1, k >= 0. - int numDivisors(BigInt n) — The number of divisors τ(n) = σ_0(n). - int totientInt(int n) — totient on ints. - int mobiusInt(int n) — mobius on ints. - int divisorSigmaInt(int n, [int k = 1]) — divisorSigma on ints (the result must fit an int). - int carmichaelLambdaInt(int n) — carmichaelLambda on ints. - List divisorSigmaTable(int length, int k) — Σ_k(n) for every n in [0, length) (index 0 is 0), by a divisor sieve: O(length log length). - List continuedFraction(Rational x) — The regular continued fraction a0; a1... ak of x (finite; the last term is > 1 unless x is an integer), matching SymPy continued_fraction. - Rational fromContinuedFraction(List terms) — The value of the finite continued fraction a0; a1... ak. - List convergents(List terms) — The convergents p_i / q_i of a0; a1.... - PeriodicContinuedFraction quadraticContinuedFraction(BigInt p, BigInt q, BigInt d) — The continued fraction of (p + sqrt(d)) / q with d > 0 not a square and q != 0. - PeriodicContinuedFraction sqrtContinuedFraction(BigInt n) — The continued fraction of sqrt(n) for a non-square n > 0: a0; (a1... a_l). - (BigInt, BigInt) pellFundamental(BigInt d) — The fundamental solution (x, y) of Pell's equation x^2 - d y^2 = 1 (d > 0 not a square). - (BigInt, BigInt)? negativePellFundamental(BigInt d) — The fundamental solution of x^2 - d y^2 = -1, or null when it has none (the period of sqrt d is even). - (Map, BigInt) trialDivision(BigInt n, {int bound = 10000}) — Trial division of n > 0 by primes <= bound: the factors found and the unfactored cofactor. - BigInt? pollardRhoBrent(BigInt n, {int maxIterations = 1 << 20, int seed = 1}) — Pollard's rho with Brent's cycle detection and batched gcds: a non-trivial factor of the composite n, or null after maxIterations steps per polynomial (tries x^2 + c for several c). - BigInt? ecmFactor(BigInt n, {int b1 = 2000, int curves = 40, int seed = 7}) — Lenstra's elliptic-curve method, stage 1 only, on Montgomery curves with Suyama's parametrisation and the x-only Montgomery ladder: a non-trivial factor of n (odd, composite, not a prime power), or null. - (BigInt, int) perfectPower(BigInt n) — (r, k) with n = r^k and k maximal, for n >= 2. - Map factorint(BigInt n) — The prime factorisation of n != 0 as a map prime -> exponent, ascending (SymPy factorint). - Map factorintInt(int n) — factorint on ints: prime -> exponent, ascending. - List divisors(BigInt n) — The positive divisors of n != 0, ascending. - List divisorsInt(int n) — divisors on ints. - double hurwitzZeta(double s, double x) — The Hurwitz zeta function ζ(s, x) for real s != 1, x > 0, by Euler–Maclaurin summation. - double digamma(double x) — The digamma function ψ(x) for real x > 0. - double riemannZeta(double s) — The Riemann zeta function ζ(s) for real s != 1: hurwitzZeta at x = 1 for s >= 1/2, the functional equation ζ(s) = 2^s π^{s−1} sin(πs/2) Γ(1−s) ζ(1−s) below. - double gamma(double x) — The gamma function Γ(x) for real x (Lanczos, g = 7, about 1e-15 relative; reflection for x < 1/2). - Rational zetaEvenCoefficient(int k) — Ζ(2k) = c · π^{2k} with the exact rational c = (−1)^{k+1} B_{2k} 2^{2k−1} / (2k)! - double exponentialIntegralE1(double x) — The exponential integral E_1(x) = ∫_x^∞ e^{−t} / t dt for x > 0. - (BigInt, BigInt, BigInt) egcd(BigInt a, BigInt b) — The extended Euclidean algorithm: (g, x, y) with a*x + b*y = g = gcd(a, b), g >= 0. - BigInt modInverse(BigInt a, BigInt m) — a^-1 mod m in 0, m). - int modInverseInt(int a, int m) — modInverse on ints. - int mulModInt(int a, int b, int m) — a * b mod m for ints, exact for every 0 < m < 2^63 (falls back to BigInt when the product could overflow). - int modPowInt(int b, int e, int m) — b^e mod m for ints (e >= 0, m >= 1), exact for every 64-bit modulus. - BigInt modPow(BigInt b, BigInt e, BigInt m) — b^e mod m on BigInt; a negative e uses the inverse of b. - (BigInt, BigInt)? crt(List residues, List moduli) — The Chinese remainder theorem for arbitrary (not necessarily coprime) moduli. - (int, int)? crtInt(List residues, List moduli) — crt on ints. - BigInt? sqrtModPrime(BigInt a, BigInt p) — A square root of a modulo the odd prime p by Tonelli–Shanks, or null when a is a non-residue. p is not checked for primality. - BigInt? sqrtModPrimeCipolla(BigInt a, BigInt p) — A square root of a modulo the odd prime p by Cipolla's algorithm, or null for a non-residue. - List sqrtModPrimePower(BigInt a, BigInt p, int k) — All square roots of a modulo p^k (p prime, k >= 1), sorted ascending. - List sqrtMod(BigInt a, BigInt n) — All square roots of a modulo n >= 1, sorted ascending (SymPy sqrt_mod(a, n, all_roots=True)). - BigInt carmichaelLambda(BigInt n) — Carmichael's function λ(n): the exponent of (Z/n)^×. - BigInt multiplicativeOrder(BigInt a, BigInt n) — The multiplicative order of a modulo n (gcd(a, n) = 1). - int multiplicativeOrderInt(int a, int n) — multiplicativeOrder on ints. - bool hasPrimitiveRoot(BigInt n) — Whether (Z/n)^× is cyclic: n = 1, 2, 4, p^k or 2p^k with p an odd prime. - BigInt? primitiveRoot(BigInt n) — The smallest primitive root modulo n, or null when (Z/n)^× is not cyclic. - int? primitiveRootInt(int n) — primitiveRoot on ints. - bool isPrimitiveRoot(BigInt g, BigInt n) — Whether g generates (Z/n)^×. - BigInt totient(BigInt n) — Euler's totient φ(n). - BigInt? discreteLog(BigInt n, BigInt a, BigInt b) — The discrete logarithm: the least x >= 0 with b^x ≡ a (mod n), or null when a is not a power of b. - int? discreteLogInt(int n, int a, int b) — discreteLog on ints. - Rational bernoulli(int n) — The Bernoulli number B_n, exact, with the convention B_1 = −1/2 (B_n = 0 for odd n > 1). - QSeries eisenstein(int k, int precision) — The normalised Eisenstein series E_k = 1 − (2k / B_k) Σ_{n>=1} σ_{k−1}(n) q^n of even weight k >= 2 (E_2 is quasi-modular). - QSeries eulerProduct(int precision) — The Euler function ∏_{n>=1} (1 − q^n) by the pentagonal number theorem. - QSeries delta(int precision) — The discriminant Δ = q ∏ (1 − q^n)^24 = η^24, the weight-12 cusp form of level 1. - List ramanujanTauList(int count) — Ramanujan's τ(n) for 1 <= n < count + 1 (index 0 is 0): the coefficients of delta. - BigInt ramanujanTau(int n) — Ramanujan's τ(n). - QSeries etaProduct(Map exponents, int precision) — The eta product ∏_m η(mτ)^{r_m} (keys m, values r_m, which may be negative) as a q-series. - QSeries thetaZ(int precision) — The Jacobi theta series θ(q) = Σ_{n ∈ Z} q^{n^2} = 1 + 2q + 2q^4 +..., the theta series of Z. - QSeries thetaZn(int n, int precision) — The theta series of Z^n: θ^n, whose q^m coefficient is r_n(m), the number of representations of m as a sum of n squares. - QSeries latticeTheta(List> gram, int precision, {bool even = true}) — The theta series Σ_{x ∈ Z^n} q^{Q(x)} of the positive definite integral quadratic form Q(x) = x^T G x / 2 for an even Gram matrix G (even lattice; e.g. a Cartan matrix), or Q(x) = x^T G x when even is false. - QSeries thetaE8(int precision) — The theta series of the E8 lattice, Σ_{x ∈ E8} q^{x·x/2}, counted exactly via E8 = D8 ∪ (D8 + ½·1): integer vectors with even coordinate sum, plus half-integer vectors with even sum. - int isqrtSmall(int n) — floor(sqrt(n)) for small non-negative ints. - QSeries hecke(QSeries f, int n, int k) — The Hecke operator T_n on a q-expansion of a level-1 (or level-N, gcd(n, N) = 1, trivial character) form of weight k: b(m) = Σ_{d | gcd(m, n)} d^{k−1} a(mn / d^2). - QSeries heckePrime(QSeries f, int p, int k) — The Hecke operator T_p for a prime p: b(m) = a(pm) + p^{k−1} a(m/p). - bool isStrongProbablePrimeInt(int n, int a) — Whether n is a strong probable prime to base a (n odd, n > 2). - bool isPrime(int n) — Deterministic primality for every int (n < 2^63): trial division, then Miller–Rabin with millerRabinBases64. - bool isStrongProbablePrime(BigInt n, BigInt a) — Whether n is a strong probable prime to base a (n odd, n > 2). - bool isSquare(BigInt n) — Whether n is a perfect square. - bool isStrongLucasProbablePrime(BigInt n) — The strong Lucas probable-prime test with Selfridge's parameters (method A: the first D in 5, −7, 9, −11, … with (D/n) = −1, P = 1, Q = (1 − D)/4). n odd, n > 2. - bool isProbablePrime(BigInt n) — Primality of a BigInt: exact below 2^63 (deterministic Miller–Rabin), Baillie–PSW above (strong base-2 Miller–Rabin plus the strong Lucas test; no BPSW pseudoprime is known). - int nextPrime(int n) — The least prime > n. - int prevPrime(int n) — The greatest prime < n; throws for n <= 2. - BigInt nextPrimeBig(BigInt n) — The least probable prime > n (BigInt). - BigInt prevPrimeBig(BigInt n) — The greatest probable prime < n (BigInt); throws for n <= 2. - int isqrtInt(int n) — floor(sqrt(n)) for n >= 0, exact for every 64-bit int. - BigInt isqrt(BigInt n) — floor(sqrt(n)) for n >= 0 on BigInt (Newton). - List primesUpTo(int n) — All primes <= n, ascending (odd-only sieve of Eratosthenes). - List primesInRange(int lo, int hi, {int segment = 1 << 16}) — All primes in [lo, hi), by a segmented sieve (memory O(sqrt(hi) + segment)). - int countPrimesInRange(int lo, int hi) — The number of primes in [lo, hi) (segmented sieve). - int primePi(int n) — The prime-counting function π(n), by the Lucy Hedgehog / Legendre-style recursion in O(n^(3/4)) time and O(sqrt n) memory. - int jacobiSymbol(BigInt a, BigInt n) — The Jacobi symbol (a/n) for odd n > 0. - int legendreSymbol(BigInt a, BigInt p) — The Legendre symbol (a/p) for an odd prime p (primality is not checked; equals the Jacobi symbol). - int kroneckerSymbol(BigInt a, BigInt n) — The Kronecker symbol (a/n) for any integers a, n. - int jacobiSymbolInt(int a, int n) — jacobiSymbol on ints. - int legendreSymbolInt(int a, int p) — legendreSymbol on ints. - int kroneckerSymbolInt(int a, int n) — kroneckerSymbol on ints. - List get exactPauli — The exact Pauli matrices over Q(i). - List> get octonionTable — The octonion multiplication table in this Cayley–Dickson convention: octonionTablej = (s, k) with e_i e_j = s e_k. - List<(int, int, int)> get fanoLines — The seven lines of the Fano plane: oriented triples (i, j, k) of imaginary units with e_i e_j = e_k (and cyclically), each spanning a quaternion subalgebra. - final List pauliWithIdentity — Σ₀ = I, σ₁, σ₂, σ₃. - List get pauli — The Pauli matrices σ₁, σ₂, σ₃. - final List gellMann — The Gell-Mann matrices λ₁ … λ₈ (Tr λ_a λ_b = 2δ_ab). - final List so3Generators — so(3): (L_i)_jk = −ε_ijk, so L_i, L_j = ε_ijk L_k and e^(θ n·L) is the rotation by θ about n. - ({List rotations, List boosts}) get lorentzGenerators — The Lorentz algebra so(3,1) on (t, x, y, z): rotations J_i (as so(3) on the spatial block) and boosts K_i with (K_i)_(0i) = (K_i)_(i0) = 1. - CMatrix get minkowskiMetric — The Minkowski metric diag(+1, −1, −1, −1) (mostly minus) as a matrix. - const List> e8CartanMatrix — The Cartan matrix of E8 (Bourbaki numbering), the Gram matrix of the E8 root lattice. - const List millerRabinBases64 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37] — The Miller–Rabin bases that are deterministic below 3.3 * 10^24 (Sorenson & Webster 2015), so for every int. - typedef ClassFunction = List — A class function or character: one exact value per conjugacy class. - final class AlgebraicNumber implements Comparable — A real algebraic number, held exactly as its minimal polynomial over Q (primitive, integer coefficients, positive leading coefficient) and an open isolating interval (lo, hi) with rational endpoints containing exactly… - AlgebraicNumber: factory AlgebraicNumber.rational(Rational r) — The rational number r. - AlgebraicNumber: factory AlgebraicNumber.fromInt(int n) — The integer n. - AlgebraicNumber: factory AlgebraicNumber.sqrt(Rational r) — The non-negative square root √r of r ≥ 0. - AlgebraicNumber: factory AlgebraicNumber.root(Rational r, int k) — The real k-th root of r (the non-negative one for even k, which needs r ≥ 0). - AlgebraicNumber: factory AlgebraicNumber.fromSqrtRational(SqrtRational v) — Sign · √square, from the exact Wigner-symbol values. - AlgebraicNumber: factory AlgebraicNumber.rootInInterval(QPoly p, Rational lo, Rational hi) — The unique root of p in the interval (lo, hi]; throws unless there is exactly one. - AlgebraicNumber: factory AlgebraicNumber.cosPi(Rational r) — cos(rπ) for rational r, exactly (Ψ_N for the reduced r/2 = k/N, with the root picked by its rank, since 2cos(2πj/N) decreases in j on 0 < j < N/2). - AlgebraicNumber: factory AlgebraicNumber.sinPi(Rational r) — sin(rπ) for rational r, exactly (= cos((1/2 − r)π)). - AlgebraicNumber: factory AlgebraicNumber.cos2PiOver(int n) — cos(2π/n). - AlgebraicNumber: factory AlgebraicNumber.sin2PiOver(int n) — sin(2π/n). - AlgebraicNumber: static List realRoots(QPoly p) — The distinct real roots of a nonzero polynomial, in increasing order. - AlgebraicNumber: static QPoly twoCosMinimalPolynomial(int n) — The minimal polynomial of 2cos(2π/n) (Ψₙ, from Φₙ(x) = x^(φ(n)/2) Ψₙ(x + 1/x)), primitive with integer coefficients. - AlgebraicNumber: static AlgebraicNumber get goldenRatio — The golden ratio (1 + √5)/2. - AlgebraicNumber: static final AlgebraicNumber zero - AlgebraicNumber: static final AlgebraicNumber one - AlgebraicNumber: final QPoly minimalPolynomial — The minimal polynomial over Q: irreducible, primitive with integer coefficients, positive leading coefficient. - AlgebraicNumber: int get degree — The degree of the number over Q (1 for rationals). - AlgebraicNumber: bool get isRational - AlgebraicNumber: (Rational, Rational) get interval — The current isolating interval (lo, hi) (equal ends for a rational). - AlgebraicNumber: AlgebraicNumber get reciprocal — 1 / this (throws for zero). - AlgebraicNumber: int get sign — −1, 0 or 1. - AlgebraicNumber: int get hashCode - AlgebraicNumber: ({Rational rational, Rational coefficient, BigInt radicand})? get quadraticSurd — P + q√d with d > 1 square-free, when this has degree 2. - AlgebraicNumber: Rational? toRational() — The value as a Rational, or null when irrational. - AlgebraicNumber: AlgebraicNumber pow(int k) — The integer power thisᵏ (k < 0 needs a nonzero value). - AlgebraicNumber: AlgebraicNumber nthRoot(int k) — The real k-th root (k ≥ 1): the non-negative one for even k (which needs this ≥ 0). - AlgebraicNumber: AlgebraicNumber powRational(Rational r) — The rational power this^r = (this^(1/q))^p for r = p/q; even q needs this ≥ 0. - AlgebraicNumber: AlgebraicNumber sqrt() — The non-negative square root (this ≥ 0). - AlgebraicNumber: AlgebraicNumber abs() - AlgebraicNumber: int compareTo(AlgebraicNumber o) - AlgebraicNumber: BigInt floor() — The largest integer ≤ this. - AlgebraicNumber: BigInt ceil() — The smallest integer ≥ this. - AlgebraicNumber: BigInt round() — The nearest integer (ties, which only rationals have, away from zero as Rational.round). - AlgebraicNumber: BigInt scaledFloor(int places) — floor(this · 10^places): the decimal digits, exactly. - AlgebraicNumber: String toDecimalString(int places) — The decimal expansion truncated (towards −∞) to places digits after the point. - AlgebraicNumber: BigFloat toBigFloat({int prec = 53, RoundingMode rnd = RoundingMode.nearestEven}) — The value correctly rounded to a BigFloat of prec bits in the rounding mode rnd. - AlgebraicNumber: double toDouble() — The nearest double. - AlgebraicNumber: String toString() — root of in (lo, hi) ≈ , or the rational itself. - AlgebraicNumber: String toLatex() — LaTeX: rationals, quadratic surds (\frac{1 + \sqrt{5}}{2}), real radicals \sqrtk{r}, otherwise the root of the minimal polynomial with its isolating interval. - AlgebraicNumber: AlgebraicNumber operator -() - AlgebraicNumber: AlgebraicNumber operator +(AlgebraicNumber o) - AlgebraicNumber: AlgebraicNumber operator -(AlgebraicNumber o) - AlgebraicNumber: AlgebraicNumber operator *(AlgebraicNumber o) - AlgebraicNumber: AlgebraicNumber operator /(AlgebraicNumber o) - AlgebraicNumber: bool operator <(AlgebraicNumber o) - AlgebraicNumber: bool operator <=(AlgebraicNumber o) - AlgebraicNumber: bool operator >(AlgebraicNumber o) - AlgebraicNumber: bool operator >=(AlgebraicNumber o) - AlgebraicNumber: bool operator ==(Object other) - final class QPoly — A dense polynomial c₀ + c₁x + … + cₙxⁿ with exact Rational coefficients (no trailing zeros; the zero polynomial has no coefficients and degree −1). - QPoly: factory QPoly(List coefficients) — From coefficients, constant term first. - QPoly: factory QPoly.fromInts(List coefficients) — From int coefficients, constant term first. - QPoly: factory QPoly.fromBigInts(List coefficients) — From BigInt coefficients, constant term first. - QPoly: factory QPoly.constant(Rational c) — The constant polynomial c. - QPoly: factory QPoly.monomial(Rational c, int k) — C·xᵏ. - QPoly: factory QPoly.fromRoots(Iterable roots) — The monic polynomial with the given roots, Π (x − rᵢ). - QPoly: static final QPoly zero - QPoly: static final QPoly one - QPoly: static final QPoly x — The polynomial x. - QPoly: static QPoly gcd(QPoly a, QPoly b) — The monic greatest common divisor (zero when both are zero). - QPoly: static (QPoly, QPoly, QPoly) extendedGcd(QPoly a, QPoly b) — The extended gcd: (g, s, t) with s·a + t·b = g monic. - QPoly: static Rational resultant(QPoly a, QPoly b) — The resultant Res(a, b), by Collins' subresultant algorithm on the integer primitive parts (Cohen, "A Course in Computational Algebraic Number Theory", Algorithm 3.3.7), rescaled to the rational inputs. - QPoly: List get coefficients — The coefficients, constant term first (unmodifiable, no trailing zeros). - QPoly: int get degree — The degree; −1 for the zero polynomial. - QPoly: bool get isZero - QPoly: bool get isConstant — True for constants (including zero). - QPoly: Rational get leadingCoefficient — The leading coefficient (0 for the zero polynomial). - QPoly: Rational get content — The positive content: the rational c > 0 such that this / c has coprime integer coefficients. - QPoly: bool get isSquareFree — True when this has no repeated factor. - QPoly: Rational get discriminant — The discriminant (−1)^(n(n−1)/2) · Res(p, p′) / lc. - QPoly: bool get isIrreducible — True when this is irreducible over Q (degree ≥ 1). - QPoly: int get hashCode - QPoly: QPoly scale(Rational s) — Multiplication by a scalar. - QPoly: QPoly pow(int k) — The k-th power. - QPoly: (QPoly, QPoly) divRem(QPoly d) — Euclidean division: (q, r) with this = q·d + r and deg r < deg d. - QPoly: bool isDivisibleBy(QPoly d) — True when d divides this exactly. - QPoly: QPoly derivative() — The formal derivative. - QPoly: Rational evaluate(Rational x) — The value at x (Horner). - QPoly: int signAt(Rational x) — The sign of the value at x (−1, 0, 1), computed on integers without building the rational value. - QPoly: QPoly compose(QPoly g) — The composition this(g(x)). - QPoly: QPoly shift(Rational c) — p(x + c) (a Taylor shift). - QPoly: QPoly scaleVariable(Rational c) — p(c·x). - QPoly: QPoly reflect() — p(−x). - QPoly: QPoly reverse() — The reversal xⁿ·p(1/x) (its roots are the reciprocals). - QPoly: QPoly substitutePower(int k) — p(xᵏ). - QPoly: QPoly monic() — This divided by its leading coefficient. - QPoly: QPoly primitive() — The primitive part with a positive leading coefficient: coprime integer coefficients. - QPoly: List integerCoefficients() — The integer coefficients of primitive (constant term first). - QPoly: List squareFreeDecomposition() — Yun's square-free decomposition: monic a₁, a₂, …, aₖ, pairwise coprime and square-free, with this = lc · a₁ · a₂² · … · aₖᵏ (some aᵢ may be 1). - QPoly: QPoly squareFreePart() — The monic square-free part (the product of the distinct monic irreducible factors). - QPoly: List sturmSequence() — The Sturm sequence p, p′, −rem(p, p′), … (each term scaled by a positive rational to a primitive integer polynomial, which keeps the sign pattern). - QPoly: int countRealRoots([Rational? lo, Rational? hi]) — The number of distinct real roots in the half-open interval (lo, hi]; the whole line when both are null. - QPoly: List<(Rational, Rational)> isolateRealRoots() — Disjoint intervals (lo, hi], one around each distinct real root, in increasing order. - QPoly: (Rational, List<(QPoly, int)>) factor() — The factorisation over Q: (unit, (f₁, e₁), …) with this = unit · Π fᵢ^eᵢ, each fᵢ irreducible over Q, primitive with integer coefficients and a positive leading coefficient, sorted by degree then coefficients. - QPoly: List irreducibleFactors() — The distinct irreducible factors (primitive, positive leading coefficient). - QPoly: String toString([String variable = 'x']) — Plain text in the variable variable, highest power first, e.g. x^4 - 10*x^2 + 1. - QPoly: String toLatex([String variable = 'x']) — LaTeX, e.g. x^{4} - 10 x^{2} + 1. - QPoly: Rational operator [](int i) — The coefficient of xⁱ (0 beyond the degree). - QPoly: QPoly operator +(QPoly o) - QPoly: QPoly operator -(QPoly o) - QPoly: QPoly operator -() - QPoly: QPoly operator *(QPoly o) - QPoly: QPoly operator ~/(QPoly d) - QPoly: QPoly operator %(QPoly d) - QPoly: bool operator ==(Object other) - final class CliffordAlgebra — The Clifford algebra with generators e_0 … e_(n−1), e_k² = metrick ∈ {+1, −1, 0}. - CliffordAlgebra: CliffordAlgebra(List metric) - CliffordAlgebra: factory CliffordAlgebra.signature(int p, [int q = 0, int r = 0]) — Cl(p, q, r): p generators squaring to +1, then q to −1, then r to 0. - CliffordAlgebra: final List metric - CliffordAlgebra: int get generatorCount - CliffordAlgebra: int get dimension — 2^n. - CliffordAlgebra: bool get isDegenerate - CliffordAlgebra: Multivector get one — The scalar 1. - CliffordAlgebra: Multivector get pseudoscalar — The unit pseudoscalar e_0 e_1 ⋯ e_(n−1). - CliffordAlgebra: late final List complexGenerators — Complex matrices for the generators in an irreducible representation of the complexification, of size 2^⌊n/2⌋ (Brauer–Weyl: tensor products of Pauli matrices; generators with e² = −1 get a factor i). - CliffordAlgebra: int bladeProductSign(int a, int b) — e_a e_b = sign · e_(a xor b) for basis blades a, b. - CliffordAlgebra: Multivector scalar(Rational r) - CliffordAlgebra: Multivector e(int k) — The generator e_k. - CliffordAlgebra: Multivector blade(int mask, [Rational? c]) — The basis blade with bitmask mask (coefficient 1). - CliffordAlgebra: Multivector product(List indices) — The blade e_(i1) e_(i2) ⋯ (indices in any order, reordered with sign). - CliffordAlgebra: Multivector vector(List v) — Σ v_k e_k. - CliffordAlgebra: String bladeName(int mask) — Name of a blade, e.g. e013, 1 for the scalar. - CliffordAlgebra: QIMatrix leftRegular(Multivector m) — The left-regular representation: the 2^n × 2^n matrix of x ↦ m x on the blade basis. - CliffordAlgebra: QIMatrix represent(Multivector x) — The image of a multivector in complexGenerators' representation. - CliffordAlgebra: String toString() - final class Multivector — An element of a CliffordAlgebra with exact rational coefficients. - Multivector: final CliffordAlgebra algebra - Multivector: final Map terms — Blade bitmask → nonzero coefficient. - Multivector: Rational get scalarPart — The scalar part ⟨x⟩₀. - Multivector: bool get isZero - Multivector: Multivector get reverse — Reversion x̃: (−1)^(k(k−1)/2) on grade k. - Multivector: Multivector get gradeInvolution — Grade involution x̂: (−1)^k on grade k. - Multivector: Multivector get cliffordConjugate — Clifford conjugate x̄ = reverse of the grade involution: (−1)^(k(k+1)/2). - Multivector: Multivector get even — The even part. - Multivector: Set get grades — Grades present. - Multivector: bool get isScalar - Multivector: Multivector get normSquared — X x̃ (scalar for versors). - Multivector: Multivector get versorInverse — The inverse of a versor (or any x with x x̃ scalar and nonzero): x̃ / (x x̃). - Multivector: Multivector get inverse — The general inverse via the left-regular representation (exact; throws if singular). - Multivector: Multivector get dual — The dual x I⁻¹ (non-degenerate algebras). - Multivector: int get hashCode - Multivector: Rational coefficient(int blade) - Multivector: Multivector scale(Rational r) - Multivector: Multivector leftContraction(Multivector o) — The left contraction x ⌋ y (grade(y) − grade(x) parts of blade products with a ⊆ b). - Multivector: Multivector rightContraction(Multivector o) — The right contraction x ⌊ y. - Multivector: Rational scalarProduct(Multivector o) — The scalar product ⟨x y⟩₀. - Multivector: Multivector dot(Multivector o) — Hestenes' inner product: grade |r − s| parts of products of nonscalar blades. - Multivector: Multivector commutatorProduct(Multivector o) — The commutator product (xy − yx)/2. - Multivector: Multivector grade(int k) — ⟨x⟩_k. - Multivector: Multivector sandwich(Multivector x) — The sandwich v x v⁻¹ (v a versor), e.g. a rotation by a rotor. - Multivector: String toString() - Multivector: Multivector operator +(Multivector o) - Multivector: Multivector operator -() - Multivector: Multivector operator -(Multivector o) - Multivector: Multivector operator *(Multivector o) — The geometric product. - Multivector: Multivector operator ^(Multivector o) — The outer (wedge) product. - Multivector: bool operator ==(Object other) - enum GammaBasis — Representation basis of the gamma matrices. - GammaBasis: dirac — Γ⁰ = diag(1, 1, −1, −1) (Dirac–Pauli; standard for the non-relativistic limit and hydrogen). - GammaBasis: weyl — Γ⁰ off-diagonal, γ⁵ = diag(−1, −1, 1, 1): left- and right-handed Weyl spinors are the upper and lower halves (Peskin & Schroeder). - GammaBasis: majorana — All γ^μ purely imaginary in mostly-minus (real in mostly-plus), so the Dirac equation is real and Majorana spinors are real. - enum MetricSignature — Metric signature convention. - MetricSignature: mostlyMinus — Η = diag(+1, −1, −1, −1) (particle physics). - MetricSignature: mostlyPlus — Η = diag(−1, +1, +1, +1) (general relativity, Srednicki, Weinberg); γ^μ = i × the mostly-minus matrices. - final class GammaMatrices — A set of gamma matrices γ^μ (upper index), μ = 0 … 3, with {γ^μ, γ^ν} = 2η^μν. - GammaMatrices: factory GammaMatrices({GammaBasis basis = GammaBasis.dirac, MetricSignature signature = MetricSignature.mostlyMinus}) - GammaMatrices: final GammaBasis basis - GammaMatrices: final MetricSignature signature - GammaMatrices: final List upper — Γ^μ. - GammaMatrices: List get metric — Η^μν = η_μν (diagonal ±1). - GammaMatrices: List get lower — Γ_μ = η_μν γ^ν. - GammaMatrices: QIMatrix get gamma5 — Γ⁵ = i γ⁰γ¹γ²γ³ (the same matrix in both signatures): Hermitian, squares to 1, anticommutes with every γ^μ. - GammaMatrices: QIMatrix get projectorLeft — Chiral projectors P_L = (1 − γ⁵)/2, P_R = (1 + γ⁵)/2. - GammaMatrices: QIMatrix get projectorRight - GammaMatrices: List get cliffordBasis — The 16 basis elements Γ_A = products γ^(μ1)⋯γ^(μk) for μ1 < … < μk (A a bitmask), a basis of all 4×4 matrices. - GammaMatrices: QIMatrix get chargeConjugation — The charge-conjugation matrix C with C γ^μ C⁻¹ = −(γ^μ)ᵀ, unitary, normalised with its first nonzero entry 1 (Dirac basis: ∝ iγ²γ⁰). - GammaMatrices: QIMatrix sigma(int mu, int nu) — Σ^μν = (i/2)γ^μ, γ^ν. - GammaMatrices: QIMatrix lorentzGenerator(int mu, int nu) — The Lorentz generators of the Dirac representation, S^μν = σ^μν / 2. - GammaMatrices: QIMatrix basisChange(GammaMatrices other) — The matrix S with γ'^μ = S γ^μ S⁻¹ taking spinors of this basis to other's: ψ' = S ψ (same signature). - GammaMatrices: CMatrix slash(List p) — Feynman slash p̸ = γ^μ p_μ = γ^μ η_μν p^ν for a contravariant p^ν (double precision). - GammaMatrices: QIMatrix slashExact(List p) — Exact p̸ for rational p^ν. - GammaMatrices: double dot(List a, List b) — Minkowski product a·b = η_μν a^μ b^ν. - GammaMatrices: int traceFormula(List indices) — Tr(γ^(μ1) ⋯ γ^(μn)) by the recursion Tr(γ^a γ^(μ2)⋯) = Σ_k (−1)^k η^(a μk) Tr(… without a, μk …), Tr 1 = 4. - GammaMatrices: GaussianRational trace(List indices) — Exact trace of a product of γ^μ by matrix multiplication. - GammaMatrices: List adjoint(List psi) — The Dirac adjoint ψ̄ = ψ†γ⁰ (as a row). - GammaMatrices: Complex bilinear(List psi, CMatrix m, List chi) — Ψ̄ M χ. - GammaMatrices: SpinorBilinears bilinears(List psi) — The five bilinear covariants of a Dirac spinor (mostly-minus): scalar ψ̄ψ, pseudoscalar ψ̄iγ⁵ψ, vector ψ̄γ^μψ, axial ψ̄γ^μγ⁵ψ, tensor ψ̄σ^μνψ. - GammaMatrices: List chargeConjugate(List psi) — The charge conjugate ψ^c = C ψ̄ᵀ = C γ⁰ᵀ ψ* (mostly-minus). - GammaMatrices: CMatrix spinorBoost(double rapidity, List axis) — The Dirac-spinor representation of a Lorentz boost with rapidity η along n: S = exp(½ η n_i γ⁰γ^i), so S⁻¹ γ^μ S = Λ^μ_ν γ^ν with Λ = lorentzBoost (mostly-minus). - GammaMatrices: CMatrix spinorRotation(double theta, List axis) — The Dirac-spinor representation of a rotation by θ about n: S = exp(½ θ (n_z γ¹γ² + n_x γ²γ³ + n_y γ³γ¹)). θ = 2π gives −1 (the 720° property). - final class SpinorBilinears — The bilinear covariants of a Dirac spinor. - SpinorBilinears: SpinorBilinears({required this.scalar, required this.pseudoscalar, required this.vector, required this.axial, required this.tensor}) - SpinorBilinears: final double scalar — Σ = ψ̄ψ. - SpinorBilinears: final double pseudoscalar — Ω = ψ̄ iγ⁵ ψ. - SpinorBilinears: final List vector — J^μ = ψ̄γ^μψ. - SpinorBilinears: final List axial — K^μ = ψ̄γ^μγ⁵ψ. - SpinorBilinears: final List> tensor — S^μν = ψ̄σ^μνψ. - final class Cyclotomic — An exact element of the cyclotomic field Q(ζ_n), ζ_n = e^(2πi/n). - Cyclotomic: factory Cyclotomic.fromTerms(int n, Map terms) — Σ_k termsk · ζ_n^k (exponents taken mod n). - Cyclotomic: factory Cyclotomic.rational(Rational r) — The rational number r, viewed in Q(ζ_1) = Q. - Cyclotomic: factory Cyclotomic.integer(int k) - Cyclotomic: factory Cyclotomic.rootOfUnity(int n, [int k = 1]) — Ζ_n^k. - Cyclotomic: factory Cyclotomic.sqrt(int d) — √d for an integer d (Gauss sums: √p = Σ (a/p) ζ_p^a for p ≡ 1 mod 4, i√p for p ≡ 3 mod 4), so quadratic irrationalities like (1+√5)/2 are exact cyclotomic numbers. - Cyclotomic: final int order — The field is Q(ζ_order); the element may lie in a smaller subfield. - Cyclotomic: List get coefficients — Coefficients on 1, ζ, …, ζ^(φ(n)−1). - Cyclotomic: Cyclotomic get conjugate — Complex conjugate (σ_(−1)). - Cyclotomic: Cyclotomic get inverse — The inverse, as the product of the other Galois conjugates divided by the (rational) norm. - Cyclotomic: bool get isZero - Cyclotomic: bool get isRational — Whether the element is rational (only the constant coefficient survives reduction). - Cyclotomic: bool get isReal — Whether the element is real (equal to its complex conjugate). - Cyclotomic: int get hashCode - Cyclotomic: Cyclotomic lift(int m) — The same element as a polynomial in ζ_m (n must divide m): ζ_n = ζ_m^(m/n). - Cyclotomic: Cyclotomic scale(Rational r) - Cyclotomic: Cyclotomic galois(int k) — The Galois automorphism σ_k: ζ ↦ ζ^k (k coprime to the order). - Cyclotomic: Rational toRational() - Cyclotomic: (double, double) toComplex() — Numerical value (re, im). - Cyclotomic: String toString() — 2, -1/2 + 1/2*z3^1, … with zN = ζ_N. - Cyclotomic: Cyclotomic operator +(Cyclotomic o) - Cyclotomic: Cyclotomic operator -() - Cyclotomic: Cyclotomic operator -(Cyclotomic o) - Cyclotomic: Cyclotomic operator *(Cyclotomic o) - Cyclotomic: Cyclotomic operator /(Cyclotomic o) - Cyclotomic: bool operator ==(Object other) - final class RtPoint — A point x, y with coordinates in a field. - RtPoint: const RtPoint(this.x, this.y) - RtPoint: final T x - RtPoint: final T y - RtPoint: int get hashCode - RtPoint: String toString() - RtPoint: bool operator ==(Object other) - final class RtLine — The line ⟨a:b:c⟩, i.e. ax + by + c = 0, with (a, b) ≠ (0, 0). - RtLine: const RtLine(this.a, this.b, this.c) - RtLine: final T a - RtLine: final T b - RtLine: final T c - RtLine: int get hashCode - RtLine: String toString() - RtLine: bool operator ==(Object other) - final class RtMeasures — The six measures of a triangle: quadrances Q₁, Q₂, Q₃ (Qᵢ opposite vertex i) and spreads s₁, s₂, s₃ (sᵢ at vertex i). - RtMeasures: const RtMeasures(this.q1, this.q2, this.q3, this.s1, this.s2, this.s3) - RtMeasures: final T q1 - RtMeasures: final T q2 - RtMeasures: final T q3 - RtMeasures: final T s1 - RtMeasures: final T s2 - RtMeasures: final T s3 - RtMeasures: List get quadrances - RtMeasures: List get spreads - RtMeasures: int get hashCode - RtMeasures: String toString() - RtMeasures: bool operator ==(Object other) - final class RtPlane — The affine plane F² over a field, with Wildberger's measures, constructions and the five main laws. - RtPlane: const RtPlane(this.field) - RtPlane: static const RtPlane rational = RtPlane(RationalField()) — Rational trigonometry over Q. - RtPlane: static const RtPlane algebraic = RtPlane(AlgebraicField()) — Over the real algebraic numbers (every real square root exists). - RtPlane: static RtPlane finite(int p) — Over GF(p), p an odd prime. - RtPlane: final ScalarField field - RtPlane: RtPoint point(T x, T y) — The point x, y. - RtPlane: RtPoint pointInt(int x, int y) — The point with integer coordinates mapped into F. - RtPlane: RtPoint pointRational(Rational x, Rational y) — The point with rational coordinates mapped into F. - RtPlane: RtLine line(T a, T b, T c) — The line ⟨a:b:c⟩ (throws when a = b = 0). - RtPlane: T quadrance(RtPoint p, RtPoint q) — The quadrance Q(A, B) = (x₂ − x₁)² + (y₂ − y₁)². - RtPlane: bool isNull(RtLine l) — True for a null line (a² + b² = 0; perpendicular to itself). - RtPlane: T spread(RtLine l1, RtLine l2) — The spread s(l₁, l₂) = (a₁b₂ − a₂b₁)² / ((a₁² + b₁²)(a₂² + b₂²)); throws for null lines. - RtPlane: T cross(RtLine l1, RtLine l2) — The cross c(l₁, l₂) = (a₁a₂ + b₁b₂)² / ((a₁² + b₁²)(a₂² + b₂²)) = 1 − s. - RtPlane: T twist(RtLine l1, RtLine l2) — The twist t(l₁, l₂) = s / c = (a₁b₂ − a₂b₁)² / (a₁a₂ + b₁b₂)²; throws for perpendicular lines. - RtPlane: RtLine join(RtPoint p, RtPoint q) — The line through two distinct points: ⟨y₁ − y₂: x₂ − x₁: x₁y₂ − x₂y₁⟩. - RtPlane: RtPoint? meet(RtLine l1, RtLine l2) — The intersection of two lines, or null when they are parallel. - RtPlane: bool liesOn(RtPoint p, RtLine l) — True when the point lies on the line. - RtPlane: bool sameLine(RtLine l1, RtLine l2) — True when the triples are proportional. - RtPlane: bool isParallel(RtLine l1, RtLine l2) - RtPlane: bool isPerpendicular(RtLine l1, RtLine l2) - RtPlane: bool isCollinear(RtPoint p, RtPoint q, RtPoint r) — True when the three points lie on one line. - RtPlane: bool isConcurrent(RtLine l1, RtLine l2, RtLine l3) — True when the three lines pass through one point (or are all parallel). - RtPlane: RtLine parallelThrough(RtPoint p, RtLine l) — The line through p parallel to l. - RtPlane: RtLine perpendicularThrough(RtPoint p, RtLine l) — The altitude: the line through p perpendicular to l. - RtPlane: RtPoint foot(RtPoint p, RtLine l) — The foot of the altitude from p to l (throws for a null line, whose altitude is the line itself). - RtPlane: RtPoint midpoint(RtPoint p, RtPoint q) — The midpoint. - RtPlane: RtPoint reflect(RtPoint p, RtLine l) — The reflection of p in the (non-null) line l. - RtPlane: List> nullLinesThrough(RtPoint p) — The null lines through p: ⟨i: −1: y − ix⟩ and ⟨i: 1: −y − ix⟩ for i² = −1 — none when −1 is not a square. - RtPlane: RtMeasures measures(RtPoint a1, RtPoint a2, RtPoint a3) — The quadrances and spreads of the triangle A₁A₂A₃ (throws for coincident points or null sides). - RtPlane: T archimedes(T q1, T q2, T q3) — Archimedes' function A(Q₁, Q₂, Q₃) = (Q₁ + Q₂ + Q₃)² − 2(Q₁² + Q₂² + Q₃²) = 4Q₁Q₂ − (Q₁ + Q₂ − Q₃)², which is 16·area² over the reals; zero exactly for collinear points. - RtPlane: T archimedesOfPoints(RtPoint a1, RtPoint a2, RtPoint a3) — The same as archimedes from the vertices (16·area² from the coordinates: 4·(cross product)²). - RtPlane: bool tripleQuadHolds(T q1, T q2, T q3) — Triple quad formula: (Q₁ + Q₂ + Q₃)² = 2(Q₁² + Q₂² + Q₃²), which holds iff the three points are collinear. - RtPlane: List solveTripleQuad(T q1, T q2) — The Q₃ making three points with quadrances Q₁, Q₂ collinear: Q₁ + Q₂ ± 2√(Q₁Q₂) (those that exist in F). - RtPlane: bool pythagorasHolds(T q1, T q2, T q3) — Pythagoras' theorem: Q₁ + Q₂ = Q₃ (which holds iff s₃ = 1, i.e. the sides opposite Q₁, Q₂ are perpendicular). - RtPlane: T pythagorasHypotenuse(T q1, T q2) — The quadrance of the hypotenuse, Q₁ + Q₂. - RtPlane: T pythagorasLeg(T hypotenuse, T leg) — The other leg, Q₃ − Q₁. - RtPlane: bool spreadLawHolds(RtMeasures m) — Spread law: s₁/Q₁ = s₂/Q₂ = s₃/Q₃, checked as s₁Q₂ = s₂Q₁, s₂Q₃ = s₃Q₂. - RtPlane: T spreadLawSpread(T s1, T q1, T q2) — The spread opposite Q₂ given s₁ opposite Q₁: s₂ = s₁Q₂/Q₁. - RtPlane: T spreadLawQuadrance(T q1, T s1, T s2) — The quadrance opposite s₂ given the pair (Q₁, s₁): Q₂ = Q₁s₂/s₁. - RtPlane: bool crossLawHolds(T q1, T q2, T q3, T s3) — Cross law: (Q₁ + Q₂ − Q₃)² = 4Q₁Q₂(1 − s₃). - RtPlane: T crossLawSpread(T q1, T q2, T q3) — The spread s₃ opposite Q₃ from three quadrances: 1 − (Q₁ + Q₂ − Q₃)²/(4Q₁Q₂) = A(Q₁, Q₂, Q₃)/(4Q₁Q₂). - RtPlane: List crossLawQuadrance(T q1, T q2, T s3) — The quadrances Q₃ opposite the spread s₃ between the sides Q₁, Q₂: Q₁ + Q₂ ± 2√(Q₁Q₂(1 − s₃)). - RtPlane: bool tripleSpreadHolds(T s1, T s2, T s3) — Triple spread formula: (s₁ + s₂ + s₃)² = 2(s₁² + s₂² + s₃²) + 4s₁s₂s₃ (holds for the spreads of any triangle, and of any three concurrent or parallel lines). - RtPlane: List solveTripleSpread(T s1, T s2) — The third spreads: s₁ + s₂ − 2s₁s₂ ± 2√(s₁s₂(1 − s₁)(1 − s₂)). - RtPlane: bool satisfiesLaws(RtMeasures m) — True when the measures satisfy the spread law, the triple spread formula, the cross law at every vertex (which contains Pythagoras' theorem as s = 1 and the triple quad formula as s = 0), and are non-degenerate… - RtPlane: List> solveTriangle({T? q1, T? q2, T? q3, T? s1, T? s2, T? s3}) — Solves a triangle from three of its six measures (at least one quadrance; spreads alone fix only the shape), returning every non-degenerate solution in F (the ambiguous cases give two). - RtPlane: T spreadPolynomialValue(int n, T s) — Sₙ(s), the spread of n·θ when s is the spread of θ, by Sₙ₊₁ = 2(1 − 2s)Sₙ − Sₙ₋₁ + 2s (S₀ = 0, S₁ = s). - abstract final class RtClassical — Conversions between rational and classical measures: distance = √Q, angle = asin √s (for 0 ≤ s ≤ 1, the angle in 0, π/2 between two lines). - RtClassical: static AlgebraicNumber distance(Rational quadrance) — The distance √Q, exactly. - RtClassical: static AlgebraicNumber distanceOf(AlgebraicNumber quadrance) — The distance √Q of an algebraic quadrance, exactly. - RtClassical: static AlgebraicNumber quadrance(AlgebraicNumber distance) — The quadrance d² of a distance, exactly. - RtClassical: static double angle(double spread) — The angle asin √s in radians as a double (0 ≤ s ≤ 1). - RtClassical: static BigFloat angleBigFloat(Rational spread, {int prec = 53}) — The angle asin √s in radians as a BigFloat of prec bits (√s is exact, then one correctly rounded asin). - RtClassical: static Rational? angleAsPiMultiple(Rational spread) — The angle as an exact rational multiple r of π (θ = rπ ∈ 0, 1/2) when one exists: by Niven's theorem a rational spread has a rational-multiple-of-π angle only for s ∈ {0, 1/4, 1/2, 3/4, 1}; otherwise null. - RtClassical: static double spreadOfAngle(double theta) — The spread sin²θ of an angle in radians (double). - RtClassical: static AlgebraicNumber spreadOfPiMultiple(Rational r) — The spread sin²(rπ) of the angle rπ, exactly. - abstract interface class ScalarField — The operations of a field F whose elements are values of type T. - ScalarField: T get zero - ScalarField: T get one - ScalarField: int get characteristic — 0 for Q and the algebraic numbers, p for GF(p). - ScalarField: T fromInt(int n) — The image of the integer n. - ScalarField: T fromRational(Rational r) — The image of a rational (throws when the denominator vanishes in F). - ScalarField: T add(T a, T b) - ScalarField: T sub(T a, T b) - ScalarField: T mul(T a, T b) - ScalarField: T div(T a, T b) — A / b (throws for b = 0). - ScalarField: T neg(T a) - ScalarField: bool isZero(T a) - ScalarField: bool equals(T a, T b) - ScalarField: T? sqrt(T a) — A square root of a in F, or null when a is not a square in F. - final class RationalField implements ScalarField — The rationals Q, with exact square roots of perfect squares only. - RationalField: const RationalField() - RationalField: Rational get zero - RationalField: Rational get one - RationalField: int get characteristic - RationalField: Rational fromInt(int n) - RationalField: Rational fromRational(Rational r) - RationalField: Rational add(Rational a, Rational b) - RationalField: Rational sub(Rational a, Rational b) - RationalField: Rational mul(Rational a, Rational b) - RationalField: Rational div(Rational a, Rational b) - RationalField: Rational neg(Rational a) - RationalField: bool isZero(Rational a) - RationalField: bool equals(Rational a, Rational b) - RationalField: Rational? sqrt(Rational a) - final class PrimeField implements ScalarField — The finite field GF(p) for an odd prime p < 2³¹, elements as ints in [0, p). - PrimeField: PrimeField(this.p) - PrimeField: final int p - PrimeField: int get zero - PrimeField: int get one - PrimeField: int get characteristic - PrimeField: bool get hasSquareRootOfMinusOne — True when −1 is a square (p ≡ 1 mod 4), i.e. when null lines exist. - PrimeField: int fromInt(int n) - PrimeField: int fromRational(Rational r) - PrimeField: int add(int a, int b) - PrimeField: int sub(int a, int b) - PrimeField: int mul(int a, int b) - PrimeField: int div(int a, int b) - PrimeField: int neg(int a) - PrimeField: bool isZero(int a) - PrimeField: bool equals(int a, int b) - PrimeField: int inverse(int a) — The multiplicative inverse (throws for 0). - PrimeField: int? sqrt(int a) — The smaller of the two square roots, or null for a non-residue. - final class AlgebraicField implements ScalarField — The real algebraic numbers: closed under square roots of non-negative elements, so every rational-trigonometry solver that needs √ succeeds whenever the answer is real. - AlgebraicField: const AlgebraicField() - AlgebraicField: AlgebraicNumber get zero - AlgebraicField: AlgebraicNumber get one - AlgebraicField: int get characteristic - AlgebraicField: AlgebraicNumber fromInt(int n) - AlgebraicField: AlgebraicNumber fromRational(Rational r) - AlgebraicField: AlgebraicNumber add(AlgebraicNumber a, AlgebraicNumber b) - AlgebraicField: AlgebraicNumber sub(AlgebraicNumber a, AlgebraicNumber b) - AlgebraicField: AlgebraicNumber mul(AlgebraicNumber a, AlgebraicNumber b) - AlgebraicField: AlgebraicNumber div(AlgebraicNumber a, AlgebraicNumber b) - AlgebraicField: AlgebraicNumber neg(AlgebraicNumber a) - AlgebraicField: bool isZero(AlgebraicNumber a) - AlgebraicField: bool equals(AlgebraicNumber a, AlgebraicNumber b) - AlgebraicField: AlgebraicNumber? sqrt(AlgebraicNumber a) - final class GaussianRational — Re + i·im with exact rational parts. - GaussianRational: GaussianRational(this.re, [Rational? im]) - GaussianRational: factory GaussianRational.integer(int re, [int im = 0]) - GaussianRational: static final GaussianRational zero - GaussianRational: static final GaussianRational one - GaussianRational: static final GaussianRational i - GaussianRational: final Rational re - GaussianRational: final Rational im - GaussianRational: bool get isZero - GaussianRational: bool get isReal - GaussianRational: bool get isImaginary - GaussianRational: GaussianRational get conjugate - GaussianRational: Rational get normSquared - GaussianRational: int get hashCode - GaussianRational: GaussianRational scale(Rational r) - GaussianRational: Complex toComplex() - GaussianRational: String toString() - GaussianRational: GaussianRational operator +(GaussianRational o) - GaussianRational: GaussianRational operator -(GaussianRational o) - GaussianRational: GaussianRational operator -() - GaussianRational: GaussianRational operator *(GaussianRational o) - GaussianRational: GaussianRational operator /(GaussianRational o) - GaussianRational: bool operator ==(Object other) - final class SqrtRational — The number sign · √square with square ≥ 0 (sign is 0 exactly when square is 0). - SqrtRational: factory SqrtRational(int sign, Rational square) — Sign · √square. - SqrtRational: factory SqrtRational.rational(Rational r) — The rational r itself. - SqrtRational: factory SqrtRational.parseSigned(String s) — Parses -3/4 meaning −√(3/4) (the fixture format). - SqrtRational: static final SqrtRational zero - SqrtRational: static final SqrtRational one - SqrtRational: final int sign - SqrtRational: final Rational square - SqrtRational: bool get isZero - SqrtRational: Rational get signedSquare — The signed square, sign · square (the fixture format). - SqrtRational: int get hashCode - SqrtRational: SqrtRational scale(Rational r) — Multiplies by a rational. - SqrtRational: double toDouble() - SqrtRational: SurdSum toSurd() — Exact value as a surd sum (for exact sums of products). - SqrtRational: String toString() - SqrtRational: SqrtRational operator *(SqrtRational o) - SqrtRational: SqrtRational operator /(SqrtRational o) - SqrtRational: SqrtRational operator -() - SqrtRational: bool operator ==(Object other) - final class SurdSum — An exact finite sum Σ c_k √k over squarefree positive integers k with rational coefficients c_k. - SurdSum: factory SurdSum.rational(Rational r) - SurdSum: factory SurdSum.sqrtOf(Rational r) — √r for a rational r ≥ 0. - SurdSum: static final SurdSum zero - SurdSum: final Map terms — Squarefree radicand → coefficient. - SurdSum: bool get isZero - SurdSum: bool get isRational - SurdSum: int get hashCode - SurdSum: SurdSum scale(Rational r) - SurdSum: Rational toRational() - SurdSum: double toDouble() - SurdSum: String toString() - SurdSum: SurdSum operator +(SurdSum o) - SurdSum: SurdSum operator -() - SurdSum: SurdSum operator -(SurdSum o) - SurdSum: SurdSum operator *(SurdSum o) - SurdSum: bool operator ==(Object other) - final class CharacterTable — The character table of a finite group with exact cyclotomic values. - CharacterTable: factory CharacterTable.of(PermutationGroup g) — Computes the table of a (small) permutation group. - CharacterTable: final int groupOrder - CharacterTable: final List classes - CharacterTable: final List characters — Irreducible characters, the trivial one first, sorted by degree. - CharacterTable: int get classCount - CharacterTable: List get classSizes - CharacterTable: List get elementOrders - CharacterTable: List get degrees - CharacterTable: ClassFunction get permutationCharacter — The permutation character of the group's action (number of fixed points), useful for decomposition checks. - CharacterTable: int powerMap(int i, int k) — The class index of g^k for the representative of class i. - CharacterTable: Cyclotomic innerProduct(ClassFunction chi, ClassFunction psi) — ⟨χ, ψ⟩ = (1/|G|) Σ_classes |C| χ(g) conj(ψ(g)), exact. - CharacterTable: ClassFunction tensor(ClassFunction a, ClassFunction b) — Pointwise product (the character of the tensor product). - CharacterTable: List decompose(ClassFunction f) — Multiplicities of each irreducible in a class function (exact rationals; integers for characters). - CharacterTable: bool checkOrthogonality() — Whether ⟨χ_i, χ_j⟩ = δ_ij (first orthogonality) and Σ_χ χ(g_a) conj(χ(g_b)) = δ_ab |C_G(g_a)| (second). - CharacterTable: int frobeniusSchur(ClassFunction chi) — The Frobenius–Schur indicator (1/|G|) Σ χ(g²): 1 real, −1 quaternionic, 0 complex type. - CharacterTable: String toString() - final class FpGroup — A group ⟨x₁, …, x_m | r₁, …, r_k⟩. - FpGroup: FpGroup(this.generatorCount, List> relators, {List? names}) - FpGroup: factory FpGroup.parse(String generators, List relators) — Parses relators written with single-letter generator names and powers, e.g. - FpGroup: final int generatorCount - FpGroup: final List> relators - FpGroup: final List names - FpGroup: CosetTable enumerateCosets({List> subgroup = const >[], int maxCosets = 1000000}) — Enumerates the cosets of the subgroup generated by subgroup (words); throws StateError past maxCosets. - FpGroup: int order({int maxCosets = 1000000}) - FpGroup: PermutationGroup toPermutationGroup({List> subgroup = const >[], int maxCosets = 1000000}) — The permutation group of G acting on the cosets of subgroup (faithful for the trivial subgroup). - final class CosetTable — The result of coset enumeration: the action of each generator on the cosets 0 … index−1 (coset 0 = H). - CosetTable: final List> generatorActions — generatorActionsc = the coset c·x_i. - CosetTable: int get index - CosetTable: List get permutations - CosetTable: PermutationGroup get permutationGroup - abstract final class NamedGroups — Constructors for standard groups. - NamedGroups: static PermutationGroup cyclic(int n) — The cyclic group C_n acting regularly on n points. - NamedGroups: static PermutationGroup dihedral(int n) — The dihedral group D_n of order 2n (symmetries of the regular n-gon), n ≥ 3; D_1 ≅ C_2 and D_2 ≅ V_4. - NamedGroups: static PermutationGroup symmetric(int n) — The symmetric group S_n. - NamedGroups: static PermutationGroup alternating(int n) — The alternating group A_n, generated by the 3-cycles (0 1 k). - NamedGroups: static PermutationGroup kleinFour() — The Klein four-group V_4 = C_2 × C_2 acting regularly on 4 points. - NamedGroups: static PermutationGroup quaternion() — The quaternion group Q_8 = {±1, ±i, ±j, ±k} acting regularly on 8 points (Todd–Coxeter on ⟨i, j | i⁴, i²j⁻², j⁻¹iji⟩). - NamedGroups: static PermutationGroup dicyclic(int n) — The dicyclic group Dic_n of order 4n: ⟨a, x | a^(2n), x²a^(−n), x⁻¹axa⟩; generalised quaternion for n a power of 2. - NamedGroups: static PermutationGroup generalisedQuaternion(int order) — The generalised quaternion group of order order (a power of 2, ≥ 8). - NamedGroups: static PermutationGroup elementaryAbelian(int p, int k) — Elementary abelian group (C_p)^k acting regularly on p^k points. - NamedGroups: static PermutationGroup projectiveSpecialLinear2(int p) — PSL(2, p) for a prime p ≥ 5, acting on the projective line {0, …, p−1, ∞} (∞ = point p): z ↦ z+1 and z ↦ −1/z. |PSL(2,p)| = p(p²−1)/2; PSL(2,5) ≅ A_5, PSL(2,7) ≅ GL(3,2). - NamedGroups: static PermutationGroup mathieu11() — The Mathieu group M_11 (order 7920) on 11 points: ⟨(1,…,11), (3,7,11,8)(4,10,5,6)⟩. - NamedGroups: static PermutationGroup mathieu12() — The Mathieu group M_12 (order 95040) on 12 points: M_11's generators and (1,12)(2,11)(3,6)(4,8)(5,9)(7,10). - final class Permutation — A permutation of {0, …, degree−1}, immutable. - Permutation: factory Permutation(List images) — From the image list: imagesi is the image of i. - Permutation: factory Permutation.identity(int n) - Permutation: factory Permutation.cycles(int n, List> cycles) — From disjoint or overlapping cycles (composed left to right), e.g. - Permutation: factory Permutation.parse(String s, int n) — Parses 1-based cycle notation such as (1,2,3)(4,5) on n points (GAP / textbook style). - Permutation: int get degree - Permutation: List get images - Permutation: Permutation get inverse - Permutation: bool get isIdentity - Permutation: List> get cycles — Nontrivial cycles, each starting at its smallest point. - Permutation: List get cycleType — Cycle lengths including fixed points, sorted descending (the partition of n). - Permutation: int get order — Order: the lcm of the cycle lengths. - Permutation: int get sign — +1 for even, −1 for odd permutations. - Permutation: bool get isEven - Permutation: List get support — Points moved. - Permutation: int get firstMoved — The smallest moved point, or −1 for the identity. - Permutation: int get hashCode - Permutation: Permutation pow(int k) — P^k for any integer k. - Permutation: Permutation conjugateBy(Permutation x) — Conjugate x⁻¹ p x. - Permutation: Permutation commutator(Permutation q) — The commutator p⁻¹ q⁻¹ p q. - Permutation: Permutation extend(int n) — Same permutation on n ≥ degree points. - Permutation: String toString() — 1-based cycle notation, for the identity. - Permutation: int operator [](int x) — The image of x. - Permutation: Permutation operator *(Permutation o) — Left-to-right product: apply this, then o. - Permutation: bool operator ==(Object other) - final class StabiliserLevel — One level of a stabiliser chain: the base point, the strong generators fixing the earlier base points, and a transversal ub (an element mapping the base point to b) for the basic orbit. - StabiliserLevel: final int basePoint - StabiliserLevel: final List generators - StabiliserLevel: final Map transversal - StabiliserLevel: Iterable get orbit — The basic orbit of the base point under this level's stabiliser. - class PermutationGroup — A group generated by permutations of {0, …, degree−1}. - PermutationGroup: PermutationGroup(List generators, {int? degree}) - PermutationGroup: final int degree - PermutationGroup: final List generators - PermutationGroup: late final List chain - PermutationGroup: Permutation get identity - PermutationGroup: List get base — The base (β₁, …, β_k). - PermutationGroup: BigInt get order - PermutationGroup: List> get orbits — All orbits on {0, …, degree−1}. - PermutationGroup: bool get isTransitive - PermutationGroup: bool get isAbelian - PermutationGroup: Iterable get elements — Every element, as products u_k ⋯ u_1 of transversal elements. - PermutationGroup: bool contains(Permutation g) — Sifts g through the chain; the residue is the identity exactly when g ∈ G. - PermutationGroup: bool containsGroup(PermutationGroup other) — Whether every element of other is in this group. - PermutationGroup: List orbit(int point) — The orbit of a point. - PermutationGroup: Permutation random(math.Random rng) — A uniformly random element (one random transversal element per level). - PermutationGroup: PermutationGroup stabiliser(List points) — The pointwise stabiliser of points, by Schreier–Sims on a base starting with them. - PermutationGroup: List conjugacyClasses() — Conjugacy classes, by orbits of conjugation on the enumerated elements. - PermutationGroup: PermutationGroup directProduct(PermutationGroup h) — Direct product G × H acting on degree(G) + degree(H) points. - PermutationGroup: String toString() - final class ConjugacyClass — A conjugacy class of a finite permutation group. - ConjugacyClass: final Permutation representative - ConjugacyClass: final List members - ConjugacyClass: int get size - ConjugacyClass: String toString() - final class CayleyDickson — An element of the Cayley–Dickson algebra of dimension 2^level with exact rational coordinates on e_0 = 1, e_1, …. - CayleyDickson: factory CayleyDickson(List coords) — From coordinates (length a power of two). - CayleyDickson: factory CayleyDickson.ints(List coords) - CayleyDickson: factory CayleyDickson.unit(int level, int k) — The basis unit e_k of the algebra of the given level. - CayleyDickson: factory CayleyDickson.zero(int level) - CayleyDickson: static CayleyDickson quaternion(int w, int x, int y, int z) — Quaternions (level 2), octonions (3) and sedenions (4). - CayleyDickson: static CayleyDickson associator(CayleyDickson x, CayleyDickson y, CayleyDickson z) — The associator (xy)z − x(yz). - CayleyDickson: static CayleyDickson commutator(CayleyDickson x, CayleyDickson y) — The commutator xy − yx. - CayleyDickson: final int level - CayleyDickson: final List c - CayleyDickson: int get dimension - CayleyDickson: CayleyDickson get conjugate - CayleyDickson: Rational get normSquared — X x* = Σ c_k² (always a nonnegative rational). - CayleyDickson: CayleyDickson get inverse — X* / |x|² (a two-sided inverse up to the octonions; sedenions have zero divisors). - CayleyDickson: bool get isZero - CayleyDickson: int get hashCode - CayleyDickson: CayleyDickson scale(Rational r) - CayleyDickson: String toString() - CayleyDickson: CayleyDickson operator +(CayleyDickson o) - CayleyDickson: CayleyDickson operator -(CayleyDickson o) - CayleyDickson: CayleyDickson operator -() - CayleyDickson: CayleyDickson operator *(CayleyDickson o) - CayleyDickson: bool operator ==(Object other) - final class Quaternion — W + x i + y j + z k with i² = j² = k² = ijk = −1. - Quaternion: const Quaternion(this.w, [this.x = 0, this.y = 0, this.z = 0]) - Quaternion: factory Quaternion.axisAngle(double ax, double ay, double az, double theta) — The unit quaternion cos(θ/2) + sin(θ/2) n̂, which rotates vectors by θ about n under q v q*. - Quaternion: static const Quaternion one = Quaternion(1) - Quaternion: static const Quaternion i = Quaternion(0, 1) - Quaternion: static const Quaternion j = Quaternion(0, 0, 1) - Quaternion: static const Quaternion k = Quaternion(0, 0, 0, 1) - Quaternion: final double w - Quaternion: final double x - Quaternion: final double y - Quaternion: final double z - Quaternion: Quaternion get conjugate - Quaternion: double get normSquared - Quaternion: double get norm - Quaternion: Quaternion get inverse - Quaternion: Quaternion get normalized - Quaternion: int get hashCode - Quaternion: Quaternion scale(double s) - Quaternion: (double, double, double) rotate(double vx, double vy, double vz) — Q v q⁻¹ for the pure quaternion v = (vx, vy, vz): the rotation of v when q is a unit quaternion. - Quaternion: Quaternion exp() — E^q. - Quaternion: Quaternion log() — Principal logarithm. - Quaternion: Quaternion slerp(Quaternion to, double t) — Spherical linear interpolation between unit quaternions (shortest arc). - Quaternion: List> toRotationMatrix() — The 3×3 rotation matrix of a unit quaternion. - Quaternion: CMatrix toSu2() — The SU(2) matrix: i ↦ −iσ₁, j ↦ −iσ₂, k ↦ −iσ₃, so w + xi + yj + zk ↦ [w − iz, −y − ix, y − ix, w + iz]. - Quaternion: bool approxEquals(Quaternion o, [double tol = 1e-12]) - Quaternion: String toString() - Quaternion: Quaternion operator +(Quaternion o) - Quaternion: Quaternion operator -(Quaternion o) - Quaternion: Quaternion operator -() - Quaternion: Quaternion operator *(Quaternion o) — The Hamilton product. - Quaternion: Quaternion operator /(Quaternion o) - Quaternion: bool operator ==(Object other) - final class MatrixLieAlgebra — A Lie algebra spanned by linearly independent matrices, with bracket the commutator. - MatrixLieAlgebra: MatrixLieAlgebra(List basis) - MatrixLieAlgebra: final List basis - MatrixLieAlgebra: int get dimension - MatrixLieAlgebra: bool get isClosed — Closed under the bracket. - MatrixLieAlgebra: late final List>> structureConstants — c_abc with X_a, X_b = Σ_c c_abc X_c. - MatrixLieAlgebra: List>> get physicsStructureConstants — For a Hermitian basis T_a with T_a, T_b = i f_abc T_c, the real f_abc (= −i c_abc). - MatrixLieAlgebra: CMatrix get killingForm — The Killing form K_ab = Tr(ad X_a ad X_b). - MatrixLieAlgebra: double get jacobiDefect — Max |Σ_d (c_abd c_dce + c_bcd c_dae + c_cad c_dbe)| over all a, b, c, e (zero for a Lie algebra). - MatrixLieAlgebra: List coordinates(CMatrix y) — Coordinates of a matrix in the basis (least squares; exact when it lies in the span). - MatrixLieAlgebra: bool spans(CMatrix y, [double tol = 1e-10]) — Whether y lies in the span (residual below tol). - MatrixLieAlgebra: CMatrix adjoint(int a) — The adjoint matrix ad(X_a): (ad X_a)_cb = c_abc. - final class Irrep — The irreducible representation V(λ) of the simple Lie algebra with root system rootSystem. - Irrep: Irrep(this.rootSystem, this.highestWeight) - Irrep: factory Irrep.of(RootSystem rs, List labels) — V(λ) from Dynkin labels. - Irrep: final RootSystem rootSystem - Irrep: final Weight highestWeight - Irrep: BigInt get dimension — Weyl dimension formula Π_(α>0) (λ+ρ, α)/(ρ, α), exact. - Irrep: Rational get casimir — The quadratic Casimir (λ, λ + 2ρ) with long roots of length² 2. - Irrep: Rational get casimirPhysics — C₂ in the physics normalisation: j(j+1) for su(2), 4/3 for the quark triplet of su(3), N for the adjoint of su(N). - Irrep: Rational get dynkinIndex — The Dynkin index of the representation, normalised so the fundamental of su(n) has index 1/2: T(R) = dim(R) C₂(R) / dim(g). - Irrep: Irrep get dual — The dual (contragredient) representation, highest weight −w₀λ. - Irrep: Map get dominantWeights — Dominant weights with their multiplicities, from the highest weight downwards. - Irrep: Map get weights — Every weight with its multiplicity (the weight diagram). - Irrep: int multiplicity(Weight w) — The multiplicity of a weight (0 if absent). - Irrep: String toString() - final class Weight — A weight in Dynkin labels (coefficients on the fundamental weights), immutable with value equality. - Weight: factory Weight(List labels) - Weight: factory Weight.zero(int rank) - Weight: int get rank - Weight: List get labels - Weight: bool get isDominant - Weight: bool get isZero - Weight: int get hashCode - Weight: Weight times(int k) - Weight: String toString() - Weight: int operator [](int i) - Weight: Weight operator +(Weight o) - Weight: Weight operator -(Weight o) - Weight: Weight operator -() - Weight: bool operator ==(Object other) - enum LieFamily — The Cartan–Killing type of a simple Lie algebra. - LieFamily: a - LieFamily: b - LieFamily: c - LieFamily: d - LieFamily: e - LieFamily: f - LieFamily: g - final class RootSystem — A simple root system of type X_n. - RootSystem: factory RootSystem.a(int n) — A_n (su(n+1)), n ≥ 1. - RootSystem: factory RootSystem.b(int n) — B_n (so(2n+1)), n ≥ 2: α_n short. - RootSystem: factory RootSystem.c(int n) — C_n (sp(2n)), n ≥ 2 (C_2 ≅ B_2): α_n long. - RootSystem: factory RootSystem.d(int n) — D_n (so(2n)), n ≥ 3 (D_3 ≅ A_3): α_(n−2) joined to α_(n−1) and α_n. - RootSystem: factory RootSystem.e(int n) — E_6, E_7, E_8 (Bourbaki: 1–3–4–5–6–7–8 with 2 attached to 4). - RootSystem: factory RootSystem.f4() — F_4: α1–α2 ⇒ α3–α4 (α1, α2 long). - RootSystem: factory RootSystem.g2() — G_2: α1 short, α2 long. - RootSystem: factory RootSystem.parse(String type) — Parses A2, B3, E8, F4, G2, … - RootSystem: final LieFamily family - RootSystem: final int rank - RootSystem: final List> cartan — a_ij = ⟨α_i, α_j^∨⟩. - RootSystem: late final List halfLengths — (α_i, α_i)/2 for each simple root (1 for long roots). - RootSystem: late final List> rootForm — (α_i, α_j). - RootSystem: late final List> weightForm — (ω_i, ω_j): the quadratic form on weights in Dynkin labels. - RootSystem: late final List> positiveRootsSimple — Positive roots in simple-root coordinates, sorted by height (simple roots first). - RootSystem: late final List positiveRoots — Positive roots as weights (Dynkin labels). - RootSystem: String get name - RootSystem: int get dimension - RootSystem: Weight get rho — Ρ = half the sum of the positive roots = Σ ω_i. - RootSystem: Weight get highestRoot — The highest root θ (the highest weight of the adjoint representation). - RootSystem: List get exponents — The exponents m_i, from the heights of the positive roots (Kostant): the number of exponents equal to k is (#roots of height k) − (#roots of height k+1). - RootSystem: List get degrees — Degrees of the basic invariants, m_i + 1. - RootSystem: BigInt get weylGroupOrder - RootSystem: int get coxeterNumber — The Coxeter number h = height(θ) + 1. - RootSystem: int get dualCoxeterNumber — The dual Coxeter number h∨ = 1 + (θ, ρ) (long roots of length² 2). - RootSystem: List get longestElement — A reduced word for the longest element w₀ (it sends ρ to −ρ; length = number of positive roots). - RootSystem: Weight simpleRoot(int i) — The simple root α_i as a weight. - RootSystem: Weight fundamental(int i) — The fundamental weight ω_i. - RootSystem: Weight rootToWeight(List c) — A root in simple-root coordinates → Dynkin labels. - RootSystem: List weightToRootCoordinates(Weight w) — Dynkin labels → simple-root coordinates (rational in general). - RootSystem: Rational inner(Weight a, Weight b) — (λ, μ) for weights in Dynkin labels. - RootSystem: Weight reflect(Weight w, int i) — The simple reflection s_i: λ ↦ λ − λ_i α_i. - RootSystem: Weight applyWord(List word, Weight w) — Applies w = s_(i1) s_(i2) ⋯ s_(ik) (the rightmost reflection acts first). - RootSystem: (Weight, int) dominantConjugate(Weight w) — The dominant weight in the Weyl orbit of w and the parity (−1)^ℓ of the element used. - RootSystem: List orbit(Weight w) — The Weyl orbit of a weight. - RootSystem: List> weylGroupElements({int limit = 5000000}) — Every Weyl group element as a reduced word, by breadth-first search on the (free, regular) orbit of ρ; words come out in order of length. - RootSystem: int length(List word) — The length of an element given by any word (number of positive roots it sends negative), via its action on ρ. - RootSystem: Weight dual(Weight lambda) — The highest weight of the dual representation, −w₀λ. - RootSystem: String toString() - final class CMatrix — An immutable rows × cols complex matrix. - CMatrix: factory CMatrix(List> entries) — From nested rows of Complex. - CMatrix: factory CMatrix.real(List> entries) — From nested rows of real numbers. - CMatrix: factory CMatrix.generate(int rows, int cols, Complex Function(int i, int j) f) - CMatrix: factory CMatrix.zero(int rows, [int? cols]) - CMatrix: factory CMatrix.identity(int n) - CMatrix: factory CMatrix.diagonal(List d) - CMatrix: final int rows - CMatrix: final int cols - CMatrix: bool get isSquare - CMatrix: CMatrix get dagger — Conjugate transpose. - CMatrix: CMatrix get transpose - CMatrix: CMatrix get conjugate - CMatrix: Complex get trace - CMatrix: double get norm — Frobenius norm. - CMatrix: Complex get determinant — Determinant (Gaussian elimination with partial pivoting). - CMatrix: CMatrix get inverse — Inverse by Gauss–Jordan elimination. - CMatrix: Complex at(int i, int j) — Entry (i, j). - CMatrix: CMatrix scale(Complex s) - CMatrix: CMatrix scaleReal(double s) - CMatrix: CMatrix commutator(CMatrix o) — A, B = AB − BA. - CMatrix: CMatrix anticommutator(CMatrix o) — {A, B} = AB + BA. - CMatrix: CMatrix kron(CMatrix o) — Kronecker product A ⊗ B. - CMatrix: Complex inner(CMatrix o) — Frobenius inner product Tr(A† B). - CMatrix: double distance(CMatrix o) — Max-entry distance to o. - CMatrix: bool approxEquals(CMatrix o, [double tol = 1e-12]) - CMatrix: CMatrix exp() — The matrix exponential e^A (expm on complex128). - CMatrix: List> toList() - CMatrix: String toString() - CMatrix: Complex operator [](int k) - CMatrix: CMatrix operator +(CMatrix o) - CMatrix: CMatrix operator -(CMatrix o) - CMatrix: CMatrix operator -() - CMatrix: CMatrix operator *(CMatrix o) - final class QIMatrix — An immutable rows × cols matrix over Q(i). - QIMatrix: factory QIMatrix(List> entries) - QIMatrix: factory QIMatrix.ints(List> entries) — From integer entries (re, im) pairs or plain ints. - QIMatrix: factory QIMatrix.generate(int rows, int cols, GaussianRational Function(int i, int j) f) - QIMatrix: factory QIMatrix.zero(int rows, [int? cols]) - QIMatrix: factory QIMatrix.identity(int n) - QIMatrix: static QIMatrix block(QIMatrix a, QIMatrix b, QIMatrix c, QIMatrix d) — Block matrix [a, b, c, d]. - QIMatrix: final int rows - QIMatrix: final int cols - QIMatrix: QIMatrix get transpose - QIMatrix: QIMatrix get dagger - QIMatrix: QIMatrix get conjugate - QIMatrix: GaussianRational get trace - QIMatrix: bool get isZero - QIMatrix: bool get isReal - QIMatrix: bool get isImaginary - QIMatrix: GaussianRational? get scalarValue — Whether this is s·I for some scalar s (returned), else null. - QIMatrix: QIMatrix get inverse — Exact inverse (Gauss–Jordan over Q(i)). - QIMatrix: int get hashCode - QIMatrix: GaussianRational at(int i, int j) - QIMatrix: QIMatrix scale(GaussianRational s) - QIMatrix: QIMatrix scaleRational(Rational s) - QIMatrix: QIMatrix scaleInt(int k) - QIMatrix: QIMatrix commutator(QIMatrix o) - QIMatrix: QIMatrix anticommutator(QIMatrix o) - QIMatrix: QIMatrix kron(QIMatrix o) - QIMatrix: CMatrix toCMatrix() - QIMatrix: List apply(List v) — Applies to a numeric vector. - QIMatrix: String toString() - QIMatrix: QIMatrix operator +(QIMatrix o) - QIMatrix: QIMatrix operator -(QIMatrix o) - QIMatrix: QIMatrix operator -() - QIMatrix: QIMatrix operator *(QIMatrix o) - QIMatrix: bool operator ==(Object other) - final class PeriodicContinuedFraction — The eventually periodic continued fraction of a quadratic irrational. - PeriodicContinuedFraction: const PeriodicContinuedFraction(this.preperiod, this.period) - PeriodicContinuedFraction: final List preperiod — The terms before the period (for sqrt(n) just floor(sqrt n)). - PeriodicContinuedFraction: final List period — One full period. - PeriodicContinuedFraction: List take(int count) — The first count terms. - PeriodicContinuedFraction: String toString() - final class EcPoint — A point on an EllipticCurve over Q: affine (x, y) or the point at infinity. - EcPoint: const EcPoint(Rational this.x, Rational this.y) - EcPoint: const EcPoint.infinity() - EcPoint: factory EcPoint.ints(int x, int y) — (x, y) from ints. - EcPoint: final Rational? x - EcPoint: final Rational? y - EcPoint: final bool isInfinity - EcPoint: int get hashCode - EcPoint: String toString() - EcPoint: bool operator ==(Object other) - final class EllipticCurve — An elliptic curve y^2 + a1 xy + a3 y = x^3 + a2 x^2 + a4 x + a6 over Q, with exact arithmetic. - EllipticCurve: EllipticCurve(this.a1, this.a2, this.a3, this.a4, this.a6) - EllipticCurve: factory EllipticCurve.fromInts(List a) — From integer coefficients a1, a2, a3, a4, a6 (the Cremona/LMFDB ordering). - EllipticCurve: factory EllipticCurve.short(Rational a, Rational b) — The short Weierstrass curve y^2 = x^3 + a x + b. - EllipticCurve: final Rational a1 - EllipticCurve: final Rational a2 - EllipticCurve: final Rational a3 - EllipticCurve: final Rational a4 - EllipticCurve: final Rational a6 - EllipticCurve: late final Rational b2 - EllipticCurve: late final Rational b4 - EllipticCurve: late final Rational b6 - EllipticCurve: late final Rational b8 - EllipticCurve: late final Rational c4 - EllipticCurve: late final Rational c6 - EllipticCurve: late final Rational discriminant — The discriminant Δ = −b2²b8 − 8b4³ − 27b6² + 9b2b4b6. - EllipticCurve: Rational get jInvariant — The j-invariant c4³/Δ. - EllipticCurve: List get coefficients — The coefficients a1, a2, a3, a4, a6. - EllipticCurve: bool get isIntegral — Whether all a_i are integers. - EllipticCurve: List get badPrimes — The primes of bad reduction of this (integral) model: the primes dividing Δ. - EllipticCurve: bool get isSemistable — Whether the (minimal integral) model is semistable: no bad prime divides c4. - EllipticCurve: bool contains(EcPoint p) — Whether p is on the curve. - EllipticCurve: EcPoint negate(EcPoint p) — −P = (x, −y − a1 x − a3). - EllipticCurve: EcPoint add(EcPoint p, EcPoint q) — P + Q. - EllipticCurve: EcPoint double(EcPoint p) — 2P. - EllipticCurve: EcPoint multiply(EcPoint p, int k) — kP (negative k multiplies −P), by double-and-add. - EllipticCurve: (EllipticCurve, BigInt) integralModel() — An integral model: (E', u) with a_i' = u^i a_i integral, via (x, y) -> (u^2 x, u^3 y). u = 1 when the curve is already integral. - EllipticCurve: EllipticCurveFp reduce(BigInt p) — The reduction modulo the prime p (the model must be p-integral). - EllipticCurve: int ap(int p) — p + 1 − #Ẽ(F_p) for the reduction at the prime p, with the singular point counted when the reduction is bad. - EllipticCurve: List anList(int n) — The coefficients a_1..a_n of the L-series (index 0 unused, set to 0), from ap and the Hecke recursion a_{p^k} = a_p a_{p^{k−1}} − p a_{p^{k−2}} at good p (a_{p^k} = a_p^k at bad p). - EllipticCurve: bool isMinimalAt(BigInt p) — Whether the (integral) model is provably minimal at p: v_p(Δ) < 12 or v_p(c4) < 4. - EllipticCurve: BigInt conductor() — The conductor, for semistable curves only: the product of the primes of (multiplicative) bad reduction. - EllipticCurve: int torsionBound({int primes = 10}) — A multiple of the torsion order: gcd #E(F_p) over the first primes odd primes of good reduction. - EllipticCurve: List torsionPoints() — The rational torsion points (including O), by Nagell–Lutz on the integral model Y^2 = X^3 − 27c4 X − 54c6 and Mazur's bound (orders <= 12), mapped back to this model. - EllipticCurve: List torsionStructure() — The torsion subgroup's invariants: n for Z/n ([] when trivial), or 2, 2m for Z/2 × Z/2m. - EllipticCurve: String toString() - final class EcPointFp — A point on an EllipticCurveFp: affine (x, y) with coordinates in [0, p), or the point at infinity. - EcPointFp: const EcPointFp(BigInt this.x, BigInt this.y) - EcPointFp: const EcPointFp.infinity() - EcPointFp: final BigInt? x - EcPointFp: final BigInt? y - EcPointFp: final bool isInfinity - EcPointFp: int get hashCode - EcPointFp: String toString() - EcPointFp: bool operator ==(Object other) - final class EllipticCurveFp — An elliptic curve y^2 + a1 xy + a3 y = x^3 + a2 x^2 + a4 x + a6 over the prime field F_p. - EllipticCurveFp: EllipticCurveFp(BigInt a1, BigInt a2, BigInt a3, BigInt a4, BigInt a6, this.p, {bool allowSingular = false}) — Coefficients are reduced mod p; p is assumed prime. - EllipticCurveFp: factory EllipticCurveFp.fromInts(List a, int p, {bool allowSingular = false}) — From ints a1, a2, a3, a4, a6 and the prime p. - EllipticCurveFp: final BigInt a1 - EllipticCurveFp: final BigInt a2 - EllipticCurveFp: final BigInt a3 - EllipticCurveFp: final BigInt a4 - EllipticCurveFp: final BigInt a6 - EllipticCurveFp: final BigInt p - EllipticCurveFp: late final BigInt b2 - EllipticCurveFp: late final BigInt b4 - EllipticCurveFp: late final BigInt b6 - EllipticCurveFp: late final BigInt b8 - EllipticCurveFp: late final BigInt c4 - EllipticCurveFp: late final BigInt c6 - EllipticCurveFp: late final BigInt discriminant - EllipticCurveFp: bool get isSingular - EllipticCurveFp: BigInt get jInvariant — The j-invariant c4^3 / Δ in F_p. - EllipticCurveFp: bool contains(EcPointFp q) - EllipticCurveFp: EcPointFp negate(EcPointFp q) - EllipticCurveFp: EcPointFp add(EcPointFp q, EcPointFp r) - EllipticCurveFp: EcPointFp double(EcPointFp q) - EllipticCurveFp: EcPointFp multiply(EcPointFp q, BigInt k) — kQ by double-and-add. - EllipticCurveFp: List points() — Every point (O first), for small p. - EllipticCurveFp: BigInt countPoints() — #E(F_p) (affine solutions plus O; a singular point counts once), by the character sum p + 1 + Σ_x ((4x^3 + b2 x^2 + 2 b4 x + b6) / p) — O(p). - EllipticCurveFp: EcPointFp randomPoint(math.Random rnd) — A uniformly random affine point (p odd). - EllipticCurveFp: BigInt orderOf(EcPointFp q) — The order of the point q, by baby-step giant-step over the Hasse interval p+1−2√p, p+1+2√p and then removing prime factors. - EllipticCurveFp: BigInt groupOrder({int seed = 1}) — #E(F_p): naive below p = 1000, otherwise the unique multiple in the Hasse interval of the lcm of the orders of random points (Mestre-style baby-step giant-step without the twist). - EllipticCurveFp: BigInt trace() — The trace of Frobenius p + 1 − #E(F_p). - EllipticCurveFp: String toString() - final class NtComplex — A complex number in double precision (the numeric value of a character or an L-value). - NtComplex: const NtComplex(this.re, [this.im = 0]) - NtComplex: factory NtComplex.unitTurn(double t) — e^{2πi t}. - NtComplex: final double re - NtComplex: final double im - NtComplex: double get abs - NtComplex: NtComplex scale(double s) - NtComplex: String toString() - NtComplex: NtComplex operator +(NtComplex o) - NtComplex: NtComplex operator -(NtComplex o) - NtComplex: NtComplex operator *(NtComplex o) - final class RootOfUnity — The exact root of unity e^{2πi k / order}, 0 <= k < order, in lowest terms. - RootOfUnity: factory RootOfUnity(int k, int order) - RootOfUnity: final int k - RootOfUnity: final int order - RootOfUnity: bool get isOne - RootOfUnity: NtComplex get value - RootOfUnity: int get hashCode - RootOfUnity: RootOfUnity conjugate() - RootOfUnity: String toString() - RootOfUnity: RootOfUnity operator *(RootOfUnity o) - RootOfUnity: bool operator ==(Object other) - final class DirichletGroup — The group of Dirichlet characters modulo n: all φ(n) characters, built from the structure of (Z/n)^×. - DirichletGroup: DirichletGroup(this.modulus) - DirichletGroup: final int modulus - DirichletGroup: List get factorOrders — The orders of the cyclic factors of (Z/n)^× (their product is φ(n)). - DirichletGroup: List get characters — All φ(n) characters; the principal character first. - DirichletGroup: DirichletCharacter character(List indices) — The character with exponent indicesj on the j-th cyclic factor: χ(g_j) = e^{2πi indicesj / ord_j}. - final class DirichletCharacter — A Dirichlet character modulo modulus with exact values e^{2πi e(a) / order} (0 off the units). - DirichletCharacter: factory DirichletCharacter.kronecker(int d) — The real character a ↦ (d / a) (Kronecker symbol) for a discriminant-like d ≡ 0, 1 (mod 4), d != 0, of modulus |d|. kronecker(-4) is χ_{−4}, the character of Q(i). - DirichletCharacter: factory DirichletCharacter.principal(int n) — The principal character modulo n. - DirichletCharacter: final int modulus - DirichletCharacter: final int order — The order of χ in the character group. - DirichletCharacter: bool get isPrincipal - DirichletCharacter: bool get isEven — Χ(−1) = 1. - DirichletCharacter: bool get isReal - DirichletCharacter: int get conductor — The conductor: the least d | modulus such that χ(a) = 1 whenever a ≡ 1 (mod d) and gcd(a, modulus) = 1. - DirichletCharacter: bool get isPrimitive - DirichletCharacter: RootOfUnity? call(int a) — Χ(a) exactly, or null when gcd(a, modulus) > 1. - DirichletCharacter: NtComplex value(int a) — Χ(a) as a complex number (0 off the units). - DirichletCharacter: DirichletCharacter primitive() — The primitive character inducing χ (of modulus conductor). - DirichletCharacter: DirichletCharacter conjugate() - DirichletCharacter: NtComplex gaussSum() — The Gauss sum τ(χ) = Σ_a χ(a) e^{2πi a / modulus}. - DirichletCharacter: NtComplex lValue(double s) — L(s, χ) = Σ χ(n) n^{−s} for real s (analytically continued, s != 1 for the principal character), via L(s, χ) = q^{−s} Σ_{a=1}^{q} χ(a) ζ(s, a/q) and, at s = 1, L(1, χ) = −(1/q) Σ χ(a) ψ(a/q). - DirichletCharacter: String toString() - DirichletCharacter: DirichletCharacter operator *(DirichletCharacter o) - final class EllipticLSeries — The L-series of an elliptic curve over Q at s = 1, from its a_n and a conductor. - EllipticLSeries: EllipticLSeries(this.curve, {BigInt? conductor}) — conductor defaults to EllipticCurve.conductor (semistable curves only). - EllipticLSeries: final EllipticCurve curve - EllipticLSeries: final BigInt conductor - EllipticLSeries: late final List an — a_0.. a_terms (index 0 unused). - EllipticLSeries: late final int rootNumber — The root number w = ±1 (the sign of the functional equation), determined numerically. - EllipticLSeries: double functionalEquationResidual() — The residual of the functional equation |F(t1) − F(t2)| for the chosen root number (≈ 1e-16 when the conductor and coefficients are right). - EllipticLSeries: double valueAt1() — L(E, 1) (0 when the root number is −1). - EllipticLSeries: double derivativeAt1() — L'(E, 1) when the root number is −1 (odd analytic rank); throws otherwise. - EllipticLSeries: double partialEulerProduct(double s, int bound) — The partial Euler product ∏_{p <= bound} L_p(s)^{-1}-style truncation of L(E, s) for real s (converges for s > 3/2): good p contribute (1 − a_p p^{−s} + p^{1−2s})^{−1}, bad p (1 − a_p p^{−s})^{−1}. - final class QSeries — A power series Σ_{n < precision} (coefficientsn / denominator) q^n, truncated at O(q^precision). - QSeries: factory QSeries(List coefficients, [BigInt? denominator]) — coefficients are the numerators of q^0.. q^(precision−1). - QSeries: factory QSeries.ints(List c) — From int coefficients. - QSeries: factory QSeries.rationals(List c) — From exact rationals. - QSeries: factory QSeries.constant(BigInt c, int precision) — The constant c + O(q^precision). - QSeries: final List coefficients - QSeries: final BigInt denominator - QSeries: int get precision — The number of known coefficients: the series is known modulo q^precision. - QSeries: bool get isIntegral - QSeries: List get rationalCoefficients — The coefficients as exact rationals. - QSeries: int get hashCode - QSeries: BigInt integerCoefficient(int n) — The coefficient of q^n (the series must be integral). - QSeries: QSeries truncate(int precision) - QSeries: QSeries scale(Rational r) — Multiplication by the rational r. - QSeries: QSeries scaleInt(int k) — Multiplication by the integer k. - QSeries: QSeries pow(int k) — this^k for k >= 0 (repeated squaring). - QSeries: QSeries shift(int s) — q^s · this, with s >= 0 (precision grows by s), or dropping the first -s coefficients for s < 0 (they must be 0). - QSeries: QSeries substitutePower(int m, [int? precision]) — f(q^m). - QSeries: bool agreesWith(QSeries o) — Equality of the first min(precision, o.precision) coefficients. - QSeries: String toString() - QSeries: Rational operator [](int n) — The coefficient of q^n as a Rational. - QSeries: QSeries operator +(QSeries o) - QSeries: QSeries operator -() - QSeries: QSeries operator -(QSeries o) - QSeries: QSeries operator *(QSeries o) — The Cauchy product, truncated at the smaller precision. - QSeries: bool operator ==(Object other) ### Rational trigonometry (riptide_rational_geometry) import 'package:riptide_rational_geometry/riptide_rational_geometry.ray'; Quadrance and spread instead of distance and angle, over the rationals and finite fields: the five main laws, conics, exact rotations, projective and universal hyperbolic geometry, chromogeometry and exact geometric predicates. https://riptidecompute.com/raya/docs/rational-geometry - double ulp(double x) — The unit in the last place of x: the spacing of doubles at |x|, 2^(e − 52) for a normal |x| in [2^e, 2^(e+1)) and 2⁻¹⁰⁷⁴ for zero and subnormals. ulp(1.0) is 2⁻⁵². - Vec? unitCirclePoint(ScalarField f, T t) — The point ((1 − t²)/(1 + t²), 2t/(1 + t²)) of the blue unit circle x² + y² = 1, exact in f; the rational replacement for (cos θ, sin θ), with t classically tan(θ/2). - Vec? redUnitCirclePoint(ScalarField f, T t) — The point ((1 + t²)/(1 − t²), 2t/(1 − t²)) of the red unit circle x² − y² = 1 (a rectangular hyperbola), exact in - Vec? greenUnitCirclePoint(ScalarField f, T t) — The point (t, 1/(2t)) of the green unit circle 2xy = 1, exact in f. - int nonSquareMod(PrimeField f) — The smallest n ≥ 2 that is not a square in ℤ/p (a quadratic non-residue), so that QuadraticExtension(f, nonSquareMod(f)) is the field F_{p²} with p² elements. - Rational rat(Object n, [int d = 1]) — The rational n/d, a shorthand for tests and examples: rat(3, 4) is 3/4 and rat(5) is 5. - Quad goldenRatio(RealQuadraticField q5) — The golden ratio φ = (1 + √5)/2 as an exact element of q5, which must be ℚ(√5) (RealQuadraticField.of(5)); any other d throws ArgumentError. φ² = φ + 1 holds exactly, and the spreads of the regular pentagon lie in ℚ(√5). - List octahedralGroup({bool properOnly = false}) — The 48 signed permutation matrices: the full octahedral group O_h, the point group of the cubic lattices. - T quadrupleQuad(ScalarField f, T a, T b, T c, T d) — The quadruple quad residual ((a + b + c + d)² − 2(a² + b² + c² + d²))² − 64abcd over f: zero when a, b, c, d are the quadrances Q(A₁A₂), Q(A₂A₃), Q(A₃A₄), Q(A₁A₄) of four collinear points (Wildberger, Divine… - T ptolemy(ScalarField f, T q12, T q13, T q14, T q23, T q24, T q34) — Ptolemy's theorem in rational form: four points A₁…A₄ lie on a circle (or a line) ⇔ A(Q₁₂Q₃₄, Q₁₃Q₂₄, Q₁₄Q₂₃) = 0, with A Archimedes' function RtPlane.archimedes and Qᵢⱼ = Q(AᵢAⱼ). - T brahmagupta(ScalarField f, T quadrea, T q1, T q2, T q3, T q4) — Brahmagupta's formula without square roots: a cyclic quadrilateral with consecutive side quadrances Q₁…Q₄ and quadrea 𝒜 (= 16·area²) satisfies (𝒜 + (Q₁ + Q₂ − Q₃ − Q₄)² − 4Q₁Q₂ − 4Q₃Q₄)² = 64Q₁Q₂Q₃Q₄. - T quadrilateralQuadrea(ScalarField f, T q1, T q2, T q3, T q4, T p, T r) — The quadrea of any quadrilateral A₁A₂A₃A₄ from its consecutive side quadrances Q₁…Q₄ and its diagonal quadrances P = Q(A₁A₃), R = Q(A₂A₄): 4PR − (Q₁ − Q₂ + Q₃ − Q₄)² (Bretschneider's formula with every root removed). - Vec qv(List xs) — A vector over Q from ints, BigInts, Rationals or strings like '3/4', e.g. qv(1, '1/2', -3). - Vec fv(PrimeField f, List xs) — A vector over ℤ/p from ints, reduced mod p: fv(PrimeField(7), 9, -1) is 2, 6. - T det(List> vs) — The determinant of the square matrix whose rows are the vectors vs. - T lineSpread(SymmetricForm form, Line l, Line m) — The spread between the lines l and m in the planar metric form: 0 for parallel lines, 1 for perpendicular ones. - List> regularPolygon(ScalarField f, T c, T s, int n) — The n points R^k (1, 0), k = 0 … n − 1, over the field f, where R is the rotation with cosine c and sine s. - RigidMotion composeReflections(SymmetricForm form, List> rs) — The single rigid motion of form equal to the reflections rs applied in order, the first in the list first. - Mat rotation2(ScalarField f, T a, T b) — The blue (Euclidean) planar rotation [a, −b, b, a] for the point (a, b) of the unit circle: it turns (1, 0) to (a, b), counterclockwise for b > 0. - (BigInt, BigInt, BigInt) pythagoreanTriple(BigInt m, BigInt n) — The Pythagorean triple (m² − n², 2mn, m² + n²) of Euclid's formula: (m² − n²)² + (2mn)² = (m² + n²)². - Mat rotationFromTriple(int m, int n) — The exact rotation over Q of the triple from (m, n) (see pythagoreanTriple): rotation2 with a = (m² − n²)/(m² + n²) and b = 2mn/(m² + n²) (classically cos θ and sin θ). - (BigInt, BigInt, BigInt, BigInt) pythagoreanQuadruple(BigInt a, BigInt b, BigInt c, BigInt d) — The Pythagorean quadruple (a² + b² − c² − d², 2(ad + bc), 2(bd − ac), a² + b² + c² + d²) from the quaternion a + bi + cj + dk: the first three entries square-sum to the square of the last. - Vec? spherePoint(ScalarField f, T s, T t) — The point of the blue unit sphere x² + y² + z² = 1 by inverse stereographic projection from the north pole: (2s, 2t, s² + t² − 1)/(s² + t² + 1), with coordinates in f whenever s and t are. - T crossRatio(Vec a, Vec b, Vec c, Vec d) — It is a projective invariant: every ProjectiveMap keeps it, exactly. - const double unitRoundoff = 1.1102230246251565e-16 — 2⁻⁵³ ≈ 1.11 × 10⁻¹⁶, the unit roundoff of binary64: one correctly rounded operation has relative error at most this. - const OrderedRationals Q = OrderedRationals() — ℚ with its order, the default field of this package: exact rational arithmetic with exact signs. - final class Bounded — A double together with a proven bound on how far it is from the exact value: |exact − value| ≤ error. - Bounded: const Bounded(this.value, this.error) — The approximation value with absolute error at most error. - Bounded: final double value — The double approximation, and the bound on its absolute error. - Bounded: final double error — The double approximation, and the bound on its absolute error. - Bounded: bool contains(double x) — Whether x lies in the interval value − error, value + error, so it could be the exact value. - Bounded: String toString() - abstract final class FloatBoundary — The conversions across the float boundary: exact values out to doubles with error bounds (value, distance, angle, rapidity, vector, vector32) and measured doubles in to exact rationals (capture, bestRational,… - FloatBoundary: static Bounded value(Rational r) — The rational r as the nearest double, with error ≤ ½ ulp of the result. - FloatBoundary: static Bounded distance(Rational quadrance) — The distance √Q for a quadrance Q, as a double. - FloatBoundary: static Bounded angle(Rational spread) — The angle θ ∈ 0, π/2 in radians of a blue spread s = sin²θ (a spread does not tell an angle from its supplement, so this is the acute one). - FloatBoundary: static Bounded rapidity(Rational redSpread) — The rapidity |Δη| of a red spread s = −sinh²(Δη) ≤ 0 between timelike directions: asinh(√(−s)), with relative error ≤ 4·2⁻⁵³ (the log-based asinh assumed ≤ 2 ulp); the reported bound is 8·2⁻⁵³·|Δη| + 2 ulp. - FloatBoundary: static (Float64List, double) vector(Vec v) — The rational vector v as doubles, each coordinate rounded to nearest, and one bound valid for every coordinate: the largest ½ ulp among them. - FloatBoundary: static (Float32List, double) vector32(Vec v) — The rational vector v as float32 for the GPU, with one error bound valid for every coordinate. - FloatBoundary: static Rational capture(double x) — A measured double captured exactly as the dyadic rational it is: capture(0.1) is 3602879701896397/2⁵⁵, not 1/10. - FloatBoundary: static Rational bestRational(double x, int maxDenominator) — The best rational approximation p/q of x with 1 ≤ q ≤ maxDenominator, from the continued fraction of x with the best semiconvergent: bestRational(π, 1000) is 355/113. - FloatBoundary: static (Vec, Bounded) rationalRotationNear(double theta, int maxDenominator) — An exact rational rotation near a measured angle theta (radians, |θ| < π): t ≈ tan(θ/2) with denominator ≤ maxDenominator (by bestRational), then the point ((1 − t²)/(1 + t²), 2t/(1 + t²)), which is exactly on the unit… - FloatBoundary: static (RtQuaternion, double) rationalQuaternionNear(double w, double x, double y, double z, int bits) — An exact rational rotation near a measured unit quaternion (w, x, y, z): each coordinate is rounded to the nearest multiple of 2^−bits. - enum Colour — The three colours of chromogeometry: blue (Euclidean, x² + y²), red (x² − y²) and green (2xy). - Colour: blue — Euclidean geometry, Q_b = x² + y². - Colour: red — Minkowski geometry with null lines along the diagonals, Q_r = x² − y². - Colour: green — Minkowski geometry with null lines along the axes, Q_g = 2xy. - final class Chromogeometry — The three geometries of the plane over a field, side by side: one SymmetricForm per Colour, and the identities that tie them together. - Chromogeometry: Chromogeometry(this.field) — The blue, red and green forms over field. - Chromogeometry: final ScalarField field — The field the points live in. - Chromogeometry: final SymmetricForm blue — The forms Q_b = x² + y², Q_r = x² − y² and Q_g = 2xy. - Chromogeometry: final SymmetricForm red — The forms Q_b = x² + y², Q_r = x² − y² and Q_g = 2xy. - Chromogeometry: final SymmetricForm green — The forms Q_b = x² + y², Q_r = x² − y² and Q_g = 2xy. - Chromogeometry: SymmetricForm form(Colour c) — The form of the colour c. - Chromogeometry: (T, T, T) quadrances(Vec v) — The three quadrances (Q_b, Q_r, Q_g) of the vector v. - Chromogeometry: T pythagoreanResidual(Vec v) — Q_b² − Q_r² − Q_g² for the vector v: zero for every vector, since (x² + y²)² = (x² − y²)² + (2xy)². - Chromogeometry: T spreadResidual(Vec u, Vec v) — 1/s_b + 1/s_r + 1/s_g − 2 for the lines with directions u and v: zero whenever it is defined. - Chromogeometry: Vec? circumcentre(Colour c, Vec a, Vec b, Vec d) — The circumcentre of the triangle a, b, d in the colour c (Centres.circumcentre); null for collinear vertices. - Chromogeometry: Vec? orthocentre(Colour c, Vec a, Vec b, Vec d) — The orthocentre of the triangle a, b, d in the colour c (Centres.orthocentre); null for collinear vertices. - final class RedSpacetime — Special relativity in one space dimension as red geometry, exactly. - RedSpacetime: RedSpacetime(this.field) — Spacetime over field, with the red form as its metric. - RedSpacetime: final ScalarField field — The field coordinates and velocities live in. - RedSpacetime: final SymmetricForm form — The red form Q_r(t, x) = t² − x². - RedSpacetime: Vec event(T t, T x) — The event at time t and position x. - RedSpacetime: T interval(Vec a, Vec b) — Q_r(A, B) = Δt² − Δx², the squared proper time between the events a and b: positive for timelike, zero for lightlike, negative for spacelike separation. - RedSpacetime: Mat? boost(T t) — The boost with parameter t (rapidity η = 2 artanh t): [γ, γv, γv, γ] with γ = (1 + t²)/(1 − t²), γv = 2t/(1 − t²), acting on events (t, x); its velocity is velocityOfParameter of t. - RedSpacetime: T velocityOfParameter(T t) — The velocity v = 2t/(1 + t²) of the boost with parameter t. - RedSpacetime: T? parameterOfVelocity(T v) — The parameter t = v/(1 + √(1 − v²)) of the velocity v, so that velocityOfParameter of t is v. - RedSpacetime: T addVelocities(T u, T v) — Relativistic velocity addition (u + v)/(1 + uv): rational for rational velocities. - RedSpacetime: T spread(Vec u, Vec w) — The red spread between two worldlines with directions u, w: s_r = 1 − B_r(u, w)²/(Q_r(u)Q_r(w)), which is −sinh²(Δη) for timelike directions with rapidity difference Δη (the classical view). - RedSpacetime: T gammaSquared(T v) — Γ² = 1/(1 − v²): the squared time dilation for the velocity v, rational for every rational v (γ itself needs a square root). - final class Conic — The conic a x² + b xy + c y² + d x + e y + f = 0 over a field: an ellipse, parabola, hyperbola, or a degenerate pair of lines or point. - Conic: Conic(this.field, this.a, this.b, this.c, this.d, this.e, this.f) — The conic a x² + b xy + c y² + d x + e y + f = 0 over field. - Conic: factory Conic.circle(SymmetricForm form, Vec centre, T k) — The circle of quadrance k about centre in the planar metric form: the points X with B(X − C, X − C) = K. - Conic: final ScalarField field — The field the coefficients live in. - Conic: final T a — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: final T b — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: final T c — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: final T d — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: final T e — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: final T f — The coefficients of a x² + b xy + c y² + d x + e y + f = 0. - Conic: Mat get matrix — The symmetric 3 × 3 matrix M of the projective conic xᵀ M x = 0 with x = (x, y, 1): [a, b/2, d/2, b/2, c, e/2, d/2, e/2, f]. - Conic: bool get isDegenerate — Whether the conic is degenerate (a pair of lines, a double line, a point or empty over the field): det M = 0. - Conic: T get discriminant — The discriminant b² − 4ac. - Conic: T evaluate(Vec p) — The value a x² + b xy + c y² + d x + e y + f at the point p: zero exactly on the conic. - Conic: bool contains(Vec p) — Whether the point p lies on the conic. - Conic: T quadraticPart(Vec u) — The quadratic part a u² + b uv + c v² at the direction u = (u, v). - Conic: Vec gradient(Vec p) — The gradient (2ax + by + d, bx + 2cy + e) of the conic's polynomial at p: a normal to the tangent when p is on the conic, and zero at a singular point. - Conic: Vec? secondMeet(Vec p, Vec u) — The second point where the line through p with direction u meets the conic, for p on the conic. - Conic: ({Vec? Function(T t) at, Vec? atInfinity}) parametrize(Vec p) — The rational parametrisation through the point p on the conic: at(t) is the secondMeet with the line of slope t, direction (1, t), and atInfinity the one with the vertical direction (t = ∞). - Conic: Line tangentAt(Vec p) — The tangent line at the point p on the conic: the line through p normal to the gradient. - Conic: Line polar(Vec p) — The polar line of the point p: the line with coefficients M (p, 1), and the tangent at p when p is on the conic. - Conic: String toString() — Conic(a, b, c, d, e, f) with the coefficients formatted by the field. - enum ModuleKind — A space-filling module shape: its connector points relative to its centre (face centres; a neighbour docked on connector c sits at centre + 2c). - ModuleKind: cube — A cube on ℤ³: 6 connectors (±1, 0, 0) and permutations. - ModuleKind: rhombicDodecahedron — A rhombic dodecahedron on the face-centred cubic lattice (the octet truss): 12 connectors, the permutations of (±1, ±1, 0). - ModuleKind: truncatedOctahedron — A truncated octahedron on the body-centred cubic lattice: 14 connectors, 8 hexagon ones (±1, ±1, ±1) followed by 6 square ones (±2, 0, 0) and permutations. - ModuleKind: List get connectors — The connector points relative to the centre, in a fixed order (connector i is connectorsi); a new list each call. - ModuleKind: CubicLattice get lattice — The lattice the module centres occupy (in the doubled coordinates used here). - ModuleKind: int get contactQuadrance — The smallest quadrance between centres of two non-overlapping modules (two neighbours sharing a face): 4 for the cube, 8 for the rhombic dodecahedron, 12 for the truncated octahedron. - ModuleKind: Set get axisSpreads — The distinct exact spreads between connector axes, including 0 for a connector with itself: {0, 1} for the cube, {0, 3/4, 1} for the rhombic dodecahedron, {0, 2/3, 8/9, 1} for the truncated octahedron. - final class Module — A module placed at an integer centre with a lattice rotation. - Module: Module(this.kind, this.centre, [this.orientation = IMat3.identity]) — A module of kind centred at centre, turned by orientation (default: no rotation). - Module: final ModuleKind kind — The module's shape. - Module: final IVec3 centre — The centre, in the doubled integer coordinates of ModuleKind.connectors. - Module: final IMat3 orientation — The rotation from the shape's own frame to the world frame. - Module: int get connectorCount — The number of connectors: 6, 12 or 14. - Module: IVec3 direction(int i) — The world direction of connector i: its offset from the centre after rotation, exactly. - Module: IVec3 connectorPoint(int i) — The world point of connector i: centre + direction. - Module: int connectorAlong(IVec3 worldDirection) — The index of the connector of this module whose world direction equals worldDirection exactly, or −1 if none does. - abstract final class Docking — Docking and collision, all exact integer tests. - Docking: static bool canDock(Module a, int i, Module b, int j) — Whether connector i of a mates connector j of b: same world point and opposite directions. - Docking: static Module? dockOnto(Module a, int i, ModuleKind kind, int j, IMat3 orientation) — The module of kind with orientation placed so that its connector j mates connector i of a; null when the two connectors cannot face each other under that orientation (directions not exactly opposite). - Docking: static bool overlap(Module a, Module b) — Whether two modules of the same kind overlap: the quadrance between their centres is below the contact quadrance of a's kind (equal centres included). - final class Assembly — A set of placed modules with exact consistency checks. - Assembly: final List modules — The placed modules in the order they were added. - Assembly: bool add(Module m) — Adds m unless it collides with an existing module, and returns whether it was added. - Assembly: List<(int, int, int, int)> matedPairs() — Every pair of mated connectors, as records (a, i, b, j) meaning connector i of modulesa mates connector j of modulesb, with a < b. - final class FastTriangle — The three quadrances, three spreads and the quadrea of a planar triangle with rational vertices, in the blue (Euclidean) metric, computed in integers over a common denominator. - FastTriangle: factory FastTriangle(Vec a1, Vec a2, Vec a3) — The measures of the triangle with vertices a1, a2, a3, given as 2-D rational vectors (only the first two coordinates are read). - FastTriangle: final Rational q1 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational q2 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational q3 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational s1 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational s2 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational s3 — The quadrances Q₁ = Q(A₂, A₃), Q₂ = Q(A₁, A₃), Q₃ = Q(A₁, A₂), each the squared side length opposite the vertex of the same index, and the spreads s₁, s₂, s₃ at A₁, A₂, A₃ (sin² of the angle there, in 0, 1). - FastTriangle: final Rational quadrea — The quadrea 𝒜 = 16·area² of the triangle, computed as 4w²/L⁴ (w the integer wedge, L the common denominator); it also equals Archimedes' (Q₁ + Q₂ + Q₃)² − 2(Q₁² + Q₂² + Q₃²). - extension FieldOps on ScalarField — Derived operations available on every ScalarField: inverse, square, integer powers, sums and printing. - FieldOps: T inv(T a) — The multiplicative inverse 1/a, computed as div(one, a). - FieldOps: T square(T a) — A², the element a times itself. - FieldOps: T pow(T a, int k) — Aᵏ for any integer k, by repeated squaring (O(log |k|) multiplications). a⁰ is one (also for a = 0). - FieldOps: T sum(Iterable xs) — The sum of xs, exactly; zero for an empty iterable. - FieldOps: String format(T a) — A readable form of the element a: 1 + 3√2 for an element of a QuadraticExtension, otherwise the element's own toString (1/3 over Q). - abstract interface class OrderedField implements ScalarField — A field with an exact order: ℚ (Q), ℚ(√d) for d > 0 (RealQuadraticField) and the real algebraic numbers (OrderedAlgebraic). - OrderedField: int sign(T a) — The exact sign of a: −1 when a < 0, 0 when a = 0, +1 when a > 0. - OrderedField: double toDouble(T a) — a as a double, for leaving exact arithmetic (rendering, display). - extension OrderedOps on OrderedField — Comparison on an OrderedField. - OrderedOps: int compare(T a, T b) — The exact sign of a − b: −1 when a < b, 0 when equal, +1 when a > b (the compareTo convention, so it can be passed to List.sort as (a, b) => field.compare(a, b)). - final class OrderedRationals implements OrderedField — ℚ with its order: riptide_algebra's RationalField plus sign and toDouble. - OrderedRationals: const OrderedRationals() — The ordered rationals; the same field as Q. - OrderedRationals: Rational get zero - OrderedRationals: Rational get one - OrderedRationals: int get characteristic - OrderedRationals: Rational fromInt(int n) - OrderedRationals: Rational fromRational(Rational r) - OrderedRationals: Rational add(Rational a, Rational b) - OrderedRationals: Rational sub(Rational a, Rational b) - OrderedRationals: Rational mul(Rational a, Rational b) - OrderedRationals: Rational div(Rational a, Rational b) - OrderedRationals: Rational neg(Rational a) - OrderedRationals: bool isZero(Rational a) - OrderedRationals: bool equals(Rational a, Rational b) - OrderedRationals: Rational? sqrt(Rational a) - OrderedRationals: int sign(Rational a) - OrderedRationals: double toDouble(Rational a) - OrderedRationals: String toString() - final class OrderedAlgebraic implements OrderedField — The real algebraic numbers with their order (riptide_algebra's AlgebraicField plus sign): every real root exists, so the regular pentagon and every constructible figure have exact coordinates. - OrderedAlgebraic: const OrderedAlgebraic() — The ordered real algebraic numbers. - OrderedAlgebraic: AlgebraicNumber get zero - OrderedAlgebraic: AlgebraicNumber get one - OrderedAlgebraic: int get characteristic - OrderedAlgebraic: AlgebraicNumber fromInt(int n) - OrderedAlgebraic: AlgebraicNumber fromRational(Rational r) - OrderedAlgebraic: AlgebraicNumber add(AlgebraicNumber a, AlgebraicNumber b) - OrderedAlgebraic: AlgebraicNumber sub(AlgebraicNumber a, AlgebraicNumber b) - OrderedAlgebraic: AlgebraicNumber mul(AlgebraicNumber a, AlgebraicNumber b) - OrderedAlgebraic: AlgebraicNumber div(AlgebraicNumber a, AlgebraicNumber b) - OrderedAlgebraic: AlgebraicNumber neg(AlgebraicNumber a) - OrderedAlgebraic: bool isZero(AlgebraicNumber a) - OrderedAlgebraic: bool equals(AlgebraicNumber a, AlgebraicNumber b) - OrderedAlgebraic: AlgebraicNumber? sqrt(AlgebraicNumber a) - OrderedAlgebraic: int sign(AlgebraicNumber a) - OrderedAlgebraic: double toDouble(AlgebraicNumber a) - OrderedAlgebraic: String toString() - final class Quad — The element a + b√d of a QuadraticExtension; d belongs to the field, not the element, so print it with the field's format (1 + 3√2). - Quad: const Quad(this.a, this.b) — The element a + b√d. - Quad: final T a — The rational part a and the coefficient b of √d, both in the base field. - Quad: final T b — The rational part a and the coefficient b of √d, both in the base field. - Quad: int get hashCode - Quad: String toString() - Quad: bool operator ==(Object other) - class QuadraticExtension implements ScalarField> — The quadratic extension F(√d) of the field base, where d is not a square in base: ℚ(√2), ℚ(√5) (golden ratio), ℚ(√−1) (Gaussian rationals), F_{p²} = ℤ/p(√n) with n from nonSquareMod. - QuadraticExtension: QuadraticExtension(this.base, this.d) — F(√d) over base. - QuadraticExtension: final ScalarField base — The field F that is extended. - QuadraticExtension: final T d — The non-square d whose root is adjoined. - QuadraticExtension: Quad get root — The generator √d. - QuadraticExtension: Quad get zero - QuadraticExtension: Quad get one - QuadraticExtension: int get characteristic - QuadraticExtension: Quad of(T x) — The base-field element x as the element x + 0√d. - QuadraticExtension: Quad make(T x, T y) — The element x + y√d. - QuadraticExtension: Quad conjugate(Quad x) — The conjugate a − b√d. - QuadraticExtension: T norm(Quad x) — The norm a² − d b² of x = a + b√d, the product x·x̄ with its conjugate; it lies in the base field and is zero only for x = 0. - QuadraticExtension: Quad add(Quad x, Quad y) - QuadraticExtension: Quad sub(Quad x, Quad y) - QuadraticExtension: Quad mul(Quad x, Quad y) - QuadraticExtension: Quad neg(Quad x) - QuadraticExtension: Quad inv(Quad x) — The inverse 1/x = x̄ / N(x): the conjugate divided by the norm. - QuadraticExtension: bool isZero(Quad x) - QuadraticExtension: bool equals(Quad a, Quad b) - QuadraticExtension: Quad fromInt(int n) - QuadraticExtension: Quad fromRational(Rational r) - QuadraticExtension: Quad div(Quad a, Quad b) - QuadraticExtension: Quad? sqrt(Quad x) — A square root u + v√d of x = a + b√d inside this field, or null when x is not a square here. - QuadraticExtension: String formatQuad(Quad a) — A readable form of a: 1 + 3√2, 3√2 when the rational part is zero, and just the base element when the √d part is zero. - QuadraticExtension: String toString() - final class RealQuadraticField extends QuadraticExtension implements OrderedField> — ℚ(√d) for a rational d > 0 that is not a square, with the order it has as a subfield of ℝ (√d taken positive): sign(a + b√d) is decided exactly by comparing a² with d b², with no rounding. - RealQuadraticField: RealQuadraticField(Rational d) — ℚ(√d). - RealQuadraticField: factory RealQuadraticField.of(int d) — ℚ(√d) for an integer d, such as RealQuadraticField.of(2) for ℚ(√2); the same checks as the main constructor. - RealQuadraticField: int sign(Quad x) — The exact sign of a + b√d: when a and b have opposite signs, the larger of a² and d b² decides. - RealQuadraticField: double toDouble(Quad x) — A + b√d as a double. - final class IVec3 — An integer 3-vector (a lattice point or a lattice direction). - IVec3: const IVec3(this.x, this.y, this.z) — The vector (x, y, z). - IVec3: final int x — The coordinates. - IVec3: final int y — The coordinates. - IVec3: final int z — The coordinates. - IVec3: int get quadrance — X² + y² + z², exact (|coordinates| < 2^31 keeps it below 2^63). - IVec3: int get hashCode - IVec3: int dot(IVec3 o) — The dot product x·x′ + y·y′ + z·z′ with o. - IVec3: IVec3 cross(IVec3 o) — The cross product with o: perpendicular to both, with quadrance Q(u)·Q(v)·s, s the spread between them. - IVec3: int quadranceTo(IVec3 o) — The quadrance between this point and o, exact. - IVec3: Rational spreadTo(IVec3 o) — The exact spread to o: 1 − (u·v)²/(Q(u)Q(v)) as a Rational; 0 for parallel vectors, 1 for perpendicular ones. - IVec3: Vec toVec() — The same vector as a 3-vector over Q, for use with the general field-based geometry. - IVec3: String toString() — The vector as (x, y, z). - IVec3: IVec3 operator +(IVec3 o) — The sum, coordinate by coordinate. - IVec3: IVec3 operator -(IVec3 o) — The difference, coordinate by coordinate. - IVec3: IVec3 operator -() — The opposite vector (−x, −y, −z). - IVec3: IVec3 operator *(int k) — The vector scaled by the integer k. - IVec3: bool operator ==(Object other) — Equal when all three coordinates are equal. - final class IMat3 — A 3 × 3 integer matrix (a lattice symmetry), row-major. - IMat3: const IMat3(this.m) — The matrix with the 9 entries m in row-major order (m3i + j is row i, column j). - IMat3: static const IMat3 identity = IMat3([1, 0, 0, 0, 1, 0, 0, 0, 1]) — The identity matrix I. - IMat3: final List m — The 9 entries, row by row. - IMat3: IMat3 get transpose — The transpose Mᵀ. - IMat3: int get determinant — The determinant det M: +1 for a rotation in octahedralGroup, −1 for a reflection. - IMat3: bool get isOrthogonal — Whether M is orthogonal, MᵀM = I, so that it keeps every quadrance and spread. - IMat3: int get hashCode - IMat3: IVec3 apply(IVec3 v) — The image M v of v, exactly. - IMat3: IMat3 operator *(IMat3 o) — The matrix product M·o: applying the result means applying o first, then this matrix. - IMat3: bool operator ==(Object other) — Equal when all 9 entries are equal. - enum CubicLattice — The cubic lattices and their nearest-neighbour shells, in integer coordinates. - CubicLattice: simple — ℤ³: 6 neighbours at quadrance 1. - CubicLattice: bodyCentred — Points with all coordinates even or all odd: 8 neighbours (±1, ±1, ±1) at quadrance 3. - CubicLattice: faceCentred — Points with even coordinate sum: 12 neighbours (permutations of (±1, ±1, 0)) at quadrance 2. - CubicLattice: int get neighbourQuadrance — The nearest-neighbour quadrance: 1, 3 or 2 for simple, body-centred and face-centred. - CubicLattice: List get neighbours — The nearest-neighbour directions (the struts of the lattice truss): 6, 8 or 12 vectors, a new list each call. - CubicLattice: bool contains(IVec3 p) — Whether the integer point p belongs to this lattice. - abstract final class LatticePolyhedra — Polyhedra with integer vertices (the modules of lattice self-assembly). - LatticePolyhedra: static List rhombicDodecahedron() — The rhombic dodecahedron (Voronoi cell of the FCC lattice, scaled by 2): 8 vertices (±1, ±1, ±1) and 6 vertices (±2, 0, 0) and permutations; its 12 faces have normals (±1, ±1, 0), the FCC neighbours. - LatticePolyhedra: static List rhombicDodecahedronFaceNormals() — The 12 face normals of the rhombic dodecahedron (= FCC neighbour directions, octet truss struts). - LatticePolyhedra: static List cuboctahedron() — The cuboctahedron (the FCC nearest-neighbour shell): its 12 vertices are the permutations of (±1, ±1, 0). - LatticePolyhedra: static List truncatedOctahedron() — The truncated octahedron (Voronoi cell of the BCC lattice, scaled by 4): its 24 vertices are the permutations of (0, ±1, ±2). - LatticePolyhedra: static List cube() — The cube: the 8 vertices (±1, ±1, ±1). - LatticePolyhedra: static List octahedron() — The octahedron: the 6 vertices (±1, 0, 0) and permutations. - LatticePolyhedra: static List tetrahedron() — The regular tetrahedron inscribed in the cube: (1, 1, 1), (1, −1, −1), (−1, 1, −1), (−1, −1, 1). - final class FixedPointFormat — Fixed point with fractionBits fractional bits: x is stored as the integer X = x·2^k. - FixedPointFormat: const FixedPointFormat(this.fractionBits) — The format with k = fractionBits fractional bits. - FixedPointFormat: static const int float32ExactLimit = 1 << 24 — 2^24, the bound for exact float32 conversion: every stored integer of magnitude at most 2^24 converts to float32 with no error. - FixedPointFormat: final int fractionBits — The number k of fractional bits. - FixedPointFormat: int get scale — The scale 2^k: the stored integer for the value 1. - FixedPointFormat: Rational decode(int stored) — The exact rational X / 2^k that the stored integer stored means. - FixedPointFormat: int encodeExact(Rational r) — The stored integer r·2^k for the rational r. - FixedPointFormat: Rational quadrance(IVec3 a, IVec3 b) — The exact quadrance between two stored points a and b, as a rational in real units (the stored quadrance divided by 4^k). - final class ExactLatticeState — The exact state of a lattice structure: integer node positions (fixed point) and struts. - ExactLatticeState: ExactLatticeState(this.format) — An empty state whose stored coordinates use format. - ExactLatticeState: final FixedPointFormat format — How stored integers map to real coordinates. - ExactLatticeState: int get nodeCount — The number of nodes. - ExactLatticeState: int get strutCount — The number of struts. - ExactLatticeState: int get fingerprint — A 64-bit FNV-1a fingerprint of every coordinate and strut: equal fingerprints before and after rendering prove no float wrote back. - ExactLatticeState: int addNode(IVec3 stored) — Adds a node at integer (stored) coordinates and returns its index. - ExactLatticeState: void addStrut(int a, int b) — Adds a strut between nodes a and b. - ExactLatticeState: void moveNode(int i, IVec3 by) — Moves node i by the integer offset by (stored units). - ExactLatticeState: void transform(IMat3 g) — Applies a lattice symmetry g about the origin to every node, exactly, in place. - ExactLatticeState: IVec3 node(int i) — The stored coordinates of node i. - ExactLatticeState: (int, int) strut(int k) — The two node indices joined by strut k. - ExactLatticeState: int strutQuadrance(int k) — The exact integer quadrance (stored units) of strut k; divide by 4^k, or use FixedPointFormat.quadrance, for real units. - ExactLatticeState: Int32List toInt32Buffer() — The GPU buffer of node coordinates, x, y, z per node (a copy; the GPU never writes back through it). - ExactLatticeState: Uint32List toIndexBuffer() — The strut index buffer: two node indices per strut (a copy). - ExactLatticeState: RenderSnapshot renderSnapshot() — A one-way float view for drawing: a new RenderSnapshot that shares nothing with this state. - final class RenderSnapshot — A float32 copy of an exact state for the renderer. - RenderSnapshot: final Float32List positions — Node positions in world units (x, y, z per node), float32. - RenderSnapshot: final Uint32List indices — The strut index buffer: two node indices per strut, as in ExactLatticeState.toIndexBuffer. - RenderSnapshot: final double maxError — The largest |float32 − exact| over all coordinates, in world units: 0 when every stored coordinate is at most 2^24 in magnitude. - RenderSnapshot: final int sourceFingerprint — The fingerprint of the state this was taken from. - abstract final class FeedbackGuard — Runs a render pass and proves it did not touch the exact state. - FeedbackGuard: static void render(ExactLatticeState state, void Function(RenderSnapshot snapshot) render) — Calls render with a fresh snapshot of state and throws StateError if the exact state's fingerprint changed meanwhile. - abstract final class ProjectiveLaws — The projective (universal hyperbolic / elliptic) laws (Wildberger, "Universal hyperbolic geometry I: trigonometry", Geometriae Dedicata 163 (2013) 215–274). - ProjectiveLaws: static bool tripleQuadHolds(ScalarField f, T q1, T q2, T q3) — Whether the projective triple quad formula holds for q₁, q₂, q₃: it has the same shape as the planar triple spread formula, (q₁ + q₂ + q₃)² = 2(q₁² + q₂² + q₃²) + 4q₁q₂q₃, and holds for the quadrances of three… - ProjectiveLaws: static bool pythagorasHolds(ScalarField f, T q1, T q2, T q3) — Whether projective Pythagoras holds: q₃ = q₁ + q₂ − q₁q₂, the relation for a right spread S₃ = 1. - ProjectiveLaws: static T crossLaw(ScalarField f, T q1, T q2, T q3, T s3) — The projective cross law residual (q₁q₂S₃ − q₁ − q₂ − q₃ + 2)² − 4(1 − q₁)(1 − q₂)(1 − q₃); zero when the law holds. - ProjectiveLaws: static bool crossLawHolds(ScalarField f, T q1, T q2, T q3, T s3) — Whether the projective cross law holds: crossLaw is zero. - ProjectiveLaws: static bool crossDualLawHolds(ScalarField f, T s1, T s2, T s3, T q3) — Whether the dual cross law (S₁S₂q₃ − S₁ − S₂ − S₃ + 2)² = 4(1 − S₁)(1 − S₂)(1 − S₃) holds: the cross law with the roles of quadrances and spreads swapped. - final class Triangle — A triangle in a metric (any SymmetricForm: blue, red, green, Lorentzian, 3-D, …). - Triangle: Triangle(this.form, this.a1, this.a2, this.a3) — The triangle with vertices a1, a2, a3, measured in form. - Triangle: final SymmetricForm form — The metric the triangle is measured in. - Triangle: final Vec a1 — The vertices A₁, A₂, A₃. - Triangle: final Vec a2 — The vertices A₁, A₂, A₃. - Triangle: final Vec a3 — The vertices A₁, A₂, A₃. - Triangle: ScalarField get f — The field of form. - Triangle: RtPlane get plane — The riptide_algebra RtPlane over f, whose laws and solvers take measures. - Triangle: late final T q1 — The quadrance Q₁ = Q(A₂A₃) of the side opposite A₁. - Triangle: late final T q2 — The quadrance Q₂ = Q(A₁A₃) of the side opposite A₂. - Triangle: late final T q3 — The quadrance Q₃ = Q(A₁A₂) of the side opposite A₃. - Triangle: late final T s1 — The spread s₁ at A₁, between the sides A₁A₂ and A₁A₃. - Triangle: late final T s2 — The spread s₂ at A₂, between the sides A₂A₁ and A₂A₃. - Triangle: late final T s3 — The spread s₃ at A₃, between the sides A₃A₁ and A₃A₂. - Triangle: RtMeasures get measures — The six measures (Q₁, Q₂, Q₃, s₁, s₂, s₃), for RtPlane.satisfiesLaws, RtPlane.solveTriangle and the rest of riptide_algebra. - Triangle: T get quadrea — The quadrea 𝒜 = A(Q₁, Q₂, Q₃), Archimedes' function of the three quadrances (16·area² for blue). - Triangle: bool get isCollinear — Whether the vertices are collinear: the quadrea is zero (the triple quad formula). - Triangle: bool get isNondegenerate — Whether every side is non-null and the vertices are not collinear, so every spread is defined. - Triangle: bool get satisfiesAllLaws — Whether the measures satisfy the five laws through RtPlane.satisfiesLaws (spread law, triple spread, cross law at every vertex) and the quadrea identity 𝒜 = 4Q₁Q₂s₃. - final class Vec — A point or vector with coordinates in a ScalarField. - Vec: Vec(this.field, List coords) — The vector with coordinates coords over field. - Vec: factory Vec.zero(ScalarField field, int n) — The zero vector of dimension n. - Vec: factory Vec.fromRtPoint(ScalarField field, RtPoint p) — The planar vector (p.x, p.y) of riptide_algebra's RtPoint p. - Vec: factory Vec.basis(ScalarField field, int n, int i) — The standard basis vector eᵢ of dimension n: 1 in coordinate i (counting from 0), 0 elsewhere. - Vec: final ScalarField field — The field the coordinates live in. - Vec: final List c — The coordinates, as an unmodifiable list. - Vec: int get dim — The number of coordinates. - Vec: T get x — The first coordinate. - Vec: T get y — The second coordinate. - Vec: T get z — The third coordinate. - Vec: bool get isZero — Whether every coordinate is zero. - Vec: int get hashCode — A hash of the coordinates. - Vec: Vec scale(T k) — The scalar multiple k·v. - Vec: T dot(Vec o) — The Euclidean (blue) dot product Σ xᵢyᵢ. - Vec: Vec cross(Vec o) — The 3-D cross product u × v. - Vec: T wedge(Vec o) — The 2-D cross (wedge) x₁y₂ − x₂y₁: the signed area of the parallelogram on the two vectors. - Vec: RtPoint toRtPoint() — The same planar point as riptide_algebra's RtPoint. - Vec: bool isProportionalTo(Vec o) — Whether this and o are proportional, that is, the same projective point: every 2 × 2 minor xᵢyⱼ − xⱼyᵢ vanishes. - Vec: Vec dehomogenize() — The affine point (x/w, y/w, …) of the homogeneous coordinates (x, y, …, w), one dimension lower. - Vec: Vec homogenize() — The homogeneous coordinates (x, y, …, 1) of this affine point, one dimension higher. - Vec: String toString() — The coordinates in brackets, formatted by the field, e.g. 1/2, -3. - Vec: T operator [](int i) — The coordinate at index i (from 0). - Vec: Vec operator +(Vec o) — The sum, coordinate by coordinate. o must have the same dimension. - Vec: Vec operator -(Vec o) — The difference this − o, coordinate by coordinate: the vector from the point o to this point. - Vec: Vec operator -() — The negated vector −v. - Vec: bool operator ==(Object other) — Exact equality: other is a Vec of the same type and dimension with equal coordinates in the field. - final class Mat — A dense n × m matrix over a ScalarField, stored row by row. - Mat: Mat(this.field, List> rows) — The matrix with rows rows over field. - Mat: factory Mat.identity(ScalarField field, int n) — The n × n identity matrix I. - Mat: factory Mat.diagonal(ScalarField field, List d) — The square diagonal matrix diag(d₁, …, dₖ) with the entries d on the diagonal. - Mat: factory Mat.columns(ScalarField field, List> cols) — The matrix whose columns are the vectors cols, all of the same dimension. - Mat: final ScalarField field — The field the entries live in. - Mat: final List> rows — The entries, row by row, as unmodifiable lists. - Mat: final int n — The number of rows (n) and of columns (m). - Mat: final int m — The number of rows (n) and of columns (m). - Mat: Mat get transpose — The transpose Aᵀ, an m × n matrix. - Mat: T get determinant — The determinant det A, exactly, by Gaussian elimination over the field. - Mat: Mat get inverse — The inverse A⁻¹, exactly, by Gauss–Jordan elimination. - Mat: Mat get adjugate — The adjugate (classical adjoint) adj A, the transposed matrix of cofactors, so that adj(A)·A = det(A)·I. - Mat: int get hashCode — A hash of the entries. - Mat: T at(int i, int j) — The entry in row i and column j (both from 0). - Mat: Mat scale(T k) — The scalar multiple k·A. - Mat: Vec apply(Vec v) — The matrix–vector product A v, with v as a column vector of dimension m. - Mat: Vec row(int i) — Row i as a vector. - Mat: Vec column(int j) — Column j as a vector. - Mat: Vec? solve(Vec b) — The exact solution x of A x = b, or null when A is singular. - Mat: String toString() — One line per row, entries formatted by the field and separated by spaces. - Mat: Mat operator *(Mat o) — The matrix product this · o: an n × o.m matrix. - Mat: Mat operator +(Mat o) — The entrywise sum. o must have the same shape. - Mat: Mat operator -(Mat o) — The entrywise difference. o must have the same shape. - Mat: bool operator ==(Object other) — Exact equality: other is a Mat of the same type and shape with equal entries in the field. - final class SymmetricForm — A symmetric bilinear form B(u, v) = uᵀ M v: the metric of a geometry. - SymmetricForm: SymmetricForm(this.matrix) — The form with matrix matrix. - SymmetricForm: factory SymmetricForm.blue(ScalarField f, [int n = 2]) — The blue (Euclidean) form x₁² + … + xₙ² on Fⁿ, M = I. n defaults to 2. - SymmetricForm: factory SymmetricForm.red(ScalarField f) — The planar red form x² − y² (Wildberger's chromogeometry; 1+1 Minkowski space), M = diag(1, −1). - SymmetricForm: factory SymmetricForm.green(ScalarField f) — The planar green form 2xy (chromogeometry; Minkowski space in null coordinates), M = [0, 1, 1, 0]. - SymmetricForm: factory SymmetricForm.diagonal(ScalarField f, List d) — The diagonal form diag(d₁, …, dₙ) from integers d, e.g. -1, 1, 1, 1 for Minkowski space-time. - SymmetricForm: final Mat matrix — The symmetric matrix M of the form. - SymmetricForm: ScalarField get field — The field the entries live in. - SymmetricForm: int get dim — The dimension n of the space the form acts on. - SymmetricForm: T get determinant — The determinant det M of the form's matrix; zero exactly when the form is degenerate. - SymmetricForm: T apply(Vec u, Vec v) — The value B(u, v) = uᵀ M v. - SymmetricForm: T norm(Vec v) — The quadrance of a vector, Q(v) = B(v, v). - SymmetricForm: T quadrance(Vec a, Vec b) — The quadrance between the points a and b, Q(A, B) = B(B − A, B − A). - SymmetricForm: bool isNull(Vec v) — Whether v is a null (isotropic) vector: B(v, v) = 0. - SymmetricForm: bool perpendicular(Vec u, Vec v) — Whether u and v are perpendicular in this metric: B(u, v) = 0. - SymmetricForm: T cross(Vec u, Vec v) — The cross c(u, v) = B(u, v)² / (B(u, u) B(v, v)) (classically cos²θ): 1 for parallel, 0 for perpendicular. - SymmetricForm: T spread(Vec u, Vec v) — The spread s(u, v) = 1 − c(u, v) = (Q(u)Q(v) − B(u, v)²)/(Q(u)Q(v)) (classically sin²θ): 0 for parallel, 1 for perpendicular. - SymmetricForm: T twist(Vec u, Vec v) — The twist t = s / c (classically tan²θ). - SymmetricForm: T spreadAt(Vec a, Vec b, Vec c) — The spread at the vertex a between the lines from a towards b and towards c. - SymmetricForm: Vec reflect(Vec x, Vec v) — The reflection of x in the hyperplane through the origin B-perpendicular to v: x − 2B(x, v)/B(v, v)·v. - SymmetricForm: Mat reflectionMatrix(Vec v) — The matrix of reflect in the normal v: I − 2 v (Mv)ᵀ / B(v, v), so that reflectionMatrix(v).apply(x) equals reflect(x, v). - SymmetricForm: bool isIsometry(Mat a) — Whether the matrix a is an isometry of this form, Aᵀ M A = M, tested exactly. - SymmetricForm: String toString() — The matrix, labelled, one row per line. - final class Gram — The Gram matrix G = Vᵀ M V of vectors v₀ … v_{k−1} in a metric (G_ij = B(vᵢ, vⱼ)), and the rational trigonometry read off its minors. - Gram: Gram(this.form, List> vectors) — The Gram matrix of vectors in the metric form: k² values B(vᵢ, vⱼ), computed once. - Gram: final SymmetricForm form — The metric the dot products are taken in. - Gram: final List> vectors — The vectors v₀ … v_{k−1}, unmodifiable. - Gram: final List> g — G as unmodifiable rows: gj is B(vᵢ, vⱼ). - Gram: ScalarField get f — The field the entries live in. - Gram: int get size — The number k of vectors, so G is k × k. - Gram: Mat get matrix — G as a Mat. - Gram: T get determinant — The full Gram determinant det G; zero when the vectors are linearly dependent. - Gram: T dot(int i, int j) — The dot product B(vᵢ, vⱼ) = G_ij of vectors i and j. - Gram: T quadrance(int i) — The quadrance Q(vᵢ) = G_ii of vector i. - Gram: T minor(List s) — The principal minor det G_S for the index set s (the "quadrume"-type invariant of those vectors: for the blue form, the squared k-volume of the parallelotope they span). - Gram: T cross(int i, int j) — The cross c(vᵢ, vⱼ) = G_ij² / (G_ii G_jj) (classically cos²θ). - Gram: T spread(int i, int j) — The spread s(vᵢ, vⱼ) = det G_{ij} / (G_ii G_jj), the 2 × 2 Gram minor over the diagonal: no subtraction of nearly equal numbers after the division, so the same formula is also the accurate one in floating point. - Gram: T kSpread(List s) — The k-spread det G_S / Π_{i∈S} G_ii of the lines through the vectors in s: 0 when they are dependent, 1 when they are mutually perpendicular. k = 2 is the spread, k = 3 in three dimensions is Notowidigdo–Wildberger's… - Gram: T lineSubspaceSpread(int i, List sub) — The spread between the line through vᵢ and the subspace spanned by the vectors in sub: det G_{i ∪ S} / (Q(vᵢ)·det G_S) (classically sin² of the angle between a line and a plane, …): 0 when vᵢ lies in the subspace, 1… - Gram: T dihedralSpread(List common, int a, int b) — The dihedral spread between the subspaces span(C ∪ {a}) and span(C ∪ {b}), which meet in span(C): det G_C · det G_{C∪{a,b}} / (det G_{C∪{a}} · det G_{C∪{b}}). - Gram: T tripleSpreadResidual(int i, int j, int l) — The Triple spread residual (s₁ + s₂ + s₃)² − 2(s₁² + s₂² + s₃²) − 4s₁s₂s₃ of the three spreads among vᵢ, vⱼ, v_l, computed from the spreads. - Gram: T tripleSpreadResidualFromGram(int i, int j, int l) — The same residual from the Gram matrix alone: det G₃ · (4 b_ij b_il b_jl − det G₃) / (a_i a_j a_l)², with G₃ the 3 × 3 Gram matrix of the three vectors (Goh–Wildberger, Theorem 3). - extension MetricMatrixTrig on SymmetricForm — The metric-matrix forms of quadrance and spread, the B-vector product, and exact rotations of any metric. - MetricMatrixTrig: Gram gram(List> vs) — The Gram matrix of vs in this metric, as a Gram. - MetricMatrixTrig: T spreadByWedge(Vec u, Vec v) — The spread of two planar vectors as det M·(u ∧ v)² / (Q(u)Q(v)) (Goh–Wildberger, p. 7, for a general 2-D form; the blue, red and green spreads of "Chromogeometry" are the cases det M = 1, −1, −1). - MetricMatrixTrig: Vec vectorProduct(Vec u, Vec v) — The B-vector product u ×_B v = adj(M)(u × v) in three dimensions (Notowidigdo–Wildberger, arXiv:1903.08330, §2): B-perpendicular to u and v, with B(w, u ×_B v) = det M·detw u v. - MetricMatrixTrig: T spreadByVectorProduct(Vec u, Vec v) — The spread in three dimensions by Lagrange's identity: Q(u ×_B v) / (det M·Q(u)Q(v)), equal to SymmetricForm.spread. - MetricMatrixTrig: Mat? cayleyRotation(Mat k) — The Cayley rotation R = (M − K)⁻¹(M + K) for a skew-symmetric K: an exact isometry of this metric (Rᵀ M R = M) with det R = 1, rational in the entries of K, over any field. - MetricMatrixTrig: Mat? rotation(T t) — The planar rotation of this metric with parameter t: cayleyRotation of t·[0, 1, −1, 0]. - MetricMatrixTrig: T rotationSpread(Mat r) — The spread every non-null vector makes with its image under a planar rotation R of this metric: 1 − (tr R)²/4 (classically sin²θ = 1 − cos²θ with tr R = 2 cos θ). - abstract final class SpreadPolynomials — Spread polynomials as matrix powers (Wildberger, Divine Proportions, 2005; Goh–Wildberger, arXiv:0911.1025). - SpreadPolynomials: static T value(ScalarField f, int n, T s) — Sₙ(s) in O(log n) field operations: Sₙ(s) = (1 − Tₙ(1 − 2s))/2 (arXiv:math/0612499, p. 20), with the Chebyshev value Tₙ(x) read off [2x, −1, 1, 0]ⁿ⁻¹ (standard). n = 10¹⁸ takes about 60 squarings of a 2 × 2 matrix. - SpreadPolynomials: static int period(PrimeField f, int s) — The spread period of s in ℤ/p: the least m ≥ 1 with Sₘ(s) = 0, so that Sₙ(s) = 0 exactly when m | n. - extension ChromoMatrices on Chromogeometry — Chromogeometry as matrices. - ChromoMatrices: Mat perpendicularMap(Colour c) — The perpendicularity map J_c of the colour c, acting on column vectors, so that J_c v is c-perpendicular to v: blue [0, −1, 1, 0], red [0, 1, 1, 0], green [−1, 0, 0, 1]. - ChromoMatrices: T quadranceByDeterminant(Colour c, Vec v) — The quadrance Q_c(v) = detv, J_c v of the colour c (Wildberger's definition, a signed area): x² + y² for blue, x² − y² for red, 2xy for green. - final class Line — The line ⟨a: b: c⟩, the points (x, y) with ax + by + c = 0 (a and b not both zero). - Line: Line(this.field, this.a, this.b, this.c) — The line ax + by + c = 0 over field. - Line: factory Line.join(Vec p, Vec q) — The line through two distinct planar points p and q. - Line: factory Line.through(Vec p, Vec d) — The line through the point p with direction d. - Line: final ScalarField field — The field the coefficients live in. - Line: final T a — The coefficients of ax + by + c = 0. - Line: final T b — The coefficients of ax + by + c = 0. - Line: final T c — The coefficients of ax + by + c = 0. - Line: Vec get direction — A direction vector (−b, a) along the line. - Line: Vec get normal — The vector (a, b), the Euclidean (blue) normal. - Line: T evaluate(Vec p) — The value a x + b y + c at the point p: zero exactly on the line. - Line: bool contains(Vec p) — Whether the point p lies on the line. - Line: bool isParallelTo(Line o) — Whether this line and o are parallel: ab′ − ba′ = 0. - Line: Vec? meet(Line o) — The point where this line meets o; null when they are parallel (including when they are the same line). - Line: Line parallelThrough(Vec p) — The line through p parallel to this one. - Line: Line perpendicularThrough(Vec p, SymmetricForm form) — The line through p perpendicular to this one in the planar metric form. - Line: Vec perpendicularDirection(SymmetricForm form) — A direction w perpendicular to the line in the planar metric form, B(d, w) = 0 for d = direction: w = J (M d), with M the matrix of form and J the quarter turn (x, y) ↦ (−y, x). - Line: Vec? foot(Vec p, SymmetricForm form) — The foot of the altitude from p to this line in the planar metric form: where the perpendicular through p meets the line. - Line: bool isNull(SymmetricForm form) — Whether the line's direction is null in form, Q(d) = 0, so spreads with this line are undefined. - Line: bool sameAs(Line o) — Whether o is the same line: its ⟨a: b: c⟩ is proportional to this one's. - Line: String toString() — ⟨a: b: c⟩ with the coefficients formatted by the field. - abstract final class Centres — Planar triangle centres in any metric, each the solution of a 2 × 2 linear system, so a rational triangle has rational centres. - Centres: static Vec? circumcentre(SymmetricForm form, Vec a, Vec b, Vec c) — The circumcentre: the point at equal quadrance from a, b and c in the planar metric form. - Centres: static Vec? orthocentre(SymmetricForm form, Vec a, Vec b, Vec c) — The orthocentre: the meet of the altitudes in the planar metric form, the X with B(X − A, C − B) = 0 and B(X − B, C − A) = 0. - Centres: static Vec centroid(Vec a, Vec b, Vec c) — The centroid (A + B + C)/3. - Centres: static T? circumquadrance(SymmetricForm form, Vec a, Vec b, Vec c) — The circumquadrance: the quadrance in form from the circumcentre to each vertex. - final class Polyhedron — A convex polyhedron given by vertices and the outward normals of its faces (a face is the set of vertices that maximise the dot product with its normal). - Polyhedron: Polyhedron(this.vertices, this.normals) — The polyhedron with vertices (3-vectors) and one outward face normal per face in normals; the faces are computed here. - Polyhedron: final List> vertices — The vertices, as given. - Polyhedron: final List> normals — The outward face normals, as given; face i has normal normalsi. - Polyhedron: final SymmetricForm form — The metric used for quadrances and spreads: the Euclidean form x² + y² + z². - Polyhedron: late final List> faces — For each normal, the indices into vertices of the vertices on that face, in increasing order. - Polyhedron: ScalarField get field — The field the coordinates live in. - Polyhedron: late final T edgeQuadrance — The smallest quadrance between two distinct vertices (the edge quadrance of a regular solid); zero if there are fewer than two vertices or two vertices coincide. - Polyhedron: late final List<(int, int)> edges — The edges: the index pairs (i, j), i < j, of vertices at exactly the edgeQuadrance. - Polyhedron: int get eulerCharacteristic — V − E + F, the vertex count minus edges plus faces: 2 for every convex polyhedron, so it checks that the edges and faces were found correctly. - Polyhedron: List dihedralSpreads() — The spreads between the normals of faces sharing an edge (the dihedral spreads), one entry per such pair of faces; all equal for a regular solid. - Polyhedron: List faceSpreads() — The spreads between the two edges at each corner of each face (the spreads of the face angles), one entry per corner: 3/4 for triangles, 1 for squares. - abstract final class Platonic — The five Platonic solids with exact coordinates: the tetrahedron, cube and octahedron over any ordered field (such as Q), the icosahedron and dodecahedron over ℚ(√5). - Platonic: static Polyhedron tetrahedron(OrderedField f) — The regular tetrahedron with vertices (1, 1, 1), (1, −1, −1), (−1, 1, −1), (−1, −1, 1) over f. - Platonic: static Polyhedron cube(OrderedField f) — The cube with vertices (±1, ±1, ±1) over f. - Platonic: static Polyhedron octahedron(OrderedField f) — The octahedron with vertices (±1, 0, 0) and permutations over f. - Platonic: static Polyhedron> icosahedron(OrderedField> q5, Quad phi) — The icosahedron with vertices the cyclic permutations of (0, ±1, ±φ), over q5 = ℚ(√5), where phi is the golden ratio φ = (1 + √5)/2 (from goldenRatio). - Platonic: static Polyhedron> dodecahedron(OrderedField> q5, Quad phi) — The dodecahedron with vertices (±1, ±1, ±1) and the cyclic permutations of (0, ±φ, ±1/φ), over q5 = ℚ(√5), where phi is the golden ratio φ = (1 + √5)/2 (from goldenRatio). - final class Predicates — Exact orientation, collinearity, in-circle and in-sphere tests over an OrderedField such as Q or a RealQuadraticField. - Predicates: const Predicates(this.field) — The predicates over field, such as Predicates(Q). - Predicates: final OrderedField field — The ordered field the coordinates live in. - Predicates: int orient2d(Vec a, Vec b, Vec c) — The orientation of the 2-D points a, b, c: the sign of det[bx − ax, by − ay, cx − ax, cy − ay], +1 when a → b → c turns counter-clockwise (left), −1 clockwise, 0 when the three points are collinear. - Predicates: bool collinear(Vec a, Vec b, Vec c) — Whether the 2-D points a, b, c lie on one line (also true when two of them coincide). - Predicates: int incircle(Vec a, Vec b, Vec c, Vec d) — The in-circle test: +1 when d is strictly inside the circle through a, b, c, −1 outside, 0 on it, for a, b, c in counter-clockwise order (orient2d(a, b, c) > 0). - Predicates: int orient3d(Vec a, Vec b, Vec c, Vec d) — The orientation of the 3-D points a, b, c, d: the sign of detb − a, c − a, d − a. +1 when d is on the side of the plane abc that (b − a) × (c − a) points to (so (0,0,0), (1,0,0), (0,1,0), (0,0,1) gives +1), −1 on the… - Predicates: bool coplanar(Vec a, Vec b, Vec c, Vec d) — Whether the 3-D points a, b, c, d lie in one plane. - Predicates: int insphere(Vec a, Vec b, Vec c, Vec d, Vec e) — The in-sphere test: +1 when e is strictly inside the sphere through a, b, c, d, −1 outside, 0 on it, for positively oriented a, b, c, d (orient3d(a, b, c, d) > 0). - abstract final class FloatPredicates — Robust predicates on doubles, with the same sign conventions as Predicates. - FloatPredicates: static int exactFallbacks — How many calls since program start (or the last reset) fell back to exact arithmetic, across all four tests. - FloatPredicates: static int orient2d(double ax, double ay, double bx, double by, double cx, double cy) — The exact orientation of the points (ax, ay), (bx, by), (cx, cy): +1 counter-clockwise, −1 clockwise, 0 collinear, as Predicates.orient2d. - FloatPredicates: static int incircle(List a, List b, List c, List d) — The exact in-circle test for 2-D points given as x, y lists: +1 when d is inside the circle through a, b, c (counter-clockwise), −1 outside, 0 on it, as Predicates.incircle. - FloatPredicates: static int orient3d(List a, List b, List c, List d) — The exact orientation of 3-D points given as x, y, z lists: the sign of detb − a, c − a, d − a, the same convention as Predicates.orient3d. - FloatPredicates: static int insphere(List a, List b, List c, List d, List e) — The exact in-sphere test for 3-D points given as x, y, z lists, the same convention as - final class ProjectivePlane — The projective plane over a field with an absolute (a symmetric form J on homogeneous coordinates). - ProjectivePlane: ProjectivePlane(Mat j) — The plane with absolute J = j, a symmetric 3 × 3 matrix (the size is not checked). - ProjectivePlane: factory ProjectivePlane.hyperbolic(ScalarField f) — Universal hyperbolic geometry: J = diag(1, 1, −1), null circle x² + y² = z². - ProjectivePlane: factory ProjectivePlane.elliptic(ScalarField f) — Elliptic geometry: J = I (the sphere with antipodes identified). - ProjectivePlane: final SymmetricForm points — The form on points (J). - ProjectivePlane: final SymmetricForm lines — The form on lines (adj J ∝ J⁻¹). - ProjectivePlane: ScalarField get field — The field the coordinates live in. - ProjectivePlane: Vec point(T x, T y, T z) — The point x: y: z. - ProjectivePlane: Vec pointOf(int x, int y, int z) — The point x: y: z from ints. - ProjectivePlane: Vec join(Vec a, Vec b) — The line through the points a and b (their cross product). - ProjectivePlane: Vec meet(Vec l, Vec m) — The point where the lines l and m meet (their cross product). - ProjectivePlane: Vec dualOfPoint(Vec a) — The dual line a⊥ = J a of a point (its polar with respect to the absolute). - ProjectivePlane: Vec dualOfLine(Vec l) — The dual point L⊥ = adj(J) L of a line (its pole). - ProjectivePlane: bool isNullPoint(Vec a) — Whether a lies on the absolute (a null point): aᵀ J a = 0. - ProjectivePlane: bool isNullLine(Vec l) — Whether l is tangent to the absolute (a null line): Lᵀ adj(J) L = 0. - ProjectivePlane: bool incident(Vec a, Vec l) — Whether the point a lies on the line l: a · L = 0. - ProjectivePlane: bool collinear(Vec a, Vec b, Vec c) — Whether the three points lie on one line: deta b c = 0. - ProjectivePlane: bool concurrent(Vec l, Vec m, Vec n) — Whether the three lines pass through one point: detl m n = 0. - ProjectivePlane: bool perpendicularPoints(Vec a, Vec b) — Whether the points a and b are perpendicular: b lies on the dual line a⊥, i.e. aᵀ J b = 0. - ProjectivePlane: bool perpendicularLines(Vec l, Vec m) — Whether the lines l and m are perpendicular: M passes through the dual point L⊥. - ProjectivePlane: T quadrance(Vec a, Vec b) — The projective quadrance q(a, b) = 1 − (aᵀJb)²/((aᵀJa)(bᵀJb)); zero for equal points, one for perpendicular. - ProjectivePlane: T spread(Vec l, Vec m) — The projective spread S(L, M) = 1 − (Lᵀ adj(J) M)²/((Lᵀ adj(J) L)(Mᵀ adj(J) M)), the dual of quadrance: zero for equal lines, one for perpendicular. - ProjectivePlane: Vec altitude(Vec a, Vec l) — The altitude from a to l: the line through a and the pole of l (perpendicular to l). - ProjectivePlane: Vec orthocentre(Vec a1, Vec a2, Vec a3) — The orthocentre of the triangle a₁a₂a₃ (the altitudes are concurrent in universal geometry too). - ProjectivePlane: ProjectiveTriangle triangle(Vec a1, Vec a2, Vec a3) — The triangle with vertices a1, a2, a3, with its quadrances (qᵢ opposite aᵢ) and spreads (Sᵢ at aᵢ). - final class ProjectiveTriangle — A triangle of the projective plane with its quadrances and spreads. - ProjectiveTriangle: ProjectiveTriangle(this.plane, this.a1, this.a2, this.a3) — The triangle a₁a₂a₃ in plane. - ProjectiveTriangle: final ProjectivePlane plane — The plane, with its absolute, the triangle lives in. - ProjectiveTriangle: final Vec a1 — The vertices a₁, a₂, a₃. - ProjectiveTriangle: final Vec a2 — The vertices a₁, a₂, a₃. - ProjectiveTriangle: final Vec a3 — The vertices a₁, a₂, a₃. - ProjectiveTriangle: ScalarField get f — The field the coordinates live in. - ProjectiveTriangle: late final Vec l1 — The sides as lines: l₁ = a₂a₃, l₂ = a₁a₃, l₃ = a₁a₂ (lᵢ opposite aᵢ). - ProjectiveTriangle: late final Vec l2 — The sides as lines: l₁ = a₂a₃, l₂ = a₁a₃, l₃ = a₁a₂ (lᵢ opposite aᵢ). - ProjectiveTriangle: late final Vec l3 — The sides as lines: l₁ = a₂a₃, l₂ = a₁a₃, l₃ = a₁a₂ (lᵢ opposite aᵢ). - ProjectiveTriangle: late final T q1 — The quadrances of the sides: q₁ = q(a₂, a₃), q₂ = q(a₁, a₃), q₃ = q(a₁, a₂) (qᵢ opposite aᵢ). - ProjectiveTriangle: late final T q2 — The quadrances of the sides: q₁ = q(a₂, a₃), q₂ = q(a₁, a₃), q₃ = q(a₁, a₂) (qᵢ opposite aᵢ). - ProjectiveTriangle: late final T q3 — The quadrances of the sides: q₁ = q(a₂, a₃), q₂ = q(a₁, a₃), q₃ = q(a₁, a₂) (qᵢ opposite aᵢ). - ProjectiveTriangle: late final T s1 — The spreads at the vertices: s₁ = S(l₂, l₃) at a₁, s₂ = S(l₁, l₃) at a₂, s₃ = S(l₁, l₂) at a₃. - ProjectiveTriangle: late final T s2 — The spreads at the vertices: s₁ = S(l₂, l₃) at a₁, s₂ = S(l₁, l₃) at a₂, s₃ = S(l₁, l₂) at a₃. - ProjectiveTriangle: late final T s3 — The spreads at the vertices: s₁ = S(l₂, l₃) at a₁, s₂ = S(l₁, l₃) at a₂, s₃ = S(l₁, l₂) at a₃. - ProjectiveTriangle: bool get isNondegenerate — Whether the vertices are not collinear and no vertex or side is null, so every quadrance and spread is defined. - ProjectiveTriangle: bool get satisfiesAllLaws — Whether every law in checks holds. - ProjectiveTriangle: Map checks() — The laws of universal geometry checked exactly on this triangle, by name: spreadLaw (as in the plane, via RtPlane.spreadLawHolds), crossLaw (the projective cross law with s₃), crossLaw1 (the same with s₁) and… - final class FieldRatio implements RatioBackend> — A RatioBackend over a field and a metric: scalars are field elements, vectors are Vecs, and every operation is exact, so equality tests (isZero, same) need no tolerance. - FieldRatio: FieldRatio(this.form, {String? name}) — The backend for the metric form. name overrides the default name (exact 2D over ). - FieldRatio: final SymmetricForm form — The metric B every measurement uses. - FieldRatio: ScalarField get f — The field of form: where scalars and vector coordinates live. - FieldRatio: String get name — The name given to the constructor, or exact D over . - FieldRatio: int get dimension — The dimension of form: 2 or 3. - FieldRatio: bool get exact — Always true: equality is exact. - FieldRatio: T fromInt(int n) — The integer n as a field element. - FieldRatio: T add(T a, T b) — The field sum a + b. - FieldRatio: T sub(T a, T b) — The field difference a − b. - FieldRatio: T mul(T a, T b) — The field product a·b. - FieldRatio: T div(T a, T b) — The field quotient a / b; throws the field's division error when b = 0 (UnsupportedError over ℚ). - FieldRatio: bool isZero(T a, T scale) — Whether a is exactly zero; scale is ignored. - FieldRatio: double? toDouble(T a) — a as a double when the field is an OrderedField (ℚ, ℚ(√d) with d > 0, the real algebraic numbers); null otherwise (ℤ/p and other fields with no order). - FieldRatio: Vec vector(List coords) — The vector with integer coordinates coords. - FieldRatio: Vec vadd(Vec a, Vec b) — The vector sum a + b. - FieldRatio: Vec vsub(Vec a, Vec b) — The vector difference a − b. - FieldRatio: Vec vscale(T k, Vec v) — The scalar multiple k v. - FieldRatio: bool same(Vec a, Vec b, T scale) — Whether a and b have exactly equal coordinates; scale is ignored. - FieldRatio: T size(Vec v) — The Euclidean quadrance x² + y² (+ z²) of the coordinates, whatever form is. - FieldRatio: T dot(Vec a, Vec b) — B(a, b) in form. - FieldRatio: T quadrance(Vec a) — The quadrance Q(a) = B(a, a) in form. - FieldRatio: T spread(Vec a, Vec b) — The spread s(a, b) = 1 − B(a, b)²/(Q(a)Q(b)) in form; throws StateError when a or b is null (Q = 0). - FieldRatio: T cross(Vec a, Vec b) — The cross c(a, b) = B(a, b)²/(Q(a)Q(b)) = 1 − s in form; throws StateError when a or b is null. - FieldRatio: T twist(Vec a, Vec b) — The twist s / c (classically tan²θ) in form; throws when a and b are perpendicular (c = 0) or either is null. - FieldRatio: T solidSpread(Vec a, Vec b, Vec c) — The solid spread of the three edge vectors a, b, c at a vertex: det G(a, b, c)/(Q(a)Q(b)Q(c)) in form. - FieldRatio: T dihedralSpread(Vec common, Vec a, Vec b) — The dihedral spread between the planes span(common, a) and span(common, b) in form. - FieldRatio: T gramDeterminant(List> vs) — The determinant of the Gram matrix B(vᵢ, vⱼ) of vs in form. - FieldRatio: Vec reflect(Vec v, Vec normal) — The reflection v − 2B(v, n)/Q(n) n of v in the hyperplane B-perpendicular to normal; throws the field's division error when normal is null. - FieldRatio: Vec perpendicular(List> vs) — A vector B-perpendicular to vs: in 2-D, to the single vector vs0 (the quarter turn of M v, M the matrix of form); in 3-D, to vs0 and vs1 (the B-vector product). - FieldRatio: Vec rotate(List k, Vec v) — v under the Cayley rotation (B − K)⁻¹(B + K) of form. - final class Reflection — The reflection in the hyperplane B-perpendicular to the non-null normal normal through the point through: x ↦ x − 2B(x − p, v)/B(v, v)·v. - Reflection: Reflection(this.form, this.normal, [Vec? through]) — The reflection of form in the hyperplane with normal normal through the point through (the origin when omitted). - Reflection: final SymmetricForm form — The metric the reflection preserves. - Reflection: final Vec normal — The normal v of the hyperplane, a non-null vector. - Reflection: final Vec through — A point p on the hyperplane; it and every other point of the hyperplane stay fixed. - Reflection: RigidMotion get motion — The same map as a RigidMotion of form: linear part L = I − 2 v (Mv)ᵀ/Q(v), translation p − L p. - Reflection: Vec apply(Vec x) — The image x − 2B(x − p, v)/B(v, v)·v of the point x, exactly. - extension ReflectionDecomposition on SymmetricForm — Cartan–Dieudonné, constructively: orthogonal bases, isometries and rigid motions as exact chains of reflections, edge pivots and face slides. - ReflectionDecomposition: List> orthogonalBasis() — A B-orthogonal basis of non-null vectors: dim vectors, pairwise perpendicular in this metric, none null. - ReflectionDecomposition: List> reflectionNormals(Mat a) — Linear reflections (hyperplanes through the origin) whose product, first applied first, is the isometry a (Aᵀ M A = M). - ReflectionDecomposition: List> decomposeMotion(RigidMotion m) — A rigid motion x ↦ Ax + t as exact affine reflections, applied in order. - ReflectionDecomposition: List>? pivotAboutEdge(Vec p, Vec d, Vec from, Vec to) — The pivot of a module about an edge: the rotation about the line through p with direction d (in 3-D) that turns the face normal from onto the face normal to, as two reflections in planes containing the edge: first in… - ReflectionDecomposition: T? addRotationParameters(T t1, T t2) — The parameter of rotation(t₁)·rotation(t₂) for a planar metric: (t₁ + t₂)/(1 − t₁t₂/det M) (the tangent addition law; derivation: with A = M⁻¹J, A² = −I/det M). - ReflectionDecomposition: List> slide(Vec t) — A slide across a face by the translation t: two reflections in parallel planes with normal t, applied in order. - abstract final class DehnScreen — Dehn's invariant screen on exact spreads (standard mathematics, not Wildberger's). - DehnScreen: static bool isRationalMultipleOfPi(Rational spread) — Whether an angle with this rational spread is a rational multiple of π: true exactly for 0, 1/4, 1/2, 3/4 and 1 (0°, 30°, 45°, 60° and 90°, and their supplements). - DehnScreen: static bool allDihedralAnglesRationalInPi(Iterable dihedralSpreads) — A polyhedron whose dihedral spreads are all rational and all in Niven's set has Dehn invariant 0 (each term ℓ ⊗ θ vanishes in ℝ ⊗ ℝ/πℚ). - final class RtQuaternion — A quaternion w + xi + yj + zk over any field, not necessarily of norm 1. - RtQuaternion: RtQuaternion(this.field, this.w, this.x, this.y, this.z) — The quaternion w + xi + yj + zk over field. - RtQuaternion: factory RtQuaternion.ints(ScalarField f, int w, int x, int y, int z) — The quaternion with integer coordinates w + xi + yj + zk over f. - RtQuaternion: final ScalarField field — The field the coordinates live in. - RtQuaternion: final T w — The coordinates: w is the scalar part, (x, y, z) the vector part. - RtQuaternion: final T x — The coordinates: w is the scalar part, (x, y, z) the vector part. - RtQuaternion: final T y — The coordinates: w is the scalar part, (x, y, z) the vector part. - RtQuaternion: final T z — The coordinates: w is the scalar part, (x, y, z) the vector part. - RtQuaternion: RtQuaternion get conjugate — The conjugate q̄ = w − xi − yj − zk; q q̄ = norm. - RtQuaternion: T get norm — The norm |q|² = w² + x² + y² + z² (the blue quadrance of q, with no square root). - RtQuaternion: RtQuaternion get inverse — The inverse q̄ / |q|², so that q·q⁻¹ = 1 exactly. - RtQuaternion: int get hashCode - RtQuaternion: Mat toRotationMatrix() — The rotation v ↦ q v q̄ / |q|² as an exact 3 × 3 matrix (Euler–Rodrigues). q and λq give the same rotation. - RtQuaternion: Vec rotate(Vec v) — The 3-vector v rotated by v ↦ q v q̄ / |q|², exactly. - RtQuaternion: String toString() — (w, x, y, z), each coordinate formatted by the field. - RtQuaternion: RtQuaternion operator *(RtQuaternion o) — The Hamilton product this·o (i² = j² = k² = ijk = −1). - RtQuaternion: RtQuaternion operator +(RtQuaternion o) — The coordinatewise sum this + o. - RtQuaternion: bool operator ==(Object other) — Whether other is a quaternion over the same type with exactly equal coordinates (q and λq are not equal, though they give the same rotation). - final class Hurwitz — A Hurwitz integer: a quaternion whose four coordinates are all integers, or all halves of odd integers. - Hurwitz: Hurwitz.doubled(this.w2, this.x2, this.y2, this.z2) — The Hurwitz integer with doubled coordinates w2, x2, y2, z2, that is (w2 + x2 i + y2 j + z2 k)/2. - Hurwitz: factory Hurwitz(int w, int x, int y, int z) — The Lipschitz (all-integer) quaternion w + xi + yj + zk. - Hurwitz: factory Hurwitz.half(int w, int x, int y, int z) — The half-integer quaternion (w + xi + yj + zk)/2. - Hurwitz: static final Hurwitz one — The multiplicative identity 1. - Hurwitz: static List units() — The 24 units: ±1, ±i, ±j, ±k and (±1 ± i ± j ± k)/2 (the binary tetrahedral group 2T ≅ SL(2, 3)). - Hurwitz: static Hurwitz rightGcd(Hurwitz a, Hurwitz b) — A right greatest common divisor g of a and b (a = x·g and b = y·g for Hurwitz integers x, y) by the Euclidean algorithm with divRem. - Hurwitz: final BigInt w2 — The doubled coordinates 2w, 2x, 2y, 2z, all of the same parity. - Hurwitz: final BigInt x2 — The doubled coordinates 2w, 2x, 2y, 2z, all of the same parity. - Hurwitz: final BigInt y2 — The doubled coordinates 2w, 2x, 2y, 2z, all of the same parity. - Hurwitz: final BigInt z2 — The doubled coordinates 2w, 2x, 2y, 2z, all of the same parity. - Hurwitz: BigInt get norm — The norm w² + x² + y² + z² (an integer for every Hurwitz integer). - Hurwitz: Hurwitz get conjugate — The conjugate w − xi − yj − zk; q q̄ = norm. - Hurwitz: bool get isZero — Whether this is 0. - Hurwitz: bool get isUnit — Whether this is one of the 24 units (norm 1). - Hurwitz: int get hashCode - Hurwitz: RtQuaternion toQuaternion() — The same quaternion as an RtQuaternion over Q. - Hurwitz: (Hurwitz, Hurwitz) divRem(Hurwitz o) — Right division with remainder: returns (q, r) with this = q·o + r and N(r) < N(o) (the Hurwitz order is Euclidean). q rounds this·ō/N(o) to the nearer of the nearest Lipschitz point and the nearest half-integer point. - Hurwitz: String toString() — (w, x, y, z) with rational coordinates, such as (1/2, 1/2, 1/2, 1/2). - Hurwitz: Hurwitz operator *(Hurwitz o) — The Hamilton product this·o, again a Hurwitz integer. - Hurwitz: Hurwitz operator +(Hurwitz o) — The sum this + o, again a Hurwitz integer. - Hurwitz: Hurwitz operator -(Hurwitz o) — The difference this − o, again a Hurwitz integer. - Hurwitz: bool operator ==(Object other) — Whether other is the same Hurwitz integer (equal coordinates). - class AffineMap — An affine map x ↦ A x + t: first the linear part A (a square matrix), then the translation t. - AffineMap: AffineMap(this.linear, this.translation) — The map x ↦ linear x + translation. - AffineMap: factory AffineMap.identity(ScalarField f, int n) — The identity map of n-space over the field f: A = I, t = 0. - AffineMap: factory AffineMap.translation(Vec t) — The pure shift x ↦ x + t (A = I). - AffineMap: final Mat linear — The linear part A, an n × n matrix. - AffineMap: final Vec translation — The translation t, added after the linear part. - AffineMap: ScalarField get field — The field the entries live in. - AffineMap: int get dim — The dimension n of the space the map acts on. - AffineMap: AffineMap get inverse — The inverse map x ↦ A⁻¹ x − A⁻¹ t, so that m.inverse.apply(m.apply(x)) is exactly x. - AffineMap: Vec apply(Vec x) — The image A x + t of the point x, exactly. - AffineMap: AffineMap compose(AffineMap other) — The composite this ∘ other: apply other first, then this map. - AffineMap: ProjectiveMap toProjective() — The same map as a ProjectiveMap: the (n + 1) × (n + 1) homogeneous matrix with A in the top left, t in the last column and (0, …, 0, 1) as the last row. - final class RigidMotion extends AffineMap — A rigid motion: an isometry of a metric followed by a translation. - RigidMotion: RigidMotion(this.form, Mat linear, Vec translation) — The rigid motion x ↦ linear x + translation of form. - RigidMotion: final SymmetricForm form — The metric this motion preserves. - RigidMotion: RigidMotion get inverse — The inverse rigid motion, again a rigid motion of form. - RigidMotion: bool get isProper — Whether the motion is proper (det A = 1, like a rotation) rather than improper (det A = −1 for a nondegenerate form, like a reflection). - RigidMotion: RigidMotion compose(AffineMap other) — The composite this ∘ other (apply other first) as a rigid motion of the same form. - final class ProjectiveMap — A projective map: an invertible (n + 1) × (n + 1) matrix acting on homogeneous coordinates, defined up to scale. - ProjectiveMap: ProjectiveMap(this.matrix) — The map with homogeneous matrix matrix. - ProjectiveMap: factory ProjectiveMap.fromFourPoints(List> from, List> to) — The unique projective map of the plane sending the four points from to to (no three collinear, given as affine 2-D points). - ProjectiveMap: final Mat matrix — The homogeneous matrix, any one of the proportional matrices that give this map. - ProjectiveMap: ScalarField get field — The field the entries live in. - ProjectiveMap: ProjectiveMap get inverse — The inverse map. - ProjectiveMap: Vec applyHomogeneous(Vec x) — The image of the homogeneous point x (n + 1 coordinates), as a homogeneous point. - ProjectiveMap: Vec? apply(Vec x) — The image of the affine point x (n coordinates), or null when it is sent to infinity. - ProjectiveMap: ProjectiveMap compose(ProjectiveMap other) — The composite this ∘ other: apply other first, then this map. - ProjectiveMap: bool sameAs(ProjectiveMap o) — Whether o is the same projective map: whether the two matrices are proportional. ### Algebraic calculus (riptide_algebraic_calculus) import 'package:riptide_algebraic_calculus/riptide_algebraic_calculus.ray'; Calculus done exactly over the rationals and prime fields, with polynumbers and subderivatives, tangents with no limits, signed areas and quadratic curvature. https://riptidecompute.com/raya/docs/algebraic-calculus - Mset eulerProduct(int n) — The truncated Euler product ∏^ 1, p, p², … over the primes p ≤ n, caret-multiplied and cut at n: unique factorisation says it is 1, 2, 3, …, n… - CavalieriResult cavalieri(ScalarField field, int n) — Runs the derivation over field for xᴺ, using the A_k already derived for k < N (each by the same argument). - T colourQuadrance(ScalarField f, T x, T y, [Colour colour = Colour.blue]) — The quadrance of (x, y) in colour. - T quadrance(ScalarField f, Pt a, Pt b, [Colour colour = Colour.blue]) — The quadrance between two points. - CurvatureAt curvatureAt(Bipolynumber curve, T x, T y, [Colour colour = Colour.blue]) — The quadratic curvature of the curve curve = 0 at the point (x, y) on it. - T graphCurvature(Polynumber f, T x) — The curvature of the graph y = f(x) at x: K = 4(D₂f)²/(1 + (Df)²)³ (with D₂ the second subderivative). - T? circumQuadrance(ScalarField f, Pt a, Pt b, Pt c) — The circumquadrance R = Q₁Q₂Q₃/A of three points, or null when they are collinear (A = 0). - T? threePointCurvature(ScalarField f, Pt a, Pt b, Pt c) — The three-point curvature K = A/(Q₁Q₂Q₃), or null when two points coincide. - T quadrea(ScalarField f, T q1, T q2, T q3) — Archimedes' quadrea A = (Q₁ + Q₂ + Q₃)² − 2(Q₁² + Q₂² + Q₃²) = 16·area². - T graphThreePointCurvature(Polynumber f, T x1, T x2, T x3) — The three-point curvature of the graph y = f(x) at x₁, x₂, x₃ with the (xᵢ − xⱼ)² cancelled: K(x₁, x₂, x₃) = 4·fx₁,x₂,x₃² / Π (1 + fxᵢ,xⱼ²) with the divided differences written as polynomials (complete symmetric sums),… - T dividedDifference(Polynumber f, List xs) — The divided difference fx₀, …, x_k as Σ aₙ·h_{n−k}(x₀, …, x_k) (complete homogeneous symmetric sums): a polynomial in the points, defined when they coincide (where it is the k-th subderivative). - T completeSymmetric(ScalarField f, List xs, int d) — h_d(x₀, …, x_k), the sum of all monomials of degree d. - Pt? graphCentre(Polynumber f, T x) — The evolute point of the graph y = f(x) at x (the centre of curvature), or null where the bend is zero. - Dual evaluateDual(Polynumber p, Dual x) — P(a + bε) by Horner with dual arithmetic: the value and the derivative in one pass. - List> evaluateDualMatrix(Polynumber p, T a) — P evaluated on the matrix a·I + ε (Horner with 2×2 matrices): the "single matrix multiplication" that returns [P(a), 0, DP(a), P(a)]. - List> translationMatrix(ScalarField field, T c, int n) — The matrix of the translation L_c on polynumbers of degree ≤ n: column j holds the coefficients of (c + α)ʲ. - BigInt binomial(int n, int k) — The binomial coefficient C(n, k) (0 outside 0 ≤ k ≤ n), exactly. - String superscript(int n) — N as superscript digits. - Rational cornerTurn(int n) — A regular n-gon's corner, in turns: (n − 2)/(2n). - Rational vertexCurvature(List sides) — The curvature of a vertex surrounded by regular polygons with sides (in turns). - FaceMesh voxelSurface(Set<(int, int, int)> cubes) — The surface of a set of unit cubes (voxels): every cube face not shared by two cubes, as a square-faced mesh. voxelRing is a cube with a square hole drilled through: genus 1, total curvature 0. - T edgeArea(ScalarField f, Pt a, Pt b) — The signed area of the oriented edge from a to b: ½(a₁b₂ − a₂b₁). - T splineArea(ScalarField f, List> points) — The signed area of the spline A₀, A₁, …, Aₙ: the sum over its edges (@09:48). - T polygonArea(ScalarField f, List> points) — The signed area of the closed polygon A₀ … Aₙ₋₁ (the spline back to A₀). - V3 v3(Rational x, Rational y, Rational z) — A rational 3-vector. - V3 v3i(int x, int y, int z) - V3 unitPoint(Rational u, Rational v) — The rational unit vector by inverse stereographic projection of (u, v): (2u, 2v, u² + v² − 1)/(u² + v² + 1). - Rational ellipticQuadrance(V3 a, V3 b) — The elliptic quadrance of the points a, b: 1 − (a·b)² / (Q(a) Q(b)), the spread between their lines through the origin. - Rational vertexS(V3 a, V3 b, V3 c) — The spread at vertex a of the triangle a, b, c: the spread of the planes a × b and a × c. - RtQuaternion halfway(V3 x, V3 y) — The unnormalised half-way rotation carrying the unit vector x to the unit vector y along their great circle: (1 + x·y, x × y). - RtQuaternion partway(V3 x, V3 y, Rational s) — The rotation about the same axis as halfway but only part of the way: (1 + x·y, s·(x × y)) for 0 ≤ s ≤ 1. - RtQuaternion holonomy(List loop) — The holonomy of a closed polygon of rational unit vectors p₀ → p₁ → … → p₀: the product of the arcs' half-way rotations, last arc leftmost. - Rational halfExcessS(RtQuaternion h) — Sin²(E/2) = |vec h|²/|h|² for a holonomy quaternion h. - Rational excessS(RtQuaternion h) — Sin²E = 4w²|v|²/|h|⁴: the spread of the transport's turn. - V3 transportAround(List loop, V3 t) — Transports the tangent vector t at loop0 around the loop; returns the arrow that comes back. - Rational sineSquared(V3 a, V3 b) — The spread between two vectors: 1 − cross = Q(u × v) / (Q(u) Q(v)). - Bipolynumber normalParaboloid(Rational a, Rational b, Rational c) — Z = ½(ax² + 2bxy + cy²). - Bipolynumber parabolicCurve(Bipolynumber f) — The parabolic curve of a graph: the polynomial f_xx f_yy − f_xy² whose zero set separates bowls from saddles. - const RationalField rationals = RationalField() — The field of rational numbers, the default for everything in this package. - const uniformSolids - Set<(int, int, int)> get voxelRing — The 3 × 3 × 1 block of cubes with the middle one removed: a cube with a hole (his problem 19). - typedef Pt = (T, T) — A point (x, y) over a field. - typedef V3 = Vec - final class Bipolynumber — Σ a_ij αⁱβʲ over field, stored sparsely by (i, j). - Bipolynumber: factory Bipolynumber(ScalarField field, Map<(int, int), T> coefficients) — From a map (i, j) → a_ij (zeros dropped). - Bipolynumber: factory Bipolynumber.ints(ScalarField field, Map<(int, int), int> coefficients) — From integer coefficients. - Bipolynumber: factory Bipolynumber.zero(ScalarField field) - Bipolynumber: factory Bipolynumber.alpha(ScalarField field) — Α (the x direction). - Bipolynumber: factory Bipolynumber.beta(ScalarField field) — Β (the y direction). - Bipolynumber: factory Bipolynumber.constant(ScalarField field, T c) - Bipolynumber: factory Bipolynumber.graph(Polynumber p) — The graph curve β − p(α) of a polynumber p. - Bipolynumber: final ScalarField field - Bipolynumber: Map<(int, int), T> get coefficients — The non-zero coefficients. - Bipolynumber: bool get isZero - Bipolynumber: int get degree — The total degree (−1 for zero). - Bipolynumber: Bipolynumber get dAlpha — The partial subderivative ∂ in α (D on the first index). - Bipolynumber: Bipolynumber get dBeta — The partial subderivative ∂ in β. - Bipolynumber: int get hashCode - Bipolynumber: T coefficient(int i, int j) - Bipolynumber: Bipolynumber scale(T c) - Bipolynumber: Bipolynumber pow(int n) - Bipolynumber: T evaluate(T x, T y) — The value at (x, y). - Bipolynumber: Bipolynumber translate(T r, T s) — The translation P(r + α, s + β): the point (r, s) moved to the origin. - Bipolynumber: Bipolynumber truncate(int k) — Keeps the terms of total degree ≤ k. - Bipolynumber: Bipolynumber homogeneous(int k) — The homogeneous part of total degree k. - Bipolynumber: Bipolynumber tangentAt(T r, T s, int k) — The k-th tangent of the curve P = 0 at (r, s), in coordinates centred on the point: P(r + α, s + β) truncated at total degree k. k = 1 the tangent line, k = 2 the tangent conic. - Bipolynumber: Bipolynumber tangentInPlace(T r, T s, int k) — The same tangent written back in the original coordinates (α − r, β − s substituted). - Bipolynumber: String toString() — "1 + 2α − αβ + β²" (lower total degree first). - Bipolynumber: String format([String x = 'x', String y = 'y']) - Bipolynumber: Bipolynumber operator +(Bipolynumber o) - Bipolynumber: Bipolynumber operator -(Bipolynumber o) - Bipolynumber: Bipolynumber operator *(Bipolynumber o) - Bipolynumber: bool operator ==(Object other) - final class Box implements Comparable — A box (black, anti = false) or anti-box (red) holding a multiset of boxes. - Box: factory Box(Iterable elements, {bool anti = false}) — A box of elements (pairs of a box and its anti annihilate). - Box: factory Box.zero({bool anti = false}) — The empty box 0 (or anti-zero). - Box: factory Box.nat(int n, {bool anti = false}) — The natural number n: a box of n zeros. - Box: factory Box.natList(List ns, {bool anti = false}) — The mset of naturals n₁, n₂, … (a polynumber written as its exponents: 2,3 is α² + α³). - Box: factory Box.integer(int k) — The integer k: a box of |k| zeros, anti-zeros for negative k. - Box: final bool anti - Box: final List elements — The contents, sorted (canonical form). - Box: int get size - Box: Box get flipped — The anti of this box: same contents, other colour. - Box: bool get isNumber — True when every element is a black or red zero. - Box: int get asInteger — As an integer: the count of black zeros minus red zeros (for boxes of zeros). - Box: List get asNatList — As an mset of naturals, sorted descending in insertion-free canonical order (for boxes of black naturals). - Box: int get hashCode - Box: int compareTo(Box o) - Box: String toString() — Brackets: black, ⟦ ⟧ red; a box of black zeros prints as its count. - Box: Box operator +(Box o) — A + B: pool the contents; the type is the product of the types. - Box: Box operator *(Box o) — A × B = a + b for a in A, b in B. - Box: Box operator ^(Box o) — A ^ B (caret) = a × b for a in A, b in B. - Box: bool operator ==(Object other) - final class Mset — The mset of naturals as a multiset of ints (insertion order irrelevant): sum is union, product forms pairwise sums, caret pairwise products. - Mset: Mset(Iterable elements) - Mset: final List elements - Mset: int get hashCode - Mset: Mset upTo(int n) — Keeps the elements ≤ n (a finite truncation of an "open box"). - Mset: String toString() - Mset: Mset operator +(Mset o) - Mset: Mset operator *(Mset o) - Mset: Mset operator ^(Mset o) - Mset: bool operator ==(Object other) - final class CavalieriResult — The outcome of the five-property derivation for one N. - CavalieriResult: final int n - CavalieriResult: final T? coefficient — A_N = ∫₀¹ xᴺ, or null when the properties are inconsistent in this field. - CavalieriResult: final List<(T, T)> equations — The coefficient-comparison equations, k = 1 … N+1, as (left factor C(N+1,k), right factor C(N,k−1)·A_{k−1}). - CavalieriResult: final String? failure — Why the derivation fails (null when it succeeds). - CavalieriResult: bool get ok - enum Colour — Which quadratic form measures quadrance: blue x² + y² (Euclid), red x² − y², green 2xy (chromogeometry). - Colour: blue - Colour: red - Colour: green - final class CurvatureAt — The quadratic curvature of an algebraic curve at one of its points. - CurvatureAt: final ScalarField field - CurvatureAt: final Pt point - CurvatureAt: final T l — The tangent conic at the point, centred there: lx + my + nx² + 2pxy + qy². - CurvatureAt: final T m — The tangent conic at the point, centred there: lx + my + nx² + 2pxy + qy². - CurvatureAt: final T n — The tangent conic at the point, centred there: lx + my + nx² + 2pxy + qy². - CurvatureAt: final T p — The tangent conic at the point, centred there: lx + my + nx² + 2pxy + qy². - CurvatureAt: final T q — The tangent conic at the point, centred there: lx + my + nx² + 2pxy + qy². - CurvatureAt: final Colour colour - CurvatureAt: T get bend — The tangent conic's quadratic part read along the tangent direction: nm² − 2plm + ql². - CurvatureAt: T get gradientQuadrance — The gradient's quadrance l² + m² (in colour, the gradient's dual form). - CurvatureAt: bool get isSingular — True at a singular point (l = m = 0): no tangent line, no curvature. - CurvatureAt: T? get curvature — K = 4(nm² − 2plm + ql²)²/(l² + m²)³, or null at a singular point (or a null tangent in red/green). - CurvatureAt: T? get radiusQuadrance — R = 1/K, the quadrance of the radius of curvature (null when K = 0 or undefined). - CurvatureAt: Pt? get centre — The centre of curvature X − (l, m)·(l² + m²)/(2·bend), or null on a line (bend 0) or at a singular point. - CurvatureAt: Pt? get focus — The focus of the normal parabola: half way from the point to the centre (the centre is "twice the focus"). - CurvatureAt: T? get radiusQuadranceFromFocus — R = 4(f² + g²) from the focus offset (f, g): the same number as radiusQuadrance. - final class DcbCurve — A dCB curve with control points P₀ … Pₙ over field. - DcbCurve: DcbCurve(this.field, List> controls) - DcbCurve: factory DcbCurve.ints(ScalarField field, List<(int, int)> points) — Integer control points. - DcbCurve: factory DcbCurve.fromPolyCurve(PolyCurve g, [int? degree]) — The control points of the polynumber curve γ (degree n): bᵢ = Σ_{j ≤ i} C(i, j)/C(n, j)·aⱼ, the inverse Pascal times diag(1/binomials)… - DcbCurve: final ScalarField field - DcbCurve: final List> controls - DcbCurve: int get degree - DcbCurve: PolyCurve get polyCurve — The polynumber curve Σ Pᵢ·C(n, i)·tⁱ(1 − t)ⁿ⁻ⁱ (the Bernstein form expanded). - DcbCurve: T get controlPolygonArea — The signed area of the closed control polygon P₀ … Pₙ. - DcbCurve: T get sliceArea — The signed area of the slice: the curve from P₀ to Pₙ, then back along the chord. - DcbCurve: Pt get archimedeanPoint — The Archimedean point: γ(½) for a parabola, (P₀ + 3P₁ + 3P₂ + P₃)/8 for a cubic, in general the binomially… - DcbCurve: T get archimedesTriangleArea — The signed area of the inscribed triangle P₀, C, Pₙ. - DcbCurve: bool get isArchimedean — True when the cubic is Archimedean: Δ₂₃ = 0 for its polynumber curve (the point at infinity is singular; equivalently four equally spaced parallel lines through P₀ … P₃… - DcbCurve: List>> ladder(T t) — The de Casteljau ladder at t: level 0 is the control points, level k has n + 1 − k points, the last level is the curve's point γ(t). - DcbCurve: Pt at(T t) — Γ(t) by de Casteljau. - DcbCurve: (DcbCurve, DcbCurve) split(T t) — The two halves at t: P₀, Q₀, R₀, …, γ(t) and γ(t), …, R₁, Q₂, Pₙ, each again a dCB curve on 0, 1. - DcbCurve: String toString() - final class Dual — A + bε with ε² = 0, over field. - Dual: const Dual(this.field, this.a, this.b) - Dual: factory Dual.at(ScalarField field, T a) — A + ε (the point a with unit infinitesimal direction). - Dual: final ScalarField field - Dual: final T a - Dual: final T b - Dual: bool get isInvertible — Bε alone has no inverse; a + bε has one exactly when a ≠ 0. - Dual: Dual get inverse - Dual: List> get matrix — The 2×2 matrix a·I + b·ε = [a, 0, b, a]. - Dual: int get hashCode - Dual: String toString() - Dual: Dual operator +(Dual o) - Dual: Dual operator -(Dual o) - Dual: Dual operator *(Dual o) - Dual: bool operator ==(Object other) - final class Maxel — A multiset of pixels k, l with integer multiplicities (negative = anti-pixels). - Maxel: factory Maxel(Map<(int, int), int> multiplicities) — From pixel multiplicities (zeros dropped). - Maxel: factory Maxel.pixels(Iterable<(int, int)> pixels) — From a list of pixels, repeats counted: {11, 12, 12, 23} is Maxel.pixels((1,1), (1,2), (1,2), (2,3)). - Maxel: factory Maxel.identity(Iterable indices) — The identity on the index set indices: {i, i}. - Maxel: factory Maxel.zeta(List elements, bool Function(int a, int b) leq) — The zeta maxel of a poset: {a, b: a ≤ b}. - Maxel: static Maxel mobius(List elements, bool Function(int a, int b) leq) — The inverse of an upper-unitriangular maxel on a finite poset (the zeta maxel's inverse is the Möbius maxel), by the recursion μ(a, a) = 1, μ(a, b) = −Σ_{a ≤ c < b} μ(a, c). - Maxel: Map<(int, int), int> get multiplicities - Maxel: int get size — The number of pixels (anti-pixels count negatively). - Maxel: List<(int, int)> get pixelList — The pixels as a sorted list, repeats written out: (1,1), (1,1), (1,4), …. - Maxel: int get hashCode - Maxel: String toString() — "{11,11,14,14,25}" for single-digit indices. - Maxel: int operator []((int, int) pixel) - Maxel: Maxel operator +(Maxel o) - Maxel: Maxel operator -() - Maxel: Maxel operator -(Maxel o) - Maxel: Maxel operator *(Maxel o) — The product: every pixel of this times every pixel of o; blanks dropped. - Maxel: bool operator ==(Object other) - final class Polynumber — A polynumber a₀ + a₁α + … + aₙαⁿ over the field field, stored as its coefficient list (no trailing zeros). - Polynumber: factory Polynumber(ScalarField field, Iterable coefficients) — The polynumber with coefficients coefficients (a₀ first). - Polynumber: factory Polynumber.ints(ScalarField field, List coefficients) — Integer coefficients, mapped into field. - Polynumber: factory Polynumber.rationals(ScalarField field, List coefficients) — Rational coefficients, mapped into field (throws when a denominator vanishes in it). - Polynumber: factory Polynumber.constant(ScalarField field, T c) — The constant polynumber c. - Polynumber: factory Polynumber.zero(ScalarField field) — The zero polynumber . - Polynumber: factory Polynumber.alpha(ScalarField field) — Α = 0, 1. - Polynumber: factory Polynumber.monomial(ScalarField field, int n, [T? c]) — Αⁿ. - Polynumber: final ScalarField field - Polynumber: List get coefficients — The coefficients a₀ … aₙ (empty for zero). - Polynumber: int get degree — The degree, −1 for the zero polynumber. - Polynumber: bool get isZero - Polynumber: Polynumber get derivative — The derivative D = D₁ (Faulhaber's D: D αⁿ = n αⁿ⁻¹). - Polynumber: Polynumber get integral — Faulhaber's integral S: S αⁿ = αⁿ⁺¹/(n + 1). - Polynumber: int get hashCode - Polynumber: Polynumber scale(T c) — C·p. - Polynumber: Polynumber pow(int n) — Pⁿ (n ≥ 0). - Polynumber: T evaluate(T x) — The value at x (Horner): the polynumber read as a function, which over GF(p) forgets information. - Polynumber: Polynumber compose(Polynumber q) — P∘q, the polynumber q substituted for α. - Polynumber: Polynumber translate(T c) — The translation L_c p = p(c + α). - Polynumber: Polynumber subderivative(int k) — The k-th subderivative D_k p: D_k αⁿ = C(n, k)·αⁿ⁻ᵏ… - Polynumber: T subderivativeAt(int k, T c) — D_k p evaluated at c, read off the translated polynumber (the k-th entry of p(c + α)). - Polynumber: Polynumber tangent(T c, int k) — The k-th tangent T_c^k p: p(c + β) truncated after βᵏ, written back in α (β = α − c). k = 1 is the tangent line, 2 the tangent conic, 3 the tangent cubic… - Polynumber: Polynumber truncate(int k) — The truncation after αᵏ (degree ≤ k). - Polynumber: T integrate(T t, T u) — The relative integral S_t^u p = (S p)(u) − (S p)(t). - Polynumber: bool sameFunctionAs(Polynumber o) — True when the two agree as functions on every element of a finite field (α and α⁷ over GF(7) do, though they are different polynumbers… - Polynumber: String toString() — "5588 + 299α + 4α²" (or with another letter). - Polynumber: String format([String letter = 'α']) - Polynumber: T operator [](int k) — Aₖ (zero beyond the degree). - Polynumber: Polynumber operator +(Polynumber o) - Polynumber: Polynumber operator -(Polynumber o) - Polynumber: Polynumber operator -() - Polynumber: Polynumber operator *(Polynumber o) — The Cauchy product: 1,3·5,2 = 5,17,6. - Polynumber: bool operator ==(Object other) - final class UniformSolid — A vertex-transitive solid: one vertex configuration (e.g. 4, 6, 6) and its vertex count. - UniformSolid: const UniformSolid(this.name, this.configuration, this.vertices) - UniformSolid: final String name - UniformSolid: final List configuration - UniformSolid: final int vertices - UniformSolid: Rational get perVertex - UniformSolid: Rational get total - UniformSolid: int get euler — V − E + F counted from the configuration: E = V·deg/2, F = Σₙ V·(n's at a vertex)/n. - final class FaceMesh — A polyhedral surface given by its faces (vertex ids, each face a regular polygon). - FaceMesh: FaceMesh(this.faces) - FaceMesh: final List> faces - FaceMesh: Set get vertexIds - FaceMesh: int get edgeCount - FaceMesh: int get euler - FaceMesh: Map get curvatures — Each vertex's curvature in turns. - FaceMesh: Rational get total - final class PolyCurve — A polynumber curve γ = (p, q): x = p, y = q. - PolyCurve: PolyCurve(this.p, this.q) - PolyCurve: final Polynumber p - PolyCurve: final Polynumber q - PolyCurve: ScalarField get field - PolyCurve: int get degree - PolyCurve: PolyCurve get derivative — The velocity (Dp, Dq). - PolyCurve: Polynumber get areaDifferential — The area differential p·Dq − q·Dp. - PolyCurve: Pt at(T t) — Γ(t). - PolyCurve: T signedArea(T t, T u) — S_t^u(γ) = ½ S_t^u(p·Dq − q·Dp): the area subtended at the origin O by the arc from t to u. - PolyCurve: T signedAreaByMonomials(T t, T u) — The same number from the monomial formula and bilinearity alone (the five-property extension). - PolyCurve: T sliceArea(T t, T u) — The signed area of the slice cut off by the chord: the arc from t to u, then back along the chord (S_t^u(γ) − edge(γ(t), γ(u))). - PolyCurve: T delta(int i, int j) — Δ_ij = pᵢqⱼ − pⱼqᵢ, the coefficient determinants. - PolyCurve: T cubicSliceArea(T t, T u) — For an Archimedean curve of degree ≤ 3 (Δ₂₃ = 0), the slice area by Wildberger's closed form (⅙Δ₁₂ + ¼Δ₁₃(t + u))(u − t)³. - PolyCurve: String toString() - final class EllipticTriangle — A spherical (elliptic) triangle with its three quadrances and spreads (qᵢ opposite vertex i, Sᵢ at vertex i). - EllipticTriangle: EllipticTriangle(this.a1, this.a2, this.a3) - EllipticTriangle: final V3 a1 - EllipticTriangle: final V3 a2 - EllipticTriangle: final V3 a3 - EllipticTriangle: final Rational q1 - EllipticTriangle: final Rational q2 - EllipticTriangle: final Rational q3 - EllipticTriangle: final Rational s1 - EllipticTriangle: final Rational s2 - EllipticTriangle: final Rational s3 - EllipticTriangle: bool get sLaw — S₁/q₁ = S₂/q₂ = S₃/q₃ (cross-multiplied, so a zero quadrance is fine). - EllipticTriangle: bool get crossLaw — (q₂q₃S₁ − q₁ − q₂ − q₃ + 2)² = 4(1 − q₁)(1 − q₂)(1 − q₃), and the same at every vertex. - EllipticTriangle: bool get pythagoras — Pythagoras: when S₁ = 1, q₁ = q₂ + q₃ − q₂q₃ (true when S₁ ≠ 1 too, vacuously). - enum QuadricKind — What the tangent quadric looks like: a bowl (K > 0), a saddle (K < 0) or a trough (K = 0). - QuadricKind: elliptic - QuadricKind: hyperbolic - QuadricKind: parabolic - final class SurfacePoint — The second-order picture of z = f(x, y) at (r, s), exact. - SurfacePoint: SurfacePoint(this.f, this.r, this.s) - SurfacePoint: final Bipolynumber f - SurfacePoint: final Rational r - SurfacePoint: final Rational s - SurfacePoint: final Bipolynumber shifted — f(r + α, s + β): its (1,0), (0,1) entries are the slopes, (2,0), (1,1), (0,2) the second subderivatives. - SurfacePoint: Rational get z - SurfacePoint: Rational get fx - SurfacePoint: Rational get fy - SurfacePoint: Rational get fxx — f_xx, f_xy, f_yy (twice, once and twice the subderivatives). - SurfacePoint: Rational get fxy - SurfacePoint: Rational get fyy - SurfacePoint: Bipolynumber get tangentPlane — The tangent plane in place: z = constant + f_x·x + f_y·y. - SurfacePoint: Bipolynumber get tangentQuadric — The tangent quadric in place. - SurfacePoint: Rational get gaussian — K = (f_xx f_yy − f_xy²)/(1 + f_x² + f_y²)². - SurfacePoint: Rational get hessian — The Hessian determinant f_xx f_yy − f_xy² (its sign is the quadric's kind; at a horizontal point it is K). - SurfacePoint: QuadricKind get kind ### Exact special functions (riptide_rational_special) import 'package:riptide_rational_special/riptide_rational_special.ray'; Special functions for rational trigonometry: spread polynomials, spread periods, the Cayley circle and spread series, next to their classic counterparts. https://riptidecompute.com/raya/docs/rational-special - List padeExpCoefficients(int m) — The coefficients pⱼ of the m/m Padé approximant of e^x = P(x)/P(−x): pⱼ = (2m − j)! m! / ((2m)! j! - Rational padeExp(Rational x, int m) — E^x ≈ P(x)/P(−x), the m/m Padé approximant, exactly at a rational x. - double padeExp64(double x, int m) — padeExp in doubles. - Rational mitchellLog2(Rational x) — Mitchell's log₂ (J. - Rational mitchellExp2(Rational y) — Mitchell's 2^y, the inverse of mitchellLog2: 2^⌊y⌋·(1 + frac y). - double mitchellLog264(double x) — mitchellLog2 in doubles: the exponent field plus the mantissa's fraction (positive normal x). - double mitchellExp264(double y) — mitchellExp2 in doubles. - double angleOfSpread(double s) — The angle θ in 0, π/2 whose sin² is the spread s: θ = asin √s (the classic way in from a spread). - double angleOfSpread32(double s) — angleOfSpread in single precision (each operation correctly rounded to f32: the best an f32 unit can do). - double sinSquaredTurn(int n, double theta) — Sin²(nθ), the spread of the n-fold turn, the classic way: multiply the angle, take the sine, square it. - double sinSquaredTurn32(int n, double theta32) — sinSquaredTurn in single precision: nθ rounded to f32, its sine correctly rounded to f32, squared in f32. - double classicSpreadTurn(int n, double s) — The classic pipeline from a spread: θ = asin √s, then sin²(nθ). - double classicSpreadTurn32(int n, double s) — The same in single precision. - double cosTurnBySteps(int n, double theta) — cos(nθ) by n repeated angle steps (the turn applied n times with cos θ and sin θ): the textbook loop. - double cosTurnChebyshev(int n, double theta) — cos(nθ) by Chebyshev's recurrence Tₖ₊₁ = 2cos θ·Tₖ − Tₖ₋₁ from one cosine. - (double, double) directionOfAngle(double phi) — The direction of the line at angle φ (to draw the classic side's lines). - (double, double) directionOfAngle32(double phi32) — The direction in single precision (cos and sin of the f32 angle, rounded to f32). - List fourierCoefficients(SeriesTarget target, int n) — The Fourier cosine coefficients a₀ … a_N of a target as a function of u = 2θ (g(u) = f(s) with cos u = 1 − 2s): g(u) ≈ Σ aₘ cos(mu). - double fourierAt(List a, double s) — The truncated Fourier series at the spread s: Σ aₘ cos(m·2θ) with θ = asin √s. - double classicExp(double x) — E^x, the classic way (the library's exp). - double classicLog2(double x) — Log₂ x, the classic way. - double degreesOfSpread(double s) — The angle in degrees whose sin² is the spread s (to read a spread as an angle, at the edge). - (double, double) directionOfDegrees(double degrees) — The direction of the line at degrees. - double ratioToDouble(BigInt p, BigInt q) — P/q as a double, within 2⁻⁵⁸ relative, for numbers of any size: both are cut to their top 62 bits first, so a million-bit fraction costs two shifts, not a million-bit division. - double pow2(int k) — 2ᵏ as a double, exactly (0 below the smallest subnormal, ∞ above the largest double). - int bitsOfFraction(BigInt p, BigInt q) — The cost of an exact fraction: bits of numerator and denominator together. - int bitsOf(Rational r) — The cost of a rational: bits of numerator and denominator together. - int decimalDigits(BigInt n) — The decimal digits of a big integer (its length when written out), without writing it out (±1 when huge). - double f32(double x) - List legendreInSpread(int n) — The integer coefficients of Pₙ(1 − 2s) in powers of s. - Rational legendreOfSpread(int n, Rational s) — Pₙ(1 − 2s) at a rational spread, exactly. - Rational chebyshevU(int k, Rational x) — Uₖ(x), Chebyshev's second kind, exactly: U₀ = 1, U₁ = 2x, Uₖ₊₁ = 2xUₖ − Uₖ₋₁ (sin 2(k+1)θ = sin 2θ·Uₖ(cos 2θ)). - Rational quarterTurnStep(int n) — The rational spread σ of one step of an n-step quarter turn: near the smallest root of Uₙ₋₁(1 − 2σ) (where the line after n steps is first perpendicular, sin 2nθ = 0), bracketed by bisection on its sign, then the… - Rational simplestBetween(Rational x, Rational y) — The fraction with the smallest denominator in x, y (0 ≤ x ≤ y), by continued fractions (the Stern–Brocot descent). - BigInt quadrance(BigInt x, BigInt y) — The quadrance of the vector (x, y): x² + y² (the square of the distance, with no root taken). - BigInt crossOf(BigInt ax, BigInt ay, BigInt bx, BigInt by) — The cross of two vectors, x₁y₂ − x₂y₁ (twice the signed area of their triangle). - Rational spreadOf(BigInt ax, BigInt ay, BigInt bx, BigInt by) — The spread between the lines along (ax, ay) and (bx, by): (x₁y₂ − x₂y₁)²/(Q₁Q₂). - (BigInt, BigInt, BigInt) chebyshevLadder(int n, BigInt c, BigInt b) — The homogeneous Chebyshev ladder: (bⁿ·Tₙ(c/b), bⁿ⁺¹·Tₙ₊₁(c/b), bⁿ) in O(log n) big multiplications, by T₂ₖ = 2Tₖ² − 1 and T₂ₖ₊₁ = 2TₖTₖ₊₁ − T₁, each multiplied through by the matching power of b so that everything… - Rational chebyshevT(int n, Rational x) — The Chebyshev polynomial Tₙ(x) at a rational x, exactly (Tₙ(cos θ) = cos nθ classically). - SpreadValue spreadExact(int n, Rational s) — Sₙ(s), the spread of the n-fold turn whose single turn has spread s, exactly, in O(log n) big multiplications: Sₙ(s) = (1 − Tₙ(1 − 2s))/2 (Goh–Wildberger §1; Wildberger, Divine Proportions). - SpreadValue spreadRecurrence(int n, Rational s) — Sₙ(s) exactly by the recurrence Sₖ₊₁ = 2(1 − 2s)Sₖ − Sₖ₋₁ + 2s (S₀ = 0, S₁ = s; Goh–Wildberger eq. 1), O(n) steps, as integers over bᵏ: Pₖ₊₁ = 2(b − 2a)Pₖ − b²Pₖ₋₁ + 2a·bᵏ. - List spreadPolynomial(int n) — The coefficients of Sₙ(s) = c₀ + c₁s + … + cₙsⁿ, all integers (S₂ = 4s − 4s², S₃ = 9s − 24s² + 16s³). - Rational evaluatePolynomial(List coefficients, Rational x) — Evaluates integer coefficients at a rational, exactly (Horner). - ({BigInt x, BigInt y, bool rootOnX}) turnLineAt(int n, Rational s) — The line lₙ of the n-fold turn of spread s = a/b at any n, exactly, in O(log n) big multiplications (no stepping through l₁ … lₙ₋₁): from the ladder's bⁿTₙ and bⁿ⁺¹Tₙ₊₁, tan nθ = (c·bⁿTₙ − bⁿ⁺¹Tₙ₊₁)/(2r(bⁿ + bⁿTₙ))… - ({SpreadValue spread, ({BigInt x, BigInt y, bool rootOnX}) line}) turnAt(int n, Rational s) — Sₙ(s) and the line lₙ from one ladder (see spreadExact and turnLineAt). - (double, double) lineDirection(({BigInt x, BigInt y, bool rootOnX}) p, double root) — A line's integer parts as a double direction, with r passed in (the one root, at the edge). - (double, double) turnLineDirection(int n, Rational s, double root) — turnLineAt as a double direction for drawing, with r = √(a(b − a)) passed in by the caller (the one root, at the screen's edge). - int spreadMod(int n, Rational s, int p) — Sₙ(s) mod p for a prime p not dividing s's denominator, in O(log n) integer steps (p < 2³¹): the finite-field shadow of the exact value, which never grows. - int? spreadPeriod(Rational s, int p) — The spread period of s at the prime p (Goh–Wildberger, Spread periodicity theorem): the least m ≥ 1 with p | Sₘ(s). - double spreadLadder64(int n, double s) — Sₙ(s) in f64 by the O(log n) ladder in spread form: S₂ₖ = 4Sₖ(1 − Sₖ) (S₂ is the logistic map) and S₂ₖ₊₁ = 2Sₖ + 2Sₖ₊₁ − 4SₖSₖ₊₁ − s (from Sₘ₊ₙ + Sₘ₋ₙ = 2Sₘ + 2Sₙ − 4SₘSₙ, our derivation from the classical sin²(α + β)… - double spreadRecurrence64(int n, double s) — Sₙ(s) in f64 by the recurrence Sₖ₊₁ = 2(1 − 2s)Sₖ − Sₖ₋₁ + 2s: n − 1 multiply-adds. - double spreadLadder32(int n, double s0) — spreadLadder64 with every operation rounded to single precision. - double spreadRecurrence32(int n, double s0) — spreadRecurrence64 with every operation rounded to single precision. - abstract final class Cayley - Cayley: static (Rational, Rational) point(Rational t) — The point of the unit circle at parameter t. - Cayley: static Rational? compose(Rational t1, Rational t2) — The parameter of "turn by t₁, then by t₂"; null for a half turn (t = ∞, the point (−1, 0)). - Cayley: static (BigInt, BigInt) gaussianPower(BigInt q, BigInt p, int n) — (q + ip)ⁿ = x + iy, by squaring: O(log n) Gaussian multiplications. - Cayley: static Rational? nFold(Rational t, int n) — The parameter of the n-fold turn of t, exactly; null when it is the half turn. - Cayley: static Rational spread(Rational t) — The spread a turn by t makes (between any line and its turned image): 4t²/(1 + t²)². - enum RaceMethod — The contenders. - RaceMethod: classic — Θ = asin √s, then sin²(nθ): the classic way in from a spread (f64). - RaceMethod: classicAngleGiven — Sin²(nθ) with θ already known (the classic cost when the angle comes for free) (f64). - RaceMethod: ladder — Sₙ(s) by the O(log n) ladder (f64): + − × only. - RaceMethod: recurrence — Sₙ(s) by the recurrence, n − 1 multiply-adds (f64). - RaceMethod: exact — Sₙ(s) exactly over Q by the integer ladder (fewer inputs: it is slow, and says so). - final class RaceLane — One lane's tally. - RaceLane: RaceLane(this.method, this.total) - RaceLane: final RaceMethod method - RaceLane: final int total — Inputs to run, inputs done, the time they took (µs, the loop only) and a checksum the loop must produce. - RaceLane: int done - RaceLane: int micros - RaceLane: double checksum - RaceLane: double? maxError — The worst |value − exact| over the sampled inputs (null until sampled; 0 for the exact lane). - RaceLane: bool get finished - RaceLane: double? get nsPer — Nanoseconds per input so far. - final class SpreadRace — A race at one n over points inputs sᵢ = (2i + 1)/(2·points), i < points: dyadic, so the double each float lane reads is the input itself and the exact value of that very input is the reference. - SpreadRace: SpreadRace({required this.n, this.points = 1 << 20, this.exactPoints = 256, this.samples = 64}) - SpreadRace: static const order — The order lanes run in (interleaved by chunks so drift in the machine's clock hits all alike). - SpreadRace: final int n - SpreadRace: final int points - SpreadRace: final int exactPoints - SpreadRace: final int samples - SpreadRace: final Map lanes - SpreadRace: bool get finished - SpreadRace: double get progress — Share done, 0 … 1. - SpreadRace: double input(int i) - SpreadRace: Rational exactInput(int i) - SpreadRace: int sampleIndex(int k) — The sampled inputs' indices. - SpreadRace: bool step(int budgetMicros, {int Function()? clock}) — Runs pieces of the race for about budgetMicros; true when everything is done. - enum SeriesTarget — Shapes to approximate, each a function of the spread s on 0, 1 that is rational at rational s (so it can be compared exactly): classically functions of cos 2θ = 1 − 2s. - SeriesTarget: kink - SeriesTarget: step — sign(1 − 2s) = sign(cos 2θ): a jump at s = 1/2 (0 there). - SeriesTarget: bump — 1/(1 + 16(1 − 2s)²): smooth, a peak at s = 1/2 (Runge's bump, in the spread). - SeriesTarget: Rational exact(Rational s) - SeriesTarget: double at(double s) - enum SeriesNodes — Where the exact series samples the target. - SeriesNodes: turns — The spreads of a line turning evenly: sⱼ = Sⱼ(σ) for j = 0 … N, where σ is the rational spread of one step that makes N steps a quarter turn (to within 2⁻²⁴), found by bisection on the sign of Uₙ₋₁(1 − 2σ): exact,… - SeriesNodes: cayley — The rational points of the circle at Cayley t = j/N: spreads 4t²/(1 + t²)², close to evenly spread in angle. - SeriesNodes: equalSpread — Evenly spaced spreads j/N (crowded near neither end: Runge's phenomenon, honestly shown). - SeriesNodes: List of(int n) - final class SpreadInterpolant — The polynomial of degree ≤ N through (sⱼ, f(sⱼ)) at N + 1 rational nodes, exactly (Newton's divided differences), and its coefficients in the spread basis {1, S₁, …, S_N}. - SpreadInterpolant: SpreadInterpolant(this.nodes, List values) - SpreadInterpolant: factory SpreadInterpolant.of(SeriesTarget target, SeriesNodes kind, int degree) — The series for target with degree + 1 nodes of kind. - SpreadInterpolant: final List nodes - SpreadInterpolant: late final List newton - SpreadInterpolant: int get degree - SpreadInterpolant: late final List monomial — Its coefficients in powers of s, exactly. - SpreadInterpolant: late final List spreadCoefficients — C₀, c₁, …, c_N with the interpolant = c₀ + Σ cₖSₖ(s), exactly: back-substitution from the top degree (Sₖ has degree k and leading coefficient (−1)ᵏ⁺¹4ᵏ⁻¹, and Sₖ(0) = 0 for k ≥ 1). - SpreadInterpolant: int get bits — The bits of all spread-basis coefficients: the cost of writing the series down exactly. - SpreadInterpolant: Rational evaluate(Rational s) — The interpolant at s, exactly. - SpreadInterpolant: double at(double s) - final class SpreadValue — An exact value of a spread polynomial: Sₙ(a/b) = numerator/denominator with denominator = bⁿ, kept unreduced: its size is the honest cost of exactness (n·log₂ b bits). - SpreadValue: const SpreadValue(this.n, this.numerator, this.denominator) - SpreadValue: final int n - SpreadValue: final BigInt numerator - SpreadValue: final BigInt denominator - SpreadValue: Rational get rational — The value as a reduced rational (a gcd of the two: costly when they are huge). - SpreadValue: int get bits — Bits of numerator and denominator. - SpreadValue: double toDouble() — The value as a double (within 2⁻⁵⁸ relative; an edge, for drawing and for measuring floats against it). - SpreadValue: String toString() - final class TurnLines — The lines of an n-fold turn, exactly, with no angle: l₀ is the x-axis, l₁ makes spread s = a/b with it, and lₖ₊₁ is lₖ₋₁ reflected in lₖ (Goh–Wildberger §1.3), so the spread between l₀ and lₖ is Sₖ(s). - TurnLines: TurnLines(Rational s) - TurnLines: final BigInt a - TurnLines: final BigInt b - TurnLines: late final BigInt c - TurnLines: late final BigInt b2 - TurnLines: int get k — The index of the newest line. - TurnLines: BigInt get t — BᵏTₖ(1 − 2s) and bᵏ⁻¹Uₖ₋₁(1 − 2s) for the newest line, and bᵏ. - TurnLines: BigInt get u - TurnLines: BigInt get bk - TurnLines: SpreadValue get spread — The spread between l₀ and the newest line: Sₖ(s) = (bᵏ − bᵏTₖ)/(2bᵏ), exactly. - TurnLines: ({BigInt x, BigInt y, bool rootOnX}) get directionParts — The newest line's direction as integers (x, y) and where the fixed root r = √(a(b − a)) multiplies in: (bᵏ + bᵏTₖ, 2bᵏ⁻¹Uₖ₋₁·r) = 2cos kθ·bᵏ(cos kθ, sin kθ), or, when cos kθ < 0 (so that the first form could cancel to… - TurnLines: int get bits — The bits the newest line costs (T and U together). - TurnLines: void reset() - TurnLines: void next() — Turns once more (k → k + 1): two big multiply-adds, no angle. - TurnLines: (double, double) direction(double root) — The newest line as a double direction for drawing. r = √(a(b − a)) is the one root in the family, taken by the caller at the screen's edge and passed in as root (so this file has no root function). ### Differential geometry (riptide_geometry) import 'package:riptide_geometry/riptide_geometry.ray'; Index-notation tensors, metrics and curvature by exact second-order differentiation, differential forms with wedge, d and Hodge star, discrete exterior calculus on meshes, and Lorentz and spinor transformations. https://riptidecompute.com/raya/docs/geometry - int popCount(int x) — The number of set bits. - int wedgeSign(int a, int b) — The sign of e^A ∧ e^B for disjoint blades A, B (bit i = dx^i): (−1)^(pairs i in A, j in B with i > j). - (Float64List, Float64List) gaussLegendre(int n) — Gauss–Legendre nodes and weights on −1, 1 (Newton on Legendre polynomials; exact for degree 2·n − 1). - double gaussLinkingIntegral(List Function(double t) a, List Function(double t) b, {int samples = 400}) — The Gauss linking integral of two closed curves a, b: 0, 2π → ℝ³, Lk = (1/4π) ∮∮ (a − b)·(a′ × b′) / |a − b|³ — an integer, the linking number (sign by orientation). - Float64List rotationMatrix(List axis, double angle) — The 3 × 3 rotation matrix by angle about the unit axis (Rodrigues): the radians form of rotationMatrixTurn. - Float64List rotationMatrixCayley(List axis, double t) — The 3 × 3 rotation matrix with Cayley parameter t = tan(θ/2) about axis: rational in t (Euler–Rodrigues), so a rational t on a rational unit axis gives an exactly rational matrix. - Float64List rotationMatrixTurn(List axis, Turn turn) — The 3 × 3 rotation matrix about axis by the turn (c, s) = (cos θ, sin θ) (Rodrigues, no trigonometry). - List nullVectorOfSpinor((Complex, Complex) xi) — The null 4-vector k^μ = ½ tr(σ_μ ξ ξ†) of a spinor ξ (Penrose: every null direction is a spinor up to phase). - double wignerCayleyPerpendicular(double a, double b) — The Cayley parameter tan(θ/2) of the Thomas–Wigner rotation produced by composing a boost of rapidity a with a perpendicular boost of rapidity b: tanh(a/2)·tanh(b/2) (closed form, for checking Lorentz.decompose). - double wignerAnglePerpendicular(double a, double b) — The Thomas–Wigner rotation angle of wignerCayleyPerpendicular, in radians. - Float64List invert(Float64List a, int n) — The inverse of a small dense matrix (Gauss–Jordan with partial pivoting). - double determinantOf(Float64List a, int n) — The determinant of a small dense matrix (LU with partial pivoting). - Float64List rotationMatrixOf(RtQuaternion q) — The rotation matrix (row-major 3 × 3, float) of an exact rational quaternion: every entry is the correctly rounded value of the exact rational entry (error ≤ ½ ulp each; the exact matrix is orthogonal). - UnitQuaternion unitQuaternionOf(RtQuaternion q) — The float unit quaternion q/|q| of an exact rational quaternion, for the SU(2) loop and spinor machinery (the only irrational step, √|q|², happens here at the boundary; relative error ≤ 2^-52 per component). - double rotationDistance(Float64List a, Float64List b) — The distance between rotation matrices (max entry). - UnitQuaternion quaternionOf(Float64List r, {UnitQuaternion near = UnitQuaternion.identity}) — A rotation matrix back to one of its two quaternions (Shepperd's method), the one nearest near. - List liftLoop(List loop) — Lifts a loop of rotations (sampled finely, first == last) to SU(2) by continuity, starting at +1. - bool isContractible(List loop) — Whether a sampled loop in SO(3) is contractible (its continuous lift closes up). - List rotationLoop(List axis, double turns, {int samples = 720}) — The loop "rotate by turns × 360° about axis", sampled at samples + 1 points. - UnitQuaternion beltTrick(double s, double t) — Dirac's belt trick as an explicit null-homotopy of the 720° rotation about z. - (double, double) spinHalfOverlap(double angle) — A spin-½ state picks up −1 under a 360° rotation and returns after 720°: the amplitude ⟨ψ|R(θ)|ψ⟩ for spin up along the rotation axis is e^{−iθ/2}. - Map spinorRotationScene({int samples = 96}) — An explainer scene: the spinor's overlap cos(θ/2) and the rotation's trace-based overlap (1 + 2cos θ)/3 as the angle goes to 720°. - final Float64List minkowski — The Minkowski metric η = diag(−1, 1, 1, 1) (signature −+++, c = 1), the convention of riptide_relativity. - final List pauli — The Pauli matrices σ0 = I, σ1, σ2, σ3, as 2 × 2 complex matrices. - typedef FormFieldFunction = Map Function(List x) — A differential form field: blade → coefficient function, written with Jets so d is exact. - typedef MetricFunction = void Function(List x, List g) — Writes the metric components g_ab(x) (n·n, row-major, symmetric) in terms of Jets of the coordinates. - typedef VectorFieldFunction = void Function(List x, List xi) — Writes a vector field's components ξ^a(x). - final class TriangleMesh — A consistently oriented triangle mesh (a discrete surface): vertex positions (x, y, z per vertex) and faces (three vertex indices each, counter-clockwise seen from outside). - TriangleMesh: TriangleMesh(this.positions, this.faces) - TriangleMesh: factory TriangleMesh.icosphere(int subdivisions) — A UV sphere-free unit icosphere (subdivisions loop subdivisions of the icosahedron, projected to the sphere). - TriangleMesh: factory TriangleMesh.torus(double major, double minor, int nu, int nv) — A torus of radii major > minor: nu vertices around the main circle and nv (even) rings, alternate rings offset by half a step so the triangles are acute (an intrinsic Delaunay mesh: every cotan weight ⋆1 is positive;… - TriangleMesh: factory TriangleMesh.grid(int nx, int ny) — A flat nx × ny grid on 0, 1² (z = 0), with a boundary. - TriangleMesh: final Float64List positions - TriangleMesh: final Int32List faces - TriangleMesh: late final Int32List edges — Edges as (tail, head) pairs, oriented from the lower vertex index to the higher. - TriangleMesh: int get vertexCount - TriangleMesh: int get faceCount - TriangleMesh: int get edgeCount - TriangleMesh: int get eulerCharacteristic — V − E + F. - TriangleMesh: late final CsrMatrix d0 — The coboundary d0: 0-forms (vertex values) → 1-forms (edge values), (d0 f)(a→b) = f(b) − f(a). - TriangleMesh: late final CsrMatrix d1 — The coboundary d1: 1-forms → 2-forms (face circulation). - TriangleMesh: late final Float64List faceAreas — Face areas. - TriangleMesh: late final Float64List star0 — ⋆0: the barycentric dual cell area of each vertex (a third of each incident face). - TriangleMesh: late final Float64List star1 — ⋆1: the cotangent weights ½(cot α + cot β), the ratio of dual to primal edge length (circumcentric duality). - TriangleMesh: late final Float64List star2 — ⋆2 = 1 / face area. - TriangleMesh: late final CsrMatrix laplacian0 — The cotan Laplacian (stiffness) L0 = d0ᵀ ⋆1 d0, symmetric positive semidefinite, kernel = constants per component. - TriangleMesh: late final CsrMatrix curlCurl1 — D1ᵀ ⋆2 d1 (E × E): the curl-curl part of the 1-form Hodge Laplacian (weak form). - TriangleMesh: (int, int) edge(int a, int b) — The index of edge {a, b} and +1 when a → b matches its orientation (−1 otherwise). - TriangleMesh: List vertex(int v) - TriangleMesh: Float64List hodgeLaplacian1(Float64List omega) — The Hodge Laplacian on primal 1-forms, Δ1 ω = d0 ⋆0⁻¹ d0ᵀ ⋆1 ω + ⋆1⁻¹ d1ᵀ ⋆2 d1 ω (δd + dδ). - TriangleMesh: Float64List codifferential1(Float64List omega) — The codifferential of a 1-form, δω = ⋆0⁻¹ d0ᵀ ⋆1 ω (a 0-form; zero for co-closed forms). - TriangleMesh: Float64List angleDefects() — The discrete Gaussian curvature: the angle defect 2π − Σ angles at each vertex (interior vertices). - TriangleMesh: HodgeDecomposition hodgeDecomposition(Float64List omega, {double rtol = 1e-12}) — Splits a 1-form into exact, co-exact and harmonic parts, ω = dα + δβ + h (discrete Hodge decomposition; the two Poisson problems are solved with conjugate gradients from riptide_numerics_sparse). - TriangleMesh: List harmonicBasis() — A basis of harmonic 1-forms (dimension 2g on a closed orientable surface of genus g; the first de Rham cohomology), from a tree–cotree decomposition (Eppstein 2003): each edge in neither the primal spanning tree nor… - final class HodgeDecomposition — Ω = exact + coexact + harmonic, with exact = d0·potential. - HodgeDecomposition: HodgeDecomposition(this.exact, this.coexact, this.harmonic, this.potential) - HodgeDecomposition: final Float64List exact - HodgeDecomposition: final Float64List coexact - HodgeDecomposition: final Float64List harmonic - HodgeDecomposition: final Float64List potential - final class Form — An element of the exterior algebra Λ(ℝⁿ)* at a point: a sum of k-forms of any degrees, one coefficient per blade (bitmask: bit i is dx^i, so 0b101 is dx⁰ ∧ dx²). n ≤ 16. - Form: Form(this.dim) - Form: factory Form.basis(int dim, List indices, [double c = 1]) — The basis k-form dx^{i1} ∧ … ∧ dx^{ik} (indices in any order; the sign of the sort is applied). - Form: factory Form.oneForm(List a) — A 1-form Σ a_i dx^i. - Form: factory Form.volume(int dim) — The volume form dx⁰ ∧ … ∧ dx^{n−1}. - Form: final int dim - Form: final Float64List coefficients - Form: double get maxAbs - Form: Form scale(double s) - Form: Form wedge(Form o) — Α ∧ β. - Form: Form grade(int k) — The degree-k part. - Form: Form interior(List v) — The interior product ι_v α (contraction of the first slot with the vector v). - Form: double evaluate(List> vectors) — Evaluates a k-form on k vectors: α(v1, …, vk) = Σ_I α_I det(v_j^{i}) over blades I. - Form: Form hodge(Float64List g) — The Hodge star with respect to the metric g (n·n, any signature), orientation dx⁰ ∧ … ∧ dx^{n−1}: ⋆(dx^I) = √|det g| Σ_L det(g⁻¹I, ∁L) sign(∁L, L) dx^L. - Form: double innerProduct(Form o, Float64List g) — The pointwise inner product ⟨α, β⟩ induced by g (from α ∧ ⋆β = ⟨α, β⟩ vol). - Form: String toString() - Form: double operator [](int blade) - Form: void operator []=(int blade, double v) - Form: Form operator +(Form o) - Form: Form operator -(Form o) - final class FormField — A differential form on an open set of ℝⁿ. - FormField: FormField(this.dim, this.coefficients) - FormField: factory FormField.oneForm(int dim, List Function(List x) a) — A 1-form from component functions a_i(x). - FormField: factory FormField.function(int dim, Jet Function(List x) f) — Df for a function f (a 0-form). - FormField: final int dim - FormField: final FormFieldFunction coefficients - FormField: FormField get d — Dω = Σ_I Σ_j ∂_j ω_I dx^j ∧ dx^I, exact (the result's coefficients carry first derivatives, so d(dω) = 0 to rounding). - FormField: Form at(List x) — The form's value at x. - FormField: double pullbackDensity(List Function(List u) phi, List u) — The pullback φ*ω evaluated on the coordinate vectors of a parametrisation phi: ℝ^k → ℝⁿ at u (ω(φ(u))(∂φ/∂u¹, …, ∂φ/∂u^k)). - FormField: double integrate(List Function(List u) phi, List lo, List hi, {int order = 24}) — ∫ ω over the k-cube lo, hi parametrised by phi (tensor Gauss–Legendre with order points per axis). - final class Jet — A second-order jet in n variables: the value, gradient and Hessian of a function at a point, carried exactly through arithmetic (forward-mode automatic differentiation truncated at order 2). - Jet: factory Jet.constant(double c, int n) — A constant in n variables. - Jet: factory Jet.variable(double value, int index, int n) — The coordinate function x_index at value. - Jet: static List variables(List point) — One variable per entry of point, seeded. - Jet: final double value - Jet: final Float64List grad - Jet: final Float64List hess - Jet: int get n - Jet: Jet constant(double c) - Jet: Jet scale(double s) - Jet: Jet apply(double f0, double f1, double f2) — Applies a scalar function with derivatives f, f', f'' at value (the chain rule to order 2). - Jet: Jet reciprocal() - Jet: Jet sqrt() - Jet: Jet pow(double p) - Jet: Jet square() - Jet: Jet sin() - Jet: Jet cos() - Jet: Jet exp() - Jet: Jet log() - Jet: Jet sinh() - Jet: Jet cosh() - Jet: Jet atan() - Jet: double d(int i) — ∂f/∂x_i. - Jet: double dd(int i, int j) — ∂²f/∂x_i∂x_j. - Jet: String toString() - Jet: Jet operator +(Object o) - Jet: Jet operator -(Object o) - Jet: Jet operator -() - Jet: Jet operator *(Object o) - Jet: Jet operator /(Object o) - final class Lorentz — A Lorentz transformation Λ^μ_ν (4 × 4, row-major, coordinates (t, x, y, z)). - Lorentz: Lorentz(this.m) - Lorentz: factory Lorentz.identity() - Lorentz: factory Lorentz.boost(List v) — A pure boost with velocity v (|v| < 1). - Lorentz: factory Lorentz.boostRapidity(List n, double eta) — A boost of rapidity eta along the unit vector n. - Lorentz: factory Lorentz.rotation(List axis, double angle) — A rotation by angle about the unit axis (right-handed, active): the radians form of Lorentz.rotationTurn. - Lorentz: factory Lorentz.rotationCayley(List axis, double t) — The rotation with Cayley parameter t = tan(θ/2) about axis (rational in t; no trigonometry). - Lorentz: factory Lorentz.rotationTurn(List axis, Turn turn) — The rotation about axis by the planar turn turn (its unit vector (cos θ, sin θ)). - Lorentz: final Float64List m - Lorentz: Lorentz get inverse — Λ⁻¹ = η Λᵀ η. - Lorentz: double get metricDefect — Max |Λᵀ η Λ − η|: zero for a Lorentz transformation. - Lorentz: double get rotationSpread — The spread sin²θ of a pure rotation's angle θ, from its antisymmetric part: R − Rᵀ = 2 sin θ nₓ, so sin²θ = Q(R₃₂ − R₂₃, R₁₃ − R₃₁, R₂₁ − R₁₂)/4. - Lorentz: Turn get rotationTurn — The rotation's angle as a turn (cos θ, sin θ), θ in 0, π: cos θ = (tr − 1)/2 and sin θ = ½|R − Rᵀ|. - Lorentz: double get rotationAngle — The rotation angle of a pure rotation in 0, π: the radians form of rotationTurn. - Lorentz: double at(int mu, int nu) - Lorentz: List apply(List x) - Lorentz: (Lorentz boost, Lorentz rotation) decompose() — Polar decomposition Λ = B·R into a boost B and a rotation R (both proper orthochronous). - Lorentz: double maxDifference(Lorentz o) - Lorentz: double operator [](int i) - Lorentz: Lorentz operator *(Lorentz o) - final class SL2C — A 2 × 2 complex matrix [a, b, c, d]; with det = 1 an element of SL(2, ℂ), the double cover of the proper orthochronous Lorentz group, acting on left-handed Weyl spinors. - SL2C: const SL2C(this.a, this.b, this.c, this.d) - SL2C: factory SL2C.rotation(List axis, double angle) — The spinor rotation exp(−i θ/2 n·σ): a 2π rotation gives −I. - SL2C: factory SL2C.rotationCayley(List axis, double t) — The spinor rotation with Cayley parameter t = tan(θ/2) about axis: (I − i t n·σ)/√(1 + t²), the unit quaternion of the Gibbs vector t·n (one square root, no trigonometry). - SL2C: factory SL2C.rotationHalfTurn(List axis, Turn half) — cos(θ/2) I − i sin(θ/2) n·σ from the half-angle turn half = (cos θ/2, sin θ/2). - SL2C: factory SL2C.boost(List n, double eta) — The spinor boost exp(−η/2 n·σ) of rapidity eta along unit n, matching Lorentz.boostRapidity (Hermitian). - SL2C: static const SL2C identity = SL2C(Complex.one, Complex.zero, Complex.zero, Complex.one) - SL2C: final Complex a - SL2C: final Complex b - SL2C: final Complex c - SL2C: final Complex d - SL2C: SL2C get adjoint - SL2C: Complex get determinant - SL2C: Complex get trace - SL2C: SL2C get inverse - SL2C: (Complex, Complex) apply((Complex, Complex) xi) — Acts on a 2-spinor (ξ¹, ξ²). - SL2C: Lorentz toLorentz() — The Lorentz transformation it covers: Λ^μ_ν = ½ tr(σ_μ A σ_ν A†). - SL2C: Complex mobius(Complex zeta) — The Möbius map ζ → (aζ + b)/(cζ + d) it induces on the celestial sphere (directions of light rays, ζ by stereographic projection): how a boosted observer sees the sky (aberration). - SL2C: double maxDifference(SL2C o) - SL2C: String toString() - SL2C: SL2C operator *(SL2C o) - SL2C: SL2C operator -() - class MetricField — A (pseudo-)Riemannian metric on a coordinate chart, written once as a MetricFunction; everything else — Christoffel symbols, Riemann, Ricci, scalar curvature, the Einstein tensor, Killing residuals — follows by exact… - MetricField: MetricField(this.dim, this.components, {this.name = 'metric', this.coordinates}) - MetricField: factory MetricField.diagonal(int dim, List Function(List x) diagonal, {String name = 'metric', List? coordinates}) — A diagonal metric g = diag(f(x)); unset components are zero in every MetricFunction too. - MetricField: factory MetricField.constant(int dim, List components, {String name = 'metric'}) — A constant metric (e.g. - MetricField: final int dim - MetricField: final MetricFunction components - MetricField: final String name - MetricField: final List? coordinates — Coordinate names, e.g. 't', 'r', 'θ', 'φ'. - MetricField: Float64List metricAt(List x) — g_ab at x (n·n row-major). - MetricField: GeometryAt at(List x) — The full local geometry at x: metric, inverse, derivatives and all curvature. - MetricField: void christoffel(List x, Float64List out) — Γ^a_bc at x into out (n·n·n, index a·n² + b·n + c). - MetricField: void geodesicAcceleration(List x, List v, Float64List acc, [Float64List? scratch]) — The geodesic equation's acceleration −Γ^a_bc v^b v^c into acc. - MetricField: double inner(List x, List u, List v) — g_ab u^a v^b at x. - MetricField: Tensor lieDerivativeOfMetric(VectorFieldFunction xi, List x) — The Lie derivative of the metric along xi at x, (L_ξ g)_ab = ξ^c ∂_c g_ab + g_cb ∂_a ξ^c + g_ac ∂_b ξ^c. - MetricField: double killingResidual(VectorFieldFunction xi, Iterable> points) — The largest component of L_ξ g over points: ~0 for a Killing vector. - final class GeometryAt — A metric and its curvature at one point. - GeometryAt: final MetricField field - GeometryAt: final Float64List x - GeometryAt: final int n - GeometryAt: late final Float64List metric — g_ab, g^ab. - GeometryAt: late final Float64List inverse — g_ab, g^ab. - GeometryAt: late final Float64List dg — ∂_c g_ab at index (c·n + a)·n + b; ∂_c ∂_d g_ab at ((c·n + d)·n + a)·n + b. - GeometryAt: late final Float64List d2g — ∂_c g_ab at index (c·n + a)·n + b; ∂_c ∂_d g_ab at ((c·n + d)·n + a)·n + b. - GeometryAt: double get determinant - GeometryAt: late final Float64List christoffelFirst — Γ_abc = ½(∂_b g_ac + ∂_c g_ab − ∂_a g_bc) (first kind). - GeometryAt: late final Float64List christoffel — Γ^a_bc (second kind). - GeometryAt: late final Float64List christoffelDerivative — ∂_d Γ^a_bc at index ((d·n + a)·n + b)·n + c. - GeometryAt: late final Tensor riemann — R^a_bcd = ∂_c Γ^a_db − ∂_d Γ^a_cb + Γ^a_ce Γ^e_db − Γ^a_de Γ^e_cb (MTW's convention: the 2-sphere of radius r has R = 2/r²). - GeometryAt: late final Tensor riemannDown — R_abcd (all indices down). - GeometryAt: late final Tensor ricci — R_bd = R^a_bad. - GeometryAt: late final double scalarCurvature — R = g^bd R_bd. - GeometryAt: late final Tensor einstein — G_ab = R_ab − ½ R g_ab. - GeometryAt: late final double kretschmann — R_abcd R^abcd (Schwarzschild: 48 M² / r⁶). - GeometryAt: late final Tensor weyl — The Weyl tensor C_abcd (n ≥ 3): the trace-free part of the Riemann tensor (zero for conformally flat metrics). - GeometryAt: Tensor get metricTensor - GeometryAt: Tensor get inverseTensor - GeometryAt: Tensor get christoffelArray — Γ^a_bc as a tensor-shaped array (it is not a tensor, but the layout is the same). - final class RationalTriangleMesh — A triangle mesh with exact rational vertex positions (3-D) and consistently oriented faces. - RationalTriangleMesh: RationalTriangleMesh(List> positions, this.faces) - RationalTriangleMesh: factory RationalTriangleMesh.grid(int nx, int ny) — A rational nx × ny grid on 0, 1² (z = 0): the exact twin of TriangleMesh.grid. - RationalTriangleMesh: final List> positions - RationalTriangleMesh: final Int32List faces - RationalTriangleMesh: int get faceCount - RationalTriangleMesh: late final TriangleMesh float — The float view (positions correctly rounded; each coordinate within ½ ulp), with its DEC operators. - RationalTriangleMesh: late final List edgeQuadrances — The exact quadrance of every edge, in float's edge order. - RationalTriangleMesh: TriangleMesh toTriangleMesh() - RationalTriangleMesh: Rational cornerSpread(int f, int k) — The spread at corner k of face f (classically sin² of the corner angle). - RationalTriangleMesh: Rational faceQuadrea(int f) — The quadrea 𝒜 = 16·area² of face f (= 4|u × v|²; Archimedes' function of its side quadrances). - RationalTriangleMesh: Rational? cornerCotangent(int f, int k) — Cot of corner k of face f: 2(u·v)/√𝒜; null when 𝒜 is not a rational square. - RationalTriangleMesh: List? exactCotanWeights() — The DEC ⋆1 weights ½(cot α + cot β), exactly, in float's edge order; null when some face's quadrea is not a rational square (then the weights are irrational and only the float TriangleMesh.star1 exists). - RationalTriangleMesh: Mat? exactLaplacian0() — The cotan Laplacian L0 = d0ᵀ ⋆1 d0 as an exact rational matrix (planar meshes); null when exactCotanWeights is. - extension QuadranceSpreadMesh on TriangleMesh — Quadrances and spreads on a float mesh: the rational-first API in floats, with lengths and angles derived. - QuadranceSpreadMesh: Float64List get edgeQuadrances — Squared edge lengths (no square root taken). - QuadranceSpreadMesh: Float64List get edgeLengths — Edge lengths, derived: √Q. - QuadranceSpreadMesh: double cornerSpread(int f, int k) — The spread at corner k of face f: |u × v|² / (|u|²|v|²). - final class UnitQuaternion — A unit quaternion w + xi + yj + zk: a point of SU(2) ≅ S³, the universal (double) cover of SO(3). - UnitQuaternion: const UnitQuaternion(this.w, this.x, this.y, this.z) - UnitQuaternion: factory UnitQuaternion.rotation(List axis, double angle) — The rotation by angle about unit axis: cos(θ/2) + sin(θ/2)(n·(i, j, k)). - UnitQuaternion: static const identity = UnitQuaternion(1, 0, 0, 0) - UnitQuaternion: final double w - UnitQuaternion: final double x - UnitQuaternion: final double y - UnitQuaternion: final double z - UnitQuaternion: double dot(UnitQuaternion o) - UnitQuaternion: double distance(UnitQuaternion o) - UnitQuaternion: Float64List toRotationMatrix() — The covering map SU(2) → SO(3): q and −q give the same rotation matrix (row-major 3 × 3). - UnitQuaternion: String toString() - UnitQuaternion: UnitQuaternion operator *(UnitQuaternion o) - UnitQuaternion: UnitQuaternion operator -() - final class Tensor — A tensor at a point of an n-dimensional manifold in index notation: rank slots, each contravariant (up, u) or covariant (down, d), components in a coordinate basis stored row-major (slot 0 slowest). - Tensor: Tensor(this.dim, this.variance, this.data) - Tensor: factory Tensor.zeros(int dim, String variance) - Tensor: factory Tensor.generate(int dim, String variance, double Function(List idx) f) — Builds components from f(indices). - Tensor: factory Tensor.einsum(String subscripts, List operands, String variance) — Contracts tensors by an einsum expression; the result's slots get variance. - Tensor: final int dim - Tensor: final String variance — One letter per slot: u (contravariant) or d (covariant). - Tensor: final Float64List data - Tensor: int get rank - Tensor: double get maxAbs — The largest absolute component. - Tensor: double get scalar — The scalar of a rank-0 tensor. - Tensor: np.NDArray toNDArray() - Tensor: Tensor lower(int slot, Tensor g) — Lowers slot slot with the metric g (a dd tensor). - Tensor: Tensor raise(int slot, Tensor gInv) — Raises slot slot with the inverse metric gInv (a uu tensor). - Tensor: Tensor contract(int a, int b) — Contracts an up slot with a down slot (a trace). - Tensor: Tensor outer(Tensor o) — The tensor product. - Tensor: Tensor scale(double s) - Tensor: String toString() - Tensor: double operator [](List idx) - Tensor: void operator []=(List idx, double v) - Tensor: Tensor operator +(Tensor o) - Tensor: Tensor operator -(Tensor o) ### Topology (riptide_topology) import 'package:riptide_topology/riptide_topology.ray'; Homology and cohomology over the integers and Z/p, persistent homology (Vietoris–Rips, alpha, cubical), mapper, discrete Morse theory and 3-manifolds. https://riptidecompute.com/raya/docs/topology - SimplicialComplex cyclicCover(SimplicialComplex k, int n, int Function(int a, int b) voltage) — The n-sheeted cyclic cover of k defined by a 1-cocycle with values in Z/n: voltage (a, b) for a < b is the sheet shift along the edge a → b (b → a shifts by its negative), and it must add to 0 mod n around every… - Map barcodeScene(PersistenceDiagram diagram, {String id = 'topology.barcode', String title = 'Persistence barcode', String axisLabel = 'scale', int maxBarsPerDimension = 12}) — A scene that draws diagram's barcode, one dimension per step (H₀, H₁, H₂ in the palette's v1, v2, v3), with a labelled filtration axis. - GroupPresentation fundamentalGroup(SimplicialComplex k, {int? base, bool simplify = true}) — Π₁(K, base) of the component of base (default: the smallest vertex): generators are the edges outside a breadth-first spanning tree, relators are the triangles (the edge-path group), then Tietze-simplified unless… - MapperGraph mapper(Float64List points, int dim, List lens, {int intervals = 10, double overlap = 0.3, required double epsilon, int maxDim = 2}) — Mapper of points (dim coordinates each) through lens (one value per point): intervals equal intervals overlapping by the fraction overlap of their length, each preimage clustered by single linkage at distance epsilon… - int modInverse(int a, int p) — A⁻¹ mod p for prime p. - List plCriticalPoints(TriangulatedSurface surface, double Function(int vertex) f) — The PL critical points of f on a closed surface; their indices add up to χ. - double bottleneckDistance(List<(double, double)> a, List<(double, double)> b) — The bottleneck distance between two diagrams given as (birth, death) points (death may be infinite), with the L∞ ground metric and every point free to go to the diagonal. - double wassersteinDistance(List<(double, double)> a, List<(double, double)> b, {double q = 1}) — The q-Wasserstein distance (L∞ ground metric) between two diagrams: the optimal assignment of points to points or to the diagonal, by the Hungarian algorithm. - double hungarian(List> cost) — The minimum total cost of a perfect assignment in a square cost matrix (Kuhn–Munkres with potentials, O(n³)). - const int rationalPrime = 2147483647 — A prime above 2³⁰ whose products fit in 64 bits: rank mod it equals the rank over Q unless it divides a torsion coefficient (which would need a coefficient this large). - typedef Cell = ({int dim, int index}) — A cell of a simplicial complex: its dimension and index within that dimension. - final class AlphaComplex — An alpha complex in 2-D or 3-D. - AlphaComplex: factory AlphaComplex(Float64List points, int dim) — From interleaved points with dim = 2 or 3 coordinates. - AlphaComplex: final Float64List points - AlphaComplex: final int dim - AlphaComplex: final SimplicialComplex complex — The Delaunay complex. - AlphaComplex: final List values — The filtration value (squared radius) of each simplex, by dimension and index. - AlphaComplex: FilteredComplex get filtration - AlphaComplex: SimplicialComplex at(double alpha2) — The subcomplex at squared radius ≤ alpha2. - AlphaComplex: PersistenceDiagram persistence({int prime = 2}) - abstract interface class ChainComplex — A finite chain complex of free abelian groups: C_k has cellCount (k) generators and ∂_k: C_k → C_{k−1} is boundary (k) (a cellCount(k−1) × cellCount(k) matrix; ∂_0 = 0). - ChainComplex: int get dimension — The top dimension with cells (−1 when empty). - ChainComplex: int cellCount(int k) - ChainComplex: SparseIntMatrix boundary(int k) - final class HomologyGroup — A finitely generated abelian group Z^rank ⊕ Z/t₁ ⊕ … ⊕ Z/t_m. - HomologyGroup: const HomologyGroup(this.rank, [this.torsion = const []]) - HomologyGroup: final int rank - HomologyGroup: final List torsion — Torsion coefficients (each > 1, each dividing the next). - HomologyGroup: bool get isTrivial - HomologyGroup: int get hashCode - HomologyGroup: String toString() - HomologyGroup: bool operator ==(Object other) - extension Homology on ChainComplex — Homology and cohomology of any ChainComplex. - Homology: int get eulerCharacteristic — Χ = Σ (−1)^k · #k-cells (= Σ (−1)^k b_k over any field). - Homology: bool get isChainComplex — Whether ∂_{k−1} ∘ ∂_k = 0 for every k (a sanity check on hand-built complexes). - Homology: List homology() — H_k(C; Z) for k = 0 … dimension, with torsion from the Smith normal form of each ∂. - Homology: List cohomology() — H^k(C; Z) = ker δ^k / im δ^{k−1}, δ^k = ∂_{k+1}ᵀ, computed from the coboundary matrices themselves (it agrees with the universal coefficient theorem: free part of H_k, torsion of H_{k−1}). - Homology: List bettiNumbers({int? prime}) — Betti numbers over Q (null) or over the field Z/prime. - final class CellComplex implements ChainComplex — A chain complex given directly by its boundary matrices: CW complexes (RP^n, lens spaces), quotients, or any complex built by hand. boundaries k−1 is ∂_k for k ≥ 1. - CellComplex: CellComplex(this.cellCounts, this.boundaries) - CellComplex: factory CellComplex.realProjectiveSpace(int n) — The minimal CW structure of RP^n: one cell per dimension, ∂_k = 1 + (−1)^k (0 or 2). - CellComplex: factory CellComplex.lensSpace(int p) — The lens space L(p, q) (one cell per dimension 0 … 3): ∂₁ = 0, ∂₂ = p, ∂₃ = 0. - CellComplex: factory CellComplex.orientableSurface(int g) — The closed orientable surface of genus g: one 0-cell, 2g 1-cells, one 2-cell with ∂ = Σ (a_i + b_i − a_i − b_i) = 0. - CellComplex: factory CellComplex.nonOrientableSurface(int k) — The connected sum of k projective planes: one 0-cell, k 1-cells, one 2-cell with ∂ = 2(a₁ + … + a_k). - CellComplex: final List cellCounts - CellComplex: final List boundaries - CellComplex: int get dimension - CellComplex: int cellCount(int k) - CellComplex: SparseIntMatrix boundary(int k) - final class CubicalComplex implements ChainComplex — The cubical complex of a grid of shape top-dimensional cubes (pixels, voxels), in Khalimsky coordinates: each cell is a point of the (2n+1)-per-axis grid (2n when periodic) and its dimension is its count of odd… - CubicalComplex: factory CubicalComplex(List shape, {bool periodic = false}) — The plain complex (no values): use it for homology. - CubicalComplex: factory CubicalComplex.topValues(List shape, List values, {bool periodic = false}) — Values on the top-dimensional cubes, row-major over shape (last axis fastest). - CubicalComplex: factory CubicalComplex.vertexValues(List shape, List values, {bool periodic = false}) — Values on the vertices, row-major over the vertex grid (shape + 1 per axis, or shape when periodic). - CubicalComplex: final List shape - CubicalComplex: final bool periodic - CubicalComplex: int get dimension - CubicalComplex: FilteredComplex get filtration — The sublevel filtration of the values. - CubicalComplex: int cellCount(int k) - CubicalComplex: SparseIntMatrix boundary(int k) - CubicalComplex: PersistenceDiagram persistence({int prime = 2}) - final class GroupPresentation — A finite group presentation ⟨g₁ … g_n | r₁ … r_m⟩. - GroupPresentation: GroupPresentation(this.generatorCount, List> relators) - GroupPresentation: final int generatorCount - GroupPresentation: final List> relators - GroupPresentation: int get deficiency — The deficiency #generators − #relators. - GroupPresentation: bool get isTriviallyTrivial - GroupPresentation: bool get isFree - GroupPresentation: HomologyGroup abelianization() — The abelianization G/G, G (= H₁ for a fundamental group), from the Smith normal form of the exponent-sum matrix. - GroupPresentation: GroupPresentation simplify() — Applies Tietze transformations until none applies: free and cyclic reduction, dropping empty and repeated relators, and eliminating a generator that occurs exactly once in some relator (g = the rest of that relator,… - GroupPresentation: String toString() - final class MapperNode — One mapper node: the points of one cluster of one interval's preimage. - MapperNode: const MapperNode(this.interval, this.members) - MapperNode: final int interval - MapperNode: final List members - final class MapperGraph — The mapper graph and its nerve. - MapperGraph: MapperGraph(this.nodes, this.nerve) - MapperGraph: final List nodes - MapperGraph: final SimplicialComplex nerve — The nerve: node i is vertex i; an edge (triangle) when two (three) clusters share a point. - MapperGraph: List> get edges - final class SparseIntMatrix — A sparse integer matrix stored by columns (row → value, zeros never stored). - SparseIntMatrix: SparseIntMatrix(this.rows, this.cols) - SparseIntMatrix: SparseIntMatrix.fromColumns(this.rows, this.columns) - SparseIntMatrix: factory SparseIntMatrix.fromDense(List> a) - SparseIntMatrix: final int rows - SparseIntMatrix: final int cols - SparseIntMatrix: final List> columns - SparseIntMatrix: int get nonZeros - SparseIntMatrix: bool get isZero - SparseIntMatrix: void set(int row, int col, int value) - SparseIntMatrix: List> toDense() - SparseIntMatrix: SparseIntMatrix transpose() - SparseIntMatrix: SparseIntMatrix multiply(SparseIntMatrix b) — The product this · b. - SparseIntMatrix: int rankModP(int p) — The rank over the field Z/p (p prime). - SparseIntMatrix: List invariantFactors() — The nonzero invariant factors d₁ | d₂ | … of the Smith normal form over Z (all positive; their count is the rank). - SparseIntMatrix: int operator [](({int row, int col}) at) - final class SmithNormalForm — Smith normal form D = U·A·V over Z with unimodular U and V (dense; for small matrices and for explicit bases). - SmithNormalForm: factory SmithNormalForm.of(List> a) - SmithNormalForm: final List diagonal — The nonzero invariant factors, each dividing the next. - SmithNormalForm: final List> d — D, U and V with D = U·A·V. - SmithNormalForm: final List> u — D, U and V with D = U·A·V. - SmithNormalForm: final List> v — D, U and V with D = U·A·V. - SmithNormalForm: int get rank - final class DiscreteGradient — A discrete gradient vector field: pairs (σ, τ) of a cell and a cofacet, the rest critical. - DiscreteGradient: factory DiscreteGradient.lowerStar(SimplicialComplex complex, double Function(int vertex) f) — Builds the gradient of f (a value per vertex id; ties broken by vertex id) on complex by processing each vertex's lower star: homotopy expansions in the order of the cells' sorted vertex values, critical cells only… - DiscreteGradient: final SimplicialComplex complex - DiscreteGradient: List<(Cell, Cell)> get pairs — The gradient pairs (σ, τ) with σ a facet of τ. - DiscreteGradient: List> get criticalCells — Critical cells by dimension. - DiscreteGradient: List get morseNumbers — The number of critical cells in each dimension (the Morse numbers c_k). - DiscreteGradient: bool isCritical(Cell c) - DiscreteGradient: Cell? partnerOf(Cell c) — The cell paired with c (a facet or a cofacet), or null when c is critical. - DiscreteGradient: bool satisfiesMorseInequalities(List betti) — Whether the weak (c_k ≥ b_k) and strong (alternating partial sums) Morse inequalities hold for betti, and Σ (−1)^k c_k = χ. - final class MorseSmaleArc — One arc of a Morse–Smale complex: a V-path from a saddle (critical edge) to a minimum (critical vertex) or a maximum (critical triangle), through cells. - MorseSmaleArc: const MorseSmaleArc(this.saddle, this.extremum, this.cells) - MorseSmaleArc: final int saddle - MorseSmaleArc: final Cell extremum - MorseSmaleArc: final List cells — The cells along the path, from the saddle. - MorseSmaleArc: bool get toMinimum - final class MorseSmaleComplex — The Morse–Smale complex of a discrete gradient on a triangulated surface: critical cells as nodes, the descending arcs saddle → minimum (vertex V-paths) and ascending arcs saddle → maximum (dual V-paths). - MorseSmaleComplex: MorseSmaleComplex(this.gradient) - MorseSmaleComplex: final DiscreteGradient gradient - MorseSmaleComplex: final List arcs - MorseSmaleComplex: List get minima - MorseSmaleComplex: List get saddles - MorseSmaleComplex: List get maxima - MorseSmaleComplex: int get cellCount2 — The 2-cells (quadrilaterals for a generic gradient on a closed surface): arcs − nodes + χ. - final class PlCriticalPoint — A piecewise-linear critical point of a vertex function on a closed triangulated surface (Banchoff 1967): around the vertex's link, count the sign changes of f(w) − f(v). 0 changes: a minimum (all higher) or a maximum… - PlCriticalPoint: const PlCriticalPoint(this.vertex, this.kind, this.multiplicity) - PlCriticalPoint: final int vertex - PlCriticalPoint: final String kind — 'min', 'max' or 'saddle'. - PlCriticalPoint: final int multiplicity - PlCriticalPoint: int get index — Its contribution to χ (the PL Poincaré–Hopf / Banchoff index). - final class PersistencePair — One interval birth, death) of a k-dimensional class; [death is infinite for an essential class. - PersistencePair: const PersistencePair(this.dimension, this.birth, this.death) - PersistencePair: final int dimension - PersistencePair: final double birth - PersistencePair: final double death - PersistencePair: double get persistence - PersistencePair: bool get isEssential - PersistencePair: String toString() - final class PersistenceDiagram — A persistence diagram: the multiset of intervals in every dimension. - PersistenceDiagram: PersistenceDiagram(List pairs) - PersistenceDiagram: final List pairs — Sorted by dimension, then longest first. - PersistenceDiagram: int get maxDimension - PersistenceDiagram: List inDimension(int d) - PersistenceDiagram: List bettiAt(double t) — The Betti numbers of the filtration at t: intervals with birth ≤ t < death. - PersistenceDiagram: PersistenceDiagram significant(double minPersistence) — Intervals longer than minPersistence only (noise removal). - PersistenceDiagram: double bottleneckTo(PersistenceDiagram other, int dim) — The bottleneck distance to other in dimension dim (L∞ ground metric, diagonal allowed). - PersistenceDiagram: double wassersteinTo(PersistenceDiagram other, int dim, {double q = 1}) — The q-Wasserstein distance to other in dimension dim (L∞ ground metric). - PersistenceDiagram: String toString() - final class FilteredComplex — A filtration of a cell complex: cells in an order where every face comes before its cofaces, each with a value that never decreases along the order. - FilteredComplex: factory FilteredComplex(List dims, List values, List> boundaries) — dims i, values i and boundaries i (face index → coefficient, indices into these same lists) describe cell i. - FilteredComplex: factory FilteredComplex.simplicial(SimplicialComplex k, double Function(int dim, int index) value) — A simplicial complex filtered by value (dimension, index within dimension). - FilteredComplex: factory FilteredComplex.lowerStar(SimplicialComplex k, double Function(int vertex) f) — The lower-star filtration of a function on vertices (a simplex enters with its highest vertex). - FilteredComplex: final List dims - FilteredComplex: final List values - FilteredComplex: final List> boundaries - FilteredComplex: int get length - FilteredComplex: PersistenceDiagram persistence({int prime = 2, bool includeZeroLength = false}) — The persistence diagram over Z/prime, by column reduction with clearing (twist): dimensions are reduced from the top down and a column that is already a pivot is zeroed without reducing it. - final class RationalPersistencePair — One interval birth, death) with exact quadrance (Rips) or squared-radius (alpha) values; [death is null for an essential class. - RationalPersistencePair: const RationalPersistencePair(this.dimension, this.birth, this.death) - RationalPersistencePair: final int dimension - RationalPersistencePair: final Rational birth - RationalPersistencePair: final Rational? death - RationalPersistencePair: bool get isEssential - RationalPersistencePair: String toString() - final class RationalPersistenceDiagram — A persistence diagram whose values are exact squared lengths. - RationalPersistenceDiagram: RationalPersistenceDiagram(List pairs) - RationalPersistenceDiagram: final List pairs - RationalPersistenceDiagram: List inDimension(int d) - RationalPersistenceDiagram: List bettiAt(Rational q) — Betti numbers at the squared scale q: intervals with birth ≤ q < death, decided exactly. - RationalPersistenceDiagram: PersistenceDiagram toDistanceDiagram() — The float view with lengths (√ of each value, via FloatBoundary.distance: relative error ≤ 2^-52): a Rips diagram in distances, an alpha diagram in radii. - RationalPersistenceDiagram: PersistenceDiagram toSquaredDiagram() — The float view of the squared values themselves (correctly rounded), e.g. to compare with AlphaComplex. - RationalPersistenceDiagram: String toString() - final class RationalVietorisRips — Vietoris–Rips persistence of rational points with the blue quadrance: exact quadrances, exact ties. - RationalVietorisRips: RationalVietorisRips(List> points) - RationalVietorisRips: final List> points - RationalVietorisRips: late final List quadrances — The full n × n quadrance matrix (row-major). - RationalVietorisRips: late final List distinct — The distinct quadrances in increasing order (the rank filtration's values). - RationalVietorisRips: int get n - RationalVietorisRips: RationalPersistenceDiagram persistence({int maxDim = 1, int prime = 2, Rational? thresholdQuadrance}) — The barcodes in dimensions 0 … maxDim over Z/prime, using edges of quadrance ≤ thresholdQuadrance (default: the enclosing radius, which gives the same diagram as no threshold apart from H₀'s infinite class). - final class RationalAlphaComplex — An alpha complex of rational points in 2-D or 3-D with exact squared-radius filtration values. - RationalAlphaComplex: factory RationalAlphaComplex(List> points) - RationalAlphaComplex: final List> points - RationalAlphaComplex: final int dim - RationalAlphaComplex: final SimplicialComplex complex — The Delaunay complex. - RationalAlphaComplex: final List> values — The exact filtration value (squared radius) of each simplex, by dimension and index. - RationalAlphaComplex: bool get isExactlyDelaunay — Whether every Delaunay triangle (tetrahedron) has no input point strictly inside its circumcircle (circumsphere), decided with the exact in-circle / in-sphere predicates over ℚ. - RationalAlphaComplex: SimplicialComplex at(Rational alpha2) — The subcomplex at squared radius ≤ alpha2, decided exactly. - RationalAlphaComplex: RationalPersistenceDiagram persistence({int prime = 2}) - final class VietorisRips — Vietoris–Rips persistence of a finite metric space. - VietorisRips: factory VietorisRips.points(Float64List points, int dim) — From n points with dim coordinates each, interleaved in points (Euclidean distances). - VietorisRips: VietorisRips.distances(this.distances, this.n) — From a full symmetric n × n distance matrix (row-major). - VietorisRips: final Float64List distances - VietorisRips: final int n - VietorisRips: double get enclosingRadius — The enclosing radius min_i max_j d(i, j): at this scale the complex is a cone on the centre point, so every class above dimension 0 has died and larger simplices change nothing (Ripser's default threshold). - VietorisRips: PersistenceDiagram persistence({int maxDim = 1, double threshold = double.infinity, int prime = 2}) — The barcodes in dimensions 0 … maxDim over Z/prime, using simplices of diameter ≤ threshold. - final class SimplicialComplex implements ChainComplex — A finite abstract simplicial complex: every face of a simplex is in it. - SimplicialComplex: factory SimplicialComplex(Iterable> simplices) — The closure of simplices (any vertex order; duplicates allowed). - SimplicialComplex: factory SimplicialComplex.sphere(int n) — The boundary of the (n+1)-simplex on vertices 0 … n+1: a triangulated n-sphere. - SimplicialComplex: factory SimplicialComplex.simplex(int n) — The full n-simplex (contractible). - SimplicialComplex: static List> facets(List simplex) — The codimension-1 faces of simplex (vertex i removed, i = 0 … k). - SimplicialComplex: int get dimension - SimplicialComplex: Iterable> get allSimplices — Every simplex, by dimension. - SimplicialComplex: List get vertices - SimplicialComplex: List> get facetsOfComplex — The maximal simplices (faces of nothing else). - SimplicialComplex: List> get components — Connected components as vertex lists. - SimplicialComplex: bool get isConnected - SimplicialComplex: int cellCount(int k) - SimplicialComplex: List> simplices(int k) — The k-simplices in lexicographic order. - SimplicialComplex: int indexOf(List simplex) — The index of simplex among the simplices of its dimension, or −1. - SimplicialComplex: bool contains(List simplex) - SimplicialComplex: List> cofacets(List simplex) — The simplices of dimension k+1 that have simplex as a face. - SimplicialComplex: SimplicialComplex skeleton(int k) — The k-skeleton: simplices of dimension ≤ k. - SimplicialComplex: SimplicialComplex link(List simplex) — The link of simplex: faces τ disjoint from it with τ ∪ σ in the complex. - SimplicialComplex: SimplicialComplex star(List simplex) — The closed star of simplex: every simplex containing it, with its faces. - SimplicialComplex: SparseIntMatrix boundary(int k) - SimplicialComplex: SimplicialComplex cone(int apex) — The join with a cone point apex (a vertex not in the complex): contractible. - SimplicialComplex: SimplicialComplex suspension(int north, int south) — The suspension (two cone points): ΣK has H̃_{k+1}(ΣK) = H̃_k(K). - SimplicialComplex: String toString() - final class SurfaceClass — Where a connected compact surface sits in the classification: the sphere with genus handles (orientable) or with genus cross-caps (non-orientable), minus boundaryComponents open disks. - SurfaceClass: const SurfaceClass({required this.orientable, required this.genus, required this.boundaryComponents}) - SurfaceClass: final bool orientable - SurfaceClass: final int genus — Handles (orientable) or cross-caps (non-orientable). - SurfaceClass: final int boundaryComponents - SurfaceClass: int get eulerCharacteristic - SurfaceClass: String get symbol — S², T², T²#T², RP², RP²#RP², … with the boundary noted. - SurfaceClass: String get name — The everyday name where there is one. - SurfaceClass: int get hashCode - SurfaceClass: String toString() - SurfaceClass: bool operator ==(Object other) - final class TriangulatedSurface — A triangulated compact surface (2-manifold, possibly with boundary): every edge lies in one or two triangles and every vertex link is one path or one cycle. - TriangulatedSurface: TriangulatedSurface(List> triangles) - TriangulatedSurface: factory TriangulatedSurface.fromComplex(SimplicialComplex k) — Any simplicial 2-complex that is a surface. - TriangulatedSurface: final List> triangles - TriangulatedSurface: final SimplicialComplex complex - TriangulatedSurface: int get vertexCount - TriangulatedSurface: int get eulerCharacteristic - TriangulatedSurface: bool get isConnected - TriangulatedSurface: bool get isClosed - TriangulatedSurface: List> get boundaryEdges — Boundary edges (each in one triangle). - TriangulatedSurface: List> get boundaryComponents — The boundary circles, as cyclic vertex lists. - TriangulatedSurface: late final List>? orientation — A coherent orientation of the triangles (each listed so that a shared edge is traversed in opposite directions by its two triangles), or null when the surface is non-orientable. - TriangulatedSurface: bool get isOrientable - TriangulatedSurface: SurfaceClass get classification — The classification of a connected surface: orientability, genus (handles or cross-caps) from χ and the number of boundary circles. - TriangulatedSurface: TriangulatedSurface orientationDoubleCover() — The orientation double cover: two copies of each triangle (one per orientation) glued so the result is oriented. - TriangulatedSurface: TriangulatedSurface connectedSum(TriangulatedSurface other) — The connected sum: a triangle is removed from each and the two holes are glued (the second surface's vertices are renumbered after this one's; its glued triangle is reversed so orientations agree). - TriangulatedSurface: List homology() — Homology over Z (H₁ of RP² is Z/2). - final class Triangulated3Manifold — A triangulated closed 3-manifold: every triangle lies in exactly two tetrahedra and every vertex link is a triangulated 2-sphere. isManifold is false for a closed pseudomanifold whose links are other surfaces. - Triangulated3Manifold: Triangulated3Manifold(List> tetrahedra) - Triangulated3Manifold: final List> tetrahedra - Triangulated3Manifold: final SimplicialComplex complex - Triangulated3Manifold: Map get vertexLinks — Each vertex link, classified (a 2-sphere at every vertex for a manifold). - Triangulated3Manifold: bool get isManifold - Triangulated3Manifold: int get eulerCharacteristic - Triangulated3Manifold: bool get isOrientable — Whether the tetrahedra can be oriented coherently (each shared triangle induced with opposite orientations). - Triangulated3Manifold: List homology() - abstract final class Triangulations — Standard triangulations for tests and demos. - Triangulations: static TriangulatedSurface tetrahedron() — The boundary of the tetrahedron: S² with 4 vertices. - Triangulations: static TriangulatedSurface octahedron() — The octahedron: S² with 6 vertices (±x = 0/1, ±y = 2/3, ±z = 4/5). - Triangulations: static TriangulatedSurface torus7() — Möbius' 7-vertex torus (Császár): triangles {i, i+1, i+3} and {i, i+3, i+2} mod 7; its 1-skeleton is K₇. - Triangulations: static TriangulatedSurface projectivePlane6() — The 6-vertex real projective plane (the hemi-icosahedron; its 1-skeleton is K₆). - Triangulations: static TriangulatedSurface mobiusBand() — The 5-vertex Möbius band: triangles {i, i+1, i+2} mod 5; the boundary is the 5-cycle of edges {i, i+2}. - Triangulations: static TriangulatedSurface grid(int m, int n, {bool twist = false, bool periodicJ = true}) — An m × n grid of squares (two triangles each) with its sides glued: twist glues the left and right sides with a flip (a Klein bottle), periodicJ false leaves the top and bottom open (an annulus, or a Möbius band with… - Triangulations: static TriangulatedSurface torusGrid(int m, int n) - Triangulations: static TriangulatedSurface kleinBottleGrid(int m, int n) - Triangulations: static TriangulatedSurface orientable(int g) — The closed orientable surface of genus g (connected sums of 7-vertex tori; the sphere for 0). - Triangulations: static TriangulatedSurface nonOrientable(int k) — The connected sum of k ≥ 1 projective planes. - Triangulations: static Triangulated3Manifold sphere3() — S³ as the boundary of the 4-simplex (5 vertices, 5 tetrahedra). - Triangulations: static SimplicialComplex torus(int n, int m) — The n-torus Tⁿ as an m^n grid of cubes, each cut into n! ### Knot theory (riptide_knots) import 'package:riptide_knots/riptide_knots.ray'; Link diagrams and Reidemeister moves, exact Jones, Alexander, Conway and HOMFLY-PT polynomials, and a table of small knots and links. https://riptidecompute.com/raya/docs/knots - List projectedCrossings(List curves, [Projection? projection]) — The crossings of closed polylines curves seen through projection (the viewer is on the +w side; the larger w passes over). - LinkDiagram diagramFromCurves(List curves, [Projection? projection]) — The link diagram of closed polylines curves seen through projection: a PD code with labels running 1, 2, … along each curve in its sampling direction. - double gaussLinkingNumber(SpaceCurve a, SpaceCurve b) — The Gauss linking integral of two closed polylines, evaluated exactly per segment pair as a signed solid angle (Klenin and Langowski, Biopolymers 54, 2000). - double curveWrithe(SpaceCurve a) — The writhe of a closed polyline (the Gauss double integral over the curve with itself); by Călugăreanu–White Lk = Tw + Wr for a ribbon along it. - Map knotDiagramScene(List curves, {required String id, required String title, Projection? projection, double gap = 0.18, int maxSegments = 160}) — Pure data, so this package needs no Evelyn; the explainer draws it in light and dark mode with its own palette. - TubeMesh tubeMesh(Float64List points, {double radius = 0.1, int sides = 16, bool closed = true, double uScale = 8}) — A tube of radius with sides facets around the polyline points (xyz per point). - final Map knotTable — The table, by name. - typedef SpaceCurve = Float64List — A closed space curve sampled as a polyline: x, y, z per point; the last point joins back to the first (it is not repeated). - abstract final class KnotCurves — Parametric knots and links in ℝ³. - KnotCurves: static SpaceCurve torusKnot(int p, int q, {double major = 2, double minor = 0.8, int samples = 360}) — The (p, q) torus knot on a torus of radii major and minor: p turns around the axis, q around the tube, x = (R + r cos qt) cos pt, y = (R + r cos qt) sin pt, z = −r sin qt. - KnotCurves: static List torusLink(int p, int q, {double major = 2, double minor = 0.8, int samples = 360}) — The (p, q) torus link: gcd(p, q) parallel copies of the (p/d, q/d) torus knot, spaced evenly around the tube; T(2, 4) is the Solomon link (linking number 2 with these orientations). - KnotCurves: static SpaceCurve figureEight({int samples = 360}) — The figure-eight knot 4₁: x = (2 + cos 2t) cos 3t, y = (2 + cos 2t) sin 3t, z = sin 4t. - KnotCurves: static SpaceCurve lissajous(int nx, int ny, int nz, {double phx = 0.1, double phy = 0.7, double phz = 0, double scale = 2, int samples = 600}) — A Lissajous knot x = cos(nₓt + φₓ), y = cos(n_y t + φ_y), z = cos(n_z t + φ_z) (frequencies pairwise coprime; with the default phases (3, 2, 7) is a 7-crossing diagram of the mirror of 7₄, as the tests check). - KnotCurves: static SpaceCurve circle((double, double, double) center, (double, double, double) u, (double, double, double) v, {double radius = 1, int samples = 200}) — A circle of radius around center in the plane spanned by unit vectors u and v. - KnotCurves: static List hopfLink({int samples = 200}) — The Hopf link: two unit circles through each other's centres. - KnotCurves: static List borromeanRings({int samples = 240}) — The Borromean rings as three mutually perpendicular ellipses (semi-axes 2 and 1). - final class Projection — An orthonormal projection frame: the screen axes u, v and the direction w toward the viewer. - Projection: factory Projection([(double, double, double) view = (0.0123, 0.0217, 1)]) — Looking along −view (default a slightly tilted z, so a symmetric curve projects generically). - Projection: final (double, double, double) u - Projection: final (double, double, double) v - Projection: final (double, double, double) w - Projection: (double, double, double) apply(Float64List c, int i) - final class ProjectedCrossing — One crossing of a projected curve: where it is on screen and which pieces of the curves pass over and under. - ProjectedCrossing: const ProjectedCrossing(this.x, this.y, this.overComponent, this.overParam, this.underComponent, this.underParam) - ProjectedCrossing: final double x — The screen position. - ProjectedCrossing: final double y — The screen position. - ProjectedCrossing: final int overComponent — Component index and position along it (segment index + fraction) of the over- and under-passes. - ProjectedCrossing: final int underComponent — Component index and position along it (segment index + fraction) of the over- and under-passes. - ProjectedCrossing: final double overParam - ProjectedCrossing: final double underParam - final class Crossing — One crossing of a planar diagram in the Knot Atlas / KnotTheory PD convention: Xa, b, c, d lists the four edge labels counterclockwise, starting with the incoming under-strand, so the under-strand runs a → c. - Crossing: const Crossing(this.a, this.b, this.c, this.d) - Crossing: factory Crossing.fromList(List x) - Crossing: final int a - Crossing: final int b - Crossing: final int c - Crossing: final int d - Crossing: List get labels - Crossing: int get hashCode - Crossing: Crossing map(int Function(int) f) - Crossing: String toString() - Crossing: int operator [](int p) — The label at counterclockwise position p (0 = incoming under). - Crossing: bool operator ==(Object other) - final class LinkDiagram — An oriented link diagram: crossings in PD notation plus freeLoops crossingless unknotted components. - LinkDiagram: LinkDiagram(List crossings, {this.freeLoops = 0, List? overEntries}) — overEntries optionally fixes, per crossing, the position (1 or 3) where the over-strand enters; it is needed only for components that never pass under (otherwise the orientation follows from the under-strands). - LinkDiagram: factory LinkDiagram.pd(List> pd, {int freeLoops = 0}) — From a PD code [i, j, k, l, …], e.g. the Knot Atlas trefoil [1, 4, 2, 5, 3, 6, 4, 1, 5, 2, 6, 3]. - LinkDiagram: factory LinkDiagram.unlink([int n = 1]) — The crossingless unknot (or an n-component unlink). - LinkDiagram: factory LinkDiagram.dt(List code) — From a Dowker–Thistlethwaite code (the even labels paired with 1, 3, 5, …; a negative entry means the strand is over at its even visit). - LinkDiagram: factory LinkDiagram.braid(int strands, List word) — The closure of a braid on strands strands; word lists generators as ±i (1-based): +i is σᵢ (strand i passes over strand i + 1, a positive crossing when both run up), −i is σᵢ⁻¹. σ₁³ is the right-handed trefoil. - LinkDiagram: static LinkDiagram rebuild(List kept, List<(int, int)> joins, {int freeLoops = 0, List? overEntries}) — Rebuilds a diagram from kept crossings after joining edge labels in pairs (joins: each pair becomes one edge). - LinkDiagram: final List crossings - LinkDiagram: final int freeLoops — Components with no crossings at all (unknotted, unlinked circles). - LinkDiagram: int get crossingCount - LinkDiagram: late final List signs — The sign of each crossing (+1: the over-strand enters at position 3, i.e. runs d → b). - LinkDiagram: int get writhe — The writhe: the sum of the crossing signs. - LinkDiagram: List get overEntries — Per crossing, the position (1 or 3) where the over-strand enters. - LinkDiagram: late final List> components — The components that have crossings, each as its edge labels in orientation order, starting from the component's smallest label; components are ordered by that label. - LinkDiagram: int get componentCount — The number of link components, crossingless loops included. - LinkDiagram: List get linkingNumbers — The pairwise linking numbers (i < j) in the order (0,1), (0,2), …, (1,2), …. - LinkDiagram: late final List> faces — The faces of the diagram as cycles of half-edges (crossing, position), each traversed counterclockwise (the face on the left). - LinkDiagram: int get projectionPieces — The number of connected pieces of the projection (crossingless loops excluded). - LinkDiagram: bool get isPlanar — Whether the crossing data is a planar diagram (Euler's formula, per connected piece of the projection). - LinkDiagram: bool get isAlternating — Whether over and under alternate along every component. - LinkDiagram: List get nugatoryCrossings — Crossings that one face touches at two corners (removable by turning a half of the diagram over). - LinkDiagram: bool get isReduced — Reduced: no nugatory crossing. - LinkDiagram: List> get pd — The PD code as lists. - LinkDiagram: bool isIncoming(int ci, int p) — Whether the edge at crossing ci, position p points into the crossing. - LinkDiagram: (int, int) overStrand(int ci) — The crossing ci's over-strand edges, incoming then outgoing. - LinkDiagram: (int next, int crossing, bool under) successor(int label) — The edge after label along the orientation, with the crossing it passes through and whether it passed under. - LinkDiagram: int componentOf(int label) — The component (index into components) that edge label belongs to. - LinkDiagram: int linkingNumber(int i, int j) — The linking number of components i and j: half the sum of the signs of the crossings between them. - LinkDiagram: LinkDiagram mirror() — The mirror image: every crossing switched. - LinkDiagram: int switchedOverEntry(int ci) — The over-strand entry position of switched (ci). - LinkDiagram: Crossing switched(int ci) — Crossing ci with over and under exchanged (orientations kept). - LinkDiagram: LinkDiagram reversed() — The same link with the orientation of every component reversed. - LinkDiagram: LinkDiagram reverseComponent(int k) — The same link with the orientation of component k (an index into components) reversed. - LinkDiagram: LinkDiagram normalized() — Labels renumbered 1, 2, … along each component in orientation order (the KnotTheory form). - LinkDiagram: String toString() - extension KnotInvariants on LinkDiagram — Exact polynomial invariants of a LinkDiagram. - KnotInvariants: Laurent kauffmanBracket() — The Kauffman bracket ⟨D⟩ in A, normalised so the crossingless unknot is 1 (a regular-isotopy invariant). - KnotInvariants: Laurent kauffmanBracketStateSum() — The plain 2ⁿ state sum (a reference for kauffmanBracket; only for small diagrams). - KnotInvariants: Laurent jonesHalf() — The Jones polynomial in s = t^½ (= q^½): knots have only even powers of s; see jones for t. - KnotInvariants: Laurent jones() — The Jones polynomial in t for a knot (or any link whose powers are integral); throws otherwise. - KnotInvariants: Laurent alexander() — The Alexander polynomial of a knot, Conway-normalised: Δ(t) = Δ(t⁻¹), Δ(1) = 1. - KnotInvariants: Laurent conway() — The Conway polynomial ∇(z), from HOMFLY-PT at a = 1 (any link); for a knot Δ(t) = ∇(t^½ − t^(−½)). - KnotInvariants: int determinant() — The determinant |Δ(−1)| = |V(−1)| of a knot. - KnotInvariants: Laurent2 homfly() — The HOMFLY-PT polynomial P(a, z): a·P(L₊) − a⁻¹·P(L₋) = z·P(L₀), P(unknot) = 1 (the Knot Atlas convention; Jones is P(a = t⁻¹, z = t^½ − t^(−½)), Conway is P(1, z)). - KnotInvariants: ({int lower, int upper, bool exact}) crossingNumberBounds() — Lower and upper bounds for the crossing number of a knot: span V(t) ≤ c(K) (Kauffman–Murasugi–Thistlethwaite) and the crossings of this diagram once kinks are removed; equal (exact) for a reduced alternating diagram. - extension KnotSignature on LinkDiagram — The knot signature by the Gordon–Litherland formula: σ = sign(G) − μ, with G the Goeritz matrix of a checkerboard colouring (white regions, one deleted) and μ the correction from the type II crossings (C. - KnotSignature: int signature() - final class Laurent — A Laurent polynomial Σ cₖ xᵏ (k ∈ ℤ, cₖ ∈ ℤ), stored sparse and normalised (no zero coefficients). - Laurent: factory Laurent.fromMap(Map terms) — From exponent → coefficient (zeros dropped). - Laurent: factory Laurent.monomial(int exponent, [int coefficient = 1]) — C·xᵉ. - Laurent: factory Laurent.constant(int c) - Laurent: static final Laurent zero - Laurent: static final Laurent one - Laurent: static final Laurent x — X itself. - Laurent: Map get terms — The terms, exponent → coefficient (read only). - Laurent: bool get isZero - Laurent: int get minDegree — The smallest and largest exponents (0 for the zero polynomial). - Laurent: int get maxDegree - Laurent: int get span — maxDegree − minDegree. - Laurent: int get absSum — Sum of |cₖ|. - Laurent: int get hashCode - Laurent: Laurent scale(int c) - Laurent: Laurent shift(int k) — Multiplies by xᵏ. - Laurent: Laurent pow(int n) - Laurent: Laurent substitutePower(int k) — p(xᵏ): every exponent multiplied by k (k = −1 is the mirror substitution x → 1/x). - Laurent: Laurent divideExponents(int k) — Exponents all divided by k; throws if one is not a multiple. - Laurent: Laurent exactDiv(Laurent d) — The exact quotient by d; throws StateError if d does not divide this in ℤx, x⁻¹. - Laurent: num evaluate(num x) — The value at an integer (exact when every exponent is ≥ 0 or x = ±1). - Laurent: String format([String variable = 'x']) — Human-readable, highest power first: -q^-4 + q^-3 + q^-1. - Laurent: String toString() - Laurent: int operator [](int exponent) — The coefficient of xᵉ. - Laurent: Laurent operator +(Laurent o) - Laurent: Laurent operator -(Laurent o) - Laurent: Laurent operator -() - Laurent: Laurent operator *(Laurent o) - Laurent: bool operator ==(Object other) - final class Laurent2 — A Laurent polynomial in two variables Σ c a^i z^j with integer coefficients (HOMFLY-PT lives here). - Laurent2: factory Laurent2.fromMap(Map<(int, int), int> terms) - Laurent2: factory Laurent2.monomial(int i, int j, [int c = 1]) - Laurent2: static final Laurent2 zero - Laurent2: static final Laurent2 one - Laurent2: Map<(int, int), int> get terms - Laurent2: bool get isZero - Laurent2: int get hashCode - Laurent2: Laurent2 shift(int i, int j) — Multiplies by aⁱ zʲ. - Laurent2: Laurent2 pow(int n) - Laurent2: Laurent2 substitute({int aPower = 1, int zPower = 1, bool negateZ = false}) — P(a^ka, z^kz·sign): the mirror image of a link is P(a⁻¹, −z). - Laurent2: Laurent specialise({required int aExp, required Laurent z}) — Sets a = x^aExp and z = z (a one-variable Laurent polynomial in x), exactly. - Laurent2: Laurent atAOne() — P(a, z) at a fixed a = 1 (the Conway polynomial for HOMFLY-PT), as a polynomial in z. - Laurent2: String format([String a = 'a', String z = 'z']) - Laurent2: String toString() - Laurent2: int operator [](({int a, int z}) e) - Laurent2: Laurent2 operator +(Laurent2 o) - Laurent2: Laurent2 operator -(Laurent2 o) - Laurent2: Laurent2 operator -() - Laurent2: Laurent2 operator *(Laurent2 o) - Laurent2: bool operator ==(Object other) - extension ReidemeisterMoves on LinkDiagram — Reidemeister moves and the other local operations on a LinkDiagram (all keep the planar PD consistent; new edges get labels above the largest one in use). - ReidemeisterMoves: List get kinks — Crossings that are R1 kinks (an edge from the crossing straight back to it, at adjacent positions). - ReidemeisterMoves: List<(int, int, int)> get r2Pokes — The R2 moves available as (face, raya i, raya j): two different edges on one face that a finger can push across. - ReidemeisterMoves: List<(int, int)> get r2Bigons — Bigon faces whose two crossings an R2⁻¹ can remove (one strand over at both), as crossing pairs. - ReidemeisterMoves: List<(int, int)> get r3Triangles — Triangular faces where R3 applies, as (face, side): the strand along that side is over (or under) at both of its triangle crossings and slides across the third crossing. - ReidemeisterMoves: LinkDiagram smoothed(int ci) — The oriented (Seifert) smoothing of crossing ci: incoming strands joined to the outgoing ones beside them. - ReidemeisterMoves: LinkDiagram removeKink(int ci) — R1⁻¹: removes kink ci. - ReidemeisterMoves: LinkDiagram removeAllKinks() — Removes kinks until none is left. - ReidemeisterMoves: LinkDiagram addKink(int? edge, {bool positive = true, bool overFirst = false}) — R1: adds a kink on edge edge (or, with edge null, on a crossingless loop). positive picks the sign, overFirst whether the strand meets the kink crossing first as the over-strand. - ReidemeisterMoves: LinkDiagram addPoke(int face, int i, int j, {bool over = true}) — R2: pushes a finger of the edge on raya i of face face across the edge on raya j of the same face, creating two crossings; over says whether the pushed strand goes over (true) or under. - ReidemeisterMoves: LinkDiagram removeBigon(int c1, int c2) — R2⁻¹: removes the bigon between crossings c1 and c2 (see r2Bigons). - ReidemeisterMoves: LinkDiagram triangleMove(int face, int side) — R3 on triangle face, sliding the strand along side side (see r3Triangles) across the opposite crossing. - final class KnotTableEntry — One knot or link of the table. jonesHalf is the Jones polynomial in q^½ (exponents doubled), homfly maps (power of a, power of z) to the coefficient. - KnotTableEntry: const KnotTableEntry({required this.name, required this.title, required this.crossings, required this.components, required this.alternating, required this.pd, required this.jonesHalf, required this.homfly, required this.signature, this.dt, this.alexander, this.conway, this.determinant, this.unknotting, this.linking}) - KnotTableEntry: final String name - KnotTableEntry: final String title - KnotTableEntry: final int crossings - KnotTableEntry: final int components - KnotTableEntry: final bool alternating - KnotTableEntry: final List> pd - KnotTableEntry: final List? dt - KnotTableEntry: final Map jonesHalf - KnotTableEntry: final Map? alexander - KnotTableEntry: final Map? conway - KnotTableEntry: final Map<(int, int), int> homfly - KnotTableEntry: final int? determinant - KnotTableEntry: final int signature - KnotTableEntry: final int? unknotting - KnotTableEntry: final List? linking - KnotTableEntry: Laurent get jonesHalfPoly - KnotTableEntry: Laurent? get alexanderPoly - KnotTableEntry: Laurent? get conwayPoly - KnotTableEntry: Laurent2 get homflyPoly - final class TubeMesh — A triangle mesh of a tube around a curve: per-vertex positions and unit normals (xyz), uvs (u along the curve, v around it), tangents (the curve direction, xyz) and counter-clockwise (outward-facing) indices. - TubeMesh: final Float32List positions - TubeMesh: final Float32List normals - TubeMesh: final Float32List uvs - TubeMesh: final Float32List tangents - TubeMesh: final Uint32List indices - TubeMesh: final int rings — Rings along the curve (the last repeats the first for a closed curve, so the texture seam has its own vertices) and vertices per ring minus one (the seam around the tube is duplicated too). - TubeMesh: final int sides — Rings along the curve (the last repeats the first for a closed curve, so the texture seam has its own vertices) and vertices per ring minus one (the seam around the tube is duplicated too). - TubeMesh: int get vertexCount - TubeMesh: Float32List interleaved() — The riptide_render interleaved layout (Geometry(vertices: …, indices: …)): position 3, normal 3, uv 2, tangent 4 (xyz + handedness 1) = 12 floats per vertex. ### Gauge fields (riptide_rational_gauge) import 'package:riptide_rational_gauge/riptide_rational_gauge.ray'; Superconductivity as a lattice Higgs model stepped by exact rational updates: U(1) links as rational unit complex numbers turned by Cayley maps, next to the classic angle form. https://riptidecompute.com/raya/docs/rational-gauge - (double, double) cayley(double t) — The Cayley point e(t) = ((1 − t²) + 2it)/(1 + t²) in doubles: (re, im). - double turnRule(double t1, double t2) — The turn rule: the parameter of e(t₁)·e(t₂), (t₁ + t₂)/(1 − t₁t₂) (infinite when t₁t₂ = 1: the half turn −1). - double halfTurnSpread(double re) — Sin²(θ/2) of a unit complex number (re, im): (1 − re)/2. - double spreadOf(double re, double im) — The spread between a unit complex number (re, im) and 1: im²/(re² + im²), which is im² for a unit number. - double londonRatio(double lambda2) — The lattice London decay ratio r (B_{n+1} = r·B_n into the sample): the root of r + 1/r = 2 + 1/λ² below 1. - double lambda2ForRatio(double r) — The other way round, rational: choose the ratio r ∈ ℚ and λ² = r/(1 − r)². - double londonPowers(double b0, double r, int n) — The lattice London profile with a rational ratio: B_n = B₀ rⁿ (multiplications only). - double latticeSpread(double u) — The lattice wave's spread k̂²/4 for the Cayley parameter u: u²/(1 + u²). - double stepSpread(double dt, double mass2, double u) — The leapfrog oscillator's per-step spread s = (dt²/4)(m² + k̂²) (Rational): the discrete dispersion relation with no angle. - double redQuadrance(double omega, double k) — The red quadrance ω² − k² of (ω, k) (chromogeometry): m² on the mass shell, 0 on the light cone. - int quadrantOf(double re, double im) — The quadrant of (re, im): 0 for re > 0, im ≥ 0; 1 for re ≤ 0, im > 0; 2 for re < 0, im ≤ 0; 3 for re ≥ 0, im < 0. −1 for the origin (no direction). - int? quarterTurns(double ar, double ai, double br, double bi) — Signed quarter turns from a to b along the straight segment (−2 … 2); null if either is the origin. - int? windingOf(List re, List im) — The winding number of the closed polygon through (rek, imk) around 0 (closed back to the first point), or null if a vertex is the origin. - int? windingOfExact(List re, List im, {required int Function(T) sign, required T Function(T, T) mul, required T Function(T, T) sub}) — The same count over any ordered field, given its sign function (exact rationals: Rational.compareTo). - void anglesFromLinks(Float64List ur, Float64List ui, Float64List th) — Θ_l = atan2(Im U_l, Re U_l): the classic way's angles from unit links (on switching ways). - void turnLinks(Float64List th, Float64List ur, Float64List ui, Float64List dth) — The classic link turn: θ_l += Δθ_l, U_l = e^{iθ_l} = (cos θ_l, sin θ_l). - (double, double) expI(double theta) — E^{iθ} = (cos θ, sin θ). - double argOf(double re, double im) — Arg z by atan2. - int windingByAngles(List re, List im) — The classic vortex count: n = round((1/2π) Σ_k arg(s_{k+1}/s_k)) round a closed polygon, each arg by atan2. - double fluxQuanta(Iterable<(double, double)> plaquettes) — Σ θ_p: the flux of a set of plaquettes in units of the flux quantum, (1/2π) Σ atan2(Im U_p, Re U_p). - double londonProfile(double b0, double x, double lambda) — London's profile B(x) = B₀ e^{−x/λ}. - (double, double) weinberg(double g, double gp, double mW) — The weak mixing angle θ_W = atan(g'/g) and m_Z = m_W / cos θ_W. - double carrier(double k, double x) — The classic wave carrier cos(kx) for a gauge-field wave packet. - (double, double) vacuum(double alpha, double beta, double phi) — The classic vacuum: |ψ₀| = √(−α/β) at the phase φ: |ψ₀| e^{iφ}. - (double, double) windingPhase(int n, double x, double y, double cx, double cy) — The phase winding n round a centre (cx, cy): e^{inφ}, φ = atan2(y − cy, x − cx) (a ring's flux state, classic). - final class CayleyArith — Exact helpers over any field T (ℚ with riptide_precision's Rational). - CayleyArith: const CayleyArith(this.f) - CayleyArith: final KeplerArith f - CayleyArith: (T, T) point(T t) — e(t): ((1 − t²)/(1 + t²), 2t/(1 + t²)). - CayleyArith: T quadrance(T re, T im) — Re² + im² (1 exactly for every Cayley point and every product of them). - CayleyArith: (T, T) mul(T a, T b, T c, T d) — (a + ib)(c + id). - CayleyArith: (T, T) power(T re, T im, int n) — The n-th power of a unit number by repeated multiplication (n ≥ 0); exact. - CayleyArith: T halfTurnSpread(T re) — Sin²(θ/2) = (1 − re)/2 of a unit number. - final class ExactGaugeLattice — The lattice model over T, stepped the rational way. - ExactGaugeLattice: ExactGaugeLattice(this.geometry, this.f, {required this.alpha, required this.beta, required this.g2, required this.sign}) - ExactGaugeLattice: final LatticeGeometry geometry - ExactGaugeLattice: final KeplerArith f - ExactGaugeLattice: final int Function(T) sign — The sign of a value (−1, 0, 1), for the exact winding count. - ExactGaugeLattice: final List pr - ExactGaugeLattice: final List pi - ExactGaugeLattice: final List qr - ExactGaugeLattice: final List qi - ExactGaugeLattice: final List ur - ExactGaugeLattice: final List ui - ExactGaugeLattice: final List el - ExactGaugeLattice: T alpha - ExactGaugeLattice: T beta - ExactGaugeLattice: T g2 - ExactGaugeLattice: T hr - ExactGaugeLattice: T hi - ExactGaugeLattice: late List gr - ExactGaugeLattice: late List gi - ExactGaugeLattice: late List fl - ExactGaugeLattice: void computeForces() - ExactGaugeLattice: T energy() — The free energy, exactly. - ExactGaugeLattice: void relax(T dt) — One time-dependent Ginzburg–Landau step (as GaugeLattice.relax, rational way). - ExactGaugeLattice: void evolve(T dt) — One Hamiltonian step (as GaugeLattice.evolve, rational way, no friction). - ExactGaugeLattice: T gauss(int i) — Gauss's law at i: Σ_out E − Σ_in E + 2 Im(π̄ψ). - ExactGaugeLattice: Iterable linkQuadrances() — Every link's quadrance |U|², which stays exactly 1. - ExactGaugeLattice: void applyGauge(List gRe, List gIm) — Ψ → gψ, π → gπ, U_l → g_j U_l ḡ_i, exactly. - ExactGaugeLattice: int vortexAt(int i) — The vortex number of the plaquette at i, by exact signs. - final class Ramp — A value that ramps linearly from from to to over length steps after start. - Ramp: const Ramp(this.from, [double? to, this.start = 0, this.length = 0]) - Ramp: final double from - Ramp: final double to - Ramp: final int start - Ramp: final int length - Ramp: double at(int step) - Ramp: bool settledAt(int step) - enum SuperconductorType — Type I (κ² < 1/2: the whole field is expelled) or type II (κ² > 1/2: it enters as vortices). - SuperconductorType: typeI(beta: 1, g2: 2, depth: 1 / 36, psi0: 1 / 6) — Κ² = β/(2g²) = 1/4: ξ = 6, λ = 3 sites (ξ² = 1/|α| = 36, λ² = 1/(2g²Q₀) = 9), ψ₀ = 1/6. - SuperconductorType: meissner(beta: 1, g2: 0.5, depth: 1 / 9, psi0: 1 / 3) — Κ² = 1 (just type II): ξ = λ = 3 sites, ψ₀ = 1/3. - SuperconductorType: ring(beta: 1, g2: 0.5, depth: 0.25, psi0: 0.5) — Κ² = 1: ξ = λ = 2 sites, ψ₀ = 1/2: a ring several λ thick, so the flux it holds is close to whole quanta. - SuperconductorType: thinRing(beta: 1, g2: 0.02, depth: 1 / 16, psi0: 0.25) — A thin ring (three sites across, under ξ): ξ = 4, λ = 20 sites (κ² = 25), ψ₀ = 1/4. - SuperconductorType: bulk(beta: 4, g2: 0.125, depth: 0.25, psi0: 0.25) — Κ² = 16: ξ = 2, λ = 8 sites, ψ₀ = 1/4: vortices 10 apart feel each other strongly and order. - SuperconductorType: typeII(beta: 4, g2: 0.5, depth: 0.25, psi0: 0.25) — Κ² = 4: ξ = 2, λ = 4 sites, ψ₀ = 1/4. - SuperconductorType: const SuperconductorType({required this.beta, required this.g2, required this.depth, required this.psi0}) - SuperconductorType: final double beta - SuperconductorType: final double g2 - SuperconductorType: final double depth - SuperconductorType: final double psi0 — A rational point on the rim: ψ₀² = Q₀ = depth/β exactly (no root). - enum SuperconductorPreset — The superconductor experiments: their shapes and presets. - SuperconductorPreset: coolInField — Cool a type-I disc through T_c in a field: the field is pushed out to a skin of depth λ. - SuperconductorPreset: fieldAfterCooling — Cool first, then switch the field on: it never gets in. - SuperconductorPreset: warmUp — Warm the cooled disc above T_c: the field floods back in. - SuperconductorPreset: fieldEnters — A type-II square in a rising field: flux enters as vortices from the edges and settles into a lattice. - SuperconductorPreset: fieldCooled — Cooled in the field: vortices and antivortices everywhere, annihilating, then ordering. - SuperconductorPreset: strongField — A strong field: a dense vortex lattice. - SuperconductorPreset: typeIForComparison — The same field on a type-I square: no vortex lattice. - SuperconductorPreset: triangularLattice — A piece of the bulk, wrapped so it has no edges (a torus √3 times taller than wide), holding exactly 32 flux quanta: cooled from noise, the vortices settle into Abrikosov's triangular lattice (six neighbours each). - SuperconductorPreset: trapFlux — Cool a ring in a field, then switch the field off: whole flux quanta stay trapped, held by a persistent current. - SuperconductorPreset: screenField — Switch a field on round a cold ring: the hole stays at zero flux (the fluxoid can't change without a vortex). - SuperconductorPreset: fluxJumps — A thin ring in a slowly rising field: the fluxoid steps up one quantum at a time (phase slips), a sawtooth of current. - SuperconductorPreset: windThree — Start the ring's phase winding three times round (rational points that go round three times), no field. - enum SuperconductorShape - SuperconductorShape: disc - SuperconductorShape: square - SuperconductorShape: torus - SuperconductorShape: ring - SuperconductorShape: thinRing - extension on SuperconductorPreset - extension on SuperconductorPreset: SuperconductorShape get shape - final class SuperconductorExperiment — A superconducting sample on the lattice, relaxed by time-dependent Ginzburg–Landau. - SuperconductorExperiment: SuperconductorExperiment({SuperconductorPreset preset = SuperconductorPreset.coolInField, LinkMaths maths = LinkMaths.rational, this.size = 64}) - SuperconductorExperiment: static SuperconductorType typeFor(SuperconductorPreset p) — The material a preset starts with. - SuperconductorExperiment: static const int frontSteps = 1800 — Steps for the front to cross the disc. - SuperconductorExperiment: static const int torusNx = 40 — The bulk tile: 40 × 69 sites (69/40 ≈ √3, so a triangular lattice of spacing 10 fits: 4 × 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. - SuperconductorExperiment: static const int torusNy = 69 — The bulk tile: 40 × 69 sites (69/40 ≈ √3, so a triangular lattice of spacing 10 fits: 4 × 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. - SuperconductorExperiment: static const int torusQuanta = 32 — The bulk tile: 40 × 69 sites (69/40 ≈ √3, so a triangular lattice of spacing 10 fits: 4 × 4 cells of 2 vortices), and the field per plaquette whose 2,760 plaquettes hold exactly torusQuanta quanta. - SuperconductorExperiment: static const double torusField = 6829 / 187402 - SuperconductorExperiment: static const double weakShare = 0.1 - SuperconductorExperiment: static const double weakHalfLength = 4.5 - SuperconductorExperiment: static const double jumpField = 0.04 — The thin ring's slow ramp: to about six quanta through the loop. - SuperconductorExperiment: static const int jumpSteps = 24000 - SuperconductorExperiment: static const double trapHalfField = 1 / 176 — The field the ring is cooled in, by the Cayley parameter of half its flux per plaquette (h = e(t½)², θ_H ≈ 0.0227: about 4.2 quanta through the middle of the ring), and the winding the condensate takes. - SuperconductorExperiment: static const int trapWinding = 4 - SuperconductorExperiment: static const double meissnerField = 0.015 — The Meissner disc's field: about 0.4 H_c (θ_c² = 2g²·α²/(2β): θ_c ≈ 0.079 per plaquette), below H_c1. - SuperconductorExperiment: static const int historyEvery = 100 - SuperconductorExperiment: static const int settleSteps = 2500 — Steps a preset is given to settle after its script. - SuperconductorExperiment: final int size — Sites along each side. - SuperconductorExperiment: late GaugeLattice lattice - SuperconductorExperiment: late SuperconductorPreset preset - SuperconductorExperiment: late SuperconductorType type - SuperconductorExperiment: late Ramp alphaRamp — The temperature knob: α = −a below T_c (a > 0), +a above. - SuperconductorExperiment: late Ramp fieldRamp — The applied field's Cayley parameter per plaquette (flux 2·atan t ≈ 2t per plaquette). - SuperconductorExperiment: int t — Steps since the preset started. - SuperconductorExperiment: double get dt — The step sizes of ψ and of the links. - SuperconductorExperiment: double get dtA — The links' step: 0.1, or g²/5 when the magnetic term is stiff (its rate goes up to 8/g²; gradient flow is stable below 2g²/8). - SuperconductorExperiment: double get depth — The condensate's depth |α| below T_c. - SuperconductorExperiment: LinkMaths get maths - SuperconductorExperiment: set maths(LinkMaths m) - SuperconductorExperiment: List get loop — The closed path of sites the ring's winding and holonomy are measured round (empty for other shapes). - SuperconductorExperiment: SuperconductorShape get shape - SuperconductorExperiment: double get centre - SuperconductorExperiment: Ramp? frontRamp — The cooling front's radius (sites), or null when the temperature is uniform. - SuperconductorExperiment: double get discRadius - SuperconductorExperiment: double get ringInner — The ring's radii (in sites) and the field it is cooled in. - SuperconductorExperiment: double get ringOuter - SuperconductorExperiment: (double, double)? get weakLinkAt — Where the weak link is (sites), for drawing; null without one. - SuperconductorExperiment: List loopInterior — The plaquettes inside loop. - SuperconductorExperiment: final history — For the ring presets, (field through the loop in quanta, fluxoid n) every historyEvery steps: the sawtooth. - SuperconductorExperiment: double get appliedLoopQuanta — The applied field's flux through the ring's loop, in quanta (display: θ_h by atan2, classic.ray). - SuperconductorExperiment: bool get settled — Whether the preset's script has played out (its ramps and cooling front done, and some time to settle). - SuperconductorExperiment: double get field — The applied field per plaquette, as its Cayley parameter now. - SuperconductorExperiment: bool get cold — Below T_c, or cooling towards it (the temperature's target). - SuperconductorExperiment: double get fieldScale — The field scale the drawing uses: Im h of the strongest field this preset applies. - SuperconductorExperiment: GLParameters get parameters - SuperconductorExperiment: void start(SuperconductorPreset p) — Starts p from its initial state. - SuperconductorExperiment: void advance(int n) — Runs n relaxation steps, following the preset's temperature and field. - SuperconductorExperiment: double? coordination() — How the vortices pack: for each vortex at least two nearest spacings from the sample's edge, the number of vortices within 1.3× its nearest neighbour's distance, compared by quadrances (Q < 1.69·Q_min: no root). - SuperconductorExperiment: SuperconductorExperiment twin(LinkMaths m) — The same experiment the other way (or this way), from this one's state now: the two run side by side. - SuperconductorExperiment: void setField(double tField, {int steps = 200}) — Moves the applied field to Cayley parameter tField per plaquette over steps from now. - SuperconductorExperiment: void setCold(bool cold, {int steps = 60}) — Cools below T_c or warms above it, everywhere, over steps from now. - SuperconductorExperiment: void setType(SuperconductorType k) — Changes the material (type I or II) from now: β, g² and the depth of the hat. - SuperconductorExperiment: List<(int, int)> vortices() — Every vortex: plaquette site and its winding (exact by signs the rational way, by atan2 the classic way). - SuperconductorExperiment: double fluxQuantaInSample() — The total flux through the sample, in flux quanta: Σ θ_p / 2π (classic, atan2 per plaquette). - SuperconductorExperiment: double insideFieldShare() — The mean field inside the sample as a share of the applied field: Σ Im U_p / (N Im h) (Rational). - SuperconductorExperiment: int ringWinding() — The fluxoid round the ring's loop: exact by signs (rational), by atan2 (classic). - SuperconductorExperiment: double ringFluxQuanta() — The flux through the ring's loop in quanta (classic: Σ θ_p/2π over the plaquettes inside). - SuperconductorExperiment: double ringHolonomySpread() — The holonomy's half-turn spread s = (1 − Re W)/2 round the loop (Rational; classically sin²(πΦ/Φ₀)): 0 exactly when the enclosed flux is a whole number of quanta. - SuperconductorExperiment: List fieldProfile() — The magnetic field profile along the middle row: Im U_p per plaquette (Rational). - enum HiggsPreset — What the Higgs strip starts from. - HiggsPreset: rollIntoVacuum — The field at the top of the hat, a light wave launched: as the field rolls into the vacuum the wave turns massive. - HiggsPreset: lightInVacuum — No condensate (above T_c): the wave travels at the speed of light. - HiggsPreset: lightInCondensate — Already in the vacuum: the wave is massive from the start (slower, spreading). - HiggsPreset: higgsMode — The field displaced outwards from the rim: it rings at the Higgs (amplitude) mass. - final class HiggsExperiment — The Higgs strip: a periodic chain (ny = 1) whose y-links carry a transverse gauge wave A_y(x) along x, with a uniform ψ that rolls in the Mexican hat. - HiggsExperiment: HiggsExperiment({HiggsPreset preset = HiggsPreset.rollIntoVacuum, LinkMaths maths = LinkMaths.rational, this.length = 256}) - HiggsExperiment: static const double alphaBroken = -0.5 — The hat: V = αQ + (β/2)Q² with Q₀ = 1/4 (ψ₀ = 1/2 exactly), g² = 1: m_A² = 2g²Q₀ = 1/2, m_H² = 2βQ₀ = 1/2. - HiggsExperiment: static const double beta = 2 — The hat: V = αQ + (β/2)Q² with Q₀ = 1/4 (ψ₀ = 1/2 exactly), g² = 1: m_A² = 2g²Q₀ = 1/2, m_H² = 2βQ₀ = 1/2. - HiggsExperiment: static const double g2 = 1 — The hat: V = αQ + (β/2)Q² with Q₀ = 1/4 (ψ₀ = 1/2 exactly), g² = 1: m_A² = 2g²Q₀ = 1/2, m_H² = 2βQ₀ = 1/2. - HiggsExperiment: static const double dt = 0.25 - HiggsExperiment: static const double carrierU = 0.3 — The wave packet's carrier: Cayley parameter u = tan(k/2) (k ≈ 0.6), and its width. - HiggsExperiment: static const int packetHalfWidth = 24 - HiggsExperiment: static const double amplitude = 0.3 — The wave packet's amplitude (A_y, radians of link phase at the crest). - HiggsExperiment: final int length - HiggsExperiment: late GaugeLattice lattice - HiggsExperiment: late HiggsPreset preset - HiggsExperiment: LinkMaths get maths - HiggsExperiment: set maths(LinkMaths m) - HiggsExperiment: double friction — Radial friction on ψ (gauge invariant), so the field settles on the rim. - HiggsExperiment: int t - HiggsExperiment: MexicanHat get hat - HiggsExperiment: Ramp alphaRamp — The temperature: α over time (the hat forms when α turns negative). - HiggsExperiment: bool get cold — Cold, or cooling (the temperature's target). - HiggsExperiment: bool get settled — Whether the preset has played out (for a looping miniature). - HiggsExperiment: (double, double) get psi — Ψ at the first site (the strip's field is uniform). - HiggsExperiment: double get q — Q = |ψ|² now. - HiggsExperiment: double get photonMass2 — The photon's mass squared now, m_A² = 2g²Q. - HiggsExperiment: double get q0 — The rim Q₀ = −α/β (0 above T_c). - HiggsExperiment: List get waveE — E_y along the strip. - HiggsExperiment: List get waveA — A_y along the strip, the link phase (Im U as the rational measure: sin A ≈ A). - HiggsExperiment: void start(HiggsPreset p) - HiggsExperiment: void advance(int n) - HiggsExperiment: HiggsExperiment twin(LinkMaths m) — The same strip the other way, from this one's state now. - HiggsExperiment: void setCold(bool cold, {int steps = 40}) — Hot (α > 0: no hat, ψ settles to 0) or cold (the hat: ψ rolls to the rim), over steps from now. - HiggsExperiment: void launchWave() — Sends a new wave packet from a quarter of the way along (replacing the transverse field there). - HiggsExperiment: void nudge() — Nudges ψ off the top of the hat (when it sits there) by a small rational step. - HiggsExperiment: double groupVelocity() — The group velocity the wave should have in the vacuum, k/√(k² + m_A²) (continuum; Root). - HiggsExperiment: double waveCentre() — The energy-weighted centre of the wave (sites), for measuring how fast it moves. - final class LatticeGeometry — The shape of a 2-D lattice: nx × ny sites (site i = y·nx + x), a link from each site in +x (μ = 0) and +y (μ = 1), link index l = 2i + μ, open or periodic in each direction, and which sites are superconducting. - LatticeGeometry: LatticeGeometry(this.nx, this.ny, {this.periodicX = false, this.periodicY = false, bool Function(int x, int y)? superconducting}) - LatticeGeometry: final int nx - LatticeGeometry: final int ny - LatticeGeometry: final bool periodicX - LatticeGeometry: final bool periodicY - LatticeGeometry: final Int32List next — The site a link leads to, or −1 (no link: an open edge). - LatticeGeometry: final Int32List prev — The site whose μ-link leads to i (prev2i + μ), or −1. - LatticeGeometry: final Uint8List sc — 1 where the site is superconducting. - LatticeGeometry: final Uint8List hop — 1 where the link carries hopping (both ends superconducting). - LatticeGeometry: final Uint8List plaquette — 1 where site i is the lower-left corner of a plaquette. - LatticeGeometry: int get sites - LatticeGeometry: int get links - LatticeGeometry: int index(int x, int y) - LatticeGeometry: int xOf(int i) - LatticeGeometry: int yOf(int i) - LatticeGeometry: bool linkOn(int l) — Whether link l exists. - LatticeGeometry: (int, int, int, int) plaquetteLinks(int i) — The four links of the plaquette at i, with the orientation the plaquette product uses: U_p = U_x(i)·U_y(i + x̂)·conj(U_x(i + ŷ))·conj(U_y(i)). - LatticeGeometry: bool plaquetteInSample(int i) — Whether all four corners of the plaquette at i are superconducting (a vortex can be counted there). - LatticeGeometry: (List, List) discLoop(double cx, double cy, double r2) — A closed counter-clockwise path of sites round the plaquettes whose centres lie within quadrance r2 of (cx, cy) (a digital disc: compared by quadrance, no root), and those plaquettes. - enum LinkMaths — How the link variables are stored and turned. - LinkMaths: classic - LinkMaths: rational - final class GaugeLattice — The lattice model in doubles (the live labs run this). - GaugeLattice: GaugeLattice(this.geometry, {LinkMaths maths = LinkMaths.rational, this.alpha = -1, this.beta = 1, this.g2 = 1}) - GaugeLattice: final LatticeGeometry geometry - GaugeLattice: final Float64List pr — Ψ (real, imaginary). - GaugeLattice: final Float64List pi — Ψ (real, imaginary). - GaugeLattice: final Float64List qr — Π, ψ's momentum (Hamiltonian evolution only). - GaugeLattice: final Float64List qi — Π, ψ's momentum (Hamiltonian evolution only). - GaugeLattice: final Float64List ur — U per link (real, imaginary); the classic way keeps them equal to (cos θ, sin θ). - GaugeLattice: final Float64List ui — U per link (real, imaginary); the classic way keeps them equal to (cos θ, sin θ). - GaugeLattice: final Float64List th — The classic way's link angles θ (unused by the rational way). - GaugeLattice: final Float64List el — The electric field per link (Hamiltonian evolution only). - GaugeLattice: final Float64List gr — The last forces: ∂F/∂ψ̄ per site and ∂F/∂θ per link. - GaugeLattice: final Float64List gi — The last forces: ∂F/∂ψ̄ per site and ∂F/∂θ per link. - GaugeLattice: final Float64List fl — The last forces: ∂F/∂ψ̄ per site and ∂F/∂θ per link. - GaugeLattice: double alpha — The potential αQ + (β/2)Q² (α < 0: below T_c, the Mexican hat). - GaugeLattice: double beta — The potential αQ + (β/2)Q² (α < 0: below T_c, the Mexican hat). - GaugeLattice: Float64List? alphaMap — Α per site, when the temperature isn't uniform (a cooling front); null: alpha everywhere. - GaugeLattice: double hr — The applied field's phase per plaquette, h = (hr, hi) (1: no field). - GaugeLattice: double hi — The applied field's phase per plaquette, h = (hr, hi) (1: no field). - GaugeLattice: bool renormalize — In the rational way, hold |U| to rounding by the quadrance correction U ← U(3 − Q)/2 after each turn. - GaugeLattice: double g2 — The gauge coupling g² (the charge squared): 1/g² weighs the magnetic energy. - GaugeLattice: LinkMaths get maths - GaugeLattice: set maths(LinkMaths m) — Switches the way the links are kept. - GaugeLattice: int steps - GaugeLattice: void copyStateFrom(GaugeLattice o) — Copies o's state (same geometry): fields, parameters and the applied field; the classic angles from the links. - GaugeLattice: void setPsi((double, double) Function(int x, int y) value) — Sets ψ everywhere superconducting from value (x, y) → (re, im), zero elsewhere; π cleared. - GaugeLattice: void setLinks((double, double) Function(int x, int y, int mu) value) — Sets every link from value (x, y, μ) → U (re, im), and the classic angles from it. - GaugeLattice: void setFieldParameter(double t) — The applied field's phase per plaquette, by its Cayley parameter: h = e(t), a flux of 2·atan t per plaquette. - GaugeLattice: void computeForces() — Fills gr, gi (∂F/∂ψ̄) and fl (∂F/∂θ). - GaugeLattice: (double, double) plaquetteAt(int i) — U_p at the plaquette whose lower-left corner is i (1 where there is none). - GaugeLattice: double energy() — The free energy F. - GaugeLattice: double hamiltonian() — The Hamiltonian (g²/2)ΣE² + Σ|π|² + F. - GaugeLattice: void relax(double dt, {double? dtA}) — One step of time-dependent Ginzburg–Landau (gradient flow): ψ ← ψ − dt·∂F/∂ψ̄, θ ← θ − dtA·∂F/∂θ. - GaugeLattice: void evolve(double dt, {double radialFriction = 0}) — One step of the Hamiltonian evolution (symplectic Euler): E ← E − dt·∂F/∂θ, π ← π − dt·∂F/∂ψ̄, then the links turn by dt·g²E and ψ ← ψ + dt·π. radialFriction damps only π's component along ψ (gauge invariant: Gauss's… - GaugeLattice: double gauss(int i) — Gauss's law at site i: Σ_out E − Σ_in E + 2 Im(π̄_i ψ_i) (conserved by evolve). - GaugeLattice: int vortexAt(int i) — The vortex number of the plaquette at i, counted exactly by signs (winding.ray): the winding of ψ carried round the plaquette by the links, closed by the plaquette's own phase. 0 outside the sample or where ψ = 0. - GaugeLattice: int fluxoid(List path, List interior) — The fluxoid of a closed path of neighbouring sites (counter-clockwise round interior, the plaquettes it encloses): (1/2π)Σ_links (Δφ − A) + Σ_p θ_p, an integer, counted exactly by signs. - GaugeLattice: (List, List) fluxoidPolygon(List path, List interior) — The polygon fluxoid winds (the classic count sums the same steps by atan2). - GaugeLattice: (double, double) holonomy(List path) — The holonomy Π U round a closed path (a unit complex number; e^{iΦ} for the enclosed flux Φ). - GaugeLattice: void applyGauge(List gRe, List gIm) — Applies the gauge transformation g_i = (gRei, gImi) (unit numbers): ψ → gψ, π → gπ, U_l → g_j U_l ḡ_i. - GaugeLattice: void noise(double amplitude, {int seed = 1}) — Small random ψ on the superconducting sites (seeded): the fluctuations a cooling sample starts from. - GaugeLattice: double unitDrift() — Max ||U|² − 1| over the links (0 for the classic way by construction, rounding for the rational way). - final class MexicanHat — The Mexican hat V(Q) = αQ + (β/2)Q² in the quadrance Q = |ψ|² (the Ginzburg–Landau potential). - MexicanHat: const MexicanHat(this.alpha, this.beta) - MexicanHat: final double alpha - MexicanHat: final double beta - MexicanHat: double get q0 — The rim (the vacuum): Q₀ = −α/β, rational (|ψ₀| = √Q₀ would be a root; the lab never needs it). - MexicanHat: double get depth — The depth of the rim below the top: V(Q₀) = −α²/(2β). - MexicanHat: double v(double q) - MexicanHat: double slope(double q) — V′(Q) = α + βQ: ψ's restoring force is −V′(Q)ψ. - final class GLParameters — Lattice units (spacing 1) of the model in lattice.ray: hopping weight 1, potential αQ + (β/2)Q², magnetic weight 1/g². - GLParameters: const GLParameters({required this.alpha, required this.beta, required this.g2}) - GLParameters: final double alpha - GLParameters: final double beta - GLParameters: final double g2 - GLParameters: double get q0 — Q₀ = −α/β. - GLParameters: double get xi2 — Ξ² = 1/|α| (the coherence length squared). - GLParameters: double get lambda2 — Λ² = 1/(2g²Q₀) (the London penetration depth squared): no root. - GLParameters: double get kappa2 — Κ² = λ²/ξ² = β/(2g²); type II when κ² > 1/2 (κ > 1/√2), with no root. - GLParameters: bool get typeII - GLParameters: double get photonMass2 — The photon's mass squared in the condensate, m_A² = 2g²Q₀ = 1/λ². - GLParameters: double get higgsMass2 — The Higgs (amplitude) mode's mass squared, m_H² = 2βQ₀ = −2α; m_H²/m_A² = 2κ². - final class Electroweak — The electroweak masses at tree level from g², g'² and v² (all squares: Rational). - Electroweak: const Electroweak({required this.g2, required this.gp2, required this.v2}) - Electroweak: static const standard = Electroweak(g2: 0.652 * 0.652, gp2: 0.357 * 0.357, v2: 246.0 * 246.0) — G = 0.652, g' = 0.357, v = 246 GeV. - Electroweak: final double g2 - Electroweak: final double gp2 - Electroweak: final double v2 - Electroweak: double get mW2 — m_W² = g²v²/4. - Electroweak: double get mZ2 — m_Z² = (g² + g'²)v²/4. - Electroweak: double get sW — The weak mixing spread s_W = g'²/(g² + g'²) (classically sin²θ_W): the spread between (g, g') and the g axis. - Electroweak: double get cW — The cross c_W = 1 − s_W = m_W²/m_Z². - Electroweak: double get photonMass2 — The photon stays massless: the combination g'W³ + gB the vacuum doesn't charge. - Electroweak: double higgsMass2(double lambda) — m_h² = 2λv² for the Higgs self-coupling λ. ### Lattice gauge theory (riptide_lattice) import 'package:riptide_lattice/riptide_lattice.ray'; U(1) gauge symmetry as code, and lattice gauge theory for U(1), SU(2) and SU(3) with the Wilson action. https://riptidecompute.com/raya/docs/lattice - double vonMises(double kappa, math.Random r) — A von Mises variate on (−π, π] with concentration kappa (Best & Fisher, Appl. - void suMul(int n, Float64List a, int ao, Float64List b, int bo, Float64List c, int co) — C = a·b for N×N complex blocks at offsets. - void suMulDag(int n, Float64List a, int ao, Float64List b, int bo, Float64List c, int co) — C = a·b†. - void suDagMul(int n, Float64List a, int ao, Float64List b, int bo, Float64List c, int co) — C = a†·b. - double suReTrace(int n, Float64List a, int ao) — Re tr(a). - void suIdentity(int n, Float64List a, int ao) — Writes the identity. - List randomSu2Quaternion(math.Random r) — A uniformly (Haar) distributed SU(2) quaternion (a0, a1, a2, a3). - void su2FromQuaternion(List q, Float64List m, int o) — The 2×2 matrix a0 + i(a1σ1 + a2σ2 + a3σ3) written at o of m (row-major complex). - List kennedyPendleton(double a, math.Random r) — Kennedy–Pendleton: x0 ∈ −1, 1 with density ∝ √(1 − x0²) e^{a·x0} (a = β_eff·k > 0), then a uniform direction. - List su2Project(int n, Float64List w, int o, int i, int j) — The SU(2) projection of the 2×2 block (i, j rows/cols of an N×N matrix w): quaternion q with Re tr(r·w_block) = 2 Σ r_μ q_μ for r ∈ SU(2) (r as quaternion, with the sign convention of su2FromQuaternion). - List quatMul(List p, List q) — Quaternion product (as SU(2) matrices): p·q. - List quatDag(List q) — The adjoint (inverse) quaternion. - void su2LeftMultiplySubgroup(int n, List q, Float64List u, int o, int i, int j) — Left-multiplies rows i, j of the N×N matrix u (at o) by the SU(2) element q embedded in that subgroup. - void suReunitarise(int n, Float64List u, int o) — Projects the N×N block at o back onto SU(N) (Gram–Schmidt on rows; for N = 3 the third row is the conjugate cross product of the first two, fixing det = 1). - void suRandom(int n, Float64List u, int o, math.Random r) — A Haar-random SU(N) element at o (N = 2 from a uniform quaternion, N = 3 from products of random subgroup rotations, which is Haar after enough factors; ten suffice for tests and hot starts). - void suExpI(int n, Float64List p, int po, double eps, Float64List out, int oo) — exp(i·ε·P) for Hermitian traceless N×N p (at po) into out (at oo), by scaling and squaring of the Taylor series; unitary to round-off for HMC step sizes. - double besselI(int n, double x) — Modified Bessel function I_n(x) (riptide_numerics_special). - double u1PlaquetteTwoDimensions(double beta, {int? plaquettes}) — Exact ⟨cos θ_P⟩ of 2-D U(1) Wilson lattice gauge theory on a periodic lattice with plaquettes plaquettes: Z = Σ_n I_n(β)^V, so ⟨cos θ_P⟩ = Σ_n I_n'(β) I_n(β)^{V−1} / Σ_n I_n(β)^V (I_n' = (I_{n−1} + I_{n+1})/2). - double su2PlaquetteTwoDimensions(double beta) — Exact infinite-volume ⟨½ tr U_P⟩ of 2-D SU(2) Wilson lattice gauge theory: I₂(β)/I₁(β) (Gross & Witten, Phys. - Float64List ringSpectrum(int sites, double flux, {bool singularGauge = false}) — The spectrum of a tight-binding ring of sites sites (hopping 1) threaded by flux flux (in units of the flux quantum h/q), with the whole Peierls phase on one link (singularGauge) or spread evenly. - Float64List aharonovBohmScreen({required double flux, int nx = 160, int ny = 96, int steps = 560, double dt = 0.2, int screenX = 130}) — The Aharonov–Bohm double-path experiment on a tight-binding grid: a wave packet from the left meets a square obstacle (sites with a high potential) that hides a solenoid of flux flux (units of h/q) at its centre; the… - enum GaugeGroup — The gauge group of a lattice. - GaugeGroup: u1(1) - GaugeGroup: su2(2) - GaugeGroup: su3(3) - GaugeGroup: const GaugeGroup(this.n) - GaugeGroup: final int n — N of U(N)/SU(N); 1 for U(1). - final class GaugeLattice — A gauge field on a periodic lattice with extents dims (the last one is Euclidean time). - GaugeLattice: GaugeLattice(this.group, this.dims, {int seed = 1}) - GaugeLattice: final GaugeGroup group - GaugeLattice: final List dims - GaugeLattice: final int d - GaugeLattice: final int volume - GaugeLattice: final int esize - GaugeLattice: final math.Random rnd - GaugeLattice: late final Float64List links - GaugeLattice: late final List up - GaugeLattice: late final List dn - GaugeLattice: late final Uint8List parity - GaugeLattice: int get n - GaugeLattice: int offset(int site, int mu) — Offset of link (site, μ) in links. - GaugeLattice: void coldStart() — Every link = 1. - GaugeLattice: void hotStart() — Every link Haar-random. - GaugeLattice: void staple(int x, int mu, Float64List v, int vo) — The sum of staples V of link (x, μ), so the local action is −(β/N) Re tr(U_μ(x)·V), written to v at vo. - GaugeLattice: double plaquette() — ⟨Re tr U_P⟩/N over every plaquette. - GaugeLattice: double plaquetteAt(int x, int mu, int nu) — Re tr U_P / N of the plaquette at x in the (μ, ν) plane. - GaugeLattice: double action(double beta) — The Wilson action S = β Σ_P (1 − Re tr U_P / N). - GaugeLattice: double wilsonLoop(int r, int t) — ⟨Re tr W(R, T)⟩/N: rectangular loops of R links along each spatial axis and T along the last axis. - GaugeLattice: (double, double) polyakovLoop() — The Polyakov loop ⟨tr Π_t U_time(x, t)⟩/N averaged over spatial sites, as (re, im). - GaugeLattice: void randomGaugeTransform() — Applies the gauge transformation U_μ(x) → G(x) U_μ(x) G(x+μ)† with Haar-random G (observables are invariant). - GaugeLattice: void heatBathSweep(double beta) — One checkerboard heat-bath sweep at coupling beta. - GaugeLattice: void overrelaxSweep() — One checkerboard overrelaxation sweep (microcanonical: leaves S unchanged). - GaugeLattice: (double, bool) hmcTrajectory(double beta, {required int steps, required double eps, bool metropolis = true}) — One HMC trajectory of steps leapfrog steps of size eps; returns (ΔH, accepted). - GaugeLattice: double hmcReversibility(double beta, {required int steps, required double eps}) — Runs the leapfrog forward then, with momenta reversed, backward; returns the max link change (reversibility). - final class U1Field2D — A charged scalar field ψ on a periodic 2-D lattice with U(1) links: the gauge principle made concrete. - U1Field2D: U1Field2D(this.nx, this.ny, {this.a = 1, this.charge = 1}) - U1Field2D: final int nx - U1Field2D: final int ny - U1Field2D: final double a - U1Field2D: final double charge - U1Field2D: final Float64List psi — Interleaved complex ψ(x, y), x fastest. - U1Field2D: final Float64List theta — Link angles θ_μ(x, y) = q·a·A_μ, index 2·site + μ (μ = 0 for x, 1 for y). - U1Field2D: int site(int x, int y) - U1Field2D: void setVectorPotential((double, double) Function(double x, double y) aField) — Sets the links from a continuum vector potential A(x, y) sampled at link midpoints. - U1Field2D: (double, double) covariantDerivative(int x, int y, int mu) — D_μψ at (x, y) as (re, im). - U1Field2D: double plaquetteAngle(int x, int y) — The plaquette angle θ_P at (x, y), wrapped to (−π, π]: q·a²·F_xy. - U1Field2D: double wilsonAction() — The Wilson gauge action β Σ_P (1 − cos θ_P) with β = 1/(q²a^{4−d}), d = 2 here, so it tends to ½∫F_xy² dxdy. - U1Field2D: void gaugeTransform(double Function(int x, int y) alpha) — Applies the local gauge transformation α(x, y): ψ → e^{iα}ψ, θ_μ(x) → θ_μ(x) + α(x) − α(x+μ̂). - U1Field2D: void applyHamiltonian(Float64List p, Float64List out, {Float64List? potential}) — Hψ for the minimally coupled lattice Schrödinger operator H = −(1/2m)Σ_μ D_μ†D_μ (mass 1): the hopping form (2d/2a²)ψ(x) − (1/2a²) Σ_μ U_μ(x)ψ(x+μ̂) + U_μ(x−μ̂)†ψ(x−μ̂). - U1Field2D: void stepRk4(double dt, {Float64List? potential}) — One RK4 step of iψ̇ = Hψ. - U1Field2D: double current(Float64List p, int x, int y, int mu) — The probability current on link (x, μ): j_μ(x) = Im(ψ*(x) U_μ(x) ψ(x+μ̂))/a (mass 1), the gauge-invariant Noether current of the phase symmetry. ## Geometry, physics and speed ### Vectors, quaternions and matrices (riptide_math) import 'package:riptide_math/riptide_math.ray'; Allocation-free vector, quaternion and matrix types over SIMD and typed data, spherical harmonics and low-discrepancy sequences. https://riptidecompute.com/raya/docs/math - List? gjk(Convex a, Convex b, {int maxIterations = 64}) — GJK intersection test (Gilbert, Johnson and Keerthi 1988): A and B overlap iff their Minkowski difference A − B contains the origin. - ({Vec3 normal, double depth})? epa(Convex a, Convex b, List simplex, {int maxIterations = 128, double tolerance = 1e-4}) — EPA (Expanding Polytope Algorithm, van den Bergen 2001): from GJK's enclosing simplex, expands toward the boundary of A − B to find the penetration depth and normal: moving B by normal × depth separates the shapes. - bool obbOverlap(Obb a, Obb b) — Separating axis theorem for two oriented boxes: they're disjoint iff some axis among the 3 + 3 face normals and the 9 edge cross products separates their projections (Gottschalk et al. 1996). - double sphereDepth(SphereShape a, SphereShape b) — Distance helper used by tests and physics: penetration depth of two spheres (negative when separated). - Vec3 bezier(List ctrl, double t) — Bézier curve of any degree by de Casteljau's algorithm: repeated linear interpolation of the control polygon (numerically stable, gives the point and the subdivision). - Vec3 catmullRom(Vec3 p0, Vec3 p1, Vec3 p2, Vec3 p3, double t, {double alpha = 0.5}) — Uniform cubic Catmull–Rom through p1→p2 with neighbours p0, p3, centripetal parameterisation (alpha = 0.5) by default, which avoids cusps and self-intersections (Yuksel et al. 2011). - Vec3 deBoor(int degree, List knots, List ctrl, double u, {List? weights}) — B-spline / NURBS evaluation by de Boor's algorithm. knots has ctrl.length + degree + 1 entries; weights (optional) makes it a NURBS curve (rational: evaluate in homogeneous coordinates, then divide by w). - List clampedKnots(int count, int degree) — A clamped uniform knot vector for count control points of degree (curve starts/ends at the end points). - ({double t, double u, double v})? rayTriangle(Ray ray, Vec3 a, Vec3 b, Vec3 c, {bool cullBack = false, double tMin = 1e-7}) — Ray–triangle intersection (Möller and Trumbore 1997): solves o + t d = (1-u-v) a + u b + v c by Cramer's rule. - ({double tNear, double tFar})? rayAabb(Ray ray, Vec3 min, Vec3 max, {double tMax = double.infinity}) — Ray–AABB slab test (Kay and Kajiya 1986; branchless form after Williams et al. 2005). - double? raySphere(Ray ray, Vec3 center, double radius) — Ray–sphere: the smallest t ≥ 0 where |o + t d - c| = r, or null. - double? rayPlane(Ray ray, Plane plane) — Ray–plane: t where the ray meets the plane, or null when parallel or behind. - Vec3 closestPointOnSegment(Vec3 p, Vec3 a, Vec3 b) — The point on segment a, b closest to p. - Vec3 closestPointOnTriangle(Vec3 p, Vec3 a, Vec3 b, Vec3 c) — The point on triangle abc closest to p, by Voronoi regions (Ericson, "Real-Time Collision Detection", 5.1.5). - ({Float64List values, Mat3d vectors}) symmetricEigen3(Mat3d a, {int maxSweeps = 32}) — Eigen-decomposition of a symmetric 3×3 matrix by cyclic Jacobi rotations: A = V diag(λ) Vᵀ. - ({Mat3d u, Float64List sigma, Mat3d v}) svd3(Mat3d a) — Singular value decomposition A = U Σ Vᵀ of a 3×3 matrix (σ descending, ≥ 0), via the eigen-decomposition of AᵀA. - ({Mat3d r, Mat3d s}) polar3(Mat3d a) — Polar decomposition A = R S with R the closest rotation to A and S symmetric positive semi-definite. - bool solveLinear(Float64List m, Float64List b, int n) — Solves the n×n system M x = b in place by Gaussian elimination with partial pivoting (row-major m). - List<(int, int, int)> convexHull3(Float32x4List pts) — Convex hull of a 3D point set by the incremental method with conflict-free face visibility (the same horizon-stitching step QuickHull uses; this version visits points in input order instead of farthest-first, so it is… - List<(int, int, int)> earClip(List poly) — Ear-clipping triangulation of a simple polygon (2D, either winding). - List<(int, int, int)> delaunay2(List pts) — Delaunay triangulation of 2D points by Bowyer–Watson: insert points one by one, remove triangles whose circumcircle contains the point, re-triangulate the hole. - Float32x4List computeTangents(Float32x4List positions, Float32x4List normals, Float32List uvs, Uint32List indices) — Per-vertex tangent frames for normal mapping (Lengyel's method: solve for the UV-gradient directions per triangle, accumulate, Gram–Schmidt against the normal, store handedness in w). - ({Float32x4List positions, Uint32List indices}) simplifyQem(Float32x4List positions, Uint32List indices, int targetTriangles) — Quadric error metric simplification (Garland and Heckbert 1997): each vertex accumulates the sum of squared distances to its faces' planes as a 4×4 quadric Q; collapsing edge (i, j) to v costs vᵀ(Q_i + Q_j)v. - double kahanSum(Iterable values) — Compensated summation: Neumaier's variant of Kahan summation keeps the low-order bits lost by each addition, so summing many floats of different magnitude stays accurate. - double contactImpulse({required Float32x4List vel, required Float32List invMass, required int a, required int b, required Vec3 normal, required double accumulated, double restitution = 0}) — One sequential-impulse contact solve along normal n (Catto 2005): computes the impulse that removes approaching velocity (with restitution), clamps the accumulated impulse to ≥ 0 so contacts only push, and applies it… - ({double value, double velocity}) springDamp(double value, double velocity, double target, double omega, double dt) — Critically damped spring smoothing toward a target (exact solution of x'' = −2ω x' − ω² (x − target), no overshoot, frame-rate independent). omega = 2 / smoothTime is a good default. - List poissonDisk(double width, double height, double r, {int k = 30, int seed = 1}) — Poisson-disk (blue noise) points in the width × height rectangle with minimum distance r (Bridson 2007). - Float32List rotateSh9(Float32List coeffs, Vec3 Function(Vec3) inverseRotate) — Rotation of order-2 SH coefficients (9 per channel) by re-projection: SH bands are closed under rotation, so evaluating the function at 9 fixed directions rotated by R⁻¹ and solving the 9×9 basis system gives the… - final class Bvh — A bounding volume hierarchy over triangles, built top-down with the binned surface area heuristic (SAH; Wald 2007): split where C = C_trav + (A_L/A) N_L C_isect + (A_R/A) N_R C_isect is lowest. - Bvh: factory Bvh.build(Float32x4List positions, Uint32List indices, {int maxLeaf = 4, int bins = 12}) — Builds over positions (one Float32x4 per vertex, w ignored) and indices (3 per triangle). - Bvh: final Float32x4List positions - Bvh: final Uint32List indices - Bvh: final Uint32List order - Bvh: final Float32x4List boundsMin - Bvh: final Float32x4List boundsMax - Bvh: final Int32List left — Child node indices; -1 for a leaf. - Bvh: final Int32List right - Bvh: final Int32List first - Bvh: final Int32List count - Bvh: int get nodeCount - Bvh: ({int triangle, double t, double u, double v})? raycast(Ray ray) — The closest triangle hit by ray: (triangle, t, u, v) or null. - abstract interface class Convex — A convex shape described only by its support function: the farthest point in direction d. - Convex: Vec3 support(Vec3 d) - final class SphereShape implements Convex - SphereShape: const SphereShape(this.center, this.radius) - SphereShape: final Vec3 center - SphereShape: final double radius - SphereShape: Vec3 support(Vec3 d) - final class BoxShape implements Convex - BoxShape: const BoxShape(this.center, this.halfExtents) - BoxShape: final Vec3 center - BoxShape: final Vec3 halfExtents - BoxShape: Vec3 support(Vec3 d) - final class PointCloudShape implements Convex - PointCloudShape: PointCloudShape(this.points) - PointCloudShape: final Float32x4List points - PointCloudShape: Vec3 support(Vec3 d) - final class CapsuleShape implements Convex — A capsule: the segment a–b swept by a sphere of radius. - CapsuleShape: const CapsuleShape(this.a, this.b, this.radius) - CapsuleShape: final Vec3 a - CapsuleShape: final Vec3 b - CapsuleShape: final double radius - CapsuleShape: Vec3 support(Vec3 d) - final class TransformedConvex implements Convex — A convex shape in local coordinates moved by a rotation and translation: support(d) = p + R·s(Rᵀd). - TransformedConvex: const TransformedConvex(this.shape, this.rotation, this.translation) - TransformedConvex: final Convex shape - TransformedConvex: final Quat rotation - TransformedConvex: final Vec3 translation - TransformedConvex: Vec3 support(Vec3 d) - final class Obb — Oriented box for separating-axis tests: center, 3 unit axes, half extents. - Obb: const Obb(this.center, this.axes, this.halfExtents) - Obb: final Vec3 center - Obb: final List axes - Obb: final Vec3 halfExtents - Obb: double radiusOn(Vec3 l) — Projection radius of this box onto axis l. - abstract final class Color — Colour spaces and transfer functions. - Color: static double srgbToLinear(double c) — sRGB electro-optical transfer: encoded → linear (IEC 61966-2-1). - Color: static double linearToSrgb(double c) — Linear → sRGB encoded. - Color: static double luminance(Vec3 rgb) — Relative luminance of linear Rec.709/sRGB (BT.709 weights). - Color: static Vec3 linearSrgbToAcesCg(Vec3 c) — Linear sRGB (D65) → ACEScg (AP1, D60), including the Bradford adaptation (matrix from the ACES reference). - Color: static Vec3 acesCgToLinearSrgb(Vec3 c) — ACEScg → linear sRGB (inverse of the above). - Color: static Vec3 linearSrgbToOklab(Vec3 c) — Linear sRGB → OKLab (L, a, b). - Color: static Vec3 oklabToLinearSrgb(Vec3 lab) — OKLab → linear sRGB. - Color: static double acesFilm(double x) — ACES filmic tone-mapping curve fit (Narkowicz 2015), applied per channel to linear HDR, result in 0, 1. - abstract final class Half — IEEE 754 binary16 ("half") packing for GPU buffers and HDR textures: 1 sign, 5 exponent, 10 mantissa bits. - Half: static int pack(double value) — Float → half bits, round-to-nearest-even, with overflow to infinity, NaN kept, and subnormals. - Half: static double unpack(int h) — Half bits → float. - final class ArcLengthTable — Arc-length table for a parametric curve: sample samples segments, accumulate chord lengths, then map an arc length s back to t by binary search + linear interpolation (constant-speed motion along curves). - ArcLengthTable: ArcLengthTable(Vec3 Function(double t) curve, {int samples = 256}) - ArcLengthTable: final Float64List lengths - ArcLengthTable: double get total - ArcLengthTable: double tAt(double s) — The parameter t at arc length s (clamped to 0, total). - enum RoundingMode — How to round when a result needs fewer digits than it has. - RoundingMode: halfEven — Toward the nearest; ties to the even neighbour (banker's rounding — no statistical bias over many roundings). - RoundingMode: halfUp — Toward the nearest; ties away from zero (the usual school rounding). - RoundingMode: halfDown — Toward the nearest; ties toward zero. - RoundingMode: down — Toward zero (truncate). - RoundingMode: up — Away from zero. - RoundingMode: floor — Toward −∞. - RoundingMode: ceiling — Toward +∞. - RoundingMode: unnecessary — Throw if any non-zero digit would be dropped. - extension type const Decimal._((BigInt, int) _r) implements Object — An exact decimal. - Decimal: factory Decimal.raw(BigInt unscaled, int scale) — unscaled × 10^(−scale); scale ≥ 0. - Decimal: factory Decimal.fromInt(int v) - Decimal: factory Decimal.fromMinorUnits(int minor, int digits) — Integer minor units with digits minor digits: fromMinorUnits(1999, 2) == 19.99. - Decimal: factory Decimal.parse(String s) — Parses "-12.3400", "1e-3", "+7". - Decimal: static final zero - Decimal: static final one - Decimal: BigInt get unscaled - Decimal: int get scale - Decimal: int get sign - Decimal: Decimal divide(Decimal o, {required int scale, RoundingMode mode = RoundingMode.halfEven}) — Quotient rounded to scale digits after the point with mode. - Decimal: Decimal setScale(int newScale, {RoundingMode mode = RoundingMode.halfEven}) — This rounded (or padded) to newScale digits after the point. - Decimal: int toMinorUnits(int digits, {RoundingMode mode = RoundingMode.halfEven}) — Integer minor units for a currency with digits minor digits, rounding with mode; throws if the result doesn't fit a 64-bit int. - Decimal: int compareTo(Decimal o) - Decimal: bool equals(Decimal o) — Numeric equality (scale-insensitive). - Decimal: Decimal abs() - Decimal: Decimal normalized() — Removes trailing zeros (1.500 → 1.5). - Decimal: String toPlainString() — Plain notation with exactly scale digits after the point ("-0.050"). - Decimal: double toDouble() — Nearest double (for display or charts only — never for money arithmetic). - Decimal: Decimal operator +(Decimal o) - Decimal: Decimal operator -(Decimal o) - Decimal: Decimal operator -() - Decimal: Decimal operator *(Decimal o) — Exact product (scales add). - Decimal: bool operator <(Decimal o) - Decimal: bool operator <=(Decimal o) - Decimal: bool operator >(Decimal o) - Decimal: bool operator >=(Decimal o) - final class IntegerOverflow implements Exception — Thrown by checked arithmetic when the exact result doesn't fit the type. - IntegerOverflow: IntegerOverflow(this.op) - IntegerOverflow: final String op - IntegerOverflow: String toString() - extension type const U8._(int v) implements Object - U8: factory U8(int v) - U8: factory U8.wrap(int v) - U8: static const max = U8._(255) - U8: static U8 parse(String s, {int radix = 10}) - U8: int get value - U8: U8 checkedAdd(U8 o) - U8: U8 checkedSub(U8 o) - U8: U8 checkedMul(U8 o) - U8: U8 saturatingAdd(U8 o) - U8: U8 saturatingSub(U8 o) - U8: U8 operator +(U8 o) - U8: U8 operator -(U8 o) - U8: U8 operator *(U8 o) - U8: U8 operator &(U8 o) - U8: U8 operator |(U8 o) - U8: U8 operator ^(U8 o) - U8: U8 operator ~() - U8: U8 operator <<(int s) - U8: U8 operator >>(int s) - U8: bool operator <(U8 o) - U8: bool operator >(U8 o) - extension type const U16._(int v) implements Object - U16: factory U16(int v) - U16: factory U16.wrap(int v) - U16: static const max = U16._(0xffff) - U16: static U16 parse(String s, {int radix = 10}) - U16: int get value - U16: U16 checkedAdd(U16 o) - U16: U16 checkedSub(U16 o) - U16: U16 checkedMul(U16 o) - U16: U16 saturatingAdd(U16 o) - U16: U16 saturatingSub(U16 o) - U16: U16 operator +(U16 o) - U16: U16 operator -(U16 o) - U16: U16 operator *(U16 o) - U16: U16 operator &(U16 o) - U16: U16 operator |(U16 o) - U16: U16 operator ^(U16 o) - U16: U16 operator ~() - U16: U16 operator <<(int s) - U16: U16 operator >>(int s) - U16: bool operator <(U16 o) - U16: bool operator >(U16 o) - extension type const U32._(int v) implements Object - U32: factory U32(int v) - U32: factory U32.wrap(int v) - U32: static const max = U32._(0xffffffff) - U32: static U32 parse(String s, {int radix = 10}) - U32: int get value - U32: U32 checkedAdd(U32 o) - U32: U32 checkedSub(U32 o) - U32: U32 checkedMul(U32 o) - U32: U32 saturatingAdd(U32 o) - U32: U32 saturatingSub(U32 o) - U32: U32 rotateLeft(int s) - U32: U32 operator +(U32 o) - U32: U32 operator -(U32 o) - U32: U32 operator *(U32 o) - U32: U32 operator &(U32 o) - U32: U32 operator |(U32 o) - U32: U32 operator ^(U32 o) - U32: U32 operator ~() - U32: U32 operator <<(int s) - U32: U32 operator >>(int s) - U32: bool operator <(U32 o) - U32: bool operator >(U32 o) - extension type const U64._(int bits) implements Object — Unsigned 64-bit: the same 64 bits as int, compared and printed as unsigned. - U64: const U64.fromBits(this.bits) - U64: factory U64.fromBigInt(BigInt b) - U64: static const max = U64._(-1) - U64: static const zero = U64._(0) - U64: static U64 parse(String s, {int radix = 10}) - U64: int compareTo(U64 o) — Unsigned compare: flipping the sign bit maps unsigned order onto signed order. - U64: U64 checkedAdd(U64 o) - U64: U64 checkedSub(U64 o) - U64: U64 checkedMul(U64 o) - U64: U64 saturatingAdd(U64 o) - U64: U64 saturatingSub(U64 o) - U64: BigInt toBigInt() - U64: String toRadixString(int radix) - U64: bool operator <(U64 o) - U64: bool operator >(U64 o) - U64: bool operator <=(U64 o) - U64: bool operator >=(U64 o) - U64: U64 operator +(U64 o) - U64: U64 operator -(U64 o) - U64: U64 operator *(U64 o) - U64: U64 operator &(U64 o) - U64: U64 operator |(U64 o) - U64: U64 operator ^(U64 o) - U64: U64 operator ~() - U64: U64 operator <<(int s) - U64: U64 operator >>(int s) - U64: U64 operator ~/(U64 o) — Unsigned division and remainder (via BigInt for the top-bit-set cases). - extension type const U128._((int, int) _r) implements Object — Unsigned 128-bit integer as (hi, lo) 64-bit halves, each read as unsigned. - U128: const U128(int hi, int lo) - U128: factory U128.fromU64(U64 v) - U128: factory U128.fromBigInt(BigInt b) - U128: static const zero = U128(0, 0) - U128: static const max = U128(-1, -1) - U128: static U128 parse(String s, {int radix = 10}) - U128: int get hi - U128: int get lo - U128: int compareTo(U128 o) - U128: bool equals(U128 o) - U128: U128 wrappingMul(U128 o) — Product modulo 2^128, by 32-bit limbs (schoolbook). - U128: U128 checkedAdd(U128 o) - U128: U128 checkedMul(U128 o) - U128: U128 saturatingAdd(U128 o) - U128: BigInt toBigInt() - U128: String toRadixString(int radix) - U128: bool operator <(U128 o) - U128: bool operator >(U128 o) - U128: U128 operator +(U128 o) - U128: U128 operator -(U128 o) - U128: U128 operator *(U128 o) - U128: U128 operator &(U128 o) - U128: U128 operator |(U128 o) - U128: U128 operator ^(U128 o) - U128: U128 operator ~() - U128: U128 operator <<(int s) - U128: U128 operator >>(int s) - extension type const I128._(U128 u) implements Object — Signed 128-bit integer (two's complement over U128's bits). - I128: factory I128.fromInt(int v) - I128: factory I128.fromBigInt(BigInt b) - I128: static final max - I128: static final min - I128: static I128 parse(String s) - I128: bool get isNegative - I128: int compareTo(I128 o) - I128: I128 checkedAdd(I128 o) - I128: I128 checkedSub(I128 o) - I128: I128 checkedMul(I128 o) - I128: I128 saturatingAdd(I128 o) - I128: BigInt toBigInt() - I128: I128 operator +(I128 o) - I128: I128 operator -(I128 o) - I128: I128 operator *(I128 o) - I128: I128 operator -() - I128: bool operator <(I128 o) - I128: bool operator >(I128 o) - abstract final class Ik — Inverse kinematics on joint position chains (root first). - Ik: static void fabrik(List joints, Vec3 target, {int iterations = 16, double tolerance = 1e-4}) — FABRIK (Aristidou and Lasenby 2011): alternate backward (end effector → root) and forward (root → end) passes, re-placing each joint along the line to its neighbour at the bone length. - Ik: static void ccd(List joints, Vec3 target, {int iterations = 32, double tolerance = 1e-4}) — Cyclic coordinate descent: from the last joint back to the root, rotate each joint so the end effector points at the target. - Ik: static Vec3 twoBone(Vec3 root, double a, double b, Vec3 target, Vec3 pole) — Analytic two-bone IK (arm or leg): with upper length a, lower length b and target distance c, the law of cosines gives the root and middle angles exactly. pole picks the bending plane. - final class Ray — A ray o + t·d (d need not be unit; t is in units of |d|). - Ray: const Ray(this.origin, this.direction) - Ray: final Vec3 origin - Ray: final Vec3 direction - Ray: Vec3 at(double t) - extension type Mat3d(Float64List m) — Small dense linear algebra in double precision (Float64List, row-major), for decompositions where float32 isn't enough: physics (inertia, shape matching), animation (polar decomposition), geometry (PCA, OBB fitting). - Mat3d: factory Mat3d.zero() - Mat3d: factory Mat3d.identity() - Mat3d: factory Mat3d.of(List rowMajor) - Mat3d: Mat3d get transposed - Mat3d: double get determinant - Mat3d: double at(int r, int c) - Mat3d: void set(int r, int c, double v) - Mat3d: Mat3d operator *(Mat3d o) - extension type Mat4._(Float32x4List c) — A 4×4 column-major matrix stored in 4 SIMD columns. - Mat4: factory Mat4.identity() — A new identity matrix (allocates its storage once). - Mat4: factory Mat4.view(Float32x4List buffer, [int column = 0]) — A matrix over 4 columns of buffer starting at column column. - Mat4: Float32x4 col(int i) - Mat4: void setIdentity() - Mat4: void setFrom(Mat4 o) - Mat4: void setTrs(Vec3 t, Quat r, Vec3 s) — Translation · rotation · scale (TRS), the usual model matrix. - Mat4: void setPerspective(double fovY, double aspect, double near, double far) — A right-handed perspective projection to clip space with z in 0, 1 (Metal/Vulkan/WebGPU convention). - Mat4: void setLookAt(Vec3 eye, Vec3 target, Vec3 up) — A right-handed view matrix looking from eye at target. - Mat4: void multiplyInto(Mat4 b, Mat4 out) — Out = this · b. out may be this or b. - Mat4: Vec4 transformPoint(Vec3 p) — This · (p, 1): a point (translation applies). - Mat4: Vec3 transformDirection(Vec3 d) — This · (d, 0): a direction (no translation). - Mat4: void transposeInto(Mat4 out) — The transpose of this into out (may be this). - Mat4: bool invertInto(Mat4 out) — The general inverse via cofactors into out; returns false (and leaves out unchanged) when singular. - Mat4: double entry(int row, int column) - extension type Mat3._(Float32x4List c) — A 3×3 matrix (normal matrices, rotations) as 3 SIMD columns (w lanes unused). - Mat3: factory Mat3.identity() - Mat3: void setRotation(Quat q) — The rotation of q. - Mat3: Vec3 transform(Vec3 p) - final class Mat4Buffer — Contiguous storage for many 4×4 matrices (e.g. instance transforms uploaded to the GPU): Mat4.view slices it. - Mat4Buffer: Mat4Buffer(this.count) - Mat4Buffer: final int count - Mat4Buffer: final Float32x4List columns - Mat4Buffer: Float32List get floats — The raw float storage, ready to copy into a GPU buffer. - Mat4Buffer: Mat4 operator [](int i) - final class HalfEdgeMesh — Half-edge mesh built from an indexed triangle mesh: each directed edge knows its twin (opposite half-edge) and next edge, so adjacency queries (one-ring, boundaries, manifoldness) are O(1) per step. - HalfEdgeMesh: HalfEdgeMesh.fromTriangles(int vertexCount, List<(int, int, int)> tris) - HalfEdgeMesh: final Int32List vertexOf - HalfEdgeMesh: final Int32List next - HalfEdgeMesh: final Int32List twin - HalfEdgeMesh: final Int32List outgoing - HalfEdgeMesh: int get halfEdgeCount - HalfEdgeMesh: int get boundaryEdgeCount — Edges with no twin lie on a boundary. - HalfEdgeMesh: List oneRing(int v) — The vertices around v (its one-ring), walking twin→next; stops at a boundary. - final class Noise — Gradient noise. - Noise: Noise([int seed = 0]) - Noise: double perlin(double x, double y, double z) — Improved Perlin noise in 3D. - Noise: double simplex2(double x, double y) — 2D simplex noise: sums of radially symmetric kernels on a skewed triangular grid; cheaper and with fewer directional artefacts than 2D Perlin. - Noise: double fbm(Vec3 p, {int octaves = 5, double lacunarity = 2, double gain = 0.5}) — Fractal Brownian motion: octaves of Perlin noise, each at double frequency and gain amplitude. - abstract final class Sdf — Signed distance functions (negative inside). - Sdf: static double sphere(Vec3 p, double r) - Sdf: static double box(Vec3 p, Vec3 halfExtents) - Sdf: static double roundBox(Vec3 p, Vec3 halfExtents, double r) - Sdf: static double torus(Vec3 p, double major, double minor) - Sdf: static double capsule(Vec3 p, Vec3 a, Vec3 b, double r) - Sdf: static double plane(Vec3 p, Vec3 n, double d) - Sdf: static double smoothUnion(double a, double b, double k) — Polynomial smooth minimum (blends two shapes over width k). - Sdf: static double? march(double Function(Vec3) sdf, Vec3 origin, Vec3 dir, {double maxDist = 100, int maxSteps = 256, double epsilon = 1e-4}) — Sphere tracing (Hart 1996): step along the ray by the distance bound until within epsilon of the surface. - Sdf: static Vec3 normal(double Function(Vec3) sdf, Vec3 p, {double h = 1e-4}) — Surface normal by central differences of the distance field. - extension type const Fx16(int raw) — Q16.16 fixed point in a Raya int (64-bit on native): bit-identical results on every device, for deterministic lockstep or rollback netcode where floats can differ between CPUs and compilers. - Fx16: factory Fx16.fromDouble(double v) - Fx16: factory Fx16.fromInt(int v) - Fx16: static const one = Fx16(1 << 16) - Fx16: double toDouble() - Fx16: Fx16 operator +(Fx16 o) - Fx16: Fx16 operator -(Fx16 o) - Fx16: Fx16 operator -() - Fx16: Fx16 operator *(Fx16 o) - Fx16: Fx16 operator /(Fx16 o) - Fx16: bool operator <(Fx16 o) - Fx16: bool operator >(Fx16 o) - extension type const Fx32(int raw) — Q32.32 fixed point. - Fx32: factory Fx32.fromDouble(double v) - Fx32: factory Fx32.fromInt(int v) - Fx32: double toDouble() - Fx32: Fx32 operator +(Fx32 o) - Fx32: Fx32 operator -(Fx32 o) - Fx32: Fx32 operator *(Fx32 o) - abstract final class RobustPredicates — Exact geometric predicates. - RobustPredicates: static int orient2d(double ax, double ay, double bx, double by, double cx, double cy) — Sign of the orientation of (a, b, c): > 0 counter-clockwise, < 0 clockwise, 0 collinear. - RobustPredicates: static int incircle(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) — Sign of whether d is inside (> 0), outside (< 0) or on (0) the circle through counter-clockwise a, b, c. - RobustPredicates: static int orient3d(List a, List b, List c, List d) — Sign of the orientation of d relative to the plane through a, b, c (> 0 below, matching Shewchuk's orient3d). - final class Rat — An exact rational number on BigInt (denominators stay powers of two here). - Rat: Rat(this.n, this.d) - Rat: static final zero - Rat: final BigInt n - Rat: final BigInt d - Rat: int get sign - Rat: Rat operator +(Rat o) - Rat: Rat operator -(Rat o) - Rat: Rat operator *(Rat o) - abstract final class Integrate — Time integrators for x'' = a(x, v, t), written over flat SIMD arrays so a whole particle system steps without allocation. - Integrate: static void semiImplicitEuler(Float32x4List x, Float32x4List v, Float32x4List a, double dt) — V += a·dt; x += v·dt (semi-implicit Euler). - Integrate: static void verlet(Float32x4List x, Float32x4List prev, Float32x4List a, double dt) — Position Verlet: x_{n+1} = 2x_n − x_{n−1} + a dt² (velocity is implicit; prev holds x_{n−1}). - Integrate: static Float64List rk4(Float64List Function(double t, Float64List y) f, double t, Float64List y, double h) — Classic RK4 for one state y' = f(t, y) (state as a Float64List). - abstract final class Xpbd — Extended position-based dynamics (Macklin, Müller and Chentanez 2016): constraints are solved on positions with a compliance α (inverse stiffness) so stiffness is independent of the time step and iteration count. - Xpbd: static double distance(Float32x4List x, Float32List w, int i, int j, double restLength, double compliance, double dt, double lambda) — One XPBD distance-constraint projection between particles i and j (inverse masses w); lambda is the accumulated Lagrange multiplier for this constraint (reset to 0 each step). - abstract final class Inertia — Inertia tensors about the centre of mass (body frame). - Inertia: static Mat3d box(double mass, Vec3 size) - Inertia: static Mat3d solidSphere(double mass, double r) - Inertia: static Mat3d cylinder(double mass, double r, double h) — Solid cylinder along Y. - Inertia: static ({double mass, Vec3 center, Mat3d inertia}) mesh(Float32x4List p, Uint32List idx, double density) — Mass properties of a closed triangle mesh of uniform density via the divergence theorem (Eberly's "Polyhedral Mass Properties", 2003): volume, centre of mass, inertia about the centre of mass. - abstract final class Broadphase — Broadphase: find candidate overlapping pairs of AABBs cheaply before exact narrowphase tests. - Broadphase: static List<(int, int)> sweepAndPrune(Float32x4List mins, Float32x4List maxs) — Sweep and prune on X: sort by min.x, sweep keeping an active list, test Y and Z overlap. - Broadphase: static List<(int, int)> uniformGrid(Float32x4List mins, Float32x4List maxs, double cellSize) — Uniform grid: hash each box into cells of cellSize; boxes sharing a cell are candidates (deduplicated). - extension type const Quat._(Float32x4 v) — A unit quaternion for rotations (lanes x, y, z = vector part, w = scalar part), unboxed like Vec3. - Quat: Quat(double x, double y, double z, double w) - Quat: factory Quat.axisAngle(Vec3 axis, double radians) — Rotation of radians about the unit axis: (axis·sin(θ/2), cos(θ/2)), the half angle's turn made at RatioBoundary (the radians entry point; the rational one is RatioQuat.fromCayley). - Quat: static final identity - Quat: double get x - Quat: double get y - Quat: double get z - Quat: double get w - Quat: Quat get conjugate - Quat: double dot(Quat o) - Quat: Quat normalized() - Quat: Vec3 rotate(Vec3 p) — Rotates p: v' = v + 2w(u×v) + 2u×(u×v), with u the vector part (cheaper than q v q*). - Quat: Quat slerp(Quat to, double t) — Spherical linear interpolation along the shorter arc; falls back to normalised lerp when nearly parallel. - Quat: Quat operator *(Quat o) — Hamilton product: this ∘ o (apply o first, then this). - extension QuatInterpolation on Quat — Extra quaternion interpolation: normalised lerp (cheap, constant direction, non-constant speed) and SQUAD (smooth cubic spline through key rotations, Shoemake 1987). - QuatInterpolation: Quat nlerp(Quat to, double t) — Normalised linear interpolation along the shorter arc. - QuatInterpolation: Quat log() — Quaternion logarithm of a unit quaternion: (axis·θ/2, 0). - QuatInterpolation: Quat exp() — Exponential of a pure quaternion (w ignored). - QuatInterpolation: Quat squad(Quat s1, Quat s2, Quat q2, double t) — SQUAD between q1 (this) and q2 with inner control points s1, s2 from squadControl. - QuatInterpolation: Quat squadControl(Quat prev, Quat next) — The SQUAD inner control point for this key given its neighbours prev and next: s_i = q_i · exp(-(log(q_i⁻¹ q_{i+1}) + log(q_i⁻¹ q_{i-1})) / 4). - final class DualQuat — A unit dual quaternion: rigid transform (rotation + translation) as q_r + ε q_d with q_d = ½ t q_r. - DualQuat: DualQuat(this.real, this.dual) - DualQuat: factory DualQuat.fromRotationTranslation(Quat r, Vec3 t) — Rotation r then translation t. - DualQuat: static DualQuat blend(List dqs, List weights) — Dual-quaternion linear blending (DLB) of transforms with weights, antipodality-corrected, normalised. - DualQuat: final Quat real - DualQuat: final Quat dual - DualQuat: Vec3 get translation - DualQuat: Vec3 transformPoint(Vec3 p) - DualQuat: DualQuat operator *(DualQuat o) — This ∘ o: apply o, then this. - abstract final class LowDiscrepancy — Low-discrepancy sequences: points that fill a domain more evenly than random numbers, so sampling-based estimates (image-based lighting, soft shadows, ambient occlusion, anti-aliasing jitter) converge faster with fewer… - LowDiscrepancy: static double radicalInverse(int i, int base) — The radical inverse of i in base: mirror its digits about the decimal point (base 2: 1→0.5, 2→0.25, 3→0.75). - LowDiscrepancy: static double vanDerCorput(int i) — Base-2 radical inverse by bit reversal (van der Corput), exact for 32-bit indices. - LowDiscrepancy: static Vec2 hammersley(int i, int n) — The ith of n Hammersley points in [0,1)²: (i/n, radical inverse base 2). - LowDiscrepancy: static Vec2 halton(int i) — The ith Halton point in [0,1)² (bases 2 and 3); unlike Hammersley, needs no total count. - LowDiscrepancy: static Vec2 r2(int i) — The ith point of Roberts' R2 sequence, based on the plastic number (the real root of x³ = x + 1). - LowDiscrepancy: static Vec3 uniformSphere(Vec2 u) — Maps a point in [0,1)² to a uniformly distributed unit direction on the sphere. - LowDiscrepancy: static Vec3 importanceSampleGgx(Vec2 u, double roughness) — GGX importance sampling of a half vector around +Z for roughness (alpha = roughness²): the distribution used to prefilter environment maps for the split-sum approximation (Karis 2013). - abstract final class Sobol2 — 2D Sobol sequence (first two dimensions, Joe–Kuo direction numbers; dimension 1 is van der Corput), and blue-noise point sets by Bridson's Poisson-disk sampling (no two points closer than r, so samples look even… - Sobol2: static Vec2 at(int i) — The ith point (i ≥ 0) in [0,1)². - abstract final class Sh9 — Real spherical harmonics up to band 2 (9 coefficients), the standard basis for diffuse lighting (Ramamoorthi and Hanrahan 2001, "An Efficient Representation for Irradiance Environment Maps"). - Sh9: static const c0 = 0.282095 — Constant factors of the 9 basis functions Y_00 … Y_22. - Sh9: static const c1 = 0.488603 - Sh9: static const c2 = 1.092548 - Sh9: static const c3 = 0.315392 - Sh9: static const c4 = 0.546274 - Sh9: static const a0 = math.pi — Band convolution weights Â_l for a clamped cosine lobe. - Sh9: static const a1 = 2 * math.pi / 3 - Sh9: static const a2 = math.pi / 4 - Sh9: static void basis(Vec3 d, Float32List out) — The 9 basis values for the unit direction d, written into out (length ≥ 9). - final class ShRgb — Spherical-harmonics radiance for RGB: 9 coefficients per channel (27 floats), accumulated from samples. - ShRgb: ShRgb() - ShRgb: final Float32List coeffs - ShRgb: void addSample(Vec3 d, Vec3 rgb, double weight) — Adds radiance rgb arriving from unit direction d with Monte Carlo weight weight (e.g. 4π/N for N uniform sphere samples). - ShRgb: Vec3 irradiance(Vec3 n) — Irradiance E(n) for unit normal n; divide by π for Lambertian outgoing radiance. - abstract final class Brdf — Physically based shading terms (Cook–Torrance microfacet model as used by UE4, Karis 2013, and Filament). - Brdf: static double ggxD(double nDotH, double roughness) — GGX / Trowbridge–Reitz normal distribution D(h) with alpha = roughness²: α² / (π ((n·h)²(α²−1)+1)²). - Brdf: static double smithGgxCorrelatedV(double nDotV, double nDotL, double roughness) — Height-correlated Smith visibility V = G / (4 (n·l)(n·v)) for GGX (Heitz 2014; Lagarde 2014 form). - Brdf: static double schlickF(double vDotH, double f0) — Schlick's Fresnel: F0 + (1 − F0)(1 − v·h)⁵. - Brdf: static double burleyDiffuse(double nDotV, double nDotL, double lDotH, double roughness) — Burley's ("Disney") diffuse, normalised so a white surface under uniform light reflects ≈ 1 (Burley 2012). - Brdf: static double specular(Vec3 n, Vec3 v, Vec3 l, double roughness, double f0) — Full specular lobe D·V·F for unit vectors n, v, l. - abstract final class CubeMap — Cube-map direction math (D3D/Vulkan/Metal face order +X, −X, +Y, −Y, +Z, −Z; u right, v down). - CubeMap: static Vec3 direction(int face, double u, double v) — The direction through texel coordinates (u, v) in −1, 1 on face. - CubeMap: static ({int face, double u, double v}) faceUv(Vec3 d) — The face and (u, v) in −1, 1 for direction d (inverse of direction). - CubeMap: static double texelSolidAngle(double u0, double v0, double u1, double v1) — Solid angle subtended by the texel spanning (u0,v0)–(u1,v1) on a face (exact, via the area element atan form). - abstract final class Signal — Audio and signal processing kernels. - Signal: static void fft(Float64List re, Float64List im, {bool inverse = false}) — In-place iterative radix-2 Cooley–Tukey FFT on separate real and imaginary arrays (length a power of two). inverse computes the unnormalised inverse; divide by n afterwards. - Signal: static Float32List resampleLinear(Float32List input, double ratio) — Linear-interpolation resampling of input by ratio = outRate / inRate (cheap; use resampleSinc for audio). - Signal: static Float32List resampleSinc(Float32List input, double ratio, {int taps = 16}) — Windowed-sinc resampling (Hann window, taps per side): band-limited, so downsampling doesn't alias. - final class Biquad — Second-order IIR filter (biquad) with the RBJ "Audio EQ Cookbook" designs, Direct Form I. - Biquad: factory Biquad.lowPass(double sampleRate, double freq, {double q = 0.7071}) - Biquad: factory Biquad.highPass(double sampleRate, double freq, {double q = 0.7071}) - Biquad: factory Biquad.bandPass(double sampleRate, double freq, {double q = 1}) - Biquad: factory Biquad.peaking(double sampleRate, double freq, double gainDb, {double q = 1}) - Biquad: final double b0 - Biquad: final double b1 - Biquad: final double b2 - Biquad: final double a1 - Biquad: final double a2 - Biquad: double process(double x) - Biquad: double magnitudeAt(double sampleRate, double freq) — Magnitude response |H(e^{jω})| at freq. - extension Mat4Projections on Mat4 — Projections and camera helpers beyond Mat4's basics. - Mat4Projections: void setOrthographic(double l, double r, double b, double t, double near, double far) — Orthographic projection of the box l, r × b, t × -near, -far to clip space. - Mat4Projections: void setPerspectiveReversedZ(double fovY, double aspect, double near, double far) — Reversed-Z perspective: near maps to depth 1 and far to 0. - Mat4Projections: void setPerspectiveInfiniteReversedZ(double fovY, double aspect, double near) — Reversed-Z perspective with the far plane at infinity: depth = near / (-z_view). - Mat4Projections: bool normalMatrixInto(Mat3 out) — The normal matrix: inverse-transpose of the upper 3×3, so normals stay perpendicular to surfaces under non-uniform scale. - extension type const Plane._(Float32x4 v) — A plane n·p + d = 0 with unit normal n (lanes x, y, z = n, w = d). - Plane: Plane.fromNormalDistance(Vec3 n, double d) - Plane: factory Plane.fromPointNormal(Vec3 p, Vec3 n) - Plane: Vec3 get normal - Plane: double get d - Plane: double signedDistance(Vec3 p) - Plane: Plane normalized() - final class Frustum — The 6 frustum planes of a view-projection matrix, pointing inward (Gribb and Hartmann 2001), for depth in 0, 1. - Frustum: Frustum.fromViewProjection(Mat4 m) - Frustum: final List planes - Frustum: bool containsPoint(Vec3 p) - Frustum: bool intersectsSphere(Vec3 center, double radius) — Conservative sphere test: false only when the sphere is entirely outside one plane. - Frustum: bool intersectsAabb(Vec3 min, Vec3 max) — Conservative AABB test using each plane's "positive vertex". - extension type const Vec2._(Float32x4 v) — A 2D vector (lanes x, y). - Vec2: Vec2(double x, double y) - Vec2: static final zero - Vec2: double get x - Vec2: double get y - Vec2: double get length2 - Vec2: double get length - Vec2: Vec2 scale(double s) - Vec2: Vec2 mul(Vec2 o) - Vec2: double dot(Vec2 o) - Vec2: double cross(Vec2 o) — The z of the 3D cross product: positive when o is counter-clockwise from this. - Vec2: Vec2 normalized() - Vec2: Vec2 lerp(Vec2 to, double t) - Vec2: Vec2 operator +(Vec2 o) - Vec2: Vec2 operator -(Vec2 o) - Vec2: Vec2 operator -() - extension type const Vec3._(Float32x4 v) — A 3D vector (lanes x, y, z; w is 0). - Vec3: Vec3(double x, double y, double z) - Vec3: Vec3.fromSimd(Float32x4 v) — Wraps a SIMD value read from storage (e.g. a Float32x4List); its w lane is cleared. - Vec3: static final zero - Vec3: static final unitX - Vec3: static final unitY - Vec3: static final unitZ - Vec3: double get x - Vec3: double get y - Vec3: double get z - Vec3: double get length2 - Vec3: double get length - Vec3: Vec3 scale(double s) - Vec3: Vec3 mul(Vec3 o) - Vec3: Vec3 min(Vec3 o) - Vec3: Vec3 max(Vec3 o) - Vec3: double dot(Vec3 o) - Vec3: Vec3 cross(Vec3 o) — Cross product via two shuffles: (a.yzx * b.zxy) - (a.zxy * b.yzx). - Vec3: Vec3 normalized() - Vec3: Vec3 lerp(Vec3 to, double t) - Vec3: Vec3 reflect(Vec3 n) — Reflects this direction about the unit normal n: d - 2(d·n)n. - Vec3: Vec4 toVec4(double w) - Vec3: Vec3 operator +(Vec3 o) - Vec3: Vec3 operator -(Vec3 o) - Vec3: Vec3 operator -() - extension type const Vec4._(Float32x4 v) — A 4D vector or homogeneous point. - Vec4: Vec4(double x, double y, double z, double w) - Vec4: const Vec4.fromSimd(this.v) — Wraps a SIMD value read from storage or produced by a matrix. - Vec4: static final zero - Vec4: double get x - Vec4: double get y - Vec4: double get z - Vec4: double get w - Vec4: double get length - Vec4: Vec3 get xyzOverW — Perspective divide: x/w, y/w, z/w. - Vec4: Vec3 get xyz - Vec4: Vec4 scale(double s) - Vec4: Vec4 mul(Vec4 o) - Vec4: double dot(Vec4 o) - Vec4: Vec4 lerp(Vec4 to, double t) - Vec4: Vec4 operator +(Vec4 o) - Vec4: Vec4 operator -(Vec4 o) - Vec4: Vec4 operator -() - final class Vec3d — A 3D vector in double precision for simulation state (rigid bodies, orbits, soft bodies), where float32's 7 digits lose momentum and energy over long runs. - Vec3d: const Vec3d(this.x, this.y, this.z) - Vec3d: factory Vec3d.read(Float64List a, int i) — Reads element i of an interleaved xyz array. - Vec3d: factory Vec3d.fromVec3(Vec3 v) - Vec3d: static const zero = Vec3d(0, 0, 0) - Vec3d: static const unitX = Vec3d(1, 0, 0) - Vec3d: static const unitY = Vec3d(0, 1, 0) - Vec3d: static const unitZ = Vec3d(0, 0, 1) - Vec3d: final double x - Vec3d: final double y - Vec3d: final double z - Vec3d: double get length2 - Vec3d: double get length - Vec3d: int get hashCode - Vec3d: Vec3d mul(Vec3d o) - Vec3d: double dot(Vec3d o) - Vec3d: Vec3d cross(Vec3d o) - Vec3d: Vec3d normalized() - Vec3d: Vec3d min(Vec3d o) - Vec3d: Vec3d max(Vec3d o) - Vec3d: Vec3d abs() - Vec3d: void write(Float64List a, int i) — Writes this vector as element i of an interleaved xyz array. - Vec3d: Vec3 toVec3() - Vec3d: (Vec3d, Vec3d) basis() — Two unit vectors that complete this unit vector to an orthonormal basis (Duff et al. 2017, branchless). - Vec3d: String toString() - Vec3d: Vec3d operator +(Vec3d o) - Vec3d: Vec3d operator -(Vec3d o) - Vec3d: Vec3d operator -() - Vec3d: Vec3d operator *(double s) - Vec3d: Vec3d operator /(double s) - Vec3d: double operator [](int i) - Vec3d: bool operator ==(Object other) - final class Quatd — A unit quaternion in double precision (x, y, z vector part, w scalar part), for rigid-body orientation. - Quatd: const Quatd(this.x, this.y, this.z, this.w) - Quatd: factory Quatd.axisAngle(Vec3d axis, double radians) - Quatd: factory Quatd.fromQuat(Quat q) - Quatd: static const identity = Quatd(0, 0, 0, 1) - Quatd: final double x - Quatd: final double y - Quatd: final double z - Quatd: final double w - Quatd: Quatd get conjugate - Quatd: double dot(Quatd o) - Quatd: Quatd normalized() - Quatd: Vec3d rotate(Vec3d p) — Rotates p: p + 2w(u×p) + 2u×(u×p). - Quatd: Vec3d unrotate(Vec3d p) — Rotates p by the inverse rotation. - Quatd: Quatd integrate(Vec3d omega, double dt) — Integrates angular velocity omega (world frame, rad/s) over dt: q + ½ dt (ω, 0) ∘ q, renormalised. - Quatd: Quatd integrateExact(Vec3d omega, double dt) — Integrates by the exact rotation exp(½ ω dt) (no first-order error; preferred for fast spins). - Quatd: Mat3d toMat3d() — The rotation matrix R (row-major) with R v = rotate(v). - Quatd: Quat toQuat() - Quatd: String toString() - Quatd: Quatd operator *(Quatd o) — Hamilton product: this ∘ o (apply o first). - extension Mat3dVec on Mat3d — Mat3d operations on Vec3d, used for inertia tensors. - Mat3dVec: static Mat3d skew(Vec3d v) — The skew-symmetric cross-product matrix v× (so v× w = v × w). - Mat3dVec: Vec3d mulVec(Vec3d v) - Mat3dVec: Vec3d mulVecT(Vec3d v) — Mᵀ v. - Mat3dVec: Mat3d scaled(double s) - Mat3dVec: Mat3d inverse() — The inverse by the adjugate; a zero matrix when singular (infinite mass in that direction). - Mat3dVec: Mat3d rotatedBy(Mat3d r) — R M Rᵀ: a body-frame tensor in world frame. - Mat3dVec: Mat3d operator +(Mat3d o) - abstract interface class RatioBackend — One number system for ratio geometry: the same operations (quadrance, spread, cross, twist, solid and dihedral spreads, Gram determinants, reflections, Cayley rotations) in a fixed metric, over scalars S and vectors V. - RatioBackend: String get name - RatioBackend: int get dimension - RatioBackend: bool get exact — True when equality is exact (no tolerance). - RatioBackend: S fromInt(int n) - RatioBackend: S add(S a, S b) - RatioBackend: S sub(S a, S b) - RatioBackend: S mul(S a, S b) - RatioBackend: S div(S a, S b) - RatioBackend: bool isZero(S a, S scale) — Whether a is zero: exactly for exact backends, within the backend's rounding relative to scale otherwise. - RatioBackend: double? toDouble(S a) — A double for comparing across backends; null where there is none (finite fields). - RatioBackend: V vector(List coords) - RatioBackend: V vadd(V a, V b) - RatioBackend: V vsub(V a, V b) - RatioBackend: V vscale(S k, V v) - RatioBackend: bool same(V a, V b, S scale) — Whether a and b are equal: exactly for exact backends; for floats within the backend's rounding of an intermediate of coordinate size √scale (pass the largest Euclidean quadrance size involved, since an ill-conditioned… - RatioBackend: S size(V v) — The Euclidean quadrance of the coordinates (x² + y² + …), whatever the metric: the size used for error scales. - RatioBackend: S dot(V a, V b) — B(a, b) in the backend's metric. - RatioBackend: S quadrance(V a) - RatioBackend: S spread(V a, V b) - RatioBackend: S cross(V a, V b) - RatioBackend: S twist(V a, V b) - RatioBackend: S solidSpread(V a, V b, V c) — The solid spread det G(a, b, c)/(Q(a)Q(b)Q(c)) (three dimensions). - RatioBackend: S dihedralSpread(V common, V a, V b) — The dihedral spread between span(common, a) and span(common, b) (three dimensions). - RatioBackend: S gramDeterminant(List vs) — Det of the Gram matrix B(vᵢ, vⱼ). - RatioBackend: V reflect(V v, V normal) — The reflection of v in the hyperplane B-perpendicular to normal. - RatioBackend: V perpendicular(List vs) — A vector B-perpendicular to the dimension − 1 vectors vs (2-D: one vector; 3-D: the B-vector product). - RatioBackend: V rotate(List cayley, V v) — v under the Cayley rotation (B − K)⁻¹(B + K) of the metric: cayley is t in two dimensions, the Gibbs vector g (K = gₓ) in three. - final class FloatRatio2 implements RatioBackend — F64 or f32 ratio geometry in a planar Metric2, on the float core. f32 stores every vector and result in single precision (what a GPU buffer holds); arithmetic is done in double and rounded once per result. - FloatRatio2: FloatRatio2(this.metric, {this.single = false}) - FloatRatio2: final Metric2 metric - FloatRatio2: final bool single - FloatRatio2: String get name - FloatRatio2: int get dimension - FloatRatio2: bool get exact - FloatRatio2: double fromInt(int n) - FloatRatio2: double add(double a, double b) - FloatRatio2: double sub(double a, double b) - FloatRatio2: double mul(double a, double b) - FloatRatio2: double div(double a, double b) - FloatRatio2: bool isZero(double a, double scale) - FloatRatio2: double? toDouble(double a) - FloatRatio2: Float64List vector(List c) - FloatRatio2: Float64List vadd(Float64List a, Float64List b) - FloatRatio2: Float64List vsub(Float64List a, Float64List b) - FloatRatio2: Float64List vscale(double k, Float64List v) - FloatRatio2: bool same(Float64List a, Float64List b, double scale) - FloatRatio2: double size(Float64List v) - FloatRatio2: double dot(Float64List a, Float64List b) - FloatRatio2: double quadrance(Float64List a) - FloatRatio2: double spread(Float64List a, Float64List b) - FloatRatio2: double cross(Float64List a, Float64List b) - FloatRatio2: double twist(Float64List a, Float64List b) - FloatRatio2: double solidSpread(Float64List a, Float64List b, Float64List c) - FloatRatio2: double dihedralSpread(Float64List common, Float64List a, Float64List b) - FloatRatio2: double gramDeterminant(List vs) - FloatRatio2: Float64List reflect(Float64List v, Float64List n) - FloatRatio2: Float64List perpendicular(List vs) - FloatRatio2: Float64List rotate(List cayley, Float64List v) - final class FloatRatio3 implements RatioBackend — F64 or f32 ratio geometry in a three-dimensional Metric3, on the float core. - FloatRatio3: FloatRatio3(this.metric, {this.single = false}) - FloatRatio3: final Metric3 metric - FloatRatio3: final bool single - FloatRatio3: String get name - FloatRatio3: int get dimension - FloatRatio3: bool get exact - FloatRatio3: double fromInt(int n) - FloatRatio3: double add(double a, double b) - FloatRatio3: double sub(double a, double b) - FloatRatio3: double mul(double a, double b) - FloatRatio3: double div(double a, double b) - FloatRatio3: bool isZero(double a, double scale) - FloatRatio3: double? toDouble(double a) - FloatRatio3: Float64List vector(List c) - FloatRatio3: Float64List vadd(Float64List a, Float64List b) - FloatRatio3: Float64List vsub(Float64List a, Float64List b) - FloatRatio3: Float64List vscale(double k, Float64List v) - FloatRatio3: bool same(Float64List a, Float64List b, double scale) - FloatRatio3: double size(Float64List v) - FloatRatio3: double dot(Float64List a, Float64List b) - FloatRatio3: double quadrance(Float64List a) - FloatRatio3: double spread(Float64List a, Float64List b) - FloatRatio3: double cross(Float64List a, Float64List b) - FloatRatio3: double twist(Float64List a, Float64List b) - FloatRatio3: double solidSpread(Float64List a, Float64List b, Float64List c) - FloatRatio3: double dihedralSpread(Float64List c, Float64List a, Float64List b) - FloatRatio3: double gramDeterminant(List vs) - FloatRatio3: Float64List reflect(Float64List v, Float64List n) - FloatRatio3: Float64List perpendicular(List vs) - FloatRatio3: Float64List rotate(List g, Float64List v) - final class Frac — An exact rational held as two int64s, reduced. - Frac: factory Frac(int numerator, [int denominator = 1]) - Frac: static const zero = Frac._(0, 1) - Frac: static const one = Frac._(1, 1) - Frac: final int numerator - Frac: final int denominator - Frac: bool get isZero - Frac: int get hashCode - Frac: double toDouble() - Frac: String toString() - Frac: Frac operator +(Frac o) - Frac: Frac operator -(Frac o) - Frac: Frac operator *(Frac o) - Frac: Frac operator /(Frac o) - Frac: Frac operator -() - Frac: bool operator ==(Object other) - final class RatioOverflow extends StateError — An exact int64 result left the 62-bit range. - RatioOverflow: RatioOverflow(String what) - final class Int64Ratio implements RatioBackend> — Exact ratio geometry in int64 rationals (Frac) in any integer metric of dimension 2 or 3. - Int64Ratio: Int64Ratio(List metric) — metric is the symmetric matrix, row-major (4 or 9 entries). - Int64Ratio: final int dimension - Int64Ratio: String get name - Int64Ratio: bool get exact - Int64Ratio: Frac fromInt(int n) - Int64Ratio: Frac add(Frac a, Frac b) - Int64Ratio: Frac sub(Frac a, Frac b) - Int64Ratio: Frac mul(Frac a, Frac b) - Int64Ratio: Frac div(Frac a, Frac b) - Int64Ratio: bool isZero(Frac a, Frac scale) - Int64Ratio: double? toDouble(Frac a) - Int64Ratio: List vector(List c) - Int64Ratio: List vadd(List a, List b) - Int64Ratio: List vsub(List a, List b) - Int64Ratio: List vscale(Frac k, List v) - Int64Ratio: Frac size(List v) - Int64Ratio: bool same(List a, List b, Frac scale) - Int64Ratio: Frac dot(List a, List b) - Int64Ratio: Frac quadrance(List a) - Int64Ratio: Frac spread(List a, List b) - Int64Ratio: Frac cross(List a, List b) - Int64Ratio: Frac twist(List a, List b) - Int64Ratio: Frac solidSpread(List a, List b, List c) - Int64Ratio: Frac dihedralSpread(List c, List a, List b) - Int64Ratio: Frac gramDeterminant(List> vs) - Int64Ratio: List reflect(List v, List n) - Int64Ratio: List perpendicular(List> vs) - Int64Ratio: List rotate(List k, List v) - abstract interface class RatioBatch — Ratio geometry over arrays of single-precision vectors: the batched backend. - RatioBatch: String get name - RatioBatch: void spreadCross2(Float32List pairs, Float32List out) - RatioBatch: void spreadCross3(Float32List pairs, Float32List out) - RatioBatch: void solidSpreads3(Float32List triples, Float32List out) - RatioBatch: void dihedralSpreads3(Float32List triples, Float32List out) - RatioBatch: void cayleyRotate3(Float32List gv, Float32List out) - RatioBatch: void exactSpreads2(Int32List pairs, Int64List out) - final class CpuRatioBatch implements RatioBatch — RatioBatch on the CPU: each item through the float core (RatioF) in double, stored as float. - CpuRatioBatch: const CpuRatioBatch() - CpuRatioBatch: String get name - CpuRatioBatch: void spreadCross2(Float32List p, Float32List out) - CpuRatioBatch: void spreadCross3(Float32List p, Float32List out) - CpuRatioBatch: void solidSpreads3(Float32List p, Float32List out) - CpuRatioBatch: void dihedralSpreads3(Float32List p, Float32List out) - CpuRatioBatch: void cayleyRotate3(Float32List p, Float32List out) - CpuRatioBatch: void exactSpreads2(Int32List p, Int64List out) - abstract final class RatioBoundary — The named adapters between ratio geometry and radians: the only place in the ratio layer that calls trigonometry. - RatioBoundary: static double cayleyFromRadians(double radians) — The Cayley parameter tan(θ/2) of an angle in radians. - RatioBoundary: static double radiansFromCayley(double t) — The angle in radians, in (−π, π), of a Cayley parameter (2·atan t; infinity gives π). - RatioBoundary: static double radiansFromSpread(double spread) — The acute angle in 0, π/2 with spread spread (sin²θ = s), as atan2(√s, √(1 − s)): accurate near 0 and near π/2, where asin(√s) and acos(√(1 − s)) lose digits. - RatioBoundary: static double spreadFromRadians(double radians) — Sin²θ. - RatioBoundary: static Turn turnFromRadians(double radians) — The turn by an angle in radians (cos θ, sin θ). - RatioBoundary: static double radiansFromTurn(Turn t) — The angle of a turn in (−π, π]. - RatioBoundary: static double radiansFromDirection(double x, double y) — The angle in (−π, π] of the direction (x, y) from the x axis, for APIs that report a heading in radians. - RatioBoundary: static Turn turnFromDegrees(double degrees) — The turn by an angle in degrees (maps, SVG, settings, a person's input). - RatioBoundary: static Turn turnFromFraction(double fraction) — The turn by fraction of a whole turn (1/n for the step of a regular n-gon). - RatioBoundary: static Quat quatFromAxisRadians(Vec3 axis, double radians) — The rotation by radians about the unit axis (the platform form of Quat.axisAngle, kept here so call sites that receive radians name the boundary). - RatioBoundary: static double radiansFromDegrees(double degrees) — Degrees to radians and back, for formats that store degrees (maps, SVG, settings). - RatioBoundary: static double degreesFromRadians(double radians) - final class Metric2 — A planar metric: the symmetric matrix B = [a, b, b, c] with B(u, v) = uᵀBv (Wildberger, "Affine and projective universal geometry", arXiv:math/0612499). - Metric2: const Metric2(this.a, this.b, this.c) - Metric2: static const blue = Metric2(1, 0, 1) — X² + y². - Metric2: static const red = Metric2(1, 0, -1) — X² − y². - Metric2: static const green = Metric2(0, 1, 0) — 2xy. - Metric2: final double a - Metric2: final double b - Metric2: final double c - Metric2: double get determinant - Metric2: bool get isBlue - Metric2: double dot(double ux, double uy, double vx, double vy) — B(u, v). - Metric2: double quadrance(double x, double y) — Q(v) = B(v, v). - Metric2: double spread(double ux, double uy, double vx, double vy) — s(u, v) = det B·(u ∧ v)²/(Q(u)Q(v)) (Goh–Wildberger, arXiv:0911.1025, p. 7): no 1 − cross cancellation. - Metric2: double cross(double ux, double uy, double vx, double vy) — c(u, v) = B(u, v)²/(Q(u)Q(v)). - Metric2: (double, double) perpendicular(double x, double y) — A vector B-perpendicular to v: J·Bv with J the quarter turn, so B(v, perp) = 0 in every metric. - Metric2: Float64List cayley(double t) — The Cayley rotation R = (B − K)⁻¹(B + K), K = t·[0, 1, −1, 0]: an isometry of this metric (RᵀBR = B) with det R = 1, rational in t (the blue case is the rational parametrisation of the circle). - final class Metric3 — A metric on three-dimensional space: the symmetric matrix B with entries xx, yy, zz, xy, xz, yz. - Metric3: const Metric3(this.xx, this.yy, this.zz, [this.xy = 0, this.xz = 0, this.yz = 0]) - Metric3: static const euclidean = Metric3(1, 1, 1) - Metric3: static const minkowski = Metric3(1, 1, -1) — diag(1, 1, −1): 2+1 Minkowski space (Wildberger's red metric in three dimensions). - Metric3: final double xx - Metric3: final double yy - Metric3: final double zz - Metric3: final double xy - Metric3: final double xz - Metric3: final double yz - Metric3: bool get isEuclidean - Metric3: double get determinant - Metric3: double dot(double ux, double uy, double uz, double vx, double vy, double vz) — B(u, v). - Metric3: double quadrance(double x, double y, double z) — Q(v). - Metric3: double adjQuadrance(double x, double y, double z) — Wᵀ adj(B) w. - Metric3: double spread(double ux, double uy, double uz, double vx, double vy, double vz) — s(u, v) = (u × v)ᵀ adj(B) (u × v)/(Q(u)Q(v)): Lagrange's identity for a general metric (Notowidigdo–Wildberger, arXiv:1909.08814, Theorem 8, written with adj B), so no 1 − cross cancellation. - Metric3: double cross(double ux, double uy, double uz, double vx, double vy, double vz) — c(u, v) = B(u, v)²/(Q(u)Q(v)). - Metric3: (double, double, double) vectorProduct(double ux, double uy, double uz, double vx, double vy, double vz) — The B-vector product adj(B)(u × v): B-perpendicular to u and v (Notowidigdo–Wildberger, arXiv:1903.08330). - Metric3: Float64List cayley(double gx, double gy, double gz) — The Cayley rotation R = (B − K)⁻¹(B + K) with K = gₓ (the skew matrix of g): an isometry of this metric with det R = 1, rational in g; for the Euclidean metric it is Euler–Rodrigues with Gibbs vector g. - abstract final class RatioMsl — The batched ratio kernels in Metal Shading Language: the GPU backend of RatioBatch, item for item the same formulas and layouts as CpuRatioBatch. - RatioMsl: static const kernels — Kernel names, in the order of RatioBatch's methods. - RatioMsl: static const source - abstract final class RatioF — Rational Trigonometry on doubles. - RatioF: static double quadrance2(double x, double y) — Q(x, y) = x² + y². - RatioF: static double wedge2(double ax, double ay, double bx, double by) — The wedge u ∧ v = uₓv_y − u_yvₓ (twice the signed area). - RatioF: static double spread2(double ax, double ay, double bx, double by) — s(u, v) = (u ∧ v)²/(Q(u)Q(v)). - RatioF: static double cross2(double ax, double ay, double bx, double by) — c(u, v) = (u·v)²/(Q(u)Q(v)). - RatioF: static double wedge2Accurate(double ax, double ay, double bx, double by) — The wedge as if computed in twice the precision (Ogita–Rump–Oishi Dot2 with Dekker's exact products; Raya has no FMA, so Veltkamp splitting stands in for Kahan's FMA form): correct to about one ulp even for nearly… - RatioF: static double spread2Accurate(double ax, double ay, double bx, double by) — spread2 from wedge2Accurate: about one ulp at every angle. - RatioF: static double spread3Accurate(double ax, double ay, double az, double bx, double by, double bz) — spread3 with each component of u × v from wedge2Accurate. - RatioF: static double twist2(double ax, double ay, double bx, double by) — t(u, v) = (u ∧ v)²/(u·v)². - RatioF: static double quadrance3(double x, double y, double z) — Q(x, y, z) = x² + y² + z². - RatioF: static double spread3(double ax, double ay, double az, double bx, double by, double bz) — s(u, v) = Q(u × v)/(Q(u)Q(v)) (Lagrange's identity; no cancellation for nearly parallel vectors). - RatioF: static double cross3(double ax, double ay, double az, double bx, double by, double bz) — c(u, v) = (u·v)²/(Q(u)Q(v)). - RatioF: static double twist3(double ax, double ay, double az, double bx, double by, double bz) — t(u, v) = Q(u × v)/(u·v)². - RatioF: static double det3(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz) — Deta b c (the triple product a·(b × c)). - RatioF: static double solidSpread3(double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz) — The solid spread deta b c²/(Q(a)Q(b)Q(c)) (Notowidigdo–Wildberger): 0 for coplanar vectors, 1 for mutually perpendicular ones; the rational analogue of the solid angle at a corner. - RatioF: static double dihedralSpread3(double cx, double cy, double cz, double ax, double ay, double az, double bx, double by, double bz) — The dihedral spread between the planes span(c, a) and span(c, b), which meet along c: Q(c)·detc a b²/(Q(c × a)·Q(c × b)) (Notowidigdo–Wildberger, Theorem 12). 0 for one plane, 1 for perpendicular planes. - RatioF: static double linePlaneSpread3(double vx, double vy, double vz, double ax, double ay, double az, double bx, double by, double bz) — The spread between the line through v and the plane span(a, b): (v·(a × b))²/(Q(v)·Q(a × b)). - RatioF: static double reflectFactor(double xDotN, double nQuadrance) — The factor k of a reflection x ↦ x − k·n in the line or plane B-perpendicular to n: k = 2B(x, n)/Q(n). - RatioF: static double cayleyCos(double t) — The planar Cayley rotation with parameter t (classically t = tan(θ/2)): cos = (1 − t²)/(1 + t²). - RatioF: static double cayleySin(double t) — Sin = 2t/(1 + t²). - RatioF: static double cayleyFactor3(double gx, double gy, double gz) — The factor 2/(1 + g·g) of the 3-D Cayley rotation with Gibbs vector g (g = tan(θ/2)·axis): R v = v + k·(g × v + g × (g × v)), rational in g (Euler–Rodrigues). - RatioF: static double twistParameter(double x, double y, double z, double w, double ax, double ay, double az) — The Cayley parameter of the twist of a unit quaternion (x, y, z, w) about the unit axis a (swing–twist decomposition): t = (v·a)/w, the tangent of half the twist angle, read off the quaternion with one division.… - extension type const Turn._raw(Float64x2 v) — A planar rotation (blue metric) held as its unit vector (c, s) = (cos θ, sin θ), never as θ. - Turn: Turn.unit(double c, double s) — The turn with unit vector (c, s); the caller guarantees c² + s² = 1 (use Turn.direction otherwise). - Turn: factory Turn.cayley(double t) — The rotation with Cayley parameter t (classically tan(θ/2)): ((1 − t²), 2t)/(1 + t²). - Turn: factory Turn.direction(double x, double y) — The turn taking the x axis to the direction (x, y) (one square root). - Turn: factory Turn.between(double ax, double ay, double bx, double by) — The turn taking the direction of a to the direction of b: (a·b, a ∧ b)/√(Q(a)Q(b)). - Turn: factory Turn.phase(double turns) — The rational circle point at turns whole turns: periodic with period 1, exactly on the unit circle, exact at every quarter turn, with continuous velocity (C¹), and no trigonometry. - Turn: factory Turn.random(math.Random random) — A direction drawn uniformly from the circle with random: a point drawn uniformly from the unit disk (rejection from the square, π/4 accepted) and scaled to unit length. - Turn: static final identity - Turn: static final half — The half turn (−1, 0). - Turn: static double gaussian(math.Random random) — A standard normal sample (mean 0, variance 1) by Marsaglia's polar method: the uniform disk point of Turn.random scaled by √(−2 ln q / q). - Turn: double get c - Turn: double get s - Turn: Turn get inverse - Turn: double get spread — The spread between a direction and its image, s² (sin²θ). - Turn: double get cross — The cross c² (cos²θ). - Turn: double get cayleyParameter — The Cayley parameter s/(1 + c) (tan(θ/2)); infinite for the half turn. - Turn: Turn get halved — The turn by half this turn's angle (the angle taken in (−π, π], so the half lies in (−π/2, π/2]): the direction of (1 + c, s), or of (s, 1 − c) when c < 0, where that sum would cancel. - Turn: Turn power(int n) — This turn applied n times (n ≥ 0) by repeated squaring: the multiple-angle formulas without angles. - Turn: (double, double) apply(double x, double y) — (x, y) turned. - Turn: Vec2 rotate(Vec2 p) — p turned. - Turn: Turn fraction(double t) — This turn's angle (taken in (−π, π]) times t, for any real t: the whole part of t is a power, the fraction is composed from successive halved turns, one per binary digit of the fraction (at most 53). - Turn: Turn renormalized() — Restores c² + s² = 1 after a long chain of products (one square root). - Turn: Turn operator *(Turn o) — This after o (complex multiplication). - extension RatioVec2 on Vec2 — Ratio geometry on Vec2 (blue metric). - RatioVec2: double get quadrance - RatioVec2: double spreadWith(Vec2 o) - RatioVec2: double crossWith(Vec2 o) - RatioVec2: double twistWith(Vec2 o) - RatioVec2: Vec2 reflectIn(Vec2 n) — The reflection in the line through the origin perpendicular to n. - extension RatioVec3 on Vec3 — Ratio geometry on Vec3 (Euclidean metric). - RatioVec3: double get quadrance - RatioVec3: double spreadWith(Vec3 o) - RatioVec3: double crossWith(Vec3 o) - RatioVec3: double twistWith(Vec3 o) - RatioVec3: double solidSpreadWith(Vec3 b, Vec3 c) — The solid spread of this, b and c. - RatioVec3: double dihedralSpreadAlong(Vec3 a, Vec3 b) — The dihedral spread between the planes span(this, a) and span(this, b), which meet along this. - RatioVec3: Vec3 reflectIn(Vec3 n) — The reflection in the plane through the origin perpendicular to n. - extension RatioVec3d on Vec3d — Ratio geometry on Vec3d (Euclidean metric, double storage), the twin of RatioVec3 for simulation state. - RatioVec3d: double get quadrance - RatioVec3d: double spreadWith(Vec3d o) - RatioVec3d: double crossWith(Vec3d o) - RatioVec3d: double twistWith(Vec3d o) - RatioVec3d: double solidSpreadWith(Vec3d b, Vec3d c) - RatioVec3d: double dihedralSpreadAlong(Vec3d a, Vec3d b) - RatioVec3d: Vec3d reflectIn(Vec3d n) - abstract final class RatioQuat — Rotations without angles, as Quats: from a Gibbs (Cayley) vector, between two directions (two reflections), and the twist about an axis (swing–twist). - RatioQuat: static Quat fromCayley(Vec3 g) — The rotation with Gibbs vector g = tan(θ/2)·axis: (g, 1)/√(1 + g·g). - RatioQuat: static Vec3 cayleyRotate(Vec3 g, Vec3 v) — v rotated by the Cayley rotation with Gibbs vector g, rationally: v + k(g × v + g × (g × v)), k = 2/(1 + g·g). - RatioQuat: static Vec3 composeCayley(Vec3 g1, Vec3 g2) — The Gibbs vector of the rotation g₁ after g₂ (g₂ applied first): (g₁ + g₂ + g₁ × g₂)/(1 − g₁·g₂). - RatioQuat: static Quat between(Vec3 a, Vec3 b) — The shortest rotation taking the direction of a to the direction of b: the composition of the reflections in a⊥ and (a + b)⊥ (Cartan–Dieudonné), as the quaternion (a × b, √(Q(a)Q(b)) + a·b) normalised. - RatioQuat: static Quat twist(Quat q, Vec3 axis) — The twist of q about the unit axis (swing–twist decomposition): (axis·(v·axis), w) normalised. - RatioQuat: static double twistParameter(Quat q, Vec3 axis) — The Cayley parameter of the twist of q about the unit axis: tan(twist/2) = (v·axis)/w. - abstract final class RatioQuatd — The RatioQuat operations on Quatd / Vec3d (double storage) for physics. - RatioQuatd: static Quatd fromCayley(Vec3d g) - RatioQuatd: static Vec3d cayleyRotate(Vec3d g, Vec3d v) - RatioQuatd: static Vec3d composeCayley(Vec3d g1, Vec3d g2) - RatioQuatd: static Quatd between(Vec3d a, Vec3d b) - RatioQuatd: static Quatd twist(Quatd q, Vec3d axis) - RatioQuatd: static double twistParameter(Quatd q, Vec3d axis) - final class RatioLaws — The laws of Rational Trigonometry as checks any RatioBackend must pass: one suite for every number system, so a new backend (a field, a precision, a GPU) is correct when this returns no failures. - RatioLaws: RatioLaws(this.b, {this.seed = 1, this.range = 9}) - RatioLaws: final RatioBackend b - RatioLaws: final int seed - RatioLaws: final int range — Coordinates are drawn from −range, range. - RatioLaws: int skipped — Cases abandoned in the last run because an exact backend overflowed (never a float backend). - RatioLaws: List run({int cases = 200}) — Runs cases random cases of every law; returns the failures (empty when the backend is correct). ### The CPU matrix unit (riptide_matrix) import 'package:riptide_matrix/riptide_matrix.ray'; Matrix multiply on the matrix unit (SME on M4, M5 and A18; a portable path elsewhere) for float32, exact int8 → int32 and int16 → int64. https://riptidecompute.com/raya/docs/matrix - abstract final class Matrix — Matrix multiply entry points. - Matrix: static int get features — What the CPU matrix unit does here: bit 0 f32, bit 1 int8 -> int32, bit 2 int16 -> int64 (0 when the work runs on a portable loop). - Matrix: static bool get nativeAvailable — Whether this VM exports the entry points. - Matrix: static void multiplyF32(Float32List a, Float32List b, Float32List c, {required int m, required int n, required int k, bool bRows = false}) — F32: c = a · op(b); c is m x n. - Matrix: static void multiplyI8(Int8List a, Int8List b, Int32List c, {required int m, required int n, required int k, bool bRows = false}) — Int8 -> int32, exact while k < 2^17. - Matrix: static void multiplyI16(Int16List a, Int16List b, Int64List c, {required int m, required int n, required int k, bool bRows = false}) — Int16 -> int64, exact (k < 2^33). ### SIMD helpers (riptide_simd) import 'package:riptide_simd/riptide_simd.ray'; SIMD helpers over Float32x4, Int32x4 and Float64x2 that compile to single NEON instructions on arm64. https://riptidecompute.com/raya/docs/simd - extension SplitOSFloat32x4Ops on Float32x4 — Float32x4 operations. - SplitOSFloat32x4Ops: Float64x2 get lowToFloat64x2 — Lanes x and y as a Float64x2 (FCVTL). - SplitOSFloat32x4Ops: Float64x2 get highToFloat64x2 — Lanes z and w as a Float64x2 (FCVTL2 on Raya, via a shuffle here). - SplitOSFloat32x4Ops: Float32x4 fma(Float32x4 b, Float32x4 c) — this * b + c per lane. - SplitOSFloat32x4Ops: double sum() — (x + y) + (z + w), each addition rounded to float (FADDP twice). - SplitOSFloat32x4Ops: double dot(Float32x4 b) — The dot product: (this * b).sum. - SplitOSFloat32x4Ops: double minLane() — The smallest lane (FMINV). - SplitOSFloat32x4Ops: double maxLane() — The largest lane (FMAXV). - SplitOSFloat32x4Ops: Float32x4 floor() — double.floorToDouble per lane (FRINTM). - SplitOSFloat32x4Ops: Float32x4 ceil() — double.ceilToDouble per lane (FRINTP). - SplitOSFloat32x4Ops: Float32x4 truncate() — double.truncateToDouble per lane (FRINTZ). - SplitOSFloat32x4Ops: Float32x4 round() — double.roundToDouble per lane, halves away from zero (FRINTA). - SplitOSFloat32x4Ops: Int32x4 toInt32x4Truncated() — Each lane converted to an int32, rounding toward zero; out-of-range lanes saturate and NaN becomes 0 (FCVTZS). - extension SplitOSFloat64x2Ops on Float64x2 — Float64x2 operations. - SplitOSFloat64x2Ops: Float64x2 fma(Float64x2 b, Float64x2 c) — this * b + c per lane. - SplitOSFloat64x2Ops: double sum() — x + y (FADDP). - SplitOSFloat64x2Ops: double dot(Float64x2 b) — x * b.x + y * b.y, products rounded before the sum. - SplitOSFloat64x2Ops: Float64x2 floor() - SplitOSFloat64x2Ops: Float64x2 ceil() - SplitOSFloat64x2Ops: Float64x2 truncate() - SplitOSFloat64x2Ops: Float64x2 round() — Halves away from zero. - SplitOSFloat64x2Ops: Int32x4 equal(Float64x2 b) — Lane masks: Int32x4 lanes x and y hold lane x's result (all ones when true), z and w lane y's. - SplitOSFloat64x2Ops: Int32x4 notEqual(Float64x2 b) - SplitOSFloat64x2Ops: Int32x4 greaterThan(Float64x2 b) - SplitOSFloat64x2Ops: Int32x4 greaterThanOrEqual(Float64x2 b) - SplitOSFloat64x2Ops: Int32x4 lessThan(Float64x2 b) - SplitOSFloat64x2Ops: Int32x4 lessThanOrEqual(Float64x2 b) - extension SplitOSInt32x4Ops on Int32x4 — Int32x4 operations. - SplitOSInt32x4Ops: Float32x4 toFloat32x4Value() — Each lane converted to a float (SCVTF). - SplitOSInt32x4Ops: Int32x4 equal(Int32x4 b) — All ones where lanes are equal (CMEQ). - SplitOSInt32x4Ops: Int32x4 greaterThan(Int32x4 b) — All ones where this lane is greater, signed (CMGT). - SplitOSInt32x4Ops: Int32x4 shiftLeft(int n) — Shift left by n (0-31). - SplitOSInt32x4Ops: Int32x4 shiftRightArithmetic(int n) — Arithmetic shift right by n (0-31). - SplitOSInt32x4Ops: Int32x4 shiftRightLogical(int n) — Logical shift right by n (0-31). - SplitOSInt32x4Ops: Int32x4 sdot(Int32x4 a, Int32x4 b) — Each lane plus the dot product of its 4 signed bytes in a and b (SDOT). - SplitOSInt32x4Ops: Int32x4 udot(Int32x4 a, Int32x4 b) — sdot with unsigned bytes (UDOT). - SplitOSInt32x4Ops: Int32x4 smmla(Int32x4 a, Int32x4 b) — This as a 2 x 2 int32 matrix (x y / z w) plus A·Bᵀ, where a and b are 2 x 8 signed byte matrices (row r = bytes 8r.. 8r + 7): 32 multiply-adds in one SMMLA. - SplitOSInt32x4Ops: Int32x4 ummla(Int32x4 a, Int32x4 b) — smmla with unsigned bytes (UMMLA). - SplitOSInt32x4Ops: Int32x4 usmmla(Int32x4 a, Int32x4 b) — smmla with a unsigned and b signed (USMMLA). - SplitOSInt32x4Ops: Float64x2 selectF64(Float64x2 t, Float64x2 f) — Bitwise select of two Float64x2 by this mask (BSL): bits of t where the mask is set, of f elsewhere. - SplitOSInt32x4Ops: Int32x4 operator *(Int32x4 b) — Lane-wise multiply, wrapping to 32 bits (MUL). - final class Float32x8 — Eight float32 lanes: lo holds lanes 0-3, hi lanes 4-7. - Float32x8: const Float32x8.fromHalves(this.lo, this.hi) - Float32x8: Float32x8(double l0, double l1, double l2, double l3, double l4, double l5, double l6, double l7) - Float32x8: Float32x8.splat(double v) - Float32x8: Float32x8.zero() - Float32x8: factory Float32x8.load(Float32x4List list, int index) — Lanes 8 * index.. 8 * index + 7 of list (two Float32x4 loads). - Float32x8: final Float32x4 lo - Float32x8: final Float32x4 hi - Float32x8: int get hashCode - Float32x8: void store(Float32x4List list, int index) - Float32x8: Float32x8 scale(double s) - Float32x8: Float32x8 min(Float32x8 o) - Float32x8: Float32x8 max(Float32x8 o) - Float32x8: Float32x8 abs() - Float32x8: Float32x8 sqrt() - Float32x8: Float32x8 fma(Float32x8 b, Float32x8 c) — this * b + c, fused on Raya arm64 (see SplitOSFloat32x4Ops.fma). - Float32x8: double sum() — lo.sum + hi.sum, rounded to float. - Float32x8: double dot(Float32x8 o) - Float32x8: Int32x8 lessThan(Float32x8 o) - Float32x8: Int32x8 lessThanOrEqual(Float32x8 o) - Float32x8: Int32x8 greaterThan(Float32x8 o) - Float32x8: Int32x8 greaterThanOrEqual(Float32x8 o) - Float32x8: Int32x8 equal(Float32x8 o) - Float32x8: List toList() - Float32x8: String toString() - Float32x8: Float32x8 operator +(Float32x8 o) - Float32x8: Float32x8 operator -(Float32x8 o) - Float32x8: Float32x8 operator *(Float32x8 o) - Float32x8: Float32x8 operator /(Float32x8 o) - Float32x8: Float32x8 operator -() - Float32x8: double operator [](int i) — Lane i (0-7). - Float32x8: bool operator ==(Object other) - final class Float64x4 — Four float64 lanes: lo holds lanes 0-1, hi lanes 2-3. - Float64x4: const Float64x4.fromHalves(this.lo, this.hi) - Float64x4: Float64x4(double l0, double l1, double l2, double l3) - Float64x4: Float64x4.splat(double v) - Float64x4: Float64x4.zero() - Float64x4: factory Float64x4.load(Float64x2List list, int index) — Lanes 4 * index.. 4 * index + 3 of list. - Float64x4: factory Float64x4.fromFloat32x4(Float32x4 v) — Four floats widened to doubles (FCVTL + FCVTL2 on Raya arm64). - Float64x4: final Float64x2 lo - Float64x4: final Float64x2 hi - Float64x4: int get hashCode - Float64x4: void store(Float64x2List list, int index) - Float64x4: Float64x4 scale(double s) - Float64x4: Float64x4 min(Float64x4 o) - Float64x4: Float64x4 max(Float64x4 o) - Float64x4: Float64x4 abs() - Float64x4: Float64x4 sqrt() - Float64x4: Float64x4 fma(Float64x4 b, Float64x4 c) - Float64x4: double sum() — (l0 + l2) + (l1 + l3). - Float64x4: double dot(Float64x4 o) - Float64x4: Float32x4 toFloat32x4() — The four lanes narrowed to floats. - Float64x4: List toList() - Float64x4: String toString() - Float64x4: Float64x4 operator +(Float64x4 o) - Float64x4: Float64x4 operator -(Float64x4 o) - Float64x4: Float64x4 operator *(Float64x4 o) - Float64x4: Float64x4 operator /(Float64x4 o) - Float64x4: Float64x4 operator -() - Float64x4: bool operator ==(Object other) - final class Int32x8 — Eight int32 lanes or a Float32x8 comparison mask. - Int32x8: const Int32x8.fromHalves(this.lo, this.hi) - Int32x8: final Int32x4 lo - Int32x8: final Int32x4 hi - Int32x8: int get signMask — Bit i set when lane i's sign bit is set. - Int32x8: int get hashCode - Int32x8: Float32x8 select(Float32x8 t, Float32x8 f) — Lanes of t where the mask is set, of f elsewhere (BSL per half). - Int32x8: List toList() - Int32x8: String toString() - Int32x8: Int32x8 operator &(Int32x8 o) - Int32x8: Int32x8 operator |(Int32x8 o) - Int32x8: Int32x8 operator ^(Int32x8 o) - Int32x8: Int32x8 operator +(Int32x8 o) - Int32x8: Int32x8 operator -(Int32x8 o) - Int32x8: Int32x8 operator *(Int32x8 o) - Int32x8: bool operator ==(Object other) ### Arrays of value-class structs (riptide_struct) import 'package:riptide_struct/riptide_struct.ray'; StructList: a fixed-length list of value-class instances stored contiguously, with no per-element objects. https://riptidecompute.com/raya/docs/struct - abstract class StructList - StructList: factory StructList.filled(int length, T fill) — A list of length copies of fill. - StructList: factory StructList.fromBytes(Uint8List bytes) — A list over bytes in C layout (for memory shared with native code, such as Pointer.asTypedList). - StructList: static int sizeOf() — The size of one element in bytes (C layout). - StructList: int get length - StructList: Uint8List? get bytes — The elements' storage, in C layout, when they are stored inline; null when the elements are objects. - StructList: T operator [](int index) - StructList: void operator []=(int index, T value) ### Physics (riptide_physics) import 'package:riptide_physics/riptide_physics.ray'; Rigid bodies with contacts and joints, cloth and soft bodies, SPH and stable fluids, finite elements and heat, orbital mechanics and typed units. https://riptidecompute.com/raya/docs/physics - (Vec3d, Vec3d) lambert(Vec3d r1, Vec3d r2, double tof, {double mu = Bodies.earthMu, bool prograde = true}) — Lambert's problem: the conic from r1 to r2 in time tof (zero revolutions), by Izzo's method ("Revisiting Lambert's problem", Celest. - List<(int, int)> sweepAndPrunePairs(List boxes) — Candidate pairs from sweep and prune (riptide_math's Broadphase.sweepAndPrune) over double boxes. - ContactSet? collide(Collider a, Vec3d pa, Quatd qa, Collider b, Vec3d pb, Quatd qb, {double margin = 0}) — Collides shape a at pose (pa, qa) with b at (pb, qb). - (Vec3d, Vec3d) closestSegmentSegment(Vec3d p1, Vec3d q1, Vec3d p2, Vec3d q2) — Closest points between segments p1–q1 and p2–q2 (Ericson, Real-Time Collision Detection 5.1.9). - ContactSet? boxBox(BoxCollider ba, Vec3d pa, Quatd qa, BoxCollider bb, Vec3d pb, Quatd qb, {double margin = 0}) — Box–box contact manifold: separating-axis test over the 15 axes, then for a face axis the incident face is clipped against the reference face's side planes (Sutherland–Hodgman), as in Box2D Lite and Bullet's box-box. - ({double distance, Vec3d normal})? signedDistance(RigidBody body, Vec3d p) — Signed distance from p to a body's shape, with the outward normal (null for shapes without an analytic SDF: hulls and compounds' hull children are skipped). - int solveSpd(CsrMatrix a, Float64List b, Float64List x, {double tolerance = 1e-12}) — Solves the symmetric positive-definite system a x = b by PCG with IC(0) (riptide_numerics_sparse), starting from and writing into x. - Float64List solveTridiagonal(Float64List a, Float64List b, Float64List c, Float64List d) — Solves a tridiagonal system (sub a, diagonal b, super c, right side d) by the Thomas algorithm. - typedef FemSolution = ({Float64List displacement, int iterations}) — Result of a static solve: nodal displacements (interleaved per dimension) and PCG iterations. - typedef ForceField = void Function(ParticleState state, double t, Float64List forceOut) — Writes the force on every particle (N, interleaved xyz) for the current positions and velocities at time t. - typedef MassProperties = ({double mass, Vec3d center, Mat3d inertia}) — Mass, centre of mass (body frame) and inertia about the centre of mass (body frame). - typedef CompoundChild = ({Collider shape, Vec3d offset, Quatd rotation}) — One child of a CompoundCollider: a shape at a local offset and rotation. - typedef ContactPoint = ({Vec3d point, double depth}) — One contact point: point is the midpoint between the two surfaces, depth the penetration (> 0 overlapping). - typedef ContactSet = ({Vec3d normal, List points, bool complete}) — The contacts between two shapes: normal points from shape A to shape B (moving B along it separates them). complete is false when the generator returns one point of a face contact (the GJK/EPA path, edge–edge box… - final class ElasticMaterial — Isotropic linear-elastic material. - ElasticMaterial: const ElasticMaterial({required this.youngs, required this.poisson}) - ElasticMaterial: final double youngs — Young's modulus E (Pa) and Poisson's ratio ν. - ElasticMaterial: final double poisson — Young's modulus E (Pa) and Poisson's ratio ν. - ElasticMaterial: double get lambda — Lamé parameters λ and μ (shear modulus). - ElasticMaterial: double get mu - final class PlaneStressFem — 2-D linear elasticity in plane stress on constant-strain triangles (CST, the P1 element): K = Σ t A Bᵀ D B assembled into CSR, Dirichlet conditions by elimination, PCG with IC(0) (riptide_numerics_sparse). - PlaneStressFem: PlaneStressFem(this.nodes, this.triangles, this.material, {this.thickness = 1}) - PlaneStressFem: static ({Float64List nodes, Int32List triangles}) crossedRectangle(int nx, int ny, double w, double h) — A structured nx × ny mesh of a w × h rectangle, each cell split into 4 triangles around its centre (the "crossed" pattern, which bends much better than 2-triangle cells). - PlaneStressFem: final Float64List nodes - PlaneStressFem: final Int32List triangles - PlaneStressFem: final ElasticMaterial material - PlaneStressFem: final double thickness - PlaneStressFem: int get nodeCount - PlaneStressFem: FemSolution solve(Float64List forces, Map fixed, {double tolerance = 1e-12}) — Solves K u = f with nodal forces (fx, fy per node) and fixed dofs (2·node + component → value). - final class TetFem — 3-D linear elasticity on linear tetrahedra (constant strain): K = Σ V Bᵀ D B. - TetFem: TetFem(this.nodes, this.tets, this.material) - TetFem: static ({Float64List nodes, Int32List tets}) box(int nx, int ny, int nz, double w, double h, double dz) — A box nx×ny×nz cells of size w×h×dz, 6 tetrahedra per cell (Kuhn split, conforming). - TetFem: final Float64List nodes - TetFem: final Int32List tets - TetFem: final ElasticMaterial material - TetFem: int get nodeCount - TetFem: FemSolution solve(Float64List forces, Map fixed, {double tolerance = 1e-12}) - abstract final class Heat — Heat conduction u_t = α ∇²u. - Heat: static void explicitStep1d(Float64List u, double alpha, double dx, double dt) — One explicit (FTCS) step on a 1-D rod with fixed ends; stable for r = α dt/dx² ≤ ½ (throws otherwise). - Heat: static void implicitStep1d(Float64List u, double alpha, double dx, double dt, {double theta = 1}) — One θ-method step on a 1-D rod with fixed ends: θ = 1 backward Euler (L-stable), θ = ½ Crank–Nicolson (second order). - final class HeatFem2 — Transient heat on a P1 triangle mesh: backward Euler (M + dt α K) uⁿ⁺¹ = M uⁿ with the lumped mass matrix, Dirichlet nodes held at their values. - HeatFem2: HeatFem2(this.nodes, this.triangles, {required this.alpha}) - HeatFem2: static ({Float64List nodes, Int32List triangles}) unitSquare(int n) — A structured n × n mesh of the unit square (2 triangles per cell). - HeatFem2: static double exactMode(double x, double y, double t, double alpha) - HeatFem2: final Float64List nodes - HeatFem2: final Int32List triangles - HeatFem2: final double alpha - HeatFem2: int step(Float64List u, double dt, Map fixed) — Advances u by dt, keeping fixed nodes at the given temperatures. - final class NeighborGrid — Fixed-radius neighbour search on a dense uniform grid built by counting sort, the layout GPU SPH and particle codes use (Green, "Particle Simulation using CUDA", 2010; Hoetzlein, "Fast Fixed-Radius Nearest Neighbors",… - NeighborGrid: NeighborGrid({required this.minX, required this.minY, required this.minZ, required double maxX, required double maxY, required double maxZ, required this.cellSize}) - NeighborGrid: final double minX - NeighborGrid: final double minY - NeighborGrid: final double minZ - NeighborGrid: final double cellSize - NeighborGrid: final int nx - NeighborGrid: final int ny - NeighborGrid: final int nz - NeighborGrid: int get cellCount - NeighborGrid: late Uint32List cellStart - NeighborGrid: Uint32List cellOf - NeighborGrid: Uint32List sorted - NeighborGrid: int get count - NeighborGrid: int cellIndex(double x, double y, double z) - NeighborGrid: void build(List pos, int count, {int stride = 4}) — Bins count particles whose positions are read from pos with stride floats per particle (4 for the vec4 layout, 3 for packed xyz). - NeighborGrid: int cellX(double x) — Cell coordinates of a point (clamped), for callers that walk neighbouring cells themselves (no closure per neighbour; the loop shape GPU kernels use): for each of the 27 cells c around it, for (s = cellStartc; s <… - NeighborGrid: int cellY(double y) - NeighborGrid: int cellZ(double z) - NeighborGrid: void forEachNeighbor(double x, double y, double z, void Function(int j) visit) — Calls visit with every particle index in the 3×3×3 cells around (x, y, z). - final class SphParams — SPH parameters (SI units). - SphParams: const SphParams({required this.h, this.restDensity = 1000, this.stiffness = 2000, this.viscosity = 1, this.gravityY = -9.81, this.boundaryDamping = 0.5, this.clampNegativePressure = true}) - SphParams: final double h — Smoothing radius (m); also the neighbour grid's cell size. - SphParams: final double restDensity - SphParams: final double stiffness — K in the equation of state p = k (ρ − ρ₀) (Pa per kg/m³). - SphParams: final double viscosity — Dynamic viscosity μ (Pa·s). - SphParams: final double gravityY - SphParams: final double boundaryDamping — Fraction of normal velocity kept when a particle hits the domain walls. - SphParams: final bool clampNegativePressure — Pressure below zero (tension) is clamped, which avoids particle clumping at free surfaces. - final class SphFluid — Weakly compressible SPH (Müller, Charypar and Gross, "Particle-Based Fluid Simulation for Interactive Applications", SCA 2003): poly6 density, spiky pressure gradient, viscosity Laplacian, linear equation of state,… - SphFluid: SphFluid(this.count, this.params, {required this.min, required this.max}) - SphFluid: final int count - SphFluid: final SphParams params - SphFluid: final (double, double, double) min - SphFluid: final (double, double, double) max - SphFluid: final Float32List pos - SphFluid: final Float32List vel - SphFluid: final Float32List acc - SphFluid: final Float32List density - SphFluid: final Float32List pressure - SphFluid: final Uint8List wallMask — Bit m − 1 set when the particle is within h of wall m (1–6: x min, x max, y min, y max, z min, z max), so its mirror image m takes part; written by computeDensity. - SphFluid: final NeighborGrid grid - SphFluid: double mass — Particle mass (kg); fillBox sets it to ρ₀ s³ for lattice spacing s. - SphFluid: late final double poly6 - SphFluid: late final double spikyGrad - SphFluid: late final double viscLap - SphFluid: double get stableDt — The largest stable step by the CFL and viscous limits: min(0.4 h / c, 0.125 h² ρ₀ / μ), c = √k the speed of sound of the linear equation of state. - SphFluid: double get maxSpeed - SphFluid: int fillBox((double, double, double) lo, (double, double, double) hi, double s) — Places particles on a cubic lattice of spacing s filling (lo)…(hi) (row by row, up to count); returns how many were placed and sets the mass to ρ₀ s³. - SphFluid: void computeDensity() — Ρᵢ = Σⱼ m W_poly6(rᵢⱼ, h) over neighbours and their wall images; pᵢ = k(ρᵢ − ρ₀). - SphFluid: void computeForces() — Aᵢ = (−Σ m (pᵢ + pⱼ)/(2ρⱼ) ∇W_spiky + μ Σ m (vⱼ − vᵢ)/ρⱼ ∇²W_visc)/ρᵢ + g over neighbours and their wall images. - SphFluid: void integrate(double dt) — Semi-implicit Euler and reflecting walls. - SphFluid: void step(double dt) - final class StableFluid2 — Stable fluids on a 2-D staggered (MAC) grid: Stam's method ("Stable Fluids", SIGGRAPH 1999) — implicit viscous diffusion, semi-Lagrangian advection (unconditionally stable) and a pressure projection — on the… - StableFluid2: StableFluid2(this.n, {this.viscosity = 0, this.diffusion = 0, this.iterations = 40, this.projectTolerance = 1e-8}) - StableFluid2: final int n - StableFluid2: double viscosity - StableFluid2: double diffusion - StableFluid2: int iterations — Gauss–Seidel sweeps for the diffusion solves. - StableFluid2: double projectTolerance — Relative residual at which the pressure CG stops. - StableFluid2: final Float64List u - StableFluid2: final Float64List v - StableFluid2: final Float64List density - StableFluid2: Float64List get pressure — Pressure from the last projection (cells²/s units). - StableFluid2: double get maxDivergence — The largest |∇·u| over all cells. - StableFluid2: double get totalDensity - StableFluid2: int ui(int i, int j) - StableFluid2: int vi(int i, int j) - StableFluid2: int ci(int i, int j) - StableFluid2: void addVelocity(int i, int j, double du, double dv) — Adds velocity to the faces around cell (i, j), 0 ≤ i, j < n. - StableFluid2: void addDensity(int i, int j, double d) - StableFluid2: void step(double dt) - StableFluid2: (double, double) velocityAt(double x, double y) — Velocity (cells/s) at a point, bilinear from the faces. - StableFluid2: double divergence(int i, int j) — Divergence of cell (i, j): (u(i+1) − u(i)) + (v(j+1) − v(j)). - StableFluid2: int project() — Makes the velocity divergence-free: solve A p = −∇·u (CG; the right side has zero mean, so the singular Neumann system is consistent), then u −= ∇p on interior faces. - final class Cr3bp — The circular restricted three-body problem in the rotating, non-dimensional frame (Szebehely 1967; Koon, Lo, Marsden and Ross, "Dynamical Systems, the Three-Body Problem and Space Mission Design", 2011): the primaries… - Cr3bp: const Cr3bp(this.mu) - Cr3bp: static const earthMoon = Cr3bp(Bodies.moonMu / (Bodies.earthMu + Bodies.moonMu)) — Earth–Moon: μ = M_moon/(M_earth + M_moon) from the GMs in Bodies. - Cr3bp: static const earthMoonLength = Bodies.earthMoonDistance — Length unit (km), time unit (s) and speed unit (km/s) for the Earth–Moon system. - Cr3bp: static double get earthMoonTime - Cr3bp: static double get earthMoonSpeed - Cr3bp: final double mu - Cr3bp: double potential(double x, double y, double z) — Pseudo-potential Ω = (x² + y²)/2 + (1 − μ)/r₁ + μ/r₂ + μ(1 − μ)/2. - Cr3bp: double jacobi(Float64List s) — The Jacobi constant C = 2Ω − v² of state (x, y, z, vx, vy, vz), conserved along trajectories. - Cr3bp: void derivative(Float64List s, Float64List out) — Equations of motion: ẍ − 2ẏ = Ω_x, ÿ + 2ẋ = Ω_y, z̈ = Ω_z. - Cr3bp: List<(double, double)> lagrangePoints() — The five Lagrange points as (x, y): L1–L3 on the x axis by Newton on the quintic's derivative, L4 and L5 at the equilateral points (½ − μ, ±√3/2). - Cr3bp: int propagate(Float64List state, double time, {double tol = 1e-12}) — Integrates state (6 values, modified in place) for time non-dimensional time units with part B's adaptive Dormand–Prince 5(4) stepper (riptide_numerics_calculus, a port of SciPy's RK45) at relative and absolute… - abstract final class Bodies — Gravitational parameters and radii in kilometres and seconds (the units of Vallado's examples). - Bodies: static const earthMu = 398600.4418 - Bodies: static const earthRadius = 6378.137 - Bodies: static const moonMu = 4902.800066 - Bodies: static const moonRadius = 1737.4 - Bodies: static const sunMu = 1.32712440018e11 - Bodies: static const earthMoonDistance = 384400.0 - final class OrbitalElements — Classical orbital elements. - OrbitalElements: const OrbitalElements({required this.a, required this.e, required this.i, required this.raan, required this.argPeriapsis, required this.trueAnomaly}) - OrbitalElements: final double a — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: final double e — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: final double i — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: final double raan — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: final double argPeriapsis — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: final double trueAnomaly — Semi-major axis (negative for hyperbolas), eccentricity, inclination, right ascension of the ascending node, argument of periapsis, true anomaly. - OrbitalElements: double get p — Semi-latus rectum p = a(1 − e²). - OrbitalElements: double period(double mu) - OrbitalElements: String toString() - abstract final class Kepler — Kepler's equation, conversions between anomalies, and two-body propagation. - Kepler: static double eccentricAnomaly(double meanAnomaly, double e) — Solves M = E − e sin E for the eccentric anomaly (0 ≤ e < 1) by Newton's method with Danby's start E₀ = M + 0.85 e sign(sin M); converges to machine precision in ≤ 6 iterations for all e < 1. - Kepler: static double hyperbolicAnomaly(double meanAnomaly, double e) — Solves M = e sinh H − H for the hyperbolic anomaly (e > 1). - Kepler: static double trueFromEccentric(double ea, double e) - Kepler: static double eccentricFromTrue(double nu, double e) - Kepler: static double trueFromHyperbolic(double h, double e) - Kepler: static double hyperbolicFromTrue(double nu, double e) - Kepler: static double meanFromTrue(double nu, double e) - Kepler: static double trueFromMean(double m, double e) - Kepler: static (double, double) stumpff(double psi) — Stumpff functions c₂(ψ) = (1 − cos√ψ)/ψ and c₃(ψ) = (√ψ − sin√ψ)/√ψ³ (with series near 0). - Kepler: static (Vec3d, Vec3d) propagate(Vec3d r, Vec3d v, double dt, {double mu = Bodies.earthMu}) — Propagates a two-body state (r km, v km/s) by dt seconds with universal variables (Vallado, Algorithm 8 KEPLER, with its initial guesses), one formulation for every conic. - Kepler: static OrbitalElements elementsFromState(Vec3d r, Vec3d v, {double mu = Bodies.earthMu}) — Vallado's RV2COE: state vector (km, km/s) to classical elements. - Kepler: static (Vec3d, Vec3d) stateFromElements(OrbitalElements el, {double mu = Bodies.earthMu}) — Vallado's COE2RV: classical elements to state vector (km, km/s). - Kepler: static double period(double a, {double mu = Bodies.earthMu}) — Orbital period (s) of semi-major axis a (km). - Kepler: static double visViva(double r, double a, {double mu = Bodies.earthMu}) — Vis-viva: speed (km/s) at radius r on an orbit of semi-major axis a. - Kepler: static double escapeSpeed(double r, {double mu = Bodies.earthMu}) — Escape speed (km/s) at radius r. - Kepler: static double circularSpeed(double r, {double mu = Bodies.earthMu}) — Circular-orbit speed (km/s) at radius r. - Kepler: static ({double dv1, double dv2, double time}) hohmann(double r1, double r2, {double mu = Bodies.earthMu}) — Hohmann transfer between circular coplanar orbits of radii r1 → r2 (km): the two burns (km/s) and the transfer time (s, half the transfer ellipse's period). - final class ParticleState — Point particles in structure-of-arrays typed data (double precision): position and velocity interleaved xyz (3 per particle), plus mass and charge. - ParticleState: ParticleState(this.count) - ParticleState: final int count - ParticleState: final Float64List position - ParticleState: final Float64List velocity - ParticleState: final Float64List mass — Per-particle mass (kg; 1 by default) and charge (C; 0 by default). - ParticleState: final Float64List charge — Per-particle mass (kg; 1 by default) and charge (C; 0 by default). - ParticleState: double time — Simulation time (s). - ParticleState: double get kineticEnergy - ParticleState: (double, double, double) get momentum — Total momentum (px, py, pz). - abstract interface class ParticleStepper — One time step of a particle system. - ParticleStepper: void step(ParticleState state, ForceField force, double dt) - base class SymplecticStepper implements ParticleStepper — Symplectic stepping by part B's SymplecticIntegrator (velocity Verlet, leapfrog, Yoshida 4 and 6): bounded energy error over long runs. - SymplecticStepper: SymplecticStepper([this.method = SymplecticMethod.velocityVerlet]) - SymplecticStepper: final SymplecticMethod method - SymplecticStepper: void reset() — Call when positions are changed from outside, so a cached force is recomputed. - SymplecticStepper: void step(ParticleState s, ForceField force, double dt) - final class VelocityVerlet extends SymplecticStepper — Velocity Verlet (kick–drift–kick): second order, symplectic, one force evaluation per step. - VelocityVerlet: VelocityVerlet() - final class SemiImplicitEuler implements ParticleStepper — Semi-implicit (symplectic) Euler: v += a dt, x += v dt. - SemiImplicitEuler: void step(ParticleState s, ForceField force, double dt) - final class RungeKutta4 implements ParticleStepper — Classic fourth-order Runge–Kutta on (x, v) by part B's Rk4Stepper: accurate for smooth, velocity-dependent forces (drag, magnetic), not symplectic. - RungeKutta4: void step(ParticleState s, ForceField force, double dt) - enum BodyType — How a body moves: dynamic bodies respond to forces and contacts; static bodies never move; kinematic bodies move by the velocity you set and push dynamic bodies without being pushed back. - BodyType: dynamic - BodyType: static - BodyType: kinematic - final class RigidBody — A rigid body. - RigidBody: factory RigidBody.dynamic(Collider collider, {double density = 1000, double? mass, Vec3d position = Vec3d.zero, Quatd orientation = Quatd.identity}) — A dynamic body whose mass comes from density (kg/m³), or exactly mass when given (inertia scaled to it). - RigidBody: factory RigidBody.static(Collider collider, {Vec3d position = Vec3d.zero, Quatd orientation = Quatd.identity}) - RigidBody: factory RigidBody.kinematic(Collider collider, {Vec3d position = Vec3d.zero, Quatd orientation = Quatd.identity}) - RigidBody: final Collider collider - RigidBody: final BodyType type - RigidBody: int id — Index in its world (set when added). - RigidBody: Object? userData - RigidBody: double mass - RigidBody: double invMass - RigidBody: Mat3d inertiaLocal - RigidBody: Mat3d invInertiaLocal - RigidBody: Mat3d invInertiaWorld — I⁻¹ in world frame, R I⁻¹_local Rᵀ; refreshed every step. - RigidBody: Vec3d position - RigidBody: Quatd orientation - RigidBody: Vec3d linearVelocity - RigidBody: Vec3d angularVelocity - RigidBody: Vec3d force - RigidBody: Vec3d torque - RigidBody: double friction - RigidBody: double restitution - RigidBody: double linearDamping - RigidBody: double angularDamping - RigidBody: double gravityScale - RigidBody: int collisionGroup — Bits of the groups this body is in, and the groups it collides with. - RigidBody: int collisionMask - RigidBody: bool awake - RigidBody: double sleepTime - RigidBody: bool get isDynamic - RigidBody: Mat3d get inertiaWorld — The world inertia tensor R I Rᵀ. - RigidBody: Aabb get bounds - RigidBody: double get kineticEnergy - RigidBody: Vec3d get linearMomentum - RigidBody: Vec3d get angularMomentum — Angular momentum about the world origin: r × m v + I ω. - RigidBody: void updateInertia() — Recomputes invInertiaWorld from the orientation. - RigidBody: Vec3d velocityAt(Vec3d p) — Velocity of the material point at world position p. - RigidBody: Vec3d toWorld(Vec3d local) - RigidBody: Vec3d toLocal(Vec3d world) - RigidBody: void applyForce(Vec3d f, {Vec3d? at}) - RigidBody: void applyTorque(Vec3d t) - RigidBody: void applyImpulse(Vec3d j, {Vec3d? at}) — Applies impulse j (N·s) at world point at (the centre of mass when null). - final class DynamicAabbTree — A dynamic AABB tree (the structure of Box2D's b2DynamicTree, written from Catto's description): leaves hold "fat" boxes inflated by margin so small motions don't touch the tree; insertion picks the sibling by the… - DynamicAabbTree: DynamicAabbTree({this.margin = 0.05}) - DynamicAabbTree: final double margin - DynamicAabbTree: int get root - DynamicAabbTree: int get height — Tree height (0 for a single leaf); a balanced tree of n leaves is about log2 n. - DynamicAabbTree: Aabb fatBounds(int id) — The fat box of proxy id. - DynamicAabbTree: int userData(int id) - DynamicAabbTree: int insert(Aabb box, int data) — Inserts box for data; returns the proxy id. - DynamicAabbTree: void remove(int id) - DynamicAabbTree: bool move(int id, Aabb box) — Updates proxy id to box; reinserts only when it left its fat box. - DynamicAabbTree: void query(Aabb box, void Function(int data) hit) — Calls hit with the user data of every leaf whose fat box overlaps box. - DynamicAabbTree: bool validate() — Checks parent links, heights and that every node box encloses its children (tests). - final class Aabb — An axis-aligned box in double precision (broadphase bounds). - Aabb: const Aabb(this.min, this.max) - Aabb: static const everything = Aabb(Vec3d(-1e30, -1e30, -1e30), Vec3d(1e30, 1e30, 1e30)) - Aabb: final Vec3d min - Aabb: final Vec3d max - Aabb: double get area — Surface area (the SAH cost of a tree node). - Aabb: bool overlaps(Aabb o) - Aabb: bool contains(Aabb o) - Aabb: Aabb union(Aabb o) - Aabb: Aabb inflate(double m) - sealed class Collider — A collision shape in its body's local frame. - Collider: const Collider() - Collider: Aabb bounds(Vec3d p, Quatd q) — World bounds at pose (p, q). - Collider: MassProperties massProperties(double density) — Mass properties at uniform density (kg/m³). - Collider: Convex? convexAt(Vec3d p, Quatd q) — A support-function view for GJK/EPA at a pose (float32, riptide_math's Convex). - final class SphereCollider extends Collider - SphereCollider: const SphereCollider(this.radius) - SphereCollider: final double radius - SphereCollider: Aabb bounds(Vec3d p, Quatd q) - SphereCollider: MassProperties massProperties(double density) - SphereCollider: Convex convexAt(Vec3d p, Quatd q) - final class BoxCollider extends Collider - BoxCollider: const BoxCollider(this.halfExtents) - BoxCollider: final Vec3d halfExtents - BoxCollider: Aabb bounds(Vec3d p, Quatd q) - BoxCollider: MassProperties massProperties(double density) - BoxCollider: Convex convexAt(Vec3d p, Quatd q) - final class CapsuleCollider extends Collider — A capsule along the local Y axis: the segment (0, ±halfHeight, 0) swept by a sphere of radius. - CapsuleCollider: const CapsuleCollider(this.halfHeight, this.radius) - CapsuleCollider: final double halfHeight - CapsuleCollider: final double radius - CapsuleCollider: (Vec3d, Vec3d) segment(Vec3d p, Quatd q) — The segment end points in world space. - CapsuleCollider: Aabb bounds(Vec3d p, Quatd q) - CapsuleCollider: MassProperties massProperties(double density) - CapsuleCollider: Convex convexAt(Vec3d p, Quatd q) - final class ConvexHullCollider extends Collider — The convex hull of points (local frame). - ConvexHullCollider: factory ConvexHullCollider(List points) - ConvexHullCollider: final Float32x4List points — Hull vertices in the local frame (centre of mass at the origin), as float32 lanes for GJK. - ConvexHullCollider: final Uint32List triangles — Hull triangles (3 indices each), outward winding. - ConvexHullCollider: Aabb bounds(Vec3d p, Quatd q) - ConvexHullCollider: MassProperties massProperties(double density) - ConvexHullCollider: Convex convexAt(Vec3d p, Quatd q) - ConvexHullCollider: Iterable worldPoints(Vec3d p, Quatd q) — World-space vertices at a pose. - final class PlaneCollider extends Collider — An infinite plane {x: n·x = offset} in world space. - PlaneCollider: PlaneCollider(Vec3d normal, this.offset) - PlaneCollider: final Vec3d normal - PlaneCollider: final double offset - PlaneCollider: Aabb bounds(Vec3d p, Quatd q) - PlaneCollider: MassProperties massProperties(double density) - PlaneCollider: Convex? convexAt(Vec3d p, Quatd q) - final class CompoundCollider extends Collider — Several shapes on one body. - CompoundCollider: factory CompoundCollider(List children) - CompoundCollider: final List children - CompoundCollider: final Vec3d shift - CompoundCollider: (Vec3d, Quatd) childPose(int i, Vec3d p, Quatd q) — Child i's world pose for a body at (p, q). - CompoundCollider: Aabb bounds(Vec3d p, Quatd q) - CompoundCollider: MassProperties massProperties(double density) - CompoundCollider: Convex? convexAt(Vec3d p, Quatd q) - final class ManifoldPoint — One persistent contact point between two bodies. - ManifoldPoint: ManifoldPoint(this.localA, this.localB, this.depth) - ManifoldPoint: Vec3d localA — The point on A's surface deepest inside B, and on B's surface deepest inside A, in body frames. - ManifoldPoint: Vec3d localB — The point on A's surface deepest inside B, and on B's surface deepest inside A, in body frames. - ManifoldPoint: double depth - ManifoldPoint: double normalImpulse - ManifoldPoint: double tangentImpulse1 - ManifoldPoint: double tangentImpulse2 - ManifoldPoint: Vec3d rA - ManifoldPoint: Vec3d rB - ManifoldPoint: double normalMass - ManifoldPoint: double tangentMass1 - ManifoldPoint: double tangentMass2 - ManifoldPoint: double velocityBias - final class ContactManifold — The contact manifold of a body pair: one normal (A to B) and up to 4 points. - ContactManifold: ContactManifold(this.a, this.b, this.shapeA, this.shapeB) - ContactManifold: final RigidBody a - ContactManifold: final RigidBody b - ContactManifold: final int shapeA — Leaf indices inside compound shapes (0 otherwise). - ContactManifold: final int shapeB — Leaf indices inside compound shapes (0 otherwise). - ContactManifold: Vec3d normal - ContactManifold: final points - ContactManifold: Vec3d t1 - ContactManifold: Vec3d t2 - ContactManifold: double friction - ContactManifold: double restitution - ContactManifold: Vec3d worldA(ManifoldPoint p) — Builds world anchors from the stored local ones. - ContactManifold: Vec3d worldB(ManifoldPoint p) - final class SolverSettings — Solver settings. - SolverSettings: const SolverSettings({this.velocityIterations = 10, this.positionIterations = 4, this.slop = 0.005, this.baumgarte = 0.2, this.maxCorrection = 0.2, this.restitutionThreshold = 1.0, this.warmStarting = true}) - SolverSettings: final int velocityIterations - SolverSettings: final int positionIterations - SolverSettings: final double slop — Penetration allowed without correction (m), so resting contacts stay touching. - SolverSettings: final double baumgarte — Fraction of the penetration removed per position iteration. - SolverSettings: final double maxCorrection - SolverSettings: final double restitutionThreshold — Approach speed (m/s) below which restitution is ignored, so resting bodies don't jitter. - SolverSettings: final bool warmStarting - final class ContactSolver — Sequential impulses (Catto, GDC 2005–2009): per contact, a normal impulse clamped to push only, two friction impulses clamped to the Coulomb pyramid μλₙ, restitution as a velocity bias, accumulated across iterations… - ContactSolver: ContactSolver(this.settings) - ContactSolver: final SolverSettings settings - ContactSolver: void prepare(List manifolds) - ContactSolver: void solveVelocities(List manifolds) - ContactSolver: double solvePositions(List manifolds) — Non-linear Gauss–Seidel on positions (Box2D's solvePositionConstraints): moves and rotates bodies to remove penetration beyond SolverSettings.slop, without touching velocities. - sealed class Joint — A constraint between two bodies, solved with the contacts by sequential impulses. - Joint: Joint(this.a, this.b) - Joint: final RigidBody a - Joint: final RigidBody b - Joint: double baumgarte — Fraction of the position error removed per step. - Joint: void prepare(double dt, {required bool warmStart}) - Joint: void solveVelocity() - final class BallJoint extends Joint — Ball-and-socket: the anchor points coincide (3 linear constraints). - BallJoint: BallJoint(super.a, super.b, Vec3d anchor) — anchor in world space at creation. - BallJoint: final Vec3d localA - BallJoint: final Vec3d localB - BallJoint: void prepare(double dt, {required bool warmStart}) - BallJoint: void solveVelocity() - final class DistanceJoint extends Joint — Keeps the anchors at length apart (a rigid rod; 1 constraint along the line between them). - DistanceJoint: DistanceJoint(super.a, super.b, Vec3d anchorA, Vec3d anchorB, {double? length}) - DistanceJoint: final Vec3d localA - DistanceJoint: final Vec3d localB - DistanceJoint: final double length - DistanceJoint: void prepare(double dt, {required bool warmStart}) - DistanceJoint: void solveVelocity() - final class HingeJoint extends Joint — A hinge: a ball joint plus 2 angular constraints keeping body B's axis aligned with body A's, so the only relative rotation is about the axis. - HingeJoint: HingeJoint(super.a, super.b, Vec3d anchor, Vec3d axis) - HingeJoint: final Vec3d axisA - HingeJoint: final Vec3d axisB - HingeJoint: double get twistParameter — The hinge's twist as a Cayley parameter, tan(angle/2): read off the relative rotation's quaternion with one division (swing–twist), no trigonometry. - HingeJoint: double get angle — The hinge angle of B relative to A about the axis, in radians in (−π, π] (the boundary form of twistParameter, for display and radians-based APIs). - HingeJoint: void prepare(double dt, {required bool warmStart}) - HingeJoint: void solveVelocity() - final class FixedJoint extends Joint — Welds two bodies: point constraint + 3 angular constraints holding their relative orientation. - FixedJoint: FixedJoint(super.a, super.b, Vec3d anchor) - FixedJoint: void prepare(double dt, {required bool warmStart}) - FixedJoint: void solveVelocity() - enum BroadphaseKind — Which broadphase finds candidate pairs. - BroadphaseKind: tree — Incremental dynamic AABB tree (default; best when most bodies move a little each step). - BroadphaseKind: sweepAndPrune — Sweep and prune on X, rebuilt each step (riptide_math's Broadphase); fine for a few hundred bodies. - final class PhysicsWorld — A rigid-body world: integrate forces, find contacts (broadphase, narrowphase, persistent manifolds), solve contacts and joints by sequential impulses, integrate positions, then correct penetration on positions. - PhysicsWorld: PhysicsWorld({this.gravity = const Vec3d(0, -9.81, 0), this.settings = const SolverSettings(), this.broadphase = BroadphaseKind.tree, this.gyroscopic = true, this.sleeping = false}) - PhysicsWorld: Vec3d gravity - PhysicsWorld: final SolverSettings settings - PhysicsWorld: final BroadphaseKind broadphase - PhysicsWorld: final bool gyroscopic — Integrate the gyroscopic term ω × Iω implicitly (Catto 2015), so free spinning bodies keep their angular momentum. - PhysicsWorld: final bool sleeping — Put bodies to sleep after sleepDelay s below sleepLinear / sleepAngular; contacts wake them. - PhysicsWorld: double sleepLinear - PhysicsWorld: double sleepAngular - PhysicsWorld: double sleepDelay - PhysicsWorld: final bodies - PhysicsWorld: final joints - PhysicsWorld: Iterable get manifolds — The contact manifolds found in the last step. - PhysicsWorld: double time - PhysicsWorld: double get kineticEnergy — Total kinetic energy of the dynamic bodies (J). - PhysicsWorld: double get potentialEnergy — Gravitational potential energy relative to the origin (J). - PhysicsWorld: Vec3d get linearMomentum - PhysicsWorld: Vec3d get angularMomentum - PhysicsWorld: RigidBody add(RigidBody body) - PhysicsWorld: Joint addJoint(Joint j) - PhysicsWorld: void step(double dt) — Advances the world by dt seconds. - PhysicsWorld: List queryAabb(Aabb box) — Bodies whose (fat) bounds overlap box. - final class XpbdBody — A particle system solved with extended position-based dynamics (Macklin, Müller and Chentanez, "XPBD", 2016) using small substeps with one constraint iteration each (Macklin et al. - XpbdBody: XpbdBody(int count) - XpbdBody: final Float64List x — Positions, previous positions and velocities (interleaved xyz) and inverse masses (0 = pinned). - XpbdBody: final Float64List prev — Positions, previous positions and velocities (interleaved xyz) and inverse masses (0 = pinned). - XpbdBody: final Float64List v — Positions, previous positions and velocities (interleaved xyz) and inverse masses (0 = pinned). - XpbdBody: final Float64List invMass — Positions, previous positions and velocities (interleaved xyz) and inverse masses (0 = pinned). - XpbdBody: int get count - XpbdBody: Vec3d gravity - XpbdBody: double damping — Velocity damping per second (0 = none). - XpbdBody: double friction — Friction coefficient against colliders (position-level, Müller et al. 2007 style). - XpbdBody: double thickness — Particle radius for collisions (m). - XpbdBody: final colliders — Rigid bodies the particles collide with. - XpbdBody: int get distanceConstraintCount - XpbdBody: int get volumeConstraintCount - XpbdBody: double get volume — Current total volume of the tetrahedra (each counted with its rest orientation, so inverted tets subtract). - XpbdBody: double get restVolume - XpbdBody: double get kineticEnergy - XpbdBody: Vec3d position(int i) - XpbdBody: void setPosition(int i, Vec3d p) - XpbdBody: void addDistance(int i, int j, {double compliance = 0}) — Adds a distance constraint between i and j at their current separation. - XpbdBody: void addVolume(int a, int b, int c, int d, {double compliance = 0}) — Adds a tetrahedral volume constraint (vertices in any order; the rest volume keeps its sign). - XpbdBody: double maxStrain({double maxCompliance = 0}) — Largest relative stretch |l − l₀|/l₀ over the distance constraints with compliance ≤ maxCompliance (by default the rigid ones: compliant bending constraints shorten wherever the cloth folds). - XpbdBody: void step(double dt, {int substeps = 10}) — Advances dt seconds in substeps substeps (each: predict, solve every constraint once, update velocities). - abstract final class SoftBodies — Builders for common XPBD bodies. - SoftBodies: static XpbdBody cloth({required int nx, required int ny, required double width, required double height, Vec3d origin = Vec3d.zero, double areaDensity = 0.2, double stretchCompliance = 0, double shearCompliance = 1e-6, double bendCompliance = 1e-3}) — A rectangular cloth of nx × ny particles spanning width × height in the XZ plane at origin, with structural, shear and bending (distance across two cells) constraints. - SoftBodies: static XpbdBody softBox({required int n, required double size, Vec3d origin = Vec3d.zero, double density = 100, double edgeCompliance = 1e-4, double volumeCompliance = 0}) — A soft box of n³ cells (each split into 5 tetrahedra) with edge and volume constraints; density kg/m³. - final class SparseBuilder — Accumulates (row, col, value) triplets, summing duplicates (FEM assembly), and compresses to Csr. - SparseBuilder: SparseBuilder(this.n) - SparseBuilder: final int n - SparseBuilder: void add(int r, int c, double v) - SparseBuilder: void applyDirichlet(Map fixed, Float64List rhs) — Applies Dirichlet conditions ui = valuei for each fixed i: moves the known columns to rhs, zeroes their rows and columns and puts 1 on the diagonal, keeping the matrix symmetric for CG. - SparseBuilder: CsrMatrix build() - abstract final class Constants — Physical constants in SI units: CODATA 2018 recommended values (Tiesinga, Mohr, Newell and Taylor, "CODATA recommended values of the fundamental physical constants: 2018", Rev. - Constants: static const speedOfLight = 299792458.0 — Speed of light in vacuum c (m/s). - Constants: static const planck = 6.62607015e-34 — Planck constant h (J·s). - Constants: static const reducedPlanck = 1.054571817e-34 — Reduced Planck constant ħ = h/2π (J·s). - Constants: static const elementaryCharge = 1.602176634e-19 — Elementary charge e (C). - Constants: static const boltzmann = 1.380649e-23 — Boltzmann constant k_B (J/K). - Constants: static const avogadro = 6.02214076e23 — Avogadro constant N_A (1/mol). - Constants: static const gas = 8.314462618 — Molar gas constant R = N_A k_B (J/(mol·K)). - Constants: static const stefanBoltzmann = 5.670374419e-8 — Stefan–Boltzmann constant σ (W/(m²·K⁴)). - Constants: static const electronVolt = 1.602176634e-19 — Electron volt (J). - Constants: static const gravitational = 6.67430e-11 — Newtonian constant of gravitation G (m³/(kg·s²)). - Constants: static const vacuumPermeability = 1.25663706212e-6 — Vacuum magnetic permeability μ₀ (N/A²). - Constants: static const vacuumPermittivity = 8.8541878128e-12 — Vacuum electric permittivity ε₀ = 1/(μ₀c²) (F/m). - Constants: static const coulomb = 8.9875517923e9 — Coulomb constant 1/(4πε₀) (N·m²/C²). - Constants: static const electronMass = 9.1093837015e-31 — Electron mass m_e (kg). - Constants: static const protonMass = 1.67262192369e-27 — Proton mass m_p (kg). - Constants: static const neutronMass = 1.67492749804e-27 — Neutron mass m_n (kg). - Constants: static const deuteronMass = 3.3435837724e-27 — Deuteron mass m_d (kg). - Constants: static const alphaMass = 6.6446573357e-27 — Alpha particle mass m_α (kg). - Constants: static const atomicMass = 1.66053906660e-27 — Atomic mass constant m_u = 1 Da (kg). - Constants: static const fineStructure = 7.2973525693e-3 — Fine-structure constant α (dimensionless). - Constants: static const rydberg = 10973731.568160 — Rydberg constant R∞ (1/m). - Constants: static const bohrRadius = 5.29177210903e-11 — Bohr radius a₀ (m). - Constants: static const classicalElectronRadius = 2.8179403262e-15 — Classical electron radius r_e (m). - Constants: static const electronRestEnergyEv = 0.51099895000e6 — Electron rest energy m_e c² (eV). - Constants: static const protonRestEnergyEv = 938.27208816e6 — Proton rest energy m_p c² (eV). - Constants: static const electronChargeToMass = -1.75882001076e11 — Electron charge-to-mass quotient −e/m_e (C/kg). - Constants: static const standardGravity = 9.80665 — Standard acceleration of gravity g_n (m/s², exact by convention). - Constants: static const standardAtmosphere = 101325.0 — Standard atmosphere (Pa, exact by convention). - Constants: static const astronomicalUnit = 149597870700.0 — Astronomical unit (m, exact, IAU 2012 Resolution B2). - Constants: static const lightYear = 9460730472580800.0 — Light year (m, Julian year × c). - Constants: static const parsec = 3.0856775814913673e16 — Parsec (m). - Constants: static const earthGM = 3.986004418e14 — Earth's GM (m³/s², IERS 2010 / WGS 84, includes the atmosphere). - Constants: static const earthRadius = 6378137.0 — Earth's equatorial radius (m, WGS 84). - Constants: static const moonGM = 4.9028000661e12 — Moon's GM (m³/s², JPL DE430). - Constants: static const earthMoonDistance = 384400e3 — Mean Earth–Moon distance (m). - Constants: static const sunGM = 1.3271244e20 — Sun's GM (m³/s², IAU 2015 nominal). - Constants: static const siderealDay = 86164.0905 — Sidereal day (s). - Constants: static const relativeUncertainty — CODATA 2018 standard relative uncertainties of the measured constants above. - final class Dimension — Units of measure, two ways: - Dimension: const Dimension({this.m = 0, this.kg = 0, this.s = 0, this.a = 0, this.k = 0, this.mol = 0, this.cd = 0}) - Dimension: static const none = Dimension() - Dimension: static const length = Dimension(m: 1) - Dimension: static const mass = Dimension(kg: 1) - Dimension: static const time = Dimension(s: 1) - Dimension: static const current = Dimension(a: 1) - Dimension: static const temperature = Dimension(k: 1) - Dimension: static const amount = Dimension(mol: 1) - Dimension: static const luminousIntensity = Dimension(cd: 1) - Dimension: static const speed = Dimension(m: 1, s: -1) - Dimension: static const acceleration = Dimension(m: 1, s: -2) - Dimension: static const force = Dimension(m: 1, kg: 1, s: -2) - Dimension: static const energy = Dimension(m: 2, kg: 1, s: -2) - Dimension: static const power = Dimension(m: 2, kg: 1, s: -3) - Dimension: static const pressure = Dimension(m: -1, kg: 1, s: -2) - Dimension: static const charge = Dimension(s: 1, a: 1) - Dimension: static const voltage = Dimension(m: 2, kg: 1, s: -3, a: -1) - Dimension: final int m - Dimension: final int kg - Dimension: final int s - Dimension: final int a - Dimension: final int k - Dimension: final int mol - Dimension: final int cd - Dimension: int get hashCode - Dimension: Dimension pow(int n) - Dimension: String toString() - Dimension: Dimension operator *(Dimension o) - Dimension: Dimension operator /(Dimension o) - Dimension: bool operator ==(Object other) - final class Quantity — A value with a run-time dimension, in SI base units. - Quantity: const Quantity(this.value, this.dimension) - Quantity: final double value - Quantity: final Dimension dimension - Quantity: Quantity scale(double s) - Quantity: Quantity pow(int n) - Quantity: double inUnit(Quantity unit) — The value in unit (which must have the same dimension). - Quantity: String toString() - Quantity: Quantity operator +(Quantity o) - Quantity: Quantity operator -(Quantity o) - Quantity: Quantity operator *(Quantity o) - Quantity: Quantity operator /(Quantity o) - Quantity: bool operator <(Quantity o) - Quantity: bool operator >(Quantity o) - extension type const Length(double m) — Length (m). - Length: const Length.km(double v) - Length: const Length.cm(double v) - Length: const Length.mm(double v) - Length: const Length.miles(double v) - Length: const Length.feet(double v) - Length: const Length.inches(double v) - Length: const Length.nauticalMiles(double v) - Length: const Length.au(double v) - Length: const Length.lightYears(double v) - Length: double get km - Length: double get miles - Length: double get feet - Length: double get au - Length: Quantity get q - Length: Area times(Length o) - Length: Speed per(Time t) - Length: double ratio(Length o) - Length: Length operator +(Length o) - Length: Length operator -(Length o) - Length: Length operator *(double s) - extension type const Time(double s) — Time (s). - Time: const Time.ms(double v) - Time: const Time.minutes(double v) - Time: const Time.hours(double v) - Time: const Time.days(double v) - Time: const Time.years(double v) - Time: double get minutes - Time: double get hours - Time: double get days - Time: Frequency get inverse - Time: Quantity get q - Time: Time operator +(Time o) - Time: Time operator -(Time o) - Time: Time operator *(double k) - extension type const Mass(double kg) — Mass (kg). - Mass: const Mass.grams(double v) - Mass: const Mass.tonnes(double v) - Mass: const Mass.pounds(double v) - Mass: double get pounds - Mass: Quantity get q - Mass: Force times(Acceleration a) - Mass: Momentum withSpeed(Speed v) - Mass: Density per(Volume v) - Mass: Mass operator +(Mass o) - Mass: Mass operator -(Mass o) - Mass: Mass operator *(double s) - extension type const Temperature(double kelvin) — Thermodynamic temperature (K). - Temperature: const Temperature.celsius(double c) - Temperature: const Temperature.fahrenheit(double f) - Temperature: double get celsius - Temperature: double get fahrenheit - Temperature: Quantity get q - extension type const Area(double m2) — Area (m²). - Area: Quantity get q - Area: Volume times(Length l) - Area: Area operator +(Area o) - extension type const Volume(double m3) — Volume (m³). - Volume: const Volume.litres(double v) - Volume: double get litres - Volume: Quantity get q - Volume: Volume operator +(Volume o) - extension type const Speed(double mps) — Speed (m/s). - Speed: const Speed.kmh(double v) - Speed: const Speed.mph(double v) - Speed: const Speed.knots(double v) - Speed: const Speed.kmps(double v) - Speed: double get kmh - Speed: double get mph - Speed: Quantity get q - Speed: Length over(Time t) - Speed: Acceleration per(Time t) - Speed: Speed operator +(Speed o) - Speed: Speed operator -(Speed o) - Speed: Speed operator *(double s) - extension type const Acceleration(double mps2) — Acceleration (m/s²). - Acceleration: const Acceleration.g(double v) - Acceleration: double get inG - Acceleration: Quantity get q - Acceleration: Speed over(Time t) - Acceleration: Acceleration operator +(Acceleration o) - extension type const Force(double newtons) — Force (N). - Force: const Force.kilonewtons(double v) - Force: const Force.poundsForce(double v) - Force: Quantity get q - Force: Energy through(Length d) - Force: Pressure per(Area a) - Force: Acceleration on(Mass m) - Force: Force operator +(Force o) - Force: Force operator -(Force o) - Force: Force operator *(double s) - extension type const Energy(double joules) — Energy (J). - Energy: const Energy.kilojoules(double v) - Energy: const Energy.electronVolts(double v) - Energy: const Energy.kilowattHours(double v) - Energy: const Energy.calories(double v) - Energy: double get electronVolts - Energy: double get kilowattHours - Energy: Quantity get q - Energy: Power per(Time t) - Energy: Energy operator +(Energy o) - Energy: Energy operator -(Energy o) - Energy: Energy operator *(double s) - extension type const Power(double watts) — Power (W). - Power: const Power.kilowatts(double v) - Power: const Power.horsepower(double v) - Power: Quantity get q - Power: Energy over(Time t) - Power: Power operator +(Power o) - extension type const Pressure(double pascals) — Pressure (Pa). - Pressure: const Pressure.kilopascals(double v) - Pressure: const Pressure.bar(double v) - Pressure: const Pressure.atmospheres(double v) - Pressure: const Pressure.psi(double v) - Pressure: double get atmospheres - Pressure: Quantity get q - Pressure: Force over(Area a) - Pressure: Pressure operator +(Pressure o) - extension type const Frequency(double hertz) — Frequency (Hz). - Frequency: Time get period - Frequency: Quantity get q - extension type const Angle(double radians) — Plane angle (rad; dimensionless in SI). - Angle: const Angle.degrees(double d) - Angle: double get degrees - Angle: AngularVelocity per(Time t) - Angle: Angle operator +(Angle o) - Angle: Angle operator -(Angle o) - extension type const AngularVelocity(double radPerS) — Angular velocity (rad/s). - AngularVelocity: const AngularVelocity.rpm(double v) - AngularVelocity: double get rpm - AngularVelocity: Quantity get q - extension type const Density(double kgPerM3) — Density (kg/m³). - Density: Quantity get q - Density: Mass of(Volume v) - extension type const Momentum(double kgMps) — Momentum (kg·m/s). - Momentum: Quantity get q - Momentum: Momentum operator +(Momentum o) - extension type const Charge(double coulombs) — Electric charge (C). - Charge: Quantity get q - Charge: Charge operator +(Charge o) - extension type const Voltage(double volts) — Voltage (V). - Voltage: Quantity get q - Voltage: Energy across(Charge c) ### Quantum mechanics (riptide_rational_quantum) import 'package:riptide_rational_quantum/riptide_rational_quantum.ray'; The Schrödinger equation stepped exactly over the Gaussian rationals, so probability is conserved exactly, rational SU(2) spin rotors and entanglement. https://riptidecompute.com/raya/docs/rational-quantum - T spreadOf(KeplerArith f, Line a, Line b) — The spread between two lines, (a × b)²/(Q_a Q_b): 0 parallel, 1 perpendicular. - double classicPolarisationCorrelation(double alpha, double beta) — The classic Bell correlation, cos 2(α − β), angles in radians (Transcendental). - double classicChsh(double a, double a2, double b, double b2) — The classic CHSH sum at angles (radians). - double classicLineAngle(double dx, double dy) — The classic way names a polariser line by its angle, atan2(dy, dx) (Transcendental). - double classicSameProbability(double alpha, double beta) — The classic coincidence probability P(same) = cos²(α − β) for the same pair (Transcendental). - List spreadPolynomials(KeplerArith f, T s, int upTo) — S₀(s) … S_upTo, Wildberger's spread polynomials at s, by the three-term recurrence Sₙ₊₁ = 2(1 − 2s)Sₙ − Sₙ₋₁ + 2s. - T spreadPolynomial(KeplerArith f, int n, T s) — Sₙ(s). - int boxEnergyRatio(int n) — The energy of state n in units of E₁ = π²ħ²/(2mL²): exactly n². - Cx cayleyTick(CxArith c, T tau) — E^{−iθ} as the Cayley point (1 − iτ)/(1 + iτ) = ((1 − τ²) − 2iτ)/(1 + τ²), θ = 2·atan τ; |z|² = 1 exactly. - Cx powCx(CxArith c, Cx z, int k) — Zᵏ (k ≥ 0) by squaring. - Cx minusIPow(CxArith c, int k) — (−i)^k. - T discreteBoxDeterminant(KeplerArith f, int n, T sigma) — det(T_N − 4σI) for T_N = tridiag(−1, 2, −1) of size n: pₖ = (2 − 4σ)pₖ₋₁ − pₖ₋₂, p₀ = 1, p₋₁ = 0. - (T, T) discreteBoxIdentity(KeplerArith f, int n, T sigma) — Both sides of det(T − 4σI)²·4σ(1 − σ) = S_{N+1}(4σ(1 − σ)) at sigma. - List discreteBoxEigenvalues(KeplerArith f, int n, T sigma1) — The discrete box's eigenvalues of T, 4·Sₖ(σ₁) for k = 1 … N, from its smallest spread σ₁ = sin²(π/(2(N + 1))) (irrational in general, so the classic side supplies it; the spread polynomials do the rest). - double boxSampleX(int num, int den) — X/L of the rational sample with tan(πx/2L) = num/den (den 0: the right wall). - double boxInstantAngle(int quarter, double tau) — E₁t of the clock instant (−i)^q·C(τ): qπ/2 + 2·atan τ. - double discreteBoxSigma1(int n) — The discrete box's smallest spread σ₁ = sin²(π/(2(N + 1))) (irrational for most N; the spread polynomials take it from here). - double classicBoxDensity(List re, List im, double x, double phase) — The textbook: L|ψ(x, t)|² for ψ = Σ cₙ √2 sin(nπx) e^{−in²E₁t} / √(Σ|cₙ|²), at x/L = x, E₁t = phase. re, im: cₙ (index n − 1). - double classicStationaryDensity(int n, double x) — The textbook stationary density 2 sin²(nπx/L) (times L). - double classicLeftHalf(List re, List im, double phase) — The textbook probability in the left half: 1/2 + (1/π)Σ_{n≠m} Re(cₙ c̄ₘ e^{−i(n²−m²)E₁t}) Iₙₘ, the integral done with cos (as one does). - double bigRatio(BigInt a, BigInt b) — A/b as a double for integers of any size (shifts both to 64 bits; the platform edge, for drawing). - BigInt binomial(int n, int k) — The binomial coefficient C(n, k). - List boxPacket({required int centre, required int spread, required int p, required int q, bool leftward = false}) — A wave packet with integer coefficients: binomial weights C(K, n − n₀ + K/2) around state centre (spread = K, even), times e^{∓inθ₀} for a packet at θ₀ = πx₀/L, tan(θ₀/2) = p/q (moving right, or left when leftward): gₙ… - (List, BigInt) phaseCoefficients(List g, int top, int quarter, int a, int b) — Gₙ = gₙ·z₁^{n²}·h^{N²}, z₁ = (−i)^q (B − iA)²/h, h = A² + B² (τ = A/B in lowest terms), so every Gₙ is a Gaussian integer over the one denominator h^{N²} (returned second). - List spreadNumerators(int a, int d, int upTo) — Spread-polynomial numerators: with σ = a/d, Sₖ(σ) = Pₖ/dᵏ where P₀ = 0, P₁ = a and Pₖ₊₁ = 2(d − 2a)Pₖ − d²Pₖ₋₁ + 2a·dᵏ (the spread recurrence times dᵏ⁺¹: integers, no division). - List gridPacket({required int n, required int centre, required int halfWidth, required int p, required int q}) — A grid wave packet in Gaussian integers: the bump (w² − d²)² for |d| < w around centre, times the rational phase ((q + ip)²/(q² + p²))^j per site (momentum ≈ 2·atan(p/q)/dx, to the right), over the common denominator… - List classicKrawtchoukProbabilities(int n, double lambdaZ) — Classic Krawtchouk transfer: P_n(z) = C(N, n) sin^{2n}(λz/2) cos^{2(N−n)}(λz/2) (Transcendental). - List> classicPairMap(int n, double lambda, double linewidth) — The classic correlation map: modes from ClassicChain (Jacobi, roots), the same line shape. - int bicgstab(void Function(Float64List x, Float64List y) apply, Float64List b, Float64List x, {double tolerance = 1e-15, int maxIterations = 100}) — Solves M x = b by BiCGSTAB, M given by apply (y = M x); x holds the start and receives the solution. - void valleyHallMass(Honeycomb h, double m, {required int x1, required int y0, required int y1}) — The valley-Hall mass: +m on A and −m on B above a Z-shaped wall, the opposite below. - void kekuleRational(Honeycomb h, KeplerArith f, {required T delta0, required T ell, required T a}) — The Kekulé (Wu–Hu) texture, rational: δt = (2/3)·Re(Δ(R)·ω₃^{k + n₁ − n₂}) with Δ(R) = 2Δ₀ (R − a)·conj(R + a) / (ℓ² + N(R − a) + N(R + a)): a vortex at +a (winding +1) and an antivortex at −a (−1) joined by a "Dirac… - void kekuleClassic(Honeycomb h, {required double delta0, required double ell, required double a}) — The classic Kekulé texture: Δ = Δ₀ tanh(|z − a|/ℓ) tanh(|z + a|/ℓ) e^{i(arg(z − a) − arg(z + a))}, positions in Cartesian form with √3/2, phases by cos and sin (Transcendental, Root). - (double, double) classicValleyPhase(int n1, int n2) — The valley K's phase on cell (n₁, n₂): e^{2πi(n₁ − n₂)/3} (classic: cos and sin). - (double, double) rationalValleyPhase(int n1, int n2) — The rational stand-in: z^{n₁ − n₂} with z = ((1 − τ²) + 2iτ)/(1 + τ²), τ = 7/4, a rational unit complex number whose angle 2·atan(7/4) is within 0.4 % of 2π/3 (the cube roots of unity are not in ℚ(i)). - List symmetricEigenvalues(List> m0) — Dense eigenvalues of a real symmetric matrix by Jacobi rotations (classic, roots): small spectra in tests. - Mat2 cayleyRotor(CxArith c, T ax, T ay, T az) — The Cayley rotor of a = (ax, ay, az). - (Cx, Cx) applyRotor(CxArith c, Mat2 u, (Cx, Cx) s) — U·(α, β). - (T, T, T) blochOf(CxArith c, (Cx, Cx) s) — The Bloch vector (2 Re ᾱβ, 2 Im ᾱβ, |α|² − |β|²). - List classicRotate(List s, double nx, double ny, double nz, double theta) — The classic rotor exp(−iθ n·σ/2) applied to (α, β) given as (re, im) pairs; n need not be unit (normalised by a root). - (double, double) classicMassDirection(double theta) — The classic mass-space direction for a gate of angle θ: (cos θ/2, sin θ/2) (Transcendental). - List> rationalPacket(CxArith c, {required int n, required int center, required int halfWidth, required T tau}) — A wave packet with no transcendental function: a rational bump (1 − ((x − x0)/w)²)² inside |x − x0| < w, times the rational phase ((1 + iτ)/(1 − iτ))^j along the grid (momentum per step ≈ 2·atan τ / dx), instead of… - (List, List) betaEnsembleSample(int n, int beta, ClickSource rng) — One sample of the tridiagonal Gaussian β-ensemble (β = 1 orthogonal, 2 unitary) of size n: (diagonal, hopping quadrances). - double irwinHallNormal(ClickSource rng) — A normal sample with no transcendental function: twelve uniforms k/2³² summed, less six (Irwin–Hall). - double boxMullerNormal(ClickSource rng) — A normal sample by Box–Muller (Transcendental, Root). - (double, double, double, double) tfdQuadratures(double k, double g1, double g2, double g3, double g4) — A sample of the TFD's quadratures (x_L, p_L, x_R, p_R) from four normals, with no root: rational coefficients k/2 and 1/(2k). - int geometricSample(double q, double u) — The number n both sides find, from one uniform: the least n with 1 − q^{n+1} > u (only + − × and a comparison). - List isingRingCoefficients(int n) — Z_N(x) = (x + 1)^N + (x − 1)^N for an Ising ring of n spins with Boltzmann weight x per aligned bond, as polynomial coefficients c_j (Z = Σ c_j x^j): 2·C(N, j) for N − j even, 0 otherwise. - double classicIsingZ(int n, double k) — The classic Ising ring, Z = (2 cosh K)^N + (2 sinh K)^N (Transcendental). - final boxCheckPrimes — The three largest primes below 2⁶¹ (2⁶¹ − 1, 2⁶¹ − 31, 2⁶¹ − 45; Miller–Rabin with the first twelve prime bases, deterministic below 3·10²⁴), for the modular checks. - final class Line — A line through the origin in the plane, by a direction (dx, dy) (any nonzero multiple is the same line). - Line: const Line(this.dx, this.dy) - Line: final T dx - Line: final T dy - final class SpreadBell — Polarisation-entangled photon pairs, measured by two polarisers: everything from spreads. - SpreadBell: const SpreadBell(this.f) - SpreadBell: final KeplerArith f - SpreadBell: (T, T, T, T) probabilities(Line a, Line b) — (P(++), P(+−), P(−+), P(−−)) for polariser lines a and b. - SpreadBell: T correlation(Line a, Line b) — E(a, b) = P(same) − P(different) = 1 − 2s. - SpreadBell: T chsh(Line a, Line a2, Line b, Line b2) — The CHSH sum E(a, b) − E(a, b′) + E(a′, b) + E(a′, b′). - SpreadBell: (Line, Line, Line, Line) tsirelsonLines(T t) — The Tsirelson setting approached with the rational slope t ≈ √2 − 1: a at 0°, a′ at 45°, b at slope t, b′ = b turned by 45° (direction (1 − t, 1 + t)). - SpreadBell: T pellSlope(int k) — The k-th Pell convergent of √2 − 1: 1/2, 2/5, 5/12, 12/29, 29/70, … (p_{k+1} = q_k, q_{k+1} = 2q_k + p_k). - SpreadBell: (T, T, T) spherePoint(T u, T v) — The rational point of the unit sphere over (u, v): (2u, 2v, u² + v² − 1)/(1 + u² + v²). - SpreadBell: T singletCorrelation((T, T, T) a, (T, T, T) b) — The singlet correlation −a·b for unit axes a, b. - SpreadBell: int hiddenOutcome(Line polariser, Line hidden) — A local-hidden-variable model, for comparison: each pair carries a hidden line ℓ; each side reports + when its polariser's spread to ℓ is below ½. - final class ClickSource — A small deterministic generator of rational uniforms k/2³² (xorshift32): detector clicks for both ways, the same stream, so the two ways can be compared click for click. - ClickSource: ClickSource([int seed = 0x2545F491]) - ClickSource: int nextBits() — The next 32-bit value. - ClickSource: double next() — A uniform in [0, 1) as a double (it is k/2³² exactly). - final class BoxSamples — The box's rational sample points: t = tan(πx/2L) = j/m for j = 0 … m (the left half) and their mirrors, so 2m + 1 points from wall to wall with σ = j²/(j² + m²) on the left and 1 − σ on the right. - BoxSamples: const BoxSamples(this.m) - BoxSamples: final int m - BoxSamples: int get length - BoxSamples: (int, bool) at(int i) — Point i (0 = left wall, 2m = right wall) as (j, mirrored): t = j/m, mirrored ones at L − x. - BoxSamples: T halfSpread(KeplerArith f, int i) — Σ = sin²(πx/2L) at point i, exactly. - BoxSamples: (int, int) tangent(int i) — tan(πx/2L) at point i as (numerator, denominator); the right wall is (1, 0). - final class BoxState — A box state Σ cₙ φₙ by its coefficients cₙ (index n − 1), not necessarily normalised: densities are divided by Σ|cₙ|², which time evolution keeps exactly. - BoxState: BoxState(this.c, List> coefficients) - BoxState: final CxArith c - BoxState: final List> coefficients - BoxState: int get top — The highest n present. - BoxState: T get norm2 — Σ|cₙ|² (the probability, before dividing). - BoxState: T get energy — ⟨E⟩/E₁ = Σ n²|cₙ|² / Σ|cₙ|². - BoxState: BoxState at(Cx z1) — The state at the clock instant z₁ = e^{−iE₁t}: cₙ·z₁^{n²}. - BoxState: List<(int, int, T)> pairs() — The pair weights Re(cₙ c̄ₘ) for n ≤ m (n, m from 1), the only thing a density needs. - BoxState: T density(List s, {List<(int, int, T)>? pairs, T? norm}) — L·|ψ|² at the point of half-spread σ given s = S₀(σ) … S_{2·top}(σ): 2 Σₙ,ₘ Re(cₙ c̄ₘ)S_{n+m}(σ) − S_{|n−m|}(σ) / Σ|cₖ|². - BoxState: T leftKappa({List<(int, int, T)>? pairs, T? norm}) — The probability in the left half, P = 1/2 + κ/π: returns κ, exactly. ∫₀^{L/2} 2 sin(nθ) sin(mθ) dx/L = s(n − m)/(n − m) − s(n + m)/(n + m)/π for n ≠ m, with s(k) = sin(kπ/2) ∈ {0, 1, 0, −1}; 1/2 for n = m. - final class BoxClock — The rational clock: instants z₁ = e^{−iE₁t} = (−i)^q·C(τ), τ = 70/169·(2k − J)/J for tick k = 0 … J − 1 of quarter q. - BoxClock: BoxClock({this.ticksPerQuarter = 96}) - BoxClock: static const reachNum = 70 — 70/169: a Pell convergent of √2 − 1 just under tan(π/8), so the charts meet with a sliver of a gap. - BoxClock: static const reachDen = 169 — 70/169: a Pell convergent of √2 − 1 just under tan(π/8), so the charts meet with a sliver of a gap. - BoxClock: final int ticksPerQuarter — J: ticks per quarter period (even, so τ = 0 is a tick). - BoxClock: int quarter — Quarter periods since t = 0 (any integer) and the tick in the current one. - BoxClock: int tick — Quarter periods since t = 0 (any integer) and the tick in the current one. - BoxClock: (int, int) get tau — Τ of this instant as (numerator, denominator), lowest terms not required. - BoxClock: bool get onRevival — At a revival (z₁ = 1), a mirror revival (z₁ = −1) or a quarter revival (z₁ = ∓i). - BoxClock: int get periods — Whole revival periods since t = 0 (floor) and the quarter within it. - BoxClock: void reset() - BoxClock: void advance([int n = 1]) — One tick forward. - BoxClock: T tauIn(KeplerArith f) - BoxClock: Cx z(CxArith c) — Z₁ = e^{−iE₁t} at this instant, exactly. - final class CayleyBoxStepper — A box state stepped by a fixed rational phase per step: cₙ ← cₙ·w^{n²}, w = C(τ). - CayleyBoxStepper: CayleyBoxStepper(this.c, List> coefficients, {required T tau}) - CayleyBoxStepper: final CxArith c - CayleyBoxStepper: int steps - CayleyBoxStepper: List> get coefficients - CayleyBoxStepper: BoxState get state - CayleyBoxStepper: void step() - final class FloatBoxStepper — Coefficients stepped in f64 by e^{−iEₙΔt} (cos and sin once, then a complex multiply per step): the usual float time-stepper. |e^{−iEₙΔt}|² is 1 only to rounding, so the norm and ⟨E⟩ walk away as the steps add up. - FloatBoxStepper: FloatBoxStepper(List re, List im, {required double e1dt}) - FloatBoxStepper: final Float64List re - FloatBoxStepper: final Float64List im - FloatBoxStepper: int steps - FloatBoxStepper: double get norm2 - FloatBoxStepper: double get energySum — Σ n²|cₙ|² (not divided: the drift of the norm shows in it too). - FloatBoxStepper: void step([int k = 1]) - final class GInt — A Gaussian integer a + bi. - GInt: const GInt(this.re, this.im) - GInt: GInt.of(int re, [int im = 0]) - GInt: static final zero - GInt: static final one - GInt: final BigInt re - GInt: final BigInt im - GInt: GInt get conj - GInt: BigInt get norm2 - GInt: bool get isZero - GInt: int get hashCode - GInt: GInt scale(BigInt k) - GInt: GInt timesMinusIPow(int k) — (−i)^k · this. - GInt: GInt pow(int k) - GInt: String toString() - GInt: GInt operator +(GInt o) - GInt: GInt operator -(GInt o) - GInt: GInt operator *(GInt o) - GInt: bool operator ==(Object other) - final class ExactBoxWave — Ψ = Σ gₙ φₙ evolved exactly on the box's rational samples t = j/m and their mirrors (2m + 1 points). - ExactBoxWave: ExactBoxWave(List g, {required this.m}) - ExactBoxWave: static bool sameDensities((List, BigInt) x, (List, BigInt) y) — Whether two instants (numerators of each) have the same density at every sample, exactly: |num|² over h² compared by cross-multiplying, no division. - ExactBoxWave: final List g — The coefficients (index n − 1) and the samples per half. - ExactBoxWave: final int m - ExactBoxWave: late final int top - ExactBoxWave: late final BigInt norm2 — Σ|gₙ|²: the probability before dividing, kept exactly by every instant. - ExactBoxWave: int get length - ExactBoxWave: Rational get energy — ⟨E⟩/E₁ = Σ n²|gₙ|² / Σ|gₙ|², exactly (no time in it). - ExactBoxWave: (List, BigInt) numerators(int quarter, int a, int b) — The exact numerators at every sample (left wall to right wall) and the shared time denominator h^{N²}. - ExactBoxWave: Float64List densities(int quarter, int a, int b) — L|ψ|² at every sample, as doubles to draw (the numbers are exact until this division). - ExactBoxWave: Rational density(int i, int quarter, int a, int b) — L|ψ|² at sample i, exactly. - ExactBoxWave: List exactDensities(int quarter, int a, int b) — Every L|ψ|², exactly (tests and the revival check). - ExactBoxWave: int bitsAt(int a, int b) — The size of the numbers an instant takes (bits of the time denominator h^{N²}). - final class SpreadBoxWave — The spread-polynomial density of BoxState in integers, for every sample, at every clock instant: L|ψ|² = 2 Σₙ≤ₘ (2 − δₙₘ) Re(Gₙ Ḡₘ)S_{n+m}(σ) − S_{m−n}(σ) / (h^{2N²} Σ|gₖ|²), each S over d^{2N}. - SpreadBoxWave: SpreadBoxWave(List g, {required this.m}) - SpreadBoxWave: final List g - SpreadBoxWave: final int m - SpreadBoxWave: late final int top - SpreadBoxWave: late final BigInt norm2 - SpreadBoxWave: int get length - SpreadBoxWave: Float64List densities(int quarter, int a, int b) - SpreadBoxWave: List exactDensities(int quarter, int a, int b) - SpreadBoxWave: int bitsAt(int a, int b, int top) — Bits of the time denominator h^{N²} at τ = a/b for top state top. - SpreadBoxWave: Rational leftKappa(int quarter, int a, int b) — Κ of the left-half probability 1/2 + κ/π, exactly (see BoxState.leftKappa). - final class ExactBoxStepper — Coefficients stepped exactly by w = C(p/q) = (q − ip)²/(q² + p²): state n by w^{n²} each step. - ExactBoxStepper: ExactBoxStepper(List g, {required this.p, required this.q}) - ExactBoxStepper: final List g - ExactBoxStepper: final int p - ExactBoxStepper: final int q - ExactBoxStepper: final BigInt h - ExactBoxStepper: int steps - ExactBoxStepper: int get bits — The bits of the largest numerator now. - ExactBoxStepper: List<(Rational, Rational)> get exact — Cₙ now, exactly. - ExactBoxStepper: (List, List) get doubles — Cₙ now, as doubles (drawing and comparing). - ExactBoxStepper: void step() - ExactBoxStepper: bool verify() - ExactBoxStepper: bool verifyMod(BigInt p) — The same identity modulo the prime p: linear in the size of the numbers, so it can run every frame. - final class ExactCayleyGrid — The discrete box's Cayley (Crank–Nicolson) step in Gaussian integers, fraction-free. - ExactCayleyGrid: ExactCayleyGrid(List psi, {required this.a, required this.b, List? k}) - ExactCayleyGrid: final int n - ExactCayleyGrid: final int a - ExactCayleyGrid: final int b - ExactCayleyGrid: final List k - ExactCayleyGrid: late final GInt det — D = det M₊ and ‖Φ₀‖². - ExactCayleyGrid: late final BigInt norm0 - ExactCayleyGrid: int steps - ExactCayleyGrid: List get phi - ExactCayleyGrid: int get bits — Bits of the largest entry now. - ExactCayleyGrid: void step() - ExactCayleyGrid: bool verify() — ‖Φₖ‖² = |D|^{2k}‖Φ₀‖²: Σ|ψ|² exactly where it started (a check in integers; it costs a squaring). - ExactCayleyGrid: bool verifyMod(BigInt p) — The same identity modulo the prime p (linear in the size of the numbers). - ExactCayleyGrid: Float64List densities() - final class QuadranceChain — A chain known by its hopping quadrances q (length L − 1) and on-site energies a (length L), over T. - QuadranceChain: QuadranceChain(this.f, {required List quadrances, List? onsite}) - QuadranceChain: factory QuadranceChain.ssh(KeplerArith f, {required int cells, required T v2, required T w2, int? wallAt, bool extraSite = false}) — The SSH chain with cells cells (2·cells sites, or one more with extraSite): intra-cell hopping quadrance v2 and inter-cell w2. - QuadranceChain: factory QuadranceChain.krawtchouk(KeplerArith f, {required int n, required T lambda}) — The Krawtchouk (Kravchuk) chain of N + 1 sites: q_n = (λ/2)²(n + 1)(N − n), the hoppings of the spin-N/2 operator λJ_x. - QuadranceChain: factory QuadranceChain.towardDimers(KeplerArith f, {required int n, required T lambda, required T dimer, required T s}) — The chain on the way from Krawtchouk (s = 0) to isolated dimers (s = 1): the quadrances move linearly, q(s) = (1 − s)q_K + s·q_D, with the dimer bonds (2k, 2k + 1) at dimer and the others 0. - QuadranceChain: final KeplerArith f - QuadranceChain: final List q - QuadranceChain: final List a - QuadranceChain: int get length - QuadranceChain: late final List weights — w_n = s_n² = Π_{k apply(List phi) — H'φ (real). - QuadranceChain: List probabilities(CxArith c, List> phi) - QuadranceChain: T norm2(CxArith c, List> phi) — Σ w_n |φ_n|²: the probability, conserved exactly by cayleyStep. - QuadranceChain: List> unitAt(CxArith c, int site) — A photon on one site: φ = e_site (ψ = s_site·e_site, weight w_site, so read it with normalized). - QuadranceChain: List normalized(CxArith c, List> phi) — Weighted norm. - QuadranceChain: List> cayleyStep(CxArith c, List> phi, T dt) — One Cayley (Crank–Nicolson) step of length dt: (I + i(dt/2)H')φ' = (I − i(dt/2)H')φ, by the Thomas algorithm. - QuadranceChain: int countBelow(T x) — The number of eigenvalues below x, by the Sturm sequence of the leading minors (only + − × ÷ and signs). - QuadranceChain: (T, T) eigenvalueBracket(int k, {int iterations = 60}) — The k-th eigenvalue (ascending, 0-based) pinned to an interval by iterations bisections, in T. - QuadranceChain: List eigenvalues({int iterations = 60}) — All eigenvalues (ascending) by Sturm bisection, as doubles. - QuadranceChain: List eigenvector(T e) — The eigenvector of H' for the exact eigenvalue e, by the recursion φ_{n+1} = ((e − a_n)φ_n − lower φ_{n−1})/q_n from φ_0 = 1 (needs every q_n ≠ 0). - QuadranceChain: List zeroMode() — The zero mode of a bipartite chain (a = 0) with an odd number of sites: φ_{2k+2} = −φ_{2k}/q_{2k+1}, odd sites 0. - QuadranceChain: T realNorm2(List phi) — Σ w_n φ_n² of a real vector in the rational basis (its squared norm). - QuadranceChain: List partner(List phi) — The chiral partner Γφ (the sign flips on odd sites): an eigenvector for −E when φ is one for E (a = 0). - final class KrawtchoukTransfer — Krawtchouk perfect state transfer in closed form: light put into site 0 of the (N + 1)-site Krawtchouk chain. - KrawtchoukTransfer: const KrawtchoukTransfer(this.f, this.n) - KrawtchoukTransfer: final KeplerArith f - KrawtchoukTransfer: final int n - KrawtchoukTransfer: T spread(T t) — The rotor's spread at the half-tangent t: 4t²/(1 + t²)². - KrawtchoukTransfer: List probabilities(T s) — P_n for every site at spread s: C(N, k) s^k (1 − s)^{N−k}. - final class ClassicChain — The classic counterpart: the chain with hoppings J_n = √q_n, diagonalised by Jacobi rotations (a root per rotation), evolved by e^{−iEt} = cos Et − i sin Et (badges Transcendental, Root). - ClassicChain: ClassicChain(List quadrances, {List? onsite}) - ClassicChain: final int n - ClassicChain: final List hop - ClassicChain: final List onsite - ClassicChain: late List energies — Eigenvalues (ascending) and eigenvectors (columns of vectors, vectorsk = component i of mode k). - ClassicChain: late List> vectors - ClassicChain: List<(double, double)> evolve(List psi0, double t) — Ψ(t) = V e^{−iΛt} Vᵀ ψ(0) for a real start psi0; returns (re, im) per site. - final class Cx — A + bi over T. - Cx: const Cx(this.re, this.im) - Cx: final T re - Cx: final T im - final class CxArith — Arithmetic on Cx built from a KeplerArith (no roots, no transcendental functions). - CxArith: const CxArith(this.f) - CxArith: final KeplerArith f - CxArith: Cx get zero - CxArith: Cx get one - CxArith: Cx of(T re, [T? im]) - CxArith: Cx add(Cx a, Cx b) - CxArith: Cx sub(Cx a, Cx b) - CxArith: Cx mul(Cx a, Cx b) - CxArith: Cx scale(Cx a, T s) - CxArith: T norm2(Cx a) - CxArith: Cx conj(Cx a) - CxArith: Cx div(Cx a, Cx b) — A / b = a·b̄ / |b|². - CxArith: Cx timesI(Cx a) — I·a. - CxArith: Cx cayleyPhase(T tau) — The rational unit complex number (1 + iτ)/(1 − iτ) = ((1 − τ²) + 2iτ)/(1 + τ²): the Cayley form of e^{iθ}, θ = 2·atan τ, exactly on the unit circle. - final class ChiralPairs — The correlation map of the pairs from a Krawtchouk array of N + 1 waveguides (N even), over T. - ChiralPairs: ChiralPairs(this.f, {required this.n, required T lambda, required this.linewidth}) - ChiralPairs: final KeplerArith f - ChiralPairs: final int n - ChiralPairs: final T lambda - ChiralPairs: final T linewidth — Γ of the line shape. - ChiralPairs: final QuadranceChain chain - ChiralPairs: late final List> modes — Mode k (energy λ(k − N/2)) in the rational basis, and its squared norm Σ w φ². - ChiralPairs: late final List norms2 - ChiralPairs: late final List> map — The correlation map, normalised to sum 1 (rows: signal mode, columns: idler mode). - ChiralPairs: T get schmidtNumber — The Schmidt number of the chiral-partner pairs (the anti-diagonal j = N − i, renormalised): (Σp)²/Σp². - ChiralPairs: T overlap2(int i, int j) — Κ(m, m′)² for modes i, j (indices 0…N): (Σ_n w_n² φ₀² φ_i φ_j)² / (‖0‖⁴ ‖i‖² ‖j‖²). - ChiralPairs: T rate(int i, int j) — The unnormalised pair rate for (i, j): κ² / (1 + (Δ/γ)²), Δ = λ(i + j − N). - final class Eis — X + yω₆ with ω₆ = e^{iπ/3} (ω₆² = ω₆ − 1), over T: the honeycomb's own number field, with no √3. - Eis: const Eis(this.x, this.y) - Eis: final T x - Eis: final T y - final class EisArith - EisArith: const EisArith(this.f) - EisArith: final KeplerArith f - EisArith: Eis add(Eis a, Eis b) - EisArith: Eis sub(Eis a, Eis b) - EisArith: Eis mul(Eis a, Eis b) — (a + bω)(c + dω) = ac − bd + (ad + bc + bd)ω. - EisArith: Eis conj(Eis a) — The conjugate: x + yω̄ = (x + y) − yω. - EisArith: T norm(Eis a) — N(x + yω) = x² + xy + y² (= |·|²). - EisArith: T re(Eis a) — Re(x + yω) = x + y/2. - EisArith: Eis scale(Eis a, T s) - EisArith: Eis omega3(int n) — Ω₃ⁿ = ω₆^{2n}: 1, −1 + ω, −ω. - final class Honeycomb — A honeycomb of l1 × l2 unit cells (cell (n₁, n₂) at R = n₁ + n₂ω₆, sites A = R and B = R + (1 + ω₆)/3), open or a torus. - Honeycomb: Honeycomb(this.l1, this.l2, {this.torus = false}) - Honeycomb: static double norm2(Float64List psi) — Σ |ψ|². - Honeycomb: final int l1 - Honeycomb: final int l2 - Honeycomb: final bool torus - Honeycomb: final bonds — (A site, B site, bond kind 0…2, n₁, n₂). - Honeycomb: late Float64List hop — Hoppings per bond (−t ⋅ these enter H) and on-site energies. - Honeycomb: late Float64List onsite — Hoppings per bond (−t ⋅ these enter H) and on-site energies. - Honeycomb: int get sites - Honeycomb: int siteA(int n1, int n2) - Honeycomb: (int, int, int) cellOf(int site) — (n₁, n₂, sublattice 0/1) of a site. - Honeycomb: (double, double) position(int site) — The site's position for drawing (display: √3/2 for the triangular lattice). - Honeycomb: void apply(Float64List x, Float64List y, {int offset = 0}) — Y = H x for a real vector: H = Σ_bonds −hop (|A⟩⟨B| + |B⟩⟨A|) + Σ onsite. - Honeycomb: int cayleyStep(Float64List psi, double dt, {Float64List? guess}) — One Cayley step of dt on (re | im) stacked: (I + i(dt/2)H)ψ′ = (I − i(dt/2)H)ψ. - Honeycomb: void rk4Step(Float64List psi, double dt) — One RK4 step of iψ̇ = Hψ (classic): ψ̇ = −iHψ, in real form (ȧ, ḃ) = (Hb, −Ha). - Honeycomb: void inGapFilter(Float64List psi, {int power = 120, double e2 = 16}) — Keeps the in-gap part of a state: ψ ← (1 − H²/e2)^power ψ, then normalised. - Honeycomb: List> dense() — The dense matrix (tests and small spectra). - final class PseudospinRing — A ring of n sites carrying a two-component pseudospin; hopping n → n + 1 carries the SU(2) link U_n. - PseudospinRing: factory PseudospinRing.rational(int n, {required bool mobius, double t = 0}) - PseudospinRing: factory PseudospinRing.classic(int n, {required bool mobius}) - PseudospinRing: static double overlap(Float64List a, Float64List b) — Re⟨a|b⟩ / ⟨a|a⟩ for two states. - PseudospinRing: final int n - PseudospinRing: final List<(double, double)> links — (c, s) of each link. - PseudospinRing: (double, double) get holonomy — The holonomy: the product of all links, (c, s) (−1, 0) for Möbius. - PseudospinRing: int get size - PseudospinRing: void apply(Float64List x, int xo, Float64List y, int yo) — Y = H x on one real part (2n values: up/down per site): H = −Σ (U_n |n + 1⟩⟨n| + h.c.). - PseudospinRing: int cayleyStep(Float64List psi, double dt) — One Cayley step (rational way), BiCGSTAB to rounding. - PseudospinRing: void rk4Step(Float64List psi, double dt) — One RK4 step (classic). - PseudospinRing: Float64List packet(int center, int w) — A packet at center, half-width w sites, pseudospin up, moving with k = π/2: the phase iⁿ (exact: powers of i), envelope (1 − d²/w²)². - PseudospinRing: Float64List classicPacket(int center, int w) — The classic packet: the same envelope with the phase e^{iπd/2} by cos and sin. - final class Mat2 — A 2 × 2 complex matrix [m11, m12, m21, m22]. - Mat2: const Mat2(this.m11, this.m12, this.m21, this.m22) - Mat2: final Cx m11 - Mat2: final Cx m12 - Mat2: final Cx m21 - Mat2: final Cx m22 - final class CayleySchrodinger — A wave function on n grid points stepped by the Cayley (Crank-Nicolson) map, over T. - CayleySchrodinger: CayleySchrodinger(this.c, {required List> psi, required List potential, required T dx, required T dt}) - CayleySchrodinger: final CxArith c - CayleySchrodinger: final int n - CayleySchrodinger: int steps - CayleySchrodinger: List> get psi - CayleySchrodinger: T get norm2 — Σ |ψ_j|² (times dx is the probability; the factor is constant, so the sum itself is conserved). - CayleySchrodinger: void step() - final class SplitStepSchrodinger — The classic split-step Fourier method in f64 (a direct O(n²) DFT; fine for the grids a lab draws). - SplitStepSchrodinger: SplitStepSchrodinger({required List<(double, double)> psi, required List potential, required this.dx, required this.dt}) - SplitStepSchrodinger: final int n - SplitStepSchrodinger: final List re - SplitStepSchrodinger: final List im - SplitStepSchrodinger: final List v - SplitStepSchrodinger: final double dx - SplitStepSchrodinger: final double dt - SplitStepSchrodinger: int steps - SplitStepSchrodinger: double get norm2 - SplitStepSchrodinger: void step() - final class FormFactor — The spectral form factor averaged over samples, two ways, built up a sample at a time. - FormFactor: FormFactor({this.n = 24, this.beta = 2, this.steps = 400, this.h = 0.05, int seed = 7}) - FormFactor: final int n - FormFactor: final int beta - FormFactor: final int steps - FormFactor: final double h — The time per step. - FormFactor: int samples - FormFactor: late List sumRational - FormFactor: late List sumClassic - FormFactor: List lastRational — The eigenvalues of the last sample, two ways (for the spectrum strip). - FormFactor: List lastClassic — The eigenvalues of the last sample, two ways (for the spectrum strip). - FormFactor: void addSample() — Adds one sample to both averages. - FormFactor: double rational(int s) — g(t_s) averaged so far. - FormFactor: double classic(int s) - FormFactor: void reset() - final class CayleySpin — A spin-1/2 stepped by the rational Cayley rotor of a field (bx, by, bz), over T. - CayleySpin: CayleySpin(this.c, {required Cx alpha, required Cx beta, required T bx, required T by, required T bz, required T dt}) - CayleySpin: final CxArith c - CayleySpin: int steps - CayleySpin: T get norm2 - CayleySpin: (T, T, T) get bloch — The Bloch vector (2 Re(ᾱβ), 2 Im(ᾱβ), |α|² − |β|²). - CayleySpin: void step() - final class ExpSpin — The classic exponential, U = cos(|b|Δt/2) I − i sin(|b|Δt/2)(b̂·σ), in f64 (Transcendental, Root). - ExpSpin: ExpSpin({required this.ar, required this.ai, required this.br, required this.bi, required double bx, required double by, required double bz, required double dt}) - ExpSpin: double ar - ExpSpin: double ai - ExpSpin: double br - ExpSpin: double bi - ExpSpin: double get norm2 - ExpSpin: (double, double, double) get bloch - ExpSpin: void step() - final class RationalTfd — The thermofield double with e^r = k, rational. - RationalTfd: const RationalTfd(this.f, this.k) - RationalTfd: final KeplerArith f - RationalTfd: final T k - RationalTfd: T get tanhR — Tanh r = (k² − 1)/(k² + 1). - RationalTfd: T get q — The Boltzmann factor q = e^{−βω} = tanh² r. - RationalTfd: T get cosh2r — Cosh 2r = (k² + k⁻²)/2 and sinh 2r = (k² − k⁻²)/2. - RationalTfd: T get sinh2r - RationalTfd: T thermal(int n) — p_n = (1 − q)qⁿ. - RationalTfd: T covariance(T c, T s, {required bool bothForward}) — Cov(x_L(t), x_R(t)) with both clocks run by the rotor (c, s): (c² − s²)·sinh 2r / 2; with the left clock run backwards (H_R − H_L, the boost) it is (c² + s²)·sinh 2r / 2, unchanged. - final class ClassicTfd — The classic TFD at inverse temperature beta (ω = 1): q = e^{−β}, r = atanh √q (Transcendental, Root). - ClassicTfd: ClassicTfd(this.beta) - ClassicTfd: static (double, double) clock(double t) — The quadrature rotation by angle t: (cos t, sin t). - ClassicTfd: final double beta - ClassicTfd: final double q - ClassicTfd: late final double r - ClassicTfd: double get cosh2r - ClassicTfd: double get sinh2r - ClassicTfd: double thermal(int n) - ClassicTfd: double covariance(double t, {required bool bothForward}) — Cov(x_L(t), x_R(t)): cos 2t · sinh 2r / 2 with both clocks forward, sinh 2r / 2 under the boost. - ClassicTfd: (double, double, double, double) quadratures(double g1, double g2, double g3, double g4) — (x_L, p_L, x_R, p_R) from four normals: e^{±r} by exp. - final class ColemanEnsemble — Coleman's ensemble, rational: two universes (Ising rings of n1 and n2 spins) sharing one random weight x, uniform on x0 − a, x0 + a. - ColemanEnsemble: const ColemanEnsemble(this.f, {required this.n1, required this.n2, required this.x0, required this.a}) - ColemanEnsemble: final KeplerArith f - ColemanEnsemble: final int n1 - ColemanEnsemble: final int n2 - ColemanEnsemble: final T x0 - ColemanEnsemble: final T a - ColemanEnsemble: T moment(int k) — ⟨x^k⟩ for the uniform measure (x₀ when a = 0). - ColemanEnsemble: T z(int n, T x) - ColemanEnsemble: T mean(int n) - ColemanEnsemble: T meanProduct() — ⟨Z₁ Z₂⟩ exactly: the product's coefficients against the moments. - ColemanEnsemble: T connected() — The wormhole: ⟨Z₁Z₂⟩ − ⟨Z₁⟩⟨Z₂⟩ (zero when a = 0: one fixed coupling, everything factorises). ### Relativity (riptide_rational_relativity) import 'package:riptide_rational_relativity/riptide_rational_relativity.ray'; Special relativity as red geometry with exact velocity composition, and light and orbits around a black hole traced with only + − × ÷. https://riptidecompute.com/raya/docs/rational-relativity - T bump(KeplerArith f, T x, T w) — The rational bump (1 − (x/w)²)² inside |x| < w, else 0. - T bernoulliDepth(KeplerArith f, {required T q2, required T e0, required T b, required T start, int iterations = 40}) — The same cubic by Newton's iteration (+ − × ÷ only), from a start on the wanted branch: above the critical depth for subcritical, below it for supercritical. - (double, double) vortexVelocityRational(double a, double b, double x, double y) — The draining-bathtub vortex, rational: v = (−Ax − By, −Ay + Bx)/(x² + y²). - (double, double) vortexVelocityClassic(double a, double b, double x, double y) — The same flow, classic: polar r = √(x² + y²), θ = atan2(y, x), v_r = −A/r, v_θ = B/r (Transcendental, Root). - double classicDrive(double omega, double t) — The classic wave maker's drive, sin ωt (Transcendental). - double classicFroude(double q, double h) — The classic horizon test: F = v/√(gh) against 1 (Root). - List solveDense(KeplerArith f, List> m, List b) — Solves M x = b by Gaussian elimination with pivoting on the largest |entry| (+ − × ÷ only; exact over ℚ). - (double, double) classicAzimuth(int m, double theta) — The classic way's angular factor e^{imθ} at angle θ: (cos mθ, sin mθ) (Transcendental). - (double, double) classicBoost((double, double) event, double v) — A Lorentz boost from the velocity: γ = 1/√(1 − v²) (Root), or from the rapidity: cosh η, sinh η (Transcendental). - T redQuadrance(KeplerArith f, (T, T) event) — The red quadrance (squared interval) of an event, t² − x². - T addVelocities(KeplerArith f, T v, T w) — Einstein's velocity addition, (v + w)/(1 + vw) (also rational). - T compactRational(KeplerArith f, T x) — The Penrose diagram's compactification, rational: x/(1 + |x|). - double compactClassic(double x) — The classic compactification (2/π)·atan x. - (T, T) kruskalRed(KeplerArith f, T rho, T tau) — Kruskal coordinates (X, T) from a red radius ρ and the half-rapidity τ = tanh(t/8M): ρ((1 + τ²), 2τ)/(1 − τ²). - (double, double) kruskalClassic(double m, double t, double r) — Classic Kruskal (X, T) outside the horizon (r > 2M): √(r/2M − 1) e^{r/4M}(cosh, sinh)(t/4M). - double kruskalRho(double m, double r) — The classic red radius ρ(r) = √(r/2M − 1) e^{r/4M}, and r from UV on the singularity side by Newton ((1 − r/2M)e^{r/2M} = UV). - (RayEnd, T?) rightMovingRay(KeplerArith f, T u0, T v0, {T? alpha}) — The fate of a right-moving ray (constant U, V increasing) starting at (u0, v0), and the V where it ends (the singularity at UV = 1) or null if it reaches the right exterior's infinity. - T uncompactRational(KeplerArith f, T p) — The inverse of compactRational: x = P/(1 − |P|). - double uncompactClassic(double p) — The inverse of compactClassic: tan(πP/2). - (double, double) classicCircle(double phi) — A round direction drawn the classic way: (cos φ, sin φ). - double classicTimeSlope(double m, double t) — Constant Schwarzschild time t outside the horizon, classic: the Kruskal ray V/U = −e^{t/2M}. - T rationalTimeSlope(KeplerArith f, T tau) — The same ray, rational: with τ = tanh(t/8M), e^{t/4M} = (1 + τ)/(1 − τ), so V/U = −((1 + τ)/(1 − τ))². - double classicKruskalProduct(double m, double r) — Kruskal's UV on a sphere of radius r, classic: (1 − r/2M) e^{r/2M} (outside: negative). - final class Flume — A flume: depth h(x) = h₀(1 − d·bump(x/w)), flow per width q = F₀·√(g h₀³) set so that the upstream Froude number is froude0 (units g = h₀ = 1, so q = F₀ and c₀ = 1). - Flume: Flume(this.f, {required this.froude0, required this.dip, required this.halfWidth}) - Flume: final KeplerArith f - Flume: final T froude0 - Flume: final T dip - Flume: final T halfWidth - Flume: T depth(T x) - Flume: T velocity(T x) - Flume: T waveSpeed2(T x) — C² = g h. - Flume: T froude2(T x) — F² = q²/(g h³). - Flume: bool supercritical(T x) — Supercritical (F² > 1): inside the analog black hole. - Flume: T bottom(T x) — The bottom that makes this depth: E₀ − h − q²/(2h²), with E₀ = 1 + q²/2 upstream. - Flume: (T, T)? horizons({int iterations = 50}) — The horizons: where F² crosses 1 in (−w, 0) (black: the flow enters supercritical) and (0, w) (white), by bisection on the sign of F² − 1 (rational); null if the flow stays subcritical. - Flume: T redQuadrance(T x, T dt, T dx) — The red quadrance of a displacement (dt, dx) in the acoustic metric at x: (dx − v dt)² − c² dt². - final class ClassicFlume — The classic flume: c = √(gh), F = v/c, and the depth solved forward from an obstacle by Viète's trigonometric root of Bernoulli's cubic h³ + (b − E₀)h² + q²/2 = 0 (Transcendental, Root). - ClassicFlume: const ClassicFlume({required this.q, required this.e0}) - ClassicFlume: final double q - ClassicFlume: final double e0 - ClassicFlume: double waveSpeed(double h) - ClassicFlume: double froude(double h) - ClassicFlume: (double, double)? depths(double b) — The two positive roots (subcritical, supercritical) of h³ + (b − E₀)h² + q²/2 = 0, or null if the bump is too high for the flow (no steady solution). - final class UnruhWave1D — Unruh's wave equation on a 1-D flow: φ at nodes, the momentum p = φ̇ + v ∂φ, Dirichlet ends. v at nodes, c2 at the n + 1 faces (face k between nodes k − 1 and k; faces 0 and n touch the walls). - UnruhWave1D: UnruhWave1D(this.f, {required List v, required List c2, required this.dx}) - UnruhWave1D: final KeplerArith f - UnruhWave1D: final int n - UnruhWave1D: final List v - UnruhWave1D: final List c2 - UnruhWave1D: final T dx - UnruhWave1D: List phi - UnruhWave1D: List p - UnruhWave1D: int steps - UnruhWave1D: T get energy — The discrete energy H (indefinite where the flow is supercritical). - UnruhWave1D: (List, List) rate(List ph, List pp) — (φ̇, ṗ) of a state. - UnruhWave1D: T energyDensity(int i) — The energy at node i: ½p² − p v (Kφ) + ½c²(∂φ)² of the face to its right (the faces 1 … n − 1 are shared this way). - UnruhWave1D: void stepRk4(T dt) — Classic: one RK4 step. - UnruhWave1D: void stepCayley(T dt) — Rational: one Cayley (implicit-midpoint) step, (I − (dt/2)A)z′ = (I + (dt/2)A)z, solved by block Thomas with 2 × 2 blocks (unknowns (φ_i, p_i)). - UnruhWave1D: void absorb(int width, T k) — A damping sponge in the outer width nodes: multiplies φ and p by 1 − k·d² (d the depth into the layer, 0…1); - final class VortexScattering — Superradiant scattering off the draining-bathtub vortex (c = 1): the radial equation of Berti, Cardoso & Lemos, - VortexScattering: const VortexScattering({required this.a, required this.b, required this.m}) - VortexScattering: final double a - VortexScattering: final double b - VortexScattering: final int m - VortexScattering: double get threshold — MΩ_H = mB/A² (rational). - VortexScattering: double reflectionRational(double w, {double delta = 1e-5, double rMax = 160, double step = 0.01}) — Rational: integrate (r, H, G) in r* without ever computing r* (dr/dr* = 1 − A²/r²): start H = 1, G = −iϖ at r = A(1 + δ), stop at rMax; split by derivatives only: |R/I|² = |H + G/(iω)|² / |H − G/(iω)|². - VortexScattering: double tortoise(double r) — The tortoise coordinate r* = r + (A/2) ln((r − A)/(r + A)) (Transcendental). - VortexScattering: double radiusOf(double rs, double guess) — R from r* by Newton's iteration on tortoise. - VortexScattering: double reflectionClassic(double w, {double delta = 1e-5, double rMax = 160, double step = 0.01}) — Classic: RK4 in r* with r recovered from the logarithmic tortoise relation, the horizon wave e^{−iϖr*} and the far split by e^{±iωr*} (cos, sin). - final class VortexWave2D — Unruh's equation on a 2-D flow (the bathtub vortex), on an n × n grid over −L, L², c = 1: - VortexWave2D: VortexWave2D({required this.n, required this.halfSize, required this.a, required this.b, required bool rational}) - VortexWave2D: static const int band = 10 - VortexWave2D: final int n - VortexWave2D: final double halfSize - VortexWave2D: final double h - VortexWave2D: final double a - VortexWave2D: final double b - VortexWave2D: final Float64List phi - VortexWave2D: final Float64List p - VortexWave2D: final Float64List vx - VortexWave2D: final Float64List vy - VortexWave2D: final Float64List damp - VortexWave2D: late final double dt - VortexWave2D: double time - VortexWave2D: double get horizonQuadrance — The horizon (Q = A²) and the ergoregion (Q = A² + B²) as quadrances. - VortexWave2D: double get ergoQuadrance - VortexWave2D: bool closed — A closed tank: no sponges, no drain absorption and no wave maker, so the waves keep their energy (the Cayley step keeps energy to rounding; RK4 lets it drift). - VortexWave2D: int lastIterations — BiCGSTAB iterations the last stepCayley took. - VortexWave2D: double get energy — The discrete energy H = Σ ½p² − p v·Gφ + ½ Σ_edges (Δφ/h)² (per cell area; the boundary ring is held at 0). - VortexWave2D: double xOf(int i) - VortexWave2D: void step(double drive) — One RK4 step (the classic way); then the source and the sponges (_after). - VortexWave2D: void stepCayley(double drive, {double tolerance = 1e-15, int maxIterations = 80}) — One Cayley (Crank–Nicolson, implicit-midpoint) step, the rational way: (I − (dt/2)A) z′ = (I + (dt/2)A) z, only + − × ÷. - VortexWave2D: void bump(double x0, double y0, double w, double height) — Puts a still polynomial bump (1 − d²/w²)² of height at (x0, y0) (radius w). - final class VortexWave2DExact — The same 2-D scheme over any KeplerArith (ℚ for the proof), on an n × n grid whose boundary ring is held at 0, with the flow given node by node. stepCayley solves (I − (dt/2)A) z′ = (I + (dt/2)A) z by Gaussian… - VortexWave2DExact: VortexWave2DExact(this.f, {required this.n, required this.h, required this.dt, required this.vx, required this.vy}) - VortexWave2DExact: final KeplerArith f - VortexWave2DExact: final int n - VortexWave2DExact: final T h - VortexWave2DExact: final T dt - VortexWave2DExact: final List vx - VortexWave2DExact: final List vy - VortexWave2DExact: List phi - VortexWave2DExact: List p - VortexWave2DExact: T get energy - VortexWave2DExact: (List, List) rate(List ph, List pp) - VortexWave2DExact: void stepCayley() - final class Cz — A + bi over T (this package's own, so it needs nothing beyond + − × ÷). - Cz: const Cz(this.re, this.im) - Cz: final T re - Cz: final T im - final class VortexBomb — The black-hole bomb (Weinfurtner 44:10–50:35): one azimuthal mode e^{imθ} of waves on the draining bathtub vortex (c = 1, v_r = −A/r, Ω = B/r²), between the drain and a MIRROR at r = R. - VortexBomb: VortexBomb(this.f, {required this.n, required this.r0, required this.mirror, required this.a, required this.b0, required this.m, required this.dt}) - VortexBomb: final KeplerArith f - VortexBomb: final int n - VortexBomb: final int m - VortexBomb: final T r0 - VortexBomb: final T mirror - VortexBomb: final T a - VortexBomb: final T b0 - VortexBomb: final T dt - VortexBomb: final T dr - VortexBomb: T b — The circulation now (B₀ until the back-reaction lowers it). - VortexBomb: T? backReaction — Β of the spin-down model (0: off). - VortexBomb: bool drain — Absorb inside the horizon (the drain). - VortexBomb: bool mirrorOn — The mirror at r = R reflects (true); false: the outer fifth absorbs instead, so waves leave and nothing builds. - VortexBomb: List> psi - VortexBomb: List> pi - VortexBomb: int steps - VortexBomb: T get energy — The discrete energy H (above). - VortexBomb: T get size — Σ r_j |ψ_j|²: the mode's size. - VortexBomb: T r(int j) - VortexBomb: T rFace(int j) - VortexBomb: (List>, List>, List>) blocks(int j) — The 2 × 2 complex blocks of A for row j: (lower = column j − 1, diagonal, upper = column j + 1), each ψψ, ψπ, πψ, ππ. - VortexBomb: (List>, List>) rate(List> ps, List> pp) — (ψ̇, π̇). - VortexBomb: void stepCayley() — One Cayley step (rational): (I − (dt/2)A) z′ = (I + (dt/2)A) z by block Thomas over ℚ(i). - VortexBomb: void stepRk4() — One RK4 step (classic). - VortexBomb: void seed(T at, T w, T height) — A small co-rotating bump at at (a polynomial (1 − d²/w²)², real). - final class ClassicSchwarzschildOrbit — The Binet equation u'' + u = K + 3Mu² by RK4 in the angle φ, positions from cos φ and sin φ (Transcendental). - ClassicSchwarzschildOrbit: ClassicSchwarzschildOrbit({required this.m, required this.u, required this.v, required this.k, required this.dphi}) - ClassicSchwarzschildOrbit: factory ClassicSchwarzschildOrbit.light({required double m, required double b, required double dphi}) — Light from infinity with impact parameter b. - ClassicSchwarzschildOrbit: final double m - ClassicSchwarzschildOrbit: final double k - ClassicSchwarzschildOrbit: final double dphi - ClassicSchwarzschildOrbit: double u - ClassicSchwarzschildOrbit: double v - ClassicSchwarzschildOrbit: double phi - ClassicSchwarzschildOrbit: int steps - ClassicSchwarzschildOrbit: (double, double) get position - ClassicSchwarzschildOrbit: double get firstIntegral - ClassicSchwarzschildOrbit: void step() - final class RedBoost — A Lorentz boost with rational half-rapidity parameter t (|t| < 1), over T. - RedBoost: RedBoost(this.f, this.t) - RedBoost: final KeplerArith f - RedBoost: final T t - RedBoost: T get gamma — Γ = (1 + t²)/(1 − t²). - RedBoost: T get velocity — The velocity, v = 2t/(1 + t²) (a fraction of c). - RedBoost: T get gammaVelocity — Γv = 2t/(1 − t²). - RedBoost: (T, T) apply((T, T) event) — The boosted event: (t', x') = (γ t + γv x, γv t + γ x). - RedBoost: RedBoost then(RedBoost o) — This boost followed by o: the half-parameters compose as (t₁ + t₂)/(1 + t₁t₂). - enum RayFate — What happened to a traced ray. - RayFate: captured - RayFate: escaped - RayFate: stillGoing - final class RationalSchwarzschildOrbit — A light ray (or orbit) around a Schwarzschild black hole of mass m, traced rationally over T. - RationalSchwarzschildOrbit: RationalSchwarzschildOrbit(this.f, {required this.m, required T u0, required T v0, required this.k, required this.tau}) — Starts at u = u0 (1/r), u' = v0, direction (1, 0), with the constant term k (0 for light) and angle parameter tau (each step turns by 2·atan τ). - RationalSchwarzschildOrbit: factory RationalSchwarzschildOrbit.light(KeplerArith f, {required T m, required T b, required T tau}) — Light coming in from infinity with impact parameter b (u = 0, u' = 1/b). - RationalSchwarzschildOrbit: final KeplerArith f - RationalSchwarzschildOrbit: final T m - RationalSchwarzschildOrbit: final T k - RationalSchwarzschildOrbit: final T tau - RationalSchwarzschildOrbit: int steps - RationalSchwarzschildOrbit: T get u — U = 1/r. - RationalSchwarzschildOrbit: T get v — U' = du/dφ. - RationalSchwarzschildOrbit: (T, T) get direction — The direction from the hole, (cos φ, sin φ) as a rational unit vector. - RationalSchwarzschildOrbit: (T, T) get position — The position r·(direction) = direction / u. - RationalSchwarzschildOrbit: T get firstIntegral — The first integral (u')² + u² − 2Ku − 2Mu³ (1/b² for light): conserved by the true motion. - RationalSchwarzschildOrbit: void step() - RationalSchwarzschildOrbit: RayFate trace({int maxSteps = 1000000}) — Traces until the ray falls through the horizon (u ≥ 1/(2M)), escapes (u ≤ 0 again after moving in), or maxSteps run out. - final class EinsteinRosen — The Einstein–Rosen bridge of mass m, rational. - EinsteinRosen: const EinsteinRosen(this.f, this.m) - EinsteinRosen: final KeplerArith f - EinsteinRosen: final T m - EinsteinRosen: T radius(T u) — R = 2M + u². - EinsteinRosen: T radialMetric(T u) — g_uu = 4(2M + u²). - EinsteinRosen: T embeddingHeight2(T u) — Flamm's height squared, z² = 8M u². - EinsteinRosen: T throatRadius(T p) — The throat's radius at the half-tangent clock p: 2M/(1 + p²). - EinsteinRosen: (T, T) circle(T s) — The rational circle point ((1 − s²), 2s)/(1 + s²) (the sheets' round direction). - final class ClassicEinsteinRosen — The classic counterparts (Transcendental, Root). - ClassicEinsteinRosen: const ClassicEinsteinRosen(this.m) - ClassicEinsteinRosen: final double m - ClassicEinsteinRosen: double properDistance(double u) — Proper radial distance from the throat to u: u√(2M + u²) + 2M asinh(u/√(2M)). - ClassicEinsteinRosen: double embeddingHeight(double r) — Flamm's paraboloid z(r) = √(8M(r − 2M)). - ClassicEinsteinRosen: (double, double) throat(double eta) — The throat on the cycloid: (r, τ) at the cycloid angle η. - enum RayEnd — Where a light ray from (u0, v0) in Kruskal null coordinates ends: it keeps U (moving to larger V). - RayEnd: singularity - RayEnd: rightExterior - RayEnd: leftExterior - final class TraversableModel — A traversable wormhole (Gao–Jafferis–Wall; Maldacena–Stanford–Yang), beyond Witten's talk. - TraversableModel: const TraversableModel(this.f, {required this.u1, required this.alpha, required this.kappaE}) - TraversableModel: final KeplerArith f - TraversableModel: final T u1 - TraversableModel: final T alpha - TraversableModel: final T kappaE - TraversableModel: T boost(T tau) — W = e^{t_s/4M} from the half-parameter τ: (1 + τ)/(1 − τ). - TraversableModel: T sendU(T w) — U of the signal before the shock. - TraversableModel: T shift(T w) — The shift the signal meets, α − κE·w. - TraversableModel: T afterU(T w) — U after the shock: negative means it comes out on the right. - TraversableModel: bool through(T w) - TraversableModel: T? arrival(T w) — The right boundary's arrival half-parameter τ_R = (u₁ + U′)/(u₁ − U′), or null if it never arrives. - final class ClassicTraversable — The classic counterpart: w = e^{t_s/4M}, arrival time t_R = −4M ln(−U′/u₁), and the window's edges from the roots of e w² − α w + u₁ (Transcendental, Root). - ClassicTraversable: const ClassicTraversable({required this.m, required this.u1, required this.alpha, required this.kappaE}) - ClassicTraversable: final double m - ClassicTraversable: final double u1 - ClassicTraversable: final double alpha - ClassicTraversable: final double kappaE - ClassicTraversable: double boost(double ts) - ClassicTraversable: double afterU(double ts) - ClassicTraversable: double? arrivalTime(double ts) - ClassicTraversable: (double, double)? window() — The send times that get through, (earliest, latest) in t_s, or null if none. ### Conics and quadrics (riptide_conics) import 'package:riptide_conics/riptide_conics.ray'; Conics and quadrics exactly over the rationals: cone sections, Dandelin spheres, foci and directrices. https://riptidecompute.com/raya/docs/conics - double cosh(double x) — Cosh and sinh from exp. - double sinh(double x) - double distance((double, double, double) a, (double, double, double) b) — The Euclidean distance √(Δx² + Δy² + Δz²). - (double, double, double) classicQuadricPoint(QuadricKind kind, double a, double b, double c, double theta, double phi) — A quadric's classic parametrisation by angles (θ round the axis, φ along it): (a cos φ cos θ, b cos φ sin θ, c sin φ) for the ellipsoid, cosh and sinh for the hyperboloids, polar coordinates for the paraboloids and the… - ((double, double, double), (double, double, double)) classicRuling(double a, double b, double c, double phi, int family) — The classic ruling of the hyperboloid of one sheet through the waist point at angle φ: (a cos φ, b sin φ, 0) - double hyperboloidResidual(double a, double b, double c, (double, double, double) p) — The value of x²/a² + y²/b² − z²/c² − 1 in doubles (the one-sheet hyperboloid's residual). - double classicMirrorMiss(double f, double x) — The classic mirror: the tangent's angle θ = atan(x/2f), the reflected ray (−sin 2θ, cos 2θ) in the plane through the axis. - List<(double, double)> classicTangentPoints(List coeffs, (double, double) pole) — The classic tangent points from a pole to the conic A x² + B xy + C y² + D x + E y + F = 0: the polar's meets with the conic by the quadratic formula (a square root). - Rational archimedes(Rational a, Rational b, Rational c) — Archimedes' function A(a, b, c) = (a + b + c)² − 2(a² + b² + c²): zero exactly when √a ± √b ± √c = 0 for some choice of signs (Wildberger's triple quad formula; Heron's formula is its −16 × area² form). - Rational q(int n, [int d = 1]) — The rational n/d. - String exact(Rational r) — "−51/4" with a true minus sign. - int bitsOf(Rational r) — The cost of exactness: the bits of numerator and denominator together. - String shortExact(Rational r, {int most = 18}) — A fraction for a label: the fraction itself when short, else its value and its size in bits. - BigInt integerRoot(BigInt n) — The integer square root of n ≥ 0 by Newton's method on integers (floor of the root). - Rational? rationalRoot(Rational r) — The rational square root of r when r is the square of a rational, else null. - Rational quadrance(QV3 a, QV3 b) — The quadrance between two points. - (double, double) dp(QP2 p) — Points of the plane as doubles (drawing). - String linear(List<(Rational, String)> terms) — "−10/9 x − 1/2 y − 1": a linear form with its signs written once and zero terms left out. - (Rational, Rational) cayley(Rational t) — A turn by a Cayley half-tangent t: cos = (1 − t²)/(1 + t²), sin = 2t/(1 + t²), both rational (no angle). - Rational crossRatio(Rational a, Rational c, Rational b, Rational d) — The cross ratio (a, c; b, d) = ((b − a)(d − c)) / ((d − a)(b − c)) of four points on a line, given by their coordinates along it. - Rational harmonicConjugate(Rational a, Rational b, Rational d) — The harmonic conjugate of a with respect to b and d: the c with (a, c; b, d) = −1. - Rational lineParameter(QV3 base, QV3 u, QV3 x) — A coordinate along the line through base in direction u (the first coordinate the line moves in). - ({Rational quarterDiscriminant, List rational}) tangentPoints(ConicForm conic, QP2 pole) — The points where the tangents from pole touch conic: the polar's meets with the conic. - typedef QP2 = (Rational, Rational) — A point of the plane with rational coordinates. - typedef QLine3 = ({QV3 point, QV3 direction}) — A straight line p + λu on a surface. - enum ClassicKind — The classic kind of a section, read off e = cos β / cos α in doubles: e < 1 ellipse, e = 1 parabola, e > 1 hyperbola (and β = 90° a circle). - ClassicKind: circle - ClassicKind: ellipse - ClassicKind: parabola - ClassicKind: hyperbola - ClassicKind: point - ClassicKind: line - ClassicKind: linePair - final class ClassicSlice — The cone of half-angle alpha cut by a plane at angle beta to the axis, offset from the vertex (radians). - ClassicSlice: ClassicSlice(this.alpha, this.beta, this.offset) - ClassicSlice: factory ClassicSlice.fromSlopes(double mu, double tau, double offset) — From the lab's rational inputs: tan α = μ and the tilt's Cayley half-tangent τ (θ = 2 atan τ). - ClassicSlice: final double alpha - ClassicSlice: final double beta - ClassicSlice: final double offset - ClassicSlice: late final double c - ClassicSlice: late final double s - ClassicSlice: late final double m - ClassicSlice: late final double bigC - ClassicSlice: late final double bigE - ClassicSlice: late final double bigF - ClassicSlice: double get eccentricity — E = cos β / cos α. - ClassicSlice: double get alphaDegrees - ClassicSlice: double get betaDegrees - ClassicSlice: ClassicKind get kind - ClassicSlice: double get v0 — The centre's v and the right side R of u² + C(v − v₀)² = R. - ClassicSlice: double get r - ClassicSlice: (double, double) get semiAxes — Semi-axes (along u and along v) of an ellipse: √R and √(R/C). - ClassicSlice: List<({double z, double radius, double touch, (double, double, double) focus})> get spheres — The Dandelin spheres the classic way: centres z = offset/(cos θ ± sin α) (one sphere for a parabola), radii - ClassicSlice: double residual(double u, double v) — U² + C v² + E v + F in doubles at a point of the plane (zero on the section, up to rounding). - ClassicSlice: List> points(int n, {double reach = 2.2}) — Points of the section in plane coordinates (u, v), from an angle: (a cos φ, v₀ + b sin φ) for an ellipse, cosh and sinh for a hyperbola (both branches), and v = −(u² + F)/E for a parabola. n points a branch. - enum SliceKind — What the plane cuts from the cone. - SliceKind: circle - SliceKind: ellipse - SliceKind: parabola - SliceKind: hyperbola - SliceKind: point — Degenerate (the plane through the vertex): the vertex alone, one generator (the plane touches the cone), or two generators. - SliceKind: line - SliceKind: linePair - SliceKind: bool get degenerate - final class ConeSlice — The right double cone x² + y² = μ² z² (generators of slope μ against the axis: tan α = μ) cut by the plane at distance offset from the vertex, its normal tilted from the axis by the Cayley half-tangent tau (c = (1 −… - ConeSlice: ConeSlice(this.mu, this.tau, this.offset) - ConeSlice: final Rational mu — The generators' slope against the axis (tan α). - ConeSlice: final Rational tau — The tilt's Cayley half-tangent and the plane's distance from the vertex. - ConeSlice: final Rational offset — The tilt's Cayley half-tangent and the plane's distance from the vertex. - ConeSlice: late final Rational c — Cos and sin of the plane's tilt, rational. - ConeSlice: late final Rational s — Cos and sin of the plane's tilt, rational. - ConeSlice: late final PlaneFrame frame - ConeSlice: late final QuadricForm cone - ConeSlice: late final ConicForm conic — The section in the plane's own (isometric) coordinates u, v. - ConeSlice: Rational get spreadGenerator — The spread between a generator and the axis: s_α = μ²/(1 + μ²) (classically sin²α). - ConeSlice: Rational get spreadPlane — The spread between the plane and the axis: s_β = c² (classically sin²β). - ConeSlice: Rational get eccentricitySquared — E² = (1 − s_β)/(1 − s_α) = s²(1 + μ²). - ConeSlice: SliceKind get kind — The kind, from the spreads (and the offset). - ConeSlice: SliceKind get kindFromMatrix — The kind read from the section's matrix instead (det and the 2 × 2 minor): it agrees with kind always (tested). - ConeSlice: QV3 get normal — The plane's unit normal (0, −s, c). - ConeSlice: QV3 get generatorAtInfinity - ConeSlice: ({Rational quarterDiscriminant, List rational}) get asymptoticParameters — The Cayley parameters of the generators parallel to the plane: c t² − 2μs t + c = 0. - ConeSlice: QV3 generator(Rational t) — The generator of the Cayley parameter t: (μ(1 − t²), 2μt, 1 + t²); every rational t gives a rational line of the cone through the vertex, and every rational line of the cone but one (t = ∞: (−μ, 0, 1)) arises so. - ConeSlice: QV3? meet(QV3 g) — Where the generator g meets the plane: offset · g / (n·g), rational. - ConeSlice: QV3? pointAt(Rational? t) — The section's point on generator t (t null: t = ∞). - ConeSlice: QP2? planePointAt(Rational? t) — The same point in the plane's coordinates. - ConeSlice: List<(Rational?, QV3)> rationalPoints({int maxDen = 4, int range = 3}) — Rational points of the section: t = p/den for |p/den| ≤ range, every den up to maxDen, and t = ∞. - ConeSlice: List chordPoints({int maxDen = 3, int range = 3}) — Diophantus' chord method in the plane: from the section's point on generator 0, lines of slope k meet the section again in rational points (k = p/den as above). - final class DandelinSphere — One sphere inscribed in the cone and touching the plane. - DandelinSphere: DandelinSphere({required this.centre, required this.radius, required this.focus, required this.touchHeight}) - DandelinSphere: final QV3 centre — On the axis: (0, 0, z). - DandelinSphere: final Rational radius - DandelinSphere: final QV3 focus — Where it touches the plane: a focus of the section. - DandelinSphere: final Rational touchHeight — The height of the circle where it touches the cone: z cos²α = z/(1 + μ²). - final class DandelinSpheres — The Dandelin spheres of a ConeSlice on a Pythagorean cone: one whose 1 + μ² is a square κ² (μ = 3/4: κ = 5/4, sin α = 3/5, cos α = 4/5). - DandelinSpheres: static DandelinSpheres? of(ConeSlice slice) — The spheres of slice, or null when the cone isn't Pythagorean or the plane passes through the vertex. - DandelinSpheres: final ConeSlice slice - DandelinSpheres: final Rational kappa — √(1 + μ²) = 1/cos α, rational. - DandelinSpheres: final List spheres — Two spheres (ellipse, hyperbola; one for a parabola, the other is at infinity). - DandelinSpheres: Rational get sinAlpha - DandelinSpheres: Rational get cosAlpha - DandelinSpheres: Rational? get focalConstant — The distance along a generator between the two touch circles: d₁ + d₂ (ellipse) or |d₁ − d₂| (hyperbola). - DandelinSpheres: Rational focalDistance(QV3 p, int i) — The distance from the section's point p to focus i, exact: |P_z − h_i|·κ. - DandelinSpheres: QV3 touchPoint(QV3 p, int i) — Where p's generator (the line from the vertex through p) touches sphere i. - DandelinSpheres: Rational? directrixV(int i) — The directrix of sphere i in the plane's coordinates: the line v = (h − c·offset)/s (null for a circle, s = 0). - DandelinSpheres: Rational? focusDirectrixRatio(QV3 p, int i) — Q(P, F_i) / Q(P, directrix_i): equals e² at every point of the section. - final class QV3 — A point or vector of three-dimensional space with rational coordinates. - QV3: QV3(this.x, this.y, this.z) - QV3: factory QV3.ints(int x, int y, int z) - QV3: static final QV3 zero - QV3: final Rational x - QV3: final Rational y - QV3: final Rational z - QV3: Rational get quadrance — The quadrance (squared length): Wildberger's replacement for distance. - QV3: bool get isZero - QV3: (double, double, double) get d — As doubles, for drawing (the boundary). - QV3: List get homogeneous — The homogeneous point x, y, z, 1. - QV3: List get direction — The homogeneous direction x, y, z, 0 (a point at infinity). - QV3: int get hashCode - QV3: QV3 scale(Rational k) - QV3: Rational dot(QV3 o) - QV3: QV3 cross(QV3 o) - QV3: String toString() - QV3: QV3 operator +(QV3 o) - QV3: QV3 operator -(QV3 o) - QV3: QV3 operator -() - QV3: bool operator ==(Object other) - final class QLine — The line a x + b y + c = 0 (homogeneous coordinates a: b: c). - QLine: QLine(this.a, this.b, this.c) - QLine: factory QLine.join(QP2 p, QP2 r) — The line through two distinct points (the cross product of x: y: 1). - QLine: final Rational a - QLine: final Rational b - QLine: final Rational c - QLine: Rational at(QP2 p) — A x + b y + c at p: zero exactly when p lies on the line. - QLine: bool contains(QP2 p) - QLine: QP2? meet(QLine o) — The meet of two lines, or null when they are parallel (they meet at infinity). - QLine: String toString() - final class SymForm — A symmetric n × n matrix over Q: the quadratic form xᵀ M x on homogeneous coordinates. - SymForm: SymForm(List> rows) - SymForm: final List> m - SymForm: int get size - SymForm: Rational get determinant — The determinant (cofactor expansion; sizes up to 4). - SymForm: int get rank — The rank (Gaussian elimination over Q). - SymForm: int get hashCode - SymForm: List apply(List a) — M a. - SymForm: Rational bilinear(List a, List b) — Aᵀ M b (the polar, or bilinear, form). - SymForm: Rational form(List a) — Aᵀ M a. - SymForm: bool operator ==(Object other) - enum ConicKind — What a plane conic is, decided exactly from its matrix. - ConicKind: circle - ConicKind: ellipse - ConicKind: parabola - ConicKind: hyperbola - ConicKind: empty — X² + y² = −1: no real points. - ConicKind: point — Degenerate: a single real point (two conjugate lines). - ConicKind: linePair — Degenerate: two lines crossing. - ConicKind: parallelLines — Degenerate: two parallel lines. - ConicKind: doubleLine — Degenerate: one line counted twice. - ConicKind: bool get degenerate - final class ConicForm — The plane conic A x² + B xy + C y² + D x + E y + F = 0 as the symmetric matrix of x, y, 1. - ConicForm: ConicForm(this.form) - ConicForm: factory ConicForm.coefficients(Rational a, Rational b, Rational c, Rational d, Rational e, Rational f) - ConicForm: final SymForm form - ConicForm: Rational get a - ConicForm: Rational get b - ConicForm: Rational get c - ConicForm: Rational get d - ConicForm: Rational get e - ConicForm: Rational get f - ConicForm: Rational get determinant — Det M (zero: degenerate). - ConicForm: Rational get minor — AC − B²/4: positive for ellipses, zero for parabolas, negative for hyperbolas (−¼ of the discriminant B² − 4AC). - ConicForm: Rational get discriminant — B² − 4AC. - ConicForm: ConicKind get kind — The kind, exactly: the sign of the 2 × 2 minor, whether det M vanishes, and for real ellipses the sign of A·det. - ConicForm: Rational value(QP2 p) — The value at p: zero exactly on the conic. - ConicForm: bool contains(QP2 p) - ConicForm: QLine polar(QP2 p) — The polar of p (Apollonius; the tangent when p is on the conic): the line M p, 1. - ConicForm: QLine polarOfDirection(QP2 u) — The polar of the point at infinity in direction u (a diameter). - ConicForm: QP2? secondMeet(QP2 p, QP2 u) — The second meet of the line through p (on the conic) in direction u, or null for a tangent or asymptotic direction. - ConicForm: QP2? throughPoint(QP2 p, Rational? t) — Diophantus' chord method: from one rational point p, the line of slope t meets the conic again in a rational point (slope null: the vertical line). - ConicForm: bool isPoleOf(QP2 r, QLine line) — Is the point r the pole of line: does M r equal the line up to a scalar? - ConicForm: String toString() - final class QPlane — The plane n·X + k = 0 in space. - QPlane: QPlane(this.n, this.k) - QPlane: final QV3 n - QPlane: final Rational k - QPlane: Rational at(QV3 x) - QPlane: bool contains(QV3 x) - QPlane: Rational? meetParameter(QV3 p, QV3 u) — Where the line p + λu meets the plane (λ), or null when the line is parallel to it. - QPlane: QV3? meet(QV3 p, QV3 u) - final class PlaneFrame — A plane in space with a frame: X = origin + u e1 + v e2. - PlaneFrame: PlaneFrame(this.origin, this.e1, this.e2, {this.orthonormal = false}) - PlaneFrame: factory PlaneFrame.tilted(Rational tau, Rational offset, {Rational? psi}) - PlaneFrame: final QV3 origin - PlaneFrame: final QV3 e1 - PlaneFrame: final QV3 e2 - PlaneFrame: final bool orthonormal — E1, e2 and their normal are unit and perpendicular: plane coordinates are isometric. - PlaneFrame: QV3 get normal — The normal e1 × e2 (a unit vector when orthonormal). - PlaneFrame: QPlane get plane - PlaneFrame: QV3 point(Rational u, Rational v) - PlaneFrame: QP2 coordinates(QV3 x) — The plane coordinates of a point of the plane (orthonormal frames). - final class QuadricForm — A quadric surface as the symmetric 4 × 4 matrix of x, y, z, 1. - QuadricForm: QuadricForm(this.form) - QuadricForm: factory QuadricForm.diagonal(Rational a, Rational b, Rational c, Rational d) — The diagonal quadric a x² + b y² + c z² + d = 0. - QuadricForm: factory QuadricForm.paraboloid(Rational a, Rational b) — A x² + b y² − z = 0 (the paraboloids). - QuadricForm: final SymForm form - QuadricForm: Rational value(QV3 x) - QuadricForm: bool contains(QV3 x) - QuadricForm: QPlane polarPlane(QV3 p) — The polar plane of p (the tangent plane when p is on the surface): M p, 1. - QuadricForm: bool containsLine(QV3 p, QV3 u) — The line p + λu lies on the surface for every λ: f(p) = 0, B(p, u) = 0 and Q(u) = 0, three exact checks. - QuadricForm: QV3? secondMeet(QV3 p, QV3 u) — The second meet of the line through p (on the surface) in direction u: λ = −2B(p, u)/Q(u), rational. - QuadricForm: ConicForm slice(PlaneFrame frame) — The conic in which the plane of frame cuts the surface, in the frame's coordinates (u, v): Fᵀ M F with F's columns e1, 0, e2, 0, origin, 1. - final class ParabolicMirror — The dish z = (x² + y²)/(4f) with focus (0, 0, f). - ParabolicMirror: ParabolicMirror(this.focal) - ParabolicMirror: final Rational focal - ParabolicMirror: QV3 get focus - ParabolicMirror: QV3 hit(Rational x, Rational y) — Where the ray straight down through (x, y) meets the dish. - ParabolicMirror: QV3 normal(QV3 p) — The surface normal there: ∇(x² + y² − 4f z) = (2x, 2y, −4f). - ParabolicMirror: QV3 reflect(QV3 p) — The reflected direction of a ray travelling (0, 0, −1). - ParabolicMirror: bool throughFocus(QV3 p) — The reflected ray passes through the focus: (F − P) × r = 0, exactly. - ParabolicMirror: Rational focusParameter(QV3 p) — How far along r the ray reaches the focus (positive: it heads there). - final class ApolloniusQuadrangle — Apollonius' straightedge construction of the polar of pole from two lines through it (UHG 1 @14:32): the line through the pole and the conic's point α meets the conic again at γ, the line through β again at δ; the two… - ApolloniusQuadrangle: static ApolloniusQuadrangle? of(ConicForm conic, QP2 pole, QP2 alpha, QP2 beta) — Null when a line through the pole is tangent or the quadrangle collapses. - ApolloniusQuadrangle: final ConicForm conic - ApolloniusQuadrangle: final QP2 pole - ApolloniusQuadrangle: final QP2 alpha - ApolloniusQuadrangle: final QP2 beta - ApolloniusQuadrangle: final QP2 gamma - ApolloniusQuadrangle: final QP2 delta - ApolloniusQuadrangle: final QP2? e — The two diagonal points (null when the pair of sides is parallel: they meet at infinity, still on the polar). - ApolloniusQuadrangle: final QP2? f — The two diagonal points (null when the pair of sides is parallel: they meet at infinity, still on the polar). - ApolloniusQuadrangle: QLine get polar - ApolloniusQuadrangle: bool get diagonalsOnPolar — Both diagonal points lie on the polar, exactly (the polar independence theorem). - ApolloniusQuadrangle: QP2? get harmonicPoint — Where the line pole–α meets the polar. - ApolloniusQuadrangle: Rational? get crossRatioOnLine — (pole, C; α, γ) along the line through the pole and α: −1 exactly. - final class SpacePolarity — The pole and polar of a quadric in space, with Apollonius' harmonic range on a line through the pole. - SpacePolarity: SpacePolarity(this.quadric, this.pole) - SpacePolarity: final NamedQuadric quadric - SpacePolarity: final QV3 pole - SpacePolarity: QPlane get plane — The polar plane M·pole, 1: the plane of the contact conic of the tangent cone from the pole. - SpacePolarity: ({QV3 centre, Rational quadrance})? get contactCircle — For an ellipsoid: in the scaled coordinates (x/a, y/b, z/c) it is the unit sphere, the pole P' has quadrance Q' = |P'|², the contact circle's centre is P'/Q' and its quadrance (squared radius) 1 − 1/Q', exact. - SpacePolarity: ({QV3 gamma, QV3 c, Rational crossRatio})? harmonic(QV3 alpha) — The line from the pole through the surface's rational point alpha meets the surface again at γ and the polar plane at C: (pole, C; α, γ) = −1, exactly. - enum QuadricKind — The real, non-degenerate quadric surfaces (and the cone, the degenerate one every conic comes from). - QuadricKind: ellipsoid - QuadricKind: hyperboloidOne - QuadricKind: hyperboloidTwo - QuadricKind: ellipticParaboloid - QuadricKind: hyperbolicParaboloid - QuadricKind: cone - QuadricKind: bool get ruled — Doubly ruled (two families of straight lines) or, for the cone, ruled by its generators. - QuadricKind: String get equation — The equation, in plain notation. - final class NamedQuadric — A quadric of kind with rational semi-axes a, b, c. - NamedQuadric: NamedQuadric(this.kind, this.a, this.b, this.c) - NamedQuadric: final QuadricKind kind - NamedQuadric: final Rational a - NamedQuadric: final Rational b - NamedQuadric: final Rational c - NamedQuadric: late final QuadricForm form - NamedQuadric: QV3 get base — The point every rational point is projected from (for the kinds parametrised by projection). - NamedQuadric: QV3? point(Rational u, Rational v) — The rational point of the parameters (u, v), exact. - NamedQuadric: (double, double, double)? pointD(double u, double v) — The same map in doubles (+ − × ÷ only), for drawing the rational mesh. - NamedQuadric: QLine3 ruling(Rational t, int family) — The ruling of parameter t in family family (+1 or −1), exact. - NamedQuadric: List<(int, Rational, QLine3)> rulings({int den = 4, int range = 2}) — Rulings for t = p/den (|t| ≤ range) in both families, each checked to lie on the surface exactly. - NamedQuadric: ConicForm slice(PlaneFrame frame) — The plane section by frame: a conic, its kind decided exactly. ### Kepler orbits (riptide_kepler) import 'package:riptide_kepler/riptide_kepler.ray'; Kepler orbits turned into a harmonic oscillator and stepped exactly, next to the classic leapfrog and Kepler-equation methods. https://riptidecompute.com/raya/docs/kepler - double solveKeplerEquation(double meanAnomaly, double e, {int iterations = 30}) — Kepler's equation M = E − e sin E solved for E by Newton's method (Transcendental: sin, cos). - double meanAnomalyFromHalfTangent(double u, double e) — Kepler's equation in the half-angle tangent u = tan(E/2): M = 2·atan(u) − 2eu/(1 + u²). - Vec3 cross3(KeplerArith f, Vec3 a, Vec3 b) — X × v. - (Vec3, Vec3) keplerInvariants(KeplerArith f, Vec3 x, Vec3 v, T r, T mu) — Angular momentum x × ẋ and the Laplace-Runge-Lenz vector (ẋ × L)/μ − x/r of a 3-D state. - T spreadBetween(KeplerArith f, (T, T) u, (T, T) v) — Spread between two plane vectors in rational trigonometry: (u ∧ v)² / (Q(u) Q(v)); 0 for parallel, 1 for perpendicular. - typedef Vec3 = (T, T, T) - abstract interface class KeplerArith — − × ÷ on T. - KeplerArith: T fromInt(int n, [int d = 1]) - KeplerArith: T add(T a, T b) - KeplerArith: T sub(T a, T b) - KeplerArith: T mul(T a, T b) - KeplerArith: T div(T a, T b) - KeplerArith: double toDouble(T a) - final class ExactArith implements KeplerArith — Exact: Rational (riptide_precision), lowest terms, arbitrary size. - ExactArith: const ExactArith() - ExactArith: Rational fromInt(int n, [int d = 1]) - ExactArith: Rational add(Rational a, Rational b) - ExactArith: Rational sub(Rational a, Rational b) - ExactArith: Rational mul(Rational a, Rational b) - ExactArith: Rational div(Rational a, Rational b) - ExactArith: double toDouble(Rational a) - final class F64Arith implements KeplerArith — IEEE binary64. - F64Arith: const F64Arith() - F64Arith: double fromInt(int n, [int d = 1]) - F64Arith: double add(double a, double b) - F64Arith: double sub(double a, double b) - F64Arith: double mul(double a, double b) - F64Arith: double div(double a, double b) - F64Arith: double toDouble(double a) - final class LeapfrogKepler — Störmer-Verlet (leapfrog) in physical time t: a = −μ z / r³ with r = √(x² + y²) (Root). - LeapfrogKepler: LeapfrogKepler({required this.x, required this.y, required this.vx, required this.vy, required this.mu, required this.dt}) - LeapfrogKepler: double x - LeapfrogKepler: double y - LeapfrogKepler: double vx - LeapfrogKepler: double vy - LeapfrogKepler: final double mu - LeapfrogKepler: final double dt - LeapfrogKepler: int steps - LeapfrogKepler: double time - LeapfrogKepler: double get energy - LeapfrogKepler: double get angularMomentum - LeapfrogKepler: (double, double) get lrl — The Laplace-Runge-Lenz vector divided by μ. - LeapfrogKepler: void step() - final class LeviCivitaKeplerF64 — LeviCivitaKepler in plain doubles. - LeviCivitaKeplerF64: LeviCivitaKeplerF64({required this.w1, required this.w2, required this.p1, required this.p2, required this.mu, required double ds}) - LeviCivitaKeplerF64: factory LeviCivitaKeplerF64.rationalEccentricity({required double k, required double q, required double ds}) — See LeviCivitaKepler.rationalEccentricity. - LeviCivitaKeplerF64: double w1 - LeviCivitaKeplerF64: double w2 - LeviCivitaKeplerF64: double p1 - LeviCivitaKeplerF64: double p2 - LeviCivitaKeplerF64: final double mu - LeviCivitaKeplerF64: late final double c - LeviCivitaKeplerF64: double time - LeviCivitaKeplerF64: int steps - LeviCivitaKeplerF64: double get radius - LeviCivitaKeplerF64: (double, double) get position - LeviCivitaKeplerF64: (double, double) get velocity - LeviCivitaKeplerF64: double get energy - LeviCivitaKeplerF64: double get angularMomentum - LeviCivitaKeplerF64: (double, double) get lrl - LeviCivitaKeplerF64: void step() - final class KsKepler — 3-D Kepler in Kustaanheimo-Stiefel variables, Cayley-stepped, over T. - KsKepler: KsKepler(this.f, {required List u, required List du, required this.mu, required T ds}) - KsKepler: final KeplerArith f - KsKepler: final T mu - KsKepler: late final T c - KsKepler: int steps - KsKepler: Vec3 get position — X = L(u) u. - KsKepler: T get radius — R = |u|². - KsKepler: Vec3 get velocity — Ẋ = 2 L(u) u' / r. - KsKepler: T get constraint — The KS bilinear constraint u4 u1' − u3 u2' + u2 u3' − u1 u4' (zero on physical states). - KsKepler: T get energy - KsKepler: T get time - KsKepler: void step() - final class Multivector — A multivector of G3 over T. - Multivector: Multivector(this.f, List c) - Multivector: factory Multivector.zero(KeplerArith f) - Multivector: static const e1 = 1 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: static const e2 = 2 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: static const e3 = 4 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: static const e12 = 3 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: static const e13 = 5 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: static const e23 = 6 — E1, e2, e3, e12, e13, e23, e123 are bitmaps 1, 2, 4, 3, 5, 6, 7. - Multivector: final KeplerArith f - Multivector: final List c - Multivector: Multivector get reverse — The reverse: grades 2 and 3 change sign. - Multivector: Vec3 get vector - Multivector: T get scalar - Multivector: Multivector grade(int g) — The grade-g part. - Multivector: Multivector operator *(Multivector o) - final class SpinorKepler — 3-D Kepler in Hestenes' spinor form: x = U e1 Ũ for an even multivector U (scalar + bivectors), r = U Ũ, dx/ds = 2⟨U' e1 Ũ⟩₁, U'' = (h/2) U with the gauge ⟨U' e1 Ũ⟩₃ = 0, Cayley-stepped. - SpinorKepler: SpinorKepler(this.f, {required Multivector u, required Multivector du, required this.mu, required T ds}) - SpinorKepler: final KeplerArith f - SpinorKepler: final T mu - SpinorKepler: late final T c - SpinorKepler: int steps - SpinorKepler: Vec3 get position — X = U e1 Ũ (a vector). - SpinorKepler: T get radius — R = U Ũ (a scalar: the quadrance of the spinor). - SpinorKepler: Vec3 get velocity — Ẋ = 2⟨U' e1 Ũ⟩₁ / r. - SpinorKepler: T get gauge — The gauge ⟨U' e1 Ũ⟩₃ (zero on physical states). - SpinorKepler: T get energy - SpinorKepler: T get time - SpinorKepler: void step() - final class LogHKepler — Planar Kepler by the logarithmic-Hamiltonian leapfrog (drift-kick-drift), over T (exact or f64). - LogHKepler: LogHKepler(this.f, {required T x, required T y, required T vx, required T vy, required this.mu, required T ds}) - LogHKepler: final KeplerArith f - LogHKepler: final T mu - LogHKepler: late T b - LogHKepler: int steps - LogHKepler: (T, T) get position - LogHKepler: (T, T) get velocity - LogHKepler: T get time - LogHKepler: T get angularMomentum — X ẏ − y ẋ. - LogHKepler: void step() - LogHKepler: T energyResidual(T h) — (T − h)² · r² − μ²: zero exactly when the energy is exactly h (no root needed to check it). - final class LogHKeplerF64 — LogHKepler in plain doubles, for honest timing. - LogHKeplerF64: LogHKeplerF64({required this.x, required this.y, required this.vx, required this.vy, required this.mu, required this.ds, required this.b}) - LogHKeplerF64: double x - LogHKeplerF64: double y - LogHKeplerF64: double vx - LogHKeplerF64: double vy - LogHKeplerF64: double time - LogHKeplerF64: final double mu - LogHKeplerF64: final double ds - LogHKeplerF64: final double b - LogHKeplerF64: int steps - LogHKeplerF64: void step() - final class LeviCivitaKepler — A planar Kepler orbit in Levi-Civita variables, stepped by Cayley maps over T (exact Rational or f64). - LeviCivitaKepler: LeviCivitaKepler(this.f, {required T w1, required T w2, required T p1, required T p2, required this.mu, required T ds}) — Starts at w = (w1, w2), w' = (p1, p2) about a centre of strength mu, with clock step ds. - LeviCivitaKepler: factory LeviCivitaKepler.rationalEccentricity(KeplerArith f, {required T k, required T q, required T ds}) — An orbit whose eccentricity is e = (k² − 1)/(k² + 1) for a rational k, chosen so the speed at perihelion is rational: μ = 2(k² + 1), w = (q, 0), w' = (0, k). - LeviCivitaKepler: final KeplerArith f - LeviCivitaKepler: final T mu - LeviCivitaKepler: late final T c - LeviCivitaKepler: int steps - LeviCivitaKepler: (T, T) get position — The position z = w² = (w1² − w2², 2 w1 w2). - LeviCivitaKepler: T get radius — The distance to the centre, r = |w|²: a quadrance, no root. - LeviCivitaKepler: (T, T) get velocity — The velocity ż = 2 w w' / |w|² (complex product). - LeviCivitaKepler: T get energy — The orbital energy h = |ż|²/2 − μ/r = (2|w'|² − μ)/|w|². - LeviCivitaKepler: T get angularMomentum — The angular momentum per unit mass, L = x ẏ − y ẋ = 2(w1 p2 − w2 p1). - LeviCivitaKepler: (T, T) get lrl — The Laplace-Runge-Lenz vector divided by μ: A = (ż × L ẑ)/μ − z/r. - LeviCivitaKepler: T get time — The physical time reached (a rational trapezoid sum of r ds; the only approximated quantity). - LeviCivitaKepler: void step() — One Cayley step of the clock s, and the trapezoid sum of physical time t += Δs (r_n + r_{n+1}) / 2. ### Vector search (riptide_vector_search) import 'package:riptide_vector_search/riptide_vector_search.ray'; Nearest neighbours by cosine similarity beside exact search by spread, on the CPU and the GPU. https://riptidecompute.com/raya/docs/vector-search - List tokenize(String text) — Lower-case runs of ASCII letters and digits; apostrophes join ("don't" → "dont"); stop words and one-letter tokens dropped. - double spreadOf(int x, int qa, int qb) — S = 1 − x²/(Q(a)Q(b)), computed exactly in integers and rounded once to f64 for display (1 when a vector is 0). - Future isolateWorker(T Function() work) — The default worker: Isolate.run, so a 262,144-vector search never blocks a frame. - Future inlineWorker(T Function() work) — Runs work on this isolate. - List> cosineTopKAll(Float32List scores, int n, int queries, int k) — The classic ranking: cosine similarity, largest first; ties (equal floats) to the smaller id. - List topKFloat(List values, int n, int k) — The k largest of values (first n), largest first, ties to the smaller index. - double recallAt(List found, List truth, int k) — Recall@k: the share of truth's first k that found's first k contains (order inside the k not counted). - double meanRecall(List> found, List> truth, int k) — The mean recall@k over queries. - int orderDifferences(List> a, List> b) — How many queries' ordered result lists differ between two searches (the same set in another order counts). - List> exactCosineTopK(VectorSet docs, VectorSet queries, int k) — The exact answer: for each query the k largest a·b / (|a||b|) in f64 arithmetic on the stored f32 numbers (plain loops, one root a vector), ties to the smaller id. - (double, int) medianMicros(void Function() run, {int minMicros = 30000, int maxRuns = 40}) — The median time of run in microseconds: one warm-up, then at least three runs and until minMicros have passed (at most maxRuns). - Float32List classicDots(SearchData s) — The f32 dot products of the unit vectors (cosines) on the matrix unit (n × q, row-major). - List exactDots(SearchData s, VectorWidth w) — The exact integer dot products D·Aᵀ on the matrix unit (Int32List for int8, Int64List for int16). - LaneRun runClassicCpu(SearchData s, {int minMicros = 30000}) — The classic CPU lane: f32 dots on the matrix unit, cosine, top k. minMicros is the timing budget. - LaneRun runExactCpu(SearchData s, VectorWidth w, {int minMicros = 30000}) — An exact CPU lane: integer dots on the matrix unit, spread ranked exactly, top k. - LaneRun rankGpu(SearchData s, SearchLane lane, GpuDots g) — Ranks a GPU lane's dot products (in a worker in the app) and measures it. - TieReport tieReport(SearchData s, Float32List f32Dots, List dots8, List dots16) — Looks at every tied pair of s for every query, from the lanes' dot products. - CpuSearchRound runCpuRound(SearchData data, {int minMicros = 30000, int reorderQueries = 4}) — The CPU lanes of a round on data (pure work: run it in a worker isolate). - VectorSet clusteredSet(int n, int d, {int clusters = 64, double noise = 0.45, int seed = 1}) — A deterministic clustered set: clusters centres drawn bell-shaped in d dimensions, each vector a centre plus noise × a bell-shaped offset; every tieEvery-th vector 3 × its predecessor. - VectorSet queriesNear(VectorSet data, int count, {double noise = 0.3, int seed = 2}) — count queries near the set: a random member plus noise × a bell-shaped offset (never a member itself). - List<(int, int)> tiedPairs(int n) — The tied pairs of a clusteredSet of n vectors: (i − 1, i) for every i ≡ −1 (mod tieEvery). - int laneColor(SearchLane l) — Classic in the classic method colour (rose), spread in Cayley green (LabCanvasColorTokens.methods, as everywhere in the Lab); the int8 lanes lighter, GPU lanes their CPU twin's colour, dimmer. - String laneName(SearchLane l) — A lane's short name. - PreparedCorpus prepareCorpus(LectureCorpus corpus) — Builds the corpus's vectors and finds the example queries (pure work: run it in a worker). - String duration(double micros) — "245 µs" or "1.01 ms". - const stopwords — The words the vectorizer skips (common English function words and caption filler). - const exampleQueries — Queries to pick from (and the corpus's recall sample): topics of the lectures and talks. - const searchSizes = [4096, 16384, 65536, 262144] — Synthetic set sizes (d = 128, 32 queries, k = 10). - const tieEvery = 64 — Every tieEvery-th vector of a synthetic set is 3 × the one before it: the same direction, so cosine and spread tie exactly in exact arithmetic. f32 rounds 3x, and every lane then has to decide what to do with the tie. - const seriesColors — The colours of the six lecture collections on the map (quiet blues and violets; rose and green are the methods'). - typedef SearchWorker = Future Function(T Function() work) — Runs work somewhere: a worker isolate in the app (isolateWorker), right here in tests (inlineWorker). - final class Lecture — One lecture of the corpus. - Lecture: const Lecture(this.title, this.series, this.videoId) - Lecture: final String title - Lecture: final int series — Which collection it came from (LectureCorpus.seriesNames). - Lecture: final String videoId - final class Passage — A passage: about two minutes of one lecture, with its words counted. - Passage: const Passage(this.lecture, this.start, this.snippet, this.terms, this.counts) - Passage: final int lecture - Passage: final int start — Where it starts in the video, seconds. - Passage: final String snippet — Its first words, for the result list. - Passage: final Uint16List terms — Vocabulary indices and how many times each occurs. - Passage: final Uint8List counts - final class LectureCorpus — The lecture corpus that ships with the lab: passages of lecture transcripts as word counts over a fixed vocabulary, and the vectorizer that turns any passage or typed query into a dims-number vector. - LectureCorpus: LectureCorpus({required this.lectures, required this.vocabulary, required this.df, required this.wordScale, required this.wordInts, required this.passages, required this.dims, required this.display}) - LectureCorpus: static const seriesNames - LectureCorpus: static String clock(int seconds) — "12:34" or "1:02:03". - LectureCorpus: static LectureCorpus decode(ByteData data) - LectureCorpus: final List lectures - LectureCorpus: final List vocabulary - LectureCorpus: final Uint32List df - LectureCorpus: final Float32List wordScale — The word vectors: word t's entry k is wordScalet · wordIntst·dims + k / 32767. - LectureCorpus: final Int16List wordInts - LectureCorpus: final List passages - LectureCorpus: final int dims - LectureCorpus: final Float32List display — Two directions in vector space (2 × dims) the map projects onto. - LectureCorpus: int get n - LectureCorpus: bool knows(String word) — Whether word is in the vocabulary. - LectureCorpus: double idf(int term) — The inverse document frequency ln(N / df) of a word. - LectureCorpus: double weight(int term, int count) — The tf-idf weight of count occurrences of term. - LectureCorpus: VectorSet vectors() — Every passage as a vector (n × dims f32). - LectureCorpus: ({VectorSet vector, List known, List unknown}) query(String text) — A typed query as a vector, and the words of it the corpus knows (the rest are not in the vocabulary and add nothing). - LectureCorpus: List shared(int i, String q) — The words of q that passage i contains (LSA also finds passages that share none: related words). - LectureCorpus: (double, double) mapPoint(Float32List v, int offset) — Where passage i sits on the map: its vector projected onto the two display directions (unscaled). - LectureCorpus: Uint8List encode() - final class Hit — One found passage with what each way measured for it. - Hit: const Hit(this.passage, {required this.cosine, required this.spread, required this.opposite}) - Hit: final int passage - Hit: final double cosine — Cos θ from the f32 unit vectors (classic). - Hit: final double spread — S = 1 − (a·b)²/(Q(a)Q(b)) of the integer vectors, exact, rounded only for display. - Hit: final bool opposite — A·b < 0: the opposite side (spread alone does not tell). - final class FindResult — One typed query both ways. - FindResult: const FindResult({required this.text, required this.known, required this.unknown, required this.classic, required this.rational, required this.width, required this.truth, required this.classicMicros, required this.rationalMicros, required this.classicRecall, required this.rationalRecall, this.mapX = 0, this.mapY = 0, this.example}) - FindResult: final String text - FindResult: final double mapX — Where the query sits on the map (its unit vector projected like the passages). - FindResult: final double mapY — Where the query sits on the map (its unit vector projected like the passages). - FindResult: final int? example — The passage the query was made from ("more like this"), or null for typed words. - FindResult: final List known - FindResult: final List unknown - FindResult: final List classic - FindResult: final List rational - FindResult: final VectorWidth width - FindResult: final List truth — The exact answer (f64 cosine on the stored vectors). - FindResult: final double classicMicros — Median time of one search over the whole corpus: dot products (matrix unit) and the top k. - FindResult: final double rationalMicros — Median time of one search over the whole corpus: dot products (matrix unit) and the top k. - FindResult: final double classicRecall - FindResult: final double rationalRecall - FindResult: bool get empty - FindResult: int get samePlaces — Passages both ways found in the same place. - FindResult: FindResult withTimes(double classic, double rational) — The same result with the measured times replaced (goldens: pixels must not depend on a stopwatch). - final class CorpusSearch — The lecture corpus as a searchable set: vectors built once (LSA), indexed both ways. - CorpusSearch: CorpusSearch(this.corpus) - CorpusSearch: final LectureCorpus corpus - CorpusSearch: final VectorSet vectors - CorpusSearch: late final SearchData base - CorpusSearch: late final Float32List mapPoints — The map position of every passage (projection onto the corpus's two display directions). - CorpusSearch: FindResult find(String text, {int k = 10, VectorWidth width = VectorWidth.b16, int minMicros = 3000}) — text both ways, top k, the rational way at width. minMicros is the timing budget per way. - CorpusSearch: FindResult findLike(int i, {int k = 10, VectorWidth width = VectorWidth.b16, int minMicros = 3000}) — "More like this": passage i's own vector as the query (it finds itself first). - CorpusSearch: SearchData examples({int k = 10}) — The example queries in one block (the corpus row of the race and its recall). - final class IvfIndex — An inverted-file index (IVF; Jégou, Douze and Schmid, "Product quantization for nearest neighbor search", IEEE TPAMI 33(1), 2011, §IV): the vectors split into lists groups around centres found by a few rounds of… - IvfIndex: static IvfIndex classic(SearchData s, int lists, {int rounds = 4, int seed = 3}) — Spherical k-means on the unit vectors of s. - IvfIndex: static IvfIndex spread(SearchData s, int lists, {int rounds = 4, int seed = 3}) — k-means by spread on the int16 vectors of s: integers throughout, no root. - IvfIndex: final bool exact - IvfIndex: final int lists - IvfIndex: final int d - IvfIndex: final List members — The ids in each group. - IvfIndex: final Float32List? unitCentres — Classic: lists × d unit f32 centres. - IvfIndex: final Int16List? intCentres — Spread: lists × d int16 centres and their exact quadrances. - IvfIndex: final Int64List? centreQuadrance - IvfIndex: final double buildMicros — How long building took (k-means and grouping), microseconds. - IvfIndex: IvfSearch search(SearchData s, int probe) — Every query of s through the index, looking in the probe nearest groups. - final class IvfSearch — What an index search found and what it cost. - IvfSearch: const IvfSearch({required this.probe, required this.results, required this.recall, required this.scannedShare, required this.microsPerQuery}) - IvfSearch: final int probe - IvfSearch: final List> results - IvfSearch: final double recall — Mean recall@k against the exact answer (the whole set, f64 cosine). - IvfSearch: final double scannedShare — The share of the set each query looked at. - IvfSearch: final double microsPerQuery - enum LaneState — Where a lane is in the current round. - LaneState: waiting - LaneState: running - LaneState: done - LaneState: unavailable - final class SearchRace — The vector-search race: the same queries over the same set on the CPU's matrix unit and the graphics chip, classic f32 cosine and exact int8 / int16 spread, each timed and scored against the exact answer. - SearchRace: SearchRace({Future Function()? gpu, SearchWorker? worker, SearchWorker? compare, this.minMicros = 30000}) - SearchRace: int minMicros — The timing budget per CPU lane. - SearchRace: int n — The set size of the next round. - SearchRace: void Function()? onChange - SearchRace: final Map state - SearchRace: final Map results - SearchRace: final Map> history — Every result so far, by lane, then size (the chart). - SearchRace: CpuSearchRound? last — The last round's tie report, reorder check and data (null before a round). - SearchRace: IvfIndex? classicIndex — The index, both ways, on the last round's set (null until built). - SearchRace: IvfIndex? spreadIndex — The index, both ways, on the last round's set (null until built). - SearchRace: IvfSearch? classicIvf - SearchRace: IvfSearch? spreadIvf - SearchRace: int probe - SearchRace: bool indexing - SearchRace: VectorGpu? gpu - SearchRace: String? gpuMissing - SearchRace: bool? native - SearchRace: int features - SearchRace: bool busy - SearchRace: int rounds - SearchRace: final List sweepQueue - SearchRace: int get largest — The largest size this device runs: 262,144 with a matrix unit, 16,384 on a portable loop. - SearchRace: int get lists - SearchRace: void reset() - SearchRace: void sweep() - SearchRace: Future round() — One round on a synthetic set of n vectors: the CPU lanes in a worker, then the GPU lanes. - SearchRace: Future buildIndex() — Builds the index both ways on the last round's set and searches it with probe groups. - SearchRace: Future searchIndex() — Searches the built index again with probe groups. - SearchRace: double? speedup(SearchLane a, SearchLane b) — How many times faster lane a was than lane b in the last round (null until both ran). - SearchRace: int? crossChipReorders(SearchLane cpu, SearchLane gpuLane) — Queries whose ordered results differ between the CPU and GPU lanes of one kind (null until both ran). - final class SpreadRanker — Exact ranking by spread. - SpreadRanker: static Float64List inverseQuadrances(Int64List q) — 1/Q(b) in f64 for every b (0 for the zero vector). - SpreadRanker: int exactFallbacks — How many comparisons the f64 filter could not decide and were settled in big integers. - SpreadRanker: int comparisons — How many exact key comparisons were made (candidates the fast reject could not dismiss). - SpreadRanker: int compare(int x1, int q1, int x2, int q2) — 0 when (x₁, q₁) ranks above (x₂, q₂), < 0 below, 0 when their keys are exactly equal. - SpreadRanker: List> topKAll(List dots, Int64List quadrance, int n, int queries, int k, {Float64List? inverseQuadrance}) — The k best candidates for each of queries queries, best first (ties to the smaller id). dots holds n × queries exact a·b row-major (doc i, query j at i·queries + j), as the matrix unit writes C = D·Aᵀ; quadrance Q(b);… - enum SearchLane — The lanes of a search: classic f32 cosine and exact integer spread, on the CPU's matrix unit and on the graphics chip; the integer lanes at 8 or 16 bits. - SearchLane: cpuClassic(gpu: false, width: null) — Unit f32 vectors (scaled once at index time, a root each); f32 dot products on the matrix unit (FMOPA) are the cosines. - SearchLane: cpuExact8(gpu: false, width: VectorWidth.b8) — Int8 vectors, exact int32 dot products on the matrix unit (SMOPA), ranked by spread exactly. - SearchLane: cpuExact16(gpu: false, width: VectorWidth.b16) — Int16 vectors, exact int64 dot products (SMOPA), ranked by spread exactly. - SearchLane: gpuClassic(gpu: true, width: null) — F32 dot products on the graphics chip (GemmF32), cosine on the CPU. - SearchLane: gpuExact8(gpu: true, width: VectorWidth.b8) — Int8 vectors, exact int32 dot products on the graphics chip (GemmI32). - SearchLane: gpuExact16(gpu: true, width: VectorWidth.b16) — Int16 vectors as two 8-bit limbs, four exact GemmI32 passes combined in int64. - SearchLane: const SearchLane({required this.gpu, required this.width}) - SearchLane: final bool gpu - SearchLane: final VectorWidth? width - SearchLane: bool get exact - final class SearchData — A set to search and the queries to search it with, with everything both ways precompute: the classic unit vectors (one root a vector) and the integer vectors with their exact quadrances (no root). truth is the exact… - SearchData: SearchData(this.docs, this.queries, {this.k = 10, this.ties = const []}) - SearchData: SearchData.withQueries(SearchData set, this.queries, {int? k}) — New queries against the same set: everything precomputed for the set is shared, not redone. - SearchData: static SearchData synthetic(int n, {int d = 128, int q = 32, int k = 10, int seed = 1}) — A clustered synthetic set of n vectors in d dimensions with q queries near it (synthetic.ray). - SearchData: final VectorSet docs - SearchData: final VectorSet queries - SearchData: final int k - SearchData: final VectorSet unitDocs — The classic index: every vector scaled to length 1 (one root each), so cosine is a dot product. - SearchData: final VectorSet unitQueries — The classic index: every vector scaled to length 1 (one root each), so cosine is a dot product. - SearchData: final QuantizedSet docs8 - SearchData: final QuantizedSet docs16 - SearchData: final QuantizedSet queries8 - SearchData: final QuantizedSet queries16 - SearchData: Float64List get inverse8 — 1/Q(b) in f64 for the integer vectors (precomputed once; no root). - SearchData: Float64List get inverse16 - SearchData: final List<(int, int)> ties — Pairs of vectors that point exactly the same way (a vector and 3 × it). - SearchData: late final List> truth - SearchData: int get n - SearchData: int get d - SearchData: int get q - SearchData: Float64List inverseOf(VectorWidth w) - SearchData: QuantizedSet docsOf(VectorWidth w) - SearchData: QuantizedSet queriesOf(VectorWidth w) - SearchData: Float32List queriesT() — The unit queries transposed (d × q, row-major): the B of C = D·B on the graphics chip. - SearchData: Int32List queriesTInt(VectorWidth w) - final class LaneRun — One lane's measured search. - LaneRun: LaneRun({required this.lane, required this.n, required this.d, required this.q, required this.dotMicros, required this.rankMicros, required this.runs, required this.results, required this.recall, this.endToEndMicros, this.passes = 1, this.fallbacks = 0, this.comparisons = 0}) - LaneRun: final SearchLane lane - LaneRun: final int n - LaneRun: final int d - LaneRun: final int q - LaneRun: final double dotMicros — Dot products for all q queries (median; GPU: kernel time), and ranking them (top k per query). - LaneRun: final double rankMicros — Dot products for all q queries (median; GPU: kernel time), and ranking them (top k per query). - LaneRun: final int runs - LaneRun: final double? endToEndMicros — GPU: upload, dot products and read-back, once. - LaneRun: final int passes — GPU dispatches a product takes (four for int16 limbs). - LaneRun: final List> results — The ids found, best first, one list per query. - LaneRun: final double recall — Mean recall@k against the exact answer. - LaneRun: final int fallbacks — Spread lanes: comparisons the f64 filter left to big integers, of all comparisons. - LaneRun: final int comparisons — Spread lanes: comparisons the f64 filter left to big integers, of all comparisons. - LaneRun: double get totalMicros - LaneRun: double get perQuery — Microseconds a query. - LaneRun: double get vectorsPerSecond — Vectors searched a second (n × q / total time). - final class GpuDots — What the graphics chip hands back: the dot products (f32, or exact integers) and how long they took. - GpuDots: const GpuDots({required this.micros, required this.runs, this.endToEndMicros, this.floats, this.ints, this.passes = 1}) - GpuDots: final double micros - GpuDots: final int runs - GpuDots: final double? endToEndMicros - GpuDots: final Float32List? floats - GpuDots: final List? ints - GpuDots: final int passes - abstract interface class VectorGpu — The graphics chip, as vector search needs it: C = D·B for n × d vectors D and a d × q block of queries B. - VectorGpu: String get name - VectorGpu: Future classic(Float32List docs, Float32List queriesT, int n, int d, int q) - VectorGpu: Future exact(Int32List docs, Int32List queriesT, int n, int d, int q, VectorWidth w) — Exact: int8 entries in one GemmI32 pass, int16 entries as two 8-bit limbs in four. - final class CpuStandInVectorGpu implements VectorGpu — A stand-in for the graphics chip on the CPU (tests): the answers a GPU must give, by plain loops, honestly timed. - CpuStandInVectorGpu: String get name - CpuStandInVectorGpu: Future classic(Float32List docs, Float32List queriesT, int n, int d, int q) - CpuStandInVectorGpu: Future exact(Int32List docs, Int32List queriesT, int n, int d, int q, VectorWidth w) - final class TieReport — What the exact tie pairs did: how often f32 cosine scored the two members of a tie differently (rounding chose the order), and how often the spread keys were exactly equal (the tie kept; the smaller id first,… - TieReport: const TieReport({required this.pairs, required this.f32Split, required this.spreadEqual8, required this.spreadEqual16}) - TieReport: final int pairs — Tied pairs × queries looked at. - TieReport: final int f32Split - TieReport: final int spreadEqual8 - TieReport: final int spreadEqual16 - final class CpuSearchRound — The CPU half of a round: the data, the three CPU lanes, the tie report, and whether another summation order (the stand-in's loop) reorders the classic results on the first few queries while the integers stay identical. - CpuSearchRound: CpuSearchRound({required this.data, required this.lanes, required this.ties, required this.reorderChecked, required this.classicReordered, required this.exactIdentical, required this.native, required this.features}) - CpuSearchRound: final SearchData data - CpuSearchRound: final Map lanes - CpuSearchRound: final TieReport ties - CpuSearchRound: final int reorderChecked — Queries compared against a plain-loop sum in another order; how many of them came back in another order (classic), and whether the integer dot products were bit for bit the same (exact). - CpuSearchRound: final int classicReordered — Queries compared against a plain-loop sum in another order; how many of them came back in another order (classic), and whether the integer dot products were bit for bit the same (exact). - CpuSearchRound: final bool exactIdentical - CpuSearchRound: final bool native - CpuSearchRound: final int features - final class SplitMix — SplitMix64 (Steele, Lea and Flood, "Fast splittable pseudorandom number generators", OOPSLA 2014): the same numbers from the same seed on every machine, so a synthetic set is the same set everywhere. - SplitMix: SplitMix(int seed) - SplitMix: int next() — The next 64 random bits. - SplitMix: double nextDouble() — Uniform in [0, 1): the top 53 bits over 2⁵³. - SplitMix: double nextBell() — Bell-shaped, mean 0, variance 1: four uniforms summed, centred, and scaled by the constant √3 (Irwin–Hall; no log or root at run time). - SplitMix: int nextInt(int n) — Uniform in [0, n). - final class VectorSet — N vectors of d numbers, row-major, as stored: f32. - VectorSet: VectorSet(this.n, this.d, this.values) - VectorSet: final int n - VectorSet: final int d - VectorSet: final Float32List values - VectorSet: Float32List row(int i) — Row i as a view. - VectorSet: VectorSet pick(List ids) — The rows ids, copied, as a new set. - VectorSet: VectorSet unit() — Every row scaled to length 1 (f64 arithmetic, stored in f32): what a classic index stores, so that the cosine is a plain dot product. - VectorSet: Float32List norms() — Vector). - enum VectorWidth — How many bits the integer vectors keep. - VectorWidth: b8(127) — Int8: |q| ≤ 127; dot products int8 → int32 on the matrix unit (exact while d < 2¹⁷). - VectorWidth: b16(32767) — Int16: |q| ≤ 32767; dot products int16 → int64 (exact). - VectorWidth: const VectorWidth(this.top) - VectorWidth: final int top — The largest integer an entry may take. - VectorWidth: String get label - final class QuantizedSet — Vectors as integers: each row scaled by its own positive factor so its largest entry is ±VectorWidth.top, then rounded. - QuantizedSet: static QuantizedSet of(VectorSet v, VectorWidth width) - QuantizedSet: final VectorWidth width - QuantizedSet: final int n - QuantizedSet: final int d - QuantizedSet: final Int8List? i8 — The entries (one of the two, by width). - QuantizedSet: final Int16List? i16 - QuantizedSet: final Int64List quadrance — Q(v) = Σ vₖ², exactly. - QuantizedSet: Int32List toInt32() — The entries as int32 (what the GPU kernel reads). - QuantizedSet: int at(int i, int k) — Entry k of row i. - enum VectorMode — What the lab shows. - VectorMode: find — The lecture corpus: a typed (or picked) query, its nearest passages both ways on the map and in two lists. - VectorMode: race — Speed and recall by set size: every lane on the CPU's matrix unit and the graphics chip. - VectorMode: ivf — The inverted-file index both ways: recall against the share of the set each query looks at. - final class PreparedCorpus — The corpus, made searchable (a worker builds the vectors), and every example query already found. - PreparedCorpus: const PreparedCorpus(this.search, this.tour) - PreparedCorpus: final CorpusSearch search - PreparedCorpus: final List tour - class VectorSearchScene extends CalcScene — Vector search, two ways: nearest neighbours by cosine (f32) beside spread (exact integers), on the lecture corpus and on synthetic sets, measured on this device. - VectorSearchScene: VectorSearchScene({Future Function()? corpus, Future Function()? gpu, SearchWorker? worker, SearchWorker? compare}) - VectorSearchScene: final SearchRace race - VectorSearchScene: PreparedCorpus? prepared - VectorSearchScene: String? corpusError - VectorSearchScene: String query — The query in the lab and what it found. - VectorSearchScene: FindResult? found - VectorSearchScene: VectorWidth width - VectorSearchScene: int? selected — The rank selected in the lists (its passage is highlighted and its first words shown), or null. - VectorSearchScene: int tourAt — The tile's tour through the example queries. - VectorSearchScene: VectorMode get mode - VectorSearchScene: set mode(VectorMode m) - VectorSearchScene: bool get loading - VectorSearchScene: CorpusSearch? get search - VectorSearchScene: MathsLabel get classicLabel - VectorSearchScene: MathsLabel get finiteLabel - VectorSearchScene: bool get showsClassic - VectorSearchScene: bool get showsRational - VectorSearchScene: List get lanes — Lanes the way shows. - VectorSearchScene: FindResult? get shown — What the map and the lists show now: the lab's query, or the tile's tour stop. - VectorSearchScene: bool get isIdle - VectorSearchScene: List get hotspots - VectorSearchScene: void settle() — Finishes the beams' grow-in now (Reduce Motion, still frames: goldens, screenshots). - VectorSearchScene: Future ensureCorpus() — Loads and prepares the corpus once (the first frame that needs it). - VectorSearchScene: void findText(String text) — Searches the corpus for text both ways (the panel's field and picks). - VectorSearchScene: void findLike(int i) — "More like this": passage i as the query. - VectorSearchScene: void setWidth(VectorWidth w) — The integer width of the rational way (the search runs again). - VectorSearchScene: void runRound() — Runs one race round now. - VectorSearchScene: void reset() - VectorSearchScene: void advance(int n) - VectorSearchScene: void animate(double dt) — Timers run on real time (animate), not on simulation steps: the tile's tour, the lab's first round. - VectorSearchScene: Size line(Canvas canvas, String s, Offset at, double maxWidth, {int color = LabCanvasColorTokens.muted, bool bold = false}) — One line of text cut with an ellipsis to maxWidth (result rows: a title never runs into the line below). - VectorSearchScene: Size text(Canvas canvas, String s, Offset at, {double size = TypeTokens.bodyXs, int color = LabCanvasColorTokens.muted, bool bold = false, double align = 0, double? maxWidth}) — Text never asks for less than a few points of width. - VectorSearchScene: bool onPick(Offset screen, {required bool done}) - VectorSearchScene: void draw(Canvas canvas, Size size)