Skip to main content

mathsdk 0.3.1 copy "mathsdk: ^0.3.1" to clipboard
mathsdk: ^0.3.1 copied to clipboard

PlatformAndroid

Native symbolic math engine (SymEngine-backed) for Flutter via dart:ffi — evaluation, calculus, equation solving, and matrix operations.

Changelog #

0.3.1 #

  • Equation steps now read like a student's work. Linear equations, and quadratics without an x term, are solved by applying the same operation to both sides: 9*x = 9 becomes (9*x)/9 = 9/9 and then x = 1, instead of -9 + 9*x = 0. New rules: subtract_both_sides, add_both_sides, multiply_both_sides (used for fractional and -1 coefficients), divide_both_sides, swap_sides and square_root_both_sides.
  • Those steps carry the new MathStep.operand, naming what was applied, such as 9.
  • Equation steps write polynomials with the highest power first (x**2 - 5*x + 6), as written by hand.

0.3.0 #

  • Step-by-step solutions for every operation. Each call now has a *Steps variant returning the same result plus a JSON trace of {before, after, rule} steps, and a typed *WithSteps variant in MathSdkTyped that parses the trace into MathSteps: substitute, derivative, solve (solveRootsWithSteps), solveLinearSystem (solveSystemWithSteps), limit, integral, series, matrixOp and odeSolveSeparable. Rules are stable snake_case names such as power_rule, chain_rule, quotient_rule, discriminant, quadratic_formula, rational_root_test, cramer_rule, cofactor_expansion and direct_substitution. The trace is never empty: input outside the detailed rules gets a single step.
  • evaluateSteps / evaluateWithSteps now trace any expression evaluate accepts, including symbols, constants and functions, instead of throwing MATHSDK_STATUS_NOT_IMPLEMENTED outside plain arithmetic. Steps that only reorder terms are no longer reported.
  • Fixed: solve returned roots that make a denominator zero, such as x = 1 for (x^2 - 1)/(x - 1) = 0. They are now discarded.
  • Fixed: series included the term of the same degree as its O term, e.g. exp(x) with order: 3 returned ... + (1/6)*x**3 + O(x**3). It now stops below the O term.
  • solve now returns exact rational roots for cubic and higher polynomials when every factor has one, e.g. 1, 2, 3 for x^3 - 6*x^2 + 11*x - 6 = 0 instead of nested Cardano radicals.

0.2.1 #

  • Fixed: solve and solveRoots reported no solution for equations the native solver cannot handle, such as sqrt(x) = 3 or exp(x) = 1, and dropped roots of products such as x*sqrt(x - 1) = 0. Equations that are not polynomial or rational in the variable now throw a MathSdkException with MATHSDK_STATUS_NOT_IMPLEMENTED.

0.2.0 #

  • Fixed: the package could not build when installed from pub.dev. The Android build referenced native sources above the package directory, which the published archive does not contain. Gradle now downloads a prebuilt libmathsdk.so per ABI from the matching GitHub release, and still builds from source for path: dependencies on a repository checkout.
  • Added armeabi-v7a alongside arm64-v8a and x86_64. Only the ABIs your build actually targets are downloaded.
  • MathSdk.open() is now a per-isolate singleton instead of loading the library and resolving symbols again on every call.
  • Added the MathSdkAsync extension: evaluateAsync, derivativeAsync, solveAsync, integralAsync, seriesAsync, and matrixOpAsync run on a background isolate so heavy symbolic work does not block the UI isolate.
  • Added typed accessors so callers stop hand-parsing the native output: solveRoots, solveSystem, matrix (returning MathMatrix), and evaluateWithSteps (returning MathSteps). The raw-string methods are unchanged.
  • Documented the order limits on derivative (1-10) and series (1-20), which the native library enforces.
  • Documented the measured cost of each operation on MathSdkAsync, so the choice between the synchronous and background-isolate variants is based on numbers rather than guesswork.
  • Prebuilt libraries are verified against the SHA256SUMS published with the release. A truncated or altered download now fails the build with a clear message instead of being packaged into the APK and failing at runtime.
  • Prebuilt libraries are cached under the Gradle home instead of build/, so flutter clean no longer forces a re-download on every build.
  • Fixed MathSdk.version reporting 0.1.0. The version now comes from pubspec.yaml alone, instead of being repeated in the native CMake build and the Android Gradle build.
  • A native call that reports success without writing a result now throws MathSdkException instead of dereferencing a null pointer.
  • Documented MathSdkStatus and each of its values, plus instance lifetime and isolate behaviour.

0.1.1 #

Added dartdoc comments to the public API and shortened the package description. No functional changes.

0.1.0 #

Initial release. Wraps MathSDK's native C ABI (native/include/mathsdk/math_sdk.h) via dart:ffi:

  • evaluate, evaluateSteps — exact expression evaluation, with a step-by-step reduction trace for the arithmetic subset.
  • substitute, evaluateNumeric — variable substitution and numeric (double) evaluation.
  • derivative, integral, series, limit — calculus operations, each documented in the native header with its exact coverage and ceiling.
  • solve, solveLinearSystem — equation and linear system solving.
  • matrixOp — determinant, inverse, transpose, add, multiply.
  • odeSolveSeparable — separable first-order ODEs only.

Android only in this version (Gradle externalNativeBuild compiles the native library from source — no prebuilt binaries are shipped or copied by hand). iOS/desktop support is tracked separately; see the root MathSDK repository's README for platform status.

1
likes
160
points
488
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Native symbolic math engine (SymEngine-backed) for Flutter via dart:ffi — evaluation, calculus, equation solving, and matrix operations.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

ffi, flutter

More

Packages that depend on mathsdk

Packages that implement mathsdk