Giter Club home page Giter Club logo

grizzly_primitives's Introduction

grizzly_primitives

Primitives (Index, Pair, Extent) for Grizzly

Usage

Pair

  final p1 = pair<int, String>(1, 'one');
  print(p1.key);  // => 1
  print(p1.value);  // => one

IntPair

  final p1 = intPair<String>(1, 'one');
  print(p1.key);  // => 1
  print(p1.value);  // => one

Index1D

  final i1 = idx1D(5);
  print(i1.dim); // => 1
  print(i1.x); // => 5
  print(i1[0]); // => 5
  print(i1.toList()); // => [5]
  
  print(i1 == [5]); // => true
  print(i1 == [2]); // => false
  
  print(i1 > idx1D(2)); // => true
  print(i1 > idx1D(10)); // => false
  print(i1 >= idx1D(2)); // => true
  print(i1 >= idx1D(10)); // => false
  print(i1 >= idx1D(5)); // => true
  
  print(i1 < idx1D(2)); // => false
  print(i1 < idx1D(10)); // => true
  print(i1 <= idx1D(2)); // => false
  print(i1 <= idx1D(10)); // => true
  print(i1 <= idx1D(5)); // => true

Index2D

  final i2 = idx2D(5, 25);
  print(i2.dim); // => 2
  print(i2.row); // => 5
  print(i2.col); // => 25
  print(i2[0]); // => 5
  print(i2[1]); // => 25
  print(i2.toList()); // => [5, 25]
  
  print(i2 == [5, 25]); // => true
  print(i2 == [5, 24]); // => false

  print(i2 > idx2D(0, 0)); // => true
  print(i2 > idx2D(10, 20)); // => false
  print(i2 >= idx2D(5, 5)); // => true
  print(i2 >= idx2D(4, 30)); // => false
  print(i2 >= idx2D(5, 25)); // => true

  print(i2 < idx2D(4, 30)); // => false
  print(i2 < idx2D(10, 30)); // => true
  print(i2 <= idx2D(10, 20)); // => false
  print(i2 <= idx2D(10, 30)); // => true
  print(i2 <= idx2D(5, 25)); // => true

grizzly_primitives's People

Contributors

tejainece avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

weenzeel

grizzly_primitives's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.