smart_arrays_base 2.0.9

Smart Arrays Base #

What the package can do for you #

This package provides basic functionalities for one- and two-dimensional arrays (vectors and matrices).

The major API functionalities #

  • class Array1D: This class provides utility functions for 1D arrays (vectors):

    • adding arrays with various options
    • Finding the minimum or maximum values with various options
    • splitting, shuffling, swapping and extracting given index ranges
    • extending with zeroes, cutting
    • computing the integral function of an array
  • class Array2D:This class provides utility functions for 2D arrays (matrices):

    • Extracting rows, columns, appending rows
    • Extracting sub-matrices, building envelopes
    • Computing projections or sums over rows or columns
    • Swapping or reversing rows
    • Finding minimum or maximum values
    • Integrating a matrix region

Detailed API #

Please view the detailed API documentation in the API reference of this package (sidebar at the right of this page).

Using this package #

You need Dart 2.0 or later.

Import the package using:

  • import 'package:smart_arrays_base/smart_arrays_base.dart';

smart_arrays_numerics: Numerics with 1D and 2D arrays

smart_arrays_compress: Compress 1D and 2D arrays to a smaller size.

smart_arrays_dbstore: Store 1D and 2D arrays along with metadata on the local device.

smart_arrays_plot_polyline: Plot 1D arrays as polyline along with axes and more.

smart_arrays_peaks: Detect peaks in 1D and 2D arrays.

smart_arrays_lmfit: Fits (x, y) data given as arrays to a specified model function using the Levenberg-Marquardt algorithm.

smart_lorentz-gauss: Compute Lorentz-Gauss (pseudo-Voigt) line shapes.

smart_signal_processing: Fourier transform and more.

smart_dialogs: Easy-to-use dialogs in Web applications

Smart Arrays Base #

Version history #

2.0.0 - 2019-03-09 First version available on pub site

2.0.1 - 2019-03-14 Minor doc updates

2.0.2 - 2019-03-22 Added zeroFill()

2.0.3 - 2019-03-24 Added integral calculation of arrays

2.0.4 - 2019-04-04 Docu updates

2.0.5 - 2019-04-05 Function integ_trapez() is now static

2.0.6 - 2019-04-05 Function integrateRegion() is now static

2.0.7 - 2019-05-06 Docu updates

2.0.8 - 2019-05-06 Docu updates

2.0.9 - 2019-08-01 Fixed health suggestions of pub.dev

example/example.dart

// Copyright (c) 2019, Dr. Bruno Guigas. All rights reserved. Use of this source
// code is governed by a BSD-style license that can be found in the LICENSE file.
import 'package:smart_arrays_base/smart_arrays_base.dart';
import "dart:typed_data";

main() {
  // Create a matrix whose elements have the form row.col, e.g. 120.231.
  // The number before the decimal point is the row number, the number
  // after the decimal point is the column number.
  final int NROWS = 123, NCOLS = 234;
  List<Float64List> matrix = List(NROWS);
  for (int i = 0; i < NROWS; i++) {
    Float64List row = Float64List(NCOLS);

    for (int k = 0; k < NCOLS; k++) {
      row[k] = double.parse("$i.$k");
    }
    matrix[i] = row;
  }

  Float64List row100 = Array2D.getRow(matrix, 101); // extract row 101
  Float64List col100 = Array2D.getColumn(matrix, 105); // extract column 105

  // get the submatrix including rows 100-109 and columns 200-219.
  List<Float64List> sub_matrix =
      Array2D.getSubmatrix(matrix, 100, 110, 200, 220, false);

  // get the minimum and maximum in the submatrix
  MinMax minmax = Array2D.getMinMax(sub_matrix);

  // now print the results

  print("matrix row 100 = ${row100}");
  print("matrix col 100 = ${col100}");

  // print submatrix
  for (int i = 0; i < sub_matrix.length; i++) {
    Float64List row = sub_matrix[i];
    print("submatrix row $i=${row}");
  }

  // print minimum and maximum
  print("Minimum value ${minmax.minValue} occurred at submatrix row/col " +
      " ${minmax.minValueIndexRow} / ${minmax.minValueIndexCol}");
  print("Maximum value ${minmax.maxValue} occurred at submatrix row/col " +
      " ${minmax.maxValueIndexRow} / ${minmax.maxValueIndexCol}");
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  smart_arrays_base: ^2.0.9

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:smart_arrays_base/smart_arrays_base.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Aug 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:smart_arrays_base/smart_arrays_base.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
build_runner ^1.6.2 1.6.6
build_web_compilers ^2.0.0 2.2.3
pedantic ^1.5.0 1.8.0+1
Transitive dependencies
analyzer 0.38.0
archive 2.0.10
args 1.5.2
async 2.3.0
bazel_worker 0.1.21
build 1.1.6
build_config 0.4.1+1
build_daemon 2.0.0
build_modules 2.4.3
build_resolvers 1.0.7
build_runner_core 3.0.9
built_collection 4.2.2
built_value 6.7.0
charcode 1.1.2
checked_yaml 1.0.2
code_builder 3.2.0
collection 1.14.12
convert 2.1.1
crypto 2.1.1+1
csslib 0.16.1
dart_style 1.2.10
fixnum 0.10.9
front_end 0.1.22
glob 1.1.7
graphs 0.2.0
html 0.14.0+2
http 0.12.0+2
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 3.0.0
kernel 0.3.22
logging 0.11.3+2
matcher 0.12.5
meta 1.1.7
mime 0.9.6+3
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
pool 1.4.0
protobuf 0.13.15
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.0.5
scratch_space 0.0.4
shelf 0.7.5
shelf_web_socket 0.2.3
source_maps 0.10.8
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.19
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
watcher 0.9.7+12
web_socket_channel 1.0.15
yaml 2.1.16