From 75f1118f79117bc4b7e70c035bc0fa3993c1cc7d Mon Sep 17 00:00:00 2001 From: Shireesha Bongarala Date: Sun, 3 Feb 2019 12:52:56 +0530 Subject: [PATCH 1/2] Rename `eye` to `identity` in mathjs from v5 https://github.com/josdejong/mathjs/issues/1054 --- types/mathjs/index.d.ts | 10 +++++----- types/mathjs/mathjs-tests.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index c72ca68941..c71b283f21 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for mathjs 4.4 +// Type definitions for mathjs 5 // Project: http://mathjs.org/ // Definitions by: Ilya Shestakov , // Andy Patterson , @@ -1277,7 +1277,7 @@ declare namespace math { * @param format The Matrix storage format * @returns A matrix with ones on the diagonal */ - eye( + identity( size: number | number[] | Matrix | MathArray, format?: string ): Matrix | MathArray | number; @@ -1287,7 +1287,7 @@ declare namespace math { * @param format The Matrix storage format * @returns A matrix with ones on the diagonal */ - eye(m: number, n: number, format?: string): Matrix | MathArray | number; + identity(m: number, n: number, format?: string): Matrix | MathArray | number; /** * Filter the items in an array or one dimensional matrix. @@ -3714,12 +3714,12 @@ declare namespace math { * matrix has ones on the diagonal and zeros elsewhere. * @param format The Matrix storage format */ - eye(format?: string): MathJsChain; + identity(format?: string): MathJsChain; /** * @param n The y dimension for the matrix * @param format The Matrix storage format */ - eye(n: number, format?: string): MathJsChain; + identity(n: number, format?: string): MathJsChain; /** * Filter the items in an array or one dimensional matrix. diff --git a/types/mathjs/mathjs-tests.ts b/types/mathjs/mathjs-tests.ts index 15d455e427..f336da0a0b 100644 --- a/types/mathjs/mathjs-tests.ts +++ b/types/mathjs/mathjs-tests.ts @@ -294,7 +294,7 @@ Sparse matrices examples */ { // create a sparse matrix - const a = math.eye(1000, 1000, 'sparse'); + const a = math.identity(1000, 1000, 'sparse'); // do operations with a sparse matrix const b = math.multiply(a, a); From 6f5cfcb9e0e7ecf7561cfe6a922d002ea14ebe2b Mon Sep 17 00:00:00 2001 From: Shireesha Bongarala Date: Sun, 3 Feb 2019 13:05:34 +0530 Subject: [PATCH 2/2] Add minor version --- types/mathjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index c71b283f21..20fb7154cb 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for mathjs 5 +// Type definitions for mathjs 5.0 // Project: http://mathjs.org/ // Definitions by: Ilya Shestakov , // Andy Patterson ,