Giter Club home page Giter Club logo

qsts's Introduction

qsts

qsts specialises in parsing arithmetic expressions and calculating derivatives via automatic differentiation.

See examples folder for how you can use qsts. :)

To build : make

To test : make test

See my blog post on this here

qsts's People

Contributors

llyr-who avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

fredericwantiez

qsts's Issues

Refactor file structure

Problem

Most of the files are in io. This is wrong. As not all of these things deal with io.

Acceptance Criteria

  • everything makes sense.
  • everything looks neat.
  • make CMake happy.

qsts currently only works with single char variables names

Problem

qsts currently only works with single char variables names. This might be a problem for some people.

Suggested Solution

Implement a "scanner" of some kind that will scan a string or terminal input and generate a list (maybe) of parse_tokens (maybe). Alter the infix,postfix types accordingly.

Acceptance Criteria

  • calling expression("hello + ginger * zing - (a + b-d)") will generate a valid expression.
  • test, as always

Symmetric nodes are not deemed as equivalent

Problem

Suppose we have a node [+, A,B]. The first component is a parent and the second and third are children. We want [+, A,B] == [+, B,A] to be true. As this agrees with our understanding of mathematics. Currently this is not implemented. One little pitfall is that we do NOT want [/, A,B] == [/, B,A] to be true as 9/4 != 4/9 etc.

Acceptance Criteria

  • add the logic that solves the above problem.
  • tests added that show the nodes are now unique for appropriate cases.

Large .hpp files

Problem

We rarely use template classes in qsts. So we should consider splitting these .hpp files into implementation (.cpp) and definition (.hpp) files for (almost) every class in the .hpp files. Within each .hpp file there are several classes which have now become quite bloated. Alternatively we could just split into more .hpp files

Acceptance Criteria

  • Clean seperation of files
  • More tests to be added
  • All tests pass.

Add unary operators

Problem

no unary functions

Suggested Solution

This is a two stage process. The first stage is getting qsts to parse unary operators, i.e. functions, and form graphs that contain them. The second stage is being able to differentiate unary functions.

For the first stage you will have to investigate how to deal with infix->postfix conversion where unary functions are part of the infix expression. This is not as simple as it looks and google will be your friend. The differentiation part will be quite simple once you can form expression graphs with functions.

AC

  • Correctly obtain gradients of expressions containing unary functions.
  • Tested with examples.

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.