Skip to content

Commit 25c6880

Browse files
committed
Add license header
This change makes it easier to comply with the terms of the Numeric license when using compilers or minifiers.
1 parent 656fa12 commit 25c6880

File tree

5 files changed

+193
-95
lines changed

5 files changed

+193
-95
lines changed

src/numeric.js

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/**
2+
* @license
3+
* Numeric Javascript
4+
* Copyright (C) 2011 by Sébastien Loisel
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
"use strict";
226

327
var numeric = (typeof exports === "undefined")?(function numeric() {}):(exports);

src/quadprog.js

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/**
2+
* @license
3+
* Numeric Javascript
4+
* Copyright (C) 2011 by Sébastien Loisel
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
/* This file is a slightly modified version of quadprog.js from Alberto Santini.
226
* It has been slightly modified by Sébastien Loisel to make sure that it handles
327
* 0-based Arrays instead of 1-based Arrays.

src/seedrandom.js

+97-94
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,100 @@
1-
// seedrandom.js version 2.0.
2-
// Author: David Bau 4/2/2011
3-
//
4-
// Defines a method Math.seedrandom() that, when called, substitutes
5-
// an explicitly seeded RC4-based algorithm for Math.random(). Also
6-
// supports automatic seeding from local or network sources of entropy.
7-
//
8-
// Usage:
9-
//
10-
// <script src=http://davidbau.com/encode/seedrandom-min.js></script>
11-
//
12-
// Math.seedrandom('yipee'); Sets Math.random to a function that is
13-
// initialized using the given explicit seed.
14-
//
15-
// Math.seedrandom(); Sets Math.random to a function that is
16-
// seeded using the current time, dom state,
17-
// and other accumulated local entropy.
18-
// The generated seed string is returned.
19-
//
20-
// Math.seedrandom('yowza', true);
21-
// Seeds using the given explicit seed mixed
22-
// together with accumulated entropy.
23-
//
24-
// <script src="http://bit.ly/srandom-512"></script>
25-
// Seeds using physical random bits downloaded
26-
// from random.org.
27-
//
28-
// <script src="https://jsonlib.appspot.com/urandom?callback=Math.seedrandom">
29-
// </script> Seeds using urandom bits from call.jsonlib.com,
30-
// which is faster than random.org.
31-
//
32-
// Examples:
33-
//
34-
// Math.seedrandom("hello"); // Use "hello" as the seed.
35-
// document.write(Math.random()); // Always 0.5463663768140734
36-
// document.write(Math.random()); // Always 0.43973793770592234
37-
// var rng1 = Math.random; // Remember the current prng.
38-
//
39-
// var autoseed = Math.seedrandom(); // New prng with an automatic seed.
40-
// document.write(Math.random()); // Pretty much unpredictable.
41-
//
42-
// Math.random = rng1; // Continue "hello" prng sequence.
43-
// document.write(Math.random()); // Always 0.554769432473455
44-
//
45-
// Math.seedrandom(autoseed); // Restart at the previous seed.
46-
// document.write(Math.random()); // Repeat the 'unpredictable' value.
47-
//
48-
// Notes:
49-
//
50-
// Each time seedrandom('arg') is called, entropy from the passed seed
51-
// is accumulated in a pool to help generate future seeds for the
52-
// zero-argument form of Math.seedrandom, so entropy can be injected over
53-
// time by calling seedrandom with explicit data repeatedly.
54-
//
55-
// On speed - This javascript implementation of Math.random() is about
56-
// 3-10x slower than the built-in Math.random() because it is not native
57-
// code, but this is typically fast enough anyway. Seeding is more expensive,
58-
// especially if you use auto-seeding. Some details (timings on Chrome 4):
59-
//
60-
// Our Math.random() - avg less than 0.002 milliseconds per call
61-
// seedrandom('explicit') - avg less than 0.5 milliseconds per call
62-
// seedrandom('explicit', true) - avg less than 2 milliseconds per call
63-
// seedrandom() - avg about 38 milliseconds per call
64-
//
65-
// LICENSE (BSD):
66-
//
67-
// Copyright 2010 David Bau, all rights reserved.
68-
//
69-
// Redistribution and use in source and binary forms, with or without
70-
// modification, are permitted provided that the following conditions are met:
71-
//
72-
// 1. Redistributions of source code must retain the above copyright
73-
// notice, this list of conditions and the following disclaimer.
74-
//
75-
// 2. Redistributions in binary form must reproduce the above copyright
76-
// notice, this list of conditions and the following disclaimer in the
77-
// documentation and/or other materials provided with the distribution.
78-
//
79-
// 3. Neither the name of this module nor the names of its contributors may
80-
// be used to endorse or promote products derived from this software
81-
// without specific prior written permission.
82-
//
83-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
84-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
85-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
86-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
87-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
88-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
90-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
91-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
92-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
93-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94-
//
1+
/**
2+
* @fileoverview
3+
* seedrandom.js version 2.0.
4+
* Author: David Bau 4/2/2011
5+
*
6+
* Defines a method Math.seedrandom() that, when called, substitutes
7+
* an explicitly seeded RC4-based algorithm for Math.random(). Also
8+
* supports automatic seeding from local or network sources of entropy.
9+
*
10+
* Usage:
11+
*
12+
* <script src=http://davidbau.com/encode/seedrandom-min.js></script>
13+
*
14+
* Math.seedrandom('yipee'); Sets Math.random to a function that is
15+
* initialized using the given explicit seed.
16+
*
17+
* Math.seedrandom(); Sets Math.random to a function that is
18+
* seeded using the current time, dom state,
19+
* and other accumulated local entropy.
20+
* The generated seed string is returned.
21+
*
22+
* Math.seedrandom('yowza', true);
23+
* Seeds using the given explicit seed mixed
24+
* together with accumulated entropy.
25+
*
26+
* <script src="http://bit.ly/srandom-512"></script>
27+
* Seeds using physical random bits downloaded
28+
* from random.org.
29+
*
30+
* <script src="https://jsonlib.appspot.com/urandom?callback=Math.seedrandom">
31+
* </script> Seeds using urandom bits from call.jsonlib.com,
32+
* which is faster than random.org.
33+
*
34+
* Examples:
35+
*
36+
* Math.seedrandom("hello"); // Use "hello" as the seed.
37+
* document.write(Math.random()); // Always 0.5463663768140734
38+
* document.write(Math.random()); // Always 0.43973793770592234
39+
* var rng1 = Math.random; // Remember the current prng.
40+
*
41+
* var autoseed = Math.seedrandom(); // New prng with an automatic seed.
42+
* document.write(Math.random()); // Pretty much unpredictable.
43+
*
44+
* Math.random = rng1; // Continue "hello" prng sequence.
45+
* document.write(Math.random()); // Always 0.554769432473455
46+
*
47+
* Math.seedrandom(autoseed); // Restart at the previous seed.
48+
* document.write(Math.random()); // Repeat the 'unpredictable' value.
49+
*
50+
* Notes:
51+
*
52+
* Each time seedrandom('arg') is called, entropy from the passed seed
53+
* is accumulated in a pool to help generate future seeds for the
54+
* zero-argument form of Math.seedrandom, so entropy can be injected over
55+
* time by calling seedrandom with explicit data repeatedly.
56+
*
57+
* On speed - This javascript implementation of Math.random() is about
58+
* 3-10x slower than the built-in Math.random() because it is not native
59+
* code, but this is typically fast enough anyway. Seeding is more expensive,
60+
* especially if you use auto-seeding. Some details (timings on Chrome 4):
61+
*
62+
* Our Math.random() - avg less than 0.002 milliseconds per call
63+
* seedrandom('explicit') - avg less than 0.5 milliseconds per call
64+
* seedrandom('explicit', true) - avg less than 2 milliseconds per call
65+
* seedrandom() - avg about 38 milliseconds per call
66+
*
67+
* @license
68+
* seedrandom.js
69+
* Copyright 2010 David Bau, all rights reserved.
70+
*
71+
* Redistribution and use in source and binary forms, with or without
72+
* modification, are permitted provided that the following conditions are met:
73+
*
74+
* 1. Redistributions of source code must retain the above copyright
75+
* notice, this list of conditions and the following disclaimer.
76+
*
77+
* 2. Redistributions in binary form must reproduce the above copyright
78+
* notice, this list of conditions and the following disclaimer in the
79+
* documentation and/or other materials provided with the distribution.
80+
*
81+
* 3. Neither the name of this module nor the names of its contributors may
82+
* be used to endorse or promote products derived from this software
83+
* without specific prior written permission.
84+
*
85+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
86+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
87+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
88+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
89+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
90+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
91+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
92+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
93+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
94+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
95+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
96+
*/
97+
9598
/**
9699
* All code is in an anonymous closure to keep the global namespace clean.
97100
*

src/sparse2.js

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/**
2+
* @license
3+
* Numeric Javascript
4+
* Copyright (C) 2011 by Sébastien Loisel
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
numeric.Sparse = function Sparse(p,v) { this.p = p; this.v = v; }
226
numeric.Sparse.scatter = function scatter(i,j,z) {
327
var n = numeric.sup(j)+1,m=i.length,jk;

src/svd.js

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/**
2+
* @license
3+
* Numeric Javascript
4+
* Copyright (C) 2011 by Sébastien Loisel
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
/*
226
Shanti Rao sent me this routine by private email. I had to modify it
327
slightly to work on Arrays instead of using a Matrix object.
@@ -293,4 +317,3 @@ numeric.svd= function svd(A) {
293317

294318
return {U:u,S:q,V:v}
295319
};
296-

0 commit comments

Comments
 (0)