ml-spectra-processing
Advanced tools
Comparing version 9.2.0 to 10.0.0
@@ -22,2 +22,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
export * from './x/xIsMonotone'; | ||
export * from './x/xIsMonotoneIncreasing'; | ||
export * from './x/xMaxIndex'; | ||
@@ -120,3 +121,5 @@ export * from './x/xMaxValue'; | ||
export * from './matrix/matrixApplyNumericalEncoding'; | ||
export * from './utils/createXArray'; | ||
export * from './utils/createFromToArray'; | ||
export * from './utils/createNormalRandomArray'; | ||
export * from './utils/createStepArray'; | ||
export declare type DoubleMatrix = DoubleArray[]; | ||
@@ -123,0 +126,0 @@ export interface Zone { |
@@ -21,2 +21,3 @@ export * from './reim/reimAbsolute'; | ||
export * from './x/xIsMonotone'; | ||
export * from './x/xIsMonotoneIncreasing'; | ||
export * from './x/xMaxIndex'; | ||
@@ -119,3 +120,5 @@ export * from './x/xMaxValue'; | ||
export * from './matrix/matrixApplyNumericalEncoding'; | ||
export * from './utils/createXArray'; | ||
export * from './utils/createFromToArray'; | ||
export * from './utils/createNormalRandomArray'; | ||
export * from './utils/createStepArray'; | ||
//# sourceMappingURL=index.js.map |
/** | ||
* Numerically encodes the strings in the matrix with an encoding dictionary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -5,0 +5,0 @@ * @returns - encoded matrix |
@@ -5,3 +5,3 @@ import { xMaxValue } from '../x/xMaxValue'; | ||
* Numerically encodes the strings in the matrix with an encoding dictionary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -8,0 +8,0 @@ * @returns - encoded matrix |
@@ -5,5 +5,5 @@ import { DoubleMatrix } from '..'; | ||
* | ||
* @param matrix - matrix [rows][cols]. | ||
* @param matrix - matrix [rows][cols] | ||
*/ | ||
export declare function matrixCenterZMean(matrix: DoubleMatrix): DoubleMatrix; | ||
//# sourceMappingURL=matrixCenterZMean.d.ts.map |
/** | ||
* Center mean of columns | ||
* | ||
* @param matrix - matrix [rows][cols]. | ||
* @param matrix - matrix [rows][cols] | ||
*/ | ||
@@ -6,0 +6,0 @@ export function matrixCenterZMean(matrix) { |
/** | ||
* Creates a clone of a matrix | ||
* @param options - Options | ||
* @param options.from - from | ||
* @param options.to - to | ||
* @param options.length - length | ||
* @returns - array of floats | ||
* Clone the matrix | ||
*/ | ||
export declare function matrixClone(matrix: any[]): any[]; | ||
//# sourceMappingURL=matrixClone.d.ts.map |
/** | ||
* Creates a clone of a matrix | ||
* @param options - Options | ||
* @param options.from - from | ||
* @param options.to - to | ||
* @param options.length - length | ||
* @returns - array of floats | ||
* Clone the matrix | ||
*/ | ||
@@ -9,0 +4,0 @@ export function matrixClone(matrix) { |
@@ -23,10 +23,12 @@ import { xHistogram } from '../x/xHistogram'; | ||
if (options.min === undefined) { | ||
options.min = logBaseX | ||
? Math.log(minMax.min) / Math.log(logBaseX) | ||
: minMax.min; | ||
options.min = | ||
logBaseX && minMax.min | ||
? Math.log(minMax.min) / Math.log(logBaseX) | ||
: minMax.min; | ||
} | ||
if (options.max === undefined) { | ||
options.max = logBaseX | ||
? Math.log(minMax.max) / Math.log(logBaseX) | ||
: minMax.max; | ||
options.max = | ||
logBaseX && minMax.max | ||
? Math.log(minMax.max) / Math.log(logBaseX) | ||
: minMax.max; | ||
} | ||
@@ -33,0 +35,0 @@ } |
import { matrixClone } from './matrixClone'; | ||
/** | ||
* Numerically decodes the matrix using the dictionnary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -6,0 +6,0 @@ * @returns - decoded matrix |
/** | ||
* Numerically encodes the strings in the matrix and returns an encoding dictionnary which can be used to encode other matrices | ||
* @param matrix - original matrix before encoding | ||
* @param dictCategoricalToNumerical - dictionnary for encoding | ||
* @returns - dictionnary from string to number | ||
@@ -5,0 +6,0 @@ */ |
@@ -5,2 +5,3 @@ import { matrixClone } from './matrixClone'; | ||
* @param matrix - original matrix before encoding | ||
* @param dictCategoricalToNumerical - dictionnary for encoding | ||
* @returns - dictionnary from string to number | ||
@@ -7,0 +8,0 @@ */ |
@@ -9,5 +9,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param matrix - matrix [rows][cols]. | ||
* @param options Options | ||
* data: Normalized dataset. | ||
* medianOfQuotients: The median of quotients of each variables. | ||
* @param options - options | ||
* @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables} | ||
*/ | ||
@@ -14,0 +13,0 @@ export declare function matrixPQN(matrix: DoubleMatrix, options?: { |
@@ -9,5 +9,4 @@ import { Matrix } from 'ml-matrix'; | ||
* @param matrix - matrix [rows][cols]. | ||
* @param options Options | ||
* data: Normalized dataset. | ||
* medianOfQuotients: The median of quotients of each variables. | ||
* @param options - options | ||
* @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables} | ||
*/ | ||
@@ -14,0 +13,0 @@ export function matrixPQN(matrix, options = {}) { |
@@ -1,2 +0,1 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { DataReIm } from '../index'; | ||
@@ -6,6 +5,6 @@ /** | ||
* | ||
* @param data - DATA | ||
* @returns - array of float | ||
* @param data - complex spectrum | ||
* @returns - reimAbsolute value | ||
*/ | ||
export declare function reimAbsolute(data: DataReIm): DoubleArray; | ||
export declare function reimAbsolute(data: DataReIm): Float64Array; | ||
//# sourceMappingURL=reimAbsolute.d.ts.map |
/** | ||
* Calculates reimAbsolute value of a complex spectrum | ||
* | ||
* @param data - DATA | ||
* @returns - array of float | ||
* @param data - complex spectrum | ||
* @returns - reimAbsolute value | ||
*/ | ||
@@ -7,0 +7,0 @@ export function reimAbsolute(data) { |
@@ -6,4 +6,4 @@ import { DataReIm } from '../index'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @param data - complex spectrum | ||
* @param options - options | ||
*/ | ||
@@ -10,0 +10,0 @@ export declare function reimAutoPhaseCorrection(data: DataReIm, options?: { |
@@ -8,4 +8,4 @@ import { xNoiseSanPlot } from '../x/xNoiseSanPlot'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @param data - complex spectrum | ||
* @param options - options | ||
*/ | ||
@@ -12,0 +12,0 @@ export function reimAutoPhaseCorrection(data, options = {}) { |
@@ -5,5 +5,5 @@ import { DataReIm } from '..'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @returns DataReim. | ||
* @param data - complex spectrum | ||
* @param options - options. | ||
* @returns FFT of complex spectrum. | ||
*/ | ||
@@ -10,0 +10,0 @@ export declare function reimFFT(data: DataReIm, options?: { |
@@ -6,5 +6,5 @@ import FFT from 'fft.js'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @returns DataReim. | ||
* @param data - complex spectrum | ||
* @param options - options. | ||
* @returns FFT of complex spectrum. | ||
*/ | ||
@@ -11,0 +11,0 @@ export function reimFFT(data, options = {}) { |
@@ -5,3 +5,3 @@ import { DataReIm } from '..'; | ||
* | ||
* @param data DataReIm | ||
* @param data - complex spectrum | ||
* @param phi0 - Angle in radians for zero order phase correction | ||
@@ -8,0 +8,0 @@ * @param phi1 - Angle in radians for first order phase correction |
/** | ||
* Phase correction filter | ||
* | ||
* @param data DataReIm | ||
* @param data - complex spectrum | ||
* @param phi0 - Angle in radians for zero order phase correction | ||
@@ -6,0 +6,0 @@ * @param phi1 - Angle in radians for first order phase correction |
@@ -0,3 +1,13 @@ | ||
/** | ||
* Function for comparing numbers and sorting them in ascending order | ||
* | ||
* @param options - options | ||
*/ | ||
export declare function numberSortAscending(left: number, right: number): number; | ||
/** | ||
* Function for comparing numbers and sorting them in descending order | ||
* | ||
* @param options - options | ||
*/ | ||
export declare function numberSortDescending(left: number, right: number): number; | ||
//# sourceMappingURL=numberSort.d.ts.map |
@@ -6,2 +6,7 @@ function assertNumber(number) { | ||
} | ||
/** | ||
* Function for comparing numbers and sorting them in ascending order | ||
* | ||
* @param options - options | ||
*/ | ||
export function numberSortAscending(left, right) { | ||
@@ -18,2 +23,7 @@ assertNumber(left); | ||
} | ||
/** | ||
* Function for comparing numbers and sorting them in descending order | ||
* | ||
* @param options - options | ||
*/ | ||
export function numberSortDescending(left, right) { | ||
@@ -20,0 +30,0 @@ assertNumber(left); |
/** | ||
* RayleighCdf. | ||
* | ||
* @param x - Number. | ||
* @param sigma - Number. | ||
* @returns Number. | ||
* @param x - data | ||
* @param sigma - standard deviation | ||
* @returns - rayleigh cdf | ||
*/ | ||
export default function rayleighCdf(x: number, sigma?: number): number; | ||
//# sourceMappingURL=rayleighCdf.d.ts.map |
/** | ||
* RayleighCdf. | ||
* | ||
* @param x - Number. | ||
* @param sigma - Number. | ||
* @returns Number. | ||
* @param x - data | ||
* @param sigma - standard deviation | ||
* @returns - rayleigh cdf | ||
*/ | ||
@@ -8,0 +8,0 @@ export default function rayleighCdf(x, sigma = 1) { |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - array of number | ||
* @returns - absolute array | ||
* @param array - array of data | ||
* @returns - array with absolute values | ||
*/ | ||
export declare function xAbsolute(array: DoubleArray): DoubleArray; | ||
//# sourceMappingURL=xAbsolute.d.ts.map |
/** | ||
* This function returns an array with absolute values | ||
* | ||
* @param array - array of number | ||
* @returns - absolute array | ||
* @param array - array of data | ||
* @returns - array with absolute values | ||
*/ | ||
@@ -7,0 +7,0 @@ export function xAbsolute(array) { |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - the array for which we want to calculate the absolute value | ||
* @returns - median | ||
@@ -8,0 +8,0 @@ */ |
@@ -6,3 +6,3 @@ import { xAbsolute } from './xAbsolute'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - the array for which we want to calculate the absolute value | ||
* @returns - median | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array2 - the second array | ||
* @param array1 - the first array | ||
* @param array2 - the second array or number | ||
*/ | ||
export declare function xAdd(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xAdd(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xAdd.d.ts.map |
@@ -5,4 +5,4 @@ import { isAnyArray } from 'is-any-array'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array2 - the second array | ||
* @param array1 - the first array | ||
* @param array2 - the second array or number | ||
*/ | ||
@@ -19,5 +19,4 @@ export function xAdd(array1, array2) { | ||
isConstant = true; | ||
constant = Number(array2); | ||
constant = array2; | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -24,0 +23,0 @@ if (isConstant) { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the auto-correlation of a vector | ||
* Calculates the auto-correlation of an array | ||
* | ||
* @param A - the array that will be fixed | ||
* @param A - the array for which to calculate the auto-correlation | ||
* @param options - Options | ||
@@ -7,0 +7,0 @@ */ |
import { xCrossCorrelation } from './xCrossCorrelation'; | ||
/** | ||
* Calculates the auto-correlation of a vector | ||
* Calculates the auto-correlation of an array | ||
* | ||
* @param A - the array that will be fixed | ||
* @param A - the array for which to calculate the auto-correlation | ||
* @param options - Options | ||
@@ -7,0 +7,0 @@ */ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* This function xSubtract the first array by the second array or a constant value from each element of the first array | ||
* Calculating the box plot of the array | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - data | ||
*/ | ||
@@ -7,0 +7,0 @@ export declare function xBoxPlot(array: DoubleArray): { |
/** | ||
* This function xSubtract the first array by the second array or a constant value from each element of the first array | ||
* Calculating the box plot of the array | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - data | ||
*/ | ||
@@ -6,0 +6,0 @@ export function xBoxPlot(array) { |
@@ -1,8 +0,8 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Checks if input is valdi | ||
* Checks if input is of type array | ||
* | ||
* @param input - input | ||
*/ | ||
export declare function xCheck(input?: DoubleArray | Uint16Array): void; | ||
export declare function xCheck(input?: NumberArray): void; | ||
/** | ||
@@ -9,0 +9,0 @@ * XCheckLengths. |
import { isAnyArray } from 'is-any-array'; | ||
/** | ||
* Checks if input is valdi | ||
* Checks if input is of type array | ||
* | ||
@@ -5,0 +5,0 @@ * @param input - input |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param A - the array that will be rotated | ||
* @param A - first array | ||
* @param B - sencond array | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @param A - the array that will be rotated | ||
* @param A - first array | ||
* @param B - sencond array | ||
@@ -8,0 +8,0 @@ */ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the cross-correlation between 2 vectors | ||
* Calculates the cross-correlation between 2 arrays | ||
* | ||
@@ -20,3 +20,3 @@ * @param A - fixed array | ||
lag?: number; | ||
}): DoubleArray; | ||
}): Float64Array; | ||
//# sourceMappingURL=xCrossCorrelation.d.ts.map |
import { xDotProduct } from './xDotProduct'; | ||
/** | ||
* Calculates the cross-correlation between 2 vectors | ||
* Calculates the cross-correlation between 2 arrays | ||
* | ||
@@ -5,0 +5,0 @@ * @param A - fixed array |
@@ -5,5 +5,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - DoubleArray | ||
* @param array - initial array | ||
*/ | ||
export declare function xCumulative(array: DoubleArray): DoubleArray; | ||
export declare function xCumulative(array: DoubleArray): Float64Array; | ||
//# sourceMappingURL=xCumulative.d.ts.map |
@@ -5,3 +5,3 @@ import { isAnyArray } from 'is-any-array'; | ||
* | ||
* @param array - DoubleArray | ||
* @param array - initial array | ||
*/ | ||
@@ -8,0 +8,0 @@ export function xCumulative(array) { |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array or number | ||
@@ -8,0 +8,0 @@ * |
@@ -5,3 +5,3 @@ import { isAnyArray } from 'is-any-array'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array or number | ||
@@ -22,3 +22,2 @@ * | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -25,0 +24,0 @@ if (isConstant) { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* XDotProduct. | ||
* Dot product between two arrays | ||
* | ||
@@ -5,0 +5,0 @@ * @param A - First array. |
import { xMultiply } from './xMultiply'; | ||
/** | ||
* XDotProduct. | ||
* Dot product between two arrays | ||
* | ||
@@ -5,0 +5,0 @@ * @param A - First array. |
import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
/** | ||
* Calculates an histogram of defined number of slots | ||
* Calculates a histogram of defined number of slots | ||
* | ||
@@ -5,0 +5,0 @@ * @param array - Array containing values |
@@ -1,2 +0,2 @@ | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
import { xAbsolute } from './xAbsolute'; | ||
@@ -7,3 +7,3 @@ import { xCheck } from './xCheck'; | ||
/** | ||
* Calculates an histogram of defined number of slots | ||
* Calculates a histogram of defined number of slots | ||
* | ||
@@ -32,7 +32,7 @@ * @param array - Array containing values | ||
const x = histogram === undefined | ||
? createXArray({ | ||
? Array.from(createFromToArray({ | ||
from: min + (centerX ? slotSize / 2 : 0), | ||
to: max - (centerX ? slotSize / 2 : 0), | ||
length: nbSlots, | ||
}) | ||
})) | ||
: histogram.x; | ||
@@ -39,0 +39,0 @@ array.forEach((element) => { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Check if the values are separated by always the same difference | ||
* Check if the values are separated always by the same difference | ||
* | ||
@@ -5,0 +5,0 @@ * @param array - Monotone growing array of number |
/** | ||
* Check if the values are separated by always the same difference | ||
* Check if the values are separated always by the same difference | ||
* | ||
@@ -4,0 +4,0 @@ * @param array - Monotone growing array of number |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -6,5 +6,5 @@ * Computes the index of the maximum of the given values | ||
* @param array - array of numbers | ||
* @returns - indexe | ||
* @returns - index | ||
*/ | ||
export declare function xMaxIndex(array: DoubleArray | Uint16Array): number; | ||
export declare function xMaxIndex(array: NumberArray): number; | ||
//# sourceMappingURL=xMaxIndex.d.ts.map |
@@ -6,3 +6,3 @@ import { xCheck } from './xCheck'; | ||
* @param array - array of numbers | ||
* @returns - indexe | ||
* @returns - index | ||
*/ | ||
@@ -9,0 +9,0 @@ export function xMaxIndex(array) { |
@@ -1,9 +0,9 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* | ||
* @param array - array of number | ||
* @param array - array of numbers | ||
* @param options - options | ||
*/ | ||
export declare function xMaxValue(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMaxValue(array: NumberArray, options?: { | ||
/** | ||
@@ -10,0 +10,0 @@ * First point for xyIntegration |
@@ -5,3 +5,3 @@ import { xCheck } from './xCheck'; | ||
* | ||
* @param array - array of number | ||
* @param array - array of numbers | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -1,4 +0,4 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* Computes the mean value of an array of values | ||
* | ||
@@ -8,3 +8,3 @@ * @param array - array of numbers | ||
*/ | ||
export declare function xMean(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMean(array: NumberArray, options?: { | ||
/** | ||
@@ -11,0 +11,0 @@ * First point for xyIntegration |
import { xCheck } from './xCheck'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* Computes the mean value of an array of values | ||
* | ||
@@ -5,0 +5,0 @@ * @param array - array of numbers |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Calculates the median of an array | ||
*/ | ||
export declare function xMedian(input: DoubleArray | Uint16Array): any; | ||
export declare function xMedian(input: NumberArray): any; | ||
//# sourceMappingURL=xMedian.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -7,3 +7,3 @@ * Computes the index of the minimum of the given values | ||
*/ | ||
export declare function xMinIndex(array: DoubleArray | Uint16Array): number; | ||
export declare function xMinIndex(array: NumberArray): number; | ||
//# sourceMappingURL=xMinIndex.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Return min and max values of an array | ||
*/ | ||
export declare function xMinMaxValues(array: DoubleArray | Uint16Array): { | ||
export declare function xMinMaxValues(array: NumberArray): { | ||
min: number; | ||
@@ -11,0 +11,0 @@ max: number; |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Computes the minimal value of an array of values | ||
*/ | ||
export declare function xMinValue(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMinValue(array: NumberArray, options?: { | ||
/** | ||
@@ -11,0 +11,0 @@ * First point for xyIntegration |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Calculates the mode of an array | ||
*/ | ||
export declare function xMode(input: DoubleArray | Uint16Array): number; | ||
export declare function xMode(input: NumberArray): number; | ||
//# sourceMappingURL=xMode.d.ts.map |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array | ||
*/ | ||
export declare function xMultiply(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xMultiply(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xMultiply.d.ts.map |
@@ -5,3 +5,3 @@ import { isAnyArray } from 'is-any-array'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array | ||
@@ -8,0 +8,0 @@ */ |
import SplineInterpolator from 'spline-interpolator'; | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
import erfcinv from './erfcinv'; | ||
@@ -301,3 +301,3 @@ import rayleighCdf from './rayleighCdf'; | ||
} | ||
const xAxis = createXArray({ | ||
const xAxis = createFromToArray({ | ||
from: 0, | ||
@@ -304,0 +304,0 @@ to: array.length - 1, |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xNorm([3, 4]) -> 5 | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @returns - calculated norm | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,3 +5,3 @@ /** | ||
* @example xNorm([3, 4]) -> 5 | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @returns - calculated norm | ||
@@ -8,0 +8,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Divides the data with either the sum, the absolute sum or the maximum of the data | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xNormed(input: DoubleArray | Uint16Array, options?: { | ||
export declare function xNormed(input: NumberArray, options?: { | ||
/** value by which to divide the data | ||
@@ -23,4 +23,4 @@ * @default 'absolute' | ||
/** output into which the result should be placed if needed */ | ||
output?: DoubleArray | Uint16Array; | ||
}): any[] | Uint16Array | Float64Array; | ||
output?: NumberArray; | ||
}): any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; | ||
//# sourceMappingURL=xNormed.d.ts.map |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* This function pads an array | ||
* | ||
* | ||
*s | ||
* @param array - the array that will be padded | ||
@@ -25,3 +24,3 @@ * @param options - options | ||
algorithm?: string; | ||
}): DoubleArray; | ||
}): Float64Array; | ||
//# sourceMappingURL=xPadding.d.ts.map |
import { xCheck } from './xCheck'; | ||
/** | ||
* This function pads an array | ||
* | ||
* | ||
*s | ||
* @param array - the array that will be padded | ||
@@ -7,0 +6,0 @@ * @param options - options |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Function used to rescale data | ||
@@ -8,5 +8,5 @@ * | ||
*/ | ||
export declare function xRescale(input: DoubleArray | Uint16Array, options?: { | ||
export declare function xRescale(input: NumberArray, options?: { | ||
/** output into which to placed the data */ | ||
output?: DoubleArray | Uint16Array; | ||
output?: NumberArray; | ||
/** min used for the scaling */ | ||
@@ -18,3 +18,3 @@ min?: number; | ||
autoMinMax?: boolean; | ||
}): any[] | Uint16Array | Float64Array; | ||
}): any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; | ||
//# sourceMappingURL=xRescale.d.ts.map |
@@ -5,4 +5,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param fct - callback function that from an array returns a value. | ||
* @param array - array | ||
* @param fct - callback function that from an array returns a value | ||
* @param options - options | ||
@@ -9,0 +9,0 @@ */ |
@@ -6,4 +6,4 @@ import { xCheck } from './xCheck'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param fct - callback function that from an array returns a value. | ||
* @param array - array | ||
* @param fct - callback function that from an array returns a value | ||
* @param options - options | ||
@@ -10,0 +10,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - option | ||
@@ -8,0 +8,0 @@ */ |
@@ -6,3 +6,3 @@ import { xMean } from './xMean'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - option | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -6,3 +6,3 @@ import { xMaxValue } from './xMaxValue'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -6,3 +6,3 @@ import { xMedian } from './xMedian'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -9,0 +9,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -6,3 +6,3 @@ import { xMinValue } from './xMinValue'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -9,0 +9,0 @@ */ |
@@ -8,7 +8,7 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xRotate([1,2,3,4],-1) -> [2,3,4,1] | ||
* @param array - the array that will be rotated | ||
* @param shift - number | ||
* @returns - array of float | ||
* @param array - array | ||
* @param shift - shift | ||
* @returns - rotated array | ||
*/ | ||
export declare function xRotate(array: DoubleArray, shift: number): DoubleArray; | ||
//# sourceMappingURL=xRotate.d.ts.map |
@@ -7,5 +7,5 @@ /** | ||
* @example xRotate([1,2,3,4],-1) -> [2,3,4,1] | ||
* @param array - the array that will be rotated | ||
* @param shift - number | ||
* @returns - array of float | ||
* @param array - array | ||
* @param shift - shift | ||
* @returns - rotated array | ||
*/ | ||
@@ -12,0 +12,0 @@ export function xRotate(array, shift) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
/** Fill an array with sequential numbers | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xSequentialFill(input?: DoubleArray | Uint16Array | { | ||
export declare function xSequentialFill(input?: NumberArray | { | ||
/** first value in the array | ||
@@ -11,0 +11,0 @@ * @default 0 |
import { DoubleArray } from 'cheminfo-types'; | ||
/** Function that sorts arrays or Float64Arrays in ascending order | ||
* | ||
* @param array - array to sort | ||
@@ -8,2 +9,3 @@ * @returns sorted array | ||
/** Function that sorts arrays or Float64Arrays in descending order | ||
* | ||
* @param array - array to sort | ||
@@ -10,0 +12,0 @@ * @returns sorted array |
/** Function that sorts arrays or Float64Arrays in ascending order | ||
* | ||
* @param array - array to sort | ||
@@ -10,6 +11,7 @@ * @returns sorted array | ||
else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? 1 : -1)); | ||
return array.sort((a, b) => a - b); | ||
} | ||
} | ||
/** Function that sorts arrays or Float64Arrays in descending order | ||
* | ||
* @param array - array to sort | ||
@@ -23,5 +25,5 @@ * @returns sorted array | ||
else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? -1 : 1)); | ||
return array.sort((a, b) => b - a); | ||
} | ||
} | ||
//# sourceMappingURL=xSort.js.map |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Finds the standard deviation for the data at hand | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xStandardDeviation(values: DoubleArray | Uint16Array, options?: {}): number; | ||
export declare function xStandardDeviation(values: NumberArray, options?: {}): number; | ||
//# sourceMappingURL=xStandardDeviation.d.ts.map |
@@ -7,4 +7,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param array2 - second array or number | ||
* @returns array after subtraction | ||
*/ | ||
export declare function xSubtract(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xSubtract(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xSubtract.d.ts.map |
@@ -7,2 +7,3 @@ import { isAnyArray } from 'is-any-array'; | ||
* @param array2 - second array or number | ||
* @returns array after subtraction | ||
*/ | ||
@@ -21,3 +22,2 @@ export function xSubtract(array1, array2) { | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -24,0 +24,0 @@ if (isConstant) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -9,3 +9,3 @@ * Calculate the sum of the values | ||
*/ | ||
export declare function xSum(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xSum(array: NumberArray, options?: { | ||
/** | ||
@@ -12,0 +12,0 @@ * First point for xSum. |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - Array of number. | ||
* @returns - Sorted array. | ||
* @param array - array of numbers | ||
* @returns - sorted array | ||
*/ | ||
export declare function xUniqueSorted(array: DoubleArray): DoubleArray; | ||
export declare function xUniqueSorted(array: DoubleArray): Float64Array; | ||
//# sourceMappingURL=xUniqueSorted.d.ts.map |
/** | ||
* XUniqueSorted. | ||
* | ||
* @param array - Array of number. | ||
* @returns - Sorted array. | ||
* @param array - array of numbers | ||
* @returns - sorted array | ||
*/ | ||
@@ -7,0 +7,0 @@ export function xUniqueSorted(array) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Finds the variance of the data | ||
@@ -6,4 +6,5 @@ * | ||
* @param options - options | ||
* @returns variance | ||
*/ | ||
export declare function xVariance(values: DoubleArray | Uint16Array, options?: { | ||
export declare function xVariance(values: NumberArray, options?: { | ||
/** Unbiased option | ||
@@ -10,0 +11,0 @@ * @default true |
@@ -7,2 +7,3 @@ import { isAnyArray } from 'is-any-array'; | ||
* @param options - options | ||
* @returns variance | ||
*/ | ||
@@ -9,0 +10,0 @@ export function xVariance(values, options = {}) { |
@@ -5,6 +5,6 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @returns - sorted array | ||
*/ | ||
export declare function xreimSortX(data: DataXReIm): DataXReIm; | ||
//# sourceMappingURL=xreimSortX.d.ts.map |
/** | ||
* Sort object of array, x has to be monotone. | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @returns - sorted array | ||
*/ | ||
@@ -7,0 +7,0 @@ export function xreimSortX(data) { |
@@ -5,7 +5,7 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @param totalLength - Final number of points. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @param totalLength - final number of points | ||
* @returns - data. | ||
*/ | ||
export declare function xreimZeroFilling(data: DataXReIm, totalLength: number): DataXReIm; | ||
//# sourceMappingURL=xreimZeroFilling.d.ts.map |
/** | ||
* This function make a zero filling to re and im part. | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @param totalLength - Final number of points. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @param totalLength - final number of points | ||
* @returns - data. | ||
*/ | ||
@@ -8,0 +8,0 @@ export function xreimZeroFilling(data, totalLength) { |
@@ -7,4 +7,5 @@ /** | ||
export declare function xyCheck(data: any, options?: { | ||
/** minimum length */ | ||
minLength?: number; | ||
}): void; | ||
//# sourceMappingURL=xyCheck.d.ts.map |
@@ -6,5 +6,4 @@ import { DataXY } from 'cheminfo-types'; | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
*/ | ||
export declare function xyEnsureGrowingX(data: DataXY): DataXY; | ||
//# sourceMappingURL=xyEnsureGrowingX.d.ts.map |
@@ -6,3 +6,2 @@ import { xyCheck } from './xyCheck'; | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
*/ | ||
@@ -9,0 +8,0 @@ export function xyEnsureGrowingX(data) { |
@@ -24,5 +24,3 @@ import { DataXY } from 'cheminfo-types'; | ||
*/ | ||
export declare function xyEquallySpaced( | ||
/** points */ | ||
arrayXY: DataXY, options?: { | ||
export declare function xyEquallySpaced(arrayXY: DataXY, options?: { | ||
/** from | ||
@@ -29,0 +27,0 @@ * @default x[0] |
@@ -1,2 +0,2 @@ | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
import { zoneCheck } from '../zone/zoneCheck'; | ||
@@ -29,5 +29,3 @@ import { zonesInvert } from '../zones/zonesInvert'; | ||
*/ | ||
export function xyEquallySpaced( | ||
/** points */ | ||
arrayXY, options = {}) { | ||
export function xyEquallySpaced(arrayXY, options = {}) { | ||
let { x, y } = arrayXY; | ||
@@ -96,7 +94,7 @@ let xLength = x.length; | ||
return { | ||
x: createXArray({ | ||
x: Array.from(createFromToArray({ | ||
from, | ||
to, | ||
length: numberOfPoints, | ||
}), | ||
})), | ||
y: output, | ||
@@ -103,0 +101,0 @@ }; |
@@ -11,4 +11,5 @@ import { DataXY } from 'cheminfo-types'; | ||
export declare function xyExtract(data: DataXY, options?: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
}): DataXY; | ||
//# sourceMappingURL=xyExtract.d.ts.map |
import { DataXY } from 'cheminfo-types'; | ||
/** Filter an array x/y based on various criteria x points are expected to be sorted | ||
* | ||
* @param points | ||
* @param options | ||
* @param points - points | ||
* @param options - options | ||
* @return filtered array | ||
*/ | ||
export declare function xyFilterX( | ||
/** points */ | ||
points: DataXY, options?: { | ||
export declare function xyFilterX(points: DataXY, options?: { | ||
/** filter from | ||
@@ -12,0 +10,0 @@ * @default x[0] |
import getZones from '../zones/utils/getZones'; | ||
/** Filter an array x/y based on various criteria x points are expected to be sorted | ||
* | ||
* @param points | ||
* @param options | ||
* @param points - points | ||
* @param options - options | ||
* @return filtered array | ||
*/ | ||
export function xyFilterX( | ||
/** points */ | ||
points, options = {}) { | ||
export function xyFilterX(points, options = {}) { | ||
const { x, y } = points; | ||
@@ -12,0 +10,0 @@ const { from = x[0], to = x[x.length - 1], exclusions = [] } = options; |
import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* Order object of array, x has to be monotone. | ||
* Ensure x is growing | ||
* Order object of array, x has to be monotone. Ensure x is growing | ||
* | ||
@@ -6,0 +5,0 @@ * @param data - Object of kind {x:[], y:[]}. |
/** | ||
* Order object of array, x has to be monotone. | ||
* Ensure x is growing | ||
* Order object of array, x has to be monotone. Ensure x is growing | ||
* | ||
@@ -5,0 +4,0 @@ * @param data - Object of kind {x:[], y:[]}. |
@@ -7,4 +7,4 @@ import { DataXY } from 'cheminfo-types'; | ||
* | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
* @returns - Array of points. | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array) | ||
* @returns - Array of points | ||
*/ | ||
@@ -11,0 +11,0 @@ export declare function xyMaximaY(data: DataXY): { |
@@ -7,4 +7,4 @@ import { xyCheck } from './xyCheck'; | ||
* | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
* @returns - Array of points. | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array) | ||
* @returns - Array of points | ||
*/ | ||
@@ -11,0 +11,0 @@ export function xyMaximaY(data) { |
import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* Merge abscissa values if the ordinate value is in a list of centroids | ||
* @param points | ||
* @param centroids | ||
* @param options | ||
* | ||
* @param points - points | ||
* @param centroids - centroids | ||
* @param options - options | ||
* @return merged points | ||
@@ -8,0 +9,0 @@ */ |
/** | ||
* Merge abscissa values if the ordinate value is in a list of centroids | ||
* @param points | ||
* @param centroids | ||
* @param options | ||
* | ||
* @param points - points | ||
* @param centroids - centroids | ||
* @param options - options | ||
* @return merged points | ||
@@ -7,0 +8,0 @@ */ |
import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
/** | ||
* This function calculates a rolling average. | ||
* | ||
* This methods will recalculate the x values by using xRollingAverage | ||
@@ -6,0 +5,0 @@ * |
@@ -5,3 +5,2 @@ import { xRolling } from '../x/xRolling'; | ||
* This function calculates a rolling average. | ||
* | ||
* This methods will recalculate the x values by using xRollingAverage | ||
@@ -8,0 +7,0 @@ * |
@@ -11,5 +11,7 @@ import { DataXY } from 'cheminfo-types'; | ||
export declare function xySetYValue(data: DataXY, options?: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
/** data contains x and y values */ | ||
value?: number; | ||
}): DataXY; | ||
//# sourceMappingURL=xySetYValue.d.ts.map |
@@ -9,3 +9,2 @@ import { xIsMonotone } from '../x/xIsMonotone'; | ||
const { x, y } = data; | ||
// no need to sort if it is already sorted | ||
if (xIsMonotone(x) && x.length > 1) { | ||
@@ -12,0 +11,0 @@ if (x[0] < x[1]) { |
import { DataXY } from 'cheminfo-types'; | ||
import { Point } from '..'; | ||
/** | ||
*XyToXYObject. | ||
* XyToXYObject. | ||
* | ||
@@ -6,0 +6,0 @@ * @param data - Array of points {x,y}. |
import { xyCheck } from './xyCheck'; | ||
/** | ||
*XyToXYObject. | ||
* XyToXYObject. | ||
* | ||
@@ -5,0 +5,0 @@ * @param data - Array of points {x,y}. |
import { Point } from '..'; | ||
/** | ||
* | ||
* Filter the array by taking the higher points (max y value) and only. | ||
* Keep one per slot. | ||
* There are 2 different slots, the smallest one will have the | ||
* Keep one per slot. There are 2 different slots, the smallest one will have the | ||
* new property `close` to true | ||
@@ -32,3 +30,4 @@ * | ||
threshold?: number; | ||
/**@default 50 */ | ||
/** number of slots | ||
* @default 50 */ | ||
numberCloseSlots?: number; | ||
@@ -35,0 +34,0 @@ /** |
import { xyObjectMaxXPoint } from './xyObjectMaxXPoint'; | ||
import { xyObjectMinXPoint } from './xyObjectMinXPoint'; | ||
/** | ||
* | ||
* Filter the array by taking the higher points (max y value) and only. | ||
* Keep one per slot. | ||
* There are 2 different slots, the smallest one will have the | ||
* Keep one per slot. There are 2 different slots, the smallest one will have the | ||
* new property `close` to true | ||
@@ -9,0 +7,0 @@ * |
import { Point } from '..'; | ||
/** | ||
* | ||
* xyObjectJoinX. | ||
@@ -5,0 +4,0 @@ * |
/** | ||
* | ||
* xyObjectJoinX. | ||
@@ -4,0 +3,0 @@ * |
import { Point } from '..'; | ||
/** | ||
* | ||
* XyObjectSlotX | ||
@@ -5,0 +4,0 @@ * |
/** | ||
* | ||
* XyObjectSlotX | ||
@@ -4,0 +3,0 @@ * |
import { DataXY } from 'cheminfo-types'; | ||
import { Point } from '..'; | ||
/** | ||
* | ||
* XyObjectToXY. | ||
@@ -6,0 +5,0 @@ * |
/** | ||
* | ||
* XyObjectToXY. | ||
@@ -4,0 +3,0 @@ * |
@@ -22,2 +22,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
export * from './x/xIsMonotone'; | ||
export * from './x/xIsMonotoneIncreasing'; | ||
export * from './x/xMaxIndex'; | ||
@@ -120,3 +121,5 @@ export * from './x/xMaxValue'; | ||
export * from './matrix/matrixApplyNumericalEncoding'; | ||
export * from './utils/createXArray'; | ||
export * from './utils/createFromToArray'; | ||
export * from './utils/createNormalRandomArray'; | ||
export * from './utils/createStepArray'; | ||
export declare type DoubleMatrix = DoubleArray[]; | ||
@@ -123,0 +126,0 @@ export interface Zone { |
@@ -33,2 +33,3 @@ "use strict"; | ||
__exportStar(require("./x/xIsMonotone"), exports); | ||
__exportStar(require("./x/xIsMonotoneIncreasing"), exports); | ||
__exportStar(require("./x/xMaxIndex"), exports); | ||
@@ -131,3 +132,5 @@ __exportStar(require("./x/xMaxValue"), exports); | ||
__exportStar(require("./matrix/matrixApplyNumericalEncoding"), exports); | ||
__exportStar(require("./utils/createXArray"), exports); | ||
__exportStar(require("./utils/createFromToArray"), exports); | ||
__exportStar(require("./utils/createNormalRandomArray"), exports); | ||
__exportStar(require("./utils/createStepArray"), exports); | ||
//# sourceMappingURL=index.js.map |
/** | ||
* Numerically encodes the strings in the matrix with an encoding dictionary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -5,0 +5,0 @@ * @returns - encoded matrix |
@@ -8,3 +8,3 @@ "use strict"; | ||
* Numerically encodes the strings in the matrix with an encoding dictionary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -11,0 +11,0 @@ * @returns - encoded matrix |
@@ -5,5 +5,5 @@ import { DoubleMatrix } from '..'; | ||
* | ||
* @param matrix - matrix [rows][cols]. | ||
* @param matrix - matrix [rows][cols] | ||
*/ | ||
export declare function matrixCenterZMean(matrix: DoubleMatrix): DoubleMatrix; | ||
//# sourceMappingURL=matrixCenterZMean.d.ts.map |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* @param matrix - matrix [rows][cols]. | ||
* @param matrix - matrix [rows][cols] | ||
*/ | ||
@@ -10,0 +10,0 @@ function matrixCenterZMean(matrix) { |
/** | ||
* Creates a clone of a matrix | ||
* @param options - Options | ||
* @param options.from - from | ||
* @param options.to - to | ||
* @param options.length - length | ||
* @returns - array of floats | ||
* Clone the matrix | ||
*/ | ||
export declare function matrixClone(matrix: any[]): any[]; | ||
//# sourceMappingURL=matrixClone.d.ts.map |
@@ -5,8 +5,3 @@ "use strict"; | ||
/** | ||
* Creates a clone of a matrix | ||
* @param options - Options | ||
* @param options.from - from | ||
* @param options.to - to | ||
* @param options.length - length | ||
* @returns - array of floats | ||
* Clone the matrix | ||
*/ | ||
@@ -13,0 +8,0 @@ function matrixClone(matrix) { |
@@ -26,10 +26,12 @@ "use strict"; | ||
if (options.min === undefined) { | ||
options.min = logBaseX | ||
? Math.log(minMax.min) / Math.log(logBaseX) | ||
: minMax.min; | ||
options.min = | ||
logBaseX && minMax.min | ||
? Math.log(minMax.min) / Math.log(logBaseX) | ||
: minMax.min; | ||
} | ||
if (options.max === undefined) { | ||
options.max = logBaseX | ||
? Math.log(minMax.max) / Math.log(logBaseX) | ||
: minMax.max; | ||
options.max = | ||
logBaseX && minMax.max | ||
? Math.log(minMax.max) / Math.log(logBaseX) | ||
: minMax.max; | ||
} | ||
@@ -36,0 +38,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
* Numerically decodes the matrix using the dictionnary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -10,0 +10,0 @@ * @returns - decoded matrix |
/** | ||
* Numerically encodes the strings in the matrix and returns an encoding dictionnary which can be used to encode other matrices | ||
* @param matrix - original matrix before encoding | ||
* @param dictCategoricalToNumerical - dictionnary for encoding | ||
* @returns - dictionnary from string to number | ||
@@ -5,0 +6,0 @@ */ |
@@ -8,2 +8,3 @@ "use strict"; | ||
* @param matrix - original matrix before encoding | ||
* @param dictCategoricalToNumerical - dictionnary for encoding | ||
* @returns - dictionnary from string to number | ||
@@ -10,0 +11,0 @@ */ |
@@ -9,5 +9,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param matrix - matrix [rows][cols]. | ||
* @param options Options | ||
* data: Normalized dataset. | ||
* medianOfQuotients: The median of quotients of each variables. | ||
* @param options - options | ||
* @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables} | ||
*/ | ||
@@ -14,0 +13,0 @@ export declare function matrixPQN(matrix: DoubleMatrix, options?: { |
@@ -12,5 +12,4 @@ "use strict"; | ||
* @param matrix - matrix [rows][cols]. | ||
* @param options Options | ||
* data: Normalized dataset. | ||
* medianOfQuotients: The median of quotients of each variables. | ||
* @param options - options | ||
* @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables} | ||
*/ | ||
@@ -17,0 +16,0 @@ function matrixPQN(matrix, options = {}) { |
@@ -1,2 +0,1 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { DataReIm } from '../index'; | ||
@@ -6,6 +5,6 @@ /** | ||
* | ||
* @param data - DATA | ||
* @returns - array of float | ||
* @param data - complex spectrum | ||
* @returns - reimAbsolute value | ||
*/ | ||
export declare function reimAbsolute(data: DataReIm): DoubleArray; | ||
export declare function reimAbsolute(data: DataReIm): Float64Array; | ||
//# sourceMappingURL=reimAbsolute.d.ts.map |
@@ -7,4 +7,4 @@ "use strict"; | ||
* | ||
* @param data - DATA | ||
* @returns - array of float | ||
* @param data - complex spectrum | ||
* @returns - reimAbsolute value | ||
*/ | ||
@@ -11,0 +11,0 @@ function reimAbsolute(data) { |
@@ -6,4 +6,4 @@ import { DataReIm } from '../index'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @param data - complex spectrum | ||
* @param options - options | ||
*/ | ||
@@ -10,0 +10,0 @@ export declare function reimAutoPhaseCorrection(data: DataReIm, options?: { |
@@ -11,4 +11,4 @@ "use strict"; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @param data - complex spectrum | ||
* @param options - options | ||
*/ | ||
@@ -15,0 +15,0 @@ function reimAutoPhaseCorrection(data, options = {}) { |
@@ -5,5 +5,5 @@ import { DataReIm } from '..'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @returns DataReim. | ||
* @param data - complex spectrum | ||
* @param options - options. | ||
* @returns FFT of complex spectrum. | ||
*/ | ||
@@ -10,0 +10,0 @@ export declare function reimFFT(data: DataReIm, options?: { |
@@ -12,5 +12,5 @@ "use strict"; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @returns DataReim. | ||
* @param data - complex spectrum | ||
* @param options - options. | ||
* @returns FFT of complex spectrum. | ||
*/ | ||
@@ -17,0 +17,0 @@ function reimFFT(data, options = {}) { |
@@ -5,3 +5,3 @@ import { DataReIm } from '..'; | ||
* | ||
* @param data DataReIm | ||
* @param data - complex spectrum | ||
* @param phi0 - Angle in radians for zero order phase correction | ||
@@ -8,0 +8,0 @@ * @param phi1 - Angle in radians for first order phase correction |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* @param data DataReIm | ||
* @param data - complex spectrum | ||
* @param phi0 - Angle in radians for zero order phase correction | ||
@@ -10,0 +10,0 @@ * @param phi1 - Angle in radians for first order phase correction |
@@ -0,3 +1,13 @@ | ||
/** | ||
* Function for comparing numbers and sorting them in ascending order | ||
* | ||
* @param options - options | ||
*/ | ||
export declare function numberSortAscending(left: number, right: number): number; | ||
/** | ||
* Function for comparing numbers and sorting them in descending order | ||
* | ||
* @param options - options | ||
*/ | ||
export declare function numberSortDescending(left: number, right: number): number; | ||
//# sourceMappingURL=numberSort.d.ts.map |
@@ -9,2 +9,7 @@ "use strict"; | ||
} | ||
/** | ||
* Function for comparing numbers and sorting them in ascending order | ||
* | ||
* @param options - options | ||
*/ | ||
function numberSortAscending(left, right) { | ||
@@ -22,2 +27,7 @@ assertNumber(left); | ||
exports.numberSortAscending = numberSortAscending; | ||
/** | ||
* Function for comparing numbers and sorting them in descending order | ||
* | ||
* @param options - options | ||
*/ | ||
function numberSortDescending(left, right) { | ||
@@ -24,0 +34,0 @@ assertNumber(left); |
/** | ||
* RayleighCdf. | ||
* | ||
* @param x - Number. | ||
* @param sigma - Number. | ||
* @returns Number. | ||
* @param x - data | ||
* @param sigma - standard deviation | ||
* @returns - rayleigh cdf | ||
*/ | ||
export default function rayleighCdf(x: number, sigma?: number): number; | ||
//# sourceMappingURL=rayleighCdf.d.ts.map |
@@ -6,5 +6,5 @@ "use strict"; | ||
* | ||
* @param x - Number. | ||
* @param sigma - Number. | ||
* @returns Number. | ||
* @param x - data | ||
* @param sigma - standard deviation | ||
* @returns - rayleigh cdf | ||
*/ | ||
@@ -11,0 +11,0 @@ function rayleighCdf(x, sigma = 1) { |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - array of number | ||
* @returns - absolute array | ||
* @param array - array of data | ||
* @returns - array with absolute values | ||
*/ | ||
export declare function xAbsolute(array: DoubleArray): DoubleArray; | ||
//# sourceMappingURL=xAbsolute.d.ts.map |
@@ -7,4 +7,4 @@ "use strict"; | ||
* | ||
* @param array - array of number | ||
* @returns - absolute array | ||
* @param array - array of data | ||
* @returns - array with absolute values | ||
*/ | ||
@@ -11,0 +11,0 @@ function xAbsolute(array) { |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - the array for which we want to calculate the absolute value | ||
* @returns - median | ||
@@ -8,0 +8,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - the array for which we want to calculate the absolute value | ||
* @returns - median | ||
@@ -12,0 +12,0 @@ */ |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array2 - the second array | ||
* @param array1 - the first array | ||
* @param array2 - the second array or number | ||
*/ | ||
export declare function xAdd(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xAdd(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xAdd.d.ts.map |
@@ -8,4 +8,4 @@ "use strict"; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array2 - the second array | ||
* @param array1 - the first array | ||
* @param array2 - the second array or number | ||
*/ | ||
@@ -22,5 +22,4 @@ function xAdd(array1, array2) { | ||
isConstant = true; | ||
constant = Number(array2); | ||
constant = array2; | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -27,0 +26,0 @@ if (isConstant) { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the auto-correlation of a vector | ||
* Calculates the auto-correlation of an array | ||
* | ||
* @param A - the array that will be fixed | ||
* @param A - the array for which to calculate the auto-correlation | ||
* @param options - Options | ||
@@ -7,0 +7,0 @@ */ |
@@ -6,5 +6,5 @@ "use strict"; | ||
/** | ||
* Calculates the auto-correlation of a vector | ||
* Calculates the auto-correlation of an array | ||
* | ||
* @param A - the array that will be fixed | ||
* @param A - the array for which to calculate the auto-correlation | ||
* @param options - Options | ||
@@ -11,0 +11,0 @@ */ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* This function xSubtract the first array by the second array or a constant value from each element of the first array | ||
* Calculating the box plot of the array | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - data | ||
*/ | ||
@@ -7,0 +7,0 @@ export declare function xBoxPlot(array: DoubleArray): { |
@@ -5,5 +5,5 @@ "use strict"; | ||
/** | ||
* This function xSubtract the first array by the second array or a constant value from each element of the first array | ||
* Calculating the box plot of the array | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - data | ||
*/ | ||
@@ -10,0 +10,0 @@ function xBoxPlot(array) { |
@@ -1,8 +0,8 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Checks if input is valdi | ||
* Checks if input is of type array | ||
* | ||
* @param input - input | ||
*/ | ||
export declare function xCheck(input?: DoubleArray | Uint16Array): void; | ||
export declare function xCheck(input?: NumberArray): void; | ||
/** | ||
@@ -9,0 +9,0 @@ * XCheckLengths. |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Checks if input is valdi | ||
* Checks if input is of type array | ||
* | ||
@@ -9,0 +9,0 @@ * @param input - input |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param A - the array that will be rotated | ||
* @param A - first array | ||
* @param B - sencond array | ||
@@ -9,0 +9,0 @@ */ |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param A - the array that will be rotated | ||
* @param A - first array | ||
* @param B - sencond array | ||
@@ -11,0 +11,0 @@ */ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the cross-correlation between 2 vectors | ||
* Calculates the cross-correlation between 2 arrays | ||
* | ||
@@ -20,3 +20,3 @@ * @param A - fixed array | ||
lag?: number; | ||
}): DoubleArray; | ||
}): Float64Array; | ||
//# sourceMappingURL=xCrossCorrelation.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Calculates the cross-correlation between 2 vectors | ||
* Calculates the cross-correlation between 2 arrays | ||
* | ||
@@ -9,0 +9,0 @@ * @param A - fixed array |
@@ -5,5 +5,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - DoubleArray | ||
* @param array - initial array | ||
*/ | ||
export declare function xCumulative(array: DoubleArray): DoubleArray; | ||
export declare function xCumulative(array: DoubleArray): Float64Array; | ||
//# sourceMappingURL=xCumulative.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param array - DoubleArray | ||
* @param array - initial array | ||
*/ | ||
@@ -11,0 +11,0 @@ function xCumulative(array) { |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array or number | ||
@@ -8,0 +8,0 @@ * |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array or number | ||
@@ -25,3 +25,2 @@ * | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -28,0 +27,0 @@ if (isConstant) { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* XDotProduct. | ||
* Dot product between two arrays | ||
* | ||
@@ -5,0 +5,0 @@ * @param A - First array. |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* XDotProduct. | ||
* Dot product between two arrays | ||
* | ||
@@ -9,0 +9,0 @@ * @param A - First array. |
import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
/** | ||
* Calculates an histogram of defined number of slots | ||
* Calculates a histogram of defined number of slots | ||
* | ||
@@ -5,0 +5,0 @@ * @param array - Array containing values |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.xHistogram = void 0; | ||
const createXArray_1 = require("../utils/createXArray"); | ||
const createFromToArray_1 = require("../utils/createFromToArray"); | ||
const xAbsolute_1 = require("./xAbsolute"); | ||
@@ -10,3 +10,3 @@ const xCheck_1 = require("./xCheck"); | ||
/** | ||
* Calculates an histogram of defined number of slots | ||
* Calculates a histogram of defined number of slots | ||
* | ||
@@ -35,7 +35,7 @@ * @param array - Array containing values | ||
const x = histogram === undefined | ||
? (0, createXArray_1.createXArray)({ | ||
? Array.from((0, createFromToArray_1.createFromToArray)({ | ||
from: min + (centerX ? slotSize / 2 : 0), | ||
to: max - (centerX ? slotSize / 2 : 0), | ||
length: nbSlots, | ||
}) | ||
})) | ||
: histogram.x; | ||
@@ -42,0 +42,0 @@ array.forEach((element) => { |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Check if the values are separated by always the same difference | ||
* Check if the values are separated always by the same difference | ||
* | ||
@@ -5,0 +5,0 @@ * @param array - Monotone growing array of number |
@@ -5,3 +5,3 @@ "use strict"; | ||
/** | ||
* Check if the values are separated by always the same difference | ||
* Check if the values are separated always by the same difference | ||
* | ||
@@ -8,0 +8,0 @@ * @param array - Monotone growing array of number |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -6,5 +6,5 @@ * Computes the index of the maximum of the given values | ||
* @param array - array of numbers | ||
* @returns - indexe | ||
* @returns - index | ||
*/ | ||
export declare function xMaxIndex(array: DoubleArray | Uint16Array): number; | ||
export declare function xMaxIndex(array: NumberArray): number; | ||
//# sourceMappingURL=xMaxIndex.d.ts.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
* @param array - array of numbers | ||
* @returns - indexe | ||
* @returns - index | ||
*/ | ||
@@ -12,0 +12,0 @@ function xMaxIndex(array) { |
@@ -1,9 +0,9 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* | ||
* @param array - array of number | ||
* @param array - array of numbers | ||
* @param options - options | ||
*/ | ||
export declare function xMaxValue(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMaxValue(array: NumberArray, options?: { | ||
/** | ||
@@ -10,0 +10,0 @@ * First point for xyIntegration |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param array - array of number | ||
* @param array - array of numbers | ||
* @param options - options | ||
@@ -11,0 +11,0 @@ */ |
@@ -1,4 +0,4 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* Computes the mean value of an array of values | ||
* | ||
@@ -8,3 +8,3 @@ * @param array - array of numbers | ||
*/ | ||
export declare function xMean(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMean(array: NumberArray, options?: { | ||
/** | ||
@@ -11,0 +11,0 @@ * First point for xyIntegration |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* Computes the mean value of an array of values | ||
* | ||
@@ -9,0 +9,0 @@ * @param array - array of numbers |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Calculates the median of an array | ||
*/ | ||
export declare function xMedian(input: DoubleArray | Uint16Array): any; | ||
export declare function xMedian(input: NumberArray): any; | ||
//# sourceMappingURL=xMedian.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -7,3 +7,3 @@ * Computes the index of the minimum of the given values | ||
*/ | ||
export declare function xMinIndex(array: DoubleArray | Uint16Array): number; | ||
export declare function xMinIndex(array: NumberArray): number; | ||
//# sourceMappingURL=xMinIndex.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Return min and max values of an array | ||
*/ | ||
export declare function xMinMaxValues(array: DoubleArray | Uint16Array): { | ||
export declare function xMinMaxValues(array: NumberArray): { | ||
min: number; | ||
@@ -11,0 +11,0 @@ max: number; |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Computes the minimal value of an array of values | ||
*/ | ||
export declare function xMinValue(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xMinValue(array: NumberArray, options?: { | ||
/** | ||
@@ -11,0 +11,0 @@ * First point for xyIntegration |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -8,3 +8,3 @@ * Calculates the mode of an array | ||
*/ | ||
export declare function xMode(input: DoubleArray | Uint16Array): number; | ||
export declare function xMode(input: NumberArray): number; | ||
//# sourceMappingURL=xMode.d.ts.map |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array | ||
*/ | ||
export declare function xMultiply(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xMultiply(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xMultiply.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array | ||
@@ -11,0 +11,0 @@ */ |
@@ -8,3 +8,3 @@ "use strict"; | ||
const spline_interpolator_1 = __importDefault(require("spline-interpolator")); | ||
const createXArray_1 = require("../utils/createXArray"); | ||
const createFromToArray_1 = require("../utils/createFromToArray"); | ||
const erfcinv_1 = __importDefault(require("./erfcinv")); | ||
@@ -309,3 +309,3 @@ const rayleighCdf_1 = __importDefault(require("./rayleighCdf")); | ||
} | ||
const xAxis = (0, createXArray_1.createXArray)({ | ||
const xAxis = (0, createFromToArray_1.createFromToArray)({ | ||
from: 0, | ||
@@ -312,0 +312,0 @@ to: array.length - 1, |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xNorm([3, 4]) -> 5 | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @returns - calculated norm | ||
@@ -9,0 +9,0 @@ */ |
@@ -8,3 +8,3 @@ "use strict"; | ||
* @example xNorm([3, 4]) -> 5 | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @returns - calculated norm | ||
@@ -11,0 +11,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Divides the data with either the sum, the absolute sum or the maximum of the data | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xNormed(input: DoubleArray | Uint16Array, options?: { | ||
export declare function xNormed(input: NumberArray, options?: { | ||
/** value by which to divide the data | ||
@@ -23,4 +23,4 @@ * @default 'absolute' | ||
/** output into which the result should be placed if needed */ | ||
output?: DoubleArray | Uint16Array; | ||
}): any[] | Uint16Array | Float64Array; | ||
output?: NumberArray; | ||
}): any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; | ||
//# sourceMappingURL=xNormed.d.ts.map |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* This function pads an array | ||
* | ||
* | ||
*s | ||
* @param array - the array that will be padded | ||
@@ -25,3 +24,3 @@ * @param options - options | ||
algorithm?: string; | ||
}): DoubleArray; | ||
}): Float64Array; | ||
//# sourceMappingURL=xPadding.d.ts.map |
@@ -7,4 +7,3 @@ "use strict"; | ||
* This function pads an array | ||
* | ||
* | ||
*s | ||
* @param array - the array that will be padded | ||
@@ -11,0 +10,0 @@ * @param options - options |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Function used to rescale data | ||
@@ -8,5 +8,5 @@ * | ||
*/ | ||
export declare function xRescale(input: DoubleArray | Uint16Array, options?: { | ||
export declare function xRescale(input: NumberArray, options?: { | ||
/** output into which to placed the data */ | ||
output?: DoubleArray | Uint16Array; | ||
output?: NumberArray; | ||
/** min used for the scaling */ | ||
@@ -18,3 +18,3 @@ min?: number; | ||
autoMinMax?: boolean; | ||
}): any[] | Uint16Array | Float64Array; | ||
}): any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; | ||
//# sourceMappingURL=xRescale.d.ts.map |
@@ -5,4 +5,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param fct - callback function that from an array returns a value. | ||
* @param array - array | ||
* @param fct - callback function that from an array returns a value | ||
* @param options - options | ||
@@ -9,0 +9,0 @@ */ |
@@ -9,4 +9,4 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param fct - callback function that from an array returns a value. | ||
* @param array - array | ||
* @param fct - callback function that from an array returns a value | ||
* @param options - options | ||
@@ -13,0 +13,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - option | ||
@@ -8,0 +8,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - option | ||
@@ -12,0 +12,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -5,3 +5,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -8,0 +8,0 @@ */ |
@@ -9,3 +9,3 @@ "use strict"; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -8,7 +8,7 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xRotate([1,2,3,4],-1) -> [2,3,4,1] | ||
* @param array - the array that will be rotated | ||
* @param shift - number | ||
* @returns - array of float | ||
* @param array - array | ||
* @param shift - shift | ||
* @returns - rotated array | ||
*/ | ||
export declare function xRotate(array: DoubleArray, shift: number): DoubleArray; | ||
//# sourceMappingURL=xRotate.d.ts.map |
@@ -10,5 +10,5 @@ "use strict"; | ||
* @example xRotate([1,2,3,4],-1) -> [2,3,4,1] | ||
* @param array - the array that will be rotated | ||
* @param shift - number | ||
* @returns - array of float | ||
* @param array - array | ||
* @param shift - shift | ||
* @returns - rotated array | ||
*/ | ||
@@ -15,0 +15,0 @@ function xRotate(array, shift) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
/** Fill an array with sequential numbers | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xSequentialFill(input?: DoubleArray | Uint16Array | { | ||
export declare function xSequentialFill(input?: NumberArray | { | ||
/** first value in the array | ||
@@ -11,0 +11,0 @@ * @default 0 |
import { DoubleArray } from 'cheminfo-types'; | ||
/** Function that sorts arrays or Float64Arrays in ascending order | ||
* | ||
* @param array - array to sort | ||
@@ -8,2 +9,3 @@ * @returns sorted array | ||
/** Function that sorts arrays or Float64Arrays in descending order | ||
* | ||
* @param array - array to sort | ||
@@ -10,0 +12,0 @@ * @returns sorted array |
@@ -5,2 +5,3 @@ "use strict"; | ||
/** Function that sorts arrays or Float64Arrays in ascending order | ||
* | ||
* @param array - array to sort | ||
@@ -14,3 +15,3 @@ * @returns sorted array | ||
else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? 1 : -1)); | ||
return array.sort((a, b) => a - b); | ||
} | ||
@@ -20,2 +21,3 @@ } | ||
/** Function that sorts arrays or Float64Arrays in descending order | ||
* | ||
* @param array - array to sort | ||
@@ -29,3 +31,3 @@ * @returns sorted array | ||
else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? -1 : 1)); | ||
return array.sort((a, b) => b - a); | ||
} | ||
@@ -32,0 +34,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Finds the standard deviation for the data at hand | ||
@@ -8,3 +8,3 @@ * | ||
*/ | ||
export declare function xStandardDeviation(values: DoubleArray | Uint16Array, options?: {}): number; | ||
export declare function xStandardDeviation(values: NumberArray, options?: {}): number; | ||
//# sourceMappingURL=xStandardDeviation.d.ts.map |
@@ -7,4 +7,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param array2 - second array or number | ||
* @returns array after subtraction | ||
*/ | ||
export declare function xSubtract(array1: DoubleArray, array2: DoubleArray | number): DoubleArray; | ||
export declare function xSubtract(array1: DoubleArray, array2: DoubleArray | number): Float64Array; | ||
//# sourceMappingURL=xSubtract.d.ts.map |
@@ -10,2 +10,3 @@ "use strict"; | ||
* @param array2 - second array or number | ||
* @returns array after subtraction | ||
*/ | ||
@@ -24,3 +25,2 @@ function xSubtract(array1, array2) { | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -27,0 +27,0 @@ if (isConstant) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** | ||
@@ -9,3 +9,3 @@ * Calculate the sum of the values | ||
*/ | ||
export declare function xSum(array: DoubleArray | Uint16Array, options?: { | ||
export declare function xSum(array: NumberArray, options?: { | ||
/** | ||
@@ -12,0 +12,0 @@ * First point for xSum. |
@@ -5,6 +5,6 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - Array of number. | ||
* @returns - Sorted array. | ||
* @param array - array of numbers | ||
* @returns - sorted array | ||
*/ | ||
export declare function xUniqueSorted(array: DoubleArray): DoubleArray; | ||
export declare function xUniqueSorted(array: DoubleArray): Float64Array; | ||
//# sourceMappingURL=xUniqueSorted.d.ts.map |
@@ -7,4 +7,4 @@ "use strict"; | ||
* | ||
* @param array - Array of number. | ||
* @returns - Sorted array. | ||
* @param array - array of numbers | ||
* @returns - sorted array | ||
*/ | ||
@@ -11,0 +11,0 @@ function xUniqueSorted(array) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
/** Finds the variance of the data | ||
@@ -6,4 +6,5 @@ * | ||
* @param options - options | ||
* @returns variance | ||
*/ | ||
export declare function xVariance(values: DoubleArray | Uint16Array, options?: { | ||
export declare function xVariance(values: NumberArray, options?: { | ||
/** Unbiased option | ||
@@ -10,0 +11,0 @@ * @default true |
@@ -10,2 +10,3 @@ "use strict"; | ||
* @param options - options | ||
* @returns variance | ||
*/ | ||
@@ -12,0 +13,0 @@ function xVariance(values, options = {}) { |
@@ -5,6 +5,6 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @returns - sorted array | ||
*/ | ||
export declare function xreimSortX(data: DataXReIm): DataXReIm; | ||
//# sourceMappingURL=xreimSortX.d.ts.map |
@@ -7,4 +7,4 @@ "use strict"; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @returns - sorted array | ||
*/ | ||
@@ -11,0 +11,0 @@ function xreimSortX(data) { |
@@ -5,7 +5,7 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @param totalLength - Final number of points. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @param totalLength - final number of points | ||
* @returns - data. | ||
*/ | ||
export declare function xreimZeroFilling(data: DataXReIm, totalLength: number): DataXReIm; | ||
//# sourceMappingURL=xreimZeroFilling.d.ts.map |
@@ -7,5 +7,5 @@ "use strict"; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @param totalLength - Final number of points. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @param totalLength - final number of points | ||
* @returns - data. | ||
*/ | ||
@@ -12,0 +12,0 @@ function xreimZeroFilling(data, totalLength) { |
@@ -7,4 +7,5 @@ /** | ||
export declare function xyCheck(data: any, options?: { | ||
/** minimum length */ | ||
minLength?: number; | ||
}): void; | ||
//# sourceMappingURL=xyCheck.d.ts.map |
@@ -6,5 +6,4 @@ import { DataXY } from 'cheminfo-types'; | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
*/ | ||
export declare function xyEnsureGrowingX(data: DataXY): DataXY; | ||
//# sourceMappingURL=xyEnsureGrowingX.d.ts.map |
@@ -9,3 +9,2 @@ "use strict"; | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
*/ | ||
@@ -12,0 +11,0 @@ function xyEnsureGrowingX(data) { |
@@ -24,5 +24,3 @@ import { DataXY } from 'cheminfo-types'; | ||
*/ | ||
export declare function xyEquallySpaced( | ||
/** points */ | ||
arrayXY: DataXY, options?: { | ||
export declare function xyEquallySpaced(arrayXY: DataXY, options?: { | ||
/** from | ||
@@ -29,0 +27,0 @@ * @default x[0] |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.xyEquallySpaced = void 0; | ||
const createXArray_1 = require("../utils/createXArray"); | ||
const createFromToArray_1 = require("../utils/createFromToArray"); | ||
const zoneCheck_1 = require("../zone/zoneCheck"); | ||
@@ -36,5 +36,3 @@ const zonesInvert_1 = require("../zones/zonesInvert"); | ||
*/ | ||
function xyEquallySpaced( | ||
/** points */ | ||
arrayXY, options = {}) { | ||
function xyEquallySpaced(arrayXY, options = {}) { | ||
let { x, y } = arrayXY; | ||
@@ -104,7 +102,7 @@ let xLength = x.length; | ||
return { | ||
x: (0, createXArray_1.createXArray)({ | ||
x: Array.from((0, createFromToArray_1.createFromToArray)({ | ||
from, | ||
to, | ||
length: numberOfPoints, | ||
}), | ||
})), | ||
y: output, | ||
@@ -111,0 +109,0 @@ }; |
@@ -11,4 +11,5 @@ import { DataXY } from 'cheminfo-types'; | ||
export declare function xyExtract(data: DataXY, options?: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
}): DataXY; | ||
//# sourceMappingURL=xyExtract.d.ts.map |
import { DataXY } from 'cheminfo-types'; | ||
/** Filter an array x/y based on various criteria x points are expected to be sorted | ||
* | ||
* @param points | ||
* @param options | ||
* @param points - points | ||
* @param options - options | ||
* @return filtered array | ||
*/ | ||
export declare function xyFilterX( | ||
/** points */ | ||
points: DataXY, options?: { | ||
export declare function xyFilterX(points: DataXY, options?: { | ||
/** filter from | ||
@@ -12,0 +10,0 @@ * @default x[0] |
@@ -10,9 +10,7 @@ "use strict"; | ||
* | ||
* @param points | ||
* @param options | ||
* @param points - points | ||
* @param options - options | ||
* @return filtered array | ||
*/ | ||
function xyFilterX( | ||
/** points */ | ||
points, options = {}) { | ||
function xyFilterX(points, options = {}) { | ||
const { x, y } = points; | ||
@@ -19,0 +17,0 @@ const { from = x[0], to = x[x.length - 1], exclusions = [] } = options; |
import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* Order object of array, x has to be monotone. | ||
* Ensure x is growing | ||
* Order object of array, x has to be monotone. Ensure x is growing | ||
* | ||
@@ -6,0 +5,0 @@ * @param data - Object of kind {x:[], y:[]}. |
@@ -5,4 +5,3 @@ "use strict"; | ||
/** | ||
* Order object of array, x has to be monotone. | ||
* Ensure x is growing | ||
* Order object of array, x has to be monotone. Ensure x is growing | ||
* | ||
@@ -9,0 +8,0 @@ * @param data - Object of kind {x:[], y:[]}. |
@@ -7,4 +7,4 @@ import { DataXY } from 'cheminfo-types'; | ||
* | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
* @returns - Array of points. | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array) | ||
* @returns - Array of points | ||
*/ | ||
@@ -11,0 +11,0 @@ export declare function xyMaximaY(data: DataXY): { |
@@ -10,4 +10,4 @@ "use strict"; | ||
* | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
* @returns - Array of points. | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array) | ||
* @returns - Array of points | ||
*/ | ||
@@ -14,0 +14,0 @@ function xyMaximaY(data) { |
import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* Merge abscissa values if the ordinate value is in a list of centroids | ||
* @param points | ||
* @param centroids | ||
* @param options | ||
* | ||
* @param points - points | ||
* @param centroids - centroids | ||
* @param options - options | ||
* @return merged points | ||
@@ -8,0 +9,0 @@ */ |
@@ -6,5 +6,6 @@ "use strict"; | ||
* Merge abscissa values if the ordinate value is in a list of centroids | ||
* @param points | ||
* @param centroids | ||
* @param options | ||
* | ||
* @param points - points | ||
* @param centroids - centroids | ||
* @param options - options | ||
* @return merged points | ||
@@ -11,0 +12,0 @@ */ |
import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
/** | ||
* This function calculates a rolling average. | ||
* | ||
* This methods will recalculate the x values by using xRollingAverage | ||
@@ -6,0 +5,0 @@ * |
@@ -8,3 +8,2 @@ "use strict"; | ||
* This function calculates a rolling average. | ||
* | ||
* This methods will recalculate the x values by using xRollingAverage | ||
@@ -11,0 +10,0 @@ * |
@@ -11,5 +11,7 @@ import { DataXY } from 'cheminfo-types'; | ||
export declare function xySetYValue(data: DataXY, options?: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
/** data contains x and y values */ | ||
value?: number; | ||
}): DataXY; | ||
//# sourceMappingURL=xySetYValue.d.ts.map |
@@ -12,3 +12,2 @@ "use strict"; | ||
const { x, y } = data; | ||
// no need to sort if it is already sorted | ||
if ((0, xIsMonotone_1.xIsMonotone)(x) && x.length > 1) { | ||
@@ -15,0 +14,0 @@ if (x[0] < x[1]) { |
import { DataXY } from 'cheminfo-types'; | ||
import { Point } from '..'; | ||
/** | ||
*XyToXYObject. | ||
* XyToXYObject. | ||
* | ||
@@ -6,0 +6,0 @@ * @param data - Array of points {x,y}. |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
*XyToXYObject. | ||
* XyToXYObject. | ||
* | ||
@@ -9,0 +9,0 @@ * @param data - Array of points {x,y}. |
import { Point } from '..'; | ||
/** | ||
* | ||
* Filter the array by taking the higher points (max y value) and only. | ||
* Keep one per slot. | ||
* There are 2 different slots, the smallest one will have the | ||
* Keep one per slot. There are 2 different slots, the smallest one will have the | ||
* new property `close` to true | ||
@@ -32,3 +30,4 @@ * | ||
threshold?: number; | ||
/**@default 50 */ | ||
/** number of slots | ||
* @default 50 */ | ||
numberCloseSlots?: number; | ||
@@ -35,0 +34,0 @@ /** |
@@ -7,6 +7,4 @@ "use strict"; | ||
/** | ||
* | ||
* Filter the array by taking the higher points (max y value) and only. | ||
* Keep one per slot. | ||
* There are 2 different slots, the smallest one will have the | ||
* Keep one per slot. There are 2 different slots, the smallest one will have the | ||
* new property `close` to true | ||
@@ -13,0 +11,0 @@ * |
import { Point } from '..'; | ||
/** | ||
* | ||
* xyObjectJoinX. | ||
@@ -5,0 +4,0 @@ * |
@@ -5,3 +5,2 @@ "use strict"; | ||
/** | ||
* | ||
* xyObjectJoinX. | ||
@@ -8,0 +7,0 @@ * |
import { Point } from '..'; | ||
/** | ||
* | ||
* XyObjectSlotX | ||
@@ -5,0 +4,0 @@ * |
@@ -5,3 +5,2 @@ "use strict"; | ||
/** | ||
* | ||
* XyObjectSlotX | ||
@@ -8,0 +7,0 @@ * |
import { DataXY } from 'cheminfo-types'; | ||
import { Point } from '..'; | ||
/** | ||
* | ||
* XyObjectToXY. | ||
@@ -6,0 +5,0 @@ * |
@@ -5,3 +5,2 @@ "use strict"; | ||
/** | ||
* | ||
* XyObjectToXY. | ||
@@ -8,0 +7,0 @@ * |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.zonesNormalize = void 0; | ||
/** | ||
@@ -11,4 +13,2 @@ * Normalize an array of zones: | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.zonesNormalize = void 0; | ||
function zonesNormalize(zones = [], options = {}) { | ||
@@ -15,0 +15,0 @@ if (zones.length === 0) |
{ | ||
"name": "ml-spectra-processing", | ||
"version": "9.2.0", | ||
"version": "10.0.0", | ||
"description": "Various method to process spectra", | ||
@@ -66,3 +66,3 @@ "main": "./lib/index.js", | ||
"binary-search": "^1.3.6", | ||
"cheminfo-types": "^0.9.1", | ||
"cheminfo-types": "^0.10.1", | ||
"fft.js": "^4.0.4", | ||
@@ -69,0 +69,0 @@ "is-any-array": "^2.0.0", |
@@ -24,2 +24,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
export * from './x/xIsMonotone'; | ||
export * from './x/xIsMonotoneIncreasing'; | ||
export * from './x/xMaxIndex'; | ||
@@ -130,3 +131,5 @@ export * from './x/xMaxValue'; | ||
export * from './utils/createXArray'; | ||
export * from './utils/createFromToArray'; | ||
export * from './utils/createNormalRandomArray'; | ||
export * from './utils/createStepArray'; | ||
@@ -133,0 +136,0 @@ export type DoubleMatrix = DoubleArray[]; |
@@ -7,3 +7,3 @@ import { xMaxValue } from '../x/xMaxValue'; | ||
* Numerically encodes the strings in the matrix with an encoding dictionary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -10,0 +10,0 @@ * @returns - encoded matrix |
@@ -6,3 +6,3 @@ import { DoubleMatrix } from '..'; | ||
* | ||
* @param matrix - matrix [rows][cols]. | ||
* @param matrix - matrix [rows][cols] | ||
*/ | ||
@@ -9,0 +9,0 @@ export function matrixCenterZMean(matrix: DoubleMatrix): DoubleMatrix { |
/** | ||
* Creates a clone of a matrix | ||
* @param options - Options | ||
* @param options.from - from | ||
* @param options.to - to | ||
* @param options.length - length | ||
* @returns - array of floats | ||
* Clone the matrix | ||
*/ | ||
@@ -9,0 +4,0 @@ export function matrixClone(matrix: any[]): any[] { |
@@ -5,2 +5,3 @@ import { Matrix } from 'ml-matrix'; | ||
import { xCorrelation } from '../x/xCorrelation'; | ||
/** | ||
@@ -7,0 +8,0 @@ * Calculates a correlation matrix based on the columns of the initial matrix |
@@ -71,10 +71,12 @@ import { DataXY } from 'cheminfo-types'; | ||
if (options.min === undefined) { | ||
options.min = logBaseX | ||
? Math.log(minMax.min as number) / Math.log(logBaseX) | ||
: minMax.min; | ||
options.min = | ||
logBaseX && minMax.min | ||
? Math.log(minMax.min) / Math.log(logBaseX) | ||
: minMax.min; | ||
} | ||
if (options.max === undefined) { | ||
options.max = logBaseX | ||
? Math.log(minMax.max as number) / Math.log(logBaseX) | ||
: minMax.max; | ||
options.max = | ||
logBaseX && minMax.max | ||
? Math.log(minMax.max) / Math.log(logBaseX) | ||
: minMax.max; | ||
} | ||
@@ -81,0 +83,0 @@ } |
@@ -5,3 +5,3 @@ import { matrixClone } from './matrixClone'; | ||
* Numerically decodes the matrix using the dictionnary | ||
* @param array - original matrix before encoding | ||
* @param matrixInitial - original matrix before encoding | ||
* @param dictionnary - dictionary against which to do the encoding | ||
@@ -8,0 +8,0 @@ * @returns - decoded matrix |
@@ -6,2 +6,3 @@ import { matrixClone } from './matrixClone'; | ||
* @param matrix - original matrix before encoding | ||
* @param dictCategoricalToNumerical - dictionnary for encoding | ||
* @returns - dictionnary from string to number | ||
@@ -23,3 +24,3 @@ */ | ||
if (typeof matrix[i][j] === 'number' && matrix[i][j] > k) { | ||
k = matrix[i][j] as number; | ||
k = matrix[i][j]; | ||
} | ||
@@ -26,0 +27,0 @@ } |
@@ -13,5 +13,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param matrix - matrix [rows][cols]. | ||
* @param options Options | ||
* data: Normalized dataset. | ||
* medianOfQuotients: The median of quotients of each variables. | ||
* @param options - options | ||
* @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables} | ||
*/ | ||
@@ -18,0 +17,0 @@ export function matrixPQN( |
@@ -1,3 +0,1 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { DataReIm } from '../index'; | ||
@@ -8,6 +6,6 @@ | ||
* | ||
* @param data - DATA | ||
* @returns - array of float | ||
* @param data - complex spectrum | ||
* @returns - reimAbsolute value | ||
*/ | ||
export function reimAbsolute(data: DataReIm): DoubleArray { | ||
export function reimAbsolute(data: DataReIm): Float64Array { | ||
const length = data.re.length; | ||
@@ -14,0 +12,0 @@ const re = data.re; |
@@ -13,4 +13,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @param data - complex spectrum | ||
* @param options - options | ||
*/ | ||
@@ -17,0 +17,0 @@ |
@@ -10,5 +10,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param data - DataReim. | ||
* @param options - Options. | ||
* @returns DataReim. | ||
* @param data - complex spectrum | ||
* @param options - options. | ||
* @returns FFT of complex spectrum. | ||
*/ | ||
@@ -15,0 +15,0 @@ export function reimFFT( |
@@ -6,3 +6,3 @@ import { DataReIm } from '..'; | ||
* | ||
* @param data DataReIm | ||
* @param data - complex spectrum | ||
* @param phi0 - Angle in radians for zero order phase correction | ||
@@ -9,0 +9,0 @@ * @param phi1 - Angle in radians for first order phase correction |
@@ -7,2 +7,7 @@ function assertNumber(number: number) { | ||
/** | ||
* Function for comparing numbers and sorting them in ascending order | ||
* | ||
* @param options - options | ||
*/ | ||
export function numberSortAscending(left: number, right: number) { | ||
@@ -23,2 +28,7 @@ assertNumber(left); | ||
/** | ||
* Function for comparing numbers and sorting them in descending order | ||
* | ||
* @param options - options | ||
*/ | ||
export function numberSortDescending(left: number, right: number) { | ||
@@ -25,0 +35,0 @@ assertNumber(left); |
/** | ||
* RayleighCdf. | ||
* | ||
* @param x - Number. | ||
* @param sigma - Number. | ||
* @returns Number. | ||
* @param x - data | ||
* @param sigma - standard deviation | ||
* @returns - rayleigh cdf | ||
*/ | ||
@@ -8,0 +8,0 @@ export default function rayleighCdf(x: number, sigma = 1): number { |
@@ -6,4 +6,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - array of number | ||
* @returns - absolute array | ||
* @param array - array of data | ||
* @returns - array with absolute values | ||
*/ | ||
@@ -10,0 +10,0 @@ export function xAbsolute(array: DoubleArray): DoubleArray { |
@@ -9,3 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - the array for which we want to calculate the absolute value | ||
* @returns - median | ||
@@ -12,0 +12,0 @@ */ |
@@ -7,4 +7,4 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array2 - the second array | ||
* @param array1 - the first array | ||
* @param array2 - the second array or number | ||
*/ | ||
@@ -14,3 +14,3 @@ export function xAdd( | ||
array2: DoubleArray | number, | ||
): DoubleArray { | ||
): Float64Array { | ||
let isConstant = false; | ||
@@ -24,6 +24,5 @@ let constant = 0; | ||
isConstant = true; | ||
constant = Number(array2); | ||
constant = array2 as number; | ||
} | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -30,0 +29,0 @@ if (isConstant) { |
@@ -6,5 +6,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the auto-correlation of a vector | ||
* Calculates the auto-correlation of an array | ||
* | ||
* @param A - the array that will be fixed | ||
* @param A - the array for which to calculate the auto-correlation | ||
* @param options - Options | ||
@@ -11,0 +11,0 @@ */ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* This function xSubtract the first array by the second array or a constant value from each element of the first array | ||
* Calculating the box plot of the array | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - data | ||
*/ | ||
@@ -8,0 +8,0 @@ export function xBoxPlot(array: DoubleArray) { |
@@ -1,10 +0,10 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
/** | ||
* Checks if input is valdi | ||
* Checks if input is of type array | ||
* | ||
* @param input - input | ||
*/ | ||
export function xCheck(input?: DoubleArray | Uint16Array) { | ||
export function xCheck(input?: NumberArray) { | ||
if (!isAnyArray(input)) { | ||
@@ -11,0 +11,0 @@ throw new TypeError('input must be an array'); |
@@ -7,3 +7,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param A - the array that will be rotated | ||
* @param A - first array | ||
* @param B - sencond array | ||
@@ -10,0 +10,0 @@ */ |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Calculates the cross-correlation between 2 vectors | ||
* Calculates the cross-correlation between 2 arrays | ||
* | ||
@@ -28,3 +28,3 @@ * @param A - fixed array | ||
} = {}, | ||
): DoubleArray { | ||
): Float64Array { | ||
let { tau = 1, lag = A.length - 1 } = options; | ||
@@ -31,0 +31,0 @@ let result = new Float64Array(1 + (2 * lag) / tau); |
@@ -7,5 +7,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - DoubleArray | ||
* @param array - initial array | ||
*/ | ||
export function xCumulative(array: DoubleArray): DoubleArray { | ||
export function xCumulative(array: DoubleArray): Float64Array { | ||
if (!isAnyArray(array)) { | ||
@@ -12,0 +12,0 @@ throw new TypeError('input must be an array'); |
@@ -7,7 +7,10 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array or number | ||
* | ||
*/ | ||
export function xDivide(array1: DoubleArray, array2: DoubleArray | number) { | ||
export function xDivide( | ||
array1: DoubleArray, | ||
array2: DoubleArray | number, | ||
): Float64Array { | ||
let isConstant = false; | ||
@@ -24,3 +27,2 @@ let constant = 0; | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -27,0 +29,0 @@ if (isConstant) { |
@@ -6,3 +6,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* XDotProduct. | ||
* Dot product between two arrays | ||
* | ||
@@ -9,0 +9,0 @@ * @param A - First array. |
import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
@@ -11,3 +11,3 @@ import { xAbsolute } from './xAbsolute'; | ||
/** | ||
* Calculates an histogram of defined number of slots | ||
* Calculates a histogram of defined number of slots | ||
* | ||
@@ -86,7 +86,9 @@ * @param array - Array containing values | ||
histogram === undefined | ||
? createXArray({ | ||
from: min + (centerX ? slotSize / 2 : 0), | ||
to: max - (centerX ? slotSize / 2 : 0), | ||
length: nbSlots, | ||
}) | ||
? Array.from( | ||
createFromToArray({ | ||
from: min + (centerX ? slotSize / 2 : 0), | ||
to: max - (centerX ? slotSize / 2 : 0), | ||
length: nbSlots, | ||
}), | ||
) | ||
: histogram.x; | ||
@@ -93,0 +95,0 @@ |
import { DoubleArray } from 'cheminfo-types'; | ||
/** | ||
* Check if the values are separated by always the same difference | ||
* Check if the values are separated always by the same difference | ||
* | ||
@@ -6,0 +6,0 @@ * @param array - Monotone growing array of number |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -8,5 +8,5 @@ import { xCheck } from './xCheck'; | ||
* @param array - array of numbers | ||
* @returns - indexe | ||
* @returns - index | ||
*/ | ||
export function xMaxIndex(array: DoubleArray | Uint16Array): number { | ||
export function xMaxIndex(array: NumberArray): number { | ||
xCheck(array); | ||
@@ -13,0 +13,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -8,7 +8,7 @@ import { xCheck } from './xCheck'; | ||
* | ||
* @param array - array of number | ||
* @param array - array of numbers | ||
* @param options - options | ||
*/ | ||
export function xMaxValue( | ||
array: DoubleArray | Uint16Array, | ||
array: NumberArray, | ||
options: { | ||
@@ -15,0 +15,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -6,3 +6,3 @@ import { xCheck } from './xCheck'; | ||
/** | ||
* Computes the maximal value of an array of values | ||
* Computes the mean value of an array of values | ||
* | ||
@@ -13,3 +13,3 @@ * @param array - array of numbers | ||
export function xMean( | ||
array: DoubleArray | Uint16Array, | ||
array: NumberArray, | ||
options: { | ||
@@ -16,0 +16,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
@@ -12,3 +12,3 @@ import quickSelectMedian from 'median-quickselect'; | ||
export function xMedian(input: DoubleArray | Uint16Array) { | ||
export function xMedian(input: NumberArray) { | ||
if (!isAnyArray(input)) { | ||
@@ -15,0 +15,0 @@ throw new TypeError('input must be an array'); |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -10,3 +10,3 @@ import { xCheck } from './xCheck'; | ||
*/ | ||
export function xMinIndex(array: DoubleArray | Uint16Array): number { | ||
export function xMinIndex(array: NumberArray): number { | ||
xCheck(array); | ||
@@ -13,0 +13,0 @@ let minIndex = 0; |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -11,3 +11,3 @@ import { xCheck } from './xCheck'; | ||
*/ | ||
export function xMinMaxValues(array: DoubleArray | Uint16Array): { | ||
export function xMinMaxValues(array: NumberArray): { | ||
min: number; | ||
@@ -14,0 +14,0 @@ max: number; |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -12,3 +12,3 @@ import { xCheck } from './xCheck'; | ||
export function xMinValue( | ||
array: DoubleArray | Uint16Array, | ||
array: NumberArray, | ||
options: { | ||
@@ -15,0 +15,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -10,3 +10,3 @@ /** | ||
export function xMode(input: DoubleArray | Uint16Array) { | ||
export function xMode(input: NumberArray) { | ||
if (input.length === 0) { | ||
@@ -13,0 +13,0 @@ throw new TypeError('input must not be empty'); |
@@ -7,3 +7,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array1 - the array that will be rotated | ||
* @param array1 - first array | ||
* @param array2 - second array | ||
@@ -14,3 +14,3 @@ */ | ||
array2: DoubleArray | number, | ||
): DoubleArray { | ||
): Float64Array { | ||
let isConstant = false; | ||
@@ -17,0 +17,0 @@ let constant = 0; |
import { DataXY, FromTo, DoubleArray } from 'cheminfo-types'; | ||
import SplineInterpolator from 'spline-interpolator'; | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
@@ -453,3 +453,3 @@ import erfcinv from './erfcinv'; | ||
const xAxis = createXArray({ | ||
const xAxis = createFromToArray({ | ||
from: 0, | ||
@@ -456,0 +456,0 @@ to: array.length - 1, |
@@ -7,3 +7,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xNorm([3, 4]) -> 5 | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @returns - calculated norm | ||
@@ -10,0 +10,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
@@ -15,3 +15,3 @@ | ||
export function xNormed( | ||
input: DoubleArray | Uint16Array, | ||
input: NumberArray, | ||
options: { | ||
@@ -31,3 +31,3 @@ /** value by which to divide the data | ||
/** output into which the result should be placed if needed */ | ||
output?: DoubleArray | Uint16Array; | ||
output?: NumberArray; | ||
} = {}, | ||
@@ -85,3 +85,3 @@ ) { | ||
function absoluteSum(input: DoubleArray | Uint16Array) { | ||
function absoluteSum(input: NumberArray) { | ||
let sumValue = 0; | ||
@@ -88,0 +88,0 @@ for (let i = 0; i < input.length; i++) { |
@@ -7,4 +7,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* This function pads an array | ||
* | ||
* | ||
*s | ||
* @param array - the array that will be padded | ||
@@ -32,3 +31,3 @@ * @param options - options | ||
} = {}, | ||
): DoubleArray { | ||
): Float64Array { | ||
const { size = 0, value = 0, algorithm = '' } = options; | ||
@@ -35,0 +34,0 @@ xCheck(array); |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
@@ -15,6 +15,6 @@ | ||
export function xRescale( | ||
input: DoubleArray | Uint16Array, | ||
input: NumberArray, | ||
options: { | ||
/** output into which to placed the data */ | ||
output?: DoubleArray | Uint16Array; | ||
output?: NumberArray; | ||
/** min used for the scaling */ | ||
@@ -21,0 +21,0 @@ min?: number; |
@@ -5,7 +5,8 @@ import { DoubleArray } from 'cheminfo-types'; | ||
import { xPadding } from './xPadding'; | ||
/** | ||
* This function calculates a rolling average | ||
* | ||
* @param array - the array that will be rotated | ||
* @param fct - callback function that from an array returns a value. | ||
* @param array - array | ||
* @param fct - callback function that from an array returns a value | ||
* @param options - options | ||
@@ -54,7 +55,3 @@ */ | ||
for (let i = 0; i < array.length - window + 1; i++) { | ||
let subArray = new Float64Array( | ||
(array as Float64Array).buffer, | ||
i * 8, | ||
window, | ||
); | ||
let subArray = new Float64Array(array.buffer, i * 8, window); | ||
// we will send a view to the original buffer | ||
@@ -61,0 +58,0 @@ newArray.push(fct(subArray)); |
@@ -9,3 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - option | ||
@@ -12,0 +12,0 @@ */ |
@@ -9,3 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -9,3 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -9,3 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - the array that will be rotated | ||
* @param array - array | ||
* @param options - options | ||
@@ -12,0 +12,0 @@ */ |
@@ -9,5 +9,5 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @example xRotate([1,2,3,4],-1) -> [2,3,4,1] | ||
* @param array - the array that will be rotated | ||
* @param shift - number | ||
* @returns - array of float | ||
* @param array - array | ||
* @param shift - shift | ||
* @returns - rotated array | ||
*/ | ||
@@ -14,0 +14,0 @@ export function xRotate(array: DoubleArray, shift: number): DoubleArray { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray, DoubleArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
@@ -13,4 +13,3 @@ | ||
input: | ||
| DoubleArray | ||
| Uint16Array | ||
| NumberArray | ||
| { | ||
@@ -17,0 +16,0 @@ /** first value in the array |
import { DoubleArray } from 'cheminfo-types'; | ||
/** Function that sorts arrays or Float64Arrays in ascending order | ||
* | ||
* @param array - array to sort | ||
@@ -11,3 +12,3 @@ * @returns sorted array | ||
} else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? 1 : -1)); | ||
return array.sort((a, b) => a - b); | ||
} | ||
@@ -17,2 +18,3 @@ } | ||
/** Function that sorts arrays or Float64Arrays in descending order | ||
* | ||
* @param array - array to sort | ||
@@ -25,4 +27,4 @@ * @returns sorted array | ||
} else if (array instanceof Array) { | ||
return array.sort((a, b) => (a > b ? -1 : 1)); | ||
return array.sort((a, b) => b - a); | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -11,7 +11,4 @@ import { xVariance } from './xVariance'; | ||
*/ | ||
export function xStandardDeviation( | ||
values: DoubleArray | Uint16Array, | ||
options = {}, | ||
) { | ||
export function xStandardDeviation(values: NumberArray, options = {}) { | ||
return Math.sqrt(xVariance(values, options)); | ||
} |
@@ -9,2 +9,3 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* @param array2 - second array or number | ||
* @returns array after subtraction | ||
*/ | ||
@@ -14,3 +15,3 @@ export function xSubtract( | ||
array2: DoubleArray | number, | ||
): DoubleArray { | ||
): Float64Array { | ||
let isConstant = false; | ||
@@ -27,3 +28,2 @@ let constant = 0; | ||
// Changed from Array to Float64Array | ||
let array3 = new Float64Array(array1.length); | ||
@@ -30,0 +30,0 @@ if (isConstant) { |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
@@ -13,3 +13,3 @@ import { xCheck } from './xCheck'; | ||
export function xSum( | ||
array: DoubleArray | Uint16Array, | ||
array: NumberArray, | ||
options: { | ||
@@ -16,0 +16,0 @@ /** |
@@ -6,7 +6,7 @@ import { DoubleArray } from 'cheminfo-types'; | ||
* | ||
* @param array - Array of number. | ||
* @returns - Sorted array. | ||
* @param array - array of numbers | ||
* @returns - sorted array | ||
*/ | ||
export function xUniqueSorted(array: DoubleArray): DoubleArray { | ||
export function xUniqueSorted(array: DoubleArray): Float64Array { | ||
return Float64Array.from(new Set(array)).sort(); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { DoubleArray } from 'cheminfo-types'; | ||
import { NumberArray } from 'cheminfo-types'; | ||
import { isAnyArray } from 'is-any-array'; | ||
@@ -10,5 +10,6 @@ | ||
* @param options - options | ||
* @returns variance | ||
*/ | ||
export function xVariance( | ||
values: DoubleArray | Uint16Array, | ||
values: NumberArray, | ||
options: { | ||
@@ -15,0 +16,0 @@ /** Unbiased option |
@@ -5,4 +5,4 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @returns - sorted array | ||
*/ | ||
@@ -9,0 +9,0 @@ export function xreimSortX(data: DataXReIm): DataXReIm { |
@@ -6,5 +6,5 @@ import { DataXReIm } from '..'; | ||
* | ||
* @param data - Object of kind {x:[], re:[], im:[]}. | ||
* @param totalLength - Final number of points. | ||
* @returns - Data. | ||
* @param data - object of kind {x:[], re:[], im:[]} | ||
* @param totalLength - final number of points | ||
* @returns - data. | ||
*/ | ||
@@ -11,0 +11,0 @@ export function xreimZeroFilling( |
@@ -8,3 +8,9 @@ import { isAnyArray } from 'is-any-array'; | ||
*/ | ||
export function xyCheck(data: any, options: { minLength?: number } = {}) { | ||
export function xyCheck( | ||
data: any, | ||
options: { | ||
/** minimum length */ | ||
minLength?: number; | ||
} = {}, | ||
) { | ||
const { minLength } = options; | ||
@@ -11,0 +17,0 @@ if (typeof data !== 'object' || !isAnyArray(data.x) || !isAnyArray(data.y)) { |
@@ -9,3 +9,2 @@ import { DataXY } from 'cheminfo-types'; | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
*/ | ||
@@ -12,0 +11,0 @@ export function xyEnsureGrowingX(data: DataXY): DataXY { |
import { DataXY } from 'cheminfo-types'; | ||
import { createXArray } from '../utils/createXArray'; | ||
import { createFromToArray } from '../utils/createFromToArray'; | ||
import { zoneCheck } from '../zone/zoneCheck'; | ||
@@ -35,3 +35,2 @@ import { zonesInvert } from '../zones/zonesInvert'; | ||
export function xyEquallySpaced( | ||
/** points */ | ||
arrayXY: DataXY, | ||
@@ -167,9 +166,11 @@ options: { | ||
return { | ||
x: createXArray({ | ||
from, | ||
to, | ||
length: numberOfPoints, | ||
}), | ||
x: Array.from( | ||
createFromToArray({ | ||
from, | ||
to, | ||
length: numberOfPoints, | ||
}), | ||
), | ||
y: output, | ||
}; | ||
} |
@@ -17,3 +17,6 @@ import { DataXY } from 'cheminfo-types'; | ||
data: DataXY, | ||
options: { zones?: Zone[] } = {}, | ||
options: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
} = {}, | ||
): DataXY { | ||
@@ -20,0 +23,0 @@ xyCheck(data); |
@@ -7,4 +7,4 @@ import { DataXY } from 'cheminfo-types'; | ||
* | ||
* @param points | ||
* @param options | ||
* @param points - points | ||
* @param options - options | ||
* @return filtered array | ||
@@ -14,3 +14,2 @@ */ | ||
export function xyFilterX( | ||
/** points */ | ||
points: DataXY, | ||
@@ -17,0 +16,0 @@ options: { |
import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* Order object of array, x has to be monotone. | ||
* Ensure x is growing | ||
* Order object of array, x has to be monotone. Ensure x is growing | ||
* | ||
@@ -6,0 +6,0 @@ * @param data - Object of kind {x:[], y:[]}. |
@@ -6,2 +6,3 @@ import { DataXY } from 'cheminfo-types'; | ||
import { xyCheck } from './xyCheck'; | ||
/** | ||
@@ -8,0 +9,0 @@ * Generate a X / Y of the xyIntegral |
import { DataXY } from 'cheminfo-types'; | ||
import { xyCheck } from './xyCheck'; | ||
/** | ||
@@ -5,0 +6,0 @@ * Join x / y values when difference in X is closer than delta. |
import { DataXY } from 'cheminfo-types'; | ||
import { xyCheck } from './xyCheck'; | ||
/** | ||
@@ -9,4 +10,4 @@ * Finds all the max values | ||
* | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array). | ||
* @returns - Array of points. | ||
* @param data - Object that contains property x (an ordered increasing array) and y (an array) | ||
* @returns - Array of points | ||
*/ | ||
@@ -13,0 +14,0 @@ export function xyMaximaY(data: DataXY) { |
@@ -13,3 +13,2 @@ import { DataXY } from 'cheminfo-types'; | ||
*/ | ||
export function xyMaxYPoint( | ||
@@ -16,0 +15,0 @@ data: DataXY, |
@@ -5,5 +5,6 @@ import { DataXY } from 'cheminfo-types'; | ||
* Merge abscissa values if the ordinate value is in a list of centroids | ||
* @param points | ||
* @param centroids | ||
* @param options | ||
* | ||
* @param points - points | ||
* @param centroids - centroids | ||
* @param options - options | ||
* @return merged points | ||
@@ -10,0 +11,0 @@ */ |
@@ -8,3 +8,2 @@ import { DoubleArray, DataXY } from 'cheminfo-types'; | ||
* This function calculates a rolling average. | ||
* | ||
* This methods will recalculate the x values by using xRollingAverage | ||
@@ -11,0 +10,0 @@ * |
@@ -17,3 +17,8 @@ import { DataXY } from 'cheminfo-types'; | ||
data: DataXY, | ||
options: { zones?: Zone[]; value?: number } = {}, | ||
options: { | ||
/** zones */ | ||
zones?: Zone[]; | ||
/** data contains x and y values */ | ||
value?: number; | ||
} = {}, | ||
): DataXY { | ||
@@ -20,0 +25,0 @@ xyCheck(data); |
@@ -13,3 +13,2 @@ import { DataXY } from 'cheminfo-types'; | ||
// no need to sort if it is already sorted | ||
if (xIsMonotone(x) && x.length > 1) { | ||
@@ -16,0 +15,0 @@ if (x[0] < x[1]) { |
@@ -8,3 +8,3 @@ import { DataXY } from 'cheminfo-types'; | ||
/** | ||
*XyToXYObject. | ||
* XyToXYObject. | ||
* | ||
@@ -11,0 +11,0 @@ * @param data - Array of points {x,y}. |
@@ -1,2 +0,2 @@ | ||
import { DataXY } from 'cheminfo-types'; | ||
import { DataXY, NumberArray } from 'cheminfo-types'; | ||
@@ -78,7 +78,3 @@ import { Point } from '..'; | ||
*/ | ||
function nextValue( | ||
data: DataXY[], | ||
positions: number[] | Float64Array | Uint16Array, | ||
point: Point, | ||
) { | ||
function nextValue(data: DataXY[], positions: NumberArray, point: Point) { | ||
let minIndex = 0; | ||
@@ -85,0 +81,0 @@ let minX = data[0].x[positions[0]]; |
@@ -7,6 +7,4 @@ import { Point } from '..'; | ||
/** | ||
* | ||
* Filter the array by taking the higher points (max y value) and only. | ||
* Keep one per slot. | ||
* There are 2 different slots, the smallest one will have the | ||
* Keep one per slot. There are 2 different slots, the smallest one will have the | ||
* new property `close` to true | ||
@@ -39,3 +37,4 @@ * | ||
threshold?: number; | ||
/**@default 50 */ | ||
/** number of slots | ||
* @default 50 */ | ||
numberCloseSlots?: number; | ||
@@ -42,0 +41,0 @@ /** |
import { Point } from '..'; | ||
/** | ||
* | ||
* xyObjectJoinX. | ||
@@ -6,0 +5,0 @@ * |
import { Point } from '..'; | ||
/** | ||
* | ||
* XyObjectSlotX | ||
@@ -6,0 +5,0 @@ * |
@@ -6,3 +6,2 @@ import { DataXY } from 'cheminfo-types'; | ||
/** | ||
* | ||
* XyObjectToXY. | ||
@@ -9,0 +8,0 @@ * |
@@ -10,3 +10,2 @@ import { zonesNormalize } from './zonesNormalize'; | ||
*/ | ||
export function zonesInvert( | ||
@@ -13,0 +12,0 @@ exclusions: { |
@@ -10,3 +10,2 @@ /** | ||
*/ | ||
export function zonesNormalize( | ||
@@ -13,0 +12,0 @@ zones: { |
@@ -11,3 +11,2 @@ import { zonesNormalize } from './zonesNormalize'; | ||
*/ | ||
export function zonesWithPoints( | ||
@@ -14,0 +13,0 @@ zones: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1116031
1238
21670
+ Addedcheminfo-types@0.10.1(transitive)
- Removedcheminfo-types@0.9.1(transitive)
Updatedcheminfo-types@^0.10.1