Skip to content

Commit

Permalink
v0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Feb 11, 2015
1 parent ec93d40 commit 5df98e4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main": "js/dist/polynomial.js",
"version": "0.0.4",
"version": "0.0.5",
"homepage": "http://aureooms.github.io/js-polynomial/",
"name": "aureooms-js-polynomial",
"description": "sparse and dense polynomials code bricks for JavaScript",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "sparse and dense polynomials code bricks for JavaScript",
"version": "0.0.4",
"version": "0.0.5",
"repo": "aureooms/js-polynomial",
"scripts": [
"js/dist/polynomial.js"
Expand Down
60 changes: 60 additions & 0 deletions js/dist/polynomial.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,66 @@ var __ladd__ = function ( nadd , copy ) {

exports.__ladd__ = __ladd__ ;

/* js/src/div */
/* js/src/div/bdiv.js */

/**
* @param {number function} iszero checks if a number is 0
* @param {number function} iadd adds two numbers in place
* @param {number function} isubmul subtracts the multiple of a number to a number in place
* @param {number function} izero zero number constructor, in place (to allow recycling)
*/

var _bdiv = function ( iszero , iadd , isubmul , izero ) {

/**
* Big endian dense polynomial division.
*
* @param {dense polynomial array} b divisor, normalized
* @param {dense polynomial array begin} bi
* @param {dense polynomial array end} bj
* @param {dense polynomial array} q quotient, initialized to zero
* @param {dense polynomial array begin} qi
* @param {dense polynomial array end} qj
* @param {dense polynomial array} r remainder, initialized to dividend
* @param {dense polynomial array begin} ri
* @param {dense polynomial array end} rj
*/

var bdiv = function ( b , bi , bj , q , qi , qj , r , ri , rj ) {

var m , n , c , y ;

m = rj - ri ;
n = bj - bi ;

for ( ; m >= n ; ++ri , --m ) {

if ( iszero( r[ri] ) ) {
++ri ;
--m ;
continue ;
}

// b fits r[ri] times in r
// we add r[ri] * x^(m-n) to q

q[qj-m+n] = iadd( q[qj-m+n] , r[ri] ) ;

for ( i = 1 ; i < n ; ++i ) {
r[ri+i] = isubmul( r[ri+i] , b[bi+i] , r[ri] ) ;
}

// leading coefficient set to zero

r[ri] = izero( r[ri] ) ;

}

} ;

} ;

/* js/src/evaluate */
/* js/src/evaluate/evaluate.js */

Expand Down
2 changes: 1 addition & 1 deletion js/dist/polynomial.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"bugs": {
"url": "https://github.com/aureooms/js-polynomial/issues"
},
"version": "0.0.4",
"version": "0.0.5",
"name": "aureooms-js-polynomial",
"description": "sparse and dense polynomials code bricks for JavaScript",
"keywords": [
Expand Down Expand Up @@ -34,4 +34,4 @@
"type": "git"
},
"license": "AGPL-3.0"
}
}

0 comments on commit 5df98e4

Please sign in to comment.