Git Product home page Git Product logo

quadraticreducer's Introduction

Quadratic Reducer

Implementation of Lagrange method for reducing a quadratic form.
The case where variable change is needed because no squares left isn't covered yet.

Requirements

  • Java [JDK 17+]
  • Maven [3.0+]

Setup

Building artifact:

 mvn clean compile assembly:single

Running:

 java -jar QuadraticReducer-1.0.jar -input [variable count] ["polynomial"]



For example:

 java -jar QuadraticReducer-1.0.jar -input 3 "5x1d2+16x1x2+-14x1x3+13x2d2+-22x2x3+10x3d2" 

Output:

 1 0 0 
 0 1 0
 0 0 0
 1 2.236x1+3.578x2+-3.130x3
 2 0.447x2+0.447x3
 3 x3

which represents quadratic form in canonical basis and how this basis is evaluated from implicitly given.

Input and output of polynomials

Term is represented as [coefficient]x[variable id]d[variable power]x[]d[]x[]d[]....
[coefficient] and d[variable power] can be omitted if they are equal to 1.
At the moment only integer coefficients can be parsed whereas output coefficients are always floating point.

Polynomial is represented as list of terms concatenated with +. Note that if not a first coefficient starts with - it will look like +-.

quadraticreducer's People

Contributors

jejutic avatar

Stargazers

 avatar

Watchers

 avatar

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.